@mappedin/mappedin-js 1.71.20 → 1.71.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builds/mappedin-node.js +1 -1
- package/builds/mappedin.js +9 -9
- package/modules/{Arrival-0896c72c.js → Arrival-e86ea5dc.js} +0 -0
- package/modules/{Chalet-b94e55b8.js → Chalet-137f12bb.js} +0 -0
- package/modules/{HelveticaNeue-a4e74660.js → HelveticaNeue-ea120ced.js} +0 -0
- package/modules/{Helvetiker-2556754b.js → Helvetiker-ffae7b02.js} +0 -0
- package/modules/{Lato-bb34ded3.js → Lato-f915eb25.js} +0 -0
- package/modules/Mappedin-modules.js +2 -2
- package/modules/Mappedin.MapView2D.js +1 -1
- package/modules/{Mappedin.MapView3D-1b91409b.js → Mappedin.MapView3D-40e6ca02.js} +4 -4
- package/modules/Mappedin.MapView3D.bundle.js +4 -4
- package/modules/Mappedin.MapView3D.js +1 -1
- package/modules/{Mappedin.MapboxOutdoorContext-5001db81.js → Mappedin.MapboxOutdoorContext-301b127b.js} +1 -1
- package/modules/Mappedin.MultiFloorView.d.ts +2 -1
- package/modules/Mappedin.Navigator.d.ts +4 -0
- package/modules/{MyriadPro-27b43c00.js → MyriadPro-3644cd34.js} +0 -0
- package/modules/{ProximaNova-2380a0ae.js → ProximaNova-936916c0.js} +0 -0
- package/modules/{SimonCircular-fd78eb8a.js → SimonCircular-a6f2f573.js} +0 -0
- package/package.json +1 -1
package/builds/mappedin-node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Mappedin=e():t.Mappedin=e()}(global,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=101)}([function(t,e,n){var r=n(31)("wks"),i=n(22),o=n(2).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(2),i=n(15),o=n(12),a=n(11),s=n(16),c=function(t,e,n){var u,l,h,p,d=t&c.F,f=t&c.G,m=t&c.S,v=t&c.P,g=t&c.B,y=f?r:m?r[e]||(r[e]={}):(r[e]||{}).prototype,x=f?i:i[e]||(i[e]={}),b=x.prototype||(x.prototype={});for(u in f&&(n=e),n)h=((l=!d&&y&&void 0!==y[u])?y:n)[u],p=g&&l?s(h,r):v&&"function"==typeof h?s(Function.call,h):h,y&&a(y,u,h,t&c.U),x[u]!=h&&o(x,u,p),v&&b[u]!=h&&(b[u]=h)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(6);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=require("stream")},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(3),i=n(56),o=n(32),a=Object.defineProperty;e.f=n(8)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(71),i=n(18);t.exports=function(t){return r(i(t))}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(2),i=n(12),o=n(13),a=n(22)("src"),s=n(102),c=(""+s).split("toString");n(15).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(t,e,n){var r=n(7),i=n(23);t.exports=n(8)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports=require("zlib")},function(t,e){var n=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(24);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(40),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";n.d(e,"c",(function(){return al})),n.d(e,"a",(function(){return sl})),n.d(e,"b",(function(){return cl}));n(70),n(132),n(94),n(78),n(47),n(48),n(134),n(135),n(50),n(91),n(38),n(53),n(93),n(90),n(89);var r=n(98),i=n.n(r);const o=new Uint8Array(256);let a=o.length;function s(){return a>o.length-16&&(i.a.randomFillSync(o),a=0),o.slice(a,a+=16)}var c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var u=function(t){return"string"==typeof t&&c.test(t)};const l=[];for(let t=0;t<256;++t)l.push((t+256).toString(16).substr(1));var h=function(t,e=0){const n=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!u(n))throw TypeError("Stringified UUID is invalid");return n};var p=function(t,e,n){const r=(t=t||{}).random||(t.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return h(r)};void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");const e=Object(t);for(let t=1;t<arguments.length;t++){const n=arguments[t];if(null!=n)for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e});function d(){}Object.assign(d.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)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(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)}}}});for(var f=[],m=0;m<256;m++)f[m]=(m<16?"0":"")+m.toString(16);var v,g={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(f[255&t]+f[t>>8&255]+f[t>>16&255]+f[t>>24&255]+"-"+f[255&e]+f[e>>8&255]+"-"+f[e>>16&15|64]+f[e>>24&255]+"-"+f[63&n|128]+f[n>>8&255]+"-"+f[n>>16&255]+f[n>>24&255]+f[255&r]+f[r>>8&255]+f[r>>16&255]+f[r>>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:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?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*g.DEG2RAD},radToDeg:function(t){return t*g.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))},setQuaternionFromProperEuler:function(t,e,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),c=a(n/2),u=o((e+r)/2),l=a((e+r)/2),h=o((e-r)/2),p=a((e-r)/2),d=o((r-e)/2),f=a((r-e)/2);switch(i){case"XYX":t.set(s*l,c*h,c*p,s*u);break;case"YZY":t.set(c*p,s*l,c*h,s*u);break;case"ZXZ":t.set(c*h,c*p,s*l,s*u);break;case"XZX":t.set(s*l,c*f,c*d,s*u);break;case"YXY":t.set(c*d,s*l,c*f,s*u);break;case"ZYZ":t.set(c*f,c*d,s*l,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};function y(t,e){this.x=t||0,this.y=e||0}function x(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(y.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(y.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("THREE.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("THREE.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(){return Math.atan2(-this.y,-this.x)+Math.PI},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.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this},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("THREE.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},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(x.prototype,{isMatrix3:!0,set:function(t,e,n,r,i,o,a,s,c){var u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=e,u[4]=i,u[5]=s,u[6]=n,u[7]=o,u[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},extractBasis:function(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),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},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],u=n[4],l=n[7],h=n[2],p=n[5],d=n[8],f=r[0],m=r[3],v=r[6],g=r[1],y=r[4],x=r[7],b=r[2],M=r[5],w=r[8];return i[0]=o*f+a*g+s*b,i[3]=o*m+a*y+s*M,i[6]=o*v+a*x+s*w,i[1]=c*f+u*g+l*b,i[4]=c*m+u*y+l*M,i[7]=c*v+u*x+l*w,i[2]=h*f+p*g+d*b,i[5]=h*m+p*y+d*M,i[8]=h*v+p*x+d*w,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],u=t[8];return e*o*u-e*a*c-n*i*u+n*a*s+r*i*c-r*o*s},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=t.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],c=n[4],u=n[5],l=n[6],h=n[7],p=n[8],d=p*c-u*h,f=u*l-p*s,m=h*s-c*l,v=i*d+o*f+a*m;if(0===v)return this.set(0,0,0,0,0,0,0,0,0);var g=1/v;return r[0]=d*g,r[1]=(a*h-p*o)*g,r[2]=(u*o-a*c)*g,r[3]=f*g,r[4]=(p*i-a*l)*g,r[5]=(a*s-u*i)*g,r[6]=m*g,r[7]=(o*l-h*i)*g,r[8]=(c*i-o*s)*g,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],u=r[7];return r[0]=e*i+n*s,r[3]=e*o+n*c,r[6]=e*a+n*u,r[1]=-n*i+e*s,r[4]=-n*o+e*c,r[7]=-n*a+e*u,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 b={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===v&&(v=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),v.width=t.width,v.height=t.height;var n=v.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=v}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},M=0;function w(t,e,n,r,i,o,a,s,c,u){Object.defineProperty(this,"id",{value:M++}),this.uuid=g.generateUUID(),this.name="",this.image=void 0!==t?t:w.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:w.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==r?r:1001,this.magFilter=void 0!==i?i:1006,this.minFilter=void 0!==o?o:1008,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:1023,this.internalFormat=null,this.type=void 0!==s?s:1009,this.offset=new y(0,0),this.repeat=new y(1,1),this.center=new y(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new x,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:3e3,this.version=0,this.onUpdate=null}function _(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function S(t,e,n){this.width=t,this.height=e,this.scissor=new _(0,0,t,e),this.scissorTest=!1,this.viewport=new _(0,0,t,e),n=n||{},this.texture=new w(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,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 E(t,e,n){S.call(this,t,e,n),this.samples=4}function T(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}w.DEFAULT_IMAGE=void 0,w.DEFAULT_MAPPING=300,w.prototype=Object.assign(Object.create(d.prototype),{constructor:w,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){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=g.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o<a;o++)i.push(b.getDataURL(r[o]))}else i=b.getDataURL(r);t.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(w.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(_.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(_.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("THREE.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("THREE.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],u=o[1],l=o[5],h=o[9],p=o[2],d=o[6],f=o[10];if(Math.abs(s-u)<.01&&Math.abs(c-p)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+u)<.1&&Math.abs(c+p)<.1&&Math.abs(h+d)<.1&&Math.abs(a+l+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,v=(l+1)/2,g=(f+1)/2,y=(s+u)/4,x=(c+p)/4,b=(h+d)/4;return m>v&&m>g?m<.01?(n=0,r=.707106781,i=.707106781):(r=y/(n=Math.sqrt(m)),i=x/n):v>g?v<.01?(n=.707106781,r=0,i=.707106781):(n=y/(r=Math.sqrt(v)),i=b/r):g<.01?(n=.707106781,r=.707106781,i=0):(n=x/(i=Math.sqrt(g)),r=b/i),this.set(n,r,i,e),this}var M=Math.sqrt((d-h)*(d-h)+(c-p)*(c-p)+(u-s)*(u-s));return Math.abs(M)<.001&&(M=1),this.x=(d-h)/M,this.y=(c-p)/M,this.z=(u-s)/M,this.w=Math.acos((a+l+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 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.w=Math.max(t,Math.min(e,this.w)),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.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.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this},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("THREE.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},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}),S.prototype=Object.assign(Object.create(d.prototype),{constructor:S,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.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"})}}),E.prototype=Object.assign(Object.create(S.prototype),{constructor:E,isWebGLMultisampleRenderTarget:!0,copy:function(t){return S.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(T,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,o,a){var s=n[r+0],c=n[r+1],u=n[r+2],l=n[r+3],h=i[o+0],p=i[o+1],d=i[o+2],f=i[o+3];if(l!==f||s!==h||c!==p||u!==d){var m=1-a,v=s*h+c*p+u*d+l*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,v*g);m=Math.sin(m*b)/x,a=Math.sin(a*b)/x}var M=a*g;if(s=s*m+h*M,c=c*m+p*M,u=u*m+d*M,l=l*m+f*M,m===1-a){var w=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=w,c*=w,u*=w,l*=w}}t[e]=s,t[e+1]=c,t[e+2]=u,t[e+3]=l},multiplyQuaternionsFlat:function(t,e,n,r,i,o){var a=n[r],s=n[r+1],c=n[r+2],u=n[r+3],l=i[o],h=i[o+1],p=i[o+2],d=i[o+3];return t[e]=a*d+u*l+s*p-c*h,t[e+1]=s*d+u*h+c*l-a*p,t[e+2]=c*d+u*p+a*h-s*l,t[e+3]=u*d-a*l-s*h-c*p,t}}),Object.defineProperties(T.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(T.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("THREE.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),u=a(r/2),l=a(i/2),h=s(n/2),p=s(r/2),d=s(i/2);switch(o){case"XYZ":this._x=h*u*l+c*p*d,this._y=c*p*l-h*u*d,this._z=c*u*d+h*p*l,this._w=c*u*l-h*p*d;break;case"YXZ":this._x=h*u*l+c*p*d,this._y=c*p*l-h*u*d,this._z=c*u*d-h*p*l,this._w=c*u*l+h*p*d;break;case"ZXY":this._x=h*u*l-c*p*d,this._y=c*p*l+h*u*d,this._z=c*u*d+h*p*l,this._w=c*u*l-h*p*d;break;case"ZYX":this._x=h*u*l-c*p*d,this._y=c*p*l+h*u*d,this._z=c*u*d-h*p*l,this._w=c*u*l+h*p*d;break;case"YZX":this._x=h*u*l+c*p*d,this._y=c*p*l+h*u*d,this._z=c*u*d-h*p*l,this._w=c*u*l-h*p*d;break;case"XZY":this._x=h*u*l-c*p*d,this._y=c*p*l-h*u*d,this._z=c*u*d+h*p*l,this._w=c*u*l+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!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],u=n[2],l=n[6],h=n[10],p=r+s+h;return p>0?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(l-c)*e,this._y=(o-u)*e,this._z=(a-i)*e):r>s&&r>h?(e=2*Math.sqrt(1+r-s-h),this._w=(l-c)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+u)/e):s>h?(e=2*Math.sqrt(1+s-r-h),this._w=(o-u)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+h-r-s),this._w=(a-i)/e,this._x=(o+u)/e,this._y=(c+l)/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._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(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(g.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("THREE.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,u=e._w;return this._x=n*u+o*a+r*c-i*s,this._y=r*u+o*s+i*a-n*c,this._z=i*u+o*c+n*s-r*a,this._w=o*u-n*a-r*s-i*c,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*t._w+n*t._x+r*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var c=1-e;return this._w=c*o+e*this._w,this._x=c*n+e*this._x,this._y=c*r+e*this._y,this._z=c*i+e*this._z,this.normalize(),this._onChangeCallback(),this}var u=Math.sqrt(s),l=Math.atan2(u,a),h=Math.sin((1-e)*l)/u,p=Math.sin(e*l)/u;return this._w=o*h+this._w*p,this._x=n*h+this._x*p,this._y=r*h+this._y*p,this._z=i*h+this._z*p,this._onChangeCallback(),this},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},fromBufferAttribute:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var L=new P,A=new T;function P(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}Object.assign(P.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("THREE.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("THREE.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("THREE.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:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(A.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(A.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},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},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,u=s*n+a*e-i*r,l=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=c*s+h*-i+u*-a-l*-o,this.y=u*s+h*-o+l*-i-c*-a,this.z=l*s+h*-a+c*-o-u*-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.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this},cross:function(t,e){return void 0!==e?(console.warn("THREE.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.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return L.copy(this).projectOnVector(t),this.sub(L)},reflect:function(t){return this.sub(L.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(g.clamp(n,-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)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*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("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var R=new P,O=new j,N=new P(0,0,0),C=new P(1,1,1),I=new P,D=new P,z=new P;function j(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(j.prototype,{isMatrix4:!0,set:function(t,e,n,r,i,o,a,s,c,u,l,h,p,d,f,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=r,v[1]=i,v[5]=o,v[9]=a,v[13]=s,v[2]=c,v[6]=u,v[10]=l,v[14]=h,v[3]=p,v[7]=d,v[11]=f,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new j).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:function(t){var e=this.elements,n=t.elements,r=1/R.setFromMatrixColumn(t,0).length(),i=1/R.setFromMatrixColumn(t,1).length(),o=1/R.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){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,i=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var h=o*u,p=o*l,d=a*u,f=a*l;e[0]=s*u,e[4]=-s*l,e[8]=c,e[1]=p+d*c,e[5]=h-f*c,e[9]=-a*s,e[2]=f-h*c,e[6]=d+p*c,e[10]=o*s}else if("YXZ"===t.order){var m=s*u,v=s*l,g=c*u,y=c*l;e[0]=m+y*a,e[4]=g*a-v,e[8]=o*c,e[1]=o*l,e[5]=o*u,e[9]=-a,e[2]=v*a-g,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*u,v=s*l,g=c*u,y=c*l;e[0]=m-y*a,e[4]=-o*l,e[8]=g+v*a,e[1]=v+g*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){h=o*u,p=o*l,d=a*u,f=a*l;e[0]=s*u,e[4]=d*c-p,e[8]=h*c+f,e[1]=s*l,e[5]=f*c+h,e[9]=p*c-d,e[2]=-c,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var x=o*s,b=o*c,M=a*s,w=a*c;e[0]=s*u,e[4]=w-x*l,e[8]=M*l+b,e[1]=l,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=b*l+M,e[10]=x-w*l}else if("XZY"===t.order){x=o*s,b=o*c,M=a*s,w=a*c;e[0]=s*u,e[4]=-l,e[8]=c*u,e[1]=x*l+w,e[5]=o*u,e[9]=b*l-M,e[2]=M*l-b,e[6]=a*u,e[10]=w*l+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(N,t,C)},lookAt:function(t,e,n){var r=this.elements;return z.subVectors(t,e),0===z.lengthSq()&&(z.z=1),z.normalize(),I.crossVectors(n,z),0===I.lengthSq()&&(1===Math.abs(n.z)?z.x+=1e-4:z.z+=1e-4,z.normalize(),I.crossVectors(n,z)),I.normalize(),D.crossVectors(z,I),r[0]=I.x,r[4]=D.x,r[8]=z.x,r[1]=I.y,r[5]=D.y,r[9]=z.y,r[2]=I.z,r[6]=D.z,r[10]=z.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.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],u=n[1],l=n[5],h=n[9],p=n[13],d=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],x=n[11],b=n[15],M=r[0],w=r[4],_=r[8],S=r[12],E=r[1],T=r[5],L=r[9],A=r[13],P=r[2],R=r[6],O=r[10],N=r[14],C=r[3],I=r[7],D=r[11],z=r[15];return i[0]=o*M+a*E+s*P+c*C,i[4]=o*w+a*T+s*R+c*I,i[8]=o*_+a*L+s*O+c*D,i[12]=o*S+a*A+s*N+c*z,i[1]=u*M+l*E+h*P+p*C,i[5]=u*w+l*T+h*R+p*I,i[9]=u*_+l*L+h*O+p*D,i[13]=u*S+l*A+h*N+p*z,i[2]=d*M+f*E+m*P+v*C,i[6]=d*w+f*T+m*R+v*I,i[10]=d*_+f*L+m*O+v*D,i[14]=d*S+f*A+m*N+v*z,i[3]=g*M+y*E+x*P+b*C,i[7]=g*w+y*T+x*R+b*I,i[11]=g*_+y*L+x*O+b*D,i[15]=g*S+y*A+x*N+b*z,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},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],u=t[2],l=t[6],h=t[10],p=t[14];return t[3]*(+i*s*l-r*c*l-i*a*h+n*c*h+r*a*p-n*s*p)+t[7]*(+e*s*p-e*c*h+i*o*h-r*o*p+r*c*u-i*s*u)+t[11]*(+e*c*l-e*a*p-i*o*l+n*o*p+i*a*u-n*c*u)+t[15]*(-r*a*u-e*s*l+e*a*h+r*o*l-n*o*h+n*s*u)},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){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=t.elements,i=r[0],o=r[1],a=r[2],s=r[3],c=r[4],u=r[5],l=r[6],h=r[7],p=r[8],d=r[9],f=r[10],m=r[11],v=r[12],g=r[13],y=r[14],x=r[15],b=d*y*h-g*f*h+g*l*m-u*y*m-d*l*x+u*f*x,M=v*f*h-p*y*h-v*l*m+c*y*m+p*l*x-c*f*x,w=p*g*h-v*d*h+v*u*m-c*g*m-p*u*x+c*d*x,_=v*d*l-p*g*l-v*u*f+c*g*f+p*u*y-c*d*y,S=i*b+o*M+a*w+s*_;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var E=1/S;return n[0]=b*E,n[1]=(g*f*s-d*y*s-g*a*m+o*y*m+d*a*x-o*f*x)*E,n[2]=(u*y*s-g*l*s+g*a*h-o*y*h-u*a*x+o*l*x)*E,n[3]=(d*l*s-u*f*s-d*a*h+o*f*h+u*a*m-o*l*m)*E,n[4]=M*E,n[5]=(p*y*s-v*f*s+v*a*m-i*y*m-p*a*x+i*f*x)*E,n[6]=(v*l*s-c*y*s-v*a*h+i*y*h+c*a*x-i*l*x)*E,n[7]=(c*f*s-p*l*s+p*a*h-i*f*h-c*a*m+i*l*m)*E,n[8]=w*E,n[9]=(v*d*s-p*g*s-v*o*m+i*g*m+p*o*x-i*d*x)*E,n[10]=(c*g*s-v*u*s+v*o*h-i*g*h-c*o*x+i*u*x)*E,n[11]=(p*u*s-c*d*s-p*o*h+i*d*h+c*o*m-i*u*m)*E,n[12]=_*E,n[13]=(p*g*a-v*d*a+v*o*f-i*g*f-p*o*y+i*d*y)*E,n[14]=(v*u*a-c*g*a-v*o*l+i*g*l+c*o*y-i*u*y)*E,n[15]=(c*d*a-p*u*a+p*o*l-i*d*l-c*o*f+i*u*f)*E,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,u=i*a;return this.set(c*o+n,c*a-r*s,c*s+r*a,0,c*a+r*s,u*a+n,u*s-r*o,0,c*s-r*a,u*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,u=o+o,l=a+a,h=i*c,p=i*u,d=i*l,f=o*u,m=o*l,v=a*l,g=s*c,y=s*u,x=s*l,b=n.x,M=n.y,w=n.z;return r[0]=(1-(f+v))*b,r[1]=(p+x)*b,r[2]=(d-y)*b,r[3]=0,r[4]=(p-x)*M,r[5]=(1-(h+v))*M,r[6]=(m+g)*M,r[7]=0,r[8]=(d+y)*w,r[9]=(m-g)*w,r[10]=(1-(h+f))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},decompose:function(t,e,n){var r=this.elements,i=R.set(r[0],r[1],r[2]).length(),o=R.set(r[4],r[5],r[6]).length(),a=R.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],O.copy(this);var s=1/i,c=1/o,u=1/a;return O.elements[0]*=s,O.elements[1]*=s,O.elements[2]*=s,O.elements[4]*=c,O.elements[5]*=c,O.elements[6]*=c,O.elements[8]*=u,O.elements[9]*=u,O.elements[10]*=u,e.setFromRotationMatrix(O),n.x=i,n.y=o,n.z=a,this},makePerspective:function(t,e,n,r,i,o){void 0===o&&console.warn("THREE.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),u=(e+t)/(e-t),l=(n+r)/(n-r),h=-(o+i)/(o-i),p=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,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),u=1/(o-i),l=(e+t)*s,h=(n+r)*c,p=(o+i)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-p,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 B=new j,k=new T;function F(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._order=r||F.DefaultOrder}function U(){this.mask=1}F.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],F.DefaultOrder="XYZ",Object.defineProperties(F.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(F.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=g.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],c=i[1],u=i[5],l=i[9],h=i[2],p=i[6],d=i[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(c,o));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,u));break;case"YZX":this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return B.makeRotationFromQuaternion(t),this.setFromRotationMatrix(B,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return k.setFromEuler(this),this.setFromQuaternion(k,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 P(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(U.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}});let G=0;const H=new P,V=new T,W=new j,q=new P,X=new P,Y=new P,J=new T,Z=new P(1,0,0),K=new P(0,1,0),Q=new P(0,0,1),$={type:"added"},tt={type:"removed"};function et(){Object.defineProperty(this,"id",{value:G++}),this.uuid=g.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=et.DefaultUp.clone();var t=new P,e=new F,n=new T,r=new P(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 j},normalMatrix:{value:new x}}),this.matrix=new j,this.matrixWorld=new j,this.matrixAutoUpdate=et.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new U,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function nt(){et.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}et.DefaultUp=new P(0,1,0),et.DefaultMatrixAutoUpdate=!0,et.prototype=Object.assign(Object.create(d.prototype),{constructor:et,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4: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},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return V.setFromAxisAngle(t,e),this.quaternion.multiply(V),this},rotateOnWorldAxis:function(t,e){return V.setFromAxisAngle(t,e),this.quaternion.premultiply(V),this},rotateX:function(t){return this.rotateOnAxis(Z,t)},rotateY:function(t){return this.rotateOnAxis(K,t)},rotateZ:function(t){return this.rotateOnAxis(Q,t)},translateOnAxis:function(t,e){return H.copy(t).applyQuaternion(this.quaternion),this.position.add(H.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(Z,t)},translateY:function(t){return this.translateOnAxis(K,t)},translateZ:function(t){return this.translateOnAxis(Q,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(W.getInverse(this.matrixWorld))},lookAt:function(t,e,n){t.isVector3?q.copy(t):q.set(t,e,n);var r=this.parent;this.updateWorldMatrix(!0,!1),X.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?W.lookAt(X,q,this.up):W.lookAt(q,X,this.up),this.quaternion.setFromRotationMatrix(W),r&&(W.extractRotation(r.matrixWorld),V.setFromRotationMatrix(W),this.quaternion.premultiply(V.inverse()))},add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent($)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){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,this.children.splice(n,1),t.dispatchEvent(tt)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),W.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),W.multiply(t.parent.matrixWorld)),t.applyMatrix4(W),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new P),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new T),this.updateMatrixWorld(!0),this.matrixWorld.decompose(X,t,Y),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new P),this.updateMatrixWorld(!0),this.matrixWorld.decompose(X,J,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new P),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(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),this.matrixWorldNeedsUpdate=!1,t=!0);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)},toJSON:function(t){var e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,c=a.length;s<c;s++){var u=a[s];i(t.shapes,u)}else i(t.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var l=[];for(s=0,c=this.material.length;s<c;s++)l.push(i(t.materials,this.material[s]));r.material=l}else r.material=i(t.materials,this.material);if(this.children.length>0){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(t).object)}if(e){var h=m(t.geometries),p=m(t.materials),d=m(t.textures),f=m(t.images);a=m(t.shapes);h.length>0&&(n.geometries=h),p.length>0&&(n.materials=p),d.length>0&&(n.textures=d),f.length>0&&(n.images=f),a.length>0&&(n.shapes=a)}return n.object=r,n;function m(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}},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}}),nt.prototype=Object.assign(Object.create(et.prototype),{constructor:nt,isScene:!0,copy:function(t,e){return et.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=et.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});var rt=[new P,new P,new P,new P,new P,new P,new P,new P],it=new P,ot=new vt,at=new P,st=new P,ct=new P,ut=new P,lt=new P,ht=new P,pt=new P,dt=new P,ft=new P,mt=new P;function vt(t,e){this.min=void 0!==t?t:new P(1/0,1/0,1/0),this.max=void 0!==e?e:new P(-1/0,-1/0,-1/0)}function gt(t,e,n,r,i){var o,a;for(o=0,a=t.length-3;o<=a;o+=3){mt.fromArray(t,o);var s=i.x*Math.abs(mt.x)+i.y*Math.abs(mt.y)+i.z*Math.abs(mt.z),c=e.dot(mt),u=n.dot(mt),l=r.dot(mt);if(Math.max(-Math.max(c,u,l),Math.min(c,u,l))>s)return!1}return!0}Object.assign(vt.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 u=t[s],l=t[s+1],h=t[s+2];u<e&&(e=u),l<n&&(n=l),h<r&&(r=h),u>i&&(i=u),l>o&&(o=l),h>a&&(a=h)}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 u=t.getX(s),l=t.getY(s),h=t.getZ(s);u<e&&(e=u),l<n&&(n=l),h<r&&(r=h),u>i&&(i=u),l>o&&(o=l),h>a&&(a=h)}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:function(t,e){var n=it.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("THREE.Box3: .getCenter() target is now required"),t=new P),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new P),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:function(t){t.updateWorldMatrix(!1,!1);var e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),ot.copy(e.boundingBox),ot.applyMatrix4(t.matrixWorld),this.union(ot));for(var n=t.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return 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("THREE.Box3: .getParameter() target is now required"),e=new P),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:function(t){return this.clampPoint(t.center,it),it.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(pt),dt.subVectors(this.max,pt),at.subVectors(t.a,pt),st.subVectors(t.b,pt),ct.subVectors(t.c,pt),ut.subVectors(st,at),lt.subVectors(ct,st),ht.subVectors(at,ct);var e=[0,-ut.z,ut.y,0,-lt.z,lt.y,0,-ht.z,ht.y,ut.z,0,-ut.x,lt.z,0,-lt.x,ht.z,0,-ht.x,-ut.y,ut.x,0,-lt.y,lt.x,0,-ht.y,ht.x,0];return!!gt(e,at,st,ct,dt)&&(!!gt(e=[1,0,0,0,1,0,0,0,1],at,st,ct,dt)&&(ft.crossVectors(ut,lt),gt(e=[ft.x,ft.y,ft.z],at,st,ct,dt)))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new P),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return it.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(it).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:function(t){return this.isEmpty()||(rt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),rt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),rt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),rt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),rt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),rt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),rt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),rt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(rt)),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)}});var yt=new vt;function xt(t,e){this.center=void 0!==t?t:new P,this.radius=void 0!==e?e:-1}Object.assign(xt.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var n=this.center;void 0!==e?n.copy(e):yt.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},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},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("THREE.Sphere: .clampPoint() target is now required"),e=new P),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("THREE.Sphere: .getBoundingBox() target is now required"),t=new vt),this.isEmpty()?(t.makeEmpty(),t):(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}});var bt=new P,Mt=new P,wt=new P,_t=new P,St=new P,Et=new P,Tt=new P;function Lt(t,e){this.origin=void 0!==t?t:new P,this.direction=void 0!==e?e:new P(0,0,-1)}Object.assign(Lt.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("THREE.Ray: .at() target is now required"),e=new P),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,bt)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new P),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:function(t){var e=bt.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(bt.copy(this.direction).multiplyScalar(e).add(this.origin),bt.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,r){Mt.copy(t).add(e).multiplyScalar(.5),wt.copy(e).sub(t).normalize(),_t.copy(this.origin).sub(Mt);var i,o,a,s,c=.5*t.distanceTo(e),u=-this.direction.dot(wt),l=_t.dot(this.direction),h=-_t.dot(wt),p=_t.lengthSq(),d=Math.abs(1-u*u);if(d>0)if(o=u*l-h,s=c*d,(i=u*h-l)>=0)if(o>=-s)if(o<=s){var f=1/d;a=(i*=f)*(i+u*(o*=f)+2*l)+o*(u*i+o+2*h)+p}else o=c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+p;else o=-c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+p;else o<=-s?a=-(i=Math.max(0,-(-u*c+l)))*i+(o=i>0?-c:Math.min(Math.max(-c,-h),c))*(o+2*h)+p:o<=s?(i=0,a=(o=Math.min(Math.max(-c,-h),c))*(o+2*h)+p):a=-(i=Math.max(0,-(u*c+l)))*i+(o=i>0?c:Math.min(Math.max(-c,-h),c))*(o+2*h)+p;else o=u>0?-c:c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+p;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(wt).multiplyScalar(o).add(Mt),a},intersectSphere:function(t,e){bt.subVectors(t.center,this.origin);var n=bt.dot(this.direction),r=bt.dot(bt)-n*n,i=t.radius*t.radius;if(r>i)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 n>=0?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,u=1/this.direction.y,l=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,r=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,r=(t.min.x-h.x)*c),u>=0?(i=(t.min.y-h.y)*u,o=(t.max.y-h.y)*u):(i=(t.max.y-h.y)*u,o=(t.min.y-h.y)*u),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),l>=0?(a=(t.min.z-h.z)*l,s=(t.max.z-h.z)*l):(a=(t.max.z-h.z)*l,s=(t.min.z-h.z)*l),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,bt)},intersectTriangle:function(t,e,n,r,i){St.subVectors(e,t),Et.subVectors(n,t),Tt.crossVectors(St,Et);var o,a=this.direction.dot(Tt);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}_t.subVectors(this.origin,t);var s=o*this.direction.dot(Et.crossVectors(_t,Et));if(s<0)return null;var c=o*this.direction.dot(St.cross(_t));if(c<0)return null;if(s+c>a)return null;var u=-o*_t.dot(Tt);return u<0?null:this.at(u/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)}});var At=new P,Pt=new P,Rt=new x;function Ot(t,e){this.normal=void 0!==t?t:new P(1,0,0),this.constant=void 0!==e?e:0}Object.assign(Ot.prototype,{isPlane:!0,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:function(t,e,n){var r=At.subVectors(n,e).cross(Pt.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("THREE.Plane: .projectPoint() target is now required"),e=new P),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new P);var n=t.delta(At),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||i>1?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&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new P),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var n=e||Rt.getNormalMatrix(t),r=this.coplanarPoint(At).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}});var Nt=new P,Ct=new P,It=new P,Dt=new P,zt=new P,jt=new P,Bt=new P,kt=new P,Ft=new P,Ut=new P;function Gt(t,e,n){this.a=void 0!==t?t:new P,this.b=void 0!==e?e:new P,this.c=void 0!==n?n:new P}Object.assign(Gt,{getNormal:function(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new P),r.subVectors(n,e),Nt.subVectors(t,e),r.cross(Nt);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(t,e,n,r,i){Nt.subVectors(r,e),Ct.subVectors(n,e),It.subVectors(t,e);var o=Nt.dot(Nt),a=Nt.dot(Ct),s=Nt.dot(It),c=Ct.dot(Ct),u=Ct.dot(It),l=o*c-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new P),0===l)return i.set(-2,-1,-1);var h=1/l,p=(c*s-a*u)*h,d=(o*u-a*s)*h;return i.set(1-p-d,d,p)},containsPoint:function(t,e,n,r){return Gt.getBarycoord(t,e,n,r,Dt),Dt.x>=0&&Dt.y>=0&&Dt.x+Dt.y<=1},getUV:function(t,e,n,r,i,o,a,s){return this.getBarycoord(t,e,n,r,Dt),s.set(0,0),s.addScaledVector(i,Dt.x),s.addScaledVector(o,Dt.y),s.addScaledVector(a,Dt.z),s},isFrontFacing:function(t,e,n,r){return Nt.subVectors(n,e),Ct.subVectors(t,e),Nt.cross(Ct).dot(r)<0}}),Object.assign(Gt.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:function(){return Nt.subVectors(this.c,this.b),Ct.subVectors(this.a,this.b),.5*Nt.cross(Ct).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new P),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Gt.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Ot),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Gt.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,r,i){return Gt.getUV(t,this.a,this.b,this.c,e,n,r,i)},containsPoint:function(t){return Gt.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return Gt.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new P);var n,r,i=this.a,o=this.b,a=this.c;zt.subVectors(o,i),jt.subVectors(a,i),kt.subVectors(t,i);var s=zt.dot(kt),c=jt.dot(kt);if(s<=0&&c<=0)return e.copy(i);Ft.subVectors(t,o);var u=zt.dot(Ft),l=jt.dot(Ft);if(u>=0&&l<=u)return e.copy(o);var h=s*l-u*c;if(h<=0&&s>=0&&u<=0)return n=s/(s-u),e.copy(i).addScaledVector(zt,n);Ut.subVectors(t,a);var p=zt.dot(Ut),d=jt.dot(Ut);if(d>=0&&p<=d)return e.copy(a);var f=p*c-s*d;if(f<=0&&c>=0&&d<=0)return r=c/(c-d),e.copy(i).addScaledVector(jt,r);var m=u*d-p*l;if(m<=0&&l-u>=0&&p-d>=0)return Bt.subVectors(a,o),r=(l-u)/(l-u+(p-d)),e.copy(o).addScaledVector(Bt,r);var v=1/(m+f+h);return n=f*v,r=h*v,e.copy(i).addScaledVector(zt,n).addScaledVector(jt,r)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var Ht={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Vt={h:0,s:0,l:0},Wt={h:0,s:0,l:0};function qt(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function Xt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function Yt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Jt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Zt(t,e,n,r,i,o){this.a=t,this.b=e,this.c=n,this.normal=r&&r.isVector3?r:new P,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new qt,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}Object.assign(qt.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=g.euclideanModulo(t,1),e=g.clamp(e,0,1),n=g.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=Xt(i,r,t+1/3),this.g=Xt(i,r,t),this.b=Xt(i,r,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(a,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u=n[1],l=u.length;if(3===l)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){var e=Ht[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},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=e>0?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=Yt(t.r),this.g=Yt(t.g),this.b=Yt(t.b),this},copyLinearToSRGB:function(t){return this.r=Jt(t.r),this.g=Jt(t.g),this.b=Jt(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){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),c=(s+a)/2;if(s===a)e=0,n=0;else{var u=a-s;switch(n=c<=.5?u/(a+s):u/(2-a-s),a){case r:e=(i-o)/u+(i<o?6:0);break;case i:e=(o-r)/u+2;break;case o:e=(r-i)/u+4}e/=6}return t.h=e,t.s=n,t.l=c,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,n){return this.getHSL(Vt),Vt.h+=t,Vt.s+=e,Vt.l+=n,this.setHSL(Vt.h,Vt.s,Vt.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:function(t,e){this.getHSL(Vt),t.getHSL(Wt);var n=g.lerp(Vt.h,Wt.h,e),r=g.lerp(Vt.s,Wt.s,e),i=g.lerp(Vt.l,Wt.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()}}),qt.NAMES=Ht,Object.assign(Zt.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var Kt=0;function Qt(){Object.defineProperty(this,"id",{value:Kt++}),this.uuid=g.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=!1,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.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function $t(t){Qt.call(this),this.type="MeshBasicMaterial",this.color=new qt(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.setValues(t)}Qt.prototype=Object.assign(Object.create(d.prototype),{constructor:Qt,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("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var i=r(t.textures),o=r(t.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Qt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),$t.prototype=Object.create(Qt.prototype),$t.prototype.constructor=$t,$t.prototype.isMeshBasicMaterial=!0,$t.prototype.copy=function(t){return Qt.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};var te=new P;function ee(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.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.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function ne(t,e,n){ee.call(this,new Int8Array(t),e,n)}function re(t,e,n){ee.call(this,new Uint8Array(t),e,n)}function ie(t,e,n){ee.call(this,new Uint8ClampedArray(t),e,n)}function oe(t,e,n){ee.call(this,new Int16Array(t),e,n)}function ae(t,e,n){ee.call(this,new Uint16Array(t),e,n)}function se(t,e,n){ee.call(this,new Int32Array(t),e,n)}function ce(t,e,n){ee.call(this,new Uint32Array(t),e,n)}function ue(t,e,n){ee.call(this,new Float32Array(t),e,n)}function le(t,e,n){ee.call(this,new Float64Array(t),e,n)}function he(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function pe(t){if(0===t.length)return-1/0;let e=t[0];for(let n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(ee.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(ee.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=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.usage=t.usage,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("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new qt),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("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new y),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("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new P),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("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new _),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},applyMatrix3:function(t){for(var e=0,n=this.count;e<n;e++)te.x=this.getX(e),te.y=this.getY(e),te.z=this.getZ(e),te.applyMatrix3(t),this.setXYZ(e,te.x,te.y,te.z);return this},applyMatrix4:function(t){for(var e=0,n=this.count;e<n;e++)te.x=this.getX(e),te.y=this.getY(e),te.z=this.getZ(e),te.applyMatrix4(t),this.setXYZ(e,te.x,te.y,te.z);return this},applyNormalMatrix:function(t){for(var e=0,n=this.count;e<n;e++)te.x=this.getX(e),te.y=this.getY(e),te.z=this.getZ(e),te.applyNormalMatrix(t),this.setXYZ(e,te.x,te.y,te.z);return this},transformDirection:function(t){for(var e=0,n=this.count;e<n;e++)te.x=this.getX(e),te.y=this.getY(e),te.z=this.getZ(e),te.transformDirection(t),this.setXYZ(e,te.x,te.y,te.z);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}}}),ne.prototype=Object.create(ee.prototype),ne.prototype.constructor=ne,re.prototype=Object.create(ee.prototype),re.prototype.constructor=re,ie.prototype=Object.create(ee.prototype),ie.prototype.constructor=ie,oe.prototype=Object.create(ee.prototype),oe.prototype.constructor=oe,ae.prototype=Object.create(ee.prototype),ae.prototype.constructor=ae,se.prototype=Object.create(ee.prototype),se.prototype.constructor=se,ce.prototype=Object.create(ee.prototype),ce.prototype.constructor=ce,ue.prototype=Object.create(ee.prototype),ue.prototype.constructor=ue,le.prototype=Object.create(ee.prototype),le.prototype.constructor=le,Object.assign(he.prototype,{computeGroups:function(t){for(var e,n=[],r=void 0,i=t.faces,o=0;o<i.length;o++){var a=i[o];a.materialIndex!==r&&(r=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:r})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,r=t.vertices,i=t.faceVertexUvs,o=i[0]&&i[0].length>0,a=i[1]&&i[1].length>0,s=t.morphTargets,c=s.length;if(c>0){e=[];for(var u=0;u<c;u++)e[u]={name:s[u].name,data:[]};this.morphTargets.position=e}var l,h=t.morphNormals,p=h.length;if(p>0){l=[];for(u=0;u<p;u++)l[u]={name:h[u].name,data:[]};this.morphTargets.normal=l}var d=t.skinIndices,f=t.skinWeights,m=d.length===r.length,v=f.length===r.length;r.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(u=0;u<n.length;u++){var g=n[u];this.vertices.push(r[g.a],r[g.b],r[g.c]);var x=g.vertexNormals;if(3===x.length)this.normals.push(x[0],x[1],x[2]);else{var b=g.normal;this.normals.push(b,b,b)}var M,w=g.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var _=g.color;this.colors.push(_,_,_)}if(!0===o)void 0!==(M=i[0][u])?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new y,new y,new y));if(!0===a)void 0!==(M=i[1][u])?this.uvs2.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new y,new y,new y));for(var S=0;S<c;S++){var E=s[S].vertices;e[S].data.push(E[g.a],E[g.b],E[g.c])}for(S=0;S<p;S++){var T=h[S].vertexNormals[u];l[S].data.push(T.a,T.b,T.c)}m&&this.skinIndices.push(d[g.a],d[g.b],d[g.c]),v&&this.skinWeights.push(f[g.a],f[g.b],f[g.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var de=1,fe=new j,me=new et,ve=new P,ge=new vt,ye=new vt,xe=new P;function be(){Object.defineProperty(this,"id",{value:de+=2}),this.uuid=g.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}be.prototype=Object.assign(Object.create(d.prototype),{constructor:be,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(pe(t)>65535?ce:ae)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute: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},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new x).getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return fe.makeRotationX(t),this.applyMatrix4(fe),this},rotateY:function(t){return fe.makeRotationY(t),this.applyMatrix4(fe),this},rotateZ:function(t){return fe.makeRotationZ(t),this.applyMatrix4(fe),this},translate:function(t,e,n){return fe.makeTranslation(t,e,n),this.applyMatrix4(fe),this},scale:function(t,e,n){return fe.makeScale(t,e,n),this.applyMatrix4(fe),this},lookAt:function(t){return me.lookAt(t),me.updateMatrix(),this.applyMatrix4(me.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ve).negate(),this.translate(ve.x,ve.y,ve.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new ue(3*e.vertices.length,3),r=new ue(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new ue(e.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},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.setAttribute("position",new ue(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new he).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new ee(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new ee(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var r=new Float32Array(3*t.colors.length);this.setAttribute("color",new ee(r,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new ee(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new ee(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],c=t.morphTargets[a],u=0,l=c.length;u<l;u++){var h=c[u],p=new ue(3*h.data.length,3);p.name=h.name,s.push(p.copyVector3sArray(h.data))}this.morphAttributes[a]=s}if(t.skinIndices.length>0){var d=new ue(4*t.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new ue(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new vt);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];ge.setFromBufferAttribute(i),this.morphTargetsRelative?(xe.addVectors(this.boundingBox.min,ge.min),this.boundingBox.expandByPoint(xe),xe.addVectors(this.boundingBox.max,ge.max),this.boundingBox.expandByPoint(xe)):(this.boundingBox.expandByPoint(ge.min),this.boundingBox.expandByPoint(ge.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new xt);var t=this.attributes.position,e=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(ge.setFromBufferAttribute(t),e)for(var r=0,i=e.length;r<i;r++){var o=e[r];ye.setFromBufferAttribute(o),this.morphTargetsRelative?(xe.addVectors(ge.min,ye.min),ge.expandByPoint(xe),xe.addVectors(ge.max,ye.max),ge.expandByPoint(xe)):(ge.expandByPoint(ye.min),ge.expandByPoint(ye.max))}ge.getCenter(n);var a=0;for(r=0,i=t.count;r<i;r++)xe.fromBufferAttribute(t,r),a=Math.max(a,n.distanceToSquared(xe));if(e)for(r=0,i=e.length;r<i;r++){o=e[r];for(var s=this.morphTargetsRelative,c=0,u=o.count;c<u;c++)xe.fromBufferAttribute(o,c),s&&(ve.fromBufferAttribute(t,c),xe.add(ve)),a=Math.max(a,n.distanceToSquared(xe))}this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.setAttribute("normal",new ee(new Float32Array(n.length),3));else for(var r=e.normal.array,i=0,o=r.length;i<o;i++)r[i]=0;var a,s,c,u=e.normal.array,l=new P,h=new P,p=new P,d=new P,f=new P;if(t){var m=t.array;for(i=0,o=t.count;i<o;i+=3)a=3*m[i+0],s=3*m[i+1],c=3*m[i+2],l.fromArray(n,a),h.fromArray(n,s),p.fromArray(n,c),d.subVectors(p,h),f.subVectors(l,h),d.cross(f),u[a]+=d.x,u[a+1]+=d.y,u[a+2]+=d.z,u[s]+=d.x,u[s+1]+=d.y,u[s+2]+=d.z,u[c]+=d.x,u[c+1]+=d.y,u[c+2]+=d.z}else for(i=0,o=n.length;i<o;i+=9)l.fromArray(n,i),h.fromArray(n,i+3),p.fromArray(n,i+6),d.subVectors(p,h),f.subVectors(l,h),d.cross(f),u[i]=d.x,u[i+1]=d.y,u[i+2]=d.z,u[i+3]=d.x,u[i+4]=d.y,u[i+5]=d.z,u[i+6]=d.x,u[i+7]=d.y,u[i+8]=d.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.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),u=0,l=s;u<c;u++,l++)i[l]=a[u];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals: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=t.normalized,o=new n.constructor(e.length*r),a=0,s=0,c=0,u=e.length;c<u;c++){a=e[c]*r;for(var l=0;l<r;l++)o[s++]=n[a++]}return new ee(o,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new be,n=this.index.array,r=this.attributes;for(var i in r){var o=t(r[i],n);e.setAttribute(i,o)}var a=this.morphAttributes;for(i in a){for(var s=[],c=a[i],u=0,l=c.length;u<l;u++){o=t(c[u],n);s.push(o)}e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,p=(u=0,h.length);u<p;u++){var d=h[u];e.addGroup(d.start,d.count,d.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var r=this.index;null!==r&&(t.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var o=(p=i[n]).toJSON();""!==p.name&&(o.name=p.name),t.data.attributes[n]=o}var a={},s=!1;for(var n in this.morphAttributes){for(var c=this.morphAttributes[n],u=[],l=0,h=c.length;l<h;l++){var p;o=(p=c[l]).toJSON();""!==p.name&&(o.name=p.name),u.push(o)}u.length>0&&(a[n]=u,s=!0)}s&&(t.data.morphAttributes=a,t.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(t.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new be).copy(this)},copy:function(t){var e,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var o=t.attributes;for(e in o){var a=o[e];this.setAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var c=[],u=s[e];for(n=0,r=u.length;n<r;n++)c.push(u[n].clone());this.morphAttributes[e]=c}this.morphTargetsRelative=t.morphTargetsRelative;var l=t.groups;for(n=0,r=l.length;n<r;n++){var h=l[n];this.addGroup(h.start,h.count,h.materialIndex)}var p=t.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=t.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Me=new j,we=new Lt,_e=new xt,Se=new P,Ee=new P,Te=new P,Le=new P,Ae=new P,Pe=new P,Re=new P,Oe=new P,Ne=new P,Ce=new y,Ie=new y,De=new y,ze=new P,je=new P;function Be(t,e){et.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new be,this.material=void 0!==e?e:new $t,this.updateMorphTargets()}function ke(t,e,n,r,i,o,a,s){if(null===(1===e.side?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,2!==e.side,s)))return null;je.copy(s),je.applyMatrix4(t.matrixWorld);var c=n.ray.origin.distanceTo(je);return c<n.near||c>n.far?null:{distance:c,point:je.clone(),object:t}}function Fe(t,e,n,r,i,o,a,s,c,u,l,h){Se.fromBufferAttribute(i,u),Ee.fromBufferAttribute(i,l),Te.fromBufferAttribute(i,h);var p=t.morphTargetInfluences;if(e.morphTargets&&o&&p){Re.set(0,0,0),Oe.set(0,0,0),Ne.set(0,0,0);for(var d=0,f=o.length;d<f;d++){var m=p[d],v=o[d];0!==m&&(Le.fromBufferAttribute(v,u),Ae.fromBufferAttribute(v,l),Pe.fromBufferAttribute(v,h),a?(Re.addScaledVector(Le,m),Oe.addScaledVector(Ae,m),Ne.addScaledVector(Pe,m)):(Re.addScaledVector(Le.sub(Se),m),Oe.addScaledVector(Ae.sub(Ee),m),Ne.addScaledVector(Pe.sub(Te),m)))}Se.add(Re),Ee.add(Oe),Te.add(Ne)}t.isSkinnedMesh&&(t.boneTransform(u,Se),t.boneTransform(l,Ee),t.boneTransform(h,Te));var g=ke(t,e,n,r,Se,Ee,Te,ze);if(g){s&&(Ce.fromBufferAttribute(s,u),Ie.fromBufferAttribute(s,l),De.fromBufferAttribute(s,h),g.uv=Gt.getUV(ze,Se,Ee,Te,Ce,Ie,De,new y)),c&&(Ce.fromBufferAttribute(c,u),Ie.fromBufferAttribute(c,l),De.fromBufferAttribute(c,h),g.uv2=Gt.getUV(ze,Se,Ee,Te,Ce,Ie,De,new y));var x=new Zt(u,l,h);Gt.getNormal(Se,Ee,Te,x.normal),g.face=x}return g}Be.prototype=Object.assign(Object.create(et.prototype),{constructor:Be,isMesh:!0,copy:function(t){return et.prototype.copy.call(this,t),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(o.length>0){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&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),_e.copy(r.boundingSphere),_e.applyMatrix4(o),!1!==t.ray.intersectsSphere(_e)&&(Me.getInverse(o),we.copy(t.ray).applyMatrix4(Me),null===r.boundingBox||!1!==we.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a,s,c,u,l,h,p,d,f,m=r.index,v=r.attributes.position,g=r.morphAttributes.position,x=r.morphTargetsRelative,b=r.attributes.uv,M=r.attributes.uv2,w=r.groups,_=r.drawRange;if(null!==m)if(Array.isArray(i))for(u=0,h=w.length;u<h;u++)for(f=i[(d=w[u]).materialIndex],l=Math.max(d.start,_.start),p=Math.min(d.start+d.count,_.start+_.count);l<p;l+=3)a=m.getX(l),s=m.getX(l+1),c=m.getX(l+2),(n=Fe(this,f,t,we,v,g,x,b,M,a,s,c))&&(n.faceIndex=Math.floor(l/3),n.face.materialIndex=d.materialIndex,e.push(n));else for(u=Math.max(0,_.start),h=Math.min(m.count,_.start+_.count);u<h;u+=3)a=m.getX(u),s=m.getX(u+1),c=m.getX(u+2),(n=Fe(this,i,t,we,v,g,x,b,M,a,s,c))&&(n.faceIndex=Math.floor(u/3),e.push(n));else if(void 0!==v)if(Array.isArray(i))for(u=0,h=w.length;u<h;u++)for(f=i[(d=w[u]).materialIndex],l=Math.max(d.start,_.start),p=Math.min(d.start+d.count,_.start+_.count);l<p;l+=3)(n=Fe(this,f,t,we,v,g,x,b,M,a=l,s=l+1,c=l+2))&&(n.faceIndex=Math.floor(l/3),n.face.materialIndex=d.materialIndex,e.push(n));else for(u=Math.max(0,_.start),h=Math.min(v.count,_.start+_.count);u<h;u+=3)(n=Fe(this,i,t,we,v,g,x,b,M,a=u,s=u+1,c=u+2))&&(n.faceIndex=Math.floor(u/3),e.push(n))}else if(r.isGeometry){var S,E,T,L,A=Array.isArray(i),P=r.vertices,R=r.faces,O=r.faceVertexUvs[0];O.length>0&&(L=O);for(var N=0,C=R.length;N<C;N++){var I=R[N],D=A?i[I.materialIndex]:i;if(void 0!==D&&(S=P[I.a],E=P[I.b],T=P[I.c],n=ke(this,D,t,we,S,E,T,ze))){if(L&&L[N]){var z=L[N];Ce.copy(z[0]),Ie.copy(z[1]),De.copy(z[2]),n.uv=Gt.getUV(ze,S,E,T,Ce,Ie,De,new y)}n.face=I,n.faceIndex=N,e.push(n)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Ue=0,Ge=new j,He=new et,Ve=new P;function We(){Object.defineProperty(this,"id",{value:Ue+=2}),this.uuid=g.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}We.prototype=Object.assign(Object.create(d.prototype),{constructor:We,isGeometry:!0,applyMatrix4:function(t){for(var e=(new x).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},rotateX:function(t){return Ge.makeRotationX(t),this.applyMatrix4(Ge),this},rotateY:function(t){return Ge.makeRotationY(t),this.applyMatrix4(Ge),this},rotateZ:function(t){return Ge.makeRotationZ(t),this.applyMatrix4(Ge),this},translate:function(t,e,n){return Ge.makeTranslation(t,e,n),this.applyMatrix4(Ge),this},scale:function(t,e,n){return Ge.makeScale(t,e,n),this.applyMatrix4(Ge),this},lookAt:function(t){return He.lookAt(t),He.updateMatrix(),this.applyMatrix4(He.matrix),this},fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,r=t.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position.array,o=void 0!==r.normal?r.normal.array:void 0,a=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,c=void 0!==r.uv2?r.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var u=0;u<i.length;u+=3)e.vertices.push((new P).fromArray(i,u)),void 0!==a&&e.colors.push((new qt).fromArray(a,u));function l(t,n,r,i){var u=void 0===a?[]:[e.colors[t].clone(),e.colors[n].clone(),e.colors[r].clone()],l=new Zt(t,n,r,void 0===o?[]:[(new P).fromArray(o,3*t),(new P).fromArray(o,3*n),(new P).fromArray(o,3*r)],u,i);e.faces.push(l),void 0!==s&&e.faceVertexUvs[0].push([(new y).fromArray(s,2*t),(new y).fromArray(s,2*n),(new y).fromArray(s,2*r)]),void 0!==c&&e.faceVertexUvs[1].push([(new y).fromArray(c,2*t),(new y).fromArray(c,2*n),(new y).fromArray(c,2*r)])}var h=t.groups;if(h.length>0)for(u=0;u<h.length;u++)for(var p=h[u],d=p.start,f=d,m=d+p.count;f<m;f+=3)void 0!==n?l(n[f],n[f+1],n[f+2],p.materialIndex):l(f,f+1,f+2,p.materialIndex);else if(void 0!==n)for(u=0;u<n.length;u+=3)l(n[u],n[u+1],n[u+2]);else for(u=0;u<i.length/3;u+=3)l(u,u+1,u+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ve).negate(),this.translate(Ve.x,Ve.y,Ve.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new j;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.applyMatrix4(r),this},computeFaceNormals:function(){for(var t=new P,e=new P,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 P;if(t){var s,c,u,l=new P,h=new P;for(r=0,i=this.faces.length;r<i;r++)o=this.faces[r],s=this.vertices[o.a],c=this.vertices[o.b],u=this.vertices[o.c],l.subVectors(u,c),h.subVectors(s,c),l.cross(h),a[o.a].add(l),a[o.b].add(l),a[o.c].add(l)}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 p=(o=this.faces[r]).vertexNormals;3===p.length?(p[0].copy(a[o.a]),p[1].copy(a[o.b]),p[2].copy(a[o.c])):(p[0]=a[o.a].clone(),p[1]=a[o.b].clone(),p[2]=a[o.c].clone())}this.faces.length>0&&(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())}this.faces.length>0&&(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 We;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 P,u={a:new P,b:new P,c:new P},a.push(c),s.push(u)}var c,u,l=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=l.faceNormals[n],u=l.vertexNormals[n],c.copy(i.normal),u.a.copy(i.vertexNormals[0]),u.b.copy(i.vertexNormals[1]),u.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 vt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new xt),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var r,i=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,c=t.faces,u=this.colors,l=t.colors;void 0===n&&(n=0),void 0!==e&&(r=(new x).getNormalMatrix(e));for(var h=0,p=a.length;h<p;h++){var d=a[h].clone();void 0!==e&&d.applyMatrix4(e),o.push(d)}for(h=0,p=l.length;h<p;h++)u.push(l[h].clone());for(h=0,p=c.length;h<p;h++){var f,m,v,g=c[h],y=g.vertexNormals,b=g.vertexColors;(f=new Zt(g.a+i,g.b+i,g.c+i)).normal.copy(g.normal),void 0!==r&&f.normal.applyMatrix3(r).normalize();for(var M=0,w=y.length;M<w;M++)m=y[M].clone(),void 0!==r&&m.applyMatrix3(r).normalize(),f.vertexNormals.push(m);f.color.copy(g.color);for(M=0,w=b.length;M<w;M++)v=b[M],f.vertexColors.push(v.clone());f.materialIndex=g.materialIndex+n,s.push(f)}for(h=0,p=t.faceVertexUvs.length;h<p;h++){var _=t.faceVertexUvs[h];void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]);for(M=0,w=_.length;M<w;M++){for(var S=_[M],E=[],T=0,L=S.length;T<L;T++)E.push(S[T].clone());this.faceVertexUvs[h].push(E)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,r,i,o,a,s,c={},u=[],l=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)t=this.vertices[n],void 0===c[e=Math.round(t.x*h)+"_"+Math.round(t.y*h)+"_"+Math.round(t.z*h)]?(c[e]=n,u.push(this.vertices[n]),l[n]=u.length-1):l[n]=l[c[e]];var p=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=l[i.a],i.b=l[i.b],i.c=l[i.c],o=[i.a,i.b,i.c];for(var d=0;d<3;d++)if(o[d]===o[(d+1)%3]){p.push(n);break}}for(n=p.length-1;n>=0;n--){var f=p[n];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(f,1)}var m=this.vertices.length-u.length;return this.vertices=u,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var r=t[e];this.vertices.push(new P(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort((function(t,e){return t.materialIndex-e.materialIndex}));var r,i,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===e&&(r=[]),a&&a.length===e&&(i=[]);for(n=0;n<e;n++){var s=t[n]._id;r&&r.push(o[s]),i&&i.push(a[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var r=[],i=0;i<this.vertices.length;i++){var o=this.vertices[i];r.push(o.x,o.y,o.z)}var a=[],s=[],c={},u=[],l={},h=[],p={};for(i=0;i<this.faces.length;i++){var d=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=d.normal.length()>0,v=d.vertexNormals.length>0,g=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=d.vertexColors.length>0,x=0;if(x=_(x,0,0),x=_(x,1,!0),x=_(x,2,!1),x=_(x,3,f),x=_(x,4,m),x=_(x,5,v),x=_(x,6,g),x=_(x,7,y),a.push(x),a.push(d.a,d.b,d.c),a.push(d.materialIndex),f){var b=this.faceVertexUvs[0][i];a.push(T(b[0]),T(b[1]),T(b[2]))}if(m&&a.push(S(d.normal)),v){var M=d.vertexNormals;a.push(S(M[0]),S(M[1]),S(M[2]))}if(g&&a.push(E(d.color)),y){var w=d.vertexColors;a.push(E(w[0]),E(w[1]),E(w[2]))}}function _(t,e,n){return n?t|1<<e:t&~(1<<e)}function S(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==c[e]||(c[e]=s.length/3,s.push(t.x,t.y,t.z)),c[e]}function E(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==l[e]||(l[e]=u.length,u.push(t.getHex())),l[e]}function T(t){var e=t.x.toString()+t.y.toString();return void 0!==p[e]||(p[e]=h.length/2,h.push(t.x,t.y)),p[e]}return t.data={},t.data.vertices=r,t.data.normals=s,u.length>0&&(t.data.colors=u),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new We).copy(this)},copy:function(t){var e,n,r,i,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var c=t.colors;for(e=0,n=c.length;e<n;e++)this.colors.push(c[e].clone());var u=t.faces;for(e=0,n=u.length;e<n;e++)this.faces.push(u[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var l=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),r=0,i=l.length;r<i;r++){var h=l[r],p=[];for(o=0,a=h.length;o<a;o++){var d=h[o];p.push(d.clone())}this.faceVertexUvs[e].push(p)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],r=0,i=f[e].vertices.length;r<i;r++)m.vertices.push(f[e].vertices[r].clone());if(void 0!==f[e].normals)for(m.normals=[],r=0,i=f[e].normals.length;r<i;r++)m.normals.push(f[e].normals[r].clone());this.morphTargets.push(m)}var v=t.morphNormals;for(e=0,n=v.length;e<n;e++){var g={};if(void 0!==v[e].vertexNormals)for(g.vertexNormals=[],r=0,i=v[e].vertexNormals.length;r<i;r++){var y=v[e].vertexNormals[r],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),g.vertexNormals.push(x)}if(void 0!==v[e].faceNormals)for(g.faceNormals=[],r=0,i=v[e].faceNormals.length;r<i;r++)g.faceNormals.push(v[e].faceNormals[r].clone());this.morphNormals.push(g)}var b=t.skinWeights;for(e=0,n=b.length;e<n;e++)this.skinWeights.push(b[e].clone());var M=t.skinIndices;for(e=0,n=M.length;e<n;e++)this.skinIndices.push(M[e].clone());var w=t.lineDistances;for(e=0,n=w.length;e<n;e++)this.lineDistances.push(w[e]);var _=t.boundingBox;null!==_&&(this.boundingBox=_.clone());var S=t.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class qe extends be{constructor(t,e,n,r,i,o){super(),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;t=t||1,e=e||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,o=Math.floor(o)||1;const s=[],c=[],u=[],l=[];let h=0,p=0;function d(t,e,n,r,i,o,d,f,m,v,g){const y=o/m,x=d/v,b=o/2,M=d/2,w=f/2,_=m+1,S=v+1;let E=0,T=0;const L=new P;for(let o=0;o<S;o++){const a=o*x-M;for(let s=0;s<_;s++){const h=s*y-b;L[t]=h*r,L[e]=a*i,L[n]=w,c.push(L.x,L.y,L.z),L[t]=0,L[e]=0,L[n]=f>0?1:-1,u.push(L.x,L.y,L.z),l.push(s/m),l.push(1-o/v),E+=1}}for(let t=0;t<v;t++)for(let e=0;e<m;e++){const n=h+e+_*t,r=h+e+_*(t+1),i=h+(e+1)+_*(t+1),o=h+(e+1)+_*t;s.push(n,r,o),s.push(r,i,o),T+=6}a.addGroup(p,T,g),p+=T,h+=E}d("z","y","x",-1,-1,n,e,t,o,i,0),d("z","y","x",1,-1,n,e,-t,o,i,1),d("x","z","y",1,1,t,n,e,r,o,2),d("x","z","y",1,-1,t,n,-e,r,o,3),d("x","y","z",1,-1,t,e,n,r,i,4),d("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new ue(c,3)),this.setAttribute("normal",new ue(u,3)),this.setAttribute("uv",new ue(l,2))}}function Xe(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 Ye(t){for(var e={},n=0;n<t.length;n++){var r=Xe(t[n]);for(var i in r)e[i]=r[i]}return e}var Je={clone:Xe,merge:Ye};function Ze(t){Qt.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("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Ke(){et.call(this),this.type="Camera",this.matrixWorldInverse=new j,this.projectionMatrix=new j,this.projectionMatrixInverse=new j}function Qe(t,e,n,r){Ke.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()}Ze.prototype=Object.create(Qt.prototype),Ze.prototype.constructor=Ze,Ze.prototype.isShaderMaterial=!0,Ze.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Xe(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=Object.assign({},t.extensions),this},Ze.prototype.toJSON=function(t){var e=Qt.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}}Object.keys(this.defines).length>0&&(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 Object.keys(i).length>0&&(e.extensions=i),e},Ke.prototype=Object.assign(Object.create(et.prototype),{constructor:Ke,isCamera:!0,copy:function(t,e){return et.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("THREE.Camera: .getWorldDirection() target is now required"),t=new P),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){et.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){et.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Qe.prototype=Object.assign(Object.create(Ke.prototype),{constructor:Qe,isPerspectiveCamera:!0,copy:function(t,e){return Ke.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*g.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*g.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*g.RAD2DEG*Math.atan(Math.tan(.5*g.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*g.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=et.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}});function $e(t,e,n){if(et.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var r=new Qe(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new P(1,0,0)),this.add(r);var i=new Qe(90,1,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new P(-1,0,0)),this.add(i);var o=new Qe(90,1,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new P(0,1,0)),this.add(o);var a=new Qe(90,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new P(0,-1,0)),this.add(a);var s=new Qe(90,1,t,e);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new P(0,0,1)),this.add(s);var c=new Qe(90,1,t,e);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new P(0,0,-1)),this.add(c),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var u=t.xr.enabled,l=t.getRenderTarget();t.xr.enabled=!1;var h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,r),t.setRenderTarget(n,1),t.render(e,i),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,s),n.texture.generateMipmaps=h,t.setRenderTarget(n,5),t.render(e,c),t.setRenderTarget(l),t.xr.enabled=u},this.clear=function(t,e,r,i){for(var o=t.getRenderTarget(),a=0;a<6;a++)t.setRenderTarget(n,a),t.clear(e,r,i);t.setRenderTarget(o)}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function tn(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),S.call(this,t,t,e)}function en(t,e,n,r,i,o,a,s,c,u,l,h){w.call(this,null,o,a,s,c,u,r,i,l,h),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==u?u:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}$e.prototype=Object.create(et.prototype),$e.prototype.constructor=$e,tn.prototype=Object.create(S.prototype),tn.prototype.constructor=tn,tn.prototype.isWebGLCubeRenderTarget=!0,tn.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new nt,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#include <common>","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV = equirectUv( direction );","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new Ze({type:"CubemapFromEquirect",uniforms:Xe(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=e;var o=new Be(new qe(5,5,5),i);return n.add(o),new $e(1,10,this).update(t,n),o.geometry.dispose(),o.material.dispose(),this},en.prototype=Object.create(w.prototype),en.prototype.constructor=en,en.prototype.isDataTexture=!0;var nn=new xt,rn=new P;function on(t,e,n,r,i,o){this.planes=[void 0!==t?t:new Ot,void 0!==e?e:new Ot,void 0!==n?n:new Ot,void 0!==r?r:new Ot,void 0!==i?i:new Ot,void 0!==o?o:new Ot]}Object.assign(on.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},setFromProjectionMatrix: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],u=n[6],l=n[7],h=n[8],p=n[9],d=n[10],f=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return e[0].setComponents(a-r,l-s,f-h,y-m).normalize(),e[1].setComponents(a+r,l+s,f+h,y+m).normalize(),e[2].setComponents(a+i,l+c,f+p,y+v).normalize(),e[3].setComponents(a-i,l-c,f-p,y-v).normalize(),e[4].setComponents(a-o,l-u,f-d,y-g).normalize(),e[5].setComponents(a+o,l+u,f+d,y+g).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),nn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(nn)},intersectsSprite:function(t){return nn.center.set(0,0,0),nn.radius=.7071067811865476,nn.applyMatrix4(t.matrixWorld),this.intersectsSphere(nn)},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:function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];if(rn.x=r.normal.x>0?t.max.x:t.min.x,rn.y=r.normal.y>0?t.max.y:t.min.y,rn.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(rn)<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}});var an={common:{diffuse:{value:new qt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x},uv2Transform:{value:new x},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 y(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 qt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new qt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}},sprite:{diffuse:{value:new qt(15658734)},opacity:{value:1},center:{value:new y(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}}};function sn(){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 cn(t,e){var n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){e.isInterleavedBufferAttribute&&(e=e.data);var o=r.get(e);void 0===o?r.set(e,function(e,n){var r=e.array,i=e.usage,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("THREE.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}}(e,i)):o.version<e.version&&(!function(e,r,i){var o=r.array,a=r.updateRange;t.bindBuffer(i,e),-1===a.count?t.bufferSubData(i,0,o):(n?t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o,a.offset,a.count):t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o.subarray(a.offset,a.offset+a.count)),a.count=-1)}(o.buffer,e,i),o.version=e.version)}}}function un(t,e,n,r){We.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new ln(t,e,n,r)),this.mergeVertices()}function ln(t,e,n,r){be.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,u=Math.floor(r)||1,l=c+1,h=u+1,p=t/c,d=e/u,f=[],m=[],v=[],g=[];for(o=0;o<h;o++){var y=o*d-s;for(i=0;i<l;i++){var x=i*p-a;m.push(x,-y,0),v.push(0,0,1),g.push(i/c),g.push(1-o/u)}}for(o=0;o<u;o++)for(i=0;i<c;i++){var b=i+l*o,M=i+l*(o+1),w=i+1+l*(o+1),_=i+1+l*o;f.push(b,M,_),f.push(M,w,_)}this.setIndex(f),this.setAttribute("position",new ue(m,3)),this.setAttribute("normal",new ue(v,3)),this.setAttribute("uv",new ue(g,2))}un.prototype=Object.create(We.prototype),un.prototype.constructor=un,ln.prototype=Object.create(be.prototype),ln.prototype.constructor=ln;var hn={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( STANDARD )\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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( 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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, 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}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",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_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - 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#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat 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}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\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#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\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}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x); } else if (face == 1.0) {\n uv = vec2(-direction.x, -direction.z) / abs(direction.y); } else if (face == 2.0) {\n uv = vec2(-direction.x, direction.y) / abs(direction.z); } else if (face == 3.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x); } else if (face == 4.0) {\n uv = vec2(-direction.x, direction.z) / abs(direction.y); } else {\n uv = vec2(direction.x, direction.y) / abs(direction.z); }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\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, vUv ).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 = clamp( floor( D ) / 255.0, 0.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#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, 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_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\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\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\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_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\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\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\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 )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\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\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 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 roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, 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\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\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#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\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 = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\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 USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * 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 = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\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};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\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};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\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};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\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_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\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_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\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\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\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 );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#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#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\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\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 = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\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\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * 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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, 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, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\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\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\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:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\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 *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\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 *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * 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\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\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#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\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}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\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 = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef 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_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\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\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\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( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), 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( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), 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 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\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 ) || defined( SHADOWMAP_TYPE_VSM )\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_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\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_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\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 highp 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#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_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\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\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\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:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\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>\nvarying vec2 vHighPrecisionZW;\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\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\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>\nvarying vec2 vHighPrecisionZW;\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\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <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 = equirectUv( direction );\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\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 <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 <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * 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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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\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 <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <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 <color_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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_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 <color_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 <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#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}",meshtoon_frag:"#define TOON\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 <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_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_toon_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}",meshtoon_vert:"#define TOON\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 <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 <shadowmap_vertex>\n\t#include <fog_vertex>\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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <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 STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\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_common_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 <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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 <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_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\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\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 STANDARD\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( TANGENTSPACE_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>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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( TANGENTSPACE_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 <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 <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#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\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 = isPerspectiveMatrix( projectionMatrix );\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\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 <alphamap_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 <alphamap_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 = isPerspectiveMatrix( projectionMatrix );\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}"},pn={basic:{uniforms:Ye([an.common,an.specularmap,an.envmap,an.aomap,an.lightmap,an.fog]),vertexShader:hn.meshbasic_vert,fragmentShader:hn.meshbasic_frag},lambert:{uniforms:Ye([an.common,an.specularmap,an.envmap,an.aomap,an.lightmap,an.emissivemap,an.fog,an.lights,{emissive:{value:new qt(0)}}]),vertexShader:hn.meshlambert_vert,fragmentShader:hn.meshlambert_frag},phong:{uniforms:Ye([an.common,an.specularmap,an.envmap,an.aomap,an.lightmap,an.emissivemap,an.bumpmap,an.normalmap,an.displacementmap,an.fog,an.lights,{emissive:{value:new qt(0)},specular:{value:new qt(1118481)},shininess:{value:30}}]),vertexShader:hn.meshphong_vert,fragmentShader:hn.meshphong_frag},standard:{uniforms:Ye([an.common,an.envmap,an.aomap,an.lightmap,an.emissivemap,an.bumpmap,an.normalmap,an.displacementmap,an.roughnessmap,an.metalnessmap,an.fog,an.lights,{emissive:{value:new qt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:hn.meshphysical_vert,fragmentShader:hn.meshphysical_frag},toon:{uniforms:Ye([an.common,an.specularmap,an.aomap,an.lightmap,an.emissivemap,an.bumpmap,an.normalmap,an.displacementmap,an.gradientmap,an.fog,an.lights,{emissive:{value:new qt(0)},specular:{value:new qt(1118481)},shininess:{value:30}}]),vertexShader:hn.meshtoon_vert,fragmentShader:hn.meshtoon_frag},matcap:{uniforms:Ye([an.common,an.bumpmap,an.normalmap,an.displacementmap,an.fog,{matcap:{value:null}}]),vertexShader:hn.meshmatcap_vert,fragmentShader:hn.meshmatcap_frag},points:{uniforms:Ye([an.points,an.fog]),vertexShader:hn.points_vert,fragmentShader:hn.points_frag},dashed:{uniforms:Ye([an.common,an.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:hn.linedashed_vert,fragmentShader:hn.linedashed_frag},depth:{uniforms:Ye([an.common,an.displacementmap]),vertexShader:hn.depth_vert,fragmentShader:hn.depth_frag},normal:{uniforms:Ye([an.common,an.bumpmap,an.normalmap,an.displacementmap,{opacity:{value:1}}]),vertexShader:hn.normal_vert,fragmentShader:hn.normal_frag},sprite:{uniforms:Ye([an.sprite,an.fog]),vertexShader:hn.sprite_vert,fragmentShader:hn.sprite_frag},background:{uniforms:{uvTransform:{value:new x},t2D:{value:null}},vertexShader:hn.background_vert,fragmentShader:hn.background_frag},cube:{uniforms:Ye([an.envmap,{opacity:{value:1}}]),vertexShader:hn.cube_vert,fragmentShader:hn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:hn.equirect_vert,fragmentShader:hn.equirect_frag},distanceRGBA:{uniforms:Ye([an.common,an.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:hn.distanceRGBA_vert,fragmentShader:hn.distanceRGBA_frag},shadow:{uniforms:Ye([an.lights,an.fog,{color:{value:new qt(0)},opacity:{value:1}}]),vertexShader:hn.shadow_vert,fragmentShader:hn.shadow_frag}};function dn(t,e,n,r){var i,o,a=new qt(0),s=0,c=null,u=0,l=null;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,p,d){var f=r.background,m=t.xr,v=m.getSession&&m.getSession();if(v&&"additive"===v.environmentBlendMode&&(f=null),null===f?h(a,s):f&&f.isColor&&(h(f,1),d=!0),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||306===f.mapping)){void 0===o&&((o=new Be(new qe(1,1,1),new Ze({type:"BackgroundCubeMaterial",uniforms:Xe(pn.cube.uniforms),vertexShader:pn.cube.vertexShader,fragmentShader:pn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o));var g=f.isWebGLCubeRenderTarget?f.texture:f;o.material.uniforms.envMap.value=g,o.material.uniforms.flipEnvMap.value=g.isCubeTexture?-1:1,c===f&&u===g.version&&l===t.toneMapping||(o.material.needsUpdate=!0,c=f,u=g.version,l=t.toneMapping),e.unshift(o,o.geometry,o.material,0,0,null)}else f&&f.isTexture&&(void 0===i&&((i=new Be(new ln(2,2),new Ze({type:"BackgroundMaterial",uniforms:Xe(pn.background.uniforms),vertexShader:pn.background.vertexShader,fragmentShader:pn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(i)),i.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),i.material.uniforms.uvTransform.value.copy(f.matrix),c===f&&u===f.version&&l===t.toneMapping||(i.material.needsUpdate=!0,c=f,u=f.version,l=t.toneMapping),e.unshift(i,i.geometry,i.material,0,0,null))}}}function fn(t,e,n,r){var i,o=r.isWebGL2;this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i)},this.renderInstances=function(r,a,s,c){if(0!==c){var u,l;if(o)u=t,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(u=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[l](i,a,s,c),n.update(s,i,c)}}}function mn(t,e,n){var r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var c=!0===n.logarithmicDepthBuffer,u=t.getParameter(34930),l=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),d=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),v=t.getParameter(36349),g=l>0,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:u,maxVertexTextures:l,maxTextureSize:h,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:o?t.getParameter(36183):0}}function vn(){var t=this,e=null,n=0,r=!1,i=!1,o=new Ot,a=new x,s={value:null,needsUpdate:!1};function c(){s.value!==e&&(s.value=e,s.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(e,n,r,i){var c=null!==e?e.length:0,u=null;if(0!==c){if(u=s.value,!0!==i||null===u){var l=r+4*c,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===u||u.length<l)&&(u=new Float32Array(l));for(var p=0,d=r;p!==c;++p,d+=4)o.copy(e[p]).applyMatrix4(h,a),o.normal.toArray(u,d),u[d+3]=o.constant}s.value=u,s.needsUpdate=!0}return t.numPlanes=c,t.numIntersection=0,u}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=u(t,o,0),n=t.length,a},this.beginShadows=function(){i=!0,u(null)},this.endShadows=function(){i=!1,c()},this.setState=function(t,o,a,l,h,p){if(!r||null===t||0===t.length||i&&!a)i?u(null):c();else{var d=i?0:n,f=4*d,m=h.clippingState||null;s.value=m,m=u(t,l,f,p);for(var v=0;v!==f;++v)m[v]=e[v];h.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=d}}}function gn(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("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=r,r}}}function yn(t,e,n){var r=new WeakMap,i=new WeakMap;function o(t){var a=t.target,s=r.get(a);for(var c in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[c]);a.removeEventListener("dispose",o),r.delete(a);var u=i.get(s);u&&(e.remove(u),i.delete(s)),n.memory.geometries--}function a(t){var n=[],r=t.index,o=t.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var c=0,u=s.length;c<u;c+=3){var l=s[c+0],h=s[c+1],p=s[c+2];n.push(l,h,h,p,p,l)}}else{s=o.array;a=o.version;for(c=0,u=s.length/3-1;c<u;c+=3){l=c+0,h=c+1,p=c+2;n.push(l,h,h,p,p,l)}}var d=new(pe(n)>65535?ce:ae)(n,1);d.version=a,e.update(d,34963);var f=i.get(t);f&&e.remove(f),i.set(t,d)}return{get:function(t,e){var i=r.get(e);return i||(e.addEventListener("dispose",o),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new be).setFromObject(t)),i=e._bufferGeometry),r.set(e,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){var e=i.get(t);if(e){var n=t.index;null!==n&&e.version<n.version&&a(t)}else a(t);return i.get(t)}}}function xn(t,e,n,r){var i,o,a,s=r.isWebGL2;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(r,c,u,l){if(0!==l){var h,p;if(s)h=t,p="drawElementsInstanced";else if(p="drawElementsInstancedANGLE",null===(h=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[p](i,u,o,c*a,l),n.update(u,i,l)}}}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 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("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function Mn(t,e){return Math.abs(e[1])-Math.abs(t[1])}function wn(t){var e={},n=new Float32Array(8);return{update:function(r,i,o,a){var s=r.morphTargetInfluences,c=void 0===s?0:s.length,u=e[i.id];if(void 0===u){u=[];for(var l=0;l<c;l++)u[l]=[l,0];e[i.id]=u}var h=o.morphTargets&&i.morphAttributes.position,p=o.morphNormals&&i.morphAttributes.normal;for(l=0;l<c;l++){0!==(f=u[l])[1]&&(h&&i.deleteAttribute("morphTarget"+l),p&&i.deleteAttribute("morphNormal"+l))}for(l=0;l<c;l++){(f=u[l])[0]=l,f[1]=s[l]}u.sort(Mn);var d=0;for(l=0;l<8;l++){var f;if(f=u[l]){var m=f[0],v=f[1];if(v){h&&i.setAttribute("morphTarget"+l,h[m]),p&&i.setAttribute("morphNormal"+l,p[m]),n[l]=v,d+=v;continue}}n[l]=0}var g=i.morphTargetsRelative?1:1-d;a.getUniforms().setValue(t,"morphTargetBaseInfluence",g),a.getUniforms().setValue(t,"morphTargetInfluences",n)}}}function _n(t,e,n,r){var i=new WeakMap;return{update:function(t){var o=r.render.frame,a=t.geometry,s=e.get(t,a);return i.get(s)!==o&&(a.isGeometry&&s.updateFromObject(t),e.update(s),i.set(s,o)),t.isInstancedMesh&&n.update(t.instanceMatrix,34962),s},dispose:function(){i=new WeakMap}}}function Sn(t,e,n,r,i,o,a,s,c,u){t=void 0!==t?t:[],e=void 0!==e?e:301,a=void 0!==a?a:1022,w.call(this,t,e,n,r,i,o,a,s,c,u),this.flipY=!1}function En(t,e,n,r){w.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Tn(t,e,n,r){w.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}pn.physical={uniforms:Ye([pn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new y(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new qt(0)},transparency:{value:0}}]),vertexShader:hn.meshphysical_vert,fragmentShader:hn.meshphysical_frag},Sn.prototype=Object.create(w.prototype),Sn.prototype.constructor=Sn,Sn.prototype.isCubeTexture=!0,Object.defineProperty(Sn.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),En.prototype=Object.create(w.prototype),En.prototype.constructor=En,En.prototype.isDataTexture2DArray=!0,Tn.prototype=Object.create(w.prototype),Tn.prototype.constructor=Tn,Tn.prototype.isDataTexture3D=!0;var Ln=new w,An=new En,Pn=new Tn,Rn=new Sn,On=[],Nn=[],Cn=new Float32Array(16),In=new Float32Array(9),Dn=new Float32Array(4);function zn(t,e,n){var r=t[0];if(r<=0||r>0)return t;var i=e*n,o=On[i];if(void 0===o&&(o=new Float32Array(i),On[i]=o),0!==e){r.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function jn(t,e){if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Bn(t,e){for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function kn(t,e){var n=Nn[e];void 0===n&&(n=new Int32Array(e),Nn[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function Fn(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Un(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(jn(n,e))return;t.uniform2fv(this.addr,e),Bn(n,e)}}function Gn(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(jn(n,e))return;t.uniform3fv(this.addr,e),Bn(n,e)}}function Hn(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(jn(n,e))return;t.uniform4fv(this.addr,e),Bn(n,e)}}function Vn(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(jn(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Bn(n,e)}else{if(jn(n,r))return;Dn.set(r),t.uniformMatrix2fv(this.addr,!1,Dn),Bn(n,r)}}function Wn(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(jn(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Bn(n,e)}else{if(jn(n,r))return;In.set(r),t.uniformMatrix3fv(this.addr,!1,In),Bn(n,r)}}function qn(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(jn(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Bn(n,e)}else{if(jn(n,r))return;Cn.set(r),t.uniformMatrix4fv(this.addr,!1,Cn),Bn(n,r)}}function Xn(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(e||Ln,i)}function Yn(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||An,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||Pn,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.safeSetTextureCube(e||Rn,i)}function Kn(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Qn(t,e){var n=this.cache;jn(n,e)||(t.uniform2iv(this.addr,e),Bn(n,e))}function $n(t,e){var n=this.cache;jn(n,e)||(t.uniform3iv(this.addr,e),Bn(n,e))}function tr(t,e){var n=this.cache;jn(n,e)||(t.uniform4iv(this.addr,e),Bn(n,e))}function er(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=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=zn(e,this.size,2);t.uniform2fv(this.addr,n)}function cr(t,e){var n=zn(e,this.size,3);t.uniform3fv(this.addr,n)}function ur(t,e){var n=zn(e,this.size,4);t.uniform4fv(this.addr,n)}function lr(t,e){var n=zn(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function hr(t,e){var n=zn(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function pr(t,e){var n=zn(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function dr(t,e,n){var r=e.length,i=kn(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTexture2D(e[o]||Ln,i[o])}function fr(t,e,n){var r=e.length,i=kn(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTextureCube(e[o]||Rn,i[o])}function mr(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Fn;case 35664:return Un;case 35665:return Gn;case 35666:return Hn;case 35674:return Vn;case 35675:return Wn;case 35676:return qn;case 5124:case 35670:return Kn;case 35667:case 35671:return Qn;case 35668:case 35672:return $n;case 35669:case 35673:return tr;case 5125:return er;case 35678:case 36198:case 36298:case 36306:case 35682:return Xn;case 35679:case 36299:case 36307:return Jn;case 35680:case 36300:case 36308:case 36293:return Zn;case 36289:case 36303:case 36311:case 36292:return Yn}}(e.type)}function vr(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 ur;case 35674:return lr;case 35675:return hr;case 35676:return pr;case 5124:case 35670:return rr;case 35667:case 35671:return ir;case 35668:case 35672:return or;case 35669:case 35673:return ar;case 35678:case 36198:case 36298:case 36306:case 35682:return dr;case 35680:case 36300:case 36308:case 36293:return fr}}(e.type)}function gr(t){this.id=t,this.seq=[],this.map={}}vr.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Bn(e,t)},gr.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 br(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],u=o[3];if(c&&(s|=0),void 0===u||"["===u&&a+2===i){xr(n,void 0===u?new mr(s,t,e):new vr(s,t,e));break}var l=n.map[s];void 0===l&&xr(n,l=new gr(s)),n=l}}function Mr(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),r=0;r<n;++r){var i=t.getActiveUniform(e,r);br(i,t.getUniformLocation(e,i.name),this)}}function wr(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}Mr.prototype.setValue=function(t,e,n,r){var i=this.map[e];void 0!==i&&i.setValue(t,n,r)},Mr.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},Mr.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)}},Mr.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 _r=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 ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function Er(t,e,n){var r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+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")}(t.getShaderSource(e))}function Tr(t,e){var n=Sr(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Lr(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 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Ar(t){return""!==t}function Pr(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).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Rr(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var Or=/^[ \t]*#include +<([\w\d./]+)>/gm;function Nr(t){return t.replace(Or,Cr)}function Cr(t,e){var n=hn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Nr(n)}var Ir=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Dr=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function zr(t){return t.replace(Dr,Br).replace(Ir,jr)}function jr(t,e,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Br(t,e,n,r)}function Br(t,e,n,r){for(var i="",o=parseInt(e);o<parseInt(n);o++)i+=r.replace(/\[ i \]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return i}function kr(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Fr(t,e,n){var r,i,o,a,s,c=t.getContext(),u=n.defines,l=n.vertexShader,h=n.fragmentShader,p=function(t){var e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(n),d=function(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case 301:case 302:e="ENVMAP_TYPE_CUBE";break;case 306:case 307:e="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:e="ENVMAP_TYPE_EQUIREC";break;case 305:e="ENVMAP_TYPE_SPHERE"}return e}(n),f=function(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case 302:case 304:e="ENVMAP_MODE_REFRACTION"}return e}(n),m=function(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(n),v=t.gammaFactor>0?t.gammaFactor:1,g=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ar).join("\n")}(n),y=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(u),x=c.createProgram();if(n.isRawShaderMaterial?((r=[y].filter(Ar).join("\n")).length>0&&(r+="\n"),(i=[g,y].filter(Ar).join("\n")).length>0&&(i+="\n")):(r=[kr(n),"#define SHADER_NAME "+n.shaderName,y,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+v,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+p:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Ar).join("\n"),i=[g,kr(n),"#define SHADER_NAME "+n.shaderName,y,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.envMap?"#define "+f:"",n.envMap?"#define "+m:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+p:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?hn.tonemapping_pars_fragment:"",0!==n.toneMapping?Lr("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?hn.encodings_pars_fragment:"",n.mapEncoding?Tr("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?Tr("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?Tr("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?Tr("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?Tr("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?(o="linearToOutputTexel",a=n.outputEncoding,s=Sr(a),"vec4 "+o+"( vec4 value ) { return LinearTo"+s[0]+s[1]+"; }"):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Ar).join("\n")),l=Rr(l=Pr(l=Nr(l),n),n),h=Rr(h=Pr(h=Nr(h),n),n),l=zr(l),h=zr(h),n.isWebGL2&&!n.isRawShaderMaterial){var b=!1,M=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==l.match(M)&&null!==h.match(M)&&(b=!0,l=l.replace(M,""),h=h.replace(M,"")),r=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,i=["#version 300 es\n","#define varying in",b?"":"out highp vec4 pc_fragColor;",b?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+i}var w,_,S=i+h,E=wr(c,35633,r+l),T=wr(c,35632,S);if(c.attachShader(x,E),c.attachShader(x,T),void 0!==n.index0AttributeName?c.bindAttribLocation(x,0,n.index0AttributeName):!0===n.morphTargets&&c.bindAttribLocation(x,0,"position"),c.linkProgram(x),t.debug.checkShaderErrors){var L=c.getProgramInfoLog(x).trim(),A=c.getShaderInfoLog(E).trim(),P=c.getShaderInfoLog(T).trim(),R=!0,O=!0;if(!1===c.getProgramParameter(x,35714)){R=!1;var N=Er(c,E,"vertex"),C=Er(c,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",c.getError(),"35715",c.getProgramParameter(x,35715),"gl.getProgramInfoLog",L,N,C)}else""!==L?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",L):""!==A&&""!==P||(O=!1);O&&(this.diagnostics={runnable:R,programLog:L,vertexShader:{log:A,prefix:r},fragmentShader:{log:P,prefix:i}})}return c.deleteShader(E),c.deleteShader(T),this.getUniforms=function(){return void 0===w&&(w=new Mr(c,x)),w},this.getAttributes=function(){return void 0===_&&(_=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,x)),_},this.destroy=function(){c.deleteProgram(x),this.program=void 0},this.name=n.shaderName,this.id=_r++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=E,this.fragmentShader=T,this}function Ur(t,e,n){var r=[],i=n.isWebGL2,o=n.logarithmicDepthBuffer,a=n.floatVertexTextures,s=n.precision,c=n.maxVertexUniforms,u=n.vertexTextures,l={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},h=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function p(t){var e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=3e3,e}this.getParameters=function(r,h,d,f,m,v,g){var y=f.fog,x=r.isMeshStandardMaterial?f.environment:null,b=r.envMap||x,M=l[r.type],w=g.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(a)return 1024;var n=c,r=Math.floor((n-20)/4),i=Math.min(r,e.length);return i<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+i+"."),0):i}(g):0;null!==r.precision&&(s=n.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",s,"instead.");var _=function(t,e){var n;if(e){var r=pn[e];n={name:t.type,uniforms:Je.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return n}(r,M);r.onBeforeCompile(_,t);var S=t.getRenderTarget();return{isWebGL2:i,shaderID:M,shaderName:_.name,uniforms:_.uniforms,vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:s,instancing:!0===g.isInstancedMesh,supportsVertexTextures:u,outputEncoding:null!==S?p(S.texture):t.outputEncoding,map:!!r.map,mapEncoding:p(r.map),matcap:!!r.matcap,matcapEncoding:p(r.matcap),envMap:!!b,envMapMode:b&&b.mapping,envMapEncoding:p(b),envMapCubeUV:!!b&&(306===b.mapping||307===b.mapping),lightMap:!!r.lightMap,lightMapEncoding:p(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:p(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:1===r.normalMapType,tangentSpaceNormalMap:0===r.normalMapType,clearcoatMap:!!r.clearcoatMap,clearcoatRoughnessMap:!!r.clearcoatRoughnessMap,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatMap||r.clearcoatRoughnessMap||r.clearcoatNormalMap||r.displacementMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||!r.displacementMap),fog:!!y,useFog:r.fog,fogExp2:y&&y.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:o,skinning:r.skinning&&w>0,maxBones:w,useVertexTexture:a,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numClippingPlanes:m,numClipIntersection:v,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&d.length>0,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:i||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:i||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:r.onBeforeCompile}},this.getProgramCacheKey=function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);if(void 0===e.isRawShaderMaterial){for(var i=0;i<h.length;i++)n.push(e[h[i]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(e,n){for(var i,o=0,a=r.length;o<a;o++){var s=r[o];if(s.cacheKey===n){++(i=s).usedTimes;break}}return void 0===i&&(i=new Fr(t,n,e),r.push(i)),i},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},this.programs=r}function Gr(){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 Hr(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 Wr(){var t=[],e=0,n=[],r=[],i={id:-1};function o(n,r,o,a,s,c){var u=t[e];return void 0===u?(u={id:n.id,object:n,geometry:r,material:o,program:o.program||i,groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},t[e]=u):(u.id=n.id,u.object=n,u.geometry=r,u.material=o,u.program=o.program||i,u.groupOrder=a,u.renderOrder=n.renderOrder,u.z=s,u.group=c),e++,u}return{opaque:n,transparent:r,init:function(){e=0,n.length=0,r.length=0},push:function(t,e,i,a,s,c){var u=o(t,e,i,a,s,c);(!0===i.transparent?r:n).push(u)},unshift:function(t,e,i,a,s,c){var u=o(t,e,i,a,s,c);(!0===i.transparent?r:n).unshift(u)},finish:function(){for(var n=e,r=t.length;n<r;n++){var i=t[n];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(t,e){n.length>1&&n.sort(t||Hr),r.length>1&&r.sort(e||Vr)}}}function qr(){var t=new WeakMap;function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}return{get:function(n,r){var i,o=t.get(n);return void 0===o?(i=new Wr,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):void 0===(i=o.get(r))&&(i=new Wr,o.set(r,i)),i},dispose:function(){t=new WeakMap}}}function Xr(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new P,color:new qt};break;case"SpotLight":n={position:new P,direction:new P,color:new qt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new P,color:new qt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new P,skyColor:new qt,groundColor:new qt};break;case"RectAreaLight":n={color:new qt,position:new P,halfWidth:new P,halfHeight:new P}}return t[e.id]=n,n}}}var Yr=0;function Jr(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Zr(){for(var t,e=new Xr,n=(t={},{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new y};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new y,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},i=0;i<9;i++)r.probe.push(new P);var o=new P,a=new j,s=new j;return{setup:function(t,i,c){for(var u=0,l=0,h=0,p=0;p<9;p++)r.probe[p].set(0,0,0);var d=0,f=0,m=0,v=0,g=0,y=0,x=0,b=0,M=c.matrixWorldInverse;t.sort(Jr),p=0;for(var w=t.length;p<w;p++){var _=t[p],S=_.color,E=_.intensity,T=_.distance,L=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)u+=S.r*E,l+=S.g*E,h+=S.b*E;else if(_.isLightProbe)for(var A=0;A<9;A++)r.probe[A].addScaledVector(_.sh.coefficients[A],E);else if(_.isDirectionalLight){if((O=e.get(_)).color.copy(_.color).multiplyScalar(_.intensity),O.direction.setFromMatrixPosition(_.matrixWorld),o.setFromMatrixPosition(_.target.matrixWorld),O.direction.sub(o),O.direction.transformDirection(M),_.castShadow){var P=_.shadow;(R=n.get(_)).shadowBias=P.bias,R.shadowRadius=P.radius,R.shadowMapSize=P.mapSize,r.directionalShadow[d]=R,r.directionalShadowMap[d]=L,r.directionalShadowMatrix[d]=_.shadow.matrix,y++}r.directional[d]=O,d++}else if(_.isSpotLight){if((O=e.get(_)).position.setFromMatrixPosition(_.matrixWorld),O.position.applyMatrix4(M),O.color.copy(S).multiplyScalar(E),O.distance=T,O.direction.setFromMatrixPosition(_.matrixWorld),o.setFromMatrixPosition(_.target.matrixWorld),O.direction.sub(o),O.direction.transformDirection(M),O.coneCos=Math.cos(_.angle),O.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),O.decay=_.decay,_.castShadow){P=_.shadow;(R=n.get(_)).shadowBias=P.bias,R.shadowRadius=P.radius,R.shadowMapSize=P.mapSize,r.spotShadow[m]=R,r.spotShadowMap[m]=L,r.spotShadowMatrix[m]=_.shadow.matrix,b++}r.spot[m]=O,m++}else if(_.isRectAreaLight){(O=e.get(_)).color.copy(S).multiplyScalar(E),O.position.setFromMatrixPosition(_.matrixWorld),O.position.applyMatrix4(M),s.identity(),a.copy(_.matrixWorld),a.premultiply(M),s.extractRotation(a),O.halfWidth.set(.5*_.width,0,0),O.halfHeight.set(0,.5*_.height,0),O.halfWidth.applyMatrix4(s),O.halfHeight.applyMatrix4(s),r.rectArea[v]=O,v++}else if(_.isPointLight){if((O=e.get(_)).position.setFromMatrixPosition(_.matrixWorld),O.position.applyMatrix4(M),O.color.copy(_.color).multiplyScalar(_.intensity),O.distance=_.distance,O.decay=_.decay,_.castShadow){var R;P=_.shadow;(R=n.get(_)).shadowBias=P.bias,R.shadowRadius=P.radius,R.shadowMapSize=P.mapSize,R.shadowCameraNear=P.camera.near,R.shadowCameraFar=P.camera.far,r.pointShadow[f]=R,r.pointShadowMap[f]=L,r.pointShadowMatrix[f]=_.shadow.matrix,x++}r.point[f]=O,f++}else if(_.isHemisphereLight){var O;(O=e.get(_)).direction.setFromMatrixPosition(_.matrixWorld),O.direction.transformDirection(M),O.direction.normalize(),O.skyColor.copy(_.color).multiplyScalar(E),O.groundColor.copy(_.groundColor).multiplyScalar(E),r.hemi[g]=O,g++}}r.ambient[0]=u,r.ambient[1]=l,r.ambient[2]=h;var N=r.hash;N.directionalLength===d&&N.pointLength===f&&N.spotLength===m&&N.rectAreaLength===v&&N.hemiLength===g&&N.numDirectionalShadows===y&&N.numPointShadows===x&&N.numSpotShadows===b||(r.directional.length=d,r.spot.length=m,r.rectArea.length=v,r.point.length=f,r.hemi.length=g,r.directionalShadow.length=y,r.directionalShadowMap.length=y,r.pointShadow.length=x,r.pointShadowMap.length=x,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=y,r.pointShadowMatrix.length=x,r.spotShadowMatrix.length=b,N.directionalLength=d,N.pointLength=f,N.spotLength=m,N.rectAreaLength=v,N.hemiLength=g,N.numDirectionalShadows=y,N.numPointShadows=x,N.numSpotShadows=b,r.version=Yr++)},state:r}}function Kr(){var t=new Zr,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 Qr(){var t=new WeakMap;function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}return{get:function(n,r){var i;return!1===t.has(n)?(i=new Kr,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):!1===t.get(n).has(r)?(i=new Kr,t.get(n).set(r,i)):i=t.get(n).get(r),i},dispose:function(){t=new WeakMap}}}function $r(t){Qt.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.setValues(t)}function ti(t){Qt.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new P,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.setValues(t)}$r.prototype=Object.create(Qt.prototype),$r.prototype.constructor=$r,$r.prototype.isMeshDepthMaterial=!0,$r.prototype.copy=function(t){return Qt.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},ti.prototype=Object.create(Qt.prototype),ti.prototype.constructor=ti,ti.prototype.isMeshDistanceMaterial=!0,ti.prototype.copy=function(t){return Qt.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};function ei(t,e,n){var r=new on,i=new y,o=new y,a=new _,s=[],c=[],u={},l={0:1,1:0,2:2},h=new Ze({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new y},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=h.clone();p.defines.HORIZONAL_PASS=1;var d=new be;d.setAttribute("position",new ee(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var f=new Be(d,h),m=this;function v(n,r){var i=e.update(f);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,h,f,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,p,f,null)}function g(t,e,n){var r=t<<0|e<<1|n<<2,i=s[r];return void 0===i&&(i=new $r({depthPacking:3201,morphTargets:t,skinning:e}),s[r]=i),i}function x(t,e,n){var r=t<<0|e<<1|n<<2,i=c[r];return void 0===i&&(i=new ti({morphTargets:t,skinning:e}),c[r]=i),i}function b(e,n,r,i,o,a,s){var c=null,h=g,p=e.customDepthMaterial;if(!0===i.isPointLight&&(h=x,p=e.customDistanceMaterial),void 0===p){var d=!1;!0===r.morphTargets&&(d=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var f=!1;!0===e.isSkinnedMesh&&(!0===r.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),c=h(d,f,!0===e.isInstancedMesh)}else c=p;if(t.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=c.uuid,v=r.uuid,y=u[m];void 0===y&&(y={},u[m]=y);var b=y[v];void 0===b&&(b=c.clone(),y[v]=b),c=b}return c.visible=r.visible,c.wireframe=r.wireframe,c.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:l[r.side],c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,!0===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=o,c.farDistance=a),c}function M(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var c=e.update(n),u=n.material;if(Array.isArray(u))for(var l=c.groups,h=0,p=l.length;h<p;h++){var d=l[h],f=u[d.materialIndex];if(f&&f.visible){var m=b(n,c,f,a,o.near,o.far,s);t.renderBufferDirect(o,null,c,m,n,d)}}else if(u.visible){m=b(n,c,u,a,o.near,o.far,s);t.renderBufferDirect(o,null,c,m,n,null)}}for(var v=n.children,g=0,y=v.length;g<y;g++)M(v[g],i,o,a,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,s,c){if(!1!==m.enabled&&(!1!==m.autoUpdate||!1!==m.needsUpdate)&&0!==e.length){var u=t.getRenderTarget(),l=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),p=t.state;p.setBlending(0),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(var d=0,f=e.length;d<f;d++){var g=e[d],y=g.shadow;if(void 0!==y){i.copy(y.mapSize);var x=y.getFrameExtents();if(i.multiply(x),o.copy(y.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/x.x),i.x=o.x*x.x,y.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/x.y),i.y=o.y*x.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var b={minFilter:1006,magFilter:1006,format:1023};y.map=new S(i.x,i.y,b),y.map.texture.name=g.name+".shadowMap",y.mapPass=new S(i.x,i.y,b),y.camera.updateProjectionMatrix()}if(null===y.map){b={minFilter:1003,magFilter:1003,format:1023};y.map=new S(i.x,i.y,b),y.map.texture.name=g.name+".shadowMap",y.camera.updateProjectionMatrix()}t.setRenderTarget(y.map),t.clear();for(var w=y.getViewportCount(),_=0;_<w;_++){var E=y.getViewport(_);a.set(o.x*E.x,o.y*E.y,o.x*E.z,o.y*E.w),p.viewport(a),y.updateMatrices(g,_),r=y.getFrustum(),M(s,c,y.camera,g,this.type)}y.isPointLightShadow||3!==this.type||v(y,c)}else console.warn("THREE.WebGLShadowMap:",g,"has no shadow.")}m.needsUpdate=!1,t.setRenderTarget(u,l,h)}}}function ni(t,e,n){var r=n.isWebGL2;var i=new function(){var e=!1,n=new _,r=null,i=new _(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?k(2929):F(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,n=null,r=null,i=null}}},a=new function(){var e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null;return{setTest:function(t){e||(t?k(2960):F(2960))},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,a){r===e&&i===n&&o===a||(t.stencilFunc(e,n,a),r=e,i=n,o=a)},setOp:function(e,n,r){a===e&&s===n&&c===r||(t.stencilOp(e,n,r),a=e,s=n,c=r)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null}}},s=t.getParameter(34921),c=new Uint8Array(s),u=new Uint8Array(s),l=new Uint8Array(s),h={},p=null,d=null,f=null,m=null,v=null,g=null,y=null,x=null,b=null,M=!1,w=null,S=null,E=null,T=null,L=null,A=t.getParameter(35661),P=!1,R=0,O=t.getParameter(7938);-1!==O.indexOf("WebGL")?(R=parseFloat(/^WebGL\ ([0-9])/.exec(O)[1]),P=R>=1):-1!==O.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(O)[1]),P=R>=2);var N=null,C={},I=new _,D=new _;function z(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 j={};function B(n,i){(c[n]=1,0===u[n]&&(t.enableVertexAttribArray(n),u[n]=1),l[n]!==i)&&((r?t:e.get("ANGLE_instanced_arrays"))[r?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),l[n]=i)}function k(e){!0!==h[e]&&(t.enable(e),h[e]=!0)}function F(e){!1!==h[e]&&(t.disable(e),h[e]=!1)}j[3553]=z(3553,3553,1),j[34067]=z(34067,34069,6),i.setClear(0,0,0,1),o.setClear(1),a.setClear(0),k(2929),o.setFunc(3),W(!1),q(1),k(2884),V(0);var U={100:32774,101:32778,102:32779};if(r)U[103]=32775,U[104]=32776;else{var G=e.get("EXT_blend_minmax");null!==G&&(U[103]=G.MIN_EXT,U[104]=G.MAX_EXT)}var H={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function V(e,n,r,i,o,a,s,c){if(0!==e){if(d||(k(3042),d=!0),5===e)o=o||n,a=a||r,s=s||i,n===m&&o===y||(t.blendEquationSeparate(U[n],U[o]),m=n,y=o),r===v&&i===g&&a===x&&s===b||(t.blendFuncSeparate(H[r],H[i],H[a],H[s]),v=r,g=i,x=a,b=s),f=e,M=null;else if(e!==f||c!==M){if(100===m&&100===y||(t.blendEquation(32774),m=100,y=100),c)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("THREE.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("THREE.WebGLState: Invalid blending: ",e)}v=null,g=null,x=null,b=null,f=e,M=c}}else d&&(F(3042),d=!1)}function W(e){w!==e&&(e?t.frontFace(2304):t.frontFace(2305),w=e)}function q(e){0!==e?(k(2884),e!==S&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):F(2884),S=e}function X(e,n,r){e?(k(32823),T===n&&L===r||(t.polygonOffset(n,r),T=n,L=r)):F(32823)}function Y(e){void 0===e&&(e=33984+A-1),N!==e&&(t.activeTexture(e),N=e)}return{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){B(t,0)},enableAttributeAndDivisor:B,disableUnusedAttributes:function(){for(var e=0,n=u.length;e!==n;++e)u[e]!==c[e]&&(t.disableVertexAttribArray(e),u[e]=0)},vertexAttribPointer:function(e,n,i,o,a,s){!0!==r||5124!==i&&5125!==i?t.vertexAttribPointer(e,n,i,o,a,s):t.vertexAttribIPointer(e,n,i,o,a,s)},enable:k,disable:F,useProgram:function(e){return p!==e&&(t.useProgram(e),p=e,!0)},setBlending:V,setMaterial:function(t,e){2===t.side?F(2884):k(2884);var n=1===t.side;e&&(n=!n),W(n),1===t.blending&&!1===t.transparent?V(0):V(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);var r=t.stencilWrite;a.setTest(r),r&&(a.setMask(t.stencilWriteMask),a.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),X(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:W,setCullFace:q,setLineWidth:function(e){e!==E&&(P&&t.lineWidth(e),E=e)},setPolygonOffset:X,setScissorTest:function(t){t?k(3089):F(3089)},activeTexture:Y,bindTexture:function(e,n){null===N&&Y();var r=C[N];void 0===r&&(r={type:void 0,texture:void 0},C[N]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||j[e]),r.type=e,r.texture=n)},unbindTexture:function(){var e=C[N];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===I.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),I.copy(e))},viewport:function(e){!1===D.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),D.copy(e))},reset:function(){for(var e=0;e<u.length;e++)1===u[e]&&(t.disableVertexAttribArray(e),u[e]=0);h={},N=null,C={},p=null,f=null,w=null,S=null,i.reset(),o.reset(),a.reset()}}}function ri(t,e,n,r,i,o,a){var s,c=i.isWebGL2,u=i.maxTextures,l=i.maxCubemapSize,h=i.maxTextureSize,p=i.maxSamples,d=new WeakMap,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function m(t,e){return f?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function v(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){var o=e?g.floorPowerOfTwo:Math.floor,a=o(i*t.width),c=o(i*t.height);void 0===s&&(s=m(a,c));var u=n?m(a,c):s;return u.width=a,u.height=c,u.getContext("2d").drawImage(t,0,0,a,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+c+")."),u}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return g.isPowerOfTwo(t.width)&&g.isPowerOfTwo(t.height)}function x(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function b(e,n,i,o){t.generateMipmap(e),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function M(n,r,i){if(!1===c)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function w(t){return 1003===t||1004===t||1005===t?9728:9729}function _(e){var n=e.target;n.removeEventListener("dispose",_),function(e){var n=r.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),r.remove(e)}(n),n.isVideoTexture&&d.delete(n),a.memory.textures--}function S(e){var n=e.target;n.removeEventListener("dispose",S),function(e){var n=r.get(e),i=r.get(e.texture);if(!e)return;void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(e.texture),r.remove(e)}(n),a.memory.textures--}var E=0;function T(t,e){var i=r.get(t);if(t.isVideoTexture&&function(t){var e=a.render.frame;d.get(t)!==e&&(d.set(t,e),t.update())}(t),t.version>0&&i.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void C(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,i.__webglTexture)}function L(e,i){if(6===e.image.length){var a=r.get(e);if(e.version>0&&a.__version!==e.version){N(a,e),n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),u=e.image[0]&&e.image[0].isDataTexture,h=[],p=0;p<6;p++)h[p]=s||u?u?e.image[p].image:e.image[p]:v(e.image[p],!1,!0,l);var d,f=h[0],m=y(f)||c,g=o.convert(e.format),w=o.convert(e.type),_=M(e.internalFormat,g,w);if(O(34067,e,m),s){for(p=0;p<6;p++){d=h[p].mipmaps;for(var S=0;S<d.length;S++){var E=d[S];1023!==e.format&&1022!==e.format?null!==g?n.compressedTexImage2D(34069+p,S,_,E.width,E.height,0,E.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+p,S,_,E.width,E.height,0,g,w,E.data)}}a.__maxMipLevel=d.length-1}else{d=e.mipmaps;for(p=0;p<6;p++)if(u){n.texImage2D(34069+p,0,_,h[p].width,h[p].height,0,g,w,h[p].data);for(S=0;S<d.length;S++){var T=(E=d[S]).image[p].image;n.texImage2D(34069+p,S+1,_,T.width,T.height,0,g,w,T.data)}}else{n.texImage2D(34069+p,0,_,g,w,h[p]);for(S=0;S<d.length;S++){E=d[S];n.texImage2D(34069+p,S+1,_,g,w,E.image[p])}}a.__maxMipLevel=d.length}x(e,m)&&b(34067,e,f.width,f.height),a.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture)}}function A(t,e){n.activeTexture(33984+e),n.bindTexture(34067,r.get(t).__webglTexture)}var P={1e3:10497,1001:33071,1002:33648},R={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function O(n,o,a){a?(t.texParameteri(n,10242,P[o.wrapS]),t.texParameteri(n,10243,P[o.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,P[o.wrapR]),t.texParameteri(n,10240,R[o.magFilter]),t.texParameteri(n,10241,R[o.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),1001===o.wrapS&&1001===o.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,w(o.magFilter)),t.texParameteri(n,10241,w(o.minFilter)),1003!==o.minFilter&&1006!==o.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=e.get("EXT_texture_filter_anisotropic");if(s){if(1015===o.type&&null===e.get("OES_texture_float_linear"))return;if(1016===o.type&&null===(c||e.get("OES_texture_half_float_linear")))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function N(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",_),e.__webglTexture=t.createTexture(),a.memory.textures++)}function C(e,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),N(e,r),n.activeTexture(33984+i),n.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);var s=function(t){return!c&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(r)&&!1===y(r.image),u=v(r.image,s,!1,h),l=y(u)||c,p=o.convert(r.format),d=o.convert(r.type),f=M(r.internalFormat,p,d);O(a,r,l);var m,g=r.mipmaps;if(r.isDepthTexture)f=6402,c?f=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===f&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,d=o.convert(r.type)),1027===r.format&&6402===f&&(f=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,d=o.convert(r.type))),n.texImage2D(3553,0,f,u.width,u.height,0,p,d,null);else if(r.isDataTexture)if(g.length>0&&l){for(var w=0,_=g.length;w<_;w++)m=g[w],n.texImage2D(3553,w,f,m.width,m.height,0,p,d,m.data);r.generateMipmaps=!1,e.__maxMipLevel=g.length-1}else n.texImage2D(3553,0,f,u.width,u.height,0,p,d,u.data),e.__maxMipLevel=0;else if(r.isCompressedTexture){for(w=0,_=g.length;w<_;w++)m=g[w],1023!==r.format&&1022!==r.format?null!==p?n.compressedTexImage2D(3553,w,f,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,w,f,m.width,m.height,0,p,d,m.data);e.__maxMipLevel=g.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,f,u.width,u.height,u.depth,0,p,d,u.data),e.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,f,u.width,u.height,u.depth,0,p,d,u.data),e.__maxMipLevel=0;else if(g.length>0&&l){for(w=0,_=g.length;w<_;w++)m=g[w],n.texImage2D(3553,w,f,p,d,m);r.generateMipmaps=!1,e.__maxMipLevel=g.length-1}else n.texImage2D(3553,0,f,p,d,u),e.__maxMipLevel=0;x(r,l)&&b(a,r,u.width,u.height),e.__version=r.version,r.onUpdate&&r.onUpdate(r)}function I(e,i,a,s){var c=o.convert(i.texture.format),u=o.convert(i.texture.type),l=M(i.texture.internalFormat,c,u);n.texImage2D(s,0,l,i.width,i.height,0,c,u,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,s,r.get(i.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function D(e,n,r){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){var i=33189;if(r){var a=n.depthTexture;a&&a.isDepthTexture&&(1015===a.type?i=36012:1014===a.type&&(i=33190));var s=j(n);t.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else t.renderbufferStorage(36161,i,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){if(r){s=j(n);t.renderbufferStorageMultisample(36161,s,35056,n.width,n.height)}else t.renderbufferStorage(36161,34041,n.width,n.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{var c=o.convert(n.texture.format),u=o.convert(n.texture.type);i=M(n.texture.internalFormat,c,u);if(r){s=j(n);t.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else t.renderbufferStorage(36161,i,n.width,n.height)}t.bindRenderbuffer(36161,null)}function z(e){var n=r.get(e),i=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),T(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)t.framebufferTexture2D(36160,36096,3553,i,0);else{if(1027!==n.depthTexture.format)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),D(n.__webglDepthbuffer[o],e,!1)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),D(n.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}function j(t){return c&&t.isWebGLMultisampleRenderTarget?Math.min(p,t.samples):0}var B=!1,k=!1;this.allocateTextureUnit=function(){var t=E;return t>=u&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+u),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=T,this.setTexture2DArray=function(t,e){var i=r.get(t);t.version>0&&i.__version!==t.version?C(i,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){var i=r.get(t);t.version>0&&i.__version!==t.version?C(i,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=L,this.setTextureCubeDynamic=A,this.setupRenderTarget=function(e){var i=r.get(e),s=r.get(e.texture);e.addEventListener("dispose",S),s.__webglTexture=t.createTexture(),a.memory.textures++;var u=!0===e.isWebGLCubeRenderTarget,l=!0===e.isWebGLMultisampleRenderTarget,h=y(e)||c;if(!c||1022!==e.texture.format||1015!==e.texture.type&&1016!==e.texture.type||(e.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),u){i.__webglFramebuffer=[];for(var p=0;p<6;p++)i.__webglFramebuffer[p]=t.createFramebuffer()}else if(i.__webglFramebuffer=t.createFramebuffer(),l)if(c){i.__webglMultisampledFramebuffer=t.createFramebuffer(),i.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var d=o.convert(e.texture.format),f=o.convert(e.texture.type),m=M(e.texture.internalFormat,d,f),v=j(e);t.renderbufferStorageMultisample(36161,v,m,e.width,e.height),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(i.__webglDepthRenderbuffer=t.createRenderbuffer(),D(i.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(u){n.bindTexture(34067,s.__webglTexture),O(34067,e.texture,h);for(p=0;p<6;p++)I(i.__webglFramebuffer[p],e,36064,34069+p);x(e.texture,h)&&b(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),O(3553,e.texture,h),I(i.__webglFramebuffer,e,36064,3553),x(e.texture,h)&&b(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&z(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(x(e,y(t)||c)){var i=t.isWebGLCubeRenderTarget?34067:3553,o=r.get(e).__webglTexture;n.bindTexture(i,o),b(i,e,t.width,t.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(c){var n=r.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var i=e.width,o=e.height,a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),B=!0),t=t.texture),T(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===k&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),k=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?L(t,e):A(t,e)}}function ii(t,e,n){var r=n.isWebGL2;return{convert:function(t){var n;if(1009===t)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(1012===t)return 5123;if(1013===t)return 5124;if(1014===t)return 5125;if(1015===t)return 5126;if(1016===t)return r?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(1022===t)return 6407;if(1023===t)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(1026===t)return 6402;if(1027===t)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===t)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===t)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&null!==(n=e.get("WEBGL_compressed_texture_etc"))){if(37492===t)return n.COMPRESSED_RGB8_ETC2;if(37496===t)return n.COMPRESSED_RGBA8_ETC2_EAC}return 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||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:36492===t?null!==(n=e.get("EXT_texture_compression_bptc"))?t:null:1020===t?r?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function oi(t){Qe.call(this),this.cameras=t||[]}function ai(){et.call(this),this.type="Group"}function si(){this._targetRay=null,this._grip=null}function ci(t,e){var n=this,r=null,i=1,o=null,a="local-floor",s=null,c=[],u=new Map,l=new Qe;l.layers.enable(1),l.viewport=new _;var h=new Qe;h.layers.enable(2),h.viewport=new _;var p=[l,h],d=new oi;d.layers.enable(1),d.layers.enable(2);var f=null,m=null;function v(t){var e=u.get(t.inputSource);e&&e.dispatchEvent({type:t.type})}function g(){u.forEach((function(t,e){t.disconnect(e)})),u.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),E.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(t){o=t,E.setContext(r),E.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function x(t){for(var e=r.inputSources,n=0;n<c.length;n++)u.set(e[n],c[n]);for(n=0;n<t.removed.length;n++){var i=t.removed[n];(o=u.get(i))&&(o.dispatchEvent({type:"disconnected",data:i}),u.delete(i))}for(n=0;n<t.added.length;n++){var o;i=t.added[n];(o=u.get(i))&&o.dispatchEvent({type:"connected",data:i})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var e=c[t];return void 0===e&&(e=new si,c[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){var e=c[t];return void 0===e&&(e=new si,c[t]=e),e.getGripSpace()},this.setFramebufferScaleFactor=function(t){i=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getSession=function(){return r},this.setSession=function(t){if(null!==(r=t)){r.addEventListener("select",v),r.addEventListener("selectstart",v),r.addEventListener("selectend",v),r.addEventListener("squeeze",v),r.addEventListener("squeezestart",v),r.addEventListener("squeezeend",v),r.addEventListener("end",g);var n=e.getContextAttributes();!0!==n.xrCompatible&&e.makeXRCompatible();var o={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil,framebufferScaleFactor:i},s=new XRWebGLLayer(r,e,o);r.updateRenderState({baseLayer:s}),r.requestReferenceSpace(a).then(y),r.addEventListener("inputsourceschange",x)}};var b=new P,M=new P;function w(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){d.near=h.near=l.near=t.near,d.far=h.far=l.far=t.far,f===d.near&&m===d.far||(r.updateRenderState({depthNear:d.near,depthFar:d.far}),f=d.near,m=d.far);var e=t.parent,n=d.cameras;w(d,e);for(var i=0;i<n.length;i++)w(n[i],e);t.matrixWorld.copy(d.matrixWorld);for(var o=t.children,a=(i=0,o.length);i<a;i++)o[i].updateMatrixWorld(!0);return 2===n.length?function(t,e,n){b.setFromMatrixPosition(e.matrixWorld),M.setFromMatrixPosition(n.matrixWorld);var r=b.distanceTo(M),i=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],u=(i[9]-1)/i[5],l=(i[8]-1)/i[0],h=(o[8]+1)/o[0],p=a*l,d=a*h,f=r/(-l+h),m=f*-l;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=a+f,g=s+f,y=p-m,x=d+(r-m),w=c*s/g*v,_=u*s/g*v;t.projectionMatrix.makePerspective(y,x,w,_,v,g)}(d,l,h):d.projectionMatrix.copy(l.projectionMatrix),d};var S=null;var E=new sn;E.setAnimationLoop((function(e,n){if(null!==(s=n.getViewerPose(o))){var i=s.views,a=r.renderState.baseLayer;t.setFramebuffer(a.framebuffer);var u=!1;i.length!==d.cameras.length&&(d.cameras.length=0,u=!0);for(var l=0;l<i.length;l++){var h=i[l],f=a.getViewport(h),m=p[l];m.matrix.fromArray(h.transform.matrix),m.projectionMatrix.fromArray(h.projectionMatrix),m.viewport.set(f.x,f.y,f.width,f.height),0===l&&d.matrix.copy(m.matrix),!0===u&&d.cameras.push(m)}}var v=r.inputSources;for(l=0;l<c.length;l++){var g=c[l],y=v[l];g.update(y,n,o)}S&&S(e,n)})),this.setAnimationLoop=function(t){S=t},this.dispose=function(){}}function ui(t){function e(e,n,r){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.specularMap&&(e.specularMap.value=n.specularMap);var i,o,a=n.envMap||r;a&&(e.envMap.value=a,e.flipEnvMap.value=a.isCubeTexture?-1:1,e.reflectivity.value=n.reflectivity,e.refractionRatio.value=n.refractionRatio,e.maxMipLevel.value=t.get(a).__maxMipLevel),n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity),n.map?i=n.map:n.specularMap?i=n.specularMap:n.displacementMap?i=n.displacementMap:n.normalMap?i=n.normalMap:n.bumpMap?i=n.bumpMap:n.roughnessMap?i=n.roughnessMap:n.metalnessMap?i=n.metalnessMap:n.alphaMap?i=n.alphaMap:n.emissiveMap&&(i=n.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix)),n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),e.uv2Transform.value.copy(o.matrix))}function n(t,e,n){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||n)&&(t.envMapIntensity.value=e.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,r,i,o,a){r.isMeshBasicMaterial?e(t,r):r.isMeshLambertMaterial?(e(t,r),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,r)):r.isMeshToonMaterial?(e(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshPhongMaterial?(e(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshStandardMaterial?(e(t,r,i),r.isMeshPhysicalMaterial?function(t,e,r){n(t,e,r),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap);e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate());t.transparency.value=e.transparency}(t,r,i):n(t,r,i)):r.isMeshMatcapMaterial?(e(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshDepthMaterial?(e(t,r),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshDistanceMaterial?(e(t,r),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,r)):r.isMeshNormalMaterial?(e(t,r),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,n,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*r,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,r,o,a):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function li(t){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,u=void 0!==t.powerPreference?t.powerPreference:"default",l=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,h=null,p=null;this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,f,m,v,x,b,M,w,S,E,T,L,A,R,O,N,C,I,D,z=this,B=!1,k=null,F=0,U=0,G=null,H=null,V=-1,W={geometry:null,program:null,wireframe:!1},q=null,X=null,Y=new _,J=new _,Z=null,K=e.width,Q=e.height,$=1,tt=null,et=null,rt=new _(0,0,K,Q),it=new _(0,0,K,Q),ot=!1,at=new on,st=new vn,ct=!1,ut=!1,lt=new j,ht=new P;function pt(){return null===G?$:1}try{var dt={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:l};if(e.addEventListener("webglcontextlost",gt,!1),e.addEventListener("webglcontextrestored",yt,!1),null===(d=n||e.getContext("webgl",dt)||e.getContext("experimental-webgl",dt)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function ft(){f=new gn(d),!1===(m=new mn(d,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"),D=new ii(d,f,m),(v=new ni(d,f,m)).scissor(J.copy(it).multiplyScalar($).floor()),v.viewport(Y.copy(rt).multiplyScalar($).floor()),x=new bn(d),b=new Gr,M=new ri(d,f,v,b,m,D,x),w=new cn(d,m),S=new yn(d,w,x),E=new _n(d,S,w,x),N=new wn(d),T=new Ur(z,f,m),L=new ui(b),A=new qr,R=new Qr,O=new dn(z,v,E,s),C=new fn(d,f,x,m),I=new xn(d,f,x,m),x.programs=T.programs,z.capabilities=m,z.extensions=f,z.properties=b,z.renderLists=A,z.state=v,z.info=x}ft();var mt=new ci(z,d);this.xr=mt;var vt=new ei(z,E,m.maxTextureSize);function gt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),B=!0}function yt(){console.log("THREE.WebGLRenderer: Context Restored."),B=!1,ft()}function xt(t){var e=t.target;e.removeEventListener("dispose",xt),function(t){bt(t),b.remove(t)}(e)}function bt(t){var e=b.get(t).program;t.program=void 0,void 0!==e&&T.releaseProgram(e)}this.shadowMap=vt,this.getContext=function(){return d},this.getContextAttributes=function(){return d.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 $},this.setPixelRatio=function(t){void 0!==t&&($=t,this.setSize(K,Q,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new y),t.set(K,Q)},this.setSize=function(t,n,r){mt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(K=t,Q=n,e.width=Math.floor(t*$),e.height=Math.floor(n*$),!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 y),t.set(K*$,Q*$).floor()},this.setDrawingBufferSize=function(t,n,r){K=t,Q=n,$=r,e.width=Math.floor(t*r),e.height=Math.floor(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 _),t.copy(Y)},this.getViewport=function(t){return t.copy(rt)},this.setViewport=function(t,e,n,r){t.isVector4?rt.set(t.x,t.y,t.z,t.w):rt.set(t,e,n,r),v.viewport(Y.copy(rt).multiplyScalar($).floor())},this.getScissor=function(t){return t.copy(it)},this.setScissor=function(t,e,n,r){t.isVector4?it.set(t.x,t.y,t.z,t.w):it.set(t,e,n,r),v.scissor(J.copy(it).multiplyScalar($).floor())},this.getScissorTest=function(){return ot},this.setScissorTest=function(t){v.setScissorTest(ot=t)},this.setOpaqueSort=function(t){tt=t},this.setTransparentSort=function(t){et=t},this.getClearColor=function(){return O.getClearColor()},this.setClearColor=function(){O.setClearColor.apply(O,arguments)},this.getClearAlpha=function(){return O.getClearAlpha()},this.setClearAlpha=function(){O.setClearAlpha.apply(O,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),d.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",gt,!1),e.removeEventListener("webglcontextrestored",yt,!1),A.dispose(),R.dispose(),b.dispose(),E.dispose(),mt.dispose(),_t.stop()},this.renderBufferImmediate=function(t,e){v.initAttributes();var n=b.get(t);t.hasPositions&&!n.position&&(n.position=d.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=d.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=d.createBuffer()),t.hasColors&&!n.color&&(n.color=d.createBuffer());var r=e.getAttributes();t.hasPositions&&(d.bindBuffer(34962,n.position),d.bufferData(34962,t.positionArray,35048),v.enableAttribute(r.position),d.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&(d.bindBuffer(34962,n.normal),d.bufferData(34962,t.normalArray,35048),v.enableAttribute(r.normal),d.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(d.bindBuffer(34962,n.uv),d.bufferData(34962,t.uvArray,35048),v.enableAttribute(r.uv),d.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(d.bindBuffer(34962,n.color),d.bufferData(34962,t.colorArray,35048),v.enableAttribute(r.color),d.vertexAttribPointer(r.color,3,5126,!1,0,0)),v.disableUnusedAttributes(),d.drawArrays(4,0,t.count),t.count=0};var Mt=new nt;this.renderBufferDirect=function(t,e,n,r,i,o){null===e&&(e=Mt);var a=i.isMesh&&i.matrixWorld.determinant()<0,s=At(t,e,r,i);v.setMaterial(r,a);var c=!1;W.geometry===n.id&&W.program===s.id&&W.wireframe===(!0===r.wireframe)||(W.geometry=n.id,W.program=s.id,W.wireframe=!0===r.wireframe,c=!0),(r.morphTargets||r.morphNormals)&&(N.update(i,n,r,s),c=!0),!0===i.isInstancedMesh&&(c=!0);var u=n.index,l=n.attributes.position;if(null===u){if(void 0===l||0===l.count)return}else if(0===u.count)return;var h,p=1;!0===r.wireframe&&(u=S.getWireframeAttribute(n),p=2);var g=C;null!==u&&(h=w.get(u),(g=I).setIndex(h)),c&&(!function(t,e,n,r){if(!1===m.isWebGL2&&(t.isInstancedMesh||e.isInstancedBufferGeometry)&&null===f.get("ANGLE_instanced_arrays"))return;v.initAttributes();var i=e.attributes,o=r.getAttributes(),a=n.defaultAttributeValues;for(var s in o){var c=o[s];if(c>=0){var u=i[s];if(void 0!==u){var l=u.normalized,h=u.itemSize;if(void 0===(_=w.get(u)))continue;var p=_.buffer,g=_.type,y=_.bytesPerElement;if(u.isInterleavedBufferAttribute){var x=u.data,b=x.stride,M=u.offset;x&&x.isInstancedInterleavedBuffer?(v.enableAttributeAndDivisor(c,x.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=x.meshPerAttribute*x.count)):v.enableAttribute(c),d.bindBuffer(34962,p),v.vertexAttribPointer(c,h,g,l,b*y,M*y)}else u.isInstancedBufferAttribute?(v.enableAttributeAndDivisor(c,u.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=u.meshPerAttribute*u.count)):v.enableAttribute(c),d.bindBuffer(34962,p),v.vertexAttribPointer(c,h,g,l,0,0)}else if("instanceMatrix"===s){var _;if(void 0===(_=w.get(t.instanceMatrix)))continue;p=_.buffer,g=_.type;v.enableAttributeAndDivisor(c+0,1),v.enableAttributeAndDivisor(c+1,1),v.enableAttributeAndDivisor(c+2,1),v.enableAttributeAndDivisor(c+3,1),d.bindBuffer(34962,p),d.vertexAttribPointer(c+0,4,g,!1,64,0),d.vertexAttribPointer(c+1,4,g,!1,64,16),d.vertexAttribPointer(c+2,4,g,!1,64,32),d.vertexAttribPointer(c+3,4,g,!1,64,48)}else if(void 0!==a){var S=a[s];if(void 0!==S)switch(S.length){case 2:d.vertexAttrib2fv(c,S);break;case 3:d.vertexAttrib3fv(c,S);break;case 4:d.vertexAttrib4fv(c,S);break;default:d.vertexAttrib1fv(c,S)}}}}v.disableUnusedAttributes()}(i,n,r,s),null!==u&&d.bindBuffer(34963,h.buffer));var y=null!==u?u.count:l.count,x=n.drawRange.start*p,b=n.drawRange.count*p,M=null!==o?o.start*p:0,_=null!==o?o.count*p:1/0,E=Math.max(x,M),T=Math.min(y,x+b,M+_)-1,L=Math.max(0,T-E+1);if(0!==L){if(i.isMesh)!0===r.wireframe?(v.setLineWidth(r.wireframeLinewidth*pt()),g.setMode(1)):g.setMode(4);else if(i.isLine){var A=r.linewidth;void 0===A&&(A=1),v.setLineWidth(A*pt()),i.isLineSegments?g.setMode(1):i.isLineLoop?g.setMode(2):g.setMode(3)}else i.isPoints?g.setMode(0):i.isSprite&&g.setMode(4);if(i.isInstancedMesh)g.renderInstances(n,E,L,i.count);else if(n.isInstancedBufferGeometry){var P=Math.min(n.instanceCount,n._maxInstanceCount);g.renderInstances(n,E,L,P)}else g.render(E,L)}},this.compile=function(t,e){(p=R.get(t,e)).init(),t.traverse((function(t){t.isLight&&(p.pushLight(t),t.castShadow&&p.pushShadow(t))})),p.setupLights(e);const n={};t.traverse((function(e){let r=e.material;if(r)if(Array.isArray(r))for(let i=0;i<r.length;i++){let o=r[i];o.uuid in n==!1&&(Lt(o,t,e),n[o.uuid]=!0)}else r.uuid in n==!1&&(Lt(r,t,e),n[r.uuid]=!0)}))};var wt=null;var _t=new sn;function St(t,e,n,r){if(!1!==t.visible){if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)p.pushLight(t),t.castShadow&&p.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||at.intersectsSprite(t)){r&&ht.setFromMatrixPosition(t.matrixWorld).applyMatrix4(lt);var i=E.update(t);(o=t.material).visible&&h.push(t,i,o,n,ht.z,null)}}else if(t.isImmediateRenderObject)r&&ht.setFromMatrixPosition(t.matrixWorld).applyMatrix4(lt),h.push(t,null,t.material,n,ht.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==x.render.frame&&(t.skeleton.update(),t.skeleton.frame=x.render.frame),!t.frustumCulled||at.intersectsObject(t))){r&&ht.setFromMatrixPosition(t.matrixWorld).applyMatrix4(lt);i=E.update(t);var o=t.material;if(Array.isArray(o))for(var a=i.groups,s=0,c=a.length;s<c;s++){var u=a[s],l=o[u.materialIndex];l&&l.visible&&h.push(t,i,l,n,ht.z,u)}else o.visible&&h.push(t,i,o,n,ht.z,null)}var d=t.children;for(s=0,c=d.length;s<c;s++)St(d[s],e,n,r)}}function Et(t,e,n,r){for(var i=0,o=t.length;i<o;i++){var a=t[i],s=a.object,c=a.geometry,u=void 0===r?a.material:r,l=a.group;if(n.isArrayCamera){X=n;for(var h=n.cameras,d=0,f=h.length;d<f;d++){var m=h[d];s.layers.test(m.layers)&&(v.viewport(Y.copy(m.viewport)),p.setupLights(m),Tt(s,e,m,c,u,l))}}else X=null,Tt(s,e,n,c,u,l)}}function Tt(t,e,n,r,i,o){if(t.onBeforeRender(z,e,n,r,i,o),p=R.get(e,X||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var a=At(n,e,i,t);v.setMaterial(i),W.geometry=null,W.program=null,W.wireframe=!1,function(t,e){t.render((function(t){z.renderBufferImmediate(t,e)}))}(t,a)}else z.renderBufferDirect(n,e,r,i,t,o);t.onAfterRender(z,e,n,r,i,o),p=R.get(e,X||n)}function Lt(t,e,n){var r=b.get(t),i=p.state.lights,o=p.state.shadowsArray,a=i.state.version,s=T.getParameters(t,i.state,o,e,st.numPlanes,st.numIntersection,n),c=T.getProgramCacheKey(s),u=r.program,l=!0;if(void 0===u)t.addEventListener("dispose",xt);else if(u.cacheKey!==c)bt(t);else if(r.lightsStateVersion!==a)r.lightsStateVersion=a,l=!1;else{if(void 0!==s.shaderID)return;l=!1}l&&(u=T.acquireProgram(s,c),r.program=u,r.uniforms=s.uniforms,r.outputEncoding=s.outputEncoding,t.program=u);var h=u.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var d=0;d<z.maxMorphTargets;d++)h["morphTarget"+d]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(d=0;d<z.maxMorphNormals;d++)h["morphNormal"+d]>=0&&t.numSupportedMorphNormals++}var f=r.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=st.numPlanes,r.numIntersection=st.numIntersection,f.clippingPlanes=st.uniform),r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=a,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),v=Mr.seqWithValue(m.seq,f);r.uniformsList=v}function At(t,e,n,r){M.resetTextureUnits();var i=e.fog,o=n.isMeshStandardMaterial?e.environment:null,a=null===G?z.outputEncoding:G.texture.encoding,s=b.get(n),c=p.state.lights;if(ct&&(ut||t!==q)){var u=t===q&&n.id===V;st.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,s,u)}n.version===s.__version?void 0===s.program||n.fog&&s.fog!==i||s.environment!==o||s.needsLights&&s.lightsStateVersion!==c.state.version?Lt(n,e,r):void 0===s.numClippingPlanes||s.numClippingPlanes===st.numPlanes&&s.numIntersection===st.numIntersection?s.outputEncoding!==a&&Lt(n,e,r):Lt(n,e,r):(Lt(n,e,r),s.__version=n.version);var l,h,f=!1,y=!1,x=!1,w=s.program,_=w.getUniforms(),S=s.uniforms;if(v.useProgram(w.program)&&(f=!0,y=!0,x=!0),n.id!==V&&(V=n.id,y=!0),f||q!==t){if(_.setValue(d,"projectionMatrix",t.projectionMatrix),m.logarithmicDepthBuffer&&_.setValue(d,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),q!==t&&(q=t,y=!0,x=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var E=_.map.cameraPosition;void 0!==E&&E.setValue(d,ht.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&_.setValue(d,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&_.setValue(d,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){_.setOptional(d,r,"bindMatrix"),_.setOptional(d,r,"bindMatrixInverse");var T=r.skeleton;if(T){var A=T.bones;if(m.floatVertexTextures){if(void 0===T.boneTexture){var P=Math.sqrt(4*A.length);P=g.ceilPowerOfTwo(P),P=Math.max(P,4);var R=new Float32Array(P*P*4);R.set(T.boneMatrices);var O=new en(R,P,P,1023,1015);T.boneMatrices=R,T.boneTexture=O,T.boneTextureSize=P}_.setValue(d,"boneTexture",T.boneTexture,M),_.setValue(d,"boneTextureSize",T.boneTextureSize)}else _.setOptional(d,T,"boneMatrices")}}return(y||s.receiveShadow!==r.receiveShadow)&&(s.receiveShadow=r.receiveShadow,_.setValue(d,"receiveShadow",r.receiveShadow)),y&&(_.setValue(d,"toneMappingExposure",z.toneMappingExposure),_.setValue(d,"toneMappingWhitePoint",z.toneMappingWhitePoint),s.needsLights&&(h=x,(l=S).ambientLightColor.needsUpdate=h,l.lightProbe.needsUpdate=h,l.directionalLights.needsUpdate=h,l.directionalLightShadows.needsUpdate=h,l.pointLights.needsUpdate=h,l.pointLightShadows.needsUpdate=h,l.spotLights.needsUpdate=h,l.spotLightShadows.needsUpdate=h,l.rectAreaLights.needsUpdate=h,l.hemisphereLights.needsUpdate=h),i&&n.fog&&L.refreshFogUniforms(S,i),L.refreshMaterialUniforms(S,n,o,$,Q),void 0!==S.ltc_1&&(S.ltc_1.value=an.LTC_1),void 0!==S.ltc_2&&(S.ltc_2.value=an.LTC_2),Mr.upload(d,s.uniformsList,S,M)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Mr.upload(d,s.uniformsList,S,M),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&_.setValue(d,"center",r.center),_.setValue(d,"modelViewMatrix",r.modelViewMatrix),_.setValue(d,"normalMatrix",r.normalMatrix),_.setValue(d,"modelMatrix",r.matrixWorld),w}_t.setAnimationLoop((function(t){mt.isPresenting||wt&&wt(t)})),"undefined"!=typeof window&&_t.setContext(window),this.setAnimationLoop=function(t){wt=t,mt.setAnimationLoop(t),_t.start()},this.render=function(t,e){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),e&&e.isCamera){if(!B){W.geometry=null,W.program=null,W.wireframe=!1,V=-1,q=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),mt.enabled&&mt.isPresenting&&(e=mt.getCamera(e)),t.onBeforeRender(z,t,e,n||G),(p=R.get(t,e)).init(),lt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),at.setFromProjectionMatrix(lt),ut=this.localClippingEnabled,ct=st.init(this.clippingPlanes,ut,e),(h=A.get(t,e)).init(),St(t,e,0,z.sortObjects),h.finish(),!0===z.sortObjects&&h.sort(tt,et),ct&&st.beginShadows();var i=p.state.shadowsArray;vt.render(i,t,e),p.setupLights(e),ct&&st.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),O.render(h,t,e,r);var o=h.opaque,a=h.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&Et(o,t,e,s),a.length&&Et(a,t,e,s)}else o.length&&Et(o,t,e),a.length&&Et(a,t,e);t.onAfterRender(z,t,e),null!==G&&(M.updateRenderTargetMipmap(G),M.updateMultisampleRenderTarget(G)),v.buffers.depth.setTest(!0),v.buffers.depth.setMask(!0),v.buffers.color.setMask(!0),v.setPolygonOffset(!1),h=null,p=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){k!==t&&null===G&&d.bindFramebuffer(36160,t),k=t},this.getActiveCubeFace=function(){return F},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return G},this.setRenderTarget=function(t,e,n){G=t,F=e,U=n,t&&void 0===b.get(t).__webglFramebuffer&&M.setupRenderTarget(t);var r=k,i=!1;if(t){var o=b.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=o[e||0],i=!0):r=t.isWebGLMultisampleRenderTarget?b.get(t).__webglMultisampledFramebuffer:o,Y.copy(t.viewport),J.copy(t.scissor),Z=t.scissorTest}else Y.copy(rt).multiplyScalar($).floor(),J.copy(it).multiplyScalar($).floor(),Z=ot;if(H!==r&&(d.bindFramebuffer(36160,r),H=r),v.viewport(Y),v.scissor(J),v.setScissorTest(Z),i){var a=b.get(t.texture);d.framebufferTexture2D(36160,36064,34069+(e||0),a.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,r,i,o,a){if(t&&t.isWebGLRenderTarget){var s=b.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var c=!1;s!==H&&(d.bindFramebuffer(36160,s),c=!0);try{var u=t.texture,l=u.format,h=u.type;if(1023!==l&&D.convert(l)!==d.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===h||D.convert(h)===d.getParameter(35738)||1015===h&&(m.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||1016===h&&(m.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===d.checkFramebufferStatus(36160)?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&d.readPixels(e,n,r,i,D.convert(l),D.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&d.bindFramebuffer(36160,H)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r),a=D.convert(e.format);M.setTexture2D(e,0),d.copyTexImage2D(3553,n,a,t.x,t.y,i,o,0),v.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r){void 0===r&&(r=0);var i=e.image.width,o=e.image.height,a=D.convert(n.format),s=D.convert(n.type);M.setTexture2D(n,0),e.isDataTexture?d.texSubImage2D(3553,r,t.x,t.y,i,o,a,s,e.image.data):e.isCompressedTexture?d.compressedTexSubImage2D(3553,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):d.texSubImage2D(3553,r,t.x,t.y,a,s,e.image),0===r&&n.generateMipmaps&&d.generateMipmap(3553),v.unbindTexture()},this.initTexture=function(t){M.setTexture2D(t,0),v.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function hi(t,e){this.name="",this.color=new qt(t),this.density=void 0!==e?e:25e-5}function pi(t,e,n){this.name="",this.color=new qt(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function di(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}oi.prototype=Object.assign(Object.create(Qe.prototype),{constructor:oi,isArrayCamera:!0}),ai.prototype=Object.assign(Object.create(et.prototype),{constructor:ai,isGroup:!0}),Object.assign(si.prototype,{constructor:si,getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new ai,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new ai,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),this},update:function(t,e,n){var r=null,i=null,o=this._targetRay,a=this._grip;return t&&(null!==o&&null!==(r=e.getPose(t.targetRaySpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)),null!==a&&t.gripSpace&&null!==(i=e.getPose(t.gripSpace,n))&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),null!==o&&(o.visible=null!==r),null!==a&&(a.visible=null!==i),this}}),Object.assign(ci.prototype,d.prototype),Object.assign(hi.prototype,{isFogExp2:!0,clone:function(){return new hi(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(pi.prototype,{isFog:!0,clone:function(){return new pi(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(di.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(di.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,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}});var fi,mi=new P;function vi(t,e,n,r){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function gi(t){Qt.call(this),this.type="SpriteMaterial",this.color=new qt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}Object.defineProperties(vi.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(vi.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var e=0,n=this.data.count;e<n;e++)mi.x=this.getX(e),mi.y=this.getY(e),mi.z=this.getZ(e),mi.applyMatrix4(t),this.setXYZ(e,mi.x,mi.y,mi.z);return this},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},clone:function(){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],e=0;e<this.count;e++)for(var n=e*this.data.stride+this.offset,r=0;r<this.itemSize;r++)t.push(this.data.array[n+r]);return new ee(new this.array.constructor(t),this.itemSize,this.normalized)},toJSON:function(){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],e=0;e<this.count;e++)for(var n=e*this.data.stride+this.offset,r=0;r<this.itemSize;r++)t.push(this.data.array[n+r]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}),gi.prototype=Object.create(Qt.prototype),gi.prototype.constructor=gi,gi.prototype.isSpriteMaterial=!0,gi.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};var yi=new P,xi=new P,bi=new P,Mi=new y,wi=new y,_i=new j,Si=new P,Ei=new P,Ti=new P,Li=new y,Ai=new y,Pi=new y;function Ri(t){if(et.call(this),this.type="Sprite",void 0===fi){fi=new be;var e=new di(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);fi.setIndex([0,1,2,0,2,3]),fi.setAttribute("position",new vi(e,3,0,!1)),fi.setAttribute("uv",new vi(e,2,3,!1))}this.geometry=fi,this.material=void 0!==t?t:new gi,this.center=new y(.5,.5)}function Oi(t,e,n,r,i,o){Mi.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(wi.x=o*Mi.x-i*Mi.y,wi.y=i*Mi.x+o*Mi.y):wi.copy(Mi),t.copy(e),t.x+=wi.x,t.y+=wi.y,t.applyMatrix4(_i)}Ri.prototype=Object.assign(Object.create(et.prototype),{constructor:Ri,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),xi.setFromMatrixScale(this.matrixWorld),_i.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),bi.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&xi.multiplyScalar(-bi.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var o=this.center;Oi(Si.set(-.5,-.5,0),bi,o,xi,n,r),Oi(Ei.set(.5,-.5,0),bi,o,xi,n,r),Oi(Ti.set(.5,.5,0),bi,o,xi,n,r),Li.set(0,0),Ai.set(1,0),Pi.set(1,1);var a=t.ray.intersectTriangle(Si,Ei,Ti,!1,yi);if(null!==a||(Oi(Ei.set(-.5,.5,0),bi,o,xi,n,r),Ai.set(0,1),null!==(a=t.ray.intersectTriangle(Si,Ti,Ei,!1,yi)))){var s=t.ray.origin.distanceTo(yi);s<t.near||s>t.far||e.push({distance:s,point:yi.clone(),uv:Gt.getUV(yi,Si,Ei,Ti,Li,Ai,Pi,new y),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return et.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var Ni,Ci,Ii,Di,zi,ji=new P,Bi=new P;function ki(){et.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Fi(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Be.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new j,this.bindMatrixInverse=new j}ki.prototype=Object.assign(Object.create(et.prototype),{constructor:ki,isLOD:!0,copy:function(t){et.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,r=e.length;n<r;n++){var i=e[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,r=0;r<n.length&&!(e<n[r].distance);r++);return n.splice(r,0,{distance:e,object:t}),this.add(t),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(t){var e=this.levels;if(e.length>0){for(var n=1,r=e.length;n<r&&!(t<e[n].distance);n++);return e[n-1].object}return null},raycast:function(t,e){if(this.levels.length>0){ji.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(ji);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){ji.setFromMatrixPosition(t.matrixWorld),Bi.setFromMatrixPosition(this.matrixWorld);var n=ji.distanceTo(Bi)/t.zoom;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(this._currentLevel=r-1;r<i;r++)e[r].object.visible=!1}},toJSON:function(t){var e=et.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var o=n[r];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),Fi.prototype=Object.assign(Object.create(Be.prototype),{constructor:Fi,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new _,e=this.geometry.attributes.skinWeight,n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Be.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)},boneTransform:(Ni=new P,Ci=new _,Ii=new _,Di=new P,zi=new j,function(t,e){var n=this.skeleton,r=this.geometry;Ci.fromBufferAttribute(r.attributes.skinIndex,t),Ii.fromBufferAttribute(r.attributes.skinWeight,t),Ni.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(var i=0;i<4;i++){var o=Ii.getComponent(i);if(0!==o){var a=Ci.getComponent(i);zi.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),e.addScaledVector(Di.copy(Ni).applyMatrix4(zi),o)}}return e.applyMatrix4(this.bindMatrixInverse)})});var Ui=new j,Gi=new j;function Hi(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new j)}}function Vi(){et.call(this),this.type="Bone"}Object.assign(Hi.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new j;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update: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:Gi;Ui.multiplyMatrices(a,e[i]),Ui.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},clone:function(){return new Hi(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var r=this.bones[e];if(r.name===t)return r}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Vi.prototype=Object.assign(Object.create(et.prototype),{constructor:Vi,isBone:!0});var Wi=new j,qi=new j,Xi=[],Yi=new Be;function Ji(t,e,n){Be.call(this,t,e),this.instanceMatrix=new ee(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function Zi(t){Qt.call(this),this.type="LineBasicMaterial",this.color=new qt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}Ji.prototype=Object.assign(Object.create(Be.prototype),{constructor:Ji,isInstancedMesh:!0,getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){var n=this.matrixWorld,r=this.count;if(Yi.geometry=this.geometry,Yi.material=this.material,void 0!==Yi.material)for(var i=0;i<r;i++){this.getMatrixAt(i,Wi),qi.multiplyMatrices(n,Wi),Yi.matrixWorld=qi,Yi.raycast(t,Xi);for(var o=0,a=Xi.length;o<a;o++){var s=Xi[o];s.instanceId=i,s.object=this,e.push(s)}Xi.length=0}},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),Zi.prototype=Object.create(Qt.prototype),Zi.prototype.constructor=Zi,Zi.prototype.isLineBasicMaterial=!0,Zi.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this};var Ki=new P,Qi=new P,$i=new j,to=new Lt,eo=new xt;function no(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),et.call(this),this.type="Line",this.geometry=void 0!==t?t:new be,this.material=void 0!==e?e:new Zi,this.updateMorphTargets()}no.prototype=Object.assign(Object.create(et.prototype),{constructor:no,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],r=1,i=e.count;r<i;r++)Ki.fromBufferAttribute(e,r-1),Qi.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=Ki.distanceTo(Qi);t.setAttribute("lineDistance",new ue(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;(n=t.lineDistances)[0]=0;for(r=1,i=o.length;r<i;r++)n[r]=n[r-1],n[r]+=o[r-1].distanceTo(o[r])}return this},raycast:function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),eo.copy(n.boundingSphere),eo.applyMatrix4(r),eo.radius+=i,!1!==t.ray.intersectsSphere(eo)){$i.getInverse(r),to.copy(t.ray).applyMatrix4($i);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,s=new P,c=new P,u=new P,l=new P,h=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var p=n.index,d=n.attributes.position.array;if(null!==p)for(var f=p.array,m=0,v=f.length-1;m<v;m+=h){var g=f[m],y=f[m+1];if(s.fromArray(d,3*g),c.fromArray(d,3*y),!(to.distanceSqToSegment(s,c,l,u)>a))l.applyMatrix4(this.matrixWorld),(M=t.ray.origin.distanceTo(l))<t.near||M>t.far||e.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(m=0,v=d.length/3-1;m<v;m+=h){if(s.fromArray(d,3*m),c.fromArray(d,3*m+3),!(to.distanceSqToSegment(s,c,l,u)>a))l.applyMatrix4(this.matrixWorld),(M=t.ray.origin.distanceTo(l))<t.near||M>t.far||e.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else if(n.isGeometry){var x=n.vertices,b=x.length;for(m=0;m<b-1;m+=h){var M;if(!(to.distanceSqToSegment(x[m],x[m+1],l,u)>a))l.applyMatrix4(this.matrixWorld),(M=t.ray.origin.distanceTo(l))<t.near||M>t.far||e.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(o.length>0){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&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ro=new P,io=new P;function oo(t,e){no.call(this,t,e),this.type="LineSegments"}function ao(t,e){no.call(this,t,e),this.type="LineLoop"}function so(t){Qt.call(this),this.type="PointsMaterial",this.color=new qt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}oo.prototype=Object.assign(Object.create(no.prototype),{constructor:oo,isLineSegments:!0,computeLineDistances: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)ro.fromBufferAttribute(e,r),io.fromBufferAttribute(e,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+ro.distanceTo(io);t.setAttribute("lineDistance",new ue(n,1))}else console.warn("THREE.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)ro.copy(o[r]),io.copy(o[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+ro.distanceTo(io)}return this}}),ao.prototype=Object.assign(Object.create(no.prototype),{constructor:ao,isLineLoop:!0}),so.prototype=Object.create(Qt.prototype),so.prototype.constructor=so,so.prototype.isPointsMaterial=!0,so.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};var co=new j,uo=new Lt,lo=new xt,ho=new P;function po(t,e){et.call(this),this.type="Points",this.geometry=void 0!==t?t:new be,this.material=void 0!==e?e:new so,this.updateMorphTargets()}function fo(t,e,n,r,i,o,a){var s=uo.distanceSqToPoint(t);if(s<n){var c=new P;uo.closestPointToPoint(t,c),c.applyMatrix4(r);var u=i.ray.origin.distanceTo(c);if(u<i.near||u>i.far)return;o.push({distance:u,distanceToRay:Math.sqrt(s),point:c,index:e,face:null,object:a})}}function mo(t,e,n,r,i,o,a,s,c){w.call(this,t,e,n,r,i,o,a,s,c),this.format=void 0!==a?a:1022,this.minFilter=void 0!==o?o:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1}function vo(t,e,n,r,i,o,a,s,c,u,l,h){w.call(this,null,o,a,s,c,u,r,i,l,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function go(t,e,n,r,i,o,a,s,c){w.call(this,t,e,n,r,i,o,a,s,c),this.needsUpdate=!0}function yo(t,e,n,r,i,o,a,s,c,u){if(1026!==(u=void 0!==u?u:1026)&&1027!==u)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===u&&(n=1012),void 0===n&&1027===u&&(n=1020),w.call(this,null,r,i,o,a,s,u,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function xo(t){be.call(this),this.type="WireframeGeometry";var e,n,r,i,o,a,s,c,u,l,h=[],p=[0,0],d={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,r=m.length;e<r;e++){var v=m[e];for(n=0;n<3;n++)s=v[f[n]],c=v[f[(n+1)%3]],p[0]=Math.min(s,c),p[1]=Math.max(s,c),void 0===d[u=p[0]+","+p[1]]&&(d[u]={index1:p[0],index2:p[1]})}for(u in d)a=d[u],l=t.vertices[a.index1],h.push(l.x,l.y,l.z),l=t.vertices[a.index2],h.push(l.x,l.y,l.z)}else if(t&&t.isBufferGeometry){var g,y,x,b,M,w,_;if(l=new P,null!==t.index){for(g=t.attributes.position,y=t.index,0===(x=t.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),i=0,o=x.length;i<o;++i)for(e=M=(b=x[i]).start,r=M+b.count;e<r;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),c=y.getX(e+(n+1)%3),p[0]=Math.min(s,c),p[1]=Math.max(s,c),void 0===d[u=p[0]+","+p[1]]&&(d[u]={index1:p[0],index2:p[1]});for(u in d)a=d[u],l.fromBufferAttribute(g,a.index1),h.push(l.x,l.y,l.z),l.fromBufferAttribute(g,a.index2),h.push(l.x,l.y,l.z)}else for(e=0,r=(g=t.attributes.position).count/3;e<r;e++)for(n=0;n<3;n++)w=3*e+n,l.fromBufferAttribute(g,w),h.push(l.x,l.y,l.z),_=3*e+(n+1)%3,l.fromBufferAttribute(g,_),h.push(l.x,l.y,l.z)}this.setAttribute("position",new ue(h,3))}function bo(t,e,n){We.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Mo(t,e,n)),this.mergeVertices()}function Mo(t,e,n){be.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var r,i,o=[],a=[],s=[],c=[],u=1e-5,l=new P,h=new P,p=new P,d=new P,f=new P;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=e+1;for(r=0;r<=n;r++){var v=r/n;for(i=0;i<=e;i++){var g=i/e;t(g,v,h),a.push(h.x,h.y,h.z),g-u>=0?(t(g-u,v,p),d.subVectors(h,p)):(t(g+u,v,p),d.subVectors(p,h)),v-u>=0?(t(g,v-u,p),f.subVectors(h,p)):(t(g,v+u,p),f.subVectors(p,h)),l.crossVectors(d,f).normalize(),s.push(l.x,l.y,l.z),c.push(g,v)}}for(r=0;r<n;r++)for(i=0;i<e;i++){var y=r*m+i,x=r*m+i+1,b=(r+1)*m+i+1,M=(r+1)*m+i;o.push(y,x,M),o.push(x,b,M)}this.setIndex(o),this.setAttribute("position",new ue(a,3)),this.setAttribute("normal",new ue(s,3)),this.setAttribute("uv",new ue(c,2))}function wo(t,e,n,r){We.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},this.fromBufferGeometry(new _o(t,e,n,r)),this.mergeVertices()}function _o(t,e,n,r){be.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},n=n||1;var i=[],o=[];function a(t,e,n,r){var i,o,a=Math.pow(2,r),c=[];for(i=0;i<=a;i++){c[i]=[];var u=t.clone().lerp(n,i/a),l=e.clone().lerp(n,i/a),h=a-i;for(o=0;o<=h;o++)c[i][o]=0===o&&i===a?u:u.clone().lerp(l,o/h)}for(i=0;i<a;i++)for(o=0;o<2*(a-i)-1;o++){var p=Math.floor(o/2);o%2==0?(s(c[i][p+1]),s(c[i+1][p]),s(c[i][p])):(s(c[i][p+1]),s(c[i+1][p+1]),s(c[i+1][p]))}}function s(t){i.push(t.x,t.y,t.z)}function c(e,n){var r=3*e;n.x=t[r+0],n.y=t[r+1],n.z=t[r+2]}function u(t,e,n,r){r<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=r/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}function h(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){for(var n=new P,r=new P,i=new P,o=0;o<e.length;o+=3)c(e[o+0],n),c(e[o+1],r),c(e[o+2],i),a(n,r,i,t)}(r=r||0),function(t){for(var e=new P,n=0;n<i.length;n+=3)e.x=i[n+0],e.y=i[n+1],e.z=i[n+2],e.normalize().multiplyScalar(t),i[n+0]=e.x,i[n+1]=e.y,i[n+2]=e.z}(n),function(){for(var t=new P,e=0;e<i.length;e+=3){t.x=i[e+0],t.y=i[e+1],t.z=i[e+2];var n=l(t)/2/Math.PI+.5,r=h(t)/Math.PI+.5;o.push(n,1-r)}(function(){for(var t=new P,e=new P,n=new P,r=new P,a=new y,s=new y,c=new y,h=0,p=0;h<i.length;h+=9,p+=6){t.set(i[h+0],i[h+1],i[h+2]),e.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),a.set(o[p+0],o[p+1]),s.set(o[p+2],o[p+3]),c.set(o[p+4],o[p+5]),r.copy(t).add(e).add(n).divideScalar(3);var d=l(r);u(a,p+0,t,d),u(s,p+2,e,d),u(c,p+4,n,d)}})(),function(){for(var t=0;t<o.length;t+=6){var e=o[t+0],n=o[t+2],r=o[t+4],i=Math.max(e,n,r),a=Math.min(e,n,r);i>.9&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),r<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new ue(i,3)),this.setAttribute("normal",new ue(i.slice(),3)),this.setAttribute("uv",new ue(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function So(t,e){We.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Eo(t,e)),this.mergeVertices()}function Eo(t,e){_o.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 To(t,e){We.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Lo(t,e)),this.mergeVertices()}function Lo(t,e){_o.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ao(t,e){We.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Po(t,e)),this.mergeVertices()}function Po(t,e){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];_o.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ro(t,e){We.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Oo(t,e)),this.mergeVertices()}function Oo(t,e){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];_o.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function No(t,e,n,r,i,o){We.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Co(t,e,n,r,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Co(t,e,n,r,i){be.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},e=e||64,n=n||1,r=r||8,i=i||!1;var o=t.computeFrenetFrames(e,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new P,u=new P,l=new y,h=new P,p=[],d=[],f=[],m=[];function v(i){h=t.getPointAt(i/e,h);var a=o.normals[i],l=o.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),v=-Math.cos(f);u.x=v*a.x+m*l.x,u.y=v*a.y+m*l.y,u.z=v*a.z+m*l.z,u.normalize(),d.push(u.x,u.y,u.z),c.x=h.x+n*u.x,c.y=h.y+n*u.y,c.z=h.z+n*u.z,p.push(c.x,c.y,c.z)}}!function(){for(a=0;a<e;a++)v(a);v(!1===i?e:0),function(){for(a=0;a<=e;a++)for(s=0;s<=r;s++)l.x=a/e,l.y=s/r,f.push(l.x,l.y)}(),function(){for(s=1;s<=e;s++)for(a=1;a<=r;a++){var t=(r+1)*(s-1)+(a-1),n=(r+1)*s+(a-1),i=(r+1)*s+a,o=(r+1)*(s-1)+a;m.push(t,n,o),m.push(n,i,o)}}()}(),this.setIndex(m),this.setAttribute("position",new ue(p,3)),this.setAttribute("normal",new ue(d,3)),this.setAttribute("uv",new ue(f,2))}function Io(t,e,n,r,i,o,a){We.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Do(t,e,n,r,i,o)),this.mergeVertices()}function Do(t,e,n,r,i,o){be.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,o=o||3;var a,s,c=[],u=[],l=[],h=[],p=new P,d=new P,f=new P,m=new P,v=new P,g=new P,y=new P;for(a=0;a<=n;++a){var x=a/n*i*Math.PI*2;for(L(x,i,o,t,f),L(x+.01,i,o,t,m),g.subVectors(m,f),y.addVectors(m,f),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize(),s=0;s<=r;++s){var b=s/r*Math.PI*2,M=-e*Math.cos(b),w=e*Math.sin(b);p.x=f.x+(M*y.x+w*v.x),p.y=f.y+(M*y.y+w*v.y),p.z=f.z+(M*y.z+w*v.z),u.push(p.x,p.y,p.z),d.subVectors(p,f).normalize(),l.push(d.x,d.y,d.z),h.push(a/n),h.push(s/r)}}for(s=1;s<=n;s++)for(a=1;a<=r;a++){var _=(r+1)*(s-1)+(a-1),S=(r+1)*s+(a-1),E=(r+1)*s+a,T=(r+1)*(s-1)+a;c.push(_,S,T),c.push(S,E,T)}function L(t,e,n,r,i){var o=Math.cos(t),a=Math.sin(t),s=n/e*t,c=Math.cos(s);i.x=r*(2+c)*.5*o,i.y=r*(2+c)*a*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.setAttribute("position",new ue(u,3)),this.setAttribute("normal",new ue(l,3)),this.setAttribute("uv",new ue(h,2))}function zo(t,e,n,r,i){We.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new jo(t,e,n,r,i)),this.mergeVertices()}function jo(t,e,n,r,i){be.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},t=t||1,e=e||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var o,a,s=[],c=[],u=[],l=[],h=new P,p=new P,d=new P;for(o=0;o<=n;o++)for(a=0;a<=r;a++){var f=a/r*i,m=o/n*Math.PI*2;p.x=(t+e*Math.cos(m))*Math.cos(f),p.y=(t+e*Math.cos(m))*Math.sin(f),p.z=e*Math.sin(m),c.push(p.x,p.y,p.z),h.x=t*Math.cos(f),h.y=t*Math.sin(f),d.subVectors(p,h).normalize(),u.push(d.x,d.y,d.z),l.push(a/r),l.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=r;a++){var v=(r+1)*o+a-1,g=(r+1)*(o-1)+a-1,y=(r+1)*(o-1)+a,x=(r+1)*o+a;s.push(v,g,x),s.push(g,y,x)}this.setIndex(s),this.setAttribute("position",new ue(c,3)),this.setAttribute("normal",new ue(u,3)),this.setAttribute("uv",new ue(l,2))}po.prototype=Object.assign(Object.create(et.prototype),{constructor:po,isPoints:!0,raycast:function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),lo.copy(n.boundingSphere),lo.applyMatrix4(r),lo.radius+=i,!1!==t.ray.intersectsSphere(lo)){co.getInverse(r),uo.copy(t.ray).applyMatrix4(co);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){var s=n.index,c=n.attributes.position.array;if(null!==s)for(var u=s.array,l=0,h=u.length;l<h;l++){var p=u[l];ho.fromArray(c,3*p),fo(ho,p,a,r,t,e,this)}else{l=0;for(var d=c.length/3;l<d;l++)ho.fromArray(c,3*l),fo(ho,l,a,r,t,e,this)}}else{var f=n.vertices;for(l=0,d=f.length;l<d;l++)fo(f[l],l,a,r,t,e,this)}}},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(o.length>0){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&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),mo.prototype=Object.assign(Object.create(w.prototype),{constructor:mo,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),vo.prototype=Object.create(w.prototype),vo.prototype.constructor=vo,vo.prototype.isCompressedTexture=!0,go.prototype=Object.create(w.prototype),go.prototype.constructor=go,go.prototype.isCanvasTexture=!0,yo.prototype=Object.create(w.prototype),yo.prototype.constructor=yo,yo.prototype.isDepthTexture=!0,xo.prototype=Object.create(be.prototype),xo.prototype.constructor=xo,bo.prototype=Object.create(We.prototype),bo.prototype.constructor=bo,Mo.prototype=Object.create(be.prototype),Mo.prototype.constructor=Mo,wo.prototype=Object.create(We.prototype),wo.prototype.constructor=wo,_o.prototype=Object.create(be.prototype),_o.prototype.constructor=_o,So.prototype=Object.create(We.prototype),So.prototype.constructor=So,Eo.prototype=Object.create(_o.prototype),Eo.prototype.constructor=Eo,To.prototype=Object.create(We.prototype),To.prototype.constructor=To,Lo.prototype=Object.create(_o.prototype),Lo.prototype.constructor=Lo,Ao.prototype=Object.create(We.prototype),Ao.prototype.constructor=Ao,Po.prototype=Object.create(_o.prototype),Po.prototype.constructor=Po,Ro.prototype=Object.create(We.prototype),Ro.prototype.constructor=Ro,Oo.prototype=Object.create(_o.prototype),Oo.prototype.constructor=Oo,No.prototype=Object.create(We.prototype),No.prototype.constructor=No,Co.prototype=Object.create(be.prototype),Co.prototype.constructor=Co,Co.prototype.toJSON=function(){var t=be.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},Io.prototype=Object.create(We.prototype),Io.prototype.constructor=Io,Do.prototype=Object.create(be.prototype),Do.prototype.constructor=Do,zo.prototype=Object.create(We.prototype),zo.prototype.constructor=zo,jo.prototype=Object.create(be.prototype),jo.prototype.constructor=jo;var Bo=function(t,e,n){n=n||2;var r,i,o,a,s,c,u,l=e&&e.length,h=l?e[0]*n:t.length,p=ko(t,0,h,n,!0),d=[];if(!p||p.next===p.prev)return d;if(l&&(p=function(t,e,n,r){var i,o,a,s,c,u=[];for(i=0,o=e.length;i<o;i++)a=e[i]*r,s=i<o-1?e[i+1]*r:t.length,(c=ko(t,a,s,r,!1))===c.next&&(c.steiner=!0),u.push(Zo(c));for(u.sort(qo),i=0;i<u.length;i++)Xo(u[i],n),n=Fo(n,n.next);return n}(t,e,p,n)),t.length>80*n){r=o=t[0],i=a=t[1];for(var f=n;f<h;f+=n)(s=t[f])<r&&(r=s),(c=t[f+1])<i&&(i=c),s>o&&(o=s),c>a&&(a=c);u=0!==(u=Math.max(o-r,a-i))?1/u:0}return Uo(p,d,n,r,i,u),d};function ko(t,e,n,r,i){var o,a;if(i===function(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}(t,e,n,r)>0)for(o=e;o<n;o+=r)a=aa(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=aa(o,t[o],t[o+1],a);return a&&ta(a,a.next)&&(sa(a),a=a.next),a}function Fo(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!ta(r,r.next)&&0!==$o(r.prev,r,r.next))r=r.next;else{if(sa(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function Uo(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Jo(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,c,u=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<u&&(s++,r=r.nextZ);e++);for(c=u;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1)}(i)}(t,r,i,o);for(var s,c,u=t;t.prev!==t.next;)if(s=t.prev,c=t.next,o?Ho(t,r,i,o):Go(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),sa(t),t=c.next,u=c.next;else if((t=c)===u){a?1===a?Uo(t=Vo(Fo(t),e,n),e,n,r,i,o,2):2===a&&Wo(t,e,n,r,i,o):Uo(Fo(t),e,n,r,i,o,1);break}}}function Go(t){var e=t.prev,n=t,r=t.next;if($o(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ko(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&$o(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ho(t,e,n,r){var i=t.prev,o=t,a=t.next;if($o(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,c=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,u=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=Jo(s,c,e,n,r),p=Jo(u,l,e,n,r),d=t.prevZ,f=t.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&Ko(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&$o(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==t.prev&&f!==t.next&&Ko(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&$o(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&Ko(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&$o(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Ko(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&$o(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Vo(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!ta(i,o)&&ea(i,r,r.next,o)&&ia(i,o)&&ia(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),sa(r),sa(r.next),r=t=o),r=r.next}while(r!==t);return Fo(r)}function Wo(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Qo(a,s)){var c=oa(a,s);return a=Fo(a,a.next),c=Fo(c,c.next),Uo(a,e,n,r,i,o),void Uo(c,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function qo(t,e){return t.x-e.x}function Xo(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n;var c,u=n,l=n.x,h=n.y,p=1/0;r=n;do{i>=r.x&&r.x>=l&&i!==r.x&&Ko(o<h?i:a,o,l,h,o<h?a:i,o,r.x,r.y)&&(c=Math.abs(o-r.y)/(i-r.x),ia(r,t)&&(c<p||c===p&&(r.x>n.x||r.x===n.x&&Yo(n,r)))&&(n=r,p=c)),r=r.next}while(r!==u);return n}(t,e)){var n=oa(e,t);Fo(e,e.next),Fo(n,n.next)}}function Yo(t,e){return $o(t.prev,t,e.prev)<0&&$o(e.next,t,t.next)<0}function Jo(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Zo(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Ko(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Qo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ea(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(ia(t,e)&&ia(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&($o(t.prev,t,e.prev)||$o(t,e.prev,e))||ta(t,e)&&$o(t.prev,t,t.next)>0&&$o(e.prev,e,e.next)>0)}function $o(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ta(t,e){return t.x===e.x&&t.y===e.y}function ea(t,e,n,r){var i=ra($o(t,e,n)),o=ra($o(t,e,r)),a=ra($o(n,r,t)),s=ra($o(n,r,e));return i!==o&&a!==s||(!(0!==i||!na(t,n,e))||(!(0!==o||!na(t,r,e))||(!(0!==a||!na(n,t,r))||!(0!==s||!na(n,e,r)))))}function na(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function ra(t){return t>0?1:t<0?-1:0}function ia(t,e){return $o(t.prev,t,t.next)<0?$o(t,e,t.next)>=0&&$o(t,t.prev,e)>=0:$o(t,e,t.prev)<0||$o(t,t.next,e)<0}function oa(t,e){var n=new ca(t.i,t.x,t.y),r=new ca(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function aa(t,e,n,r){var i=new ca(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function sa(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ca(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var ua={area:function(t){for(var e=t.length,n=0,r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n},isClockWise:function(t){return ua.area(t)<0},triangulateShape:function(t,e){var n=[],r=[],i=[];la(t),ha(n,t);var o=t.length;e.forEach(la);for(var a=0;a<e.length;a++)r.push(o),o+=e[a].length,ha(n,e[a]);var s=Bo(n,r);for(a=0;a<s.length;a+=3)i.push(s.slice(a,a+3));return i}};function la(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function ha(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function pa(t,e){We.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new da(t,e)),this.mergeVertices()}function da(t,e){be.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];for(var n=this,r=[],i=[],o=0,a=t.length;o<a;o++){s(t[o])}function s(t){var o=[],a=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,c=void 0!==e.depth?e.depth:100,u=void 0===e.bevelEnabled||e.bevelEnabled,l=void 0!==e.bevelThickness?e.bevelThickness:6,h=void 0!==e.bevelSize?e.bevelSize:l-2,p=void 0!==e.bevelOffset?e.bevelOffset:0,d=void 0!==e.bevelSegments?e.bevelSegments:3,f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:fa;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=e.amount);var v,g,x,b,M,w,_,S,E=!1;f&&(v=f.getSpacedPoints(s),E=!0,u=!1,g=f.computeFrenetFrames(s,!1),x=new P,b=new P,M=new P),u||(d=0,l=0,h=0,p=0);var T=t.extractPoints(a),L=T.shape,A=T.holes;if(!ua.isClockWise(L))for(L=L.reverse(),_=0,S=A.length;_<S;_++)w=A[_],ua.isClockWise(w)&&(A[_]=w.reverse());var R=ua.triangulateShape(L,A),O=L;for(_=0,S=A.length;_<S;_++)w=A[_],L=L.concat(w);function N(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var C,I,D,z,j,B,k=L.length,F=R.length;function U(t,e,n){var r,i,o,a=t.x-e.x,s=t.y-e.y,c=n.x-t.x,u=n.y-t.y,l=a*a+s*s,h=a*u-s*c;if(Math.abs(h)>Number.EPSILON){var p=Math.sqrt(l),d=Math.sqrt(c*c+u*u),f=e.x-s/p,m=e.y+a/p,v=((n.x-u/d-f)*u-(n.y+c/d-m)*c)/(a*u-s*c),g=(r=f+a*v-t.x)*r+(i=m+s*v-t.y)*i;if(g<=2)return new y(r,i);o=Math.sqrt(g/2)}else{var x=!1;a>Number.EPSILON?c>Number.EPSILON&&(x=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(x=!0):Math.sign(s)===Math.sign(u)&&(x=!0),x?(r=-s,i=a,o=Math.sqrt(l)):(r=a,i=s,o=Math.sqrt(l/2))}return new y(r/o,i/o)}for(var G=[],H=0,V=O.length,W=V-1,q=H+1;H<V;H++,W++,q++)W===V&&(W=0),q===V&&(q=0),G[H]=U(O[H],O[W],O[q]);var X,Y,J=[],Z=G.concat();for(_=0,S=A.length;_<S;_++){for(w=A[_],X=[],H=0,W=(V=w.length)-1,q=H+1;H<V;H++,W++,q++)W===V&&(W=0),q===V&&(q=0),X[H]=U(w[H],w[W],w[q]);J.push(X),Z=Z.concat(X)}for(C=0;C<d;C++){for(D=C/d,z=l*Math.cos(D*Math.PI/2),I=h*Math.sin(D*Math.PI/2)+p,H=0,V=O.length;H<V;H++)Q((j=N(O[H],G[H],I)).x,j.y,-z);for(_=0,S=A.length;_<S;_++)for(w=A[_],X=J[_],H=0,V=w.length;H<V;H++)Q((j=N(w[H],X[H],I)).x,j.y,-z)}for(I=h+p,H=0;H<k;H++)j=u?N(L[H],Z[H],I):L[H],E?(b.copy(g.normals[0]).multiplyScalar(j.x),x.copy(g.binormals[0]).multiplyScalar(j.y),M.copy(v[0]).add(b).add(x),Q(M.x,M.y,M.z)):Q(j.x,j.y,0);for(Y=1;Y<=s;Y++)for(H=0;H<k;H++)j=u?N(L[H],Z[H],I):L[H],E?(b.copy(g.normals[Y]).multiplyScalar(j.x),x.copy(g.binormals[Y]).multiplyScalar(j.y),M.copy(v[Y]).add(b).add(x),Q(M.x,M.y,M.z)):Q(j.x,j.y,c/s*Y);for(C=d-1;C>=0;C--){for(D=C/d,z=l*Math.cos(D*Math.PI/2),I=h*Math.sin(D*Math.PI/2)+p,H=0,V=O.length;H<V;H++)Q((j=N(O[H],G[H],I)).x,j.y,c+z);for(_=0,S=A.length;_<S;_++)for(w=A[_],X=J[_],H=0,V=w.length;H<V;H++)j=N(w[H],X[H],I),E?Q(j.x,j.y+v[s-1].y,v[s-1].x+z):Q(j.x,j.y,c+z)}function K(t,e){var n,r;for(H=t.length;--H>=0;){n=H,(r=H-1)<0&&(r=t.length-1);var i=0,o=s+2*d;for(i=0;i<o;i++){var a=k*i,c=k*(i+1);tt(e+n+a,e+r+a,e+r+c,e+n+c)}}}function Q(t,e,n){o.push(t),o.push(e),o.push(n)}function $(t,e,i){et(t),et(e),et(i);var o=r.length/3,a=m.generateTopUV(n,r,o-3,o-2,o-1);nt(a[0]),nt(a[1]),nt(a[2])}function tt(t,e,i,o){et(t),et(e),et(o),et(e),et(i),et(o);var a=r.length/3,s=m.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);nt(s[0]),nt(s[1]),nt(s[3]),nt(s[1]),nt(s[2]),nt(s[3])}function et(t){r.push(o[3*t+0]),r.push(o[3*t+1]),r.push(o[3*t+2])}function nt(t){i.push(t.x),i.push(t.y)}!function(){var t=r.length/3;if(u){var e=0,i=k*e;for(H=0;H<F;H++)$((B=R[H])[2]+i,B[1]+i,B[0]+i);for(i=k*(e=s+2*d),H=0;H<F;H++)$((B=R[H])[0]+i,B[1]+i,B[2]+i)}else{for(H=0;H<F;H++)$((B=R[H])[2],B[1],B[0]);for(H=0;H<F;H++)$((B=R[H])[0]+k*s,B[1]+k*s,B[2]+k*s)}n.addGroup(t,r.length/3-t,0)}(),function(){var t=r.length/3,e=0;for(K(O,e),e+=O.length,_=0,S=A.length;_<S;_++)K(w=A[_],e),e+=w.length;n.addGroup(t,r.length/3-t,1)}()}this.setAttribute("position",new ue(r,3)),this.setAttribute("uv",new ue(i,2)),this.computeVertexNormals()}pa.prototype=Object.create(We.prototype),pa.prototype.constructor=pa,pa.prototype.toJSON=function(){var t=We.prototype.toJSON.call(this);return ma(this.parameters.shapes,this.parameters.options,t)},da.prototype=Object.create(be.prototype),da.prototype.constructor=da,da.prototype.toJSON=function(){var t=be.prototype.toJSON.call(this);return ma(this.parameters.shapes,this.parameters.options,t)};var fa={generateTopUV:function(t,e,n,r,i){var o=e[3*n],a=e[3*n+1],s=e[3*r],c=e[3*r+1],u=e[3*i],l=e[3*i+1];return[new y(o,a),new y(s,c),new y(u,l)]},generateSideWallUV:function(t,e,n,r,i,o){var a=e[3*n],s=e[3*n+1],c=e[3*n+2],u=e[3*r],l=e[3*r+1],h=e[3*r+2],p=e[3*i],d=e[3*i+1],f=e[3*i+2],m=e[3*o],v=e[3*o+1],g=e[3*o+2];return Math.abs(s-l)<.01?[new y(a,1-c),new y(u,1-h),new y(p,1-f),new y(m,1-g)]:[new y(s,1-c),new y(l,1-h),new y(d,1-f),new y(v,1-g)]}};function ma(t,e,n){if(n.shapes=[],Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];n.shapes.push(o.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function va(t,e){We.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new ga(t,e)),this.mergeVertices()}function ga(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new We;var r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),da.call(this,r,e),this.type="TextBufferGeometry"}function ya(t,e,n,r,i,o,a){We.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new xa(t,e,n,r,i,o,a)),this.mergeVertices()}function xa(t,e,n,r,i,o,a){be.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,u=Math.min(o+a,Math.PI),l=0,h=[],p=new P,d=new P,f=[],m=[],v=[],g=[];for(c=0;c<=n;c++){var y=[],x=c/n,b=0;for(0==c&&0==o?b=.5/e:c==n&&u==Math.PI&&(b=-.5/e),s=0;s<=e;s++){var M=s/e;p.x=-t*Math.cos(r+M*i)*Math.sin(o+x*a),p.y=t*Math.cos(o+x*a),p.z=t*Math.sin(r+M*i)*Math.sin(o+x*a),m.push(p.x,p.y,p.z),d.copy(p).normalize(),v.push(d.x,d.y,d.z),g.push(M+b,1-x),y.push(l++)}h.push(y)}for(c=0;c<n;c++)for(s=0;s<e;s++){var w=h[c][s+1],_=h[c][s],S=h[c+1][s],E=h[c+1][s+1];(0!==c||o>0)&&f.push(w,_,E),(c!==n-1||u<Math.PI)&&f.push(_,S,E)}this.setIndex(f),this.setAttribute("position",new ue(m,3)),this.setAttribute("normal",new ue(v,3)),this.setAttribute("uv",new ue(g,2))}function ba(t,e,n,r,i,o){We.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},this.fromBufferGeometry(new Ma(t,e,n,r,i,o)),this.mergeVertices()}function Ma(t,e,n,r,i,o){be.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},t=t||.5,e=e||1,i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,c,u=[],l=[],h=[],p=[],d=t,f=(e-t)/(r=void 0!==r?Math.max(1,r):1),m=new P,v=new y;for(s=0;s<=r;s++){for(c=0;c<=n;c++)a=i+c/n*o,m.x=d*Math.cos(a),m.y=d*Math.sin(a),l.push(m.x,m.y,m.z),h.push(0,0,1),v.x=(m.x/e+1)/2,v.y=(m.y/e+1)/2,p.push(v.x,v.y);d+=f}for(s=0;s<r;s++){var g=s*(n+1);for(c=0;c<n;c++){var x=a=c+g,b=a+n+1,M=a+n+2,w=a+1;u.push(x,b,w),u.push(b,M,w)}}this.setIndex(u),this.setAttribute("position",new ue(l,3)),this.setAttribute("normal",new ue(h,3)),this.setAttribute("uv",new ue(p,2))}function wa(t,e,n,r){We.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},this.fromBufferGeometry(new _a(t,e,n,r)),this.mergeVertices()}function _a(t,e,n,r){be.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},e=Math.floor(e)||12,n=n||0,r=r||2*Math.PI,r=g.clamp(r,0,2*Math.PI);var i,o,a,s=[],c=[],u=[],l=1/e,h=new P,p=new y;for(o=0;o<=e;o++){var d=n+o*l*r,f=Math.sin(d),m=Math.cos(d);for(a=0;a<=t.length-1;a++)h.x=t[a].x*f,h.y=t[a].y,h.z=t[a].x*m,c.push(h.x,h.y,h.z),p.x=o/e,p.y=a/(t.length-1),u.push(p.x,p.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){var v=i=a+o*t.length,x=i+t.length,b=i+t.length+1,M=i+1;s.push(v,x,M),s.push(x,b,M)}if(this.setIndex(s),this.setAttribute("position",new ue(c,3)),this.setAttribute("uv",new ue(u,2)),this.computeVertexNormals(),r===2*Math.PI){var w=this.attributes.normal.array,_=new P,S=new P,E=new P;for(i=e*t.length*3,o=0,a=0;o<t.length;o++,a+=3)_.x=w[a+0],_.y=w[a+1],_.z=w[a+2],S.x=w[i+a+0],S.y=w[i+a+1],S.z=w[i+a+2],E.addVectors(_,S).normalize(),w[a+0]=w[i+a+0]=E.x,w[a+1]=w[i+a+1]=E.y,w[a+2]=w[i+a+2]=E.z}}function Sa(t,e){We.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Ea(t,e)),this.mergeVertices()}function Ea(t,e){be.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],r=[],i=[],o=[],a=0,s=0;if(!1===Array.isArray(t))u(t);else for(var c=0;c<t.length;c++)u(t[c]),this.addGroup(a,s,c),a+=s,s=0;function u(t){var a,c,u,l=r.length/3,h=t.extractPoints(e),p=h.shape,d=h.holes;for(!1===ua.isClockWise(p)&&(p=p.reverse()),a=0,c=d.length;a<c;a++)u=d[a],!0===ua.isClockWise(u)&&(d[a]=u.reverse());var f=ua.triangulateShape(p,d);for(a=0,c=d.length;a<c;a++)u=d[a],p=p.concat(u);for(a=0,c=p.length;a<c;a++){var m=p[a];r.push(m.x,m.y,0),i.push(0,0,1),o.push(m.x,m.y)}for(a=0,c=f.length;a<c;a++){var v=f[a],g=v[0]+l,y=v[1]+l,x=v[2]+l;n.push(g,y,x),s+=3}}this.setIndex(n),this.setAttribute("position",new ue(r,3)),this.setAttribute("normal",new ue(i,3)),this.setAttribute("uv",new ue(o,2))}function Ta(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}function La(t,e){be.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,r,i,o,a=[],s=Math.cos(g.DEG2RAD*e),c=[0,0],u={},l=["a","b","c"];t.isBufferGeometry?(o=new We).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var h=o.vertices,p=o.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],v=0;v<3;v++)n=m[l[v]],r=m[l[(v+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===u[i=c[0]+","+c[1]]?u[i]={index1:c[0],index2:c[1],face1:d,face2:void 0}:u[i].face2=d;for(i in u){var y=u[i];if(void 0===y.face2||p[y.face1].normal.dot(p[y.face2].normal)<=s){var x=h[y.index1];a.push(x.x,x.y,x.z),x=h[y.index2],a.push(x.x,x.y,x.z)}}this.setAttribute("position",new ue(a,3))}function Aa(t,e,n,r,i,o,a,s){We.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Pa(t,e,n,r,i,o,a,s)),this.mergeVertices()}function Pa(t,e,n,r,i,o,a,s){be.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};var c=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var u=[],l=[],h=[],p=[],d=0,f=[],m=n/2,v=0;function g(n){var i,o,f,g=new y,x=new P,b=0,M=!0===n?t:e,w=!0===n?1:-1;for(o=d,i=1;i<=r;i++)l.push(0,m*w,0),h.push(0,w,0),p.push(.5,.5),d++;for(f=d,i=0;i<=r;i++){var _=i/r*s+a,S=Math.cos(_),E=Math.sin(_);x.x=M*E,x.y=m*w,x.z=M*S,l.push(x.x,x.y,x.z),h.push(0,w,0),g.x=.5*S+.5,g.y=.5*E*w+.5,p.push(g.x,g.y),d++}for(i=0;i<r;i++){var T=o+i,L=f+i;!0===n?u.push(L,L+1,T):u.push(L+1,L,T),b+=3}c.addGroup(v,b,!0===n?1:2),v+=b}!function(){var o,g,y=new P,x=new P,b=0,M=(e-t)/n;for(g=0;g<=i;g++){var w=[],_=g/i,S=_*(e-t)+t;for(o=0;o<=r;o++){var E=o/r,T=E*s+a,L=Math.sin(T),A=Math.cos(T);x.x=S*L,x.y=-_*n+m,x.z=S*A,l.push(x.x,x.y,x.z),y.set(L,M,A).normalize(),h.push(y.x,y.y,y.z),p.push(E,1-_),w.push(d++)}f.push(w)}for(o=0;o<r;o++)for(g=0;g<i;g++){var R=f[g][o],O=f[g+1][o],N=f[g+1][o+1],C=f[g][o+1];u.push(R,O,C),u.push(O,N,C),b+=6}c.addGroup(v,b,0),v+=b}(),!1===o&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(u),this.setAttribute("position",new ue(l,3)),this.setAttribute("normal",new ue(h,3)),this.setAttribute("uv",new ue(p,2))}function Ra(t,e,n,r,i,o,a){Aa.call(this,0,t,e,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Oa(t,e,n,r,i,o,a){Pa.call(this,0,t,e,n,r,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Na(t,e,n,r){We.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Ca(t,e,n,r)),this.mergeVertices()}function Ca(t,e,n,r){be.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=[],u=[],l=new P,h=new y;for(s.push(0,0,0),c.push(0,0,1),u.push(.5,.5),o=0,i=3;o<=e;o++,i+=3){var p=n+o/e*r;l.x=t*Math.cos(p),l.y=t*Math.sin(p),s.push(l.x,l.y,l.z),c.push(0,0,1),h.x=(s[i]/t+1)/2,h.y=(s[i+1]/t+1)/2,u.push(h.x,h.y)}for(i=1;i<=e;i++)a.push(i,i+1,0);this.setIndex(a),this.setAttribute("position",new ue(s,3)),this.setAttribute("normal",new ue(c,3)),this.setAttribute("uv",new ue(u,2))}va.prototype=Object.create(We.prototype),va.prototype.constructor=va,ga.prototype=Object.create(da.prototype),ga.prototype.constructor=ga,ya.prototype=Object.create(We.prototype),ya.prototype.constructor=ya,xa.prototype=Object.create(be.prototype),xa.prototype.constructor=xa,ba.prototype=Object.create(We.prototype),ba.prototype.constructor=ba,Ma.prototype=Object.create(be.prototype),Ma.prototype.constructor=Ma,wa.prototype=Object.create(We.prototype),wa.prototype.constructor=wa,_a.prototype=Object.create(be.prototype),_a.prototype.constructor=_a,Sa.prototype=Object.create(We.prototype),Sa.prototype.constructor=Sa,Sa.prototype.toJSON=function(){var t=We.prototype.toJSON.call(this);return Ta(this.parameters.shapes,t)},Ea.prototype=Object.create(be.prototype),Ea.prototype.constructor=Ea,Ea.prototype.toJSON=function(){var t=be.prototype.toJSON.call(this);return Ta(this.parameters.shapes,t)},La.prototype=Object.create(be.prototype),La.prototype.constructor=La,Aa.prototype=Object.create(We.prototype),Aa.prototype.constructor=Aa,Pa.prototype=Object.create(be.prototype),Pa.prototype.constructor=Pa,Ra.prototype=Object.create(Aa.prototype),Ra.prototype.constructor=Ra,Oa.prototype=Object.create(Pa.prototype),Oa.prototype.constructor=Oa,Na.prototype=Object.create(We.prototype),Na.prototype.constructor=Na,Ca.prototype=Object.create(be.prototype),Ca.prototype.constructor=Ca;var Ia=Object.freeze({__proto__:null,WireframeGeometry:xo,ParametricGeometry:bo,ParametricBufferGeometry:Mo,TetrahedronGeometry:So,TetrahedronBufferGeometry:Eo,OctahedronGeometry:To,OctahedronBufferGeometry:Lo,IcosahedronGeometry:Ao,IcosahedronBufferGeometry:Po,DodecahedronGeometry:Ro,DodecahedronBufferGeometry:Oo,PolyhedronGeometry:wo,PolyhedronBufferGeometry:_o,TubeGeometry:No,TubeBufferGeometry:Co,TorusKnotGeometry:Io,TorusKnotBufferGeometry:Do,TorusGeometry:zo,TorusBufferGeometry:jo,TextGeometry:va,TextBufferGeometry:ga,SphereGeometry:ya,SphereBufferGeometry:xa,RingGeometry:ba,RingBufferGeometry:Ma,PlaneGeometry:un,PlaneBufferGeometry:ln,LatheGeometry:wa,LatheBufferGeometry:_a,ShapeGeometry:Sa,ShapeBufferGeometry:Ea,ExtrudeGeometry:pa,ExtrudeBufferGeometry:da,EdgesGeometry:La,ConeGeometry:Ra,ConeBufferGeometry:Oa,CylinderGeometry:Aa,CylinderBufferGeometry:Pa,CircleGeometry:Na,CircleBufferGeometry:Ca,BoxGeometry:class extends We{constructor(t,e,n,r,i,o){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o},this.fromBufferGeometry(new qe(t,e,n,r,i,o)),this.mergeVertices()}},BoxBufferGeometry:qe});function Da(t){Qt.call(this),this.type="ShadowMaterial",this.color=new qt(0),this.transparent=!0,this.setValues(t)}function za(t){Ze.call(this,t),this.type="RawShaderMaterial"}function ja(t){Qt.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new qt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function Ba(t){ja.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new y(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function ka(t){Qt.call(this),this.type="MeshPhongMaterial",this.color=new qt(16777215),this.specular=new qt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(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 Fa(t){Qt.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new qt(16777215),this.specular=new qt(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ua(t){Qt.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ga(t){Qt.call(this),this.type="MeshLambertMaterial",this.color=new qt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(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 Ha(t){Qt.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new qt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Va(t){Zi.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Da.prototype=Object.create(Qt.prototype),Da.prototype.constructor=Da,Da.prototype.isShadowMaterial=!0,Da.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this},za.prototype=Object.create(Ze.prototype),za.prototype.constructor=za,za.prototype.isRawShaderMaterial=!0,ja.prototype=Object.create(Qt.prototype),ja.prototype.constructor=ja,ja.prototype.isMeshStandardMaterial=!0,ja.prototype.copy=function(t){return Qt.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.vertexTangents=t.vertexTangents,this},Ba.prototype=Object.create(ja.prototype),Ba.prototype.constructor=Ba,Ba.prototype.isMeshPhysicalMaterial=!0,Ba.prototype.copy=function(t){return ja.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new qt).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},ka.prototype=Object.create(Qt.prototype),ka.prototype.constructor=ka,ka.prototype.isMeshPhongMaterial=!0,ka.prototype.copy=function(t){return Qt.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},Fa.prototype=Object.create(Qt.prototype),Fa.prototype.constructor=Fa,Fa.prototype.isMeshToonMaterial=!0,Fa.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,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},Ua.prototype=Object.create(Qt.prototype),Ua.prototype.constructor=Ua,Ua.prototype.isMeshNormalMaterial=!0,Ua.prototype.copy=function(t){return Qt.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},Ga.prototype=Object.create(Qt.prototype),Ga.prototype.constructor=Ga,Ga.prototype.isMeshLambertMaterial=!0,Ga.prototype.copy=function(t){return Qt.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},Ha.prototype=Object.create(Qt.prototype),Ha.prototype.constructor=Ha,Ha.prototype.isMeshMatcapMaterial=!0,Ha.prototype.copy=function(t){return Qt.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},Va.prototype=Object.create(Zi.prototype),Va.prototype.constructor=Va,Va.prototype.isLineDashedMaterial=!0,Va.prototype.copy=function(t){return Zi.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Wa=Object.freeze({__proto__:null,ShadowMaterial:Da,SpriteMaterial:gi,RawShaderMaterial:za,ShaderMaterial:Ze,PointsMaterial:so,MeshPhysicalMaterial:Ba,MeshStandardMaterial:ja,MeshPhongMaterial:ka,MeshToonMaterial:Fa,MeshNormalMaterial:Ua,MeshLambertMaterial:Ga,MeshDepthMaterial:$r,MeshDistanceMaterial:ti,MeshBasicMaterial:$t,MeshMatcapMaterial:Ha,LineDashedMaterial:Va,LineBasicMaterial:Zi,Material:Qt}),qa={arraySlice:function(t,e,n){return qa.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))do{void 0!==(a=o[r])&&(e.push(o.time),n.push.apply(n,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(e.push(o.time),n.push(a)),o=t[i++]}while(void 0!==o)}},subclip:function(t,e,n,r,i){i=i||30;var o=t.clone();o.name=e;for(var a=[],s=0;s<o.tracks.length;++s){for(var c=o.tracks[s],u=c.getValueSize(),l=[],h=[],p=0;p<c.times.length;++p){var d=c.times[p]*i;if(!(d<n||d>=r)){l.push(c.times[p]);for(var f=0;f<u;++f)h.push(c.values[p*u+f])}}0!==l.length&&(c.times=qa.convertArray(l,c.times.constructor),c.values=qa.convertArray(h,c.values.constructor),a.push(c))}o.tracks=a;var m=1/0;for(s=0;s<o.tracks.length;++s)m>o.tracks[s].times[0]&&(m=o.tracks[s].times[0]);for(s=0;s<o.tracks.length;++s)o.tracks[s].shift(-1*m);return o.resetDuration(),o},makeClipAdditive:function(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=t),(void 0===r||r<=0)&&(r=30);for(var i=t.tracks.length,o=e/r,a=0;a<i;++a){var s=n.tracks[a],c=s.ValueTypeName;if("bool"!==c&&"string"!==c){var u=t.tracks.find((function(t){return t.name===s.name&&t.ValueTypeName===c}));if(void 0!==u){var l,h=s.getValueSize(),p=s.times.length-1;if(o<=s.times[0])l=qa.arraySlice(s.values,0,s.valueSize);else if(o>=s.times[p]){var d=p*h;l=qa.arraySlice(s.values,d)}else{var f=s.createInterpolant();f.evaluate(o),l=f.resultBuffer}if("quaternion"===c)new T(l[0],l[1],l[2],l[3]).normalize().conjugate().toArray(l);for(var m=u.times.length,v=0;v<m;++v){var g=v*h;if("quaternion"===c)T.multiplyQuaternionsFlat(u.values,g,l,0,u.values,g);else for(var y=0;y<h;++y)u.values[g+y]-=l[y]}}}}return t.blendMode=2501,t}};function Xa(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 Ya(t,e,n,r){Xa.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Ja(t,e,n,r){Xa.call(this,t,e,n,r)}function Za(t,e,n,r){Xa.call(this,t,e,n,r)}function Ka(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=qa.convertArray(e,this.TimeBufferType),this.values=qa.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Qa(t,e,n){Ka.call(this,t,e,n)}function $a(t,e,n,r){Ka.call(this,t,e,n,r)}function ts(t,e,n,r){Ka.call(this,t,e,n,r)}function es(t,e,n,r){Xa.call(this,t,e,n,r)}function ns(t,e,n,r){Ka.call(this,t,e,n,r)}function rs(t,e,n,r){Ka.call(this,t,e,n,r)}function is(t,e,n,r){Ka.call(this,t,e,n,r)}function os(t,e,n,r){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.blendMode=void 0!==r?r:2500,this.uuid=g.generateUUID(),this.duration<0&&this.resetDuration()}function as(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ts;case"vector":case"vector2":case"vector3":case"vector4":return is;case"color":return $a;case"quaternion":return ns;case"bool":case"boolean":return Qa;case"string":return rs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],r=[];qa.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(Xa.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(t>=i)break t;var s=e[1];t<s&&(n=2,i=s);for(a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===a)break;if(r=i,t>=(i=e[--n-1]))break e}o=n,n=0}for(;n<o;){var c=n+o>>>1;t<e[c]?o=c:n=c+1}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(Xa.prototype,{beforeStart_:Xa.prototype.copySampleValue_,afterEnd_:Xa.prototype.copySampleValue_}),Ya.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Ya,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(t,e,n){var r=this.parameterPositions,i=t-2,o=t+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:i=t,a=2*e-n;break;case 2402:a=e+r[i=r.length-2]-r[i+1];break;default:i=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:o=t,s=2*n-e;break;case 2402:o=1,s=n+r[1]-r[0];break;default:o=t-1,s=e}var c=.5*(n-e),u=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(s-n),this._offsetPrev=i*u,this._offsetNext=o*u},interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,u=this._offsetPrev,l=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-e)/(r-e),f=d*d,m=f*d,v=-h*m+2*h*f-h*d,g=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,b=0;b!==a;++b)i[b]=v*o[u+b]+g*o[c+b]+y*o[s+b]+x*o[l+b];return i}}),Ja.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Ja,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,u=(n-e)/(r-e),l=1-u,h=0;h!==a;++h)i[h]=o[c+h]*l+o[s+h]*u;return i}}),Za.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Za,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Ka,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:qa.convertArray(t.times,Array),values:qa.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e}}),Object.assign(Ka.prototype,{constructor:Ka,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new Za(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Ja(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Ya(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,r=n.length,i=0,o=r-1;i!==r&&n[i]<t;)++i;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=qa.arraySlice(n,i,o),this.values=qa.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==r&&qa.isTypedArray(r)){a=0;for(var c=r.length;a!==c;++a){var u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),t=!1;break}}}return t},optimize:function(){for(var t=qa.arraySlice(this.times),e=qa.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,o=t.length-1,a=1;a<o;++a){var s=!1,c=t[a];if(c!==t[a+1]&&(1!==a||c!==c[0]))if(r)s=!0;else for(var u=a*n,l=u-n,h=u+n,p=0;p!==n;++p){var d=e[u+p];if(d!==e[l+p]||d!==e[h+p]){s=!0;break}}if(s){if(a!==i){t[i]=t[a];var f=a*n,m=i*n;for(p=0;p!==n;++p)e[m+p]=e[f+p]}++i}}if(o>0){t[i]=t[o];for(f=o*n,m=i*n,p=0;p!==n;++p)e[m+p]=e[f+p];++i}return i!==t.length?(this.times=qa.arraySlice(t,0,i),this.values=qa.arraySlice(e,0,i*n)):(this.times=t,this.values=e),this},clone:function(){var t=qa.arraySlice(this.times,0),e=qa.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Qa.prototype=Object.assign(Object.create(Ka.prototype),{constructor:Qa,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),$a.prototype=Object.assign(Object.create(Ka.prototype),{constructor:$a,ValueTypeName:"color"}),ts.prototype=Object.assign(Object.create(Ka.prototype),{constructor:ts,ValueTypeName:"number"}),es.prototype=Object.assign(Object.create(Xa.prototype),{constructor:es,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),u=s+a;s!==u;s+=4)T.slerpFlat(i,0,o,s-a,o,s,c);return i}}),ns.prototype=Object.assign(Object.create(Ka.prototype),{constructor:ns,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new es(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),rs.prototype=Object.assign(Object.create(Ka.prototype),{constructor:rs,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),is.prototype=Object.assign(Object.create(Ka.prototype),{constructor:is,ValueTypeName:"vector"}),Object.assign(os,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,o=n.length;i!==o;++i)e.push(as(n[i]).scale(r));return new os(t.name,t.duration,e,t.blendMode)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode},i=0,o=n.length;i!==o;++i)e.push(Ka.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var i=e.length,o=[],a=0;a<i;a++){var s=[],c=[];s.push((a+i-1)%i,a,(a+1)%i),c.push(0,1,0);var u=qa.getKeyframeOrder(s);s=qa.sortedArray(s,1,u),c=qa.sortedArray(c,1,u),r||0!==s[0]||(s.push(i),c.push(c[0])),o.push(new ts(".morphTargetInfluences["+e[a].name+"]",s,c).scale(1/n))}return new os(t,-1,o)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){var r=t;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],c=s.name.match(i);if(c&&c.length>1){var u=r[h=c[1]];u||(r[h]=u=[]),u.push(s)}}var l=[];for(var h in r)l.push(os.CreateFromMorphTargetSequence(h,r[h],e,n));return l},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var o=[],a=[];qa.flattenJSON(n,o,a,r),0!==o.length&&i.push(new t(e,o,a))}},r=[],i=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.blendMode,c=t.hierarchy||[],u=0;u<c.length;u++){var l=c[u].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var h={},p=0;p<l.length;p++)if(l[p].morphTargets)for(var d=0;d<l[p].morphTargets.length;d++)h[l[p].morphTargets[d]]=-1;for(var f in h){var m=[],v=[];for(d=0;d!==l[p].morphTargets.length;++d){var g=l[p];m.push(g.time),v.push(g.morphTarget===f?1:0)}r.push(new ts(".morphTargetInfluence["+f+"]",m,v))}o=h.length*(a||1)}else{var y=".bones["+e[u].name+"]";n(is,y+".position",l,"pos",r),n(ns,y+".quaternion",l,"rot",r),n(is,y+".scale",l,"scl",r)}}return 0===r.length?null:new os(i,o,r,s)}}),Object.assign(os.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new os(this.name,this.duration,t,this.blendMode)}});var ss={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 cs(t,e,n){var r=this,i=!1,o=0,a=0,s=void 0,c=[];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},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){var e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=c.length;e<n;e+=2){var r=c[e],i=c[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null}}var us=new cs;function ls(t){this.manager=void 0!==t?t:us,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(ls.prototype,{load:function(){},loadAsync:function(t,e){var n=this;return new Promise((function(r,i){n.load(t,r,e,i)}))},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});var hs={};function ps(t){ls.call(this,t)}function ds(t){ls.call(this,t)}function fs(t){ls.call(this,t)}function ms(t){ls.call(this,t)}function vs(t){ls.call(this,t)}function gs(t){ls.call(this,t)}function ys(t){ls.call(this,t)}function xs(){this.type="Curve",this.arcLengthDivisions=200}function bs(t,e,n,r,i,o,a,s){xs.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 Ms(t,e,n,r,i,o){bs.call(this,t,e,n,n,r,i,o),this.type="ArcCurve"}function ws(){var t=0,e=0,n=0,r=0;function i(i,o,a,s){t=i,e=a,n=-3*i+3*o-2*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,u=(n-e)/a-(r-e)/(a+s)+(r-n)/s;i(e,n,c*=a,u*=a)},calc:function(i){var o=i*i;return t+e*i+n*o+r*(o*i)}}}ps.prototype=Object.assign(Object.create(ls.prototype),{constructor:ps,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=ss.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===hs[t]){var a=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],c=!!a[2],u=a[3];u=decodeURIComponent(u),c&&(u=atob(u));try{var l,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var p=new Uint8Array(u.length),d=0;d<u.length;d++)p[d]=u.charCodeAt(d);l="blob"===h?new Blob([p.buffer],{type:s}):p.buffer;break;case"document":var f=new DOMParser;l=f.parseFromString(u,s);break;case"json":l=JSON.parse(u);break;default:l=u}setTimeout((function(){e&&e(l),i.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}),0)}}else{hs[t]=[],hs[t].push({onLoad:e,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var v in m.open("GET",t,!0),m.addEventListener("load",(function(e){var n=this.response,r=hs[t];if(delete hs[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),ss.add(t,n);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=hs[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=hs[t];delete hs[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=hs[t];delete hs[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(v,this.requestHeader[v]);m.send(null)}return i.manager.itemStart(t),m}hs[t].push({onLoad:e,onProgress:n,onError:r})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this}}),ds.prototype=Object.assign(Object.create(ls.prototype),{constructor:ds,load:function(t,e,n,r){var i=this,o=new ps(i.manager);o.setPath(i.path),o.load(t,(function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var r=os.parse(t[n]);e.push(r)}return e}}),fs.prototype=Object.assign(Object.create(ls.prototype),{constructor:fs,load:function(t,e,n,r){var i=this,o=[],a=new vo;a.image=o;var s=new ps(this.manager);function c(c){s.load(t[c],(function(t){var n=i.parse(t,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(u+=1)&&(1===n.mipmapCount&&(a.minFilter=1006),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 u=0,l=0,h=t.length;l<h;++l)c(l);else s.load(t,(function(t){var n=i.parse(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=1006),a.format=n.format,a.needsUpdate=!0,e&&e(a)}),n,r);return a}}),ms.prototype=Object.assign(Object.create(ls.prototype),{constructor:ms,load:function(t,e,n,r){var i=this,o=new en,a=new ps(this.manager);return a.setResponseType("arraybuffer"),a.setPath(this.path),a.load(t,(function(t){var n=i.parse(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:1001,o.wrapT=void 0!==n.wrapT?n.wrapT:1001,o.magFilter=void 0!==n.magFilter?n.magFilter:1006,o.minFilter=void 0!==n.minFilter?n.minFilter:1006,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,o.minFilter=1008),1===n.mipmapCount&&(o.minFilter=1006),o.needsUpdate=!0,e&&e(o,n))}),n,r),o}}),vs.prototype=Object.assign(Object.create(ls.prototype),{constructor:vs,load:function(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=ss.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),ss.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}}),gs.prototype=Object.assign(Object.create(ls.prototype),{constructor:gs,load:function(t,e,n,r){var i=new Sn,o=new vs(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}}),ys.prototype=Object.assign(Object.create(ls.prototype),{constructor:ys,load:function(t,e,n,r){var i=new w,o=new vs(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(n){i.image=n;var r=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}),Object.assign(xs.prototype,{getPoint:function(){return console.warn("THREE.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,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(!(a>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(o-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(o-1)},getTangent:function(t,e){var n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n),o=this.getPoint(r),a=e||(i.isVector2?new y:new P);return a.copy(o).sub(i).normalize(),a},getTangentAt:function(t,e){var n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){var n,r,i,o=new P,a=[],s=[],c=[],u=new P,l=new j;for(n=0;n<=t;n++)r=n/t,a[n]=this.getTangentAt(r,new P),a[n].normalize();s[0]=new P,c[0]=new P;var h=Number.MAX_VALUE,p=Math.abs(a[0].x),d=Math.abs(a[0].y),f=Math.abs(a[0].z);for(p<=h&&(h=p,o.set(1,0,0)),d<=h&&(h=d,o.set(0,1,0)),f<=h&&o.set(0,0,1),u.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],u),c[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),u.crossVectors(a[n-1],a[n]),u.length()>Number.EPSILON&&(u.normalize(),i=Math.acos(g.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(l.makeRotationAxis(u,i))),c[n].crossVectors(a[n],s[n]);if(!0===e)for(i=Math.acos(g.clamp(s[0].dot(s[t]),-1,1)),i/=t,a[0].dot(u.crossVectors(s[0],s[t]))>0&&(i=-i),n=1;n<=t;n++)s[n].applyMatrix4(l.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}}),bs.prototype=Object.create(xs.prototype),bs.prototype.constructor=bs,bs.prototype.isEllipseCurve=!0,bs.prototype.getPoint=function(t,e){for(var n=e||new y,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)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 u=Math.cos(this.aRotation),l=Math.sin(this.aRotation),h=s-this.aX,p=c-this.aY;s=h*u-p*l+this.aX,c=h*l+p*u+this.aY}return n.set(s,c)},bs.prototype.copy=function(t){return xs.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},bs.prototype.toJSON=function(){var t=xs.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},bs.prototype.fromJSON=function(t){return xs.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},Ms.prototype=Object.create(bs.prototype),Ms.prototype.constructor=Ms,Ms.prototype.isArcCurve=!0;var _s=new P,Ss=new ws,Es=new ws,Ts=new ws;function Ls(t,e,n,r){xs.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=r||.5}function As(t,e,n,r,i){var o=.5*(r-e),a=.5*(i-n),s=t*t;return(2*n-2*r+o+a)*(t*s)+(-3*n+3*r-2*o-a)*s+o*t+n}function Ps(t,e,n,r){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function Rs(t,e,n,r,i){return function(t,e){var n=1-t;return n*n*n*e}(t,e)+function(t,e){var n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}function Os(t,e,n,r){xs.call(this),this.type="CubicBezierCurve",this.v0=t||new y,this.v1=e||new y,this.v2=n||new y,this.v3=r||new y}function Ns(t,e,n,r){xs.call(this),this.type="CubicBezierCurve3",this.v0=t||new P,this.v1=e||new P,this.v2=n||new P,this.v3=r||new P}function Cs(t,e){xs.call(this),this.type="LineCurve",this.v1=t||new y,this.v2=e||new y}function Is(t,e){xs.call(this),this.type="LineCurve3",this.v1=t||new P,this.v2=e||new P}function Ds(t,e,n){xs.call(this),this.type="QuadraticBezierCurve",this.v0=t||new y,this.v1=e||new y,this.v2=n||new y}function zs(t,e,n){xs.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new P,this.v1=e||new P,this.v2=n||new P}function js(t){xs.call(this),this.type="SplineCurve",this.points=t||[]}Ls.prototype=Object.create(xs.prototype),Ls.prototype.constructor=Ls,Ls.prototype.isCatmullRomCurve3=!0,Ls.prototype.getPoint=function(t,e){var n,r,i,o,a=e||new P,s=this.points,c=s.length,u=(c-(this.closed?0:1))*t,l=Math.floor(u),h=u-l;if(this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/c)+1)*c:0===h&&l===c-1&&(l=c-2,h=1),this.closed||l>0?n=s[(l-1)%c]:(_s.subVectors(s[0],s[1]).add(s[0]),n=_s),r=s[l%c],i=s[(l+1)%c],this.closed||l+2<c?o=s[(l+2)%c]:(_s.subVectors(s[c-1],s[c-2]).add(s[c-1]),o=_s),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(r),p),f=Math.pow(r.distanceToSquared(i),p),m=Math.pow(i.distanceToSquared(o),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),Ss.initNonuniformCatmullRom(n.x,r.x,i.x,o.x,d,f,m),Es.initNonuniformCatmullRom(n.y,r.y,i.y,o.y,d,f,m),Ts.initNonuniformCatmullRom(n.z,r.z,i.z,o.z,d,f,m)}else"catmullrom"===this.curveType&&(Ss.initCatmullRom(n.x,r.x,i.x,o.x,this.tension),Es.initCatmullRom(n.y,r.y,i.y,o.y,this.tension),Ts.initCatmullRom(n.z,r.z,i.z,o.z,this.tension));return a.set(Ss.calc(h),Es.calc(h),Ts.calc(h)),a},Ls.prototype.copy=function(t){xs.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ls.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Ls.prototype.fromJSON=function(t){xs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new P).fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Os.prototype=Object.create(xs.prototype),Os.prototype.constructor=Os,Os.prototype.isCubicBezierCurve=!0,Os.prototype.getPoint=function(t,e){var n=e||new y,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Rs(t,r.x,i.x,o.x,a.x),Rs(t,r.y,i.y,o.y,a.y)),n},Os.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Os.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Os.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Ns.prototype=Object.create(xs.prototype),Ns.prototype.constructor=Ns,Ns.prototype.isCubicBezierCurve3=!0,Ns.prototype.getPoint=function(t,e){var n=e||new P,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Rs(t,r.x,i.x,o.x,a.x),Rs(t,r.y,i.y,o.y,a.y),Rs(t,r.z,i.z,o.z,a.z)),n},Ns.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Ns.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Ns.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Cs.prototype=Object.create(xs.prototype),Cs.prototype.constructor=Cs,Cs.prototype.isLineCurve=!0,Cs.prototype.getPoint=function(t,e){var n=e||new y;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Cs.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Cs.prototype.getTangent=function(t,e){return(e||new y).copy(this.v2).sub(this.v1).normalize()},Cs.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Cs.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Cs.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Is.prototype=Object.create(xs.prototype),Is.prototype.constructor=Is,Is.prototype.isLineCurve3=!0,Is.prototype.getPoint=function(t,e){var n=e||new P;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Is.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Is.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Is.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Is.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ds.prototype=Object.create(xs.prototype),Ds.prototype.constructor=Ds,Ds.prototype.isQuadraticBezierCurve=!0,Ds.prototype.getPoint=function(t,e){var n=e||new y,r=this.v0,i=this.v1,o=this.v2;return n.set(Ps(t,r.x,i.x,o.x),Ps(t,r.y,i.y,o.y)),n},Ds.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ds.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ds.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},zs.prototype=Object.create(xs.prototype),zs.prototype.constructor=zs,zs.prototype.isQuadraticBezierCurve3=!0,zs.prototype.getPoint=function(t,e){var n=e||new P,r=this.v0,i=this.v1,o=this.v2;return n.set(Ps(t,r.x,i.x,o.x),Ps(t,r.y,i.y,o.y),Ps(t,r.z,i.z,o.z)),n},zs.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},zs.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},zs.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},js.prototype=Object.create(xs.prototype),js.prototype.constructor=js,js.prototype.isSplineCurve=!0,js.prototype.getPoint=function(t,e){var n=e||new y,r=this.points,i=(r.length-1)*t,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],c=r[o],u=r[o>r.length-2?r.length-1:o+1],l=r[o>r.length-3?r.length-1:o+2];return n.set(As(a,s.x,c.x,u.x,l.x),As(a,s.y,c.y,u.y,l.y)),n},js.prototype.copy=function(t){xs.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this},js.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t},js.prototype.fromJSON=function(t){xs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new y).fromArray(r))}return this};var Bs=Object.freeze({__proto__:null,ArcCurve:Ms,CatmullRomCurve3:Ls,CubicBezierCurve:Os,CubicBezierCurve3:Ns,EllipseCurve:bs,LineCurve:Cs,LineCurve3:Is,QuadraticBezierCurve:Ds,QuadraticBezierCurve3:zs,SplineCurve:js});function ks(){xs.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Fs(t){ks.call(this),this.type="Path",this.currentPoint=new y,t&&this.setFromPoints(t)}function Us(t){Fs.call(this,t),this.uuid=g.generateUUID(),this.type="Shape",this.holes=[]}function Gs(t,e){et.call(this),this.type="Light",this.color=new qt(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Hs(t,e,n){Gs.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(et.DefaultUp),this.updateMatrix(),this.groundColor=new qt(e)}function Vs(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new y(512,512),this.map=null,this.mapPass=null,this.matrix=new j,this._frustum=new on,this._frameExtents=new y(1,1),this._viewportCount=1,this._viewports=[new _(0,0,1,1)]}function Ws(){Vs.call(this,new Qe(50,1,.5,500))}function qs(t,e,n,r,i,o){Gs.call(this,t,e),this.type="SpotLight",this.position.copy(et.DefaultUp),this.updateMatrix(),this.target=new et,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==o?o:1,this.shadow=new Ws}function Xs(){Vs.call(this,new Qe(90,1,.5,500)),this._frameExtents=new y(4,2),this._viewportCount=6,this._viewports=[new _(2,1,1,1),new _(0,1,1,1),new _(3,1,1,1),new _(1,1,1,1),new _(3,0,1,1),new _(1,0,1,1)],this._cubeDirections=[new P(1,0,0),new P(-1,0,0),new P(0,0,1),new P(0,0,-1),new P(0,1,0),new P(0,-1,0)],this._cubeUps=[new P(0,1,0),new P(0,1,0),new P(0,1,0),new P(0,1,0),new P(0,0,1),new P(0,0,-1)]}function Ys(t,e,n,r){Gs.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Xs}function Js(t,e,n,r,i,o){Ke.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 Zs(){Vs.call(this,new Js(-5,5,5,-5,.5,500))}function Ks(t,e){Gs.call(this,t,e),this.type="DirectionalLight",this.position.copy(et.DefaultUp),this.updateMatrix(),this.target=new et,this.shadow=new Zs}function Qs(t,e){Gs.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function $s(t,e,n,r){Gs.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function tc(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new P)}function ec(t,e){Gs.call(this,void 0,e),this.type="LightProbe",this.sh=void 0!==t?t:new tc}function nc(t){ls.call(this,t),this.textures={}}ks.prototype=Object.assign(Object.create(xs.prototype),{constructor:ks,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Cs(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=e){var i=n[r]-e,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],r=0,i=this.curves;r<i.length;r++)for(var o=i[r],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),c=0;c<s.length;c++){var u=s[c];e&&e.equals(u)||(n.push(u),e=u)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){xs.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=xs.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var r=this.curves[e];t.curves.push(r.toJSON())}return t},fromJSON:function(t){xs.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push((new Bs[r.type]).fromJSON(r))}return this}}),Fs.prototype=Object.assign(Object.create(ks.prototype),{constructor:Fs,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){var n=new Cs(this.currentPoint.clone(),new y(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,n,r){var i=new Ds(this.currentPoint.clone(),new y(t,e),new y(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(t,e,n,r,i,o){var a=new Os(this.currentPoint.clone(),new y(t,e),new y(n,r),new y(i,o));return this.curves.push(a),this.currentPoint.set(i,o),this},splineThru:function(t){var e=new js([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,n,r,i,o){var a=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+a,e+s,n,r,i,o),this},absarc:function(t,e,n,r,i,o){return this.absellipse(t,e,n,n,r,i,o),this},ellipse:function(t,e,n,r,i,o,a,s){var c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(t+c,e+u,n,r,i,o,a,s),this},absellipse:function(t,e,n,r,i,o,a,s){var c=new bs(t,e,n,r,i,o,a,s);if(this.curves.length>0){var u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);var l=c.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return ks.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=ks.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return ks.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Us.prototype=Object.assign(Object.create(Fs.prototype),{constructor:Us,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){Fs.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=Fs.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){Fs.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 Fs).fromJSON(r))}return this}}),Gs.prototype=Object.assign(Object.create(et.prototype),{constructor:Gs,isLight:!0,copy:function(t){return et.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=et.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Hs.prototype=Object.assign(Object.create(Gs.prototype),{constructor:Hs,isHemisphereLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Vs.prototype,{_projScreenMatrix:new j,_lightPositionWorld:new P,_lookTarget:new P,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){var e=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,o=this._lightPositionWorld;o.setFromMatrixPosition(t.matrixWorld),e.position.copy(o),i.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(i),e.updateMatrixWorld(),r.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Ws.prototype=Object.assign(Object.create(Vs.prototype),{constructor:Ws,isSpotLightShadow:!0,updateMatrices:function(t){var e=this.camera,n=2*g.RAD2DEG*t.angle,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix()),Vs.prototype.updateMatrices.call(this,t)}}),qs.prototype=Object.assign(Object.create(Gs.prototype),{constructor:qs,isSpotLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Xs.prototype=Object.assign(Object.create(Vs.prototype),{constructor:Xs,isPointLightShadow:!0,updateMatrices:function(t,e){void 0===e&&(e=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,o=this._lookTarget,a=this._projScreenMatrix;i.setFromMatrixPosition(t.matrixWorld),n.position.copy(i),o.copy(n.position),o.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(o),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),a.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(a)}}),Ys.prototype=Object.assign(Object.create(Gs.prototype),{constructor:Ys,isPointLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Js.prototype=Object.assign(Object.create(Ke.prototype),{constructor:Js,isOrthographicCamera:!0,copy:function(t,e){return Ke.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.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(i+=c*this.view.offsetX)+c*this.view.width,s=(a-=u*this.view.offsetY)-u*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=et.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}}),Zs.prototype=Object.assign(Object.create(Vs.prototype),{constructor:Zs,isDirectionalLightShadow:!0,updateMatrices:function(t){Vs.prototype.updateMatrices.call(this,t)}}),Ks.prototype=Object.assign(Object.create(Gs.prototype),{constructor:Ks,isDirectionalLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Qs.prototype=Object.assign(Object.create(Gs.prototype),{constructor:Qs,isAmbientLight:!0}),$s.prototype=Object.assign(Object.create(Gs.prototype),{constructor:$s,isRectAreaLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=Gs.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(tc.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*r),e.addScaledVector(o[2],.488603*i),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*r*1.092548),e.addScaledVector(o[5],r*i*1.092548),e.addScaledVector(o[6],.315392*(3*i*i-1)),e.addScaledVector(o[7],n*i*1.092548),e.addScaledVector(o[8],.546274*(n*n-r*r)),e},getIrradianceAt:function(t,e){var n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*r),e.addScaledVector(o[2],1.023328*i),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*r),e.addScaledVector(o[5],.858086*r*i),e.addScaledVector(o[6],.743125*i*i-.247708),e.addScaledVector(o[7],.858086*n*i),e.addScaledVector(o[8],.429043*(n*n-r*r)),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},addScaledSH:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}}),Object.assign(tc,{getBasisAt:function(t,e){var n=t.x,r=t.y,i=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*i,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*i,e[6]=.315392*(3*i*i-1),e[7]=1.092548*n*i,e[8]=.546274*(n*n-r*r)}}),ec.prototype=Object.assign(Object.create(Gs.prototype),{constructor:ec,isLightProbe:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.sh.copy(t.sh),this},fromJSON:function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this},toJSON:function(t){var e=Gs.prototype.toJSON.call(this,t);return e.object.sh=this.sh.toArray(),e}}),nc.prototype=Object.assign(Object.create(ls.prototype),{constructor:nc,load:function(t,e,n,r){var i=this,o=new ps(i.manager);o.setPath(i.path),o.load(t,(function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var r=new Wa[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.sheen&&(r.sheen=(new qt).setHex(t.sheen)),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.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.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.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.morphNormals&&(r.morphNormals=t.morphNormals),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.vertexTangents&&(r.vertexTangents=t.vertexTangents),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=t.vertexColors>0:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(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 qt).setHex(o.value);break;case"v2":r.uniforms[i].value=(new y).fromArray(o.value);break;case"v3":r.uniforms[i].value=(new P).fromArray(o.value);break;case"v4":r.uniforms[i].value=(new _).fromArray(o.value);break;case"m3":r.uniforms[i].value=(new x).fromArray(o.value);case"m4":r.uniforms[i].value=(new j).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)),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 y).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.refractionRatio&&(r.refractionRatio=t.refractionRatio),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)),void 0!==t.clearcoatMap&&(r.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new y).fromArray(t.clearcoatNormalScale)),r},setTextures:function(t){return this.textures=t,this}});var rc=function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)};function ic(){be.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function oc(t,e,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),ee.call(this,t,e,n),this.meshPerAttribute=r||1}function ac(t){ls.call(this,t)}ic.prototype=Object.assign(Object.create(be.prototype),{constructor:ic,isInstancedBufferGeometry:!0,copy:function(t){return be.prototype.copy.call(this,t),this.instanceCount=t.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=be.prototype.toJSON.call(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}),oc.prototype=Object.assign(Object.create(ee.prototype),{constructor:oc,isInstancedBufferAttribute:!0,copy:function(t){return ee.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=ee.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),ac.prototype=Object.assign(Object.create(ls.prototype),{constructor:ac,load:function(t,e,n,r){var i=this,o=new ps(i.manager);o.setPath(i.path),o.load(t,(function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)},parse:function(t){var e=t.isInstancedBufferGeometry?new ic:new be,n=t.data.index;if(void 0!==n){var r=new sc[n.type](n.array);e.setIndex(new ee(r,1))}var i=t.data.attributes;for(var o in i){var a=i[o],s=(r=new sc[a.type](a.array),new(a.isInstancedBufferAttribute?oc:ee)(r,a.itemSize,a.normalized));void 0!==a.name&&(s.name=a.name),e.setAttribute(o,s)}var c=t.data.morphAttributes;if(c)for(var o in c){for(var u=c[o],l=[],h=0,p=u.length;h<p;h++){a=u[h],s=new ee(r=new sc[a.type](a.array),a.itemSize,a.normalized);void 0!==a.name&&(s.name=a.name),l.push(s)}e.morphAttributes[o]=l}t.data.morphTargetsRelative&&(e.morphTargetsRelative=!0);var d=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==d){h=0;for(var f=d.length;h!==f;++h){var m=d[h];e.addGroup(m.start,m.count,m.materialIndex)}}var v=t.data.boundingSphere;if(void 0!==v){var g=new P;void 0!==v.center&&g.fromArray(v.center),e.boundingSphere=new xt(g,v.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e}});var sc={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function cc(t){ls.call(this,t)}cc.prototype=Object.assign(Object.create(ls.prototype),{constructor:cc,load:function(t,e,n,r){var i=this,o=""===this.path?rc(t):this.path;this.resourcePath=this.resourcePath||o;var a=new ps(i.manager);a.setPath(this.path),a.load(t,(function(n){var o=null;try{o=JSON.parse(n)}catch(e){return void 0!==r&&r(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t)}),n,r)},parse:function(t,e){var n=this.parseShape(t.shapes),r=this.parseGeometries(t.geometries,n),i=this.parseImages(t.images,(function(){void 0!==e&&e(s)})),o=this.parseTextures(t.textures,i),a=this.parseMaterials(t.materials,o),s=this.parseObject(t.object,r,a);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,r=t.length;n<r;n++){var i=(new Us).fromJSON(t[n]);e[i.uuid]=i}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var r=new ac,i=0,o=t.length;i<o;i++){var a,s=t[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new Ia[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new Ia[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new Ia[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new Ia[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new Ia[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new Ia[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":a=new Ia[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new Ia[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new Ia[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new Ia[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":a=new Ia[s.type]((new Bs[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":a=new Ia[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":a=new Ia[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],u=0,l=s.shapes.length;u<l;u++){var h=e[s.shapes[u]];c.push(h)}a=new Ia[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],u=0,l=s.shapes.length;u<l;u++){h=e[s.shapes[u]];c.push(h)}var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Bs[p.type]).fromJSON(p)),a=new Ia[s.type](c,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),!0===a.isBufferGeometry&&void 0!==s.userData&&(a.userData=s.userData),n[s.uuid]=a}return n},parseMaterials:function(t,e){var n={},r={};if(void 0!==t){var i=new nc;i.setTextures(e);for(var o=0,a=t.length;o<a;o++){var s=t[o];if("MultiMaterial"===s.type){for(var c=[],u=0;u<s.materials.length;u++){var l=s.materials[u];void 0===n[l.uuid]&&(n[l.uuid]=i.parse(l)),c.push(n[l.uuid])}r[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i=os.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),e.push(i)}return e},parseImages:function(t,e){var n=this,r={};function i(t){return n.manager.itemStart(t),o.load(t,(function(){n.manager.itemEnd(t)}),void 0,(function(){n.manager.itemError(t),n.manager.itemEnd(t)}))}if(void 0!==t&&t.length>0){var o=new vs(new cs(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var c=t[a],u=c.url;if(Array.isArray(u)){r[c.uuid]=[];for(var l=0,h=u.length;l<h;l++){var p=u[l],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;r[c.uuid].push(i(d))}}else{d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.resourcePath+c.url;r[c.uuid]=i(d)}}}return r},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var r={};if(void 0!==t)for(var i=0,o=t.length;i<o;i++){var a,s=t[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(a=Array.isArray(e[s.image])?new Sn(e[s.image]):new w(e[s.image])).needsUpdate=!0,a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=n(s.mapping,lc)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=n(s.wrap[0],hc),a.wrapT=n(s.wrap[1],hc)),void 0!==s.format&&(a.format=s.format),void 0!==s.type&&(a.type=s.type),void 0!==s.encoding&&(a.encoding=s.encoding),void 0!==s.minFilter&&(a.minFilter=n(s.minFilter,pc)),void 0!==s.magFilter&&(a.magFilter=n(s.magFilter,pc)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(a.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(a.unpackAlignment=s.unpackAlignment),r[s.uuid]=a}return r},parseObject:function(t,e,n){var r;function i(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function o(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],r=0,i=t.length;r<i;r++){var o=t[r];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),e.push(n[o])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":r=new nt,void 0!==t.background&&Number.isInteger(t.background)&&(r.background=new qt(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?r.fog=new pi(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(r.fog=new hi(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":r=new Qe(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(r.focus=t.focus),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.filmGauge&&(r.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(r.filmOffset=t.filmOffset),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"OrthographicCamera":r=new Js(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"AmbientLight":r=new Qs(t.color,t.intensity);break;case"DirectionalLight":r=new Ks(t.color,t.intensity);break;case"PointLight":r=new Ys(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":r=new $s(t.color,t.intensity,t.width,t.height);break;case"SpotLight":r=new qs(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":r=new Hs(t.color,t.groundColor,t.intensity);break;case"LightProbe":r=(new ec).fromJSON(t);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":r=new Be(a=i(t.geometry),s=o(t.material));break;case"InstancedMesh":var a=i(t.geometry),s=o(t.material),c=t.count,u=t.instanceMatrix;(r=new Ji(a,s,c)).instanceMatrix=new ee(new Float32Array(u.array),16);break;case"LOD":r=new ki;break;case"Line":r=new no(i(t.geometry),o(t.material),t.mode);break;case"LineLoop":r=new ao(i(t.geometry),o(t.material));break;case"LineSegments":r=new oo(i(t.geometry),o(t.material));break;case"PointCloud":case"Points":r=new po(i(t.geometry),o(t.material));break;case"Sprite":r=new Ri(o(t.material));break;case"Group":r=new ai;break;default:r=new et}if(r.uuid=t.uuid,void 0!==t.name&&(r.name=t.name),void 0!==t.matrix?(r.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(r.matrixAutoUpdate=t.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==t.position&&r.position.fromArray(t.position),void 0!==t.rotation&&r.rotation.fromArray(t.rotation),void 0!==t.quaternion&&r.quaternion.fromArray(t.quaternion),void 0!==t.scale&&r.scale.fromArray(t.scale)),void 0!==t.castShadow&&(r.castShadow=t.castShadow),void 0!==t.receiveShadow&&(r.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(r.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(r.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&r.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(r.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.frustumCulled&&(r.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(r.renderOrder=t.renderOrder),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.layers&&(r.layers.mask=t.layers),void 0!==t.children)for(var l=t.children,h=0;h<l.length;h++)r.add(this.parseObject(l[h],e,n));if("LOD"===t.type){void 0!==t.autoUpdate&&(r.autoUpdate=t.autoUpdate);for(var p=t.levels,d=0;d<p.length;d++){var f=p[d],m=r.getObjectByProperty("uuid",f.object);void 0!==m&&r.addLevel(m,f.distance)}}return r}});var uc,lc={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},hc={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},pc={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};function dc(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),ls.call(this,t),this.options=void 0}function fc(){this.type="ShapePath",this.color=new qt,this.subPaths=[],this.currentPath=null}function mc(t){this.type="Font",this.data=t}function vc(t,e,n,r,i){var o=i.glyphs[t]||i.glyphs["?"];if(o){var a,s,c,u,l,h,p,d,f=new fc;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),v=0,g=m.length;v<g;){switch(m[v++]){case"m":a=m[v++]*e+n,s=m[v++]*e+r,f.moveTo(a,s);break;case"l":a=m[v++]*e+n,s=m[v++]*e+r,f.lineTo(a,s);break;case"q":c=m[v++]*e+n,u=m[v++]*e+r,l=m[v++]*e+n,h=m[v++]*e+r,f.quadraticCurveTo(l,h,c,u);break;case"b":c=m[v++]*e+n,u=m[v++]*e+r,l=m[v++]*e+n,h=m[v++]*e+r,p=m[v++]*e+n,d=m[v++]*e+r,f.bezierCurveTo(l,h,p,d,c,u)}}return{offsetX:o.ha*e,path:f}}console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".")}function gc(t){ls.call(this,t)}dc.prototype=Object.assign(Object.create(ls.prototype),{constructor:dc,setOptions:function(t){return this.options=t,this},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=ss.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;fetch(t).then((function(t){return t.blob()})).then((function(t){return void 0===i.options?createImageBitmap(t):createImageBitmap(t,i.options)})).then((function(n){ss.add(t,n),e&&e(n),i.manager.itemEnd(t)})).catch((function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)})),i.manager.itemStart(t)}}),Object.assign(fc.prototype,{moveTo:function(t,e){return this.currentPath=new Fs,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this},bezierCurveTo:function(t,e,n,r,i,o){return this.currentPath.bezierCurveTo(t,e,n,r,i,o),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function n(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n],o=new Us;o.curves=i.curves,e.push(o)}return e}function r(t,e){for(var n=e.length,r=!1,i=n-1,o=0;o<n;i=o++){var a=e[i],s=e[o],c=s.x-a.x,u=s.y-a.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(a=e[o],c=-c,s=e[i],u=-u),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var l=u*(t.x-a.x)-c*(t.y-a.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return r}var i=ua.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,c,u=[];if(1===o.length)return s=o[0],(c=new Us).curves=s.curves,u.push(c),u;var l=!i(o[0].getPoints());l=t?!l:l;var h,p,d=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=o.length;g<y;g++)a=i(h=(s=o[g]).getPoints()),(a=t?!a:a)?(!l&&f[v]&&v++,f[v]={s:new Us,p:h},f[v].s.curves=s.curves,l&&v++,m[v]=[]):m[v].push({h:s,p:h[0]});if(!f[0])return n(o);if(f.length>1){for(var x=!1,b=[],M=0,w=f.length;M<w;M++)d[M]=[];for(M=0,w=f.length;M<w;M++)for(var _=m[M],S=0;S<_.length;S++){for(var E=_[S],T=!0,L=0;L<f.length;L++)r(E.p,f[L].p)&&(M!==L&&b.push({froms:M,tos:L,hole:S}),T?(T=!1,d[L].push(E)):x=!0);T&&d[M].push(E)}b.length>0&&(x||(m=d))}g=0;for(var A=f.length;g<A;g++){c=f[g].s,u.push(c);for(var P=0,R=(p=m[g]).length;P<R;P++)c.holes.push(p[P].h)}return u}}),Object.assign(mc.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],r=function(t,e,n){for(var r=Array.from?Array.from(t):String(t).split(""),i=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[],s=0,c=0,u=0;u<r.length;u++){var l=r[u];if("\n"===l)s=0,c-=o;else{var h=vc(l,i,s,c,n);s+=h.offsetX,a.push(h.path)}}return a}(t,e,this.data),i=0,o=r.length;i<o;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),gc.prototype=Object.assign(Object.create(ls.prototype),{constructor:gc,load:function(t,e,n,r){var i=this,o=new ps(this.manager);o.setPath(this.path),o.load(t,(function(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var r=i.parse(n);e&&e(r)}),n,r)},parse:function(t){return new mc(t)}});var yc=function(){return void 0===uc&&(uc=new(window.AudioContext||window.webkitAudioContext)),uc};function xc(t){ls.call(this,t)}function bc(t,e,n){ec.call(this,void 0,n);var r=(new qt).set(t),i=(new qt).set(e),o=new P(r.r,r.g,r.b),a=new P(i.r,i.g,i.b),s=Math.sqrt(Math.PI),c=s*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}function Mc(t,e){ec.call(this,void 0,e);var n=(new qt).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}xc.prototype=Object.assign(Object.create(ls.prototype),{constructor:xc,load:function(t,e,n,r){var i=this,o=new ps(i.manager);o.setResponseType("arraybuffer"),o.setPath(i.path),o.load(t,(function(n){try{var o=n.slice(0);yc().decodeAudioData(o,(function(t){e(t)}))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)}}),bc.prototype=Object.assign(Object.create(ec.prototype),{constructor:bc,isHemisphereLightProbe:!0,copy:function(t){return ec.prototype.copy.call(this,t),this},toJSON:function(t){return ec.prototype.toJSON.call(this,t)}}),Mc.prototype=Object.assign(Object.create(ec.prototype),{constructor:Mc,isAmbientLightProbe:!0,copy:function(t){return ec.prototype.copy.call(this,t),this},toJSON:function(t){return ec.prototype.toJSON.call(this,t)}});var wc=new j,_c=new j;function Sc(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Qe,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Qe,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}.prototype,{update:function(t){var e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;var n,r,i=t.projectionMatrix.clone(),o=e.eyeSep/2,a=o*e.near/e.focus,s=e.near*Math.tan(g.DEG2RAD*e.fov*.5)/e.zoom;_c.elements[12]=-o,wc.elements[12]=o,n=-s*e.aspect+a,r=s*e.aspect+a,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*e.aspect-a,r=s*e.aspect-a,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(_c),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(wc)}}),Object.assign(Sc.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}});var Ec=new P,Tc=new T,Lc=new P,Ac=new P;function Pc(){et.call(this),this.type="AudioListener",this.context=yc(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Sc}function Rc(t){et.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._progress=0,this.filters=[]}Pc.prototype=Object.assign(Object.create(et.prototype),{constructor:Pc,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){et.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ec,Tc,Lc),Ac.set(0,0,-1).applyQuaternion(Tc),e.positionX){var r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Ec.x,r),e.positionY.linearRampToValueAtTime(Ec.y,r),e.positionZ.linearRampToValueAtTime(Ec.z,r),e.forwardX.linearRampToValueAtTime(Ac.x,r),e.forwardY.linearRampToValueAtTime(Ac.y,r),e.forwardZ.linearRampToValueAtTime(Ac.z,r),e.upX.linearRampToValueAtTime(n.x,r),e.upY.linearRampToValueAtTime(n.y,r),e.upZ.linearRampToValueAtTime(n.z,r)}else e.setPosition(Ec.x,Ec.y,Ec.z),e.setOrientation(Ac.x,Ac.y,Ac.z,n.x,n.y,n.z)}}),Rc.prototype=Object.assign(Object.create(et.prototype),{constructor:Rc,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});var Oc=new P,Nc=new T,Cc=new P,Ic=new P;function Dc(t){Rc.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function zc(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function jc(t,e,n){var r,i,o;switch(this.binding=t,this.valueSize=n,e){case"quaternion":r=this._slerp,i=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Dc.prototype=Object.assign(Object.create(Rc.prototype),{constructor:Dc,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){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(t){if(et.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(Oc,Nc,Cc),Ic.set(0,0,1).applyQuaternion(Nc);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Oc.x,n),e.positionY.linearRampToValueAtTime(Oc.y,n),e.positionZ.linearRampToValueAtTime(Oc.z,n),e.orientationX.linearRampToValueAtTime(Ic.x,n),e.orientationY.linearRampToValueAtTime(Ic.y,n),e.orientationZ.linearRampToValueAtTime(Ic.z,n)}else e.setPosition(Oc.x,Oc.y,Oc.z),e.setOrientation(Ic.x,Ic.y,Ic.z)}}}),Object.assign(zc.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(jc.prototype,{accumulate:function(t,e){var n=this.buffer,r=this.valueSize,i=t*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)n[i+a]=n[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=o},accumulateAdditive:function(t){var e=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t},apply:function(t){var e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){var s=e*this._origIndex;this._mixBufferRegion(n,r,s,1-i,e)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(var c=e,u=e+e;c!==u;++c)if(n[c]!==n[c+e]){a.setValue(n,r);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(var i=n,o=r;i!==o;++i)e[i]=e[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){for(var t=this._addIndex*this.valueSize,e=t+this.valueSize,n=t;n<e;n++)this.buffer[n]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[4*this._addIndex+3]=1},_setAdditiveIdentityOther:function(){for(var t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]},_select:function(t,e,n,r,i){if(r>=.5)for(var o=0;o!==i;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,r){T.slerpFlat(t,e,t,e,t,n,r)},_slerpAdditive:function(t,e,n,r,i){var o=this._workIndex*i;T.multiplyQuaternionsFlat(t,o,t,e,t,n),T.slerpFlat(t,e,t,e,t,o,r)},_lerp:function(t,e,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*r}},_lerpAdditive:function(t,e,n,r,i){for(var o=0;o!==i;++o){var a=e+o;t[a]=t[a]+t[n+o]*r}}});var Bc=new RegExp("[\\[\\]\\.:\\/]","g"),kc="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Fc=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Uc=/(WCOD+)?/.source.replace("WCOD",kc),Gc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Hc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Vc=new RegExp("^"+Fc+Uc+Gc+Hc+"$"),Wc=["material","materials","bones"];function qc(t,e,n){var r=n||Xc.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function Xc(t,e,n){this.path=e,this.parsedPath=n||Xc.parseTrackName(e),this.node=Xc.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Yc(t,e,n,r){this._mixer=t,this._clip=e,this._localRoot=n||null,this.blendMode=r||e.blendMode;for(var i=e.tracks,o=i.length,a=new Array(o),s={endingStart:2400,endingEnd:2400},c=0;c!==o;++c){var u=i[c].createInterpolant(null);a[c]=u,u.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Jc(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Zc(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Kc(t,e,n){di.call(this,t,e),this.meshPerAttribute=n||1}function Qc(t,e,n,r){this.ray=new Lt(t,e),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new U,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function $c(t,e){return t.distance-e.distance}function tu(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r)for(var i=t.children,o=0,a=i.length;o<a;o++)tu(i[o],e,n,!0)}Object.assign(qc.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Xc,{Composite:qc,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Xc.Composite(t,e,n):new Xc(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Bc,"")},parseTrackName:function(t){var e=Vc.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!==Wc.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){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var r=function(t){for(var n=0;n<t.length;n++){var i=t[n];if(i.name===e||i.uuid===e)return i;var o=r(i.children);if(o)return o}return null},i=r(t.children);if(i)return i}return null}}),Object.assign(Xc.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)t[e++]=n[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,r=e.propertyName,i=e.propertyIndex;if(t||(t=Xc.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var s=t[r];if(void 0!==s){var c=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[i]&&(i=t.morphTargetDictionary[i])}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}else{var l=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+r+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Xc.prototype,{_getValue_unbound:Xc.prototype.getValue,_setValue_unbound:Xc.prototype.setValue}),Object.assign(function(){this.uuid=g.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,c=void 0,u=0,l=arguments.length;u!==l;++u){var h=arguments[u],p=h.uuid,d=r[p];if(void 0===d){d=e++,r[p]=d,t.push(h);for(var f=0,m=s;f!==m;++f)a[f].push(new Xc(h,i[f],o[f]))}else if(d<n){c=t[d];var v=--n,g=t[v];r[g.uuid]=d,t[d]=g,r[p]=v,t[v]=h;for(f=0,m=s;f!==m;++f){var y=a[f],x=y[v],b=y[d];y[d]=x,void 0===b&&(b=new Xc(h,i[f],o[f])),y[v]=b}}else t[d]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],c=s.uuid,u=n[c];if(void 0!==u&&u>=e){var l=e++,h=t[l];n[h.uuid]=u,t[u]=h,n[c]=l,t[l]=s;for(var p=0,d=i;p!==d;++p){var f=r[p],m=f[l],v=f[u];f[u]=m,f[l]=v}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],u=c.uuid,l=r[u];if(void 0!==l)if(delete r[u],l<n){var h=--n,p=t[h],d=t[y=--e];r[p.uuid]=l,t[l]=p,r[d.uuid]=h,t[h]=d,t.pop();for(var f=0,m=o;f!==m;++f){var v=(x=i[f])[h],g=x[y];x[l]=v,x[h]=g,x.pop()}}else{var y;r[(d=t[y=--e]).uuid]=l,t[l]=d,t.pop();for(f=0,m=o;f!==m;++f){var x;(x=i[f])[l]=x[y],x.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,r=n[t],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,l=new Array(c);r=i.length,n[t]=r,o.push(t),a.push(e),i.push(l);for(var h=u,p=s.length;h!==p;++h){var d=s[h];l[h]=new Xc(d,t,e)}return l},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}}),Object.assign(Yc.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var r=this._clip.duration,i=t._clip.duration,o=i/r,a=r/i;t.warp(1,o,e),this.warp(a,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var r=this._mixer,i=r.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=t/a,c[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(t-i)*n;if(o<0||0===n)return;this._startTime=null,e=n*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0){var c=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case 2501:for(var l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].accumulateAdditive(s);break;case 2500:default:for(l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].accumulate(r,s)}}}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,r=this.loop,i=this._loopCount,o=2202===r;if(0===t)return-1===i?e:o&&1==(1&i)?n-e:e;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=n)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=n||e<0){var a=Math.floor(e/n);e-=n*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var c=t<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=e;if(o&&1==(1&i))return n-e}return e},_setEndings:function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(t,e,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=n,this}}),Jc.prototype=Object.assign(Object.create(d.prototype),{constructor:Jc,_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,u=c[s];void 0===u&&(u={},c[s]=u);for(var l=0;l!==i;++l){var h=r[l],p=h.name,d=u[p];if(void 0!==d)o[l]=d;else{if(void 0!==(d=o[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=e&&e._propertyBindings[l].binding.parsedPath;++(d=new jc(Xc.create(n,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),o[l]=d}a[l].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var r=this._actions,i=this._actionsByClip,o=i[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=r.length,r.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],r=t._cacheIndex;n._cacheIndex=r,e[r]=n,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,c=s[s.length-1],u=t._byClipCacheIndex;c._byClipCacheIndex=u,s[u]=c,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_addInactiveBinding:function(t,e,n){var r=this._bindingsByRootAndName,i=r[e],o=this._bindings;void 0===i&&(i={},r[e]=i),i[n]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete a[i],0===Object.keys(a).length&&delete o[r]},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&((n=new Ja(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];t.__cacheIndex=r,e[r]=t,i.__cacheIndex=n,e[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e,n){var r=e||this._root,i=r.uuid,o="string"==typeof t?os.findByName(r,t):t,a=null!==o?o.uuid:t,s=this._actionsByClip[a],c=null;if(void 0===n&&(n=null!==o?o.blendMode:2500),void 0!==s){var u=s.actionByRoot[i];if(void 0!==u&&u.blendMode===n)return u;c=s.knownActions[0],null===o&&(o=c._clip)}if(null===o)return null;var l=new Yc(this,o,e,n);return this._bindAction(l,c),this._addInactiveAction(l,a,i),l},existingAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?os.findByName(n,t):t,o=i?i.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null},stopAllAction:function(){for(var t=this._actions,e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a){e[a]._update(r,t,i,o)}var s=this._bindings,c=this._nActiveBindings;for(a=0;a!==c;++a)s[a].apply(o);return this},setTime:function(t){this.time=0;for(var e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var o=i.knownActions,a=0,s=o.length;a!==s;++a){var c=o[a];this._deactivateAction(c);var u=c._cacheIndex,l=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,l._cacheIndex=u,e[u]=l,e.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var o=this._bindingsByRootAndName[e];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Zc.prototype.clone=function(){return new Zc(void 0===this.value.clone?this.value:this.value.clone())},Kc.prototype=Object.assign(Object.create(di.prototype),{constructor:Kc,isInstancedInterleavedBuffer:!0,copy:function(t){return di.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Qc.prototype,{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(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var r=n||[];return tu(t,this,r,e),r.sort($c),r},intersectObjects:function(t,e,n){var r=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,o=t.length;i<o;i++)tu(t[i],this,r,e);return r.sort($c),r}}),Object.assign(function(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(g.clamp(e/this.radius,-1,1))),this}}),Object.assign(function(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}});var eu=new y;function nu(t,e){this.min=void 0!==t?t:new y(1/0,1/0),this.max=void 0!==e?e:new y(-1/0,-1/0)}Object.assign(nu.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=eu.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},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=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new y),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new y),this.isEmpty()?t.set(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},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},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},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new y),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},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)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new y),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return eu.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),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)}});var ru=new P,iu=new P;function ou(t,e){this.start=void 0!==t?t:new P,this.end=void 0!==e?e:new P}function au(t){et.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Object.assign(ou.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new P),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new P),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new P),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){ru.subVectors(t,this.start),iu.subVectors(this.end,this.start);var n=iu.dot(iu),r=iu.dot(ru)/n;return e&&(r=g.clamp(r,0,1)),r},closestPointToPoint:function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new P),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),au.prototype=Object.create(et.prototype),au.prototype.constructor=au,au.prototype.isImmediateRenderObject=!0;var su=new P;function cu(t,e){et.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new be,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,o=1;i<32;i++,o++){var a=i/32*Math.PI*2,s=o/32*Math.PI*2;r.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new ue(r,3));var c=new Zi({fog:!1,toneMapped:!1});this.cone=new oo(n,c),this.add(this.cone),this.update()}cu.prototype=Object.create(et.prototype),cu.prototype.constructor=cu,cu.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},cu.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),su.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(su),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var uu=new P,lu=new j,hu=new j;function pu(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var r=0;r<e.children.length;r++)n.push.apply(n,t(e.children[r]));return n}(t),n=new be,r=[],i=[],o=new qt(0,0,1),a=new qt(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}n.setAttribute("position",new ue(r,3)),n.setAttribute("color",new ue(i,3));var u=new Zi({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});oo.call(this,n,u),this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function du(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var r=new xa(e,4,2),i=new $t({wireframe:!0,fog:!1,toneMapped:!1});Be.call(this,r,i),this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}pu.prototype=Object.create(oo.prototype),pu.prototype.constructor=pu,pu.prototype.isSkeletonHelper=!0,pu.prototype.updateMatrixWorld=function(t){var e=this.bones,n=this.geometry,r=n.getAttribute("position");hu.getInverse(this.root.matrixWorld);for(var i=0,o=0;i<e.length;i++){var a=e[i];a.parent&&a.parent.isBone&&(lu.multiplyMatrices(hu,a.matrixWorld),uu.setFromMatrixPosition(lu),r.setXYZ(o,uu.x,uu.y,uu.z),lu.multiplyMatrices(hu,a.parent.matrixWorld),uu.setFromMatrixPosition(lu),r.setXYZ(o+1,uu.x,uu.y,uu.z),o+=2)}n.getAttribute("position").needsUpdate=!0,et.prototype.updateMatrixWorld.call(this,t)},du.prototype=Object.create(Be.prototype),du.prototype.constructor=du,du.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},du.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var fu=new P,mu=new qt,vu=new qt;function gu(t,e,n){et.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Lo(e);r.rotateY(.5*Math.PI),this.material=new $t({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);var i=r.getAttribute("position"),o=new Float32Array(3*i.count);r.setAttribute("color",new ee(o,3)),this.add(new Be(r,this.material)),this.update()}function yu(t,e,n,r){t=t||10,e=e||10,n=new qt(void 0!==n?n:4473924),r=new qt(void 0!==r?r:8947848);for(var i=e/2,o=t/e,a=t/2,s=[],c=[],u=0,l=0,h=-a;u<=e;u++,h+=o){s.push(-a,0,h,a,0,h),s.push(h,0,-a,h,0,a);var p=u===i?n:r;p.toArray(c,l),l+=3,p.toArray(c,l),l+=3,p.toArray(c,l),l+=3,p.toArray(c,l),l+=3}var d=new be;d.setAttribute("position",new ue(s,3)),d.setAttribute("color",new ue(c,3));var f=new Zi({vertexColors:!0,toneMapped:!1});oo.call(this,d,f),this.type="GridHelper"}function xu(t,e,n,r,i,o){t=t||10,e=e||16,n=n||8,r=r||64,i=new qt(void 0!==i?i:4473924),o=new qt(void 0!==o?o:8947848);var a,s,c,u,l,h,p,d=[],f=[];for(u=0;u<=e;u++)c=u/e*(2*Math.PI),a=Math.sin(c)*t,s=Math.cos(c)*t,d.push(0,0,0),d.push(a,0,s),p=1&u?i:o,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(u=0;u<=n;u++)for(p=1&u?i:o,h=t-t/n*u,l=0;l<r;l++)c=l/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,d.push(a,0,s),f.push(p.r,p.g,p.b),c=(l+1)/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,d.push(a,0,s),f.push(p.r,p.g,p.b);var m=new be;m.setAttribute("position",new ue(d,3)),m.setAttribute("color",new ue(f,3));var v=new Zi({vertexColors:!0,toneMapped:!1});oo.call(this,m,v),this.type="PolarGridHelper"}gu.prototype=Object.create(et.prototype),gu.prototype.constructor=gu,gu.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},gu.prototype.update=function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");mu.copy(this.light.color),vu.copy(this.light.groundColor);for(var n=0,r=e.count;n<r;n++){var i=n<r/2?mu:vu;e.setXYZ(n,i.r,i.g,i.b)}e.needsUpdate=!0}t.lookAt(fu.setFromMatrixPosition(this.light.matrixWorld).negate())},yu.prototype=Object.assign(Object.create(oo.prototype),{constructor:yu,copy:function(t){return oo.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),xu.prototype=Object.create(oo.prototype),xu.prototype.constructor=xu;var bu=new P,Mu=new P,wu=new P;function _u(t,e,n){et.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var r=new be;r.setAttribute("position",new ue([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new Zi({fog:!1,toneMapped:!1});this.lightPlane=new no(r,i),this.add(this.lightPlane),(r=new be).setAttribute("position",new ue([0,0,0,0,0,1],3)),this.targetLine=new no(r,i),this.add(this.targetLine),this.update()}_u.prototype=Object.create(et.prototype),_u.prototype.constructor=_u,_u.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},_u.prototype.update=function(){bu.setFromMatrixPosition(this.light.matrixWorld),Mu.setFromMatrixPosition(this.light.target.matrixWorld),wu.subVectors(Mu,bu),this.lightPlane.lookAt(Mu),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Mu),this.targetLine.scale.z=wu.length()};var Su=new P,Eu=new Ke;function Tu(t){var e=new be,n=new Zi({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],o={},a=new qt(16755200),s=new qt(16711680),c=new qt(43775),u=new qt(16777215),l=new qt(3355443);function h(t,e,n){p(t,n),p(e,n)}function p(t,e){r.push(0,0,0),i.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(r.length/3-1)}h("n1","n2",a),h("n2","n4",a),h("n4","n3",a),h("n3","n1",a),h("f1","f2",a),h("f2","f4",a),h("f4","f3",a),h("f3","f1",a),h("n1","f1",a),h("n2","f2",a),h("n3","f3",a),h("n4","f4",a),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",u),h("p","c",l),h("cn1","cn2",l),h("cn3","cn4",l),h("cf1","cf2",l),h("cf3","cf4",l),e.setAttribute("position",new ue(r,3)),e.setAttribute("color",new ue(i,3)),oo.call(this,e,n),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function Lu(t,e,n,r,i,o,a){Su.set(i,o,a).unproject(r);var s=e[t];if(void 0!==s)for(var c=n.getAttribute("position"),u=0,l=s.length;u<l;u++)c.setXYZ(s[u],Su.x,Su.y,Su.z)}Tu.prototype=Object.create(oo.prototype),Tu.prototype.constructor=Tu,Tu.prototype.update=function(){var t=this.geometry,e=this.pointMap;Eu.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Lu("c",e,t,Eu,0,0,-1),Lu("t",e,t,Eu,0,0,1),Lu("n1",e,t,Eu,-1,-1,-1),Lu("n2",e,t,Eu,1,-1,-1),Lu("n3",e,t,Eu,-1,1,-1),Lu("n4",e,t,Eu,1,1,-1),Lu("f1",e,t,Eu,-1,-1,1),Lu("f2",e,t,Eu,1,-1,1),Lu("f3",e,t,Eu,-1,1,1),Lu("f4",e,t,Eu,1,1,1),Lu("u1",e,t,Eu,.7,1.1,-1),Lu("u2",e,t,Eu,-.7,1.1,-1),Lu("u3",e,t,Eu,0,2,-1),Lu("cf1",e,t,Eu,-1,0,1),Lu("cf2",e,t,Eu,1,0,1),Lu("cf3",e,t,Eu,0,-1,1),Lu("cf4",e,t,Eu,0,1,1),Lu("cn1",e,t,Eu,-1,0,-1),Lu("cn2",e,t,Eu,1,0,-1),Lu("cn3",e,t,Eu,0,-1,-1),Lu("cn4",e,t,Eu,0,1,-1),t.getAttribute("position").needsUpdate=!0};var Au=new vt;function Pu(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new be;i.setIndex(new ee(n,1)),i.setAttribute("position",new ee(r,3)),oo.call(this,i,new Zi({color:e,toneMapped:!1})),this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}function Ru(t,e){this.type="Box3Helper",this.box=t,e=e||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new be;r.setIndex(new ee(n,1)),r.setAttribute("position",new ue([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),oo.call(this,r,new Zi({color:e,toneMapped:!1})),this.type="Box3Helper",this.geometry.computeBoundingSphere()}function Ou(t,e,n){this.plane=t,this.size=void 0===e?1:e;var r=void 0!==n?n:16776960,i=new be;i.setAttribute("position",new ue([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),no.call(this,i,new Zi({color:r,toneMapped:!1})),this.type="PlaneHelper";var o=new be;o.setAttribute("position",new ue([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new Be(o,new $t({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}Pu.prototype=Object.create(oo.prototype),Pu.prototype.constructor=Pu,Pu.prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Au.setFromObject(this.object),!Au.isEmpty()){var e=Au.min,n=Au.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Pu.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Pu.prototype.copy=function(t){return oo.prototype.copy.call(this,t),this.object=t.object,this},Pu.prototype.clone=function(){return(new this.constructor).copy(this)},Ru.prototype=Object.create(oo.prototype),Ru.prototype.constructor=Ru,Ru.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),et.prototype.updateMatrixWorld.call(this,t))},Ou.prototype=Object.create(no.prototype),Ou.prototype.constructor=Ou,Ou.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?1:0,this.lookAt(this.plane.normal),et.prototype.updateMatrixWorld.call(this,t)};var Nu,Cu,Iu=new P;function Du(t,e,n,r,i,o){et.call(this),this.type="ArrowHelper",void 0===t&&(t=new P(0,0,1)),void 0===e&&(e=new P(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===o&&(o=.2*i),void 0===Nu&&((Nu=new be).setAttribute("position",new ue([0,0,0,0,1,0],3)),(Cu=new Pa(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new no(Nu,new Zi({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Be(Cu,new $t({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,i,o)}function zu(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new be;n.setAttribute("position",new ue(e,3)),n.setAttribute("color",new ue([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Zi({vertexColors:!0,toneMapped:!1});oo.call(this,n,r),this.type="AxesHelper"}Du.prototype=Object.create(et.prototype),Du.prototype.constructor=Du,Du.prototype.setDirection=function(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Iu.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Iu,e)}},Du.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Du.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Du.prototype.copy=function(t){return et.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Du.prototype.clone=function(){return(new this.constructor).copy(this)},zu.prototype=Object.create(oo.prototype),zu.prototype.constructor=zu;var ju=Math.pow(2,8),Bu=[.125,.215,.35,.446,.526,.582],ku=5+Bu.length,Fu={3e3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},Uu=new Js,{_lodPlanes:Gu,_sizeLods:Hu,_sigmas:Vu}=function(){for(var t=[],e=[],n=[],r=8,i=0;i<ku;i++){var o=Math.pow(2,r);e.push(o);var a=1/o;i>4?a=Bu[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),c=-s/2,u=1+s/2,l=[c,c,u,c,u,u,c,c,u,u,c,u],h=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,v=f>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];h.set(g,18*f),p.set(l,12*f);var y=[f,f,f,f,f,f];d.set(y,6*f)}var x=new be;x.setAttribute("position",new ee(h,3)),x.setAttribute("uv",new ee(p,2)),x.setAttribute("faceIndex",new ee(d,1)),t.push(x),r>4&&r--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}(),Wu=null,qu=(1+Math.sqrt(5))/2,Xu=1/qu,Yu=[new P(1,1,1),new P(-1,1,1),new P(1,1,-1),new P(-1,1,-1),new P(0,qu,Xu),new P(0,qu,-Xu),new P(Xu,0,qu),new P(-Xu,0,qu),new P(qu,Xu,0),new P(-qu,Xu,0)];function Ju(t){var e,n,r,i;this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=(e=20,n=new Float32Array(e),r=new P(0,1,0),(i=new za({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r},inputEncoding:{value:Fu[3e3]},outputEncoding:{value:Fu[3e3]}},vertexShader:el(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${nl()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",i),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Zu(t){return void 0!==t&&1009===t.type&&(3e3===t.encoding||3001===t.encoding||3007===t.encoding)}function Ku(t){var e=new S(3*ju,3*ju,t);return e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Qu(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function $u(){var t=new za({uniforms:{envMap:{value:null},texelSize:{value:new y(1,1)},inputEncoding:{value:Fu[3e3]},outputEncoding:{value:Fu[3e3]}},vertexShader:el(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n${nl()}\n\n#include <common>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv = equirectUv( outputDirection );\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function tl(){var t=new za({uniforms:{envMap:{value:null},inputEncoding:{value:Fu[3e3]},outputEncoding:{value:Fu[3e3]}},vertexShader:el(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n${nl()}\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1});return t.type="CubemapToCubeUV",t}function el(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function nl(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}Ju.prototype={constructor:Ju,fromScene:function(t,e=0,n=.1,r=100){Wu=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(t,n,r,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i},fromEquirectangular:function(t){return t.magFilter=1003,t.minFilter=1003,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){Wu=this._renderer.getRenderTarget();var e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=tl(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=$u(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var t=0;t<Gu.length;t++)Gu[t].dispose()},_cleanup:function(t){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Wu),t.scissorTest=!1,t.setSize(t.width,t.height)},_allocateTargets:function(t){var e={magFilter:1003,minFilter:1003,generateMipmaps:!1,type:1009,format:1023,encoding:Zu(t)?t.encoding:3002,depthBuffer:!1,stencilBuffer:!1},n=Ku(e);return n.depthBuffer=!t,this._pingPongRenderTarget=Ku(e),n},_compileMaterial:function(t){var e=new Be(Gu[0],t);this._renderer.compile(e,Uu)},_sceneToCubeUV:function(t,e,n,r){var i=new Qe(90,1,e,n),o=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],s=this._renderer,c=s.outputEncoding,u=s.toneMapping,l=s.toneMappingExposure,h=s.getClearColor(),p=s.getClearAlpha();s.toneMapping=1,s.toneMappingExposure=1,s.outputEncoding=3e3;var d=t.background;if(d&&d.isColor){d.convertSRGBToLinear();var f=Math.max(d.r,d.g,d.b),m=Math.min(Math.max(Math.ceil(Math.log2(f)),-128),127);d=d.multiplyScalar(Math.pow(2,-m));var v=(m+128)/255;s.setClearColor(d,v),t.background=null}for(var g=0;g<6;g++){var y=g%3;0==y?(i.up.set(0,o[g],0),i.lookAt(a[g],0,0)):1==y?(i.up.set(0,0,o[g]),i.lookAt(0,a[g],0)):(i.up.set(0,o[g],0),i.lookAt(0,0,a[g])),Qu(r,y*ju,g>2?ju:0,ju,ju),s.setRenderTarget(r),s.render(t,i)}s.toneMapping=u,s.toneMappingExposure=l,s.outputEncoding=c,s.setClearColor(h,p)},_textureToCubeUV:function(t,e){var n=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=tl()):null==this._equirectShader&&(this._equirectShader=$u());var r=t.isCubeTexture?this._cubemapShader:this._equirectShader,i=new Be(Gu[0],r),o=r.uniforms;o.envMap.value=t,t.isCubeTexture||o.texelSize.value.set(1/t.image.width,1/t.image.height),o.inputEncoding.value=Fu[t.encoding],o.outputEncoding.value=Fu[e.texture.encoding],Qu(e,0,0,3*ju,2*ju),n.setRenderTarget(e),n.render(i,Uu)},_applyPMREM:function(t){var e=this._renderer,n=e.autoClear;e.autoClear=!1;for(var r=1;r<ku;r++){var i=Math.sqrt(Vu[r]*Vu[r]-Vu[r-1]*Vu[r-1]),o=Yu[(r-1)%Yu.length];this._blur(t,r-1,r,i,o)}e.autoClear=n},_blur:function(t,e,n,r,i){var o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,r,"latitudinal",i),this._halfBlur(o,t,n,n,r,"longitudinal",i)},_halfBlur:function(t,e,n,r,i,o,a){var s=this._renderer,c=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");var u=new Be(Gu[r],c),l=c.uniforms,h=Hu[n]-1,p=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,d=i/p,f=isFinite(i)?1+Math.floor(3*d):20;f>20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);for(var m=[],v=0,g=0;g<20;++g){var y=g/d,x=Math.exp(-y*y/2);m.push(x),0==g?v+=x:g<f&&(v+=2*x)}for(g=0;g<m.length;g++)m[g]=m[g]/v;l.envMap.value=t.texture,l.samples.value=f,l.weights.value=m,l.latitudinal.value="latitudinal"===o,a&&(l.poleAxis.value=a),l.dTheta.value=p,l.mipInt.value=8-n,l.inputEncoding.value=Fu[t.texture.encoding],l.outputEncoding.value=Fu[t.texture.encoding];var b=Hu[r];Qu(e,y=3*Math.max(0,ju-2*b),(0===r?0:2*ju)+2*b*(r>4?r-8+4:0),3*b,2*b),s.setRenderTarget(e),s.render(u,Uu)}};function rl(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ls.call(this,t),this.type="catmullrom"}xs.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(xs.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(ks.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new We,n=0,r=t.length;n<r;n++){var i=t[n];e.vertices.push(new P(i.x,i.y,i.z||0))}return e}}),Object.assign(Fs.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Object.create(Ls.prototype),Object.create(Ls.prototype),rl.prototype=Object.create(Ls.prototype),Object.assign(rl.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),yu.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},pu.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(ls.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),rc(t)}}),ls.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(cc.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(nu.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(vt.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(xt.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),on.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},ou.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(g,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),g.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),g.ceilPowerOfTwo(t)}}),Object.assign(x.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(j.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new P).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,o)}}),Ot.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},T.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Lt.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Gt.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(Gt,{barycoordFromPoint:function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Gt.getBarycoord(t,e,n,r,i)},normal:function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Gt.getNormal(t,e,n,r)}}),Object.assign(Us.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new pa(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Sa(this,t)}}),Object.assign(y.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(P.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(_.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(We.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(et.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(et.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Be.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Be.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(ki.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Hi.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Fi.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(xs.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Qe.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Gs.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(ee.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(ee.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(be.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new ee(arguments[1],arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(be.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(ic.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(Qc.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(di.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(di.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(da.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Zc.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Qt.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new qt}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(ka.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Ze.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(li.prototype,{clearTarget:function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(li.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?3001:3e3}}}),Object.defineProperties(ei.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(S.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Rc.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new xc).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),zc.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},$e.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};b.crossOrigin=void 0,b.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new ys;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},b.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new gs;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},b.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},b.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"117"}}));var il,ol;n(29);function al(t){return/^[\da-f]{24}$/i.test(t)}function sl(){if(!il)try{(il=localStorage.getItem("mi-uuid"))||(il=p(),localStorage.setItem("mi-uuid",il))}catch(t){il="NLS-"+p()}return il}function cl(){if(!ol)try{(ol=sessionStorage.getItem("mi-session"))||(ol=p(),sessionStorage.setItem("mi-session",ol))}catch(t){ol="NSS-"+p()}return ol}},function(t,e,n){var r=n(74),i=n(46);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){t.exports=!1},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports={}},function(t,e,n){var r=n(18);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(34),i=n(23),o=n(9),a=n(32),s=n(13),c=n(56),u=Object.getOwnPropertyDescriptor;e.f=n(8)?u:function(t,e){if(t=o(t),e=a(e,!0),c)try{return u(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){"use strict";var r,i;function o(t,e,n){if(!(this instanceof o))return new o(t,e,n);void 0===n&&(n=o.datum.WGS84),this.lat=Number(t),this.lon=Number(e),this.datum=n}t.exports&&(r=n(54)),t.exports&&(i=n(36)),o.ellipsoid={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},o.datum={ED50:{ellipsoid:o.ellipsoid.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},Irl1975:{ellipsoid:o.ellipsoid.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,-1.042,-.214,-.631]},NAD27:{ellipsoid:o.ellipsoid.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:o.ellipsoid.GRS80,transform:[1.004,-1.91,-.515,-.0015,.0267,34e-5,.011]},NTF:{ellipsoid:o.ellipsoid.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:o.ellipsoid.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:o.ellipsoid.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:o.ellipsoid.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:o.ellipsoid.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:o.ellipsoid.WGS84,transform:[0,0,0,0,0,0,0]}},o.prototype.convertDatum=function(t){var e=this,n=null;if(e.datum==o.datum.WGS84&&(n=t.transform),t==o.datum.WGS84){n=[];for(var r=0;r<7;r++)n[r]=-e.datum.transform[r]}return null==n&&(e=this.convertDatum(o.datum.WGS84),n=t.transform),e.toCartesian().applyTransform(n).toLatLonE(t)},o.prototype.toCartesian=function(){var t=this.lat.toRadians(),e=this.lon.toRadians(),n=this.datum.ellipsoid.a,i=this.datum.ellipsoid.f,o=Math.sin(t),a=Math.cos(t),s=Math.sin(e),c=Math.cos(e),u=2*i-i*i,l=n/Math.sqrt(1-u*o*o);return new r((l+0)*a*c,(l+0)*a*s,(l*(1-u)+0)*o)},r.prototype.toLatLonE=function(t){var e=this.x,n=this.y,r=this.z,i=t.ellipsoid.a,a=t.ellipsoid.b,s=t.ellipsoid.f,c=2*s-s*s,u=c/(1-c),l=Math.sqrt(e*e+n*n),h=a*r/(i*l)*(1+u*a/Math.sqrt(l*l+r*r)),p=h/Math.sqrt(1+h*h),d=p/h,f=isNaN(d)?0:Math.atan2(r+u*a*p*p*p,l-c*i*d*d*d),m=Math.atan2(n,e),v=Math.sin(f);Math.cos(f),Math.sqrt(1-c*v*v);return new o(f.toDegrees(),m.toDegrees(),t)},r.prototype.applyTransform=function(t){var e=this.x,n=this.y,i=this.z,o=t[0],a=t[1],s=t[2],c=t[3]/1e6+1,u=(t[4]/3600).toRadians(),l=(t[5]/3600).toRadians(),h=(t[6]/3600).toRadians();return new r(o+e*c-n*h+i*l,a+e*h+n*c-i*u,s-e*l+n*u+i*c)},o.prototype.toString=function(t,e){return i.toLat(this.lat,t,e)+", "+i.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),t.exports&&(t.exports=o,t.exports.Vector3d=r)},function(t,e,n){"use strict";e.LatLonSpherical=n(140),e.LatLonEllipsoidal=n(28);var r=n(141);for(var i in r)e.LatLonEllipsoidal[i]=r[i];e.LatLonVectors=n(142),e.Vector3d=n(54),e.Utm=n(95),e.Mgrs=n(143),e.OsGridRef=n(144),e.Dms=n(36)},function(t,e,n){var r=n(10),i=n(0)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var r=n(15),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(21)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var r=n(6);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(7).f,i=n(13),o=n(0)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(74),i=n(46).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){"use strict";var r={parseDMS:function(t){if("number"==typeof t&&isFinite(t))return Number(t);var e,n=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==n[n.length-1]&&n.splice(n.length-1),""==n)return NaN;switch(n.length){case 3:e=n[0]/1+n[1]/60+n[2]/3600;break;case 2:e=n[0]/1+n[1]/60;break;case 1:e=n[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(e=-e),Number(e)},separator:"",toDMS:function(t,e,n){if(isNaN(t))return null;if(void 0===e&&(e="dms"),void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="dms",n=0}var i,o,a,s;switch(t=Math.abs(t),e){default:case"d":case"deg":(o=t.toFixed(n))<100&&(o="0"+o),o<10&&(o="0"+o),i=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),60==(a=(60*t%60).toFixed(n))&&(a=0,o++),a<10&&(a="0"+a),i=(o=("000"+o).slice(-3))+"°"+r.separator+a+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),a=Math.floor(3600*t/60)%60,60==(s=(3600*t%60).toFixed(n))&&(s=(0).toFixed(n),a++),60==a&&(a=0,o++),o=("000"+o).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),i=o+"°"+r.separator+a+"′"+r.separator+s+"″"}return i},toLat:function(t,e,n){var i=r.toDMS(t,e,n);return null===i?"–":i.slice(1)+r.separator+(t<0?"S":"N")},toLon:function(t,e,n){var i=r.toDMS(t,e,n);return null===i?"–":i+r.separator+(t<0?"W":"E")},toBrng:function(t,e,n){t=(Number(t)+360)%360;var i=r.toDMS(t,e,n);return null===i?"–":i.replace("360","0")},compassPoint:function(t,e){void 0===e&&(e=3),t=(t%360+360)%360;var n=4*Math.pow(2,e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}};t.exports&&(t.exports=r)},function(t,e){t.exports=require("url")},function(t,e,n){"use strict";var r=n(30),i={};i[n(0)("toStringTag")]="z",i+""!="[object z]"&&n(11)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(t,e,n){var r=n(6),i=n(2).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(2).document;t.exports=r&&r.documentElement},function(t,e,n){"use strict";var r,i,o=n(114),a=RegExp.prototype.exec,s=String.prototype.replace,c=a,u=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),l=void 0!==/()??/.exec("")[1];(u||l)&&(c=function(t){var e,n,r,i,c=this;return l&&(n=new RegExp("^"+c.source+"$(?!\\s)",o.call(c))),u&&(e=c.lastIndex),r=a.call(c,t),u&&r&&(c.lastIndex=c.global?r.index+r[0].length:e),l&&r&&r.length>1&&s.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),t.exports=c},function(t,e,n){var r=n(16),i=n(71),o=n(26),a=n(17),s=n(116);t.exports=function(t,e){var n=1==t,c=2==t,u=3==t,l=4==t,h=6==t,p=5==t||h,d=e||s;return function(e,s,f){for(var m,v,g=o(e),y=i(g),x=r(s,f,3),b=a(y.length),M=0,w=n?d(e,b):c?d(e,0):void 0;b>M;M++)if((p||M in y)&&(v=x(m=y[M],M,g),t))if(n)w[M]=v;else if(v)switch(t){case 3:return!0;case 5:return m;case 6:return M;case 2:w.push(m)}else if(l)return!1;return h?-1:u||l?l:w}}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,n){var r=n(31)("keys"),i=n(22);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){"use strict";var r=n(1),i=n(80);r(r.P+r.F*n(82)("includes"),"String",{includes:function(t){return!!~i(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(1),i=n(75)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(49)("includes")},function(t,e,n){var r=n(0)("unscopables"),i=Array.prototype;null==i[r]&&n(12)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e,n){"use strict";var r=n(2),i=n(13),o=n(8),a=n(1),s=n(11),c=n(123).KEY,u=n(4),l=n(31),h=n(33),p=n(22),d=n(0),f=n(84),m=n(124),v=n(125),g=n(72),y=n(3),x=n(6),b=n(9),M=n(32),w=n(23),_=n(52),S=n(127),E=n(27),T=n(7),L=n(20),A=E.f,P=T.f,R=S.f,O=r.Symbol,N=r.JSON,C=N&&N.stringify,I=d("_hidden"),D=d("toPrimitive"),z={}.propertyIsEnumerable,j=l("symbol-registry"),B=l("symbols"),k=l("op-symbols"),F=Object.prototype,U="function"==typeof O,G=r.QObject,H=!G||!G.prototype||!G.prototype.findChild,V=o&&u((function(){return 7!=_(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=A(F,e);r&&delete F[e],P(t,e,n),r&&t!==F&&P(F,e,r)}:P,W=function(t){var e=B[t]=_(O.prototype);return e._k=t,e},q=U&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},X=function(t,e,n){return t===F&&X(k,e,n),y(t),e=M(e,!0),y(n),i(B,e)?(n.enumerable?(i(t,I)&&t[I][e]&&(t[I][e]=!1),n=_(n,{enumerable:w(0,!1)})):(i(t,I)||P(t,I,w(1,{})),t[I][e]=!0),V(t,e,n)):P(t,e,n)},Y=function(t,e){y(t);for(var n,r=v(e=b(e)),i=0,o=r.length;o>i;)X(t,n=r[i++],e[n]);return t},J=function(t){var e=z.call(this,t=M(t,!0));return!(this===F&&i(B,t)&&!i(k,t))&&(!(e||!i(this,t)||!i(B,t)||i(this,I)&&this[I][t])||e)},Z=function(t,e){if(t=b(t),e=M(e,!0),t!==F||!i(B,e)||i(k,e)){var n=A(t,e);return!n||!i(B,e)||i(t,I)&&t[I][e]||(n.enumerable=!0),n}},K=function(t){for(var e,n=R(b(t)),r=[],o=0;n.length>o;)i(B,e=n[o++])||e==I||e==c||r.push(e);return r},Q=function(t){for(var e,n=t===F,r=R(n?k:b(t)),o=[],a=0;r.length>a;)!i(B,e=r[a++])||n&&!i(F,e)||o.push(B[e]);return o};U||(s((O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===F&&e.call(k,n),i(this,I)&&i(this[I],t)&&(this[I][t]=!1),V(this,t,w(1,n))};return o&&H&&V(F,t,{configurable:!0,set:e}),W(t)}).prototype,"toString",(function(){return this._k})),E.f=Z,T.f=X,n(35).f=S.f=K,n(34).f=J,n(51).f=Q,o&&!n(21)&&s(F,"propertyIsEnumerable",J,!0),f.f=function(t){return W(d(t))}),a(a.G+a.W+a.F*!U,{Symbol:O});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;$.length>tt;)d($[tt++]);for(var et=L(d.store),nt=0;et.length>nt;)m(et[nt++]);a(a.S+a.F*!U,"Symbol",{for:function(t){return i(j,t+="")?j[t]:j[t]=O(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var e in j)if(j[e]===t)return e},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!U,"Object",{create:function(t,e){return void 0===e?_(t):Y(_(t),e)},defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:Z,getOwnPropertyNames:K,getOwnPropertySymbols:Q}),N&&a(a.S+a.F*(!U||u((function(){var t=O();return"[null]"!=C([t])||"{}"!=C({a:t})||"{}"!=C(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(x(e)||void 0!==t)&&!q(t))return g(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!q(e))return e}),r[1]=e,C.apply(N,r)}}),O.prototype[D]||n(12)(O.prototype,D,O.prototype.valueOf),h(O,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(3),i=n(126),o=n(46),a=n(45)("IE_PROTO"),s=function(){},c=function(){var t,e=n(39)("iframe"),r=o.length;for(e.style.display="none",n(41).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[o[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=c(),void 0===e?n:i(n,e)}},function(t,e,n){"use strict";var r=n(49),i=n(131),o=n(25),a=n(9);t.exports=n(92)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);this.x=Number(t),this.y=Number(e),this.z=Number(n)}r.prototype.plus=function(t){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");return new r(this.x+t.x,this.y+t.y,this.z+t.z)},r.prototype.minus=function(t){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");return new r(this.x-t.x,this.y-t.y,this.z-t.z)},r.prototype.times=function(t){return t=Number(t),new r(this.x*t,this.y*t,this.z*t)},r.prototype.dividedBy=function(t){return t=Number(t),new r(this.x/t,this.y/t,this.z/t)},r.prototype.dot=function(t){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z},r.prototype.cross=function(t){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");return new r(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},r.prototype.negate=function(){return new r(-this.x,-this.y,-this.z)},r.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},r.prototype.unit=function(){var t=this.length();return 1==t||0==t?this:new r(this.x/t,this.y/t,this.z/t)},r.prototype.angleTo=function(t,e){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");if(!(e instanceof r||null==e))throw new TypeError("n is not Vector3d object");var n=null==e?1:Math.sign(this.cross(t).dot(e)),i=this.cross(t).length()*n,o=this.dot(t);return Math.atan2(i,o)},r.prototype.rotateAround=function(t,e){if(!(t instanceof r))throw new TypeError("axis is not Vector3d object");for(var n=this.unit(),i=[n.x,n.y,n.z],o=t.unit(),a=Math.sin(e),s=Math.cos(e),c=[[o.x*o.x*(1-s)+s,o.x*o.y*(1-s)-o.z*a,o.x*o.z*(1-s)+o.y*a],[o.y*o.x*(1-s)+o.z*a,o.y*o.y*(1-s)+s,o.y*o.z*(1-s)-o.x*a],[o.z*o.x*(1-s)-o.y*a,o.z*o.y*(1-s)+o.x*a,o.z*o.z*(1-s)+s]],u=[0,0,0],l=0;l<3;l++)for(var h=0;h<3;h++)u[l]+=c[l][h]*i[h];return new r(u[0],u[1],u[2])},r.prototype.toString=function(t){var e=void 0===t?3:Number(t);return"["+this.x.toFixed(e)+","+this.y.toFixed(e)+","+this.z.toFixed(e)+"]"},void 0===Math.sign&&(Math.sign=function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1}),t.exports&&(t.exports=r)},function(t,e){t.exports=require("http")},function(t,e,n){t.exports=!n(8)&&!n(4)((function(){return 7!=Object.defineProperty(n(39)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){"use strict";var r,i,o,a,s=n(21),c=n(2),u=n(16),l=n(30),h=n(1),p=n(6),d=n(24),f=n(103),m=n(104),v=n(61),g=n(62).set,y=n(106)(),x=n(63),b=n(107),M=n(108),w=n(109),_=c.TypeError,S=c.process,E=S&&S.versions,T=E&&E.v8||"",L=c.Promise,A="process"==l(S),P=function(){},R=i=x.f,O=!!function(){try{var t=L.resolve(1),e=(t.constructor={})[n(0)("species")]=function(t){t(P,P)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then(P)instanceof e&&0!==T.indexOf("6.6")&&-1===M.indexOf("Chrome/66")}catch(t){}}(),N=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},C=function(t,e){if(!t._n){t._n=!0;var n=t._c;y((function(){for(var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,s=i?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(i||(2==t._h&&z(t),t._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===e.promise?u(_("Promise-chain cycle")):(o=N(n))?o.call(n,c,u):c(n)):u(r)}catch(t){l&&!a&&l.exit(),u(t)}};n.length>o;)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&I(t)}))}},I=function(t){g.call(c,(function(){var e,n,r,i=t._v,o=D(t);if(o&&(e=b((function(){A?S.emit("unhandledRejection",i,t):(n=c.onunhandledrejection)?n({promise:t,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=A||D(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},D=function(t){return 1!==t._h&&0===(t._a||t._c).length},z=function(t){g.call(c,(function(){var e;A?S.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})}))},j=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),C(e,!0))},B=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw _("Promise can't be resolved itself");(e=N(t))?y((function(){var r={_w:n,_d:!1};try{e.call(t,u(B,r,1),u(j,r,1))}catch(t){j.call(r,t)}})):(n._v=t,n._s=1,C(n,!1))}catch(t){j.call({_w:n,_d:!1},t)}}};O||(L=function(t){f(this,L,"Promise","_h"),d(t),r.call(this);try{t(u(B,this,1),u(j,this,1))}catch(t){j.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(110)(L.prototype,{then:function(t,e){var n=R(v(this,L));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=A?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&C(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=u(B,t,1),this.reject=u(j,t,1)},x.f=R=function(t){return t===L||t===a?new o(t):i(t)}),h(h.G+h.W+h.F*!O,{Promise:L}),n(33)(L,"Promise"),n(111)("Promise"),a=n(15).Promise,h(h.S+h.F*!O,"Promise",{reject:function(t){var e=R(this);return(0,e.reject)(t),e.promise}}),h(h.S+h.F*(s||!O),"Promise",{resolve:function(t){return w(s&&this===a?L:this,t)}}),h(h.S+h.F*!(O&&n(64)((function(t){L.all(t).catch(P)}))),"Promise",{all:function(t){var e=this,n=R(e),r=n.resolve,i=n.reject,o=b((function(){var n=[],o=0,a=1;m(t,!1,(function(t){var s=o++,c=!1;n.push(void 0),a++,e.resolve(t).then((function(t){c||(c=!0,n[s]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=R(e),r=n.reject,i=b((function(){m(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},function(t,e,n){var r=n(3);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){var r=n(25),i=n(0)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){var r=n(30),i=n(0)("iterator"),o=n(25);t.exports=n(15).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(3),i=n(24),o=n(0)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},function(t,e,n){var r,i,o,a=n(16),s=n(105),c=n(41),u=n(39),l=n(2),h=l.process,p=l.setImmediate,d=l.clearImmediate,f=l.MessageChannel,m=l.Dispatch,v=0,g={},y=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},x=function(t){y.call(t.data)};p&&d||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return g[++v]=function(){s("function"==typeof t?t:Function(t),e)},r(v),v},d=function(t){delete g[t]},"process"==n(10)(h)?r=function(t){h.nextTick(a(y,t,1))}:m&&m.now?r=function(t){m.now(a(y,t,1))}:f?(o=(i=new f).port2,i.port1.onmessage=x,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",x,!1)):r="onreadystatechange"in u("script")?function(t){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),y.call(t)}}:function(t){setTimeout(a(y,t,1),0)}),t.exports={set:p,clear:d}},function(t,e,n){"use strict";var r=n(24);function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},function(t,e,n){var r=n(0)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},t(o)}catch(t){}return n}},function(t,e,n){"use strict";var r=n(3),i=n(112),o=n(66);n(67)("search",1,(function(t,e,n,a){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var s=r(t),c=String(this),u=s.lastIndex;i(u,0)||(s.lastIndex=0);var l=o(s,c);return i(s.lastIndex,u)||(s.lastIndex=u),null===l?-1:l.index}]}))},function(t,e,n){"use strict";var r=n(30),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var o=n.call(t,e);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},function(t,e,n){"use strict";n(113);var r=n(11),i=n(12),o=n(4),a=n(18),s=n(0),c=n(42),u=s("species"),l=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),h=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var p=s(t),d=!o((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),f=d?!o((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[u]=function(){return n}),n[p](""),!e})):void 0;if(!d||!f||"replace"===t&&!l||"split"===t&&!h){var m=/./[p],v=n(a,p,""[t],(function(t,e,n,r,i){return e.exec===c?d&&!i?{done:!0,value:m.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),g=v[0],y=v[1];r(String.prototype,t,g),i(RegExp.prototype,p,2==e?function(t,e){return y.call(t,this,e)}:function(t){return y.call(t,this)})}}},function(t,e,n){"use strict";var r=n(115);t.exports=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),r.call(this,t,e)},global.fetch||(global.fetch=t.exports,global.Response=r.Response,global.Headers=r.Headers,global.Request=r.Request)},function(t,e){!function(){"use strict";t.exports=function(t){return(t instanceof Buffer?t:Buffer.from(t.toString(),"binary")).toString("base64")}}()},function(t,e,n){"use strict";var r=n(1),i=n(43)(1);r(r.P+r.F*!n(44)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},function(t,e,n){var r=n(10);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(10);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(26),i=n(20);n(77)("keys",(function(){return function(t){return i(r(t))}}))},function(t,e,n){var r=n(13),i=n(9),o=n(75)(!1),a=n(45)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;e.length>c;)r(s,n=e[c++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var r=n(9),i=n(17),o=n(76);t.exports=function(t){return function(e,n,a){var s,c=r(e),u=i(c.length),l=o(a,u);if(t&&n!=n){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(40),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(1),i=n(15),o=n(4);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},function(t,e,n){var r=n(7).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||n(8)&&r(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,e,n){var r=n(1),i=n(118)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},function(t,e,n){var r=n(81),i=n(18);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e,n){var r=n(6),i=n(10),o=n(0)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){var r=n(0)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){var r=n(40),i=n(18);t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),c=r(n),u=s.length;return c<0||c>=u?t?"":void 0:(o=s.charCodeAt(c))<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):o:t?s.slice(c,c+2):a-56320+(o-55296<<10)+65536}}},function(t,e,n){e.f=n(0)},function(t,e,n){"use strict";var r=n(1),i=n(43)(2);r(r.P+r.F*!n(44)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},function(t,e,n){var r=n(9),i=n(27).f;n(77)("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},function(t,e,n){var r=n(1),i=n(128),o=n(9),a=n(27),s=n(88);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=o(t),c=a.f,u=i(r),l={},h=0;u.length>h;)void 0!==(n=c(r,e=u[h++]))&&s(l,e,n);return l}})},function(t,e,n){"use strict";var r=n(7),i=n(23);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){"use strict";var r=n(1),i=n(41),o=n(10),a=n(76),s=n(17),c=[].slice;r(r.P+r.F*n(4)((function(){i&&c.call(i)})),"Array",{slice:function(t,e){var n=s(this.length),r=o(this);if(e=void 0===e?n:e,"Array"==r)return c.call(this,t,e);for(var i=a(t,n),u=a(e,n),l=s(u-i),h=new Array(l),p=0;p<l;p++)h[p]="String"==r?this.charAt(i+p):this[i+p];return h}})},function(t,e,n){"use strict";var r=n(16),i=n(1),o=n(26),a=n(58),s=n(59),c=n(17),u=n(88),l=n(60);i(i.S+i.F*!n(64)((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,i,h,p=o(t),d="function"==typeof this?this:Array,f=arguments.length,m=f>1?arguments[1]:void 0,v=void 0!==m,g=0,y=l(p);if(v&&(m=r(m,f>2?arguments[2]:void 0,2)),null==y||d==Array&&s(y))for(n=new d(e=c(p.length));e>g;g++)u(n,g,v?m(p[g],g):p[g]);else for(h=y.call(p),n=new d;!(i=h.next()).done;g++)u(n,g,v?a(h,m,[i.value,g],!0):i.value);return n.length=g,n}})},function(t,e,n){"use strict";var r=n(83)(!0);n(92)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},function(t,e,n){"use strict";var r=n(21),i=n(1),o=n(11),a=n(12),s=n(25),c=n(129),u=n(33),l=n(130),h=n(0)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,f,m,v,g){c(n,e,f);var y,x,b,M=function(t){if(!p&&t in E)return E[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",_="values"==m,S=!1,E=t.prototype,T=E[h]||E["@@iterator"]||m&&E[m],L=T||M(m),A=m?_?M("entries"):L:void 0,P="Array"==e&&E.entries||T;if(P&&(b=l(P.call(new t)))!==Object.prototype&&b.next&&(u(b,w,!0),r||"function"==typeof b[h]||a(b,h,d)),_&&T&&"values"!==T.name&&(S=!0,L=function(){return T.call(this)}),r&&!g||!p&&!S&&E[h]||a(E,h,L),s[e]=L,s[w]=d,m)if(y={values:_?L:M("values"),keys:v?L:M("keys"),entries:A},g)for(x in y)x in E||o(E,x,y[x]);else i(i.P+i.F*(p||S),e,y);return y}},function(t,e,n){for(var r=n(53),i=n(20),o=n(11),a=n(2),s=n(12),c=n(25),u=n(0),l=u("iterator"),h=u("toStringTag"),p=c.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},f=i(d),m=0;m<f.length;m++){var v,g=f[m],y=d[g],x=a[g],b=x&&x.prototype;if(b&&(b[l]||s(b,l,p),b[h]||s(b,h,g),c[g]=p,y))for(v in r)b[v]||o(b,v,r[v],!0)}},function(t,e,n){"use strict";var r=n(1),i=n(43)(5),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(49)("find")},function(t,e,n){"use strict";var r;function i(t,e,n,o,a,s,c){if(!(this instanceof i))return new i(t,e,n,o,a,s,c);if(void 0===a&&(a=r.datum.WGS84),void 0===s&&(s=null),void 0===c&&(c=null),!(1<=t&&t<=60))throw new Error("Invalid UTM zone "+t);if(!e.match(/[NS]/i))throw new Error("Invalid UTM hemisphere "+e);this.zone=Number(t),this.hemisphere=e.toUpperCase(),this.easting=Number(n),this.northing=Number(o),this.datum=a,this.convergence=null===s?null:Number(s),this.scale=null===c?null:Number(c)}t.exports&&(r=n(28)),r.prototype.toUtm=function(){if(isNaN(this.lat)||isNaN(this.lon))throw new Error("Invalid point");if(!(-80<=this.lat&&this.lat<=84))throw new Error("Outside UTM limits");var t=Math.floor((this.lon+180)/6)+1,e=(6*(t-1)-180+3).toRadians(),n="CDEFGHJKLMNPQRSTUVWXX".charAt(Math.floor(this.lat/8+10));31==t&&"V"==n&&this.lon>=3&&(t++,e+=6..toRadians()),32==t&&"X"==n&&this.lon<9&&(t--,e-=6..toRadians()),32==t&&"X"==n&&this.lon>=9&&(t++,e+=6..toRadians()),34==t&&"X"==n&&this.lon<21&&(t--,e-=6..toRadians()),34==t&&"X"==n&&this.lon>=21&&(t++,e+=6..toRadians()),36==t&&"X"==n&&this.lon<33&&(t--,e-=6..toRadians()),36==t&&"X"==n&&this.lon>=33&&(t++,e+=6..toRadians());for(var r=this.lat.toRadians(),o=this.lon.toRadians()-e,a=this.datum.ellipsoid.a,s=this.datum.ellipsoid.f,c=.9996,u=Math.sqrt(s*(2-s)),l=s/(2-s),h=l*l,p=l*h,d=l*p,f=l*d,m=l*f,v=Math.cos(o),g=Math.sin(o),y=Math.tan(o),x=Math.tan(r),b=Math.sinh(u*Math.atanh(u*x/Math.sqrt(1+x*x))),M=x*Math.sqrt(1+b*b)-b*Math.sqrt(1+x*x),w=Math.atan2(M,v),_=Math.asinh(g/Math.sqrt(M*M+v*v)),S=a/(1+l)*(1+1/4*h+1/64*d+1/256*m),E=[null,.5*l-2/3*h+5/16*p+41/180*d-127/288*f+7891/37800*m,13/48*h-.6*p+557/1440*d+281/630*f-1983433/1935360*m,61/240*p-103/140*d+15061/26880*f+167603/181440*m,49561/161280*d-179/168*f+6601661/7257600*m,34729/80640*f-3418889/1995840*m,.6650675310896665*m],T=w,L=1;L<=6;L++)T+=E[L]*Math.sin(2*L*w)*Math.cosh(2*L*_);var A=_;for(L=1;L<=6;L++)A+=E[L]*Math.cos(2*L*w)*Math.sinh(2*L*_);var P=c*S*A,R=c*S*T,O=1;for(L=1;L<=6;L++)O+=2*L*E[L]*Math.cos(2*L*w)*Math.cosh(2*L*_);var N=0;for(L=1;L<=6;L++)N+=2*L*E[L]*Math.sin(2*L*w)*Math.sinh(2*L*_);var C=Math.atan(M/Math.sqrt(1+M*M)*y)+Math.atan2(N,O),I=Math.sin(r),D=c*(Math.sqrt(1-u*u*I*I)*Math.sqrt(1+x*x)/Math.sqrt(M*M+v*v))*(S/a*Math.sqrt(O*O+N*N));P+=5e5,R<0&&(R+=1e7),P=Number(P.toFixed(6)),R=Number(R.toFixed(6));var z=Number(C.toDegrees().toFixed(9)),j=Number(D.toFixed(12));return new i(t,this.lat>=0?"N":"S",P,R,this.datum,z,j)},i.prototype.toLatLonE=function(){var t=this.zone,e=this.hemisphere,n=this.easting,i=this.northing;if(isNaN(t)||isNaN(n)||isNaN(i))throw new Error("Invalid coordinate");var o=this.datum.ellipsoid.a,a=this.datum.ellipsoid.f,s=.9996;n-=5e5,i="S"==e?i-1e7:i;for(var c=Math.sqrt(a*(2-a)),u=a/(2-a),l=u*u,h=u*l,p=u*h,d=u*p,f=u*d,m=o/(1+u)*(1+1/4*l+1/64*p+1/256*f),v=n/(s*m),g=i/(s*m),y=[null,.5*u-2/3*l+37/96*h-1/360*p-81/512*d+96199/604800*f,1/48*l+1/15*h-437/1440*p+46/105*d-1118711/3870720*f,17/480*h-37/840*p-209/4480*d+5569/90720*f,4397/161280*p-11/504*d-830251/7257600*f,4583/161280*d-108847/3991680*f,20648693/638668800*f],x=g,b=1;b<=6;b++)x-=y[b]*Math.sin(2*b*g)*Math.cosh(2*b*v);var M=v;for(b=1;b<=6;b++)M-=y[b]*Math.cos(2*b*g)*Math.sinh(2*b*v);var w=Math.sinh(M),_=Math.sin(x),S=Math.cos(x),E=_/Math.sqrt(w*w+S*S),T=E;do{var L=Math.sinh(c*Math.atanh(c*T/Math.sqrt(1+T*T))),A=T*Math.sqrt(1+L*L)-L*Math.sqrt(1+T*T),P=(E-A)/Math.sqrt(1+A*A)*(1+(1-c*c)*T*T)/((1-c*c)*Math.sqrt(1+T*T));T+=P}while(Math.abs(P)>1e-12);var R=T,O=Math.atan(R),N=Math.atan2(w,S),C=1;for(b=1;b<=6;b++)C-=2*b*y[b]*Math.cos(2*b*g)*Math.cosh(2*b*v);var I=0;for(b=1;b<=6;b++)I+=2*b*y[b]*Math.sin(2*b*g)*Math.sinh(2*b*v);var D=Math.atan(Math.tan(x)*Math.tanh(M))+Math.atan2(I,C),z=Math.sin(O),j=s*(Math.sqrt(1-c*c*z*z)*Math.sqrt(1+R*R)*Math.sqrt(w*w+S*S))*(m/o/Math.sqrt(C*C+I*I));N+=(6*(t-1)-180+3).toRadians();var B=Number(O.toDegrees().toFixed(11)),k=Number(N.toDegrees().toFixed(11)),F=Number(D.toDegrees().toFixed(9)),U=Number(j.toFixed(12)),G=new r(B,k,this.datum);return G.convergence=F,G.scale=U,G},i.parse=function(t,e){if(void 0===e&&(e=r.datum.WGS84),null==(t=t.trim().match(/\S+/g))||4!=t.length)throw new Error("Invalid UTM coordinate ‘"+t+"’");return new i(t[0],t[1],t[2],t[3],e)},i.prototype.toString=function(t){t=Number(t||0);var e=this.zone<10?"0"+this.zone:this.zone,n=this.hemisphere,r=this.easting,i=this.northing;return isNaN(e)||!n.match(/[NS]/)||isNaN(r)||isNaN(i)?"":e+" "+n+" "+r.toFixed(t)+" "+i.toFixed(t)},void 0===Math.sinh&&(Math.sinh=function(t){return(Math.exp(t)-Math.exp(-t))/2}),void 0===Math.cosh&&(Math.cosh=function(t){return(Math.exp(t)+Math.exp(-t))/2}),void 0===Math.tanh&&(Math.tanh=function(t){return(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))}),void 0===Math.asinh&&(Math.asinh=function(t){return Math.log(t+Math.sqrt(1+t*t))}),void 0===Math.atanh&&(Math.atanh=function(t){return Math.log((1+t)/(1-t))/2}),t.exports&&(t.exports=i)},function(t,e){t.exports=require("https")},function(t,e,n){"use strict";(function(t){n(70),n(73),n(78),n(79),n(65),n(47),n(48),n(119),n(121),n(122),n(38),n(57),n(50),n(85),n(86),n(87),n(89),n(90),n(91),n(53),n(93);var r=n(19);function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}e.a=function(e){e=e||{},this.ASSET_TYPES={LOCATION:"location",EVENT:"event",CATEGORY:"category"};var n=this;n.useSmartSearch=e.smart;var o=e.endpoint||e.baseUrl||(n.useSmartSearch?"https://api-gateway.mappedin.com/search/":"https://search.mappedin.com/"),a=e.venue,c=e.key,u=e.secret,l=e.locations||[],h=e.categories||[],p=n.useSmartSearch?"/search":"/suggest",d={Authorization:"Basic "+t(c+":"+u),"mi-context":"web","mi-session":Object(r.b)(),"mi-device":Object(r.a)()},f=function(t){return Object.keys(t).map((function(e){return e+"="+encodeURIComponent(t[e])})).join("&")},m=function(t){this.assetType=t.assetType,this.score=t.score||t.strength,this.name=t.name,this.id=t.id,this.description=t.description,n.useSmartSearch&&(this.strength=t.strength,t.ids&&(this.id=t.ids[0]))},v=function(t){m.call(this,t),this.categories=t.categories,this.logo=t.logo,this.assetType=n.ASSET_TYPES.LOCATION},g=function(t){m.call(this,t),this.assetType=n.ASSET_TYPES.CATEGORY},y=function(t){m.call(this,t),this.location=t.location,this.startData=t.startDate,this.endData=t.endDate,this.showDate=t.showDate},x=function(t,e,r){if(this.query=t,this.total=e.total,this.page=r.pn||1,n.useSmartSearch){var i=e.categories,o=e.locations,a={locations:[],categories:[]},c={};o.map((function(t){t.ids.forEach((function(e){c[e]||(c[e]=new v(s(s({},t),{},{ids:[e]})))}))})),a.locations=Object.values(c),a.categories=i.map((function(t){return new g(t)})),this.hits=a}else this.hits=e.hits.map((function(t){switch(t.assetType){case n.ASSET_TYPES.LOCATION:return new v(t);case n.ASSET_TYPES.EVENT:return new y(t)}}));this.getNextPage=function(){return r.pn+=1,n.search(t,r)},this.hasNextPage=function(){return r.pn*r.ps<e.total}},b=function(t,e){this.query=t,this.total=e.total,this.hits=e.hits.map((function(t){return t.text}))},M=function(t,e){var n=function(t,e){var n=t.toLowerCase(),r=[],o=[];if(l.forEach((function(t){var e=t.name.toLowerCase();if(n.includes(" ")&&e.includes(n))r.push(new v(t));else{var o,a=i(e.split(/\s+/));try{for(a.s();!(o=a.n()).done;){if(o.value.startsWith(n)){r.push(new v(t));break}}}catch(t){a.e(t)}finally{a.f()}}})),e.expandCategories){var a=r.map((function(t){return t.id}));h.forEach((function(t){var e=t.name.toLowerCase(),i=t.id;e===n&&l.forEach((function(t){t.categories.includes(i)&&!a.includes(t.id)&&r.push(new v(t))}))}))}else h.forEach((function(t){var e=t.name.toLowerCase();if(n.includes(" ")&&e.includes(n))o.push(new g(t));else{var r,a=i(e.split(/\s+/));try{for(a.s();!(r=a.n()).done;){if(r.value.startsWith(n)){o.push(new g(t));break}}}catch(t){a.e(t)}finally{a.f()}}}));var s=r.concat(o);return s.sort((function(t,e){var n=t.name,r=e.name;return n.localeCompare(r)})),s}(t,e);this.query=t,this.total=n.length,this.hits=n,this.fallbackSearch=!0,this.page=e.pn||1,this.getNextPage=function(){},this.hasNextPage=!1};this.search=function(t,e){(e=e||{}).q=t,n.useSmartSearch?(e.ln=null==e.ln?20:e.ln,e.cn=null==e.cn?5:e.cn,e.lang=null==e.lang?"en":e.lang):(e.ps=null==e.ps?10:e.ps,e.pn=null==e.pn?1:e.pn);var r=!1;e.expandCategories&&(r=e.expandCategories,delete e.expandCategories);var i=o+a+"/search?"+f(e),c={method:"GET",mode:"cors",headers:d};return new Promise((function(n,r){0!=t.length?fetch(i,c).then((function(i){200!=i.status?r({message:i.status+" "+i.statusText,response:i}):i.json().then((function(r){n(new x(t,r,e))}),r)}),r):r({message:"Empty Search",response:{}})})).catch((function(n){var i=l.length||h.length,o=n&&n.message&&"Empty Search"===n.message;if(!i||o)throw n;return new M(t,s({expandCategories:r},e))}))},this.suggest=function(t){if(n.useSmartSearch){console.warn("Smart Search doesn't support the Suggest API; please use the Search API.");return new b(t,{total:0,hits:[]})}(e={}).q=t.toLowerCase();var r=o+a+p+"?"+f(e),i={method:"GET",mode:"cors",headers:d};return new Promise((function(e,n){0!=t.length?fetch(r,i).then((function(r){200!=r.status?n({message:r.status+" "+r.statusText,response:r}):r.json().then((function(n){e(new b(t,n))}),n)}),n):n({message:"Empty query",response:{}})})).catch((function(e){return new M(t,{expandCategories:!1})}))}}}).call(this,n(69))},function(t,e){t.exports=require("crypto")},function(t,e,n){"use strict";(function(t){n(94),n(47),n(48),n(79),n(73),n(50),n(85),n(86),n(87);var r=n(19),i=n(100),o=n.n(i);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u=["websdk","web","webv2"],l=function e(n){var i=(n=n||{}).key,a=n.secret,c=n.noAuth,l="https://api-gateway.mappedin.com/track-analytics/a/";c||!i||Object(r.c)(i)||(l="https://web-proxy.mappedin.com/a/");var h=n.url||n.baseUrl||l;h+=n.venue+"/";var p=!1,d=n.testMode,f=u.find((function(t){return t===n.context}))||u[0],m=Object(r.a)(),v=Object(r.b)(),g=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!0!==d&&"True"!==d&&"true"!==d){var r=s(s({},n),{},{g:p}),u=h+e+"?"+o.a.stringify(r),l={method:"GET",mode:"cors",headers:{"mi-context":f,"mi-session":v,"mi-device":m}};c||(l.headers.Authorization="Basic "+t(i+":"+a)),fetch(u,l)}};this.locationSelected=function(t){var e=t.id||t;g("select-location",{id:e})},this.categorySelected=function(t){var e=t.id||t;g("select-category",{id:e})},this.mapViewLoaded=function(t,e,n,r){g("load-mapview",{type:t,force:e,benchmark:n||-1,reason:r||"success"}),delete this.mapViewLoaded},this.getDirections=function(t,e){g("query-directions",{start:t,end:e,type:"location_to_location"})},this.getSessionID=function(){return v},this.getDeviceID=function(){return m},this.setGeolocationMode=function(t){p=t},this.trackBlueDotEvent=function(t){t&&Object.values(e.BLUEDOT_EVENT).includes(t)?g(t):console.warn('Ignored unsupported blue dot event: "'.concat(t,'".'))}};l.BLUEDOT_EVENT={ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"},e.a=l}).call(this,n(69))},function(t,e,n){"use strict";var r=n(145),i=n(146),o=n(147);function a(t,e){return e.encode?e.strict?r(t):encodeURIComponent(t):t}function s(t){var e=t.indexOf("?");return-1===e?"":t.slice(e+1)}function c(t,e){var n=function(t){var e;switch(t.arrayFormat){case"index":return function(t,n,r){e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return function(t,n,r){e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};default:return function(t,e,n){void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e=i({arrayFormat:"none"},e)),r=Object.create(null);return"string"!=typeof t?r:(t=t.trim().replace(/^[?#&]/,""))?(t.split("&").forEach((function(t){var e=t.replace(/\+/g," ").split("="),i=e.shift(),a=e.length>0?e.join("="):void 0;a=void 0===a?null:o(a),n(o(i),a,r)})),Object.keys(r).sort().reduce((function(t,e){var n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((function(t,e){return Number(t)-Number(e)})).map((function(t){return e[t]})):e}(n):t[e]=n,t}),Object.create(null))):r}e.extract=s,e.parse=c,e.stringify=function(t,e){!1===(e=i({encode:!0,strict:!0,arrayFormat:"none"},e)).sort&&(e.sort=function(){});var n=function(t){switch(t.arrayFormat){case"index":return function(e,n,r){return null===n?[a(e,t),"[",r,"]"].join(""):[a(e,t),"[",a(r,t),"]=",a(n,t)].join("")};case"bracket":return function(e,n){return null===n?a(e,t):[a(e,t),"[]=",a(n,t)].join("")};default:return function(e,n){return null===n?a(e,t):[a(e,t),"=",a(n,t)].join("")}}}(e);return t?Object.keys(t).sort(e.sort).map((function(r){var i=t[r];if(void 0===i)return"";if(null===i)return a(r,e);if(Array.isArray(i)){var o=[];return i.slice().forEach((function(t){void 0!==t&&o.push(n(r,t,o.length))})),o.join("&")}return a(r,e)+"="+a(i,e)})).filter((function(t){return t.length>0})).join("&"):""},e.parseUrl=function(t,e){return{url:t.split("?")[0]||"",query:c(s(t),e)}}},function(t,e,n){t.exports=n(148)},function(t,e,n){t.exports=n(31)("native-function-to-string",Function.toString)},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(16),i=n(58),o=n(59),a=n(3),s=n(17),c=n(60),u={},l={};(e=t.exports=function(t,e,n,h,p){var d,f,m,v,g=p?function(){return t}:c(t),y=r(n,h,e?2:1),x=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(d=s(t.length);d>x;x++)if((v=e?y(a(f=t[x])[0],f[1]):y(t[x]))===u||v===l)return v}else for(m=g.call(t);!(f=m.next()).done;)if((v=i(m,y,f.value,e))===u||v===l)return v}).BREAK=u,e.RETURN=l},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(2),i=n(62).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n(10)(a);t.exports=function(){var t,e,n,u=function(){var r,i;for(c&&(r=a.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(u)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(u)}}else n=function(){i.call(r,u)};else{var h=!0,p=document.createTextNode("");new o(u).observe(p,{characterData:!0}),n=function(){p.data=h=!h}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(2).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){var r=n(3),i=n(6),o=n(63);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){var r=n(11);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){"use strict";var r=n(2),i=n(7),o=n(8),a=n(0)("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){"use strict";var r=n(42);n(1)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(t,e,n){"use strict";var r=n(3);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";n.r(e),n.d(e,"Headers",(function(){return P})),n.d(e,"Request",(function(){return H})),n.d(e,"Response",(function(){return j})),n.d(e,"FetchError",(function(){return p}));var r=n(5),i=n(55),o=n(37),a=n(96),s=n(14);const c=r.Readable,u=Symbol("buffer"),l=Symbol("type");class h{constructor(){this[l]="";const t=arguments[0],e=arguments[1],n=[];let r=0;if(t){const e=t,i=Number(e.length);for(let t=0;t<i;t++){const i=e[t];let o;o=i instanceof Buffer?i:ArrayBuffer.isView(i)?Buffer.from(i.buffer,i.byteOffset,i.byteLength):i instanceof ArrayBuffer?Buffer.from(i):i instanceof h?i[u]:Buffer.from("string"==typeof i?i:String(i)),r+=o.length,n.push(o)}}this[u]=Buffer.concat(n);let i=e&&void 0!==e.type&&String(e.type).toLowerCase();i&&!/[^\u0020-\u007E]/.test(i)&&(this[l]=i)}get size(){return this[u].length}get type(){return this[l]}text(){return Promise.resolve(this[u].toString())}arrayBuffer(){const t=this[u],e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return Promise.resolve(e)}stream(){const t=new c;return t._read=function(){},t.push(this[u]),t.push(null),t}toString(){return"[object Blob]"}slice(){const t=this.size,e=arguments[0],n=arguments[1];let r,i;r=void 0===e?0:e<0?Math.max(t+e,0):Math.min(e,t),i=void 0===n?t:n<0?Math.max(t+n,0):Math.min(n,t);const o=Math.max(i-r,0),a=this[u].slice(r,r+o),s=new h([],{type:arguments[2]});return s[u]=a,s}}function p(t,e,n){Error.call(this,t),this.message=t,this.type=e,n&&(this.code=this.errno=n.code),Error.captureStackTrace(this,this.constructor)}let d;Object.defineProperties(h.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(h.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.name="FetchError";try{d=require("encoding").convert}catch(t){}const f=Symbol("Body internals"),m=r.PassThrough;function v(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.size;let o=void 0===i?0:i;var a=n.timeout;let s=void 0===a?0:a;null==t?t=null:y(t)?t=Buffer.from(t.toString()):x(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof r||(t=Buffer.from(String(t)))),this[f]={body:t,disturbed:!1,error:null},this.size=o,this.timeout=s,t instanceof r&&t.on("error",(function(t){const n="AbortError"===t.name?t:new p(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t);e[f].error=n}))}function g(){var t=this;if(this[f].disturbed)return v.Promise.reject(new TypeError("body used already for: "+this.url));if(this[f].disturbed=!0,this[f].error)return v.Promise.reject(this[f].error);let e=this.body;if(null===e)return v.Promise.resolve(Buffer.alloc(0));if(x(e)&&(e=e.stream()),Buffer.isBuffer(e))return v.Promise.resolve(e);if(!(e instanceof r))return v.Promise.resolve(Buffer.alloc(0));let n=[],i=0,o=!1;return new v.Promise((function(r,a){let s;t.timeout&&(s=setTimeout((function(){o=!0,a(new p(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),e.on("error",(function(e){"AbortError"===e.name?(o=!0,a(e)):a(new p(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),e.on("data",(function(e){if(!o&&null!==e){if(t.size&&i+e.length>t.size)return o=!0,void a(new p(`content size at ${t.url} over limit: ${t.size}`,"max-size"));i+=e.length,n.push(e)}})),e.on("end",(function(){if(!o){clearTimeout(s);try{r(Buffer.concat(n,i))}catch(e){a(new p(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function y(t){return"object"==typeof t&&"function"==typeof t.append&&"function"==typeof t.delete&&"function"==typeof t.get&&"function"==typeof t.getAll&&"function"==typeof t.has&&"function"==typeof t.set&&("URLSearchParams"===t.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(t)||"function"==typeof t.sort)}function x(t){return"object"==typeof t&&"function"==typeof t.arrayBuffer&&"string"==typeof t.type&&"function"==typeof t.stream&&"function"==typeof t.constructor&&"string"==typeof t.constructor.name&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function b(t){let e,n,i=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof r&&"function"!=typeof i.getBoundary&&(e=new m,n=new m,i.pipe(e),i.pipe(n),t[f].body=e,i=n),i}function M(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":y(t)?"application/x-www-form-urlencoded;charset=UTF-8":x(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?"multipart/form-data;boundary="+t.getBoundary():t instanceof r?null:"text/plain;charset=UTF-8"}function w(t){const e=t.body;return null===e?0:x(e)?e.size:Buffer.isBuffer(e)?e.length:e&&"function"==typeof e.getLengthSync&&(e._lengthRetrievers&&0==e._lengthRetrievers.length||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}v.prototype={get body(){return this[f].body},get bodyUsed(){return this[f].disturbed},arrayBuffer(){return g.call(this).then((function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}))},blob(){let t=this.headers&&this.headers.get("content-type")||"";return g.call(this).then((function(e){return Object.assign(new h([],{type:t.toLowerCase()}),{[u]:e})}))},json(){var t=this;return g.call(this).then((function(e){try{return JSON.parse(e.toString())}catch(e){return v.Promise.reject(new p(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}}))},text(){return g.call(this).then((function(t){return t.toString()}))},buffer(){return g.call(this)},textConverted(){var t=this;return g.call(this).then((function(e){return function(t,e){if("function"!=typeof d)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=e.get("content-type");let r,i,o="utf-8";n&&(r=/charset=([^;]*)/i.exec(n));i=t.slice(0,1024).toString(),!r&&i&&(r=/<meta.+?charset=(['"])(.+?)\1/i.exec(i));!r&&i&&(r=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(i),r||(r=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(i),r&&r.pop()),r&&(r=/charset=(.*)/i.exec(r.pop())));!r&&i&&(r=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(i));r&&(o=r.pop(),"gb2312"!==o&&"gbk"!==o||(o="gb18030"));return d(t,"UTF-8",o).toString()}(e,t.headers)}))}},Object.defineProperties(v.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),v.mixIn=function(t){for(const e of Object.getOwnPropertyNames(v.prototype))if(!(e in t)){const n=Object.getOwnPropertyDescriptor(v.prototype,e);Object.defineProperty(t,e,n)}},v.Promise=global.Promise;const _=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,S=/[^\t\x20-\x7e\x80-\xff]/;function E(t){if(t=""+t,_.test(t)||""===t)throw new TypeError(t+" is not a legal HTTP header name")}function T(t){if(t=""+t,S.test(t))throw new TypeError(t+" is not a legal HTTP header value")}function L(t,e){e=e.toLowerCase();for(const n in t)if(n.toLowerCase()===e)return n}const A=Symbol("map");class P{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[A]=Object.create(null),t instanceof P){const e=t.raw(),n=Object.keys(e);for(const t of n)for(const n of e[t])this.append(t,n)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const n=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(e))}for(const t of n){if(2!==t.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(t[0],t[1])}}else for(const e of Object.keys(t)){const n=t[e];this.append(e,n)}}}}get(t){E(t=""+t);const e=L(this[A],t);return void 0===e?null:this[A][e].join(", ")}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=R(this),r=0;for(;r<n.length;){var i=n[r];const o=i[0],a=i[1];t.call(e,a,o,this),n=R(this),r++}}set(t,e){e=""+e,E(t=""+t),T(e);const n=L(this[A],t);this[A][void 0!==n?n:t]=[e]}append(t,e){e=""+e,E(t=""+t),T(e);const n=L(this[A],t);void 0!==n?this[A][n].push(e):this[A][t]=[e]}has(t){return E(t=""+t),void 0!==L(this[A],t)}delete(t){E(t=""+t);const e=L(this[A],t);void 0!==e&&delete this[A][e]}raw(){return this[A]}keys(){return N(this,"key")}values(){return N(this,"value")}[Symbol.iterator](){return N(this,"key+value")}}function R(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";const n=Object.keys(t[A]).sort();return n.map("key"===e?function(t){return t.toLowerCase()}:"value"===e?function(e){return t[A][e].join(", ")}:function(e){return[e.toLowerCase(),t[A][e].join(", ")]})}P.prototype.entries=P.prototype[Symbol.iterator],Object.defineProperty(P.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(P.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const O=Symbol("internal");function N(t,e){const n=Object.create(C);return n[O]={target:t,kind:e,index:0},n}const C=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==C)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[O];const e=t.target,n=t.kind,r=t.index,i=R(e,n);return r>=i.length?{value:void 0,done:!0}:(this[O].index=r+1,{value:i[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function I(t){const e=Object.assign({__proto__:null},t[A]),n=L(t[A],"Host");return void 0!==n&&(e[n]=e[n][0]),e}Object.defineProperty(C,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const D=Symbol("Response internals"),z=i.STATUS_CODES;class j{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};v.call(this,t,e);const n=e.status||200,r=new P(e.headers);if(null!=t&&!r.has("Content-Type")){const e=M(t);e&&r.append("Content-Type",e)}this[D]={url:e.url,status:n,statusText:e.statusText||z[n],headers:r,counter:e.counter}}get url(){return this[D].url||""}get status(){return this[D].status}get ok(){return this[D].status>=200&&this[D].status<300}get redirected(){return this[D].counter>0}get statusText(){return this[D].statusText}get headers(){return this[D].headers}clone(){return new j(b(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}v.mixIn(j.prototype),Object.defineProperties(j.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(j.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const B=Symbol("Request internals"),k=o.parse,F=o.format,U="destroy"in r.Readable.prototype;function G(t){return"object"==typeof t&&"object"==typeof t[B]}class H{constructor(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};G(t)?e=k(t.url):(e=t&&t.href?k(t.href):k(""+t),t={});let r=n.method||t.method||"GET";if(r=r.toUpperCase(),(null!=n.body||G(t)&&null!==t.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=n.body?n.body:G(t)&&null!==t.body?b(t):null;v.call(this,i,{timeout:n.timeout||t.timeout||0,size:n.size||t.size||0});const o=new P(n.headers||t.headers||{});if(null!=i&&!o.has("Content-Type")){const t=M(i);t&&o.append("Content-Type",t)}let a=G(t)?t.signal:null;if("signal"in n&&(a=n.signal),null!=a&&!function(t){const e=t&&"object"==typeof t&&Object.getPrototypeOf(t);return!(!e||"AbortSignal"!==e.constructor.name)}(a))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[B]={method:r,redirect:n.redirect||t.redirect||"follow",headers:o,parsedURL:e,signal:a},this.follow=void 0!==n.follow?n.follow:void 0!==t.follow?t.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===t.compress||t.compress,this.counter=n.counter||t.counter||0,this.agent=n.agent||t.agent}get method(){return this[B].method}get url(){return F(this[B].parsedURL)}get headers(){return this[B].headers}get redirect(){return this[B].redirect}get signal(){return this[B].signal}clone(){return new H(this)}}function V(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}v.mixIn(H.prototype),Object.defineProperty(H.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(H.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),V.prototype=Object.create(Error.prototype),V.prototype.constructor=V,V.prototype.name="AbortError";const W=r.PassThrough,q=o.resolve;function X(t,e){if(!X.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return v.Promise=X.Promise,new X.Promise((function(n,o){const c=new H(t,e),u=function(t){const e=t[B].parsedURL,n=new P(t[B].headers);if(n.has("Accept")||n.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof r.Readable&&!U)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let i=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(i="0"),null!=t.body){const e=w(t);"number"==typeof e&&(i=String(e))}i&&n.set("Content-Length",i),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate");let o=t.agent;return"function"==typeof o&&(o=o(e)),n.has("Connection")||o||n.set("Connection","close"),Object.assign({},e,{method:t.method,headers:I(n),agent:o})}(c),l=("https:"===u.protocol?a:i).request,h=c.signal;let d=null;const f=function(){let t=new V("The user aborted a request.");o(t),c.body&&c.body instanceof r.Readable&&c.body.destroy(t),d&&d.body&&d.body.emit("error",t)};if(h&&h.aborted)return void f();const m=function(){f(),y()},v=l(u);let g;function y(){v.abort(),h&&h.removeEventListener("abort",m),clearTimeout(g)}h&&h.addEventListener("abort",m),c.timeout&&v.once("socket",(function(t){g=setTimeout((function(){o(new p("network timeout at: "+c.url,"request-timeout")),y()}),c.timeout)})),v.on("error",(function(t){o(new p(`request to ${c.url} failed, reason: ${t.message}`,"system",t)),y()})),v.on("response",(function(t){clearTimeout(g);const e=function(t){const e=new P;for(const n of Object.keys(t))if(!_.test(n))if(Array.isArray(t[n]))for(const r of t[n])S.test(r)||(void 0===e[A][n]?e[A][n]=[r]:e[A][n].push(r));else S.test(t[n])||(e[A][n]=[t[n]]);return e}(t.headers);if(X.isRedirect(t.statusCode)){const r=e.get("Location"),i=null===r?null:q(c.url,r);switch(c.redirect){case"error":return o(new p("uri requested responds with a redirect, redirect mode is set to error: "+c.url,"no-redirect")),void y();case"manual":if(null!==i)try{e.set("Location",i)}catch(t){o(t)}break;case"follow":if(null===i)break;if(c.counter>=c.follow)return o(new p("maximum redirect reached at: "+c.url,"max-redirect")),void y();const r={headers:new P(c.headers),follow:c.follow,counter:c.counter+1,agent:c.agent,compress:c.compress,method:c.method,body:c.body,signal:c.signal,timeout:c.timeout,size:c.size};return 303!==t.statusCode&&c.body&&null===w(c)?(o(new p("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void y()):(303!==t.statusCode&&(301!==t.statusCode&&302!==t.statusCode||"POST"!==c.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),n(X(new H(i,r))),void y())}}t.once("end",(function(){h&&h.removeEventListener("abort",m)}));let r=t.pipe(new W);const i={url:c.url,status:t.statusCode,statusText:t.statusMessage,headers:e,size:c.size,timeout:c.timeout,counter:c.counter},a=e.get("Content-Encoding");if(!c.compress||"HEAD"===c.method||null===a||204===t.statusCode||304===t.statusCode)return d=new j(r,i),void n(d);const u={flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return r=r.pipe(s.createGunzip(u)),d=new j(r,i),void n(d);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof s.createBrotliDecompress)return r=r.pipe(s.createBrotliDecompress()),d=new j(r,i),void n(d);d=new j(r,i),n(d)}else{t.pipe(new W).once("data",(function(t){r=8==(15&t[0])?r.pipe(s.createInflate()):r.pipe(s.createInflateRaw()),d=new j(r,i),n(d)}))}})),function(t,e){const n=e.body;null===n?t.end():x(n)?n.stream().pipe(t):Buffer.isBuffer(n)?(t.write(n),t.end()):n.pipe(t)}(v,c)}))}X.isRedirect=function(t){return 301===t||302===t||303===t||307===t||308===t},X.Promise=global.Promise,e.default=X},function(t,e,n){var r=n(117);t.exports=function(t,e){return new(r(t))(e)}},function(t,e,n){var r=n(6),i=n(72),o=n(0)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){var r=n(20),i=n(9),o=n(34).f;t.exports=function(t){return function(e){for(var n,a=i(e),s=r(a),c=s.length,u=0,l=[];c>u;)o.call(a,n=s[u++])&&l.push(t?[n,a[n]]:a[n]);return l}}},function(t,e,n){"use strict";var r=n(81),i=n(3),o=n(61),a=n(120),s=n(17),c=n(66),u=n(42),l=n(4),h=Math.min,p=[].push,d="length",f=!l((function(){RegExp(4294967295,"y")}));n(67)("split",2,(function(t,e,n,l){var m;return m="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[d]||2!="ab".split(/(?:ab)*/)[d]||4!=".".split(/(.?)(.?)/)[d]||".".split(/()()/)[d]>1||"".split(/.?/)[d]?function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(i,t,e);for(var o,a,s,c=[],l=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),h=0,f=void 0===e?4294967295:e>>>0,m=new RegExp(t.source,l+"g");(o=u.call(m,i))&&!((a=m.lastIndex)>h&&(c.push(i.slice(h,o.index)),o[d]>1&&o.index<i[d]&&p.apply(c,o.slice(1)),s=o[0][d],h=a,c[d]>=f));)m.lastIndex===o.index&&m.lastIndex++;return h===i[d]?!s&&m.test("")||c.push(""):c.push(i.slice(h)),c[d]>f?c.slice(0,f):c}:"0".split(void 0,0)[d]?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var i=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):m.call(String(i),n,r)},function(t,e){var r=l(m,t,this,e,m!==n);if(r.done)return r.value;var u=i(t),p=String(this),d=o(u,RegExp),v=u.unicode,g=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(f?"y":"g"),y=new d(f?u:"^(?:"+u.source+")",g),x=void 0===e?4294967295:e>>>0;if(0===x)return[];if(0===p.length)return null===c(y,p)?[p]:[];for(var b=0,M=0,w=[];M<p.length;){y.lastIndex=f?M:0;var _,S=c(y,f?p:p.slice(M));if(null===S||(_=h(s(y.lastIndex+(f?0:M)),p.length))===b)M=a(p,M,v);else{if(w.push(p.slice(b,M)),w.length===x)return w;for(var E=1;E<=S.length-1;E++)if(w.push(S[E]),w.length===x)return w;M=b=_}}return w.push(p.slice(b)),w}]}))},function(t,e,n){"use strict";var r=n(83)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},function(t,e,n){"use strict";var r=n(1),i=n(17),o=n(80),a="".startsWith;r(r.P+r.F*n(82)("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return a?a.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";var r=n(1),i=n(24),o=n(26),a=n(4),s=[].sort,c=[1,2,3];r(r.P+r.F*(a((function(){c.sort(void 0)}))||!a((function(){c.sort(null)}))||!n(44)(s)),"Array",{sort:function(t){return void 0===t?s.call(o(this)):s.call(o(this),i(t))}})},function(t,e,n){var r=n(22)("meta"),i=n(6),o=n(13),a=n(7).f,s=0,c=Object.isExtensible||function(){return!0},u=!n(4)((function(){return c(Object.preventExtensions({}))})),l=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},h=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!c(t))return"F";if(!e)return"E";l(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!c(t))return!0;if(!e)return!1;l(t)}return t[r].w},onFreeze:function(t){return u&&h.NEED&&c(t)&&!o(t,r)&&l(t),t}}},function(t,e,n){var r=n(2),i=n(15),o=n(21),a=n(84),s=n(7).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e,n){var r=n(20),i=n(51),o=n(34);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),c=o.f,u=0;s.length>u;)c.call(t,a=s[u++])&&e.push(a);return e}},function(t,e,n){var r=n(7),i=n(3),o=n(20);t.exports=n(8)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),s=a.length,c=0;s>c;)r.f(t,n=a[c++],e[n]);return t}},function(t,e,n){var r=n(9),i=n(35).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return a.slice()}}(t):i(r(t))}},function(t,e,n){var r=n(35),i=n(51),o=n(3),a=n(2).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},function(t,e,n){"use strict";var r=n(52),i=n(23),o=n(33),a={};n(12)(a,n(0)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(13),i=n(26),o=n(45)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";n(133)("sub",(function(t){return function(){return t(this,"sub","","")}}))},function(t,e,n){var r=n(1),i=n(4),o=n(18),a=/"/g,s=function(t,e,n,r){var i=String(o(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(s),r(r.P+r.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},function(t,e,n){var r=n(1);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){"use strict";var r=n(2),i=n(13),o=n(10),a=n(136),s=n(32),c=n(4),u=n(35).f,l=n(27).f,h=n(7).f,p=n(138).trim,d=r.Number,f=d,m=d.prototype,v="Number"==o(n(52)(m)),g="trim"in String.prototype,y=function(t){var e=s(t,!1);if("string"==typeof e&&e.length>2){var n,r,i,o=(e=g?e.trim():p(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var a,c=e.slice(2),u=0,l=c.length;u<l;u++)if((a=c.charCodeAt(u))<48||a>i)return NaN;return parseInt(c,r)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof d&&(v?c((function(){m.valueOf.call(n)})):"Number"!=o(n))?a(new f(y(e)),n,d):y(e)};for(var x,b=n(8)?u(f):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),M=0;b.length>M;M++)i(f,x=b[M])&&!i(d,x)&&h(d,x,l(f,x));d.prototype=m,m.constructor=d,n(11)(r,"Number",d)}},function(t,e,n){var r=n(6),i=n(137).set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},function(t,e,n){var r=n(6),i=n(3),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(16)(Function.call,n(27).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){var r=n(1),i=n(18),o=n(4),a=n(139),s="["+a+"]",c=RegExp("^"+s+s+"*"),u=RegExp(s+s+"*$"),l=function(t,e,n){var i={},s=o((function(){return!!a[t]()||"
"!="
"[t]()})),c=i[t]=s?e(h):a[t];n&&(i[n]=c),r(r.P+r.F*s,"String",i)},h=l.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(c,"")),2&e&&(t=t.replace(u,"")),t};t.exports=l},function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(t,e,n){"use strict";var r;function i(t,e){if(!(this instanceof i))return new i(t,e);this.lat=Number(t),this.lon=Number(e)}t.exports&&(r=n(36)),i.prototype.distanceTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var n=e=void 0===e?6371e3:Number(e),r=this.lat.toRadians(),o=this.lon.toRadians(),a=t.lat.toRadians(),s=a-r,c=t.lon.toRadians()-o,u=Math.sin(s/2)*Math.sin(s/2)+Math.cos(r)*Math.cos(a)*Math.sin(c/2)*Math.sin(c/2);return n*(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))},i.prototype.bearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),o=Math.sin(r)*Math.cos(n),a=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r);return(Math.atan2(o,a).toDegrees()+360)%360},i.prototype.finalBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");return(t.bearingTo(this)+180)%360},i.prototype.midpointTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),a=Math.cos(r)*Math.cos(o),s=Math.cos(r)*Math.sin(o),c=Math.sqrt((Math.cos(e)+a)*(Math.cos(e)+a)+s*s),u=Math.sin(e)+Math.sin(r),l=Math.atan2(u,c),h=n+Math.atan2(s,Math.cos(e)+a);return new i(l.toDegrees(),(h.toDegrees()+540)%360-180)},i.prototype.intermediatePointTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var n=this.lat.toRadians(),r=this.lon.toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),s=Math.sin(n),c=Math.cos(n),u=Math.sin(r),l=Math.cos(r),h=Math.sin(o),p=Math.cos(o),d=Math.sin(a),f=Math.cos(a),m=o-n,v=a-r,g=Math.sin(m/2)*Math.sin(m/2)+Math.cos(n)*Math.cos(o)*Math.sin(v/2)*Math.sin(v/2),y=2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g)),x=Math.sin((1-e)*y)/Math.sin(y),b=Math.sin(e*y)/Math.sin(y),M=x*c*l+b*p*f,w=x*c*u+b*p*d,_=x*s+b*h,S=Math.atan2(_,Math.sqrt(M*M+w*w)),E=Math.atan2(w,M);return new i(S.toDegrees(),(E.toDegrees()+540)%360-180)},i.prototype.destinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var r=Number(t)/n,o=Number(e).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),c=Math.sin(a),u=Math.cos(a),l=Math.sin(r),h=Math.cos(r),p=Math.sin(o),d=c*h+u*l*Math.cos(o),f=Math.asin(d),m=p*l*u,v=h-c*d,g=s+Math.atan2(m,v);return new i(f.toDegrees(),(g.toDegrees()+540)%360-180)},i.intersection=function(t,e,n,r){if(!(t instanceof i))throw new TypeError("p1 is not LatLon object");if(!(n instanceof i))throw new TypeError("p2 is not LatLon object");var o=t.lat.toRadians(),a=t.lon.toRadians(),s=n.lat.toRadians(),c=n.lon.toRadians(),u=Number(e).toRadians(),l=Number(r).toRadians(),h=s-o,p=c-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(o)*Math.cos(s)*Math.sin(p/2)*Math.sin(p/2)));if(0==d)return null;var f=Math.acos((Math.sin(s)-Math.sin(o)*Math.cos(d))/(Math.sin(d)*Math.cos(o)));isNaN(f)&&(f=0);var m=Math.acos((Math.sin(o)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s))),v=u-(Math.sin(c-a)>0?f:2*Math.PI-f),g=(Math.sin(c-a)>0?2*Math.PI-m:m)-l;if(0==Math.sin(v)&&0==Math.sin(g))return null;if(Math.sin(v)*Math.sin(g)<0)return null;var y=Math.acos(-Math.cos(v)*Math.cos(g)+Math.sin(v)*Math.sin(g)*Math.cos(d)),x=Math.atan2(Math.sin(d)*Math.sin(v)*Math.sin(g),Math.cos(g)+Math.cos(v)*Math.cos(y)),b=Math.asin(Math.sin(o)*Math.cos(x)+Math.cos(o)*Math.sin(x)*Math.cos(u)),M=a+Math.atan2(Math.sin(u)*Math.sin(x)*Math.cos(o),Math.cos(x)-Math.sin(o)*Math.sin(b));return new i(b.toDegrees(),(M.toDegrees()+540)%360-180)},i.prototype.crossTrackDistanceTo=function(t,e,n){if(!(t instanceof i))throw new TypeError("pathStart is not LatLon object");if(!(e instanceof i))throw new TypeError("pathEnd is not LatLon object");var r=void 0===n?6371e3:Number(n),o=t.distanceTo(this,r)/r,a=t.bearingTo(this).toRadians(),s=t.bearingTo(e).toRadians();return Math.asin(Math.sin(o)*Math.sin(a-s))*r},i.prototype.alongTrackDistanceTo=function(t,e,n){if(!(t instanceof i))throw new TypeError("pathStart is not LatLon object");if(!(e instanceof i))throw new TypeError("pathEnd is not LatLon object");var r=void 0===n?6371e3:Number(n),o=t.distanceTo(this,r)/r,a=t.bearingTo(this).toRadians(),s=t.bearingTo(e).toRadians(),c=Math.asin(Math.sin(o)*Math.sin(a-s));return Math.acos(Math.cos(o)/Math.abs(Math.cos(c)))*Math.sign(Math.cos(s-a))*r},i.prototype.maxLatitude=function(t){var e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()},i.crossingParallels=function(t,e,n){var r=Number(n).toRadians(),i=t.lat.toRadians(),o=t.lon.toRadians(),a=e.lat.toRadians(),s=e.lon.toRadians()-o,c=Math.sin(i)*Math.cos(a)*Math.cos(r)*Math.sin(s),u=Math.sin(i)*Math.cos(a)*Math.cos(r)*Math.cos(s)-Math.cos(i)*Math.sin(a)*Math.cos(r),l=Math.cos(i)*Math.cos(a)*Math.sin(r)*Math.sin(s);if(l*l>c*c+u*u)return null;var h=Math.atan2(-u,c),p=Math.acos(l/Math.sqrt(c*c+u*u)),d=o+h+p;return{lon1:((o+h-p).toDegrees()+540)%360-180,lon2:(d.toDegrees()+540)%360-180}},i.prototype.rhumbDistanceTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var n=e=void 0===e?6371e3:Number(e),r=this.lat.toRadians(),o=t.lat.toRadians(),a=o-r,s=Math.abs(t.lon-this.lon).toRadians();s>Math.PI&&(s-=2*Math.PI);var c=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),u=Math.abs(c)>1e-11?a/c:Math.cos(r);return Math.sqrt(a*a+u*u*s*s)*n},i.prototype.rhumbBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians();r>Math.PI&&(r-=2*Math.PI),r<-Math.PI&&(r+=2*Math.PI);var o=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(e/2+Math.PI/4));return(Math.atan2(r,o).toDegrees()+360)%360},i.prototype.rhumbDestinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var r=Number(t)/n,o=this.lat.toRadians(),a=this.lon.toRadians(),s=Number(e).toRadians(),c=r*Math.cos(s),u=o+c;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var l=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),h=Math.abs(l)>1e-11?c/l:Math.cos(o),p=a+r*Math.sin(s)/h;return new i(u.toDegrees(),(p.toDegrees()+540)%360-180)},i.prototype.rhumbMidpointTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-n)>Math.PI&&(n+=2*Math.PI);var a=(e+r)/2,s=Math.tan(Math.PI/4+e/2),c=Math.tan(Math.PI/4+r/2),u=Math.tan(Math.PI/4+a/2),l=((o-n)*Math.log(u)+n*Math.log(c)-o*Math.log(s))/Math.log(c/s);return isFinite(l)||(l=(n+o)/2),i(a.toDegrees(),(l.toDegrees()+540)%360-180)},i.areaOf=function(t,e){var n=void 0===e?6371e3:Number(e),r=t[0].equals(t[t.length-1]);r||t.push(t[0]);for(var i=t.length-1,o=0,a=0;a<i;a++){var s=t[a].lat.toRadians(),c=t[a+1].lat.toRadians(),u=(t[a+1].lon-t[a].lon).toRadians();o+=2*Math.atan2(Math.tan(u/2)*(Math.tan(s/2)+Math.tan(c/2)),1+Math.tan(s/2)*Math.tan(c/2))}(function(t){for(var e=0,n=t[0].bearingTo(t[1]),r=0;r<t.length-1;r++){var i=t[r].bearingTo(t[r+1]),o=t[r].finalBearingTo(t[r+1]);e+=(i-n+540)%360-180,e+=(o-i+540)%360-180,n=o}i=t[0].bearingTo(t[1]);return e+=(i-n+540)%360-180,Math.abs(e)<90})(t)&&(o=Math.abs(o)-2*Math.PI);var l=Math.abs(o*n*n);return r||t.pop(),l},i.prototype.equals=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");return this.lat==t.lat&&this.lon==t.lon},i.prototype.toString=function(t,e){return r.toLat(this.lat,t,e)+", "+r.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),t.exports&&(t.exports=i)},function(t,e,n){"use strict";var r;t.exports&&(r=n(28)),r.prototype.distanceTo=function(t){if(!(t instanceof r))throw new TypeError("point is not LatLon object");try{return Number(this.inverse(t).distance.toFixed(3))}catch(t){return NaN}},r.prototype.initialBearingTo=function(t){if(!(t instanceof r))throw new TypeError("point is not LatLon object");try{return Number(this.inverse(t).initialBearing.toFixed(9))}catch(t){return NaN}},r.prototype.finalBearingTo=function(t){if(!(t instanceof r))throw new TypeError("point is not LatLon object");try{return Number(this.inverse(t).finalBearing.toFixed(9))}catch(t){return NaN}},r.prototype.destinationPoint=function(t,e){return this.direct(Number(t),Number(e)).point},r.prototype.finalBearingOn=function(t,e){return Number(this.direct(Number(t),Number(e)).finalBearing.toFixed(9))},r.prototype.direct=function(t,e){var n,i,o,a,s=this.lat.toRadians(),c=this.lon.toRadians(),u=e.toRadians(),l=t,h=this.datum.ellipsoid.a,p=this.datum.ellipsoid.b,d=this.datum.ellipsoid.f,f=Math.sin(u),m=Math.cos(u),v=(1-d)*Math.tan(s),g=1/Math.sqrt(1+v*v),y=v*g,x=Math.atan2(v,m),b=g*f,M=1-b*b,w=M*(h*h-p*p)/(p*p),_=1+w/16384*(4096+w*(w*(320-175*w)-768)),S=w/1024*(256+w*(w*(74-47*w)-128)),E=l/(p*_),T=0;do{n=Math.cos(2*x+E),a=E,E=l/(p*_)+S*(i=Math.sin(E))*(n+S/4*((o=Math.cos(E))*(2*n*n-1)-S/6*n*(4*i*i-3)*(4*n*n-3)))}while(Math.abs(E-a)>1e-12&&++T<100);if(T>=100)throw new Error("Formula failed to converge");var L=y*i-g*o*m,A=Math.atan2(y*o+g*i*m,(1-d)*Math.sqrt(b*b+L*L)),P=d/16*M*(4+d*(4-3*M)),R=(c+(Math.atan2(i*f,g*o-y*i*m)-(1-P)*d*b*(E+P*i*(n+P*o*(2*n*n-1))))+3*Math.PI)%(2*Math.PI)-Math.PI,O=Math.atan2(b,-L);return O=(O+2*Math.PI)%(2*Math.PI),{point:new r(A.toDegrees(),R.toDegrees(),this.datum),finalBearing:O.toDegrees(),iterations:T}},r.prototype.inverse=function(t){var e=t;-180==this.lon&&(this.lon=180);var n,r,i,o,a,s,c=this.lat.toRadians(),u=this.lon.toRadians(),l=e.lat.toRadians(),h=e.lon.toRadians(),p=this.datum.ellipsoid.a,d=this.datum.ellipsoid.b,f=this.datum.ellipsoid.f,m=h-u,v=(1-f)*Math.tan(c),g=1/Math.sqrt(1+v*v),y=v*g,x=(1-f)*Math.tan(l),b=1/Math.sqrt(1+x*x),M=x*b,w=0,_=0,S=0,E=0,T=0,L=m,A=0,P=Math.abs(m)>Math.PI;do{if(0==(i=b*(n=Math.sin(L))*(b*n)+(g*M-y*b*(r=Math.cos(L)))*(g*M-y*b*r)))break;if(_=y*M+g*b*r,s=L,L=m+(1-(a=f/16*(E=1-(o=g*b*n/(w=Math.sqrt(i)))*o)*(4+f*(4-3*E))))*f*o*((S=Math.atan2(w,_))+a*w*((T=0!=E?_-2*y*M/E:0)+a*_*(2*T*T-1))),(P?Math.abs(L)-Math.PI:Math.abs(L))>Math.PI)throw new Error("λ > π")}while(Math.abs(L-s)>1e-12&&++A<1e3);if(A>=1e3)throw new Error("Formula failed to converge");var R=E*(p*p-d*d)/(d*d),O=R/1024*(256+R*(R*(74-47*R)-128)),N=d*(1+R/16384*(4096+R*(R*(320-175*R)-768)))*(S-O*w*(T+O/4*(_*(2*T*T-1)-O/6*T*(4*w*w-3)*(4*T*T-3)))),C=Math.atan2(b*n,g*M-y*b*r),I=Math.atan2(g*n,-y*b+g*M*r);return C=(C+2*Math.PI)%(2*Math.PI),I=(I+2*Math.PI)%(2*Math.PI),{distance:N,initialBearing:0==N?NaN:C.toDegrees(),finalBearing:0==N?NaN:I.toDegrees(),iterations:A}},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),t.exports&&(t.exports=r)},function(t,e,n){"use strict";var r,i;function o(t,e){if(!(this instanceof o))return new o(t,e);this.lat=Number(t),this.lon=Number(e)}t.exports&&(r=n(54)),t.exports&&(i=n(36)),o.prototype.toVector=function(){var t=this.lat.toRadians(),e=this.lon.toRadians(),n=Math.cos(t)*Math.cos(e),i=Math.cos(t)*Math.sin(e),o=Math.sin(t);return new r(n,i,o)},r.prototype.toLatLonS=function(){var t=Math.atan2(this.z,Math.sqrt(this.x*this.x+this.y*this.y)),e=Math.atan2(this.y,this.x);return new o(t.toDegrees(),e.toDegrees())},o.prototype.greatCircle=function(t){var e=this.lat.toRadians(),n=this.lon.toRadians(),i=Number(t).toRadians(),o=Math.sin(n)*Math.cos(i)-Math.sin(e)*Math.cos(n)*Math.sin(i),a=-Math.cos(n)*Math.cos(i)-Math.sin(e)*Math.sin(n)*Math.sin(i),s=Math.cos(e)*Math.sin(i);return new r(o,a,s)},r.prototype.greatCircle=function(t){var e=Number(t).toRadians(),n=new r(0,0,1).cross(this),i=this.cross(n),o=n.times(Math.cos(e)/n.length());return i.times(Math.sin(e)/i.length()).minus(o)},o.prototype.distanceTo=function(t,e){if(!(t instanceof o))throw new TypeError("point is not LatLon object");e=void 0===e?6371e3:Number(e);var n=this.toVector(),r=t.toVector();return n.angleTo(r)*e},o.prototype.bearingTo=function(t){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var e=this.toVector(),n=t.toVector(),i=new r(0,0,1),a=e.cross(n),s=e.cross(i);return(a.angleTo(s,e).toDegrees()+360)%360},o.prototype.midpointTo=function(t){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var e=this.toVector(),n=t.toVector();return e.plus(n).unit().toLatLonS()},o.prototype.intermediatePointTo=function(t,e){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var n=this.toVector(),i=t.toVector(),a=n.cross(i).length(),s=n.dot(i),c=Math.atan2(a,s)*Number(e),u=Math.sin(c),l=Math.cos(c),h=n.cross(i).unit().cross(n),p=n.times(l).plus(h.times(u));return new r(p.x,p.y,p.z).toLatLonS()},o.prototype.intermediatePointOnChordTo=function(t,e){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var n=this.toVector(),i=t.toVector(),a=n.plus(i.minus(n).times(Number(e)));return new r(a.x,a.y,a.z).toLatLonS()},o.prototype.destinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var i=this.toVector(),o=Number(t)/n,a=Number(e).toRadians(),s=new r(0,0,1).cross(i).unit(),c=i.cross(s),u=s.times(Math.sin(a)),l=c.times(Math.cos(a)).plus(u),h=i.times(Math.cos(o)),p=l.times(Math.sin(o));return h.plus(p).toLatLonS()},o.intersection=function(t,e,n,r){if(!(t instanceof o))throw new TypeError("path1start is not LatLon object");if(!(n instanceof o))throw new TypeError("path2start is not LatLon object");if(!(e instanceof o)&&isNaN(e))throw new TypeError("path1brngEnd is not LatLon object or bearing");if(!(r instanceof o)&&isNaN(r))throw new TypeError("path2brngEnd is not LatLon object or bearing");var i,a,s,c,u=t.toVector(),l=n.toVector();e instanceof o?(i=u.cross(e.toVector()),s="endpoint"):(i=t.greatCircle(Number(e)),s="bearing"),r instanceof o?(a=l.cross(r.toVector()),c="endpoint"):(a=n.greatCircle(Number(r)),c="bearing");var h=i.cross(a),p=a.cross(i),d=null;switch(s+"+"+c){case"bearing+bearing":switch(Math.sign(i.cross(u).dot(h))+Math.sign(a.cross(l).dot(h))){case 2:d=h;break;case-2:d=p;break;case 0:d=u.plus(l).dot(h)>0?p:h}break;case"bearing+endpoint":d=Math.sign(i.cross(u).dot(h))>0?h:p;break;case"endpoint+bearing":d=Math.sign(a.cross(l).dot(h))>0?h:p;break;case"endpoint+endpoint":d=u.plus(l).plus(e.toVector()).plus(r.toVector()).dot(h)>0?h:p}return d.toLatLonS()},o.prototype.crossTrackDistanceTo=function(t,e,n){if(!(t instanceof o))throw new TypeError("pathStart is not LatLon object");var r=void 0===n?6371e3:Number(n),i=this.toVector();return((e instanceof o?t.toVector().cross(e.toVector()):t.greatCircle(Number(e))).angleTo(i)-Math.PI/2)*r},o.prototype.alongTrackDistanceTo=function(t,e,n){if(!(t instanceof o))throw new TypeError("pathStart is not LatLon object");var r=void 0===n?6371e3:Number(n),i=this.toVector(),a=e instanceof o?t.toVector().cross(e.toVector()):t.greatCircle(Number(e)),s=a.cross(i).cross(a);return t.toVector().angleTo(s,a)*r},o.prototype.nearestPointOnSegment=function(t,e){var n=null;if(this.isBetween(t,e)){var r=this.toVector(),i=t.toVector(),o=e.toVector(),a=i.cross(o),s=r.cross(a);n=a.cross(s).toLatLonS()}else{n=this.distanceTo(t)<this.distanceTo(e)?t:e}return n},o.prototype.isBetween=function(t,e){var n=this.toVector(),r=t.toVector(),i=e.toVector(),o=n.minus(r),a=i.minus(r),s=n.minus(i),c=r.minus(i),u=o.dot(a),l=s.dot(c),h=u>=0&&l>=0,p=n.dot(r)>=0&&n.dot(i)>=0;return h&&p},o.prototype.enclosedBy=function(t){var e=t[0].equals(t[t.length-1]);e||t.push(t[0]);for(var n=t.length-1,r=this.toVector(),i=[],o=0;o<n;o++)i[o]=r.minus(t[o].toVector());i.push(i[0]);var a=0;for(o=0;o<n;o++)a+=i[o].angleTo(i[o+1],r);var s=Math.abs(a)>Math.PI;return e||t.pop(),s},o.areaOf=function(t,e){var n=null==e?6371e3:Number(e),r=t[0].equals(t[t.length-1]);r||t.push(t[0]);for(var i=t.length-1,o=[],a=0;a<i;a++){var s=t[a].toVector(),c=t[a+1].toVector();o[a]=s.cross(c)}o.push(o[0]);var u=t[0].toVector(),l=0;for(a=0;a<i;a++)l+=o[a].angleTo(o[a+1],u);var h=(i*Math.PI-Math.abs(l)-(i-2)*Math.PI)*n*n;return r||t.pop(),h},o.meanOf=function(t){for(var e=new r(0,0,0),n=0;n<t.length;n++)e=e.plus(t[n].toVector());return e.unit().toLatLonS()},o.prototype.equals=function(t){if(!(t instanceof o))throw new TypeError("point is not LatLon object");return this.lat==t.lat&&this.lon==t.lon},o.prototype.toString=function(t,e){return i.toLat(this.lat,t,e)+", "+i.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),void 0===Math.sign&&(Math.sign=function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1}),t.exports&&(t.exports=o,t.exports.Vector3d=r)},function(t,e,n){"use strict";var r,i;function o(t,e,n,r,a,s,c){if(!(this instanceof o))return new o(t,e,n,r,a,s,c);if(void 0===c&&(c=i.datum.WGS84),!(1<=t&&t<=60))throw new Error("Invalid MGRS grid reference (zone ‘"+t+"’)");if(1!=e.length)throw new Error("Invalid MGRS grid reference (band ‘"+e+"’)");if(-1==o.latBands.indexOf(e))throw new Error("Invalid MGRS grid reference (band ‘"+e+"’)");if(1!=n.length)throw new Error("Invalid MGRS grid reference (e100k ‘"+n+"’)");if(1!=r.length)throw new Error("Invalid MGRS grid reference (n100k ‘"+r+"’)");this.zone=Number(t),this.band=e,this.e100k=n,this.n100k=r,this.easting=Number(a),this.northing=Number(s),this.datum=c}t.exports&&(r=n(95)),t.exports&&(i=n(28)),o.latBands="CDEFGHJKLMNPQRSTUVWXX",o.e100kLetters=["ABCDEFGH","JKLMNPQR","STUVWXYZ"],o.n100kLetters=["ABCDEFGHJKLMNPQRSTUV","FGHJKLMNPQRSTUVABCDE"],r.prototype.toMgrs=function(){if(isNaN(this.zone+this.easting+this.northing))throw new Error("Invalid UTM coordinate ‘"+this.toString()+"’");var t=this.zone,e=this.toLatLonE(),n=o.latBands.charAt(Math.floor(e.lat/8+10)),r=Math.floor(this.easting/1e5),i=o.e100kLetters[(t-1)%3].charAt(r-1),a=Math.floor(this.northing/1e5)%20,s=o.n100kLetters[(t-1)%2].charAt(a),c=this.easting%1e5,u=this.northing%1e5;return new o(t,n,i,s,c=Number(c.toFixed(6)),u=Number(u.toFixed(6)))},o.prototype.toUtm=function(){for(var t=this.zone,e=this.band,n=this.e100k,a=this.n100k,s=this.easting,c=this.northing,u=e>="N"?"N":"S",l=1e5*(o.e100kLetters[(t-1)%3].indexOf(n)+1),h=1e5*o.n100kLetters[(t-1)%2].indexOf(a),p=8*(o.latBands.indexOf(e)-10),d=1e5*Math.floor(new i(p,0).toUtm().northing/1e5),f=0;f+h+c<d;)f+=2e6;return new r(t,u,l+s,f+h+c,this.datum)},o.parse=function(t){if(!(t=t.trim()).match(/\s/)){var e=t.slice(5);e=e.slice(0,e.length/2)+" "+e.slice(-e.length/2),t=t.slice(0,3)+" "+t.slice(3,5)+" "+e}if(null==(t=t.match(/\S+/g))||4!=t.length)throw new Error("Invalid MGRS grid reference ‘"+t+"’");var n=t[0],r=n.slice(0,2),i=n.slice(2,3),a=t[1],s=a.slice(0,1),c=a.slice(1,2),u=t[2],l=t[3];return new o(r,i,s,c,u=u.length>=5?u:(u+"00000").slice(0,5),l=l.length>=5?l:(l+"00000").slice(0,5))},o.prototype.toString=function(t){if(t=void 0===t?10:Number(t),-1==[2,4,6,8,10].indexOf(t))throw new Error("Invalid precision ‘"+t+"’");var e=("00"+this.zone).slice(-2),n=this.band,r=this.e100k,i=this.n100k,o=Math.floor(this.easting/Math.pow(10,5-t/2)),a=Math.floor(this.northing/Math.pow(10,5-t/2));return e+n+" "+r+i+" "+("00000"+o).slice(-t/2)+" "+("00000"+a).slice(-t/2)},t.exports&&(t.exports=o)},function(t,e,n){"use strict";var r;function i(t,e){if(!(this instanceof i))return new i(t,e);this.easting=Number(t),this.northing=Number(e)}t.exports&&(r=n(28)),i.latLonToOsGrid=function(t){if(!(t instanceof r))throw new TypeError("point is not LatLon object");t.datum!=r.datum.OSGB36&&(t=t.convertDatum(r.datum.OSGB36));var e=t.lat.toRadians(),n=t.lon.toRadians(),o=6377563.396,a=6356256.909,s=.9996012717,c=49..toRadians(),u=(-2).toRadians(),l=1-a*a/(o*o),h=(o-a)/(o+a),p=h*h,d=h*h*h,f=Math.cos(e),m=Math.sin(e),v=o*s/Math.sqrt(1-l*m*m),g=o*s*(1-l)/Math.pow(1-l*m*m,1.5),y=v/g-1,x=a*s*(1.0016767257673973*(e-c)-(3*h+3*h*h+21/8*d)*Math.sin(e-c)*Math.cos(e+c)+(15/8*p+15/8*d)*Math.sin(2*(e-c))*Math.cos(2*(e+c))-35/24*d*Math.sin(3*(e-c))*Math.cos(3*(e+c))),b=f*f*f,M=b*f*f,w=Math.tan(e)*Math.tan(e),_=w*w,S=n-u,E=S*S,T=E*S,L=T*S,A=L*S,P=x+-1e5+v/2*m*f*E+v/24*m*b*(5-w+9*y)*L+v/720*m*M*(61-58*w+_)*(A*S),R=4e5+v*f*S+v/6*b*(v/g-w)*T+v/120*M*(5-18*w+_+14*y-58*w*y)*A;return P=Number(P.toFixed(3)),new i(R=Number(R.toFixed(3)),P)},i.osGridToLatLon=function(t,e){if(!(t instanceof i))throw new TypeError("gridref is not OsGridRef object");void 0===e&&(e=r.datum.WGS84);var n=t.easting,o=t.northing,a=6377563.396,s=6356256.909,c=.9996012717,u=49..toRadians(),l=(-2).toRadians(),h=1-s*s/(a*a),p=(a-s)/(a+s),d=p*p,f=p*p*p,m=u,v=0;do{v=s*c*(1.0016767257673973*((m=(o- -1e5-v)/(a*c)+m)-u)-(3*p+3*p*p+21/8*f)*Math.sin(m-u)*Math.cos(m+u)+(15/8*d+15/8*f)*Math.sin(2*(m-u))*Math.cos(2*(m+u))-35/24*f*Math.sin(3*(m-u))*Math.cos(3*(m+u)))}while(o- -1e5-v>=1e-5);var g=Math.cos(m),y=Math.sin(m),x=a*c/Math.sqrt(1-h*y*y),b=a*c*(1-h)/Math.pow(1-h*y*y,1.5),M=x/b-1,w=Math.tan(m),_=w*w,S=_*_,E=1/g,T=x*x*x,L=T*x*x,A=n-4e5,P=A*A,R=P*A,O=P*P,N=R*P,C=l+E/x*A-E/(6*T)*(x/b+2*_)*R+E/(120*L)*(5+28*_+24*S)*N-E/(5040*(L*x*x))*(61+662*_+1320*S+720*(S*_))*(N*P),I=new r((m=m-w/(2*b*x)*P+w/(24*b*T)*(5+3*_+M-9*_*M)*O-w/(720*b*L)*(61+90*_+45*S)*(O*P)).toDegrees(),C.toDegrees(),r.datum.OSGB36);return e!=r.datum.OSGB36&&(I=I.convertDatum(e)),I},i.parse=function(t){var e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new i(e[1],e[2]);if(!(e=t.match(/^[A-Z]{2}\s*[0-9]+\s*[0-9]+$/i)))throw new Error("Invalid grid reference");var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;var o=(n-2)%5*5+r%5,a=19-5*Math.floor(n/5)-Math.floor(r/5),s=t.slice(2).trim().split(/\s+/);if(1==s.length&&(s=[s[0].slice(0,s[0].length/2),s[0].slice(s[0].length/2)]),o<0||o>6||a<0||a>12)throw new Error("Invalid grid reference");if(2!=s.length)throw new Error("Invalid grid reference");if(s[0].length!=s[1].length)throw new Error("Invalid grid reference");return s[0]=(s[0]+"00000").slice(0,5),s[1]=(s[1]+"00000").slice(0,5),new i(o+s[0],a+s[1])},i.prototype.toString=function(t){if(t=void 0===t?10:Number(t),isNaN(t)||t%2!=0||t>16)throw new RangeError("Invalid precision ‘"+t+"’");var e=this.easting,n=this.northing;if(isNaN(e)||isNaN(n))throw new Error("Invalid grid reference");if(0==t){var r=Math.floor(e),i=e-r,o=Math.floor(n),a=n-o;return("000000"+r).slice(-6)+(i>0?i.toFixed(3).slice(1):"")+","+((o<1e6?("000000"+o).slice(-6):o)+(a>0?a.toFixed(3).slice(1):""))}var s=Math.floor(e/1e5),c=Math.floor(n/1e5);if(s<0||s>6||c<0||c>12)return"";var u=19-c-(19-c)%5+Math.floor((s+10)/5),l=5*(19-c)%25+s%5;u>7&&u++,l>7&&l++;var h=String.fromCharCode(u+"A".charCodeAt(0),l+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),n=Math.floor(n%1e5/Math.pow(10,5-t/2)),h+" "+(e=("00000000"+e).slice(-t/2))+" "+(n=("00000000"+n).slice(-t/2))},t.exports&&(t.exports=i)},function(t,e,n){"use strict";t.exports=function(t){return encodeURIComponent(t).replace(/[!'()*]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}},function(t,e,n){"use strict";
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Mappedin=e():t.Mappedin=e()}(global,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=101)}([function(t,e,n){var r=n(31)("wks"),i=n(22),o=n(2).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e,n){var r=n(2),i=n(15),o=n(12),a=n(11),s=n(16),c=function(t,e,n){var u,l,h,p,d=t&c.F,f=t&c.G,m=t&c.S,v=t&c.P,g=t&c.B,y=f?r:m?r[e]||(r[e]={}):(r[e]||{}).prototype,x=f?i:i[e]||(i[e]={}),b=x.prototype||(x.prototype={});for(u in f&&(n=e),n)h=((l=!d&&y&&void 0!==y[u])?y:n)[u],p=g&&l?s(h,r):v&&"function"==typeof h?s(Function.call,h):h,y&&a(y,u,h,t&c.U),x[u]!=h&&o(x,u,p),v&&b[u]!=h&&(b[u]=h)};r.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(6);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=require("stream")},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(3),i=n(56),o=n(32),a=Object.defineProperty;e.f=n(8)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(71),i=n(18);t.exports=function(t){return r(i(t))}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(2),i=n(12),o=n(13),a=n(22)("src"),s=n(102),c=(""+s).split("toString");n(15).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",e)),t[e]!==n&&(u&&(o(n,a)||i(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:i(t,e,n):(delete t[e],i(t,e,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(t,e,n){var r=n(7),i=n(23);t.exports=n(8)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports=require("zlib")},function(t,e){var n=t.exports={version:"2.6.5"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(24);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(40),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";n.d(e,"c",(function(){return al})),n.d(e,"a",(function(){return sl})),n.d(e,"b",(function(){return cl}));n(70),n(132),n(94),n(78),n(47),n(48),n(134),n(135),n(50),n(91),n(38),n(53),n(93),n(90),n(89);var r=n(98),i=n.n(r);const o=new Uint8Array(256);let a=o.length;function s(){return a>o.length-16&&(i.a.randomFillSync(o),a=0),o.slice(a,a+=16)}var c=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;var u=function(t){return"string"==typeof t&&c.test(t)};const l=[];for(let t=0;t<256;++t)l.push((t+256).toString(16).substr(1));var h=function(t,e=0){const n=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!u(n))throw TypeError("Stringified UUID is invalid");return n};var p=function(t,e,n){const r=(t=t||{}).random||(t.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return h(r)};void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");const e=Object(t);for(let t=1;t<arguments.length;t++){const n=arguments[t];if(null!=n)for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e});function d(){}Object.assign(d.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)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(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)}}}});for(var f=[],m=0;m<256;m++)f[m]=(m<16?"0":"")+m.toString(16);var v,g={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(f[255&t]+f[t>>8&255]+f[t>>16&255]+f[t>>24&255]+"-"+f[255&e]+f[e>>8&255]+"-"+f[e>>16&15|64]+f[e>>24&255]+"-"+f[63&n|128]+f[n>>8&255]+"-"+f[n>>16&255]+f[n>>24&255]+f[255&r]+f[r>>8&255]+f[r>>16&255]+f[r>>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:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?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*g.DEG2RAD},radToDeg:function(t){return t*g.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))},setQuaternionFromProperEuler:function(t,e,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),c=a(n/2),u=o((e+r)/2),l=a((e+r)/2),h=o((e-r)/2),p=a((e-r)/2),d=o((r-e)/2),f=a((r-e)/2);switch(i){case"XYX":t.set(s*l,c*h,c*p,s*u);break;case"YZY":t.set(c*p,s*l,c*h,s*u);break;case"ZXZ":t.set(c*h,c*p,s*l,s*u);break;case"XZX":t.set(s*l,c*f,c*d,s*u);break;case"YXY":t.set(c*d,s*l,c*f,s*u);break;case"ZYZ":t.set(c*f,c*d,s*l,s*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};function y(t,e){this.x=t||0,this.y=e||0}function x(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(y.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(y.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("THREE.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("THREE.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(){return Math.atan2(-this.y,-this.x)+Math.PI},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.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this},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("THREE.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},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(x.prototype,{isMatrix3:!0,set:function(t,e,n,r,i,o,a,s,c){var u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=e,u[4]=i,u[5]=s,u[6]=n,u[7]=o,u[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},extractBasis:function(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),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},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],u=n[4],l=n[7],h=n[2],p=n[5],d=n[8],f=r[0],m=r[3],v=r[6],g=r[1],y=r[4],x=r[7],b=r[2],M=r[5],w=r[8];return i[0]=o*f+a*g+s*b,i[3]=o*m+a*y+s*M,i[6]=o*v+a*x+s*w,i[1]=c*f+u*g+l*b,i[4]=c*m+u*y+l*M,i[7]=c*v+u*x+l*w,i[2]=h*f+p*g+d*b,i[5]=h*m+p*y+d*M,i[8]=h*v+p*x+d*w,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],u=t[8];return e*o*u-e*a*c-n*i*u+n*a*s+r*i*c-r*o*s},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=t.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],c=n[4],u=n[5],l=n[6],h=n[7],p=n[8],d=p*c-u*h,f=u*l-p*s,m=h*s-c*l,v=i*d+o*f+a*m;if(0===v)return this.set(0,0,0,0,0,0,0,0,0);var g=1/v;return r[0]=d*g,r[1]=(a*h-p*o)*g,r[2]=(u*o-a*c)*g,r[3]=f*g,r[4]=(p*i-a*l)*g,r[5]=(a*s-u*i)*g,r[6]=m*g,r[7]=(o*l-h*i)*g,r[8]=(c*i-o*s)*g,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],u=r[7];return r[0]=e*i+n*s,r[3]=e*o+n*c,r[6]=e*a+n*u,r[1]=-n*i+e*s,r[4]=-n*o+e*c,r[7]=-n*a+e*u,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 b={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===v&&(v=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),v.width=t.width,v.height=t.height;var n=v.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=v}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},M=0;function w(t,e,n,r,i,o,a,s,c,u){Object.defineProperty(this,"id",{value:M++}),this.uuid=g.generateUUID(),this.name="",this.image=void 0!==t?t:w.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:w.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:1001,this.wrapT=void 0!==r?r:1001,this.magFilter=void 0!==i?i:1006,this.minFilter=void 0!==o?o:1008,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:1023,this.internalFormat=null,this.type=void 0!==s?s:1009,this.offset=new y(0,0),this.repeat=new y(1,1),this.center=new y(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new x,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:3e3,this.version=0,this.onUpdate=null}function _(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function S(t,e,n){this.width=t,this.height=e,this.scissor=new _(0,0,t,e),this.scissorTest=!1,this.viewport=new _(0,0,t,e),n=n||{},this.texture=new w(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,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 E(t,e,n){S.call(this,t,e,n),this.samples=4}function T(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}w.DEFAULT_IMAGE=void 0,w.DEFAULT_MAPPING=300,w.prototype=Object.assign(Object.create(d.prototype),{constructor:w,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){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=g.generateUUID()),!e&&void 0===t.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o<a;o++)i.push(b.getDataURL(r[o]))}else i=b.getDataURL(r);t.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(w.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(_.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(_.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("THREE.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("THREE.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],u=o[1],l=o[5],h=o[9],p=o[2],d=o[6],f=o[10];if(Math.abs(s-u)<.01&&Math.abs(c-p)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+u)<.1&&Math.abs(c+p)<.1&&Math.abs(h+d)<.1&&Math.abs(a+l+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,v=(l+1)/2,g=(f+1)/2,y=(s+u)/4,x=(c+p)/4,b=(h+d)/4;return m>v&&m>g?m<.01?(n=0,r=.707106781,i=.707106781):(r=y/(n=Math.sqrt(m)),i=x/n):v>g?v<.01?(n=.707106781,r=0,i=.707106781):(n=y/(r=Math.sqrt(v)),i=b/r):g<.01?(n=.707106781,r=.707106781,i=0):(n=x/(i=Math.sqrt(g)),r=b/i),this.set(n,r,i,e),this}var M=Math.sqrt((d-h)*(d-h)+(c-p)*(c-p)+(u-s)*(u-s));return Math.abs(M)<.001&&(M=1),this.x=(d-h)/M,this.y=(c-p)/M,this.z=(u-s)/M,this.w=Math.acos((a+l+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 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.w=Math.max(t,Math.min(e,this.w)),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.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.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this},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("THREE.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},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}),S.prototype=Object.assign(Object.create(d.prototype),{constructor:S,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.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"})}}),E.prototype=Object.assign(Object.create(S.prototype),{constructor:E,isWebGLMultisampleRenderTarget:!0,copy:function(t){return S.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(T,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,o,a){var s=n[r+0],c=n[r+1],u=n[r+2],l=n[r+3],h=i[o+0],p=i[o+1],d=i[o+2],f=i[o+3];if(l!==f||s!==h||c!==p||u!==d){var m=1-a,v=s*h+c*p+u*d+l*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,v*g);m=Math.sin(m*b)/x,a=Math.sin(a*b)/x}var M=a*g;if(s=s*m+h*M,c=c*m+p*M,u=u*m+d*M,l=l*m+f*M,m===1-a){var w=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=w,c*=w,u*=w,l*=w}}t[e]=s,t[e+1]=c,t[e+2]=u,t[e+3]=l},multiplyQuaternionsFlat:function(t,e,n,r,i,o){var a=n[r],s=n[r+1],c=n[r+2],u=n[r+3],l=i[o],h=i[o+1],p=i[o+2],d=i[o+3];return t[e]=a*d+u*l+s*p-c*h,t[e+1]=s*d+u*h+c*l-a*p,t[e+2]=c*d+u*p+a*h-s*l,t[e+3]=u*d-a*l-s*h-c*p,t}}),Object.defineProperties(T.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(T.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("THREE.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),u=a(r/2),l=a(i/2),h=s(n/2),p=s(r/2),d=s(i/2);switch(o){case"XYZ":this._x=h*u*l+c*p*d,this._y=c*p*l-h*u*d,this._z=c*u*d+h*p*l,this._w=c*u*l-h*p*d;break;case"YXZ":this._x=h*u*l+c*p*d,this._y=c*p*l-h*u*d,this._z=c*u*d-h*p*l,this._w=c*u*l+h*p*d;break;case"ZXY":this._x=h*u*l-c*p*d,this._y=c*p*l+h*u*d,this._z=c*u*d+h*p*l,this._w=c*u*l-h*p*d;break;case"ZYX":this._x=h*u*l-c*p*d,this._y=c*p*l+h*u*d,this._z=c*u*d-h*p*l,this._w=c*u*l+h*p*d;break;case"YZX":this._x=h*u*l+c*p*d,this._y=c*p*l+h*u*d,this._z=c*u*d-h*p*l,this._w=c*u*l-h*p*d;break;case"XZY":this._x=h*u*l-c*p*d,this._y=c*p*l-h*u*d,this._z=c*u*d+h*p*l,this._w=c*u*l+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!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],u=n[2],l=n[6],h=n[10],p=r+s+h;return p>0?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(l-c)*e,this._y=(o-u)*e,this._z=(a-i)*e):r>s&&r>h?(e=2*Math.sqrt(1+r-s-h),this._w=(l-c)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+u)/e):s>h?(e=2*Math.sqrt(1+s-r-h),this._w=(o-u)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+h-r-s),this._w=(a-i)/e,this._x=(o+u)/e,this._y=(c+l)/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._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(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(g.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("THREE.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,u=e._w;return this._x=n*u+o*a+r*c-i*s,this._y=r*u+o*s+i*a-n*c,this._z=i*u+o*c+n*s-r*a,this._w=o*u-n*a-r*s-i*c,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*t._w+n*t._x+r*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var c=1-e;return this._w=c*o+e*this._w,this._x=c*n+e*this._x,this._y=c*r+e*this._y,this._z=c*i+e*this._z,this.normalize(),this._onChangeCallback(),this}var u=Math.sqrt(s),l=Math.atan2(u,a),h=Math.sin((1-e)*l)/u,p=Math.sin(e*l)/u;return this._w=o*h+this._w*p,this._x=n*h+this._x*p,this._y=r*h+this._y*p,this._z=i*h+this._z*p,this._onChangeCallback(),this},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},fromBufferAttribute:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var L=new P,A=new T;function P(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}Object.assign(P.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("THREE.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("THREE.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("THREE.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:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(A.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(A.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},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},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,u=s*n+a*e-i*r,l=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=c*s+h*-i+u*-a-l*-o,this.y=u*s+h*-o+l*-i-c*-a,this.z=l*s+h*-a+c*-o-u*-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.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this},cross:function(t,e){return void 0!==e?(console.warn("THREE.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.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return L.copy(this).projectOnVector(t),this.sub(L)},reflect:function(t){return this.sub(L.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(g.clamp(n,-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)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*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("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var R=new P,O=new j,N=new P(0,0,0),C=new P(1,1,1),I=new P,D=new P,z=new P;function j(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(j.prototype,{isMatrix4:!0,set:function(t,e,n,r,i,o,a,s,c,u,l,h,p,d,f,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=r,v[1]=i,v[5]=o,v[9]=a,v[13]=s,v[2]=c,v[6]=u,v[10]=l,v[14]=h,v[3]=p,v[7]=d,v[11]=f,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new j).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:function(t){var e=this.elements,n=t.elements,r=1/R.setFromMatrixColumn(t,0).length(),i=1/R.setFromMatrixColumn(t,1).length(),o=1/R.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){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,i=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var h=o*u,p=o*l,d=a*u,f=a*l;e[0]=s*u,e[4]=-s*l,e[8]=c,e[1]=p+d*c,e[5]=h-f*c,e[9]=-a*s,e[2]=f-h*c,e[6]=d+p*c,e[10]=o*s}else if("YXZ"===t.order){var m=s*u,v=s*l,g=c*u,y=c*l;e[0]=m+y*a,e[4]=g*a-v,e[8]=o*c,e[1]=o*l,e[5]=o*u,e[9]=-a,e[2]=v*a-g,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*u,v=s*l,g=c*u,y=c*l;e[0]=m-y*a,e[4]=-o*l,e[8]=g+v*a,e[1]=v+g*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){h=o*u,p=o*l,d=a*u,f=a*l;e[0]=s*u,e[4]=d*c-p,e[8]=h*c+f,e[1]=s*l,e[5]=f*c+h,e[9]=p*c-d,e[2]=-c,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var x=o*s,b=o*c,M=a*s,w=a*c;e[0]=s*u,e[4]=w-x*l,e[8]=M*l+b,e[1]=l,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=b*l+M,e[10]=x-w*l}else if("XZY"===t.order){x=o*s,b=o*c,M=a*s,w=a*c;e[0]=s*u,e[4]=-l,e[8]=c*u,e[1]=x*l+w,e[5]=o*u,e[9]=b*l-M,e[2]=M*l-b,e[6]=a*u,e[10]=w*l+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(N,t,C)},lookAt:function(t,e,n){var r=this.elements;return z.subVectors(t,e),0===z.lengthSq()&&(z.z=1),z.normalize(),I.crossVectors(n,z),0===I.lengthSq()&&(1===Math.abs(n.z)?z.x+=1e-4:z.z+=1e-4,z.normalize(),I.crossVectors(n,z)),I.normalize(),D.crossVectors(z,I),r[0]=I.x,r[4]=D.x,r[8]=z.x,r[1]=I.y,r[5]=D.y,r[9]=z.y,r[2]=I.z,r[6]=D.z,r[10]=z.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.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],u=n[1],l=n[5],h=n[9],p=n[13],d=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],x=n[11],b=n[15],M=r[0],w=r[4],_=r[8],S=r[12],E=r[1],T=r[5],L=r[9],A=r[13],P=r[2],R=r[6],O=r[10],N=r[14],C=r[3],I=r[7],D=r[11],z=r[15];return i[0]=o*M+a*E+s*P+c*C,i[4]=o*w+a*T+s*R+c*I,i[8]=o*_+a*L+s*O+c*D,i[12]=o*S+a*A+s*N+c*z,i[1]=u*M+l*E+h*P+p*C,i[5]=u*w+l*T+h*R+p*I,i[9]=u*_+l*L+h*O+p*D,i[13]=u*S+l*A+h*N+p*z,i[2]=d*M+f*E+m*P+v*C,i[6]=d*w+f*T+m*R+v*I,i[10]=d*_+f*L+m*O+v*D,i[14]=d*S+f*A+m*N+v*z,i[3]=g*M+y*E+x*P+b*C,i[7]=g*w+y*T+x*R+b*I,i[11]=g*_+y*L+x*O+b*D,i[15]=g*S+y*A+x*N+b*z,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},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],u=t[2],l=t[6],h=t[10],p=t[14];return t[3]*(+i*s*l-r*c*l-i*a*h+n*c*h+r*a*p-n*s*p)+t[7]*(+e*s*p-e*c*h+i*o*h-r*o*p+r*c*u-i*s*u)+t[11]*(+e*c*l-e*a*p-i*o*l+n*o*p+i*a*u-n*c*u)+t[15]*(-r*a*u-e*s*l+e*a*h+r*o*l-n*o*h+n*s*u)},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){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=t.elements,i=r[0],o=r[1],a=r[2],s=r[3],c=r[4],u=r[5],l=r[6],h=r[7],p=r[8],d=r[9],f=r[10],m=r[11],v=r[12],g=r[13],y=r[14],x=r[15],b=d*y*h-g*f*h+g*l*m-u*y*m-d*l*x+u*f*x,M=v*f*h-p*y*h-v*l*m+c*y*m+p*l*x-c*f*x,w=p*g*h-v*d*h+v*u*m-c*g*m-p*u*x+c*d*x,_=v*d*l-p*g*l-v*u*f+c*g*f+p*u*y-c*d*y,S=i*b+o*M+a*w+s*_;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var E=1/S;return n[0]=b*E,n[1]=(g*f*s-d*y*s-g*a*m+o*y*m+d*a*x-o*f*x)*E,n[2]=(u*y*s-g*l*s+g*a*h-o*y*h-u*a*x+o*l*x)*E,n[3]=(d*l*s-u*f*s-d*a*h+o*f*h+u*a*m-o*l*m)*E,n[4]=M*E,n[5]=(p*y*s-v*f*s+v*a*m-i*y*m-p*a*x+i*f*x)*E,n[6]=(v*l*s-c*y*s-v*a*h+i*y*h+c*a*x-i*l*x)*E,n[7]=(c*f*s-p*l*s+p*a*h-i*f*h-c*a*m+i*l*m)*E,n[8]=w*E,n[9]=(v*d*s-p*g*s-v*o*m+i*g*m+p*o*x-i*d*x)*E,n[10]=(c*g*s-v*u*s+v*o*h-i*g*h-c*o*x+i*u*x)*E,n[11]=(p*u*s-c*d*s-p*o*h+i*d*h+c*o*m-i*u*m)*E,n[12]=_*E,n[13]=(p*g*a-v*d*a+v*o*f-i*g*f-p*o*y+i*d*y)*E,n[14]=(v*u*a-c*g*a-v*o*l+i*g*l+c*o*y-i*u*y)*E,n[15]=(c*d*a-p*u*a+p*o*l-i*d*l-c*o*f+i*u*f)*E,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,u=i*a;return this.set(c*o+n,c*a-r*s,c*s+r*a,0,c*a+r*s,u*a+n,u*s-r*o,0,c*s-r*a,u*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,u=o+o,l=a+a,h=i*c,p=i*u,d=i*l,f=o*u,m=o*l,v=a*l,g=s*c,y=s*u,x=s*l,b=n.x,M=n.y,w=n.z;return r[0]=(1-(f+v))*b,r[1]=(p+x)*b,r[2]=(d-y)*b,r[3]=0,r[4]=(p-x)*M,r[5]=(1-(h+v))*M,r[6]=(m+g)*M,r[7]=0,r[8]=(d+y)*w,r[9]=(m-g)*w,r[10]=(1-(h+f))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this},decompose:function(t,e,n){var r=this.elements,i=R.set(r[0],r[1],r[2]).length(),o=R.set(r[4],r[5],r[6]).length(),a=R.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],O.copy(this);var s=1/i,c=1/o,u=1/a;return O.elements[0]*=s,O.elements[1]*=s,O.elements[2]*=s,O.elements[4]*=c,O.elements[5]*=c,O.elements[6]*=c,O.elements[8]*=u,O.elements[9]*=u,O.elements[10]*=u,e.setFromRotationMatrix(O),n.x=i,n.y=o,n.z=a,this},makePerspective:function(t,e,n,r,i,o){void 0===o&&console.warn("THREE.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),u=(e+t)/(e-t),l=(n+r)/(n-r),h=-(o+i)/(o-i),p=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,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),u=1/(o-i),l=(e+t)*s,h=(n+r)*c,p=(o+i)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-p,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 B=new j,k=new T;function F(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._order=r||F.DefaultOrder}function U(){this.mask=1}F.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],F.DefaultOrder="XYZ",Object.defineProperties(F.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(F.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=g.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],c=i[1],u=i[5],l=i[9],h=i[2],p=i[6],d=i[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(c,o));break;case"ZYX":this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,u));break;case"YZX":this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return B.makeRotationFromQuaternion(t),this.setFromRotationMatrix(B,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return k.setFromEuler(this),this.setFromQuaternion(k,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 P(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(U.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}});let G=0;const H=new P,V=new T,W=new j,q=new P,X=new P,Y=new P,J=new T,Z=new P(1,0,0),K=new P(0,1,0),Q=new P(0,0,1),$={type:"added"},tt={type:"removed"};function et(){Object.defineProperty(this,"id",{value:G++}),this.uuid=g.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=et.DefaultUp.clone();var t=new P,e=new F,n=new T,r=new P(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 j},normalMatrix:{value:new x}}),this.matrix=new j,this.matrixWorld=new j,this.matrixAutoUpdate=et.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new U,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function nt(){et.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}et.DefaultUp=new P(0,1,0),et.DefaultMatrixAutoUpdate=!0,et.prototype=Object.assign(Object.create(d.prototype),{constructor:et,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4: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},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return V.setFromAxisAngle(t,e),this.quaternion.multiply(V),this},rotateOnWorldAxis:function(t,e){return V.setFromAxisAngle(t,e),this.quaternion.premultiply(V),this},rotateX:function(t){return this.rotateOnAxis(Z,t)},rotateY:function(t){return this.rotateOnAxis(K,t)},rotateZ:function(t){return this.rotateOnAxis(Q,t)},translateOnAxis:function(t,e){return H.copy(t).applyQuaternion(this.quaternion),this.position.add(H.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(Z,t)},translateY:function(t){return this.translateOnAxis(K,t)},translateZ:function(t){return this.translateOnAxis(Q,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(W.getInverse(this.matrixWorld))},lookAt:function(t,e,n){t.isVector3?q.copy(t):q.set(t,e,n);var r=this.parent;this.updateWorldMatrix(!0,!1),X.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?W.lookAt(X,q,this.up):W.lookAt(q,X,this.up),this.quaternion.setFromRotationMatrix(W),r&&(W.extractRotation(r.matrixWorld),V.setFromRotationMatrix(W),this.quaternion.premultiply(V.inverse()))},add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent($)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){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,this.children.splice(n,1),t.dispatchEvent(tt)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),W.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),W.multiply(t.parent.matrixWorld)),t.applyMatrix4(W),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new P),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new T),this.updateMatrixWorld(!0),this.matrixWorld.decompose(X,t,Y),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new P),this.updateMatrixWorld(!0),this.matrixWorld.decompose(X,J,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new P),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(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),this.matrixWorldNeedsUpdate=!1,t=!0);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)},toJSON:function(t){var e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,c=a.length;s<c;s++){var u=a[s];i(t.shapes,u)}else i(t.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var l=[];for(s=0,c=this.material.length;s<c;s++)l.push(i(t.materials,this.material[s]));r.material=l}else r.material=i(t.materials,this.material);if(this.children.length>0){r.children=[];for(s=0;s<this.children.length;s++)r.children.push(this.children[s].toJSON(t).object)}if(e){var h=m(t.geometries),p=m(t.materials),d=m(t.textures),f=m(t.images);a=m(t.shapes);h.length>0&&(n.geometries=h),p.length>0&&(n.materials=p),d.length>0&&(n.textures=d),f.length>0&&(n.images=f),a.length>0&&(n.shapes=a)}return n.object=r,n;function m(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}},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}}),nt.prototype=Object.assign(Object.create(et.prototype),{constructor:nt,isScene:!0,copy:function(t,e){return et.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=et.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});var rt=[new P,new P,new P,new P,new P,new P,new P,new P],it=new P,ot=new vt,at=new P,st=new P,ct=new P,ut=new P,lt=new P,ht=new P,pt=new P,dt=new P,ft=new P,mt=new P;function vt(t,e){this.min=void 0!==t?t:new P(1/0,1/0,1/0),this.max=void 0!==e?e:new P(-1/0,-1/0,-1/0)}function gt(t,e,n,r,i){var o,a;for(o=0,a=t.length-3;o<=a;o+=3){mt.fromArray(t,o);var s=i.x*Math.abs(mt.x)+i.y*Math.abs(mt.y)+i.z*Math.abs(mt.z),c=e.dot(mt),u=n.dot(mt),l=r.dot(mt);if(Math.max(-Math.max(c,u,l),Math.min(c,u,l))>s)return!1}return!0}Object.assign(vt.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 u=t[s],l=t[s+1],h=t[s+2];u<e&&(e=u),l<n&&(n=l),h<r&&(r=h),u>i&&(i=u),l>o&&(o=l),h>a&&(a=h)}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 u=t.getX(s),l=t.getY(s),h=t.getZ(s);u<e&&(e=u),l<n&&(n=l),h<r&&(r=h),u>i&&(i=u),l>o&&(o=l),h>a&&(a=h)}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:function(t,e){var n=it.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("THREE.Box3: .getCenter() target is now required"),t=new P),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new P),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:function(t){t.updateWorldMatrix(!1,!1);var e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),ot.copy(e.boundingBox),ot.applyMatrix4(t.matrixWorld),this.union(ot));for(var n=t.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return 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("THREE.Box3: .getParameter() target is now required"),e=new P),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:function(t){return this.clampPoint(t.center,it),it.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(pt),dt.subVectors(this.max,pt),at.subVectors(t.a,pt),st.subVectors(t.b,pt),ct.subVectors(t.c,pt),ut.subVectors(st,at),lt.subVectors(ct,st),ht.subVectors(at,ct);var e=[0,-ut.z,ut.y,0,-lt.z,lt.y,0,-ht.z,ht.y,ut.z,0,-ut.x,lt.z,0,-lt.x,ht.z,0,-ht.x,-ut.y,ut.x,0,-lt.y,lt.x,0,-ht.y,ht.x,0];return!!gt(e,at,st,ct,dt)&&(!!gt(e=[1,0,0,0,1,0,0,0,1],at,st,ct,dt)&&(ft.crossVectors(ut,lt),gt(e=[ft.x,ft.y,ft.z],at,st,ct,dt)))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new P),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return it.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(it).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:function(t){return this.isEmpty()||(rt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),rt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),rt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),rt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),rt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),rt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),rt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),rt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(rt)),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)}});var yt=new vt;function xt(t,e){this.center=void 0!==t?t:new P,this.radius=void 0!==e?e:-1}Object.assign(xt.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var n=this.center;void 0!==e?n.copy(e):yt.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},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},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("THREE.Sphere: .clampPoint() target is now required"),e=new P),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("THREE.Sphere: .getBoundingBox() target is now required"),t=new vt),this.isEmpty()?(t.makeEmpty(),t):(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}});var bt=new P,Mt=new P,wt=new P,_t=new P,St=new P,Et=new P,Tt=new P;function Lt(t,e){this.origin=void 0!==t?t:new P,this.direction=void 0!==e?e:new P(0,0,-1)}Object.assign(Lt.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("THREE.Ray: .at() target is now required"),e=new P),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,bt)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new P),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:function(t){var e=bt.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(bt.copy(this.direction).multiplyScalar(e).add(this.origin),bt.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,r){Mt.copy(t).add(e).multiplyScalar(.5),wt.copy(e).sub(t).normalize(),_t.copy(this.origin).sub(Mt);var i,o,a,s,c=.5*t.distanceTo(e),u=-this.direction.dot(wt),l=_t.dot(this.direction),h=-_t.dot(wt),p=_t.lengthSq(),d=Math.abs(1-u*u);if(d>0)if(o=u*l-h,s=c*d,(i=u*h-l)>=0)if(o>=-s)if(o<=s){var f=1/d;a=(i*=f)*(i+u*(o*=f)+2*l)+o*(u*i+o+2*h)+p}else o=c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+p;else o=-c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+p;else o<=-s?a=-(i=Math.max(0,-(-u*c+l)))*i+(o=i>0?-c:Math.min(Math.max(-c,-h),c))*(o+2*h)+p:o<=s?(i=0,a=(o=Math.min(Math.max(-c,-h),c))*(o+2*h)+p):a=-(i=Math.max(0,-(u*c+l)))*i+(o=i>0?c:Math.min(Math.max(-c,-h),c))*(o+2*h)+p;else o=u>0?-c:c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+p;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(wt).multiplyScalar(o).add(Mt),a},intersectSphere:function(t,e){bt.subVectors(t.center,this.origin);var n=bt.dot(this.direction),r=bt.dot(bt)-n*n,i=t.radius*t.radius;if(r>i)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 n>=0?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,u=1/this.direction.y,l=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,r=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,r=(t.min.x-h.x)*c),u>=0?(i=(t.min.y-h.y)*u,o=(t.max.y-h.y)*u):(i=(t.max.y-h.y)*u,o=(t.min.y-h.y)*u),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),l>=0?(a=(t.min.z-h.z)*l,s=(t.max.z-h.z)*l):(a=(t.max.z-h.z)*l,s=(t.min.z-h.z)*l),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,bt)},intersectTriangle:function(t,e,n,r,i){St.subVectors(e,t),Et.subVectors(n,t),Tt.crossVectors(St,Et);var o,a=this.direction.dot(Tt);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}_t.subVectors(this.origin,t);var s=o*this.direction.dot(Et.crossVectors(_t,Et));if(s<0)return null;var c=o*this.direction.dot(St.cross(_t));if(c<0)return null;if(s+c>a)return null;var u=-o*_t.dot(Tt);return u<0?null:this.at(u/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)}});var At=new P,Pt=new P,Rt=new x;function Ot(t,e){this.normal=void 0!==t?t:new P(1,0,0),this.constant=void 0!==e?e:0}Object.assign(Ot.prototype,{isPlane:!0,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:function(t,e,n){var r=At.subVectors(n,e).cross(Pt.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("THREE.Plane: .projectPoint() target is now required"),e=new P),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new P);var n=t.delta(At),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||i>1?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&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new P),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var n=e||Rt.getNormalMatrix(t),r=this.coplanarPoint(At).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}});var Nt=new P,Ct=new P,It=new P,Dt=new P,zt=new P,jt=new P,Bt=new P,kt=new P,Ft=new P,Ut=new P;function Gt(t,e,n){this.a=void 0!==t?t:new P,this.b=void 0!==e?e:new P,this.c=void 0!==n?n:new P}Object.assign(Gt,{getNormal:function(t,e,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new P),r.subVectors(n,e),Nt.subVectors(t,e),r.cross(Nt);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(t,e,n,r,i){Nt.subVectors(r,e),Ct.subVectors(n,e),It.subVectors(t,e);var o=Nt.dot(Nt),a=Nt.dot(Ct),s=Nt.dot(It),c=Ct.dot(Ct),u=Ct.dot(It),l=o*c-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new P),0===l)return i.set(-2,-1,-1);var h=1/l,p=(c*s-a*u)*h,d=(o*u-a*s)*h;return i.set(1-p-d,d,p)},containsPoint:function(t,e,n,r){return Gt.getBarycoord(t,e,n,r,Dt),Dt.x>=0&&Dt.y>=0&&Dt.x+Dt.y<=1},getUV:function(t,e,n,r,i,o,a,s){return this.getBarycoord(t,e,n,r,Dt),s.set(0,0),s.addScaledVector(i,Dt.x),s.addScaledVector(o,Dt.y),s.addScaledVector(a,Dt.z),s},isFrontFacing:function(t,e,n,r){return Nt.subVectors(n,e),Ct.subVectors(t,e),Nt.cross(Ct).dot(r)<0}}),Object.assign(Gt.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:function(){return Nt.subVectors(this.c,this.b),Ct.subVectors(this.a,this.b),.5*Nt.cross(Ct).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new P),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Gt.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Ot),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Gt.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,r,i){return Gt.getUV(t,this.a,this.b,this.c,e,n,r,i)},containsPoint:function(t){return Gt.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return Gt.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new P);var n,r,i=this.a,o=this.b,a=this.c;zt.subVectors(o,i),jt.subVectors(a,i),kt.subVectors(t,i);var s=zt.dot(kt),c=jt.dot(kt);if(s<=0&&c<=0)return e.copy(i);Ft.subVectors(t,o);var u=zt.dot(Ft),l=jt.dot(Ft);if(u>=0&&l<=u)return e.copy(o);var h=s*l-u*c;if(h<=0&&s>=0&&u<=0)return n=s/(s-u),e.copy(i).addScaledVector(zt,n);Ut.subVectors(t,a);var p=zt.dot(Ut),d=jt.dot(Ut);if(d>=0&&p<=d)return e.copy(a);var f=p*c-s*d;if(f<=0&&c>=0&&d<=0)return r=c/(c-d),e.copy(i).addScaledVector(jt,r);var m=u*d-p*l;if(m<=0&&l-u>=0&&p-d>=0)return Bt.subVectors(a,o),r=(l-u)/(l-u+(p-d)),e.copy(o).addScaledVector(Bt,r);var v=1/(m+f+h);return n=f*v,r=h*v,e.copy(i).addScaledVector(zt,n).addScaledVector(jt,r)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var Ht={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Vt={h:0,s:0,l:0},Wt={h:0,s:0,l:0};function qt(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function Xt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function Yt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Jt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Zt(t,e,n,r,i,o){this.a=t,this.b=e,this.c=n,this.normal=r&&r.isVector3?r:new P,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new qt,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}Object.assign(qt.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=g.euclideanModulo(t,1),e=g.clamp(e,0,1),n=g.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=Xt(i,r,t+1/3),this.g=Xt(i,r,t),this.b=Xt(i,r,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(a,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u=n[1],l=u.length;if(3===l)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){var e=Ht[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},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=e>0?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=Yt(t.r),this.g=Yt(t.g),this.b=Yt(t.b),this},copyLinearToSRGB:function(t){return this.r=Jt(t.r),this.g=Jt(t.g),this.b=Jt(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){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),c=(s+a)/2;if(s===a)e=0,n=0;else{var u=a-s;switch(n=c<=.5?u/(a+s):u/(2-a-s),a){case r:e=(i-o)/u+(i<o?6:0);break;case i:e=(o-r)/u+2;break;case o:e=(r-i)/u+4}e/=6}return t.h=e,t.s=n,t.l=c,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,n){return this.getHSL(Vt),Vt.h+=t,Vt.s+=e,Vt.l+=n,this.setHSL(Vt.h,Vt.s,Vt.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:function(t,e){this.getHSL(Vt),t.getHSL(Wt);var n=g.lerp(Vt.h,Wt.h,e),r=g.lerp(Vt.s,Wt.s,e),i=g.lerp(Vt.l,Wt.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()}}),qt.NAMES=Ht,Object.assign(Zt.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var Kt=0;function Qt(){Object.defineProperty(this,"id",{value:Kt++}),this.uuid=g.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexColors=!1,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.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function $t(t){Qt.call(this),this.type="MeshBasicMaterial",this.color=new qt(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.setValues(t)}Qt.prototype=Object.assign(Object.create(d.prototype),{constructor:Qt,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("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var i=r(t.textures),o=r(t.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Qt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),$t.prototype=Object.create(Qt.prototype),$t.prototype.constructor=$t,$t.prototype.isMeshBasicMaterial=!0,$t.prototype.copy=function(t){return Qt.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};var te=new P;function ee(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.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.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function ne(t,e,n){ee.call(this,new Int8Array(t),e,n)}function re(t,e,n){ee.call(this,new Uint8Array(t),e,n)}function ie(t,e,n){ee.call(this,new Uint8ClampedArray(t),e,n)}function oe(t,e,n){ee.call(this,new Int16Array(t),e,n)}function ae(t,e,n){ee.call(this,new Uint16Array(t),e,n)}function se(t,e,n){ee.call(this,new Int32Array(t),e,n)}function ce(t,e,n){ee.call(this,new Uint32Array(t),e,n)}function ue(t,e,n){ee.call(this,new Float32Array(t),e,n)}function le(t,e,n){ee.call(this,new Float64Array(t),e,n)}function he(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function pe(t){if(0===t.length)return-1/0;let e=t[0];for(let n=1,r=t.length;n<r;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(ee.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(ee.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=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.usage=t.usage,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("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new qt),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("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new y),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("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new P),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("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new _),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},applyMatrix3:function(t){for(var e=0,n=this.count;e<n;e++)te.x=this.getX(e),te.y=this.getY(e),te.z=this.getZ(e),te.applyMatrix3(t),this.setXYZ(e,te.x,te.y,te.z);return this},applyMatrix4:function(t){for(var e=0,n=this.count;e<n;e++)te.x=this.getX(e),te.y=this.getY(e),te.z=this.getZ(e),te.applyMatrix4(t),this.setXYZ(e,te.x,te.y,te.z);return this},applyNormalMatrix:function(t){for(var e=0,n=this.count;e<n;e++)te.x=this.getX(e),te.y=this.getY(e),te.z=this.getZ(e),te.applyNormalMatrix(t),this.setXYZ(e,te.x,te.y,te.z);return this},transformDirection:function(t){for(var e=0,n=this.count;e<n;e++)te.x=this.getX(e),te.y=this.getY(e),te.z=this.getZ(e),te.transformDirection(t),this.setXYZ(e,te.x,te.y,te.z);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}}}),ne.prototype=Object.create(ee.prototype),ne.prototype.constructor=ne,re.prototype=Object.create(ee.prototype),re.prototype.constructor=re,ie.prototype=Object.create(ee.prototype),ie.prototype.constructor=ie,oe.prototype=Object.create(ee.prototype),oe.prototype.constructor=oe,ae.prototype=Object.create(ee.prototype),ae.prototype.constructor=ae,se.prototype=Object.create(ee.prototype),se.prototype.constructor=se,ce.prototype=Object.create(ee.prototype),ce.prototype.constructor=ce,ue.prototype=Object.create(ee.prototype),ue.prototype.constructor=ue,le.prototype=Object.create(ee.prototype),le.prototype.constructor=le,Object.assign(he.prototype,{computeGroups:function(t){for(var e,n=[],r=void 0,i=t.faces,o=0;o<i.length;o++){var a=i[o];a.materialIndex!==r&&(r=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:r})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,r=t.vertices,i=t.faceVertexUvs,o=i[0]&&i[0].length>0,a=i[1]&&i[1].length>0,s=t.morphTargets,c=s.length;if(c>0){e=[];for(var u=0;u<c;u++)e[u]={name:s[u].name,data:[]};this.morphTargets.position=e}var l,h=t.morphNormals,p=h.length;if(p>0){l=[];for(u=0;u<p;u++)l[u]={name:h[u].name,data:[]};this.morphTargets.normal=l}var d=t.skinIndices,f=t.skinWeights,m=d.length===r.length,v=f.length===r.length;r.length>0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(u=0;u<n.length;u++){var g=n[u];this.vertices.push(r[g.a],r[g.b],r[g.c]);var x=g.vertexNormals;if(3===x.length)this.normals.push(x[0],x[1],x[2]);else{var b=g.normal;this.normals.push(b,b,b)}var M,w=g.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var _=g.color;this.colors.push(_,_,_)}if(!0===o)void 0!==(M=i[0][u])?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new y,new y,new y));if(!0===a)void 0!==(M=i[1][u])?this.uvs2.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new y,new y,new y));for(var S=0;S<c;S++){var E=s[S].vertices;e[S].data.push(E[g.a],E[g.b],E[g.c])}for(S=0;S<p;S++){var T=h[S].vertexNormals[u];l[S].data.push(T.a,T.b,T.c)}m&&this.skinIndices.push(d[g.a],d[g.b],d[g.c]),v&&this.skinWeights.push(f[g.a],f[g.b],f[g.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var de=1,fe=new j,me=new et,ve=new P,ge=new vt,ye=new vt,xe=new P;function be(){Object.defineProperty(this,"id",{value:de+=2}),this.uuid=g.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}be.prototype=Object.assign(Object.create(d.prototype),{constructor:be,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(pe(t)>65535?ce:ae)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute: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},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new x).getNormalMatrix(t);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return fe.makeRotationX(t),this.applyMatrix4(fe),this},rotateY:function(t){return fe.makeRotationY(t),this.applyMatrix4(fe),this},rotateZ:function(t){return fe.makeRotationZ(t),this.applyMatrix4(fe),this},translate:function(t,e,n){return fe.makeTranslation(t,e,n),this.applyMatrix4(fe),this},scale:function(t,e,n){return fe.makeScale(t,e,n),this.applyMatrix4(fe),this},lookAt:function(t){return me.lookAt(t),me.updateMatrix(),this.applyMatrix4(me.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ve).negate(),this.translate(ve.x,ve.y,ve.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new ue(3*e.vertices.length,3),r=new ue(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new ue(e.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},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.setAttribute("position",new ue(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new he).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new ee(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new ee(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var r=new Float32Array(3*t.colors.length);this.setAttribute("color",new ee(r,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new ee(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new ee(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],c=t.morphTargets[a],u=0,l=c.length;u<l;u++){var h=c[u],p=new ue(3*h.data.length,3);p.name=h.name,s.push(p.copyVector3sArray(h.data))}this.morphAttributes[a]=s}if(t.skinIndices.length>0){var d=new ue(4*t.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new ue(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new vt);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];ge.setFromBufferAttribute(i),this.morphTargetsRelative?(xe.addVectors(this.boundingBox.min,ge.min),this.boundingBox.expandByPoint(xe),xe.addVectors(this.boundingBox.max,ge.max),this.boundingBox.expandByPoint(xe)):(this.boundingBox.expandByPoint(ge.min),this.boundingBox.expandByPoint(ge.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new xt);var t=this.attributes.position,e=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(ge.setFromBufferAttribute(t),e)for(var r=0,i=e.length;r<i;r++){var o=e[r];ye.setFromBufferAttribute(o),this.morphTargetsRelative?(xe.addVectors(ge.min,ye.min),ge.expandByPoint(xe),xe.addVectors(ge.max,ye.max),ge.expandByPoint(xe)):(ge.expandByPoint(ye.min),ge.expandByPoint(ye.max))}ge.getCenter(n);var a=0;for(r=0,i=t.count;r<i;r++)xe.fromBufferAttribute(t,r),a=Math.max(a,n.distanceToSquared(xe));if(e)for(r=0,i=e.length;r<i;r++){o=e[r];for(var s=this.morphTargetsRelative,c=0,u=o.count;c<u;c++)xe.fromBufferAttribute(o,c),s&&(ve.fromBufferAttribute(t,c),xe.add(ve)),a=Math.max(a,n.distanceToSquared(xe))}this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.setAttribute("normal",new ee(new Float32Array(n.length),3));else for(var r=e.normal.array,i=0,o=r.length;i<o;i++)r[i]=0;var a,s,c,u=e.normal.array,l=new P,h=new P,p=new P,d=new P,f=new P;if(t){var m=t.array;for(i=0,o=t.count;i<o;i+=3)a=3*m[i+0],s=3*m[i+1],c=3*m[i+2],l.fromArray(n,a),h.fromArray(n,s),p.fromArray(n,c),d.subVectors(p,h),f.subVectors(l,h),d.cross(f),u[a]+=d.x,u[a+1]+=d.y,u[a+2]+=d.z,u[s]+=d.x,u[s+1]+=d.y,u[s+2]+=d.z,u[c]+=d.x,u[c+1]+=d.y,u[c+2]+=d.z}else for(i=0,o=n.length;i<o;i+=9)l.fromArray(n,i),h.fromArray(n,i+3),p.fromArray(n,i+6),d.subVectors(p,h),f.subVectors(l,h),d.cross(f),u[i]=d.x,u[i+1]=d.y,u[i+2]=d.z,u[i+3]=d.x,u[i+4]=d.y,u[i+5]=d.z,u[i+6]=d.x,u[i+7]=d.y,u[i+8]=d.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.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),u=0,l=s;u<c;u++,l++)i[l]=a[u];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals: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=t.normalized,o=new n.constructor(e.length*r),a=0,s=0,c=0,u=e.length;c<u;c++){a=e[c]*r;for(var l=0;l<r;l++)o[s++]=n[a++]}return new ee(o,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new be,n=this.index.array,r=this.attributes;for(var i in r){var o=t(r[i],n);e.setAttribute(i,o)}var a=this.morphAttributes;for(i in a){for(var s=[],c=a[i],u=0,l=c.length;u<l;u++){o=t(c[u],n);s.push(o)}e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,p=(u=0,h.length);u<p;u++){var d=h[u];e.addGroup(d.start,d.count,d.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var r=this.index;null!==r&&(t.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var o=(p=i[n]).toJSON();""!==p.name&&(o.name=p.name),t.data.attributes[n]=o}var a={},s=!1;for(var n in this.morphAttributes){for(var c=this.morphAttributes[n],u=[],l=0,h=c.length;l<h;l++){var p;o=(p=c[l]).toJSON();""!==p.name&&(o.name=p.name),u.push(o)}u.length>0&&(a[n]=u,s=!0)}s&&(t.data.morphAttributes=a,t.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(t.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new be).copy(this)},copy:function(t){var e,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var o=t.attributes;for(e in o){var a=o[e];this.setAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var c=[],u=s[e];for(n=0,r=u.length;n<r;n++)c.push(u[n].clone());this.morphAttributes[e]=c}this.morphTargetsRelative=t.morphTargetsRelative;var l=t.groups;for(n=0,r=l.length;n<r;n++){var h=l[n];this.addGroup(h.start,h.count,h.materialIndex)}var p=t.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=t.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Me=new j,we=new Lt,_e=new xt,Se=new P,Ee=new P,Te=new P,Le=new P,Ae=new P,Pe=new P,Re=new P,Oe=new P,Ne=new P,Ce=new y,Ie=new y,De=new y,ze=new P,je=new P;function Be(t,e){et.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new be,this.material=void 0!==e?e:new $t,this.updateMorphTargets()}function ke(t,e,n,r,i,o,a,s){if(null===(1===e.side?r.intersectTriangle(a,o,i,!0,s):r.intersectTriangle(i,o,a,2!==e.side,s)))return null;je.copy(s),je.applyMatrix4(t.matrixWorld);var c=n.ray.origin.distanceTo(je);return c<n.near||c>n.far?null:{distance:c,point:je.clone(),object:t}}function Fe(t,e,n,r,i,o,a,s,c,u,l,h){Se.fromBufferAttribute(i,u),Ee.fromBufferAttribute(i,l),Te.fromBufferAttribute(i,h);var p=t.morphTargetInfluences;if(e.morphTargets&&o&&p){Re.set(0,0,0),Oe.set(0,0,0),Ne.set(0,0,0);for(var d=0,f=o.length;d<f;d++){var m=p[d],v=o[d];0!==m&&(Le.fromBufferAttribute(v,u),Ae.fromBufferAttribute(v,l),Pe.fromBufferAttribute(v,h),a?(Re.addScaledVector(Le,m),Oe.addScaledVector(Ae,m),Ne.addScaledVector(Pe,m)):(Re.addScaledVector(Le.sub(Se),m),Oe.addScaledVector(Ae.sub(Ee),m),Ne.addScaledVector(Pe.sub(Te),m)))}Se.add(Re),Ee.add(Oe),Te.add(Ne)}t.isSkinnedMesh&&(t.boneTransform(u,Se),t.boneTransform(l,Ee),t.boneTransform(h,Te));var g=ke(t,e,n,r,Se,Ee,Te,ze);if(g){s&&(Ce.fromBufferAttribute(s,u),Ie.fromBufferAttribute(s,l),De.fromBufferAttribute(s,h),g.uv=Gt.getUV(ze,Se,Ee,Te,Ce,Ie,De,new y)),c&&(Ce.fromBufferAttribute(c,u),Ie.fromBufferAttribute(c,l),De.fromBufferAttribute(c,h),g.uv2=Gt.getUV(ze,Se,Ee,Te,Ce,Ie,De,new y));var x=new Zt(u,l,h);Gt.getNormal(Se,Ee,Te,x.normal),g.face=x}return g}Be.prototype=Object.assign(Object.create(et.prototype),{constructor:Be,isMesh:!0,copy:function(t){return et.prototype.copy.call(this,t),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(o.length>0){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&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),_e.copy(r.boundingSphere),_e.applyMatrix4(o),!1!==t.ray.intersectsSphere(_e)&&(Me.getInverse(o),we.copy(t.ray).applyMatrix4(Me),null===r.boundingBox||!1!==we.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a,s,c,u,l,h,p,d,f,m=r.index,v=r.attributes.position,g=r.morphAttributes.position,x=r.morphTargetsRelative,b=r.attributes.uv,M=r.attributes.uv2,w=r.groups,_=r.drawRange;if(null!==m)if(Array.isArray(i))for(u=0,h=w.length;u<h;u++)for(f=i[(d=w[u]).materialIndex],l=Math.max(d.start,_.start),p=Math.min(d.start+d.count,_.start+_.count);l<p;l+=3)a=m.getX(l),s=m.getX(l+1),c=m.getX(l+2),(n=Fe(this,f,t,we,v,g,x,b,M,a,s,c))&&(n.faceIndex=Math.floor(l/3),n.face.materialIndex=d.materialIndex,e.push(n));else for(u=Math.max(0,_.start),h=Math.min(m.count,_.start+_.count);u<h;u+=3)a=m.getX(u),s=m.getX(u+1),c=m.getX(u+2),(n=Fe(this,i,t,we,v,g,x,b,M,a,s,c))&&(n.faceIndex=Math.floor(u/3),e.push(n));else if(void 0!==v)if(Array.isArray(i))for(u=0,h=w.length;u<h;u++)for(f=i[(d=w[u]).materialIndex],l=Math.max(d.start,_.start),p=Math.min(d.start+d.count,_.start+_.count);l<p;l+=3)(n=Fe(this,f,t,we,v,g,x,b,M,a=l,s=l+1,c=l+2))&&(n.faceIndex=Math.floor(l/3),n.face.materialIndex=d.materialIndex,e.push(n));else for(u=Math.max(0,_.start),h=Math.min(v.count,_.start+_.count);u<h;u+=3)(n=Fe(this,i,t,we,v,g,x,b,M,a=u,s=u+1,c=u+2))&&(n.faceIndex=Math.floor(u/3),e.push(n))}else if(r.isGeometry){var S,E,T,L,A=Array.isArray(i),P=r.vertices,R=r.faces,O=r.faceVertexUvs[0];O.length>0&&(L=O);for(var N=0,C=R.length;N<C;N++){var I=R[N],D=A?i[I.materialIndex]:i;if(void 0!==D&&(S=P[I.a],E=P[I.b],T=P[I.c],n=ke(this,D,t,we,S,E,T,ze))){if(L&&L[N]){var z=L[N];Ce.copy(z[0]),Ie.copy(z[1]),De.copy(z[2]),n.uv=Gt.getUV(ze,S,E,T,Ce,Ie,De,new y)}n.face=I,n.faceIndex=N,e.push(n)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Ue=0,Ge=new j,He=new et,Ve=new P;function We(){Object.defineProperty(this,"id",{value:Ue+=2}),this.uuid=g.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}We.prototype=Object.assign(Object.create(d.prototype),{constructor:We,isGeometry:!0,applyMatrix4:function(t){for(var e=(new x).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},rotateX:function(t){return Ge.makeRotationX(t),this.applyMatrix4(Ge),this},rotateY:function(t){return Ge.makeRotationY(t),this.applyMatrix4(Ge),this},rotateZ:function(t){return Ge.makeRotationZ(t),this.applyMatrix4(Ge),this},translate:function(t,e,n){return Ge.makeTranslation(t,e,n),this.applyMatrix4(Ge),this},scale:function(t,e,n){return Ge.makeScale(t,e,n),this.applyMatrix4(Ge),this},lookAt:function(t){return He.lookAt(t),He.updateMatrix(),this.applyMatrix4(He.matrix),this},fromBufferGeometry:function(t){var e=this,n=null!==t.index?t.index.array:void 0,r=t.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var i=r.position.array,o=void 0!==r.normal?r.normal.array:void 0,a=void 0!==r.color?r.color.array:void 0,s=void 0!==r.uv?r.uv.array:void 0,c=void 0!==r.uv2?r.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var u=0;u<i.length;u+=3)e.vertices.push((new P).fromArray(i,u)),void 0!==a&&e.colors.push((new qt).fromArray(a,u));function l(t,n,r,i){var u=void 0===a?[]:[e.colors[t].clone(),e.colors[n].clone(),e.colors[r].clone()],l=new Zt(t,n,r,void 0===o?[]:[(new P).fromArray(o,3*t),(new P).fromArray(o,3*n),(new P).fromArray(o,3*r)],u,i);e.faces.push(l),void 0!==s&&e.faceVertexUvs[0].push([(new y).fromArray(s,2*t),(new y).fromArray(s,2*n),(new y).fromArray(s,2*r)]),void 0!==c&&e.faceVertexUvs[1].push([(new y).fromArray(c,2*t),(new y).fromArray(c,2*n),(new y).fromArray(c,2*r)])}var h=t.groups;if(h.length>0)for(u=0;u<h.length;u++)for(var p=h[u],d=p.start,f=d,m=d+p.count;f<m;f+=3)void 0!==n?l(n[f],n[f+1],n[f+2],p.materialIndex):l(f,f+1,f+2,p.materialIndex);else if(void 0!==n)for(u=0;u<n.length;u+=3)l(n[u],n[u+1],n[u+2]);else for(u=0;u<i.length/3;u+=3)l(u,u+1,u+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ve).negate(),this.translate(Ve.x,Ve.y,Ve.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,r=new j;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.applyMatrix4(r),this},computeFaceNormals:function(){for(var t=new P,e=new P,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 P;if(t){var s,c,u,l=new P,h=new P;for(r=0,i=this.faces.length;r<i;r++)o=this.faces[r],s=this.vertices[o.a],c=this.vertices[o.b],u=this.vertices[o.c],l.subVectors(u,c),h.subVectors(s,c),l.cross(h),a[o.a].add(l),a[o.b].add(l),a[o.c].add(l)}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 p=(o=this.faces[r]).vertexNormals;3===p.length?(p[0].copy(a[o.a]),p[1].copy(a[o.b]),p[2].copy(a[o.c])):(p[0]=a[o.a].clone(),p[1]=a[o.b].clone(),p[2]=a[o.c].clone())}this.faces.length>0&&(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())}this.faces.length>0&&(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 We;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 P,u={a:new P,b:new P,c:new P},a.push(c),s.push(u)}var c,u,l=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=l.faceNormals[n],u=l.vertexNormals[n],c.copy(i.normal),u.a.copy(i.vertexNormals[0]),u.b.copy(i.vertexNormals[1]),u.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 vt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new xt),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var r,i=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,c=t.faces,u=this.colors,l=t.colors;void 0===n&&(n=0),void 0!==e&&(r=(new x).getNormalMatrix(e));for(var h=0,p=a.length;h<p;h++){var d=a[h].clone();void 0!==e&&d.applyMatrix4(e),o.push(d)}for(h=0,p=l.length;h<p;h++)u.push(l[h].clone());for(h=0,p=c.length;h<p;h++){var f,m,v,g=c[h],y=g.vertexNormals,b=g.vertexColors;(f=new Zt(g.a+i,g.b+i,g.c+i)).normal.copy(g.normal),void 0!==r&&f.normal.applyMatrix3(r).normalize();for(var M=0,w=y.length;M<w;M++)m=y[M].clone(),void 0!==r&&m.applyMatrix3(r).normalize(),f.vertexNormals.push(m);f.color.copy(g.color);for(M=0,w=b.length;M<w;M++)v=b[M],f.vertexColors.push(v.clone());f.materialIndex=g.materialIndex+n,s.push(f)}for(h=0,p=t.faceVertexUvs.length;h<p;h++){var _=t.faceVertexUvs[h];void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]);for(M=0,w=_.length;M<w;M++){for(var S=_[M],E=[],T=0,L=S.length;T<L;T++)E.push(S[T].clone());this.faceVertexUvs[h].push(E)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){var t,e,n,r,i,o,a,s,c={},u=[],l=[],h=Math.pow(10,4);for(n=0,r=this.vertices.length;n<r;n++)t=this.vertices[n],void 0===c[e=Math.round(t.x*h)+"_"+Math.round(t.y*h)+"_"+Math.round(t.z*h)]?(c[e]=n,u.push(this.vertices[n]),l[n]=u.length-1):l[n]=l[c[e]];var p=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=l[i.a],i.b=l[i.b],i.c=l[i.c],o=[i.a,i.b,i.c];for(var d=0;d<3;d++)if(o[d]===o[(d+1)%3]){p.push(n);break}}for(n=p.length-1;n>=0;n--){var f=p[n];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(f,1)}var m=this.vertices.length-u.length;return this.vertices=u,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var r=t[e];this.vertices.push(new P(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort((function(t,e){return t.materialIndex-e.materialIndex}));var r,i,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===e&&(r=[]),a&&a.length===e&&(i=[]);for(n=0;n<e;n++){var s=t[n]._id;r&&r.push(o[s]),i&&i.push(a[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}for(var r=[],i=0;i<this.vertices.length;i++){var o=this.vertices[i];r.push(o.x,o.y,o.z)}var a=[],s=[],c={},u=[],l={},h=[],p={};for(i=0;i<this.faces.length;i++){var d=this.faces[i],f=void 0!==this.faceVertexUvs[0][i],m=d.normal.length()>0,v=d.vertexNormals.length>0,g=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=d.vertexColors.length>0,x=0;if(x=_(x,0,0),x=_(x,1,!0),x=_(x,2,!1),x=_(x,3,f),x=_(x,4,m),x=_(x,5,v),x=_(x,6,g),x=_(x,7,y),a.push(x),a.push(d.a,d.b,d.c),a.push(d.materialIndex),f){var b=this.faceVertexUvs[0][i];a.push(T(b[0]),T(b[1]),T(b[2]))}if(m&&a.push(S(d.normal)),v){var M=d.vertexNormals;a.push(S(M[0]),S(M[1]),S(M[2]))}if(g&&a.push(E(d.color)),y){var w=d.vertexColors;a.push(E(w[0]),E(w[1]),E(w[2]))}}function _(t,e,n){return n?t|1<<e:t&~(1<<e)}function S(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==c[e]||(c[e]=s.length/3,s.push(t.x,t.y,t.z)),c[e]}function E(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==l[e]||(l[e]=u.length,u.push(t.getHex())),l[e]}function T(t){var e=t.x.toString()+t.y.toString();return void 0!==p[e]||(p[e]=h.length/2,h.push(t.x,t.y)),p[e]}return t.data={},t.data.vertices=r,t.data.normals=s,u.length>0&&(t.data.colors=u),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new We).copy(this)},copy:function(t){var e,n,r,i,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var c=t.colors;for(e=0,n=c.length;e<n;e++)this.colors.push(c[e].clone());var u=t.faces;for(e=0,n=u.length;e<n;e++)this.faces.push(u[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var l=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),r=0,i=l.length;r<i;r++){var h=l[r],p=[];for(o=0,a=h.length;o<a;o++){var d=h[o];p.push(d.clone())}this.faceVertexUvs[e].push(p)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],r=0,i=f[e].vertices.length;r<i;r++)m.vertices.push(f[e].vertices[r].clone());if(void 0!==f[e].normals)for(m.normals=[],r=0,i=f[e].normals.length;r<i;r++)m.normals.push(f[e].normals[r].clone());this.morphTargets.push(m)}var v=t.morphNormals;for(e=0,n=v.length;e<n;e++){var g={};if(void 0!==v[e].vertexNormals)for(g.vertexNormals=[],r=0,i=v[e].vertexNormals.length;r<i;r++){var y=v[e].vertexNormals[r],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),g.vertexNormals.push(x)}if(void 0!==v[e].faceNormals)for(g.faceNormals=[],r=0,i=v[e].faceNormals.length;r<i;r++)g.faceNormals.push(v[e].faceNormals[r].clone());this.morphNormals.push(g)}var b=t.skinWeights;for(e=0,n=b.length;e<n;e++)this.skinWeights.push(b[e].clone());var M=t.skinIndices;for(e=0,n=M.length;e<n;e++)this.skinIndices.push(M[e].clone());var w=t.lineDistances;for(e=0,n=w.length;e<n;e++)this.lineDistances.push(w[e]);var _=t.boundingBox;null!==_&&(this.boundingBox=_.clone());var S=t.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class qe extends be{constructor(t,e,n,r,i,o){super(),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;t=t||1,e=e||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1,o=Math.floor(o)||1;const s=[],c=[],u=[],l=[];let h=0,p=0;function d(t,e,n,r,i,o,d,f,m,v,g){const y=o/m,x=d/v,b=o/2,M=d/2,w=f/2,_=m+1,S=v+1;let E=0,T=0;const L=new P;for(let o=0;o<S;o++){const a=o*x-M;for(let s=0;s<_;s++){const h=s*y-b;L[t]=h*r,L[e]=a*i,L[n]=w,c.push(L.x,L.y,L.z),L[t]=0,L[e]=0,L[n]=f>0?1:-1,u.push(L.x,L.y,L.z),l.push(s/m),l.push(1-o/v),E+=1}}for(let t=0;t<v;t++)for(let e=0;e<m;e++){const n=h+e+_*t,r=h+e+_*(t+1),i=h+(e+1)+_*(t+1),o=h+(e+1)+_*t;s.push(n,r,o),s.push(r,i,o),T+=6}a.addGroup(p,T,g),p+=T,h+=E}d("z","y","x",-1,-1,n,e,t,o,i,0),d("z","y","x",1,-1,n,e,-t,o,i,1),d("x","z","y",1,1,t,n,e,r,o,2),d("x","z","y",1,-1,t,n,-e,r,o,3),d("x","y","z",1,-1,t,e,n,r,i,4),d("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new ue(c,3)),this.setAttribute("normal",new ue(u,3)),this.setAttribute("uv",new ue(l,2))}}function Xe(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 Ye(t){for(var e={},n=0;n<t.length;n++){var r=Xe(t[n]);for(var i in r)e[i]=r[i]}return e}var Je={clone:Xe,merge:Ye};function Ze(t){Qt.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("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Ke(){et.call(this),this.type="Camera",this.matrixWorldInverse=new j,this.projectionMatrix=new j,this.projectionMatrixInverse=new j}function Qe(t,e,n,r){Ke.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()}Ze.prototype=Object.create(Qt.prototype),Ze.prototype.constructor=Ze,Ze.prototype.isShaderMaterial=!0,Ze.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Xe(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=Object.assign({},t.extensions),this},Ze.prototype.toJSON=function(t){var e=Qt.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}}Object.keys(this.defines).length>0&&(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 Object.keys(i).length>0&&(e.extensions=i),e},Ke.prototype=Object.assign(Object.create(et.prototype),{constructor:Ke,isCamera:!0,copy:function(t,e){return et.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("THREE.Camera: .getWorldDirection() target is now required"),t=new P),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){et.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){et.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Qe.prototype=Object.assign(Object.create(Ke.prototype),{constructor:Qe,isPerspectiveCamera:!0,copy:function(t,e){return Ke.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*g.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*g.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*g.RAD2DEG*Math.atan(Math.tan(.5*g.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*g.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=et.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}});function $e(t,e,n){if(et.call(this),this.type="CubeCamera",!0===n.isWebGLCubeRenderTarget){this.renderTarget=n;var r=new Qe(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new P(1,0,0)),this.add(r);var i=new Qe(90,1,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new P(-1,0,0)),this.add(i);var o=new Qe(90,1,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new P(0,1,0)),this.add(o);var a=new Qe(90,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new P(0,-1,0)),this.add(a);var s=new Qe(90,1,t,e);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new P(0,0,1)),this.add(s);var c=new Qe(90,1,t,e);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new P(0,0,-1)),this.add(c),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var u=t.xr.enabled,l=t.getRenderTarget();t.xr.enabled=!1;var h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,r),t.setRenderTarget(n,1),t.render(e,i),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,s),n.texture.generateMipmaps=h,t.setRenderTarget(n,5),t.render(e,c),t.setRenderTarget(l),t.xr.enabled=u},this.clear=function(t,e,r,i){for(var o=t.getRenderTarget(),a=0;a<6;a++)t.setRenderTarget(n,a),t.clear(e,r,i);t.setRenderTarget(o)}}else console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.")}function tn(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),S.call(this,t,t,e)}function en(t,e,n,r,i,o,a,s,c,u,l,h){w.call(this,null,o,a,s,c,u,r,i,l,h),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==u?u:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}$e.prototype=Object.create(et.prototype),$e.prototype.constructor=$e,tn.prototype=Object.create(S.prototype),tn.prototype.constructor=tn,tn.prototype.isWebGLCubeRenderTarget=!0,tn.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new nt,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#include <common>","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV = equirectUv( direction );","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new Ze({type:"CubemapFromEquirect",uniforms:Xe(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=e;var o=new Be(new qe(5,5,5),i);return n.add(o),new $e(1,10,this).update(t,n),o.geometry.dispose(),o.material.dispose(),this},en.prototype=Object.create(w.prototype),en.prototype.constructor=en,en.prototype.isDataTexture=!0;var nn=new xt,rn=new P;function on(t,e,n,r,i,o){this.planes=[void 0!==t?t:new Ot,void 0!==e?e:new Ot,void 0!==n?n:new Ot,void 0!==r?r:new Ot,void 0!==i?i:new Ot,void 0!==o?o:new Ot]}Object.assign(on.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},setFromProjectionMatrix: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],u=n[6],l=n[7],h=n[8],p=n[9],d=n[10],f=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return e[0].setComponents(a-r,l-s,f-h,y-m).normalize(),e[1].setComponents(a+r,l+s,f+h,y+m).normalize(),e[2].setComponents(a+i,l+c,f+p,y+v).normalize(),e[3].setComponents(a-i,l-c,f-p,y-v).normalize(),e[4].setComponents(a-o,l-u,f-d,y-g).normalize(),e[5].setComponents(a+o,l+u,f+d,y+g).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),nn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(nn)},intersectsSprite:function(t){return nn.center.set(0,0,0),nn.radius=.7071067811865476,nn.applyMatrix4(t.matrixWorld),this.intersectsSphere(nn)},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:function(t){for(var e=this.planes,n=0;n<6;n++){var r=e[n];if(rn.x=r.normal.x>0?t.max.x:t.min.x,rn.y=r.normal.y>0?t.max.y:t.min.y,rn.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(rn)<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}});var an={common:{diffuse:{value:new qt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new x},uv2Transform:{value:new x},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 y(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 qt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new qt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}},sprite:{diffuse:{value:new qt(15658734)},opacity:{value:1},center:{value:new y(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new x}}};function sn(){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 cn(t,e){var n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){e.isInterleavedBufferAttribute&&(e=e.data);var o=r.get(e);void 0===o?r.set(e,function(e,n){var r=e.array,i=e.usage,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("THREE.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}}(e,i)):o.version<e.version&&(!function(e,r,i){var o=r.array,a=r.updateRange;t.bindBuffer(i,e),-1===a.count?t.bufferSubData(i,0,o):(n?t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o,a.offset,a.count):t.bufferSubData(i,a.offset*o.BYTES_PER_ELEMENT,o.subarray(a.offset,a.offset+a.count)),a.count=-1)}(o.buffer,e,i),o.version=e.version)}}}function un(t,e,n,r){We.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new ln(t,e,n,r)),this.mergeVertices()}function ln(t,e,n,r){be.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,u=Math.floor(r)||1,l=c+1,h=u+1,p=t/c,d=e/u,f=[],m=[],v=[],g=[];for(o=0;o<h;o++){var y=o*d-s;for(i=0;i<l;i++){var x=i*p-a;m.push(x,-y,0),v.push(0,0,1),g.push(i/c),g.push(1-o/u)}}for(o=0;o<u;o++)for(i=0;i<c;i++){var b=i+l*o,M=i+l*(o+1),w=i+1+l*(o+1),_=i+1+l*o;f.push(b,M,_),f.push(M,w,_)}this.setIndex(f),this.setAttribute("position",new ue(m,3)),this.setAttribute("normal",new ue(v,3)),this.setAttribute("uv",new ue(g,2))}un.prototype=Object.create(We.prototype),un.prototype.constructor=un,ln.prototype=Object.create(be.prototype),ln.prototype.constructor=ln;var hn={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( STANDARD )\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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( 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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, 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}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",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_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - 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#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat 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}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\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#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\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}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x); } else if (face == 1.0) {\n uv = vec2(-direction.x, -direction.z) / abs(direction.y); } else if (face == 2.0) {\n uv = vec2(-direction.x, direction.y) / abs(direction.z); } else if (face == 3.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x); } else if (face == 4.0) {\n uv = vec2(-direction.x, direction.z) / abs(direction.y); } else {\n uv = vec2(direction.x, direction.y) / abs(direction.z); }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\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, vUv ).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 = clamp( floor( D ) / 255.0, 0.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#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, 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_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\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\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\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_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\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\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\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 )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\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\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 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 roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, 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\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\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#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\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 = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\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 USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * 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 = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\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};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\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};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\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};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\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_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\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_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\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\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\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 );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#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#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\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\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 = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\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\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * 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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, 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, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\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\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\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:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\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 *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\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 *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * 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\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\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#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\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}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\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 = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef 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_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\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\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\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( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), 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( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), 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 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\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 ) || defined( SHADOWMAP_TYPE_VSM )\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_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\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_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\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 highp 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#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_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\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\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\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:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\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>\nvarying vec2 vHighPrecisionZW;\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\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\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>\nvarying vec2 vHighPrecisionZW;\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\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <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 = equirectUv( direction );\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\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 <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 <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * 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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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\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 <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <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 <color_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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_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 <color_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 <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#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}",meshtoon_frag:"#define TOON\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 <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_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_toon_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}",meshtoon_vert:"#define TOON\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 <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 <shadowmap_vertex>\n\t#include <fog_vertex>\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_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <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 STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\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_common_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 <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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 <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_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\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\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 STANDARD\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( TANGENTSPACE_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>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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( TANGENTSPACE_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 <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 <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#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\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 = isPerspectiveMatrix( projectionMatrix );\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\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 <alphamap_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 <alphamap_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 = isPerspectiveMatrix( projectionMatrix );\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}"},pn={basic:{uniforms:Ye([an.common,an.specularmap,an.envmap,an.aomap,an.lightmap,an.fog]),vertexShader:hn.meshbasic_vert,fragmentShader:hn.meshbasic_frag},lambert:{uniforms:Ye([an.common,an.specularmap,an.envmap,an.aomap,an.lightmap,an.emissivemap,an.fog,an.lights,{emissive:{value:new qt(0)}}]),vertexShader:hn.meshlambert_vert,fragmentShader:hn.meshlambert_frag},phong:{uniforms:Ye([an.common,an.specularmap,an.envmap,an.aomap,an.lightmap,an.emissivemap,an.bumpmap,an.normalmap,an.displacementmap,an.fog,an.lights,{emissive:{value:new qt(0)},specular:{value:new qt(1118481)},shininess:{value:30}}]),vertexShader:hn.meshphong_vert,fragmentShader:hn.meshphong_frag},standard:{uniforms:Ye([an.common,an.envmap,an.aomap,an.lightmap,an.emissivemap,an.bumpmap,an.normalmap,an.displacementmap,an.roughnessmap,an.metalnessmap,an.fog,an.lights,{emissive:{value:new qt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:hn.meshphysical_vert,fragmentShader:hn.meshphysical_frag},toon:{uniforms:Ye([an.common,an.specularmap,an.aomap,an.lightmap,an.emissivemap,an.bumpmap,an.normalmap,an.displacementmap,an.gradientmap,an.fog,an.lights,{emissive:{value:new qt(0)},specular:{value:new qt(1118481)},shininess:{value:30}}]),vertexShader:hn.meshtoon_vert,fragmentShader:hn.meshtoon_frag},matcap:{uniforms:Ye([an.common,an.bumpmap,an.normalmap,an.displacementmap,an.fog,{matcap:{value:null}}]),vertexShader:hn.meshmatcap_vert,fragmentShader:hn.meshmatcap_frag},points:{uniforms:Ye([an.points,an.fog]),vertexShader:hn.points_vert,fragmentShader:hn.points_frag},dashed:{uniforms:Ye([an.common,an.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:hn.linedashed_vert,fragmentShader:hn.linedashed_frag},depth:{uniforms:Ye([an.common,an.displacementmap]),vertexShader:hn.depth_vert,fragmentShader:hn.depth_frag},normal:{uniforms:Ye([an.common,an.bumpmap,an.normalmap,an.displacementmap,{opacity:{value:1}}]),vertexShader:hn.normal_vert,fragmentShader:hn.normal_frag},sprite:{uniforms:Ye([an.sprite,an.fog]),vertexShader:hn.sprite_vert,fragmentShader:hn.sprite_frag},background:{uniforms:{uvTransform:{value:new x},t2D:{value:null}},vertexShader:hn.background_vert,fragmentShader:hn.background_frag},cube:{uniforms:Ye([an.envmap,{opacity:{value:1}}]),vertexShader:hn.cube_vert,fragmentShader:hn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:hn.equirect_vert,fragmentShader:hn.equirect_frag},distanceRGBA:{uniforms:Ye([an.common,an.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:hn.distanceRGBA_vert,fragmentShader:hn.distanceRGBA_frag},shadow:{uniforms:Ye([an.lights,an.fog,{color:{value:new qt(0)},opacity:{value:1}}]),vertexShader:hn.shadow_vert,fragmentShader:hn.shadow_frag}};function dn(t,e,n,r){var i,o,a=new qt(0),s=0,c=null,u=0,l=null;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,p,d){var f=r.background,m=t.xr,v=m.getSession&&m.getSession();if(v&&"additive"===v.environmentBlendMode&&(f=null),null===f?h(a,s):f&&f.isColor&&(h(f,1),d=!0),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||306===f.mapping)){void 0===o&&((o=new Be(new qe(1,1,1),new Ze({type:"BackgroundCubeMaterial",uniforms:Xe(pn.cube.uniforms),vertexShader:pn.cube.vertexShader,fragmentShader:pn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o));var g=f.isWebGLCubeRenderTarget?f.texture:f;o.material.uniforms.envMap.value=g,o.material.uniforms.flipEnvMap.value=g.isCubeTexture?-1:1,c===f&&u===g.version&&l===t.toneMapping||(o.material.needsUpdate=!0,c=f,u=g.version,l=t.toneMapping),e.unshift(o,o.geometry,o.material,0,0,null)}else f&&f.isTexture&&(void 0===i&&((i=new Be(new ln(2,2),new Ze({type:"BackgroundMaterial",uniforms:Xe(pn.background.uniforms),vertexShader:pn.background.vertexShader,fragmentShader:pn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(i)),i.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),i.material.uniforms.uvTransform.value.copy(f.matrix),c===f&&u===f.version&&l===t.toneMapping||(i.material.needsUpdate=!0,c=f,u=f.version,l=t.toneMapping),e.unshift(i,i.geometry,i.material,0,0,null))}}}function fn(t,e,n,r){var i,o=r.isWebGL2;this.setMode=function(t){i=t},this.render=function(e,r){t.drawArrays(i,e,r),n.update(r,i)},this.renderInstances=function(r,a,s,c){if(0!==c){var u,l;if(o)u=t,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(u=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[l](i,a,s,c),n.update(s,i,c)}}}function mn(t,e,n){var r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var c=!0===n.logarithmicDepthBuffer,u=t.getParameter(34930),l=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),d=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),v=t.getParameter(36349),g=l>0,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:u,maxVertexTextures:l,maxTextureSize:h,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:o?t.getParameter(36183):0}}function vn(){var t=this,e=null,n=0,r=!1,i=!1,o=new Ot,a=new x,s={value:null,needsUpdate:!1};function c(){s.value!==e&&(s.value=e,s.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(e,n,r,i){var c=null!==e?e.length:0,u=null;if(0!==c){if(u=s.value,!0!==i||null===u){var l=r+4*c,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===u||u.length<l)&&(u=new Float32Array(l));for(var p=0,d=r;p!==c;++p,d+=4)o.copy(e[p]).applyMatrix4(h,a),o.normal.toArray(u,d),u[d+3]=o.constant}s.value=u,s.needsUpdate=!0}return t.numPlanes=c,t.numIntersection=0,u}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=u(t,o,0),n=t.length,a},this.beginShadows=function(){i=!0,u(null)},this.endShadows=function(){i=!1,c()},this.setState=function(t,o,a,l,h,p){if(!r||null===t||0===t.length||i&&!a)i?u(null):c();else{var d=i?0:n,f=4*d,m=h.clippingState||null;s.value=m,m=u(t,l,f,p);for(var v=0;v!==f;++v)m[v]=e[v];h.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=d}}}function gn(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("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=r,r}}}function yn(t,e,n){var r=new WeakMap,i=new WeakMap;function o(t){var a=t.target,s=r.get(a);for(var c in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[c]);a.removeEventListener("dispose",o),r.delete(a);var u=i.get(s);u&&(e.remove(u),i.delete(s)),n.memory.geometries--}function a(t){var n=[],r=t.index,o=t.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var c=0,u=s.length;c<u;c+=3){var l=s[c+0],h=s[c+1],p=s[c+2];n.push(l,h,h,p,p,l)}}else{s=o.array;a=o.version;for(c=0,u=s.length/3-1;c<u;c+=3){l=c+0,h=c+1,p=c+2;n.push(l,h,h,p,p,l)}}var d=new(pe(n)>65535?ce:ae)(n,1);d.version=a,e.update(d,34963);var f=i.get(t);f&&e.remove(f),i.set(t,d)}return{get:function(t,e){var i=r.get(e);return i||(e.addEventListener("dispose",o),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new be).setFromObject(t)),i=e._bufferGeometry),r.set(e,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){var e=i.get(t);if(e){var n=t.index;null!==n&&e.version<n.version&&a(t)}else a(t);return i.get(t)}}}function xn(t,e,n,r){var i,o,a,s=r.isWebGL2;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(r,c,u,l){if(0!==l){var h,p;if(s)h=t,p="drawElementsInstanced";else if(p="drawElementsInstancedANGLE",null===(h=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[p](i,u,o,c*a,l),n.update(u,i,l)}}}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 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("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function Mn(t,e){return Math.abs(e[1])-Math.abs(t[1])}function wn(t){var e={},n=new Float32Array(8);return{update:function(r,i,o,a){var s=r.morphTargetInfluences,c=void 0===s?0:s.length,u=e[i.id];if(void 0===u){u=[];for(var l=0;l<c;l++)u[l]=[l,0];e[i.id]=u}var h=o.morphTargets&&i.morphAttributes.position,p=o.morphNormals&&i.morphAttributes.normal;for(l=0;l<c;l++){0!==(f=u[l])[1]&&(h&&i.deleteAttribute("morphTarget"+l),p&&i.deleteAttribute("morphNormal"+l))}for(l=0;l<c;l++){(f=u[l])[0]=l,f[1]=s[l]}u.sort(Mn);var d=0;for(l=0;l<8;l++){var f;if(f=u[l]){var m=f[0],v=f[1];if(v){h&&i.setAttribute("morphTarget"+l,h[m]),p&&i.setAttribute("morphNormal"+l,p[m]),n[l]=v,d+=v;continue}}n[l]=0}var g=i.morphTargetsRelative?1:1-d;a.getUniforms().setValue(t,"morphTargetBaseInfluence",g),a.getUniforms().setValue(t,"morphTargetInfluences",n)}}}function _n(t,e,n,r){var i=new WeakMap;return{update:function(t){var o=r.render.frame,a=t.geometry,s=e.get(t,a);return i.get(s)!==o&&(a.isGeometry&&s.updateFromObject(t),e.update(s),i.set(s,o)),t.isInstancedMesh&&n.update(t.instanceMatrix,34962),s},dispose:function(){i=new WeakMap}}}function Sn(t,e,n,r,i,o,a,s,c,u){t=void 0!==t?t:[],e=void 0!==e?e:301,a=void 0!==a?a:1022,w.call(this,t,e,n,r,i,o,a,s,c,u),this.flipY=!1}function En(t,e,n,r){w.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Tn(t,e,n,r){w.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}pn.physical={uniforms:Ye([pn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new y(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new qt(0)},transparency:{value:0}}]),vertexShader:hn.meshphysical_vert,fragmentShader:hn.meshphysical_frag},Sn.prototype=Object.create(w.prototype),Sn.prototype.constructor=Sn,Sn.prototype.isCubeTexture=!0,Object.defineProperty(Sn.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),En.prototype=Object.create(w.prototype),En.prototype.constructor=En,En.prototype.isDataTexture2DArray=!0,Tn.prototype=Object.create(w.prototype),Tn.prototype.constructor=Tn,Tn.prototype.isDataTexture3D=!0;var Ln=new w,An=new En,Pn=new Tn,Rn=new Sn,On=[],Nn=[],Cn=new Float32Array(16),In=new Float32Array(9),Dn=new Float32Array(4);function zn(t,e,n){var r=t[0];if(r<=0||r>0)return t;var i=e*n,o=On[i];if(void 0===o&&(o=new Float32Array(i),On[i]=o),0!==e){r.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function jn(t,e){if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Bn(t,e){for(var n=0,r=e.length;n<r;n++)t[n]=e[n]}function kn(t,e){var n=Nn[e];void 0===n&&(n=new Int32Array(e),Nn[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function Fn(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Un(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(jn(n,e))return;t.uniform2fv(this.addr,e),Bn(n,e)}}function Gn(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(jn(n,e))return;t.uniform3fv(this.addr,e),Bn(n,e)}}function Hn(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(jn(n,e))return;t.uniform4fv(this.addr,e),Bn(n,e)}}function Vn(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(jn(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Bn(n,e)}else{if(jn(n,r))return;Dn.set(r),t.uniformMatrix2fv(this.addr,!1,Dn),Bn(n,r)}}function Wn(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(jn(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Bn(n,e)}else{if(jn(n,r))return;In.set(r),t.uniformMatrix3fv(this.addr,!1,In),Bn(n,r)}}function qn(t,e){var n=this.cache,r=e.elements;if(void 0===r){if(jn(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Bn(n,e)}else{if(jn(n,r))return;Cn.set(r),t.uniformMatrix4fv(this.addr,!1,Cn),Bn(n,r)}}function Xn(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(e||Ln,i)}function Yn(t,e,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||An,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||Pn,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.safeSetTextureCube(e||Rn,i)}function Kn(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Qn(t,e){var n=this.cache;jn(n,e)||(t.uniform2iv(this.addr,e),Bn(n,e))}function $n(t,e){var n=this.cache;jn(n,e)||(t.uniform3iv(this.addr,e),Bn(n,e))}function tr(t,e){var n=this.cache;jn(n,e)||(t.uniform4iv(this.addr,e),Bn(n,e))}function er(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=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=zn(e,this.size,2);t.uniform2fv(this.addr,n)}function cr(t,e){var n=zn(e,this.size,3);t.uniform3fv(this.addr,n)}function ur(t,e){var n=zn(e,this.size,4);t.uniform4fv(this.addr,n)}function lr(t,e){var n=zn(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function hr(t,e){var n=zn(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function pr(t,e){var n=zn(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function dr(t,e,n){var r=e.length,i=kn(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTexture2D(e[o]||Ln,i[o])}function fr(t,e,n){var r=e.length,i=kn(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.safeSetTextureCube(e[o]||Rn,i[o])}function mr(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Fn;case 35664:return Un;case 35665:return Gn;case 35666:return Hn;case 35674:return Vn;case 35675:return Wn;case 35676:return qn;case 5124:case 35670:return Kn;case 35667:case 35671:return Qn;case 35668:case 35672:return $n;case 35669:case 35673:return tr;case 5125:return er;case 35678:case 36198:case 36298:case 36306:case 35682:return Xn;case 35679:case 36299:case 36307:return Jn;case 35680:case 36300:case 36308:case 36293:return Zn;case 36289:case 36303:case 36311:case 36292:return Yn}}(e.type)}function vr(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 ur;case 35674:return lr;case 35675:return hr;case 35676:return pr;case 5124:case 35670:return rr;case 35667:case 35671:return ir;case 35668:case 35672:return or;case 35669:case 35673:return ar;case 35678:case 36198:case 36298:case 36306:case 35682:return dr;case 35680:case 36300:case 36308:case 36293:return fr}}(e.type)}function gr(t){this.id=t,this.seq=[],this.map={}}vr.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Bn(e,t)},gr.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 br(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],u=o[3];if(c&&(s|=0),void 0===u||"["===u&&a+2===i){xr(n,void 0===u?new mr(s,t,e):new vr(s,t,e));break}var l=n.map[s];void 0===l&&xr(n,l=new gr(s)),n=l}}function Mr(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),r=0;r<n;++r){var i=t.getActiveUniform(e,r);br(i,t.getUniformLocation(e,i.name),this)}}function wr(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}Mr.prototype.setValue=function(t,e,n,r){var i=this.map[e];void 0!==i&&i.setValue(t,n,r)},Mr.prototype.setOptional=function(t,e,n){var r=e[n];void 0!==r&&this.setValue(t,n,r)},Mr.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)}},Mr.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 _r=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 ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+t)}}function Er(t,e,n){var r=t.getShaderParameter(e,35713),i=t.getShaderInfoLog(e).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+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")}(t.getShaderSource(e))}function Tr(t,e){var n=Sr(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Lr(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 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Ar(t){return""!==t}function Pr(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).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Rr(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}var Or=/^[ \t]*#include +<([\w\d./]+)>/gm;function Nr(t){return t.replace(Or,Cr)}function Cr(t,e){var n=hn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Nr(n)}var Ir=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Dr=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function zr(t){return t.replace(Dr,Br).replace(Ir,jr)}function jr(t,e,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Br(t,e,n,r)}function Br(t,e,n,r){for(var i="",o=parseInt(e);o<parseInt(n);o++)i+=r.replace(/\[ i \]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return i}function kr(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Fr(t,e,n){var r,i,o,a,s,c=t.getContext(),u=n.defines,l=n.vertexShader,h=n.fragmentShader,p=function(t){var e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(n),d=function(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case 301:case 302:e="ENVMAP_TYPE_CUBE";break;case 306:case 307:e="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:e="ENVMAP_TYPE_EQUIREC";break;case 305:e="ENVMAP_TYPE_SPHERE"}return e}(n),f=function(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case 302:case 304:e="ENVMAP_MODE_REFRACTION"}return e}(n),m=function(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(n),v=t.gammaFactor>0?t.gammaFactor:1,g=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ar).join("\n")}(n),y=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(u),x=c.createProgram();if(n.isRawShaderMaterial?((r=[y].filter(Ar).join("\n")).length>0&&(r+="\n"),(i=[g,y].filter(Ar).join("\n")).length>0&&(i+="\n")):(r=[kr(n),"#define SHADER_NAME "+n.shaderName,y,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+v,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+p:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Ar).join("\n"),i=[g,kr(n),"#define SHADER_NAME "+n.shaderName,y,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.envMap?"#define "+f:"",n.envMap?"#define "+m:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+p:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?hn.tonemapping_pars_fragment:"",0!==n.toneMapping?Lr("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?hn.encodings_pars_fragment:"",n.mapEncoding?Tr("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?Tr("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?Tr("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?Tr("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?Tr("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?(o="linearToOutputTexel",a=n.outputEncoding,s=Sr(a),"vec4 "+o+"( vec4 value ) { return LinearTo"+s[0]+s[1]+"; }"):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Ar).join("\n")),l=Rr(l=Pr(l=Nr(l),n),n),h=Rr(h=Pr(h=Nr(h),n),n),l=zr(l),h=zr(h),n.isWebGL2&&!n.isRawShaderMaterial){var b=!1,M=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==l.match(M)&&null!==h.match(M)&&(b=!0,l=l.replace(M,""),h=h.replace(M,"")),r=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,i=["#version 300 es\n","#define varying in",b?"":"out highp vec4 pc_fragColor;",b?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+i}var w,_,S=i+h,E=wr(c,35633,r+l),T=wr(c,35632,S);if(c.attachShader(x,E),c.attachShader(x,T),void 0!==n.index0AttributeName?c.bindAttribLocation(x,0,n.index0AttributeName):!0===n.morphTargets&&c.bindAttribLocation(x,0,"position"),c.linkProgram(x),t.debug.checkShaderErrors){var L=c.getProgramInfoLog(x).trim(),A=c.getShaderInfoLog(E).trim(),P=c.getShaderInfoLog(T).trim(),R=!0,O=!0;if(!1===c.getProgramParameter(x,35714)){R=!1;var N=Er(c,E,"vertex"),C=Er(c,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",c.getError(),"35715",c.getProgramParameter(x,35715),"gl.getProgramInfoLog",L,N,C)}else""!==L?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",L):""!==A&&""!==P||(O=!1);O&&(this.diagnostics={runnable:R,programLog:L,vertexShader:{log:A,prefix:r},fragmentShader:{log:P,prefix:i}})}return c.deleteShader(E),c.deleteShader(T),this.getUniforms=function(){return void 0===w&&(w=new Mr(c,x)),w},this.getAttributes=function(){return void 0===_&&(_=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,x)),_},this.destroy=function(){c.deleteProgram(x),this.program=void 0},this.name=n.shaderName,this.id=_r++,this.cacheKey=e,this.usedTimes=1,this.program=x,this.vertexShader=E,this.fragmentShader=T,this}function Ur(t,e,n){var r=[],i=n.isWebGL2,o=n.logarithmicDepthBuffer,a=n.floatVertexTextures,s=n.precision,c=n.maxVertexUniforms,u=n.vertexTextures,l={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},h=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];function p(t){var e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=3e3,e}this.getParameters=function(r,h,d,f,m,v,g){var y=f.fog,x=r.isMeshStandardMaterial?f.environment:null,b=r.envMap||x,M=l[r.type],w=g.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(a)return 1024;var n=c,r=Math.floor((n-20)/4),i=Math.min(r,e.length);return i<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+i+"."),0):i}(g):0;null!==r.precision&&(s=n.getMaxPrecision(r.precision))!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",s,"instead.");var _=function(t,e){var n;if(e){var r=pn[e];n={name:t.type,uniforms:Je.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return n}(r,M);r.onBeforeCompile(_,t);var S=t.getRenderTarget();return{isWebGL2:i,shaderID:M,shaderName:_.name,uniforms:_.uniforms,vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:s,instancing:!0===g.isInstancedMesh,supportsVertexTextures:u,outputEncoding:null!==S?p(S.texture):t.outputEncoding,map:!!r.map,mapEncoding:p(r.map),matcap:!!r.matcap,matcapEncoding:p(r.matcap),envMap:!!b,envMapMode:b&&b.mapping,envMapEncoding:p(b),envMapCubeUV:!!b&&(306===b.mapping||307===b.mapping),lightMap:!!r.lightMap,lightMapEncoding:p(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:p(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:1===r.normalMapType,tangentSpaceNormalMap:0===r.normalMapType,clearcoatMap:!!r.clearcoatMap,clearcoatRoughnessMap:!!r.clearcoatRoughnessMap,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatMap||r.clearcoatRoughnessMap||r.clearcoatNormalMap||r.displacementMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||!r.displacementMap),fog:!!y,useFog:r.fog,fogExp2:y&&y.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:o,skinning:r.skinning&&w>0,maxBones:w,useVertexTexture:a,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numClippingPlanes:m,numClipIntersection:v,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&d.length>0,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:i||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:i||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:r.onBeforeCompile}},this.getProgramCacheKey=function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);if(void 0===e.isRawShaderMaterial){for(var i=0;i<h.length;i++)n.push(e[h[i]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(e,n){for(var i,o=0,a=r.length;o<a;o++){var s=r[o];if(s.cacheKey===n){++(i=s).usedTimes;break}}return void 0===i&&(i=new Fr(t,n,e),r.push(i)),i},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},this.programs=r}function Gr(){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 Hr(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 Wr(){var t=[],e=0,n=[],r=[],i={id:-1};function o(n,r,o,a,s,c){var u=t[e];return void 0===u?(u={id:n.id,object:n,geometry:r,material:o,program:o.program||i,groupOrder:a,renderOrder:n.renderOrder,z:s,group:c},t[e]=u):(u.id=n.id,u.object=n,u.geometry=r,u.material=o,u.program=o.program||i,u.groupOrder=a,u.renderOrder=n.renderOrder,u.z=s,u.group=c),e++,u}return{opaque:n,transparent:r,init:function(){e=0,n.length=0,r.length=0},push:function(t,e,i,a,s,c){var u=o(t,e,i,a,s,c);(!0===i.transparent?r:n).push(u)},unshift:function(t,e,i,a,s,c){var u=o(t,e,i,a,s,c);(!0===i.transparent?r:n).unshift(u)},finish:function(){for(var n=e,r=t.length;n<r;n++){var i=t[n];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(t,e){n.length>1&&n.sort(t||Hr),r.length>1&&r.sort(e||Vr)}}}function qr(){var t=new WeakMap;function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}return{get:function(n,r){var i,o=t.get(n);return void 0===o?(i=new Wr,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):void 0===(i=o.get(r))&&(i=new Wr,o.set(r,i)),i},dispose:function(){t=new WeakMap}}}function Xr(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new P,color:new qt};break;case"SpotLight":n={position:new P,direction:new P,color:new qt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new P,color:new qt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new P,skyColor:new qt,groundColor:new qt};break;case"RectAreaLight":n={color:new qt,position:new P,halfWidth:new P,halfHeight:new P}}return t[e.id]=n,n}}}var Yr=0;function Jr(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Zr(){for(var t,e=new Xr,n=(t={},{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new y};break;case"PointLight":n={shadowBias:0,shadowRadius:1,shadowMapSize:new y,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},i=0;i<9;i++)r.probe.push(new P);var o=new P,a=new j,s=new j;return{setup:function(t,i,c){for(var u=0,l=0,h=0,p=0;p<9;p++)r.probe[p].set(0,0,0);var d=0,f=0,m=0,v=0,g=0,y=0,x=0,b=0,M=c.matrixWorldInverse;t.sort(Jr),p=0;for(var w=t.length;p<w;p++){var _=t[p],S=_.color,E=_.intensity,T=_.distance,L=_.shadow&&_.shadow.map?_.shadow.map.texture:null;if(_.isAmbientLight)u+=S.r*E,l+=S.g*E,h+=S.b*E;else if(_.isLightProbe)for(var A=0;A<9;A++)r.probe[A].addScaledVector(_.sh.coefficients[A],E);else if(_.isDirectionalLight){if((O=e.get(_)).color.copy(_.color).multiplyScalar(_.intensity),O.direction.setFromMatrixPosition(_.matrixWorld),o.setFromMatrixPosition(_.target.matrixWorld),O.direction.sub(o),O.direction.transformDirection(M),_.castShadow){var P=_.shadow;(R=n.get(_)).shadowBias=P.bias,R.shadowRadius=P.radius,R.shadowMapSize=P.mapSize,r.directionalShadow[d]=R,r.directionalShadowMap[d]=L,r.directionalShadowMatrix[d]=_.shadow.matrix,y++}r.directional[d]=O,d++}else if(_.isSpotLight){if((O=e.get(_)).position.setFromMatrixPosition(_.matrixWorld),O.position.applyMatrix4(M),O.color.copy(S).multiplyScalar(E),O.distance=T,O.direction.setFromMatrixPosition(_.matrixWorld),o.setFromMatrixPosition(_.target.matrixWorld),O.direction.sub(o),O.direction.transformDirection(M),O.coneCos=Math.cos(_.angle),O.penumbraCos=Math.cos(_.angle*(1-_.penumbra)),O.decay=_.decay,_.castShadow){P=_.shadow;(R=n.get(_)).shadowBias=P.bias,R.shadowRadius=P.radius,R.shadowMapSize=P.mapSize,r.spotShadow[m]=R,r.spotShadowMap[m]=L,r.spotShadowMatrix[m]=_.shadow.matrix,b++}r.spot[m]=O,m++}else if(_.isRectAreaLight){(O=e.get(_)).color.copy(S).multiplyScalar(E),O.position.setFromMatrixPosition(_.matrixWorld),O.position.applyMatrix4(M),s.identity(),a.copy(_.matrixWorld),a.premultiply(M),s.extractRotation(a),O.halfWidth.set(.5*_.width,0,0),O.halfHeight.set(0,.5*_.height,0),O.halfWidth.applyMatrix4(s),O.halfHeight.applyMatrix4(s),r.rectArea[v]=O,v++}else if(_.isPointLight){if((O=e.get(_)).position.setFromMatrixPosition(_.matrixWorld),O.position.applyMatrix4(M),O.color.copy(_.color).multiplyScalar(_.intensity),O.distance=_.distance,O.decay=_.decay,_.castShadow){var R;P=_.shadow;(R=n.get(_)).shadowBias=P.bias,R.shadowRadius=P.radius,R.shadowMapSize=P.mapSize,R.shadowCameraNear=P.camera.near,R.shadowCameraFar=P.camera.far,r.pointShadow[f]=R,r.pointShadowMap[f]=L,r.pointShadowMatrix[f]=_.shadow.matrix,x++}r.point[f]=O,f++}else if(_.isHemisphereLight){var O;(O=e.get(_)).direction.setFromMatrixPosition(_.matrixWorld),O.direction.transformDirection(M),O.direction.normalize(),O.skyColor.copy(_.color).multiplyScalar(E),O.groundColor.copy(_.groundColor).multiplyScalar(E),r.hemi[g]=O,g++}}r.ambient[0]=u,r.ambient[1]=l,r.ambient[2]=h;var N=r.hash;N.directionalLength===d&&N.pointLength===f&&N.spotLength===m&&N.rectAreaLength===v&&N.hemiLength===g&&N.numDirectionalShadows===y&&N.numPointShadows===x&&N.numSpotShadows===b||(r.directional.length=d,r.spot.length=m,r.rectArea.length=v,r.point.length=f,r.hemi.length=g,r.directionalShadow.length=y,r.directionalShadowMap.length=y,r.pointShadow.length=x,r.pointShadowMap.length=x,r.spotShadow.length=b,r.spotShadowMap.length=b,r.directionalShadowMatrix.length=y,r.pointShadowMatrix.length=x,r.spotShadowMatrix.length=b,N.directionalLength=d,N.pointLength=f,N.spotLength=m,N.rectAreaLength=v,N.hemiLength=g,N.numDirectionalShadows=y,N.numPointShadows=x,N.numSpotShadows=b,r.version=Yr++)},state:r}}function Kr(){var t=new Zr,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 Qr(){var t=new WeakMap;function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}return{get:function(n,r){var i;return!1===t.has(n)?(i=new Kr,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):!1===t.get(n).has(r)?(i=new Kr,t.get(n).set(r,i)):i=t.get(n).get(r),i},dispose:function(){t=new WeakMap}}}function $r(t){Qt.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.setValues(t)}function ti(t){Qt.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new P,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.setValues(t)}$r.prototype=Object.create(Qt.prototype),$r.prototype.constructor=$r,$r.prototype.isMeshDepthMaterial=!0,$r.prototype.copy=function(t){return Qt.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},ti.prototype=Object.create(Qt.prototype),ti.prototype.constructor=ti,ti.prototype.isMeshDistanceMaterial=!0,ti.prototype.copy=function(t){return Qt.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};function ei(t,e,n){var r=new on,i=new y,o=new y,a=new _,s=[],c=[],u={},l={0:1,1:0,2:2},h=new Ze({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new y},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=h.clone();p.defines.HORIZONAL_PASS=1;var d=new be;d.setAttribute("position",new ee(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var f=new Be(d,h),m=this;function v(n,r){var i=e.update(f);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,i,h,f,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,i,p,f,null)}function g(t,e,n){var r=t<<0|e<<1|n<<2,i=s[r];return void 0===i&&(i=new $r({depthPacking:3201,morphTargets:t,skinning:e}),s[r]=i),i}function x(t,e,n){var r=t<<0|e<<1|n<<2,i=c[r];return void 0===i&&(i=new ti({morphTargets:t,skinning:e}),c[r]=i),i}function b(e,n,r,i,o,a,s){var c=null,h=g,p=e.customDepthMaterial;if(!0===i.isPointLight&&(h=x,p=e.customDistanceMaterial),void 0===p){var d=!1;!0===r.morphTargets&&(d=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);var f=!1;!0===e.isSkinnedMesh&&(!0===r.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),c=h(d,f,!0===e.isInstancedMesh)}else c=p;if(t.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var m=c.uuid,v=r.uuid,y=u[m];void 0===y&&(y={},u[m]=y);var b=y[v];void 0===b&&(b=c.clone(),y[v]=b),c=b}return c.visible=r.visible,c.wireframe=r.wireframe,c.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:l[r.side],c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,!0===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=o,c.farDistance=a),c}function M(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var c=e.update(n),u=n.material;if(Array.isArray(u))for(var l=c.groups,h=0,p=l.length;h<p;h++){var d=l[h],f=u[d.materialIndex];if(f&&f.visible){var m=b(n,c,f,a,o.near,o.far,s);t.renderBufferDirect(o,null,c,m,n,d)}}else if(u.visible){m=b(n,c,u,a,o.near,o.far,s);t.renderBufferDirect(o,null,c,m,n,null)}}for(var v=n.children,g=0,y=v.length;g<y;g++)M(v[g],i,o,a,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(e,s,c){if(!1!==m.enabled&&(!1!==m.autoUpdate||!1!==m.needsUpdate)&&0!==e.length){var u=t.getRenderTarget(),l=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),p=t.state;p.setBlending(0),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(var d=0,f=e.length;d<f;d++){var g=e[d],y=g.shadow;if(void 0!==y){i.copy(y.mapSize);var x=y.getFrameExtents();if(i.multiply(x),o.copy(y.mapSize),(i.x>n||i.y>n)&&(i.x>n&&(o.x=Math.floor(n/x.x),i.x=o.x*x.x,y.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/x.y),i.y=o.y*x.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var b={minFilter:1006,magFilter:1006,format:1023};y.map=new S(i.x,i.y,b),y.map.texture.name=g.name+".shadowMap",y.mapPass=new S(i.x,i.y,b),y.camera.updateProjectionMatrix()}if(null===y.map){b={minFilter:1003,magFilter:1003,format:1023};y.map=new S(i.x,i.y,b),y.map.texture.name=g.name+".shadowMap",y.camera.updateProjectionMatrix()}t.setRenderTarget(y.map),t.clear();for(var w=y.getViewportCount(),_=0;_<w;_++){var E=y.getViewport(_);a.set(o.x*E.x,o.y*E.y,o.x*E.z,o.y*E.w),p.viewport(a),y.updateMatrices(g,_),r=y.getFrustum(),M(s,c,y.camera,g,this.type)}y.isPointLightShadow||3!==this.type||v(y,c)}else console.warn("THREE.WebGLShadowMap:",g,"has no shadow.")}m.needsUpdate=!1,t.setRenderTarget(u,l,h)}}}function ni(t,e,n){var r=n.isWebGL2;var i=new function(){var e=!1,n=new _,r=null,i=new _(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?k(2929):F(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,n=null,r=null,i=null}}},a=new function(){var e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null;return{setTest:function(t){e||(t?k(2960):F(2960))},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,a){r===e&&i===n&&o===a||(t.stencilFunc(e,n,a),r=e,i=n,o=a)},setOp:function(e,n,r){a===e&&s===n&&c===r||(t.stencilOp(e,n,r),a=e,s=n,c=r)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null}}},s=t.getParameter(34921),c=new Uint8Array(s),u=new Uint8Array(s),l=new Uint8Array(s),h={},p=null,d=null,f=null,m=null,v=null,g=null,y=null,x=null,b=null,M=!1,w=null,S=null,E=null,T=null,L=null,A=t.getParameter(35661),P=!1,R=0,O=t.getParameter(7938);-1!==O.indexOf("WebGL")?(R=parseFloat(/^WebGL\ ([0-9])/.exec(O)[1]),P=R>=1):-1!==O.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(O)[1]),P=R>=2);var N=null,C={},I=new _,D=new _;function z(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 j={};function B(n,i){(c[n]=1,0===u[n]&&(t.enableVertexAttribArray(n),u[n]=1),l[n]!==i)&&((r?t:e.get("ANGLE_instanced_arrays"))[r?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),l[n]=i)}function k(e){!0!==h[e]&&(t.enable(e),h[e]=!0)}function F(e){!1!==h[e]&&(t.disable(e),h[e]=!1)}j[3553]=z(3553,3553,1),j[34067]=z(34067,34069,6),i.setClear(0,0,0,1),o.setClear(1),a.setClear(0),k(2929),o.setFunc(3),W(!1),q(1),k(2884),V(0);var U={100:32774,101:32778,102:32779};if(r)U[103]=32775,U[104]=32776;else{var G=e.get("EXT_blend_minmax");null!==G&&(U[103]=G.MIN_EXT,U[104]=G.MAX_EXT)}var H={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function V(e,n,r,i,o,a,s,c){if(0!==e){if(d||(k(3042),d=!0),5===e)o=o||n,a=a||r,s=s||i,n===m&&o===y||(t.blendEquationSeparate(U[n],U[o]),m=n,y=o),r===v&&i===g&&a===x&&s===b||(t.blendFuncSeparate(H[r],H[i],H[a],H[s]),v=r,g=i,x=a,b=s),f=e,M=null;else if(e!==f||c!==M){if(100===m&&100===y||(t.blendEquation(32774),m=100,y=100),c)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("THREE.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("THREE.WebGLState: Invalid blending: ",e)}v=null,g=null,x=null,b=null,f=e,M=c}}else d&&(F(3042),d=!1)}function W(e){w!==e&&(e?t.frontFace(2304):t.frontFace(2305),w=e)}function q(e){0!==e?(k(2884),e!==S&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):F(2884),S=e}function X(e,n,r){e?(k(32823),T===n&&L===r||(t.polygonOffset(n,r),T=n,L=r)):F(32823)}function Y(e){void 0===e&&(e=33984+A-1),N!==e&&(t.activeTexture(e),N=e)}return{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){B(t,0)},enableAttributeAndDivisor:B,disableUnusedAttributes:function(){for(var e=0,n=u.length;e!==n;++e)u[e]!==c[e]&&(t.disableVertexAttribArray(e),u[e]=0)},vertexAttribPointer:function(e,n,i,o,a,s){!0!==r||5124!==i&&5125!==i?t.vertexAttribPointer(e,n,i,o,a,s):t.vertexAttribIPointer(e,n,i,o,a,s)},enable:k,disable:F,useProgram:function(e){return p!==e&&(t.useProgram(e),p=e,!0)},setBlending:V,setMaterial:function(t,e){2===t.side?F(2884):k(2884);var n=1===t.side;e&&(n=!n),W(n),1===t.blending&&!1===t.transparent?V(0):V(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);var r=t.stencilWrite;a.setTest(r),r&&(a.setMask(t.stencilWriteMask),a.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),a.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),X(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:W,setCullFace:q,setLineWidth:function(e){e!==E&&(P&&t.lineWidth(e),E=e)},setPolygonOffset:X,setScissorTest:function(t){t?k(3089):F(3089)},activeTexture:Y,bindTexture:function(e,n){null===N&&Y();var r=C[N];void 0===r&&(r={type:void 0,texture:void 0},C[N]=r),r.type===e&&r.texture===n||(t.bindTexture(e,n||j[e]),r.type=e,r.texture=n)},unbindTexture:function(){var e=C[N];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===I.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),I.copy(e))},viewport:function(e){!1===D.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),D.copy(e))},reset:function(){for(var e=0;e<u.length;e++)1===u[e]&&(t.disableVertexAttribArray(e),u[e]=0);h={},N=null,C={},p=null,f=null,w=null,S=null,i.reset(),o.reset(),a.reset()}}}function ri(t,e,n,r,i,o,a){var s,c=i.isWebGL2,u=i.maxTextures,l=i.maxCubemapSize,h=i.maxTextureSize,p=i.maxSamples,d=new WeakMap,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function m(t,e){return f?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function v(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){var o=e?g.floorPowerOfTwo:Math.floor,a=o(i*t.width),c=o(i*t.height);void 0===s&&(s=m(a,c));var u=n?m(a,c):s;return u.width=a,u.height=c,u.getContext("2d").drawImage(t,0,0,a,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+c+")."),u}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return g.isPowerOfTwo(t.width)&&g.isPowerOfTwo(t.height)}function x(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function b(e,n,i,o){t.generateMipmap(e),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function M(n,r,i){if(!1===c)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function w(t){return 1003===t||1004===t||1005===t?9728:9729}function _(e){var n=e.target;n.removeEventListener("dispose",_),function(e){var n=r.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),r.remove(e)}(n),n.isVideoTexture&&d.delete(n),a.memory.textures--}function S(e){var n=e.target;n.removeEventListener("dispose",S),function(e){var n=r.get(e),i=r.get(e.texture);if(!e)return;void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(e.texture),r.remove(e)}(n),a.memory.textures--}var E=0;function T(t,e){var i=r.get(t);if(t.isVideoTexture&&function(t){var e=a.render.frame;d.get(t)!==e&&(d.set(t,e),t.update())}(t),t.version>0&&i.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void C(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,i.__webglTexture)}function L(e,i){if(6===e.image.length){var a=r.get(e);if(e.version>0&&a.__version!==e.version){N(a,e),n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),u=e.image[0]&&e.image[0].isDataTexture,h=[],p=0;p<6;p++)h[p]=s||u?u?e.image[p].image:e.image[p]:v(e.image[p],!1,!0,l);var d,f=h[0],m=y(f)||c,g=o.convert(e.format),w=o.convert(e.type),_=M(e.internalFormat,g,w);if(O(34067,e,m),s){for(p=0;p<6;p++){d=h[p].mipmaps;for(var S=0;S<d.length;S++){var E=d[S];1023!==e.format&&1022!==e.format?null!==g?n.compressedTexImage2D(34069+p,S,_,E.width,E.height,0,E.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+p,S,_,E.width,E.height,0,g,w,E.data)}}a.__maxMipLevel=d.length-1}else{d=e.mipmaps;for(p=0;p<6;p++)if(u){n.texImage2D(34069+p,0,_,h[p].width,h[p].height,0,g,w,h[p].data);for(S=0;S<d.length;S++){var T=(E=d[S]).image[p].image;n.texImage2D(34069+p,S+1,_,T.width,T.height,0,g,w,T.data)}}else{n.texImage2D(34069+p,0,_,g,w,h[p]);for(S=0;S<d.length;S++){E=d[S];n.texImage2D(34069+p,S+1,_,g,w,E.image[p])}}a.__maxMipLevel=d.length}x(e,m)&&b(34067,e,f.width,f.height),a.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+i),n.bindTexture(34067,a.__webglTexture)}}function A(t,e){n.activeTexture(33984+e),n.bindTexture(34067,r.get(t).__webglTexture)}var P={1e3:10497,1001:33071,1002:33648},R={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function O(n,o,a){a?(t.texParameteri(n,10242,P[o.wrapS]),t.texParameteri(n,10243,P[o.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,P[o.wrapR]),t.texParameteri(n,10240,R[o.magFilter]),t.texParameteri(n,10241,R[o.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),1001===o.wrapS&&1001===o.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,w(o.magFilter)),t.texParameteri(n,10241,w(o.minFilter)),1003!==o.minFilter&&1006!==o.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=e.get("EXT_texture_filter_anisotropic");if(s){if(1015===o.type&&null===e.get("OES_texture_float_linear"))return;if(1016===o.type&&null===(c||e.get("OES_texture_half_float_linear")))return;(o.anisotropy>1||r.get(o).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function N(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",_),e.__webglTexture=t.createTexture(),a.memory.textures++)}function C(e,r,i){var a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),N(e,r),n.activeTexture(33984+i),n.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);var s=function(t){return!c&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(r)&&!1===y(r.image),u=v(r.image,s,!1,h),l=y(u)||c,p=o.convert(r.format),d=o.convert(r.type),f=M(r.internalFormat,p,d);O(a,r,l);var m,g=r.mipmaps;if(r.isDepthTexture)f=6402,c?f=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===f&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,d=o.convert(r.type)),1027===r.format&&6402===f&&(f=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,d=o.convert(r.type))),n.texImage2D(3553,0,f,u.width,u.height,0,p,d,null);else if(r.isDataTexture)if(g.length>0&&l){for(var w=0,_=g.length;w<_;w++)m=g[w],n.texImage2D(3553,w,f,m.width,m.height,0,p,d,m.data);r.generateMipmaps=!1,e.__maxMipLevel=g.length-1}else n.texImage2D(3553,0,f,u.width,u.height,0,p,d,u.data),e.__maxMipLevel=0;else if(r.isCompressedTexture){for(w=0,_=g.length;w<_;w++)m=g[w],1023!==r.format&&1022!==r.format?null!==p?n.compressedTexImage2D(3553,w,f,m.width,m.height,0,m.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,w,f,m.width,m.height,0,p,d,m.data);e.__maxMipLevel=g.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,f,u.width,u.height,u.depth,0,p,d,u.data),e.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,f,u.width,u.height,u.depth,0,p,d,u.data),e.__maxMipLevel=0;else if(g.length>0&&l){for(w=0,_=g.length;w<_;w++)m=g[w],n.texImage2D(3553,w,f,p,d,m);r.generateMipmaps=!1,e.__maxMipLevel=g.length-1}else n.texImage2D(3553,0,f,p,d,u),e.__maxMipLevel=0;x(r,l)&&b(a,r,u.width,u.height),e.__version=r.version,r.onUpdate&&r.onUpdate(r)}function I(e,i,a,s){var c=o.convert(i.texture.format),u=o.convert(i.texture.type),l=M(i.texture.internalFormat,c,u);n.texImage2D(s,0,l,i.width,i.height,0,c,u,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,s,r.get(i.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function D(e,n,r){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){var i=33189;if(r){var a=n.depthTexture;a&&a.isDepthTexture&&(1015===a.type?i=36012:1014===a.type&&(i=33190));var s=j(n);t.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else t.renderbufferStorage(36161,i,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){if(r){s=j(n);t.renderbufferStorageMultisample(36161,s,35056,n.width,n.height)}else t.renderbufferStorage(36161,34041,n.width,n.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{var c=o.convert(n.texture.format),u=o.convert(n.texture.type);i=M(n.texture.internalFormat,c,u);if(r){s=j(n);t.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else t.renderbufferStorage(36161,i,n.width,n.height)}t.bindRenderbuffer(36161,null)}function z(e){var n=r.get(e),i=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),T(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)t.framebufferTexture2D(36160,36096,3553,i,0);else{if(1027!==n.depthTexture.format)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),D(n.__webglDepthbuffer[o],e,!1)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),D(n.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}function j(t){return c&&t.isWebGLMultisampleRenderTarget?Math.min(p,t.samples):0}var B=!1,k=!1;this.allocateTextureUnit=function(){var t=E;return t>=u&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+u),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=T,this.setTexture2DArray=function(t,e){var i=r.get(t);t.version>0&&i.__version!==t.version?C(i,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){var i=r.get(t);t.version>0&&i.__version!==t.version?C(i,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=L,this.setTextureCubeDynamic=A,this.setupRenderTarget=function(e){var i=r.get(e),s=r.get(e.texture);e.addEventListener("dispose",S),s.__webglTexture=t.createTexture(),a.memory.textures++;var u=!0===e.isWebGLCubeRenderTarget,l=!0===e.isWebGLMultisampleRenderTarget,h=y(e)||c;if(!c||1022!==e.texture.format||1015!==e.texture.type&&1016!==e.texture.type||(e.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),u){i.__webglFramebuffer=[];for(var p=0;p<6;p++)i.__webglFramebuffer[p]=t.createFramebuffer()}else if(i.__webglFramebuffer=t.createFramebuffer(),l)if(c){i.__webglMultisampledFramebuffer=t.createFramebuffer(),i.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var d=o.convert(e.texture.format),f=o.convert(e.texture.type),m=M(e.texture.internalFormat,d,f),v=j(e);t.renderbufferStorageMultisample(36161,v,m,e.width,e.height),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(i.__webglDepthRenderbuffer=t.createRenderbuffer(),D(i.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(u){n.bindTexture(34067,s.__webglTexture),O(34067,e.texture,h);for(p=0;p<6;p++)I(i.__webglFramebuffer[p],e,36064,34069+p);x(e.texture,h)&&b(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),O(3553,e.texture,h),I(i.__webglFramebuffer,e,36064,3553),x(e.texture,h)&&b(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&z(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(x(e,y(t)||c)){var i=t.isWebGLCubeRenderTarget?34067:3553,o=r.get(e).__webglTexture;n.bindTexture(i,o),b(i,e,t.width,t.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(c){var n=r.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var i=e.width,o=e.height,a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),B=!0),t=t.texture),T(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===k&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),k=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?L(t,e):A(t,e)}}function ii(t,e,n){var r=n.isWebGL2;return{convert:function(t){var n;if(1009===t)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(1012===t)return 5123;if(1013===t)return 5124;if(1014===t)return 5125;if(1015===t)return 5126;if(1016===t)return r?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(1022===t)return 6407;if(1023===t)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(1026===t)return 6402;if(1027===t)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===t)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===t)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&null!==(n=e.get("WEBGL_compressed_texture_etc"))){if(37492===t)return n.COMPRESSED_RGB8_ETC2;if(37496===t)return n.COMPRESSED_RGBA8_ETC2_EAC}return 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||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:36492===t?null!==(n=e.get("EXT_texture_compression_bptc"))?t:null:1020===t?r?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function oi(t){Qe.call(this),this.cameras=t||[]}function ai(){et.call(this),this.type="Group"}function si(){this._targetRay=null,this._grip=null}function ci(t,e){var n=this,r=null,i=1,o=null,a="local-floor",s=null,c=[],u=new Map,l=new Qe;l.layers.enable(1),l.viewport=new _;var h=new Qe;h.layers.enable(2),h.viewport=new _;var p=[l,h],d=new oi;d.layers.enable(1),d.layers.enable(2);var f=null,m=null;function v(t){var e=u.get(t.inputSource);e&&e.dispatchEvent({type:t.type})}function g(){u.forEach((function(t,e){t.disconnect(e)})),u.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),E.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(t){o=t,E.setContext(r),E.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function x(t){for(var e=r.inputSources,n=0;n<c.length;n++)u.set(e[n],c[n]);for(n=0;n<t.removed.length;n++){var i=t.removed[n];(o=u.get(i))&&(o.dispatchEvent({type:"disconnected",data:i}),u.delete(i))}for(n=0;n<t.added.length;n++){var o;i=t.added[n];(o=u.get(i))&&o.dispatchEvent({type:"connected",data:i})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){var e=c[t];return void 0===e&&(e=new si,c[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){var e=c[t];return void 0===e&&(e=new si,c[t]=e),e.getGripSpace()},this.setFramebufferScaleFactor=function(t){i=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){a=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getSession=function(){return r},this.setSession=function(t){if(null!==(r=t)){r.addEventListener("select",v),r.addEventListener("selectstart",v),r.addEventListener("selectend",v),r.addEventListener("squeeze",v),r.addEventListener("squeezestart",v),r.addEventListener("squeezeend",v),r.addEventListener("end",g);var n=e.getContextAttributes();!0!==n.xrCompatible&&e.makeXRCompatible();var o={antialias:n.antialias,alpha:n.alpha,depth:n.depth,stencil:n.stencil,framebufferScaleFactor:i},s=new XRWebGLLayer(r,e,o);r.updateRenderState({baseLayer:s}),r.requestReferenceSpace(a).then(y),r.addEventListener("inputsourceschange",x)}};var b=new P,M=new P;function w(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){d.near=h.near=l.near=t.near,d.far=h.far=l.far=t.far,f===d.near&&m===d.far||(r.updateRenderState({depthNear:d.near,depthFar:d.far}),f=d.near,m=d.far);var e=t.parent,n=d.cameras;w(d,e);for(var i=0;i<n.length;i++)w(n[i],e);t.matrixWorld.copy(d.matrixWorld);for(var o=t.children,a=(i=0,o.length);i<a;i++)o[i].updateMatrixWorld(!0);return 2===n.length?function(t,e,n){b.setFromMatrixPosition(e.matrixWorld),M.setFromMatrixPosition(n.matrixWorld);var r=b.distanceTo(M),i=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],u=(i[9]-1)/i[5],l=(i[8]-1)/i[0],h=(o[8]+1)/o[0],p=a*l,d=a*h,f=r/(-l+h),m=f*-l;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=a+f,g=s+f,y=p-m,x=d+(r-m),w=c*s/g*v,_=u*s/g*v;t.projectionMatrix.makePerspective(y,x,w,_,v,g)}(d,l,h):d.projectionMatrix.copy(l.projectionMatrix),d};var S=null;var E=new sn;E.setAnimationLoop((function(e,n){if(null!==(s=n.getViewerPose(o))){var i=s.views,a=r.renderState.baseLayer;t.setFramebuffer(a.framebuffer);var u=!1;i.length!==d.cameras.length&&(d.cameras.length=0,u=!0);for(var l=0;l<i.length;l++){var h=i[l],f=a.getViewport(h),m=p[l];m.matrix.fromArray(h.transform.matrix),m.projectionMatrix.fromArray(h.projectionMatrix),m.viewport.set(f.x,f.y,f.width,f.height),0===l&&d.matrix.copy(m.matrix),!0===u&&d.cameras.push(m)}}var v=r.inputSources;for(l=0;l<c.length;l++){var g=c[l],y=v[l];g.update(y,n,o)}S&&S(e,n)})),this.setAnimationLoop=function(t){S=t},this.dispose=function(){}}function ui(t){function e(e,n,r){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.specularMap&&(e.specularMap.value=n.specularMap);var i,o,a=n.envMap||r;a&&(e.envMap.value=a,e.flipEnvMap.value=a.isCubeTexture?-1:1,e.reflectivity.value=n.reflectivity,e.refractionRatio.value=n.refractionRatio,e.maxMipLevel.value=t.get(a).__maxMipLevel),n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity),n.map?i=n.map:n.specularMap?i=n.specularMap:n.displacementMap?i=n.displacementMap:n.normalMap?i=n.normalMap:n.bumpMap?i=n.bumpMap:n.roughnessMap?i=n.roughnessMap:n.metalnessMap?i=n.metalnessMap:n.alphaMap?i=n.alphaMap:n.emissiveMap&&(i=n.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix)),n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),e.uv2Transform.value.copy(o.matrix))}function n(t,e,n){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||n)&&(t.envMapIntensity.value=e.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,r,i,o,a){r.isMeshBasicMaterial?e(t,r):r.isMeshLambertMaterial?(e(t,r),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,r)):r.isMeshToonMaterial?(e(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshPhongMaterial?(e(t,r),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshStandardMaterial?(e(t,r,i),r.isMeshPhysicalMaterial?function(t,e,r){n(t,e,r),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap);e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate());t.transparency.value=e.transparency}(t,r,i):n(t,r,i)):r.isMeshMatcapMaterial?(e(t,r),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshDepthMaterial?(e(t,r),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isMeshDistanceMaterial?(e(t,r),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,r)):r.isMeshNormalMaterial?(e(t,r),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,r)):r.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,r),r.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,r)):r.isPointsMaterial?function(t,e,n,r){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*r,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,r,o,a):r.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(t,r):r.isShadowMaterial?(t.color.value.copy(r.color),t.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function li(t){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,u=void 0!==t.powerPreference?t.powerPreference:"default",l=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,h=null,p=null;this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,f,m,v,x,b,M,w,S,E,T,L,A,R,O,N,C,I,D,z=this,B=!1,k=null,F=0,U=0,G=null,H=null,V=-1,W={geometry:null,program:null,wireframe:!1},q=null,X=null,Y=new _,J=new _,Z=null,K=e.width,Q=e.height,$=1,tt=null,et=null,rt=new _(0,0,K,Q),it=new _(0,0,K,Q),ot=!1,at=new on,st=new vn,ct=!1,ut=!1,lt=new j,ht=new P;function pt(){return null===G?$:1}try{var dt={alpha:r,depth:i,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:l};if(e.addEventListener("webglcontextlost",gt,!1),e.addEventListener("webglcontextrestored",yt,!1),null===(d=n||e.getContext("webgl",dt)||e.getContext("experimental-webgl",dt)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function ft(){f=new gn(d),!1===(m=new mn(d,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"),D=new ii(d,f,m),(v=new ni(d,f,m)).scissor(J.copy(it).multiplyScalar($).floor()),v.viewport(Y.copy(rt).multiplyScalar($).floor()),x=new bn(d),b=new Gr,M=new ri(d,f,v,b,m,D,x),w=new cn(d,m),S=new yn(d,w,x),E=new _n(d,S,w,x),N=new wn(d),T=new Ur(z,f,m),L=new ui(b),A=new qr,R=new Qr,O=new dn(z,v,E,s),C=new fn(d,f,x,m),I=new xn(d,f,x,m),x.programs=T.programs,z.capabilities=m,z.extensions=f,z.properties=b,z.renderLists=A,z.state=v,z.info=x}ft();var mt=new ci(z,d);this.xr=mt;var vt=new ei(z,E,m.maxTextureSize);function gt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),B=!0}function yt(){console.log("THREE.WebGLRenderer: Context Restored."),B=!1,ft()}function xt(t){var e=t.target;e.removeEventListener("dispose",xt),function(t){bt(t),b.remove(t)}(e)}function bt(t){var e=b.get(t).program;t.program=void 0,void 0!==e&&T.releaseProgram(e)}this.shadowMap=vt,this.getContext=function(){return d},this.getContextAttributes=function(){return d.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 $},this.setPixelRatio=function(t){void 0!==t&&($=t,this.setSize(K,Q,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new y),t.set(K,Q)},this.setSize=function(t,n,r){mt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(K=t,Q=n,e.width=Math.floor(t*$),e.height=Math.floor(n*$),!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 y),t.set(K*$,Q*$).floor()},this.setDrawingBufferSize=function(t,n,r){K=t,Q=n,$=r,e.width=Math.floor(t*r),e.height=Math.floor(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 _),t.copy(Y)},this.getViewport=function(t){return t.copy(rt)},this.setViewport=function(t,e,n,r){t.isVector4?rt.set(t.x,t.y,t.z,t.w):rt.set(t,e,n,r),v.viewport(Y.copy(rt).multiplyScalar($).floor())},this.getScissor=function(t){return t.copy(it)},this.setScissor=function(t,e,n,r){t.isVector4?it.set(t.x,t.y,t.z,t.w):it.set(t,e,n,r),v.scissor(J.copy(it).multiplyScalar($).floor())},this.getScissorTest=function(){return ot},this.setScissorTest=function(t){v.setScissorTest(ot=t)},this.setOpaqueSort=function(t){tt=t},this.setTransparentSort=function(t){et=t},this.getClearColor=function(){return O.getClearColor()},this.setClearColor=function(){O.setClearColor.apply(O,arguments)},this.getClearAlpha=function(){return O.getClearAlpha()},this.setClearAlpha=function(){O.setClearAlpha.apply(O,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),d.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",gt,!1),e.removeEventListener("webglcontextrestored",yt,!1),A.dispose(),R.dispose(),b.dispose(),E.dispose(),mt.dispose(),_t.stop()},this.renderBufferImmediate=function(t,e){v.initAttributes();var n=b.get(t);t.hasPositions&&!n.position&&(n.position=d.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=d.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=d.createBuffer()),t.hasColors&&!n.color&&(n.color=d.createBuffer());var r=e.getAttributes();t.hasPositions&&(d.bindBuffer(34962,n.position),d.bufferData(34962,t.positionArray,35048),v.enableAttribute(r.position),d.vertexAttribPointer(r.position,3,5126,!1,0,0)),t.hasNormals&&(d.bindBuffer(34962,n.normal),d.bufferData(34962,t.normalArray,35048),v.enableAttribute(r.normal),d.vertexAttribPointer(r.normal,3,5126,!1,0,0)),t.hasUvs&&(d.bindBuffer(34962,n.uv),d.bufferData(34962,t.uvArray,35048),v.enableAttribute(r.uv),d.vertexAttribPointer(r.uv,2,5126,!1,0,0)),t.hasColors&&(d.bindBuffer(34962,n.color),d.bufferData(34962,t.colorArray,35048),v.enableAttribute(r.color),d.vertexAttribPointer(r.color,3,5126,!1,0,0)),v.disableUnusedAttributes(),d.drawArrays(4,0,t.count),t.count=0};var Mt=new nt;this.renderBufferDirect=function(t,e,n,r,i,o){null===e&&(e=Mt);var a=i.isMesh&&i.matrixWorld.determinant()<0,s=At(t,e,r,i);v.setMaterial(r,a);var c=!1;W.geometry===n.id&&W.program===s.id&&W.wireframe===(!0===r.wireframe)||(W.geometry=n.id,W.program=s.id,W.wireframe=!0===r.wireframe,c=!0),(r.morphTargets||r.morphNormals)&&(N.update(i,n,r,s),c=!0),!0===i.isInstancedMesh&&(c=!0);var u=n.index,l=n.attributes.position;if(null===u){if(void 0===l||0===l.count)return}else if(0===u.count)return;var h,p=1;!0===r.wireframe&&(u=S.getWireframeAttribute(n),p=2);var g=C;null!==u&&(h=w.get(u),(g=I).setIndex(h)),c&&(!function(t,e,n,r){if(!1===m.isWebGL2&&(t.isInstancedMesh||e.isInstancedBufferGeometry)&&null===f.get("ANGLE_instanced_arrays"))return;v.initAttributes();var i=e.attributes,o=r.getAttributes(),a=n.defaultAttributeValues;for(var s in o){var c=o[s];if(c>=0){var u=i[s];if(void 0!==u){var l=u.normalized,h=u.itemSize;if(void 0===(_=w.get(u)))continue;var p=_.buffer,g=_.type,y=_.bytesPerElement;if(u.isInterleavedBufferAttribute){var x=u.data,b=x.stride,M=u.offset;x&&x.isInstancedInterleavedBuffer?(v.enableAttributeAndDivisor(c,x.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=x.meshPerAttribute*x.count)):v.enableAttribute(c),d.bindBuffer(34962,p),v.vertexAttribPointer(c,h,g,l,b*y,M*y)}else u.isInstancedBufferAttribute?(v.enableAttributeAndDivisor(c,u.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=u.meshPerAttribute*u.count)):v.enableAttribute(c),d.bindBuffer(34962,p),v.vertexAttribPointer(c,h,g,l,0,0)}else if("instanceMatrix"===s){var _;if(void 0===(_=w.get(t.instanceMatrix)))continue;p=_.buffer,g=_.type;v.enableAttributeAndDivisor(c+0,1),v.enableAttributeAndDivisor(c+1,1),v.enableAttributeAndDivisor(c+2,1),v.enableAttributeAndDivisor(c+3,1),d.bindBuffer(34962,p),d.vertexAttribPointer(c+0,4,g,!1,64,0),d.vertexAttribPointer(c+1,4,g,!1,64,16),d.vertexAttribPointer(c+2,4,g,!1,64,32),d.vertexAttribPointer(c+3,4,g,!1,64,48)}else if(void 0!==a){var S=a[s];if(void 0!==S)switch(S.length){case 2:d.vertexAttrib2fv(c,S);break;case 3:d.vertexAttrib3fv(c,S);break;case 4:d.vertexAttrib4fv(c,S);break;default:d.vertexAttrib1fv(c,S)}}}}v.disableUnusedAttributes()}(i,n,r,s),null!==u&&d.bindBuffer(34963,h.buffer));var y=null!==u?u.count:l.count,x=n.drawRange.start*p,b=n.drawRange.count*p,M=null!==o?o.start*p:0,_=null!==o?o.count*p:1/0,E=Math.max(x,M),T=Math.min(y,x+b,M+_)-1,L=Math.max(0,T-E+1);if(0!==L){if(i.isMesh)!0===r.wireframe?(v.setLineWidth(r.wireframeLinewidth*pt()),g.setMode(1)):g.setMode(4);else if(i.isLine){var A=r.linewidth;void 0===A&&(A=1),v.setLineWidth(A*pt()),i.isLineSegments?g.setMode(1):i.isLineLoop?g.setMode(2):g.setMode(3)}else i.isPoints?g.setMode(0):i.isSprite&&g.setMode(4);if(i.isInstancedMesh)g.renderInstances(n,E,L,i.count);else if(n.isInstancedBufferGeometry){var P=Math.min(n.instanceCount,n._maxInstanceCount);g.renderInstances(n,E,L,P)}else g.render(E,L)}},this.compile=function(t,e){(p=R.get(t,e)).init(),t.traverse((function(t){t.isLight&&(p.pushLight(t),t.castShadow&&p.pushShadow(t))})),p.setupLights(e);const n={};t.traverse((function(e){let r=e.material;if(r)if(Array.isArray(r))for(let i=0;i<r.length;i++){let o=r[i];o.uuid in n==!1&&(Lt(o,t,e),n[o.uuid]=!0)}else r.uuid in n==!1&&(Lt(r,t,e),n[r.uuid]=!0)}))};var wt=null;var _t=new sn;function St(t,e,n,r){if(!1!==t.visible){if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)p.pushLight(t),t.castShadow&&p.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||at.intersectsSprite(t)){r&&ht.setFromMatrixPosition(t.matrixWorld).applyMatrix4(lt);var i=E.update(t);(o=t.material).visible&&h.push(t,i,o,n,ht.z,null)}}else if(t.isImmediateRenderObject)r&&ht.setFromMatrixPosition(t.matrixWorld).applyMatrix4(lt),h.push(t,null,t.material,n,ht.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==x.render.frame&&(t.skeleton.update(),t.skeleton.frame=x.render.frame),!t.frustumCulled||at.intersectsObject(t))){r&&ht.setFromMatrixPosition(t.matrixWorld).applyMatrix4(lt);i=E.update(t);var o=t.material;if(Array.isArray(o))for(var a=i.groups,s=0,c=a.length;s<c;s++){var u=a[s],l=o[u.materialIndex];l&&l.visible&&h.push(t,i,l,n,ht.z,u)}else o.visible&&h.push(t,i,o,n,ht.z,null)}var d=t.children;for(s=0,c=d.length;s<c;s++)St(d[s],e,n,r)}}function Et(t,e,n,r){for(var i=0,o=t.length;i<o;i++){var a=t[i],s=a.object,c=a.geometry,u=void 0===r?a.material:r,l=a.group;if(n.isArrayCamera){X=n;for(var h=n.cameras,d=0,f=h.length;d<f;d++){var m=h[d];s.layers.test(m.layers)&&(v.viewport(Y.copy(m.viewport)),p.setupLights(m),Tt(s,e,m,c,u,l))}}else X=null,Tt(s,e,n,c,u,l)}}function Tt(t,e,n,r,i,o){if(t.onBeforeRender(z,e,n,r,i,o),p=R.get(e,X||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var a=At(n,e,i,t);v.setMaterial(i),W.geometry=null,W.program=null,W.wireframe=!1,function(t,e){t.render((function(t){z.renderBufferImmediate(t,e)}))}(t,a)}else z.renderBufferDirect(n,e,r,i,t,o);t.onAfterRender(z,e,n,r,i,o),p=R.get(e,X||n)}function Lt(t,e,n){var r=b.get(t),i=p.state.lights,o=p.state.shadowsArray,a=i.state.version,s=T.getParameters(t,i.state,o,e,st.numPlanes,st.numIntersection,n),c=T.getProgramCacheKey(s),u=r.program,l=!0;if(void 0===u)t.addEventListener("dispose",xt);else if(u.cacheKey!==c)bt(t);else if(r.lightsStateVersion!==a)r.lightsStateVersion=a,l=!1;else{if(void 0!==s.shaderID)return;l=!1}l&&(u=T.acquireProgram(s,c),r.program=u,r.uniforms=s.uniforms,r.outputEncoding=s.outputEncoding,t.program=u);var h=u.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var d=0;d<z.maxMorphTargets;d++)h["morphTarget"+d]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(d=0;d<z.maxMorphNormals;d++)h["morphNormal"+d]>=0&&t.numSupportedMorphNormals++}var f=r.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=st.numPlanes,r.numIntersection=st.numIntersection,f.clippingPlanes=st.uniform),r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=a,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),v=Mr.seqWithValue(m.seq,f);r.uniformsList=v}function At(t,e,n,r){M.resetTextureUnits();var i=e.fog,o=n.isMeshStandardMaterial?e.environment:null,a=null===G?z.outputEncoding:G.texture.encoding,s=b.get(n),c=p.state.lights;if(ct&&(ut||t!==q)){var u=t===q&&n.id===V;st.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,s,u)}n.version===s.__version?void 0===s.program||n.fog&&s.fog!==i||s.environment!==o||s.needsLights&&s.lightsStateVersion!==c.state.version?Lt(n,e,r):void 0===s.numClippingPlanes||s.numClippingPlanes===st.numPlanes&&s.numIntersection===st.numIntersection?s.outputEncoding!==a&&Lt(n,e,r):Lt(n,e,r):(Lt(n,e,r),s.__version=n.version);var l,h,f=!1,y=!1,x=!1,w=s.program,_=w.getUniforms(),S=s.uniforms;if(v.useProgram(w.program)&&(f=!0,y=!0,x=!0),n.id!==V&&(V=n.id,y=!0),f||q!==t){if(_.setValue(d,"projectionMatrix",t.projectionMatrix),m.logarithmicDepthBuffer&&_.setValue(d,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),q!==t&&(q=t,y=!0,x=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var E=_.map.cameraPosition;void 0!==E&&E.setValue(d,ht.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&_.setValue(d,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&_.setValue(d,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){_.setOptional(d,r,"bindMatrix"),_.setOptional(d,r,"bindMatrixInverse");var T=r.skeleton;if(T){var A=T.bones;if(m.floatVertexTextures){if(void 0===T.boneTexture){var P=Math.sqrt(4*A.length);P=g.ceilPowerOfTwo(P),P=Math.max(P,4);var R=new Float32Array(P*P*4);R.set(T.boneMatrices);var O=new en(R,P,P,1023,1015);T.boneMatrices=R,T.boneTexture=O,T.boneTextureSize=P}_.setValue(d,"boneTexture",T.boneTexture,M),_.setValue(d,"boneTextureSize",T.boneTextureSize)}else _.setOptional(d,T,"boneMatrices")}}return(y||s.receiveShadow!==r.receiveShadow)&&(s.receiveShadow=r.receiveShadow,_.setValue(d,"receiveShadow",r.receiveShadow)),y&&(_.setValue(d,"toneMappingExposure",z.toneMappingExposure),_.setValue(d,"toneMappingWhitePoint",z.toneMappingWhitePoint),s.needsLights&&(h=x,(l=S).ambientLightColor.needsUpdate=h,l.lightProbe.needsUpdate=h,l.directionalLights.needsUpdate=h,l.directionalLightShadows.needsUpdate=h,l.pointLights.needsUpdate=h,l.pointLightShadows.needsUpdate=h,l.spotLights.needsUpdate=h,l.spotLightShadows.needsUpdate=h,l.rectAreaLights.needsUpdate=h,l.hemisphereLights.needsUpdate=h),i&&n.fog&&L.refreshFogUniforms(S,i),L.refreshMaterialUniforms(S,n,o,$,Q),void 0!==S.ltc_1&&(S.ltc_1.value=an.LTC_1),void 0!==S.ltc_2&&(S.ltc_2.value=an.LTC_2),Mr.upload(d,s.uniformsList,S,M)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Mr.upload(d,s.uniformsList,S,M),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&_.setValue(d,"center",r.center),_.setValue(d,"modelViewMatrix",r.modelViewMatrix),_.setValue(d,"normalMatrix",r.normalMatrix),_.setValue(d,"modelMatrix",r.matrixWorld),w}_t.setAnimationLoop((function(t){mt.isPresenting||wt&&wt(t)})),"undefined"!=typeof window&&_t.setContext(window),this.setAnimationLoop=function(t){wt=t,mt.setAnimationLoop(t),_t.start()},this.render=function(t,e){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),e&&e.isCamera){if(!B){W.geometry=null,W.program=null,W.wireframe=!1,V=-1,q=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),mt.enabled&&mt.isPresenting&&(e=mt.getCamera(e)),t.onBeforeRender(z,t,e,n||G),(p=R.get(t,e)).init(),lt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),at.setFromProjectionMatrix(lt),ut=this.localClippingEnabled,ct=st.init(this.clippingPlanes,ut,e),(h=A.get(t,e)).init(),St(t,e,0,z.sortObjects),h.finish(),!0===z.sortObjects&&h.sort(tt,et),ct&&st.beginShadows();var i=p.state.shadowsArray;vt.render(i,t,e),p.setupLights(e),ct&&st.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),O.render(h,t,e,r);var o=h.opaque,a=h.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&Et(o,t,e,s),a.length&&Et(a,t,e,s)}else o.length&&Et(o,t,e),a.length&&Et(a,t,e);t.onAfterRender(z,t,e),null!==G&&(M.updateRenderTargetMipmap(G),M.updateMultisampleRenderTarget(G)),v.buffers.depth.setTest(!0),v.buffers.depth.setMask(!0),v.buffers.color.setMask(!0),v.setPolygonOffset(!1),h=null,p=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){k!==t&&null===G&&d.bindFramebuffer(36160,t),k=t},this.getActiveCubeFace=function(){return F},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return G},this.setRenderTarget=function(t,e,n){G=t,F=e,U=n,t&&void 0===b.get(t).__webglFramebuffer&&M.setupRenderTarget(t);var r=k,i=!1;if(t){var o=b.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=o[e||0],i=!0):r=t.isWebGLMultisampleRenderTarget?b.get(t).__webglMultisampledFramebuffer:o,Y.copy(t.viewport),J.copy(t.scissor),Z=t.scissorTest}else Y.copy(rt).multiplyScalar($).floor(),J.copy(it).multiplyScalar($).floor(),Z=ot;if(H!==r&&(d.bindFramebuffer(36160,r),H=r),v.viewport(Y),v.scissor(J),v.setScissorTest(Z),i){var a=b.get(t.texture);d.framebufferTexture2D(36160,36064,34069+(e||0),a.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,r,i,o,a){if(t&&t.isWebGLRenderTarget){var s=b.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var c=!1;s!==H&&(d.bindFramebuffer(36160,s),c=!0);try{var u=t.texture,l=u.format,h=u.type;if(1023!==l&&D.convert(l)!==d.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===h||D.convert(h)===d.getParameter(35738)||1015===h&&(m.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||1016===h&&(m.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===d.checkFramebufferStatus(36160)?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&d.readPixels(e,n,r,i,D.convert(l),D.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&d.bindFramebuffer(36160,H)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(e.image.width*r),o=Math.floor(e.image.height*r),a=D.convert(e.format);M.setTexture2D(e,0),d.copyTexImage2D(3553,n,a,t.x,t.y,i,o,0),v.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r){void 0===r&&(r=0);var i=e.image.width,o=e.image.height,a=D.convert(n.format),s=D.convert(n.type);M.setTexture2D(n,0),e.isDataTexture?d.texSubImage2D(3553,r,t.x,t.y,i,o,a,s,e.image.data):e.isCompressedTexture?d.compressedTexSubImage2D(3553,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):d.texSubImage2D(3553,r,t.x,t.y,a,s,e.image),0===r&&n.generateMipmaps&&d.generateMipmap(3553),v.unbindTexture()},this.initTexture=function(t){M.setTexture2D(t,0),v.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function hi(t,e){this.name="",this.color=new qt(t),this.density=void 0!==e?e:25e-5}function pi(t,e,n){this.name="",this.color=new qt(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function di(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}oi.prototype=Object.assign(Object.create(Qe.prototype),{constructor:oi,isArrayCamera:!0}),ai.prototype=Object.assign(Object.create(et.prototype),{constructor:ai,isGroup:!0}),Object.assign(si.prototype,{constructor:si,getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new ai,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new ai,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),this},update:function(t,e,n){var r=null,i=null,o=this._targetRay,a=this._grip;return t&&(null!==o&&null!==(r=e.getPose(t.targetRaySpace,n))&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)),null!==a&&t.gripSpace&&null!==(i=e.getPose(t.gripSpace,n))&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),null!==o&&(o.visible=null!==r),null!==a&&(a.visible=null!==i),this}}),Object.assign(ci.prototype,d.prototype),Object.assign(hi.prototype,{isFogExp2:!0,clone:function(){return new hi(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(pi.prototype,{isFog:!0,clone:function(){return new pi(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(di.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(di.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,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}});var fi,mi=new P;function vi(t,e,n,r){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function gi(t){Qt.call(this),this.type="SpriteMaterial",this.color=new qt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}Object.defineProperties(vi.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(vi.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(var e=0,n=this.data.count;e<n;e++)mi.x=this.getX(e),mi.y=this.getY(e),mi.z=this.getZ(e),mi.applyMatrix4(t),this.setXYZ(e,mi.x,mi.y,mi.z);return this},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},clone:function(){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],e=0;e<this.count;e++)for(var n=e*this.data.stride+this.offset,r=0;r<this.itemSize;r++)t.push(this.data.array[n+r]);return new ee(new this.array.constructor(t),this.itemSize,this.normalized)},toJSON:function(){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");for(var t=[],e=0;e<this.count;e++)for(var n=e*this.data.stride+this.offset,r=0;r<this.itemSize;r++)t.push(this.data.array[n+r]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}}),gi.prototype=Object.create(Qt.prototype),gi.prototype.constructor=gi,gi.prototype.isSpriteMaterial=!0,gi.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};var yi=new P,xi=new P,bi=new P,Mi=new y,wi=new y,_i=new j,Si=new P,Ei=new P,Ti=new P,Li=new y,Ai=new y,Pi=new y;function Ri(t){if(et.call(this),this.type="Sprite",void 0===fi){fi=new be;var e=new di(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);fi.setIndex([0,1,2,0,2,3]),fi.setAttribute("position",new vi(e,3,0,!1)),fi.setAttribute("uv",new vi(e,2,3,!1))}this.geometry=fi,this.material=void 0!==t?t:new gi,this.center=new y(.5,.5)}function Oi(t,e,n,r,i,o){Mi.subVectors(t,n).addScalar(.5).multiply(r),void 0!==i?(wi.x=o*Mi.x-i*Mi.y,wi.y=i*Mi.x+o*Mi.y):wi.copy(Mi),t.copy(e),t.x+=wi.x,t.y+=wi.y,t.applyMatrix4(_i)}Ri.prototype=Object.assign(Object.create(et.prototype),{constructor:Ri,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),xi.setFromMatrixScale(this.matrixWorld),_i.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),bi.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&xi.multiplyScalar(-bi.z);var n,r,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var o=this.center;Oi(Si.set(-.5,-.5,0),bi,o,xi,n,r),Oi(Ei.set(.5,-.5,0),bi,o,xi,n,r),Oi(Ti.set(.5,.5,0),bi,o,xi,n,r),Li.set(0,0),Ai.set(1,0),Pi.set(1,1);var a=t.ray.intersectTriangle(Si,Ei,Ti,!1,yi);if(null!==a||(Oi(Ei.set(-.5,.5,0),bi,o,xi,n,r),Ai.set(0,1),null!==(a=t.ray.intersectTriangle(Si,Ti,Ei,!1,yi)))){var s=t.ray.origin.distanceTo(yi);s<t.near||s>t.far||e.push({distance:s,point:yi.clone(),uv:Gt.getUV(yi,Si,Ei,Ti,Li,Ai,Pi,new y),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return et.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var Ni,Ci,Ii,Di,zi,ji=new P,Bi=new P;function ki(){et.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Fi(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Be.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new j,this.bindMatrixInverse=new j}ki.prototype=Object.assign(Object.create(et.prototype),{constructor:ki,isLOD:!0,copy:function(t){et.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,r=e.length;n<r;n++){var i=e[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,r=0;r<n.length&&!(e<n[r].distance);r++);return n.splice(r,0,{distance:e,object:t}),this.add(t),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(t){var e=this.levels;if(e.length>0){for(var n=1,r=e.length;n<r&&!(t<e[n].distance);n++);return e[n-1].object}return null},raycast:function(t,e){if(this.levels.length>0){ji.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(ji);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){ji.setFromMatrixPosition(t.matrixWorld),Bi.setFromMatrixPosition(this.matrixWorld);var n=ji.distanceTo(Bi)/t.zoom;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(this._currentLevel=r-1;r<i;r++)e[r].object.visible=!1}},toJSON:function(t){var e=et.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var o=n[r];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),Fi.prototype=Object.assign(Object.create(Be.prototype),{constructor:Fi,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new _,e=this.geometry.attributes.skinWeight,n=0,r=e.count;n<r;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Be.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)},boneTransform:(Ni=new P,Ci=new _,Ii=new _,Di=new P,zi=new j,function(t,e){var n=this.skeleton,r=this.geometry;Ci.fromBufferAttribute(r.attributes.skinIndex,t),Ii.fromBufferAttribute(r.attributes.skinWeight,t),Ni.fromBufferAttribute(r.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(var i=0;i<4;i++){var o=Ii.getComponent(i);if(0!==o){var a=Ci.getComponent(i);zi.multiplyMatrices(n.bones[a].matrixWorld,n.boneInverses[a]),e.addScaledVector(Di.copy(Ni).applyMatrix4(zi),o)}}return e.applyMatrix4(this.bindMatrixInverse)})});var Ui=new j,Gi=new j;function Hi(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new j)}}function Vi(){et.call(this),this.type="Bone"}Object.assign(Hi.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new j;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update: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:Gi;Ui.multiplyMatrices(a,e[i]),Ui.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=!0)},clone:function(){return new Hi(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var r=this.bones[e];if(r.name===t)return r}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Vi.prototype=Object.assign(Object.create(et.prototype),{constructor:Vi,isBone:!0});var Wi=new j,qi=new j,Xi=[],Yi=new Be;function Ji(t,e,n){Be.call(this,t,e),this.instanceMatrix=new ee(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function Zi(t){Qt.call(this),this.type="LineBasicMaterial",this.color=new qt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}Ji.prototype=Object.assign(Object.create(Be.prototype),{constructor:Ji,isInstancedMesh:!0,getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){var n=this.matrixWorld,r=this.count;if(Yi.geometry=this.geometry,Yi.material=this.material,void 0!==Yi.material)for(var i=0;i<r;i++){this.getMatrixAt(i,Wi),qi.multiplyMatrices(n,Wi),Yi.matrixWorld=qi,Yi.raycast(t,Xi);for(var o=0,a=Xi.length;o<a;o++){var s=Xi[o];s.instanceId=i,s.object=this,e.push(s)}Xi.length=0}},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),Zi.prototype=Object.create(Qt.prototype),Zi.prototype.constructor=Zi,Zi.prototype.isLineBasicMaterial=!0,Zi.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this};var Ki=new P,Qi=new P,$i=new j,to=new Lt,eo=new xt;function no(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),et.call(this),this.type="Line",this.geometry=void 0!==t?t:new be,this.material=void 0!==e?e:new Zi,this.updateMorphTargets()}no.prototype=Object.assign(Object.create(et.prototype),{constructor:no,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],r=1,i=e.count;r<i;r++)Ki.fromBufferAttribute(e,r-1),Qi.fromBufferAttribute(e,r),n[r]=n[r-1],n[r]+=Ki.distanceTo(Qi);t.setAttribute("lineDistance",new ue(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;(n=t.lineDistances)[0]=0;for(r=1,i=o.length;r<i;r++)n[r]=n[r-1],n[r]+=o[r-1].distanceTo(o[r])}return this},raycast:function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),eo.copy(n.boundingSphere),eo.applyMatrix4(r),eo.radius+=i,!1!==t.ray.intersectsSphere(eo)){$i.getInverse(r),to.copy(t.ray).applyMatrix4($i);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,s=new P,c=new P,u=new P,l=new P,h=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var p=n.index,d=n.attributes.position.array;if(null!==p)for(var f=p.array,m=0,v=f.length-1;m<v;m+=h){var g=f[m],y=f[m+1];if(s.fromArray(d,3*g),c.fromArray(d,3*y),!(to.distanceSqToSegment(s,c,l,u)>a))l.applyMatrix4(this.matrixWorld),(M=t.ray.origin.distanceTo(l))<t.near||M>t.far||e.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(m=0,v=d.length/3-1;m<v;m+=h){if(s.fromArray(d,3*m),c.fromArray(d,3*m+3),!(to.distanceSqToSegment(s,c,l,u)>a))l.applyMatrix4(this.matrixWorld),(M=t.ray.origin.distanceTo(l))<t.near||M>t.far||e.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else if(n.isGeometry){var x=n.vertices,b=x.length;for(m=0;m<b-1;m+=h){var M;if(!(to.distanceSqToSegment(x[m],x[m+1],l,u)>a))l.applyMatrix4(this.matrixWorld),(M=t.ray.origin.distanceTo(l))<t.near||M>t.far||e.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(o.length>0){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&&s.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ro=new P,io=new P;function oo(t,e){no.call(this,t,e),this.type="LineSegments"}function ao(t,e){no.call(this,t,e),this.type="LineLoop"}function so(t){Qt.call(this),this.type="PointsMaterial",this.color=new qt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}oo.prototype=Object.assign(Object.create(no.prototype),{constructor:oo,isLineSegments:!0,computeLineDistances: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)ro.fromBufferAttribute(e,r),io.fromBufferAttribute(e,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+ro.distanceTo(io);t.setAttribute("lineDistance",new ue(n,1))}else console.warn("THREE.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)ro.copy(o[r]),io.copy(o[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+ro.distanceTo(io)}return this}}),ao.prototype=Object.assign(Object.create(no.prototype),{constructor:ao,isLineLoop:!0}),so.prototype=Object.create(Qt.prototype),so.prototype.constructor=so,so.prototype.isPointsMaterial=!0,so.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};var co=new j,uo=new Lt,lo=new xt,ho=new P;function po(t,e){et.call(this),this.type="Points",this.geometry=void 0!==t?t:new be,this.material=void 0!==e?e:new so,this.updateMorphTargets()}function fo(t,e,n,r,i,o,a){var s=uo.distanceSqToPoint(t);if(s<n){var c=new P;uo.closestPointToPoint(t,c),c.applyMatrix4(r);var u=i.ray.origin.distanceTo(c);if(u<i.near||u>i.far)return;o.push({distance:u,distanceToRay:Math.sqrt(s),point:c,index:e,face:null,object:a})}}function mo(t,e,n,r,i,o,a,s,c){w.call(this,t,e,n,r,i,o,a,s,c),this.format=void 0!==a?a:1022,this.minFilter=void 0!==o?o:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1}function vo(t,e,n,r,i,o,a,s,c,u,l,h){w.call(this,null,o,a,s,c,u,r,i,l,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function go(t,e,n,r,i,o,a,s,c){w.call(this,t,e,n,r,i,o,a,s,c),this.needsUpdate=!0}function yo(t,e,n,r,i,o,a,s,c,u){if(1026!==(u=void 0!==u?u:1026)&&1027!==u)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===u&&(n=1012),void 0===n&&1027===u&&(n=1020),w.call(this,null,r,i,o,a,s,u,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function xo(t){be.call(this),this.type="WireframeGeometry";var e,n,r,i,o,a,s,c,u,l,h=[],p=[0,0],d={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,r=m.length;e<r;e++){var v=m[e];for(n=0;n<3;n++)s=v[f[n]],c=v[f[(n+1)%3]],p[0]=Math.min(s,c),p[1]=Math.max(s,c),void 0===d[u=p[0]+","+p[1]]&&(d[u]={index1:p[0],index2:p[1]})}for(u in d)a=d[u],l=t.vertices[a.index1],h.push(l.x,l.y,l.z),l=t.vertices[a.index2],h.push(l.x,l.y,l.z)}else if(t&&t.isBufferGeometry){var g,y,x,b,M,w,_;if(l=new P,null!==t.index){for(g=t.attributes.position,y=t.index,0===(x=t.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),i=0,o=x.length;i<o;++i)for(e=M=(b=x[i]).start,r=M+b.count;e<r;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),c=y.getX(e+(n+1)%3),p[0]=Math.min(s,c),p[1]=Math.max(s,c),void 0===d[u=p[0]+","+p[1]]&&(d[u]={index1:p[0],index2:p[1]});for(u in d)a=d[u],l.fromBufferAttribute(g,a.index1),h.push(l.x,l.y,l.z),l.fromBufferAttribute(g,a.index2),h.push(l.x,l.y,l.z)}else for(e=0,r=(g=t.attributes.position).count/3;e<r;e++)for(n=0;n<3;n++)w=3*e+n,l.fromBufferAttribute(g,w),h.push(l.x,l.y,l.z),_=3*e+(n+1)%3,l.fromBufferAttribute(g,_),h.push(l.x,l.y,l.z)}this.setAttribute("position",new ue(h,3))}function bo(t,e,n){We.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Mo(t,e,n)),this.mergeVertices()}function Mo(t,e,n){be.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var r,i,o=[],a=[],s=[],c=[],u=1e-5,l=new P,h=new P,p=new P,d=new P,f=new P;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=e+1;for(r=0;r<=n;r++){var v=r/n;for(i=0;i<=e;i++){var g=i/e;t(g,v,h),a.push(h.x,h.y,h.z),g-u>=0?(t(g-u,v,p),d.subVectors(h,p)):(t(g+u,v,p),d.subVectors(p,h)),v-u>=0?(t(g,v-u,p),f.subVectors(h,p)):(t(g,v+u,p),f.subVectors(p,h)),l.crossVectors(d,f).normalize(),s.push(l.x,l.y,l.z),c.push(g,v)}}for(r=0;r<n;r++)for(i=0;i<e;i++){var y=r*m+i,x=r*m+i+1,b=(r+1)*m+i+1,M=(r+1)*m+i;o.push(y,x,M),o.push(x,b,M)}this.setIndex(o),this.setAttribute("position",new ue(a,3)),this.setAttribute("normal",new ue(s,3)),this.setAttribute("uv",new ue(c,2))}function wo(t,e,n,r){We.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},this.fromBufferGeometry(new _o(t,e,n,r)),this.mergeVertices()}function _o(t,e,n,r){be.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:r},n=n||1;var i=[],o=[];function a(t,e,n,r){var i,o,a=Math.pow(2,r),c=[];for(i=0;i<=a;i++){c[i]=[];var u=t.clone().lerp(n,i/a),l=e.clone().lerp(n,i/a),h=a-i;for(o=0;o<=h;o++)c[i][o]=0===o&&i===a?u:u.clone().lerp(l,o/h)}for(i=0;i<a;i++)for(o=0;o<2*(a-i)-1;o++){var p=Math.floor(o/2);o%2==0?(s(c[i][p+1]),s(c[i+1][p]),s(c[i][p])):(s(c[i][p+1]),s(c[i+1][p+1]),s(c[i+1][p]))}}function s(t){i.push(t.x,t.y,t.z)}function c(e,n){var r=3*e;n.x=t[r+0],n.y=t[r+1],n.z=t[r+2]}function u(t,e,n,r){r<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=r/2/Math.PI+.5)}function l(t){return Math.atan2(t.z,-t.x)}function h(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){for(var n=new P,r=new P,i=new P,o=0;o<e.length;o+=3)c(e[o+0],n),c(e[o+1],r),c(e[o+2],i),a(n,r,i,t)}(r=r||0),function(t){for(var e=new P,n=0;n<i.length;n+=3)e.x=i[n+0],e.y=i[n+1],e.z=i[n+2],e.normalize().multiplyScalar(t),i[n+0]=e.x,i[n+1]=e.y,i[n+2]=e.z}(n),function(){for(var t=new P,e=0;e<i.length;e+=3){t.x=i[e+0],t.y=i[e+1],t.z=i[e+2];var n=l(t)/2/Math.PI+.5,r=h(t)/Math.PI+.5;o.push(n,1-r)}(function(){for(var t=new P,e=new P,n=new P,r=new P,a=new y,s=new y,c=new y,h=0,p=0;h<i.length;h+=9,p+=6){t.set(i[h+0],i[h+1],i[h+2]),e.set(i[h+3],i[h+4],i[h+5]),n.set(i[h+6],i[h+7],i[h+8]),a.set(o[p+0],o[p+1]),s.set(o[p+2],o[p+3]),c.set(o[p+4],o[p+5]),r.copy(t).add(e).add(n).divideScalar(3);var d=l(r);u(a,p+0,t,d),u(s,p+2,e,d),u(c,p+4,n,d)}})(),function(){for(var t=0;t<o.length;t+=6){var e=o[t+0],n=o[t+2],r=o[t+4],i=Math.max(e,n,r),a=Math.min(e,n,r);i>.9&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),r<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new ue(i,3)),this.setAttribute("normal",new ue(i.slice(),3)),this.setAttribute("uv",new ue(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function So(t,e){We.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Eo(t,e)),this.mergeVertices()}function Eo(t,e){_o.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 To(t,e){We.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Lo(t,e)),this.mergeVertices()}function Lo(t,e){_o.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ao(t,e){We.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Po(t,e)),this.mergeVertices()}function Po(t,e){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];_o.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ro(t,e){We.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Oo(t,e)),this.mergeVertices()}function Oo(t,e){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];_o.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function No(t,e,n,r,i,o){We.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Co(t,e,n,r,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Co(t,e,n,r,i){be.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},e=e||64,n=n||1,r=r||8,i=i||!1;var o=t.computeFrenetFrames(e,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new P,u=new P,l=new y,h=new P,p=[],d=[],f=[],m=[];function v(i){h=t.getPointAt(i/e,h);var a=o.normals[i],l=o.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),v=-Math.cos(f);u.x=v*a.x+m*l.x,u.y=v*a.y+m*l.y,u.z=v*a.z+m*l.z,u.normalize(),d.push(u.x,u.y,u.z),c.x=h.x+n*u.x,c.y=h.y+n*u.y,c.z=h.z+n*u.z,p.push(c.x,c.y,c.z)}}!function(){for(a=0;a<e;a++)v(a);v(!1===i?e:0),function(){for(a=0;a<=e;a++)for(s=0;s<=r;s++)l.x=a/e,l.y=s/r,f.push(l.x,l.y)}(),function(){for(s=1;s<=e;s++)for(a=1;a<=r;a++){var t=(r+1)*(s-1)+(a-1),n=(r+1)*s+(a-1),i=(r+1)*s+a,o=(r+1)*(s-1)+a;m.push(t,n,o),m.push(n,i,o)}}()}(),this.setIndex(m),this.setAttribute("position",new ue(p,3)),this.setAttribute("normal",new ue(d,3)),this.setAttribute("uv",new ue(f,2))}function Io(t,e,n,r,i,o,a){We.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Do(t,e,n,r,i,o)),this.mergeVertices()}function Do(t,e,n,r,i,o){be.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:r,p:i,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,o=o||3;var a,s,c=[],u=[],l=[],h=[],p=new P,d=new P,f=new P,m=new P,v=new P,g=new P,y=new P;for(a=0;a<=n;++a){var x=a/n*i*Math.PI*2;for(L(x,i,o,t,f),L(x+.01,i,o,t,m),g.subVectors(m,f),y.addVectors(m,f),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize(),s=0;s<=r;++s){var b=s/r*Math.PI*2,M=-e*Math.cos(b),w=e*Math.sin(b);p.x=f.x+(M*y.x+w*v.x),p.y=f.y+(M*y.y+w*v.y),p.z=f.z+(M*y.z+w*v.z),u.push(p.x,p.y,p.z),d.subVectors(p,f).normalize(),l.push(d.x,d.y,d.z),h.push(a/n),h.push(s/r)}}for(s=1;s<=n;s++)for(a=1;a<=r;a++){var _=(r+1)*(s-1)+(a-1),S=(r+1)*s+(a-1),E=(r+1)*s+a,T=(r+1)*(s-1)+a;c.push(_,S,T),c.push(S,E,T)}function L(t,e,n,r,i){var o=Math.cos(t),a=Math.sin(t),s=n/e*t,c=Math.cos(s);i.x=r*(2+c)*.5*o,i.y=r*(2+c)*a*.5,i.z=r*Math.sin(s)*.5}this.setIndex(c),this.setAttribute("position",new ue(u,3)),this.setAttribute("normal",new ue(l,3)),this.setAttribute("uv",new ue(h,2))}function zo(t,e,n,r,i){We.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new jo(t,e,n,r,i)),this.mergeVertices()}function jo(t,e,n,r,i){be.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},t=t||1,e=e||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var o,a,s=[],c=[],u=[],l=[],h=new P,p=new P,d=new P;for(o=0;o<=n;o++)for(a=0;a<=r;a++){var f=a/r*i,m=o/n*Math.PI*2;p.x=(t+e*Math.cos(m))*Math.cos(f),p.y=(t+e*Math.cos(m))*Math.sin(f),p.z=e*Math.sin(m),c.push(p.x,p.y,p.z),h.x=t*Math.cos(f),h.y=t*Math.sin(f),d.subVectors(p,h).normalize(),u.push(d.x,d.y,d.z),l.push(a/r),l.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=r;a++){var v=(r+1)*o+a-1,g=(r+1)*(o-1)+a-1,y=(r+1)*(o-1)+a,x=(r+1)*o+a;s.push(v,g,x),s.push(g,y,x)}this.setIndex(s),this.setAttribute("position",new ue(c,3)),this.setAttribute("normal",new ue(u,3)),this.setAttribute("uv",new ue(l,2))}po.prototype=Object.assign(Object.create(et.prototype),{constructor:po,isPoints:!0,raycast:function(t,e){var n=this.geometry,r=this.matrixWorld,i=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),lo.copy(n.boundingSphere),lo.applyMatrix4(r),lo.radius+=i,!1!==t.ray.intersectsSphere(lo)){co.getInverse(r),uo.copy(t.ray).applyMatrix4(co);var o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){var s=n.index,c=n.attributes.position.array;if(null!==s)for(var u=s.array,l=0,h=u.length;l<h;l++){var p=u[l];ho.fromArray(c,3*p),fo(ho,p,a,r,t,e,this)}else{l=0;for(var d=c.length/3;l<d;l++)ho.fromArray(c,3*l),fo(ho,l,a,r,t,e,this)}}else{var f=n.vertices;for(l=0,d=f.length;l<d;l++)fo(f[l],l,a,r,t,e,this)}}},updateMorphTargets:function(){var t,e,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,o=Object.keys(i);if(o.length>0){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&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),mo.prototype=Object.assign(Object.create(w.prototype),{constructor:mo,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),vo.prototype=Object.create(w.prototype),vo.prototype.constructor=vo,vo.prototype.isCompressedTexture=!0,go.prototype=Object.create(w.prototype),go.prototype.constructor=go,go.prototype.isCanvasTexture=!0,yo.prototype=Object.create(w.prototype),yo.prototype.constructor=yo,yo.prototype.isDepthTexture=!0,xo.prototype=Object.create(be.prototype),xo.prototype.constructor=xo,bo.prototype=Object.create(We.prototype),bo.prototype.constructor=bo,Mo.prototype=Object.create(be.prototype),Mo.prototype.constructor=Mo,wo.prototype=Object.create(We.prototype),wo.prototype.constructor=wo,_o.prototype=Object.create(be.prototype),_o.prototype.constructor=_o,So.prototype=Object.create(We.prototype),So.prototype.constructor=So,Eo.prototype=Object.create(_o.prototype),Eo.prototype.constructor=Eo,To.prototype=Object.create(We.prototype),To.prototype.constructor=To,Lo.prototype=Object.create(_o.prototype),Lo.prototype.constructor=Lo,Ao.prototype=Object.create(We.prototype),Ao.prototype.constructor=Ao,Po.prototype=Object.create(_o.prototype),Po.prototype.constructor=Po,Ro.prototype=Object.create(We.prototype),Ro.prototype.constructor=Ro,Oo.prototype=Object.create(_o.prototype),Oo.prototype.constructor=Oo,No.prototype=Object.create(We.prototype),No.prototype.constructor=No,Co.prototype=Object.create(be.prototype),Co.prototype.constructor=Co,Co.prototype.toJSON=function(){var t=be.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},Io.prototype=Object.create(We.prototype),Io.prototype.constructor=Io,Do.prototype=Object.create(be.prototype),Do.prototype.constructor=Do,zo.prototype=Object.create(We.prototype),zo.prototype.constructor=zo,jo.prototype=Object.create(be.prototype),jo.prototype.constructor=jo;var Bo=function(t,e,n){n=n||2;var r,i,o,a,s,c,u,l=e&&e.length,h=l?e[0]*n:t.length,p=ko(t,0,h,n,!0),d=[];if(!p||p.next===p.prev)return d;if(l&&(p=function(t,e,n,r){var i,o,a,s,c,u=[];for(i=0,o=e.length;i<o;i++)a=e[i]*r,s=i<o-1?e[i+1]*r:t.length,(c=ko(t,a,s,r,!1))===c.next&&(c.steiner=!0),u.push(Zo(c));for(u.sort(qo),i=0;i<u.length;i++)Xo(u[i],n),n=Fo(n,n.next);return n}(t,e,p,n)),t.length>80*n){r=o=t[0],i=a=t[1];for(var f=n;f<h;f+=n)(s=t[f])<r&&(r=s),(c=t[f+1])<i&&(i=c),s>o&&(o=s),c>a&&(a=c);u=0!==(u=Math.max(o-r,a-i))?1/u:0}return Uo(p,d,n,r,i,u),d};function ko(t,e,n,r,i){var o,a;if(i===function(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}(t,e,n,r)>0)for(o=e;o<n;o+=r)a=aa(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=aa(o,t[o],t[o+1],a);return a&&ta(a,a.next)&&(sa(a),a=a.next),a}function Fo(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!ta(r,r.next)&&0!==$o(r.prev,r,r.next))r=r.next;else{if(sa(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function Uo(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Jo(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,c,u=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<u&&(s++,r=r.nextZ);e++);for(c=u;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1)}(i)}(t,r,i,o);for(var s,c,u=t;t.prev!==t.next;)if(s=t.prev,c=t.next,o?Ho(t,r,i,o):Go(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),sa(t),t=c.next,u=c.next;else if((t=c)===u){a?1===a?Uo(t=Vo(Fo(t),e,n),e,n,r,i,o,2):2===a&&Wo(t,e,n,r,i,o):Uo(Fo(t),e,n,r,i,o,1);break}}}function Go(t){var e=t.prev,n=t,r=t.next;if($o(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ko(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&$o(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ho(t,e,n,r){var i=t.prev,o=t,a=t.next;if($o(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,c=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,u=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=Jo(s,c,e,n,r),p=Jo(u,l,e,n,r),d=t.prevZ,f=t.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&Ko(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&$o(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==t.prev&&f!==t.next&&Ko(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&$o(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&Ko(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&$o(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Ko(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&$o(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Vo(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!ta(i,o)&&ea(i,r,r.next,o)&&ia(i,o)&&ia(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),sa(r),sa(r.next),r=t=o),r=r.next}while(r!==t);return Fo(r)}function Wo(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Qo(a,s)){var c=oa(a,s);return a=Fo(a,a.next),c=Fo(c,c.next),Uo(a,e,n,r,i,o),void Uo(c,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function qo(t,e){return t.x-e.x}function Xo(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n;var c,u=n,l=n.x,h=n.y,p=1/0;r=n;do{i>=r.x&&r.x>=l&&i!==r.x&&Ko(o<h?i:a,o,l,h,o<h?a:i,o,r.x,r.y)&&(c=Math.abs(o-r.y)/(i-r.x),ia(r,t)&&(c<p||c===p&&(r.x>n.x||r.x===n.x&&Yo(n,r)))&&(n=r,p=c)),r=r.next}while(r!==u);return n}(t,e)){var n=oa(e,t);Fo(e,e.next),Fo(n,n.next)}}function Yo(t,e){return $o(t.prev,t,e.prev)<0&&$o(e.next,t,t.next)<0}function Jo(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Zo(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Ko(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Qo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ea(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(ia(t,e)&&ia(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&($o(t.prev,t,e.prev)||$o(t,e.prev,e))||ta(t,e)&&$o(t.prev,t,t.next)>0&&$o(e.prev,e,e.next)>0)}function $o(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ta(t,e){return t.x===e.x&&t.y===e.y}function ea(t,e,n,r){var i=ra($o(t,e,n)),o=ra($o(t,e,r)),a=ra($o(n,r,t)),s=ra($o(n,r,e));return i!==o&&a!==s||(!(0!==i||!na(t,n,e))||(!(0!==o||!na(t,r,e))||(!(0!==a||!na(n,t,r))||!(0!==s||!na(n,e,r)))))}function na(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function ra(t){return t>0?1:t<0?-1:0}function ia(t,e){return $o(t.prev,t,t.next)<0?$o(t,e,t.next)>=0&&$o(t,t.prev,e)>=0:$o(t,e,t.prev)<0||$o(t,t.next,e)<0}function oa(t,e){var n=new ca(t.i,t.x,t.y),r=new ca(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function aa(t,e,n,r){var i=new ca(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function sa(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ca(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var ua={area:function(t){for(var e=t.length,n=0,r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n},isClockWise:function(t){return ua.area(t)<0},triangulateShape:function(t,e){var n=[],r=[],i=[];la(t),ha(n,t);var o=t.length;e.forEach(la);for(var a=0;a<e.length;a++)r.push(o),o+=e[a].length,ha(n,e[a]);var s=Bo(n,r);for(a=0;a<s.length;a+=3)i.push(s.slice(a,a+3));return i}};function la(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function ha(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function pa(t,e){We.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new da(t,e)),this.mergeVertices()}function da(t,e){be.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];for(var n=this,r=[],i=[],o=0,a=t.length;o<a;o++){s(t[o])}function s(t){var o=[],a=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,c=void 0!==e.depth?e.depth:100,u=void 0===e.bevelEnabled||e.bevelEnabled,l=void 0!==e.bevelThickness?e.bevelThickness:6,h=void 0!==e.bevelSize?e.bevelSize:l-2,p=void 0!==e.bevelOffset?e.bevelOffset:0,d=void 0!==e.bevelSegments?e.bevelSegments:3,f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:fa;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=e.amount);var v,g,x,b,M,w,_,S,E=!1;f&&(v=f.getSpacedPoints(s),E=!0,u=!1,g=f.computeFrenetFrames(s,!1),x=new P,b=new P,M=new P),u||(d=0,l=0,h=0,p=0);var T=t.extractPoints(a),L=T.shape,A=T.holes;if(!ua.isClockWise(L))for(L=L.reverse(),_=0,S=A.length;_<S;_++)w=A[_],ua.isClockWise(w)&&(A[_]=w.reverse());var R=ua.triangulateShape(L,A),O=L;for(_=0,S=A.length;_<S;_++)w=A[_],L=L.concat(w);function N(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var C,I,D,z,j,B,k=L.length,F=R.length;function U(t,e,n){var r,i,o,a=t.x-e.x,s=t.y-e.y,c=n.x-t.x,u=n.y-t.y,l=a*a+s*s,h=a*u-s*c;if(Math.abs(h)>Number.EPSILON){var p=Math.sqrt(l),d=Math.sqrt(c*c+u*u),f=e.x-s/p,m=e.y+a/p,v=((n.x-u/d-f)*u-(n.y+c/d-m)*c)/(a*u-s*c),g=(r=f+a*v-t.x)*r+(i=m+s*v-t.y)*i;if(g<=2)return new y(r,i);o=Math.sqrt(g/2)}else{var x=!1;a>Number.EPSILON?c>Number.EPSILON&&(x=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(x=!0):Math.sign(s)===Math.sign(u)&&(x=!0),x?(r=-s,i=a,o=Math.sqrt(l)):(r=a,i=s,o=Math.sqrt(l/2))}return new y(r/o,i/o)}for(var G=[],H=0,V=O.length,W=V-1,q=H+1;H<V;H++,W++,q++)W===V&&(W=0),q===V&&(q=0),G[H]=U(O[H],O[W],O[q]);var X,Y,J=[],Z=G.concat();for(_=0,S=A.length;_<S;_++){for(w=A[_],X=[],H=0,W=(V=w.length)-1,q=H+1;H<V;H++,W++,q++)W===V&&(W=0),q===V&&(q=0),X[H]=U(w[H],w[W],w[q]);J.push(X),Z=Z.concat(X)}for(C=0;C<d;C++){for(D=C/d,z=l*Math.cos(D*Math.PI/2),I=h*Math.sin(D*Math.PI/2)+p,H=0,V=O.length;H<V;H++)Q((j=N(O[H],G[H],I)).x,j.y,-z);for(_=0,S=A.length;_<S;_++)for(w=A[_],X=J[_],H=0,V=w.length;H<V;H++)Q((j=N(w[H],X[H],I)).x,j.y,-z)}for(I=h+p,H=0;H<k;H++)j=u?N(L[H],Z[H],I):L[H],E?(b.copy(g.normals[0]).multiplyScalar(j.x),x.copy(g.binormals[0]).multiplyScalar(j.y),M.copy(v[0]).add(b).add(x),Q(M.x,M.y,M.z)):Q(j.x,j.y,0);for(Y=1;Y<=s;Y++)for(H=0;H<k;H++)j=u?N(L[H],Z[H],I):L[H],E?(b.copy(g.normals[Y]).multiplyScalar(j.x),x.copy(g.binormals[Y]).multiplyScalar(j.y),M.copy(v[Y]).add(b).add(x),Q(M.x,M.y,M.z)):Q(j.x,j.y,c/s*Y);for(C=d-1;C>=0;C--){for(D=C/d,z=l*Math.cos(D*Math.PI/2),I=h*Math.sin(D*Math.PI/2)+p,H=0,V=O.length;H<V;H++)Q((j=N(O[H],G[H],I)).x,j.y,c+z);for(_=0,S=A.length;_<S;_++)for(w=A[_],X=J[_],H=0,V=w.length;H<V;H++)j=N(w[H],X[H],I),E?Q(j.x,j.y+v[s-1].y,v[s-1].x+z):Q(j.x,j.y,c+z)}function K(t,e){var n,r;for(H=t.length;--H>=0;){n=H,(r=H-1)<0&&(r=t.length-1);var i=0,o=s+2*d;for(i=0;i<o;i++){var a=k*i,c=k*(i+1);tt(e+n+a,e+r+a,e+r+c,e+n+c)}}}function Q(t,e,n){o.push(t),o.push(e),o.push(n)}function $(t,e,i){et(t),et(e),et(i);var o=r.length/3,a=m.generateTopUV(n,r,o-3,o-2,o-1);nt(a[0]),nt(a[1]),nt(a[2])}function tt(t,e,i,o){et(t),et(e),et(o),et(e),et(i),et(o);var a=r.length/3,s=m.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);nt(s[0]),nt(s[1]),nt(s[3]),nt(s[1]),nt(s[2]),nt(s[3])}function et(t){r.push(o[3*t+0]),r.push(o[3*t+1]),r.push(o[3*t+2])}function nt(t){i.push(t.x),i.push(t.y)}!function(){var t=r.length/3;if(u){var e=0,i=k*e;for(H=0;H<F;H++)$((B=R[H])[2]+i,B[1]+i,B[0]+i);for(i=k*(e=s+2*d),H=0;H<F;H++)$((B=R[H])[0]+i,B[1]+i,B[2]+i)}else{for(H=0;H<F;H++)$((B=R[H])[2],B[1],B[0]);for(H=0;H<F;H++)$((B=R[H])[0]+k*s,B[1]+k*s,B[2]+k*s)}n.addGroup(t,r.length/3-t,0)}(),function(){var t=r.length/3,e=0;for(K(O,e),e+=O.length,_=0,S=A.length;_<S;_++)K(w=A[_],e),e+=w.length;n.addGroup(t,r.length/3-t,1)}()}this.setAttribute("position",new ue(r,3)),this.setAttribute("uv",new ue(i,2)),this.computeVertexNormals()}pa.prototype=Object.create(We.prototype),pa.prototype.constructor=pa,pa.prototype.toJSON=function(){var t=We.prototype.toJSON.call(this);return ma(this.parameters.shapes,this.parameters.options,t)},da.prototype=Object.create(be.prototype),da.prototype.constructor=da,da.prototype.toJSON=function(){var t=be.prototype.toJSON.call(this);return ma(this.parameters.shapes,this.parameters.options,t)};var fa={generateTopUV:function(t,e,n,r,i){var o=e[3*n],a=e[3*n+1],s=e[3*r],c=e[3*r+1],u=e[3*i],l=e[3*i+1];return[new y(o,a),new y(s,c),new y(u,l)]},generateSideWallUV:function(t,e,n,r,i,o){var a=e[3*n],s=e[3*n+1],c=e[3*n+2],u=e[3*r],l=e[3*r+1],h=e[3*r+2],p=e[3*i],d=e[3*i+1],f=e[3*i+2],m=e[3*o],v=e[3*o+1],g=e[3*o+2];return Math.abs(s-l)<.01?[new y(a,1-c),new y(u,1-h),new y(p,1-f),new y(m,1-g)]:[new y(s,1-c),new y(l,1-h),new y(d,1-f),new y(v,1-g)]}};function ma(t,e,n){if(n.shapes=[],Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];n.shapes.push(o.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function va(t,e){We.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new ga(t,e)),this.mergeVertices()}function ga(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new We;var r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),da.call(this,r,e),this.type="TextBufferGeometry"}function ya(t,e,n,r,i,o,a){We.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new xa(t,e,n,r,i,o,a)),this.mergeVertices()}function xa(t,e,n,r,i,o,a){be.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,u=Math.min(o+a,Math.PI),l=0,h=[],p=new P,d=new P,f=[],m=[],v=[],g=[];for(c=0;c<=n;c++){var y=[],x=c/n,b=0;for(0==c&&0==o?b=.5/e:c==n&&u==Math.PI&&(b=-.5/e),s=0;s<=e;s++){var M=s/e;p.x=-t*Math.cos(r+M*i)*Math.sin(o+x*a),p.y=t*Math.cos(o+x*a),p.z=t*Math.sin(r+M*i)*Math.sin(o+x*a),m.push(p.x,p.y,p.z),d.copy(p).normalize(),v.push(d.x,d.y,d.z),g.push(M+b,1-x),y.push(l++)}h.push(y)}for(c=0;c<n;c++)for(s=0;s<e;s++){var w=h[c][s+1],_=h[c][s],S=h[c+1][s],E=h[c+1][s+1];(0!==c||o>0)&&f.push(w,_,E),(c!==n-1||u<Math.PI)&&f.push(_,S,E)}this.setIndex(f),this.setAttribute("position",new ue(m,3)),this.setAttribute("normal",new ue(v,3)),this.setAttribute("uv",new ue(g,2))}function ba(t,e,n,r,i,o){We.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},this.fromBufferGeometry(new Ma(t,e,n,r,i,o)),this.mergeVertices()}function Ma(t,e,n,r,i,o){be.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},t=t||.5,e=e||1,i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,c,u=[],l=[],h=[],p=[],d=t,f=(e-t)/(r=void 0!==r?Math.max(1,r):1),m=new P,v=new y;for(s=0;s<=r;s++){for(c=0;c<=n;c++)a=i+c/n*o,m.x=d*Math.cos(a),m.y=d*Math.sin(a),l.push(m.x,m.y,m.z),h.push(0,0,1),v.x=(m.x/e+1)/2,v.y=(m.y/e+1)/2,p.push(v.x,v.y);d+=f}for(s=0;s<r;s++){var g=s*(n+1);for(c=0;c<n;c++){var x=a=c+g,b=a+n+1,M=a+n+2,w=a+1;u.push(x,b,w),u.push(b,M,w)}}this.setIndex(u),this.setAttribute("position",new ue(l,3)),this.setAttribute("normal",new ue(h,3)),this.setAttribute("uv",new ue(p,2))}function wa(t,e,n,r){We.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},this.fromBufferGeometry(new _a(t,e,n,r)),this.mergeVertices()}function _a(t,e,n,r){be.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:r},e=Math.floor(e)||12,n=n||0,r=r||2*Math.PI,r=g.clamp(r,0,2*Math.PI);var i,o,a,s=[],c=[],u=[],l=1/e,h=new P,p=new y;for(o=0;o<=e;o++){var d=n+o*l*r,f=Math.sin(d),m=Math.cos(d);for(a=0;a<=t.length-1;a++)h.x=t[a].x*f,h.y=t[a].y,h.z=t[a].x*m,c.push(h.x,h.y,h.z),p.x=o/e,p.y=a/(t.length-1),u.push(p.x,p.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){var v=i=a+o*t.length,x=i+t.length,b=i+t.length+1,M=i+1;s.push(v,x,M),s.push(x,b,M)}if(this.setIndex(s),this.setAttribute("position",new ue(c,3)),this.setAttribute("uv",new ue(u,2)),this.computeVertexNormals(),r===2*Math.PI){var w=this.attributes.normal.array,_=new P,S=new P,E=new P;for(i=e*t.length*3,o=0,a=0;o<t.length;o++,a+=3)_.x=w[a+0],_.y=w[a+1],_.z=w[a+2],S.x=w[i+a+0],S.y=w[i+a+1],S.z=w[i+a+2],E.addVectors(_,S).normalize(),w[a+0]=w[i+a+0]=E.x,w[a+1]=w[i+a+1]=E.y,w[a+2]=w[i+a+2]=E.z}}function Sa(t,e){We.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Ea(t,e)),this.mergeVertices()}function Ea(t,e){be.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],r=[],i=[],o=[],a=0,s=0;if(!1===Array.isArray(t))u(t);else for(var c=0;c<t.length;c++)u(t[c]),this.addGroup(a,s,c),a+=s,s=0;function u(t){var a,c,u,l=r.length/3,h=t.extractPoints(e),p=h.shape,d=h.holes;for(!1===ua.isClockWise(p)&&(p=p.reverse()),a=0,c=d.length;a<c;a++)u=d[a],!0===ua.isClockWise(u)&&(d[a]=u.reverse());var f=ua.triangulateShape(p,d);for(a=0,c=d.length;a<c;a++)u=d[a],p=p.concat(u);for(a=0,c=p.length;a<c;a++){var m=p[a];r.push(m.x,m.y,0),i.push(0,0,1),o.push(m.x,m.y)}for(a=0,c=f.length;a<c;a++){var v=f[a],g=v[0]+l,y=v[1]+l,x=v[2]+l;n.push(g,y,x),s+=3}}this.setIndex(n),this.setAttribute("position",new ue(r,3)),this.setAttribute("normal",new ue(i,3)),this.setAttribute("uv",new ue(o,2))}function Ta(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}function La(t,e){be.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,r,i,o,a=[],s=Math.cos(g.DEG2RAD*e),c=[0,0],u={},l=["a","b","c"];t.isBufferGeometry?(o=new We).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var h=o.vertices,p=o.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],v=0;v<3;v++)n=m[l[v]],r=m[l[(v+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===u[i=c[0]+","+c[1]]?u[i]={index1:c[0],index2:c[1],face1:d,face2:void 0}:u[i].face2=d;for(i in u){var y=u[i];if(void 0===y.face2||p[y.face1].normal.dot(p[y.face2].normal)<=s){var x=h[y.index1];a.push(x.x,x.y,x.z),x=h[y.index2],a.push(x.x,x.y,x.z)}}this.setAttribute("position",new ue(a,3))}function Aa(t,e,n,r,i,o,a,s){We.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Pa(t,e,n,r,i,o,a,s)),this.mergeVertices()}function Pa(t,e,n,r,i,o,a,s){be.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};var c=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,r=Math.floor(r)||8,i=Math.floor(i)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var u=[],l=[],h=[],p=[],d=0,f=[],m=n/2,v=0;function g(n){var i,o,f,g=new y,x=new P,b=0,M=!0===n?t:e,w=!0===n?1:-1;for(o=d,i=1;i<=r;i++)l.push(0,m*w,0),h.push(0,w,0),p.push(.5,.5),d++;for(f=d,i=0;i<=r;i++){var _=i/r*s+a,S=Math.cos(_),E=Math.sin(_);x.x=M*E,x.y=m*w,x.z=M*S,l.push(x.x,x.y,x.z),h.push(0,w,0),g.x=.5*S+.5,g.y=.5*E*w+.5,p.push(g.x,g.y),d++}for(i=0;i<r;i++){var T=o+i,L=f+i;!0===n?u.push(L,L+1,T):u.push(L+1,L,T),b+=3}c.addGroup(v,b,!0===n?1:2),v+=b}!function(){var o,g,y=new P,x=new P,b=0,M=(e-t)/n;for(g=0;g<=i;g++){var w=[],_=g/i,S=_*(e-t)+t;for(o=0;o<=r;o++){var E=o/r,T=E*s+a,L=Math.sin(T),A=Math.cos(T);x.x=S*L,x.y=-_*n+m,x.z=S*A,l.push(x.x,x.y,x.z),y.set(L,M,A).normalize(),h.push(y.x,y.y,y.z),p.push(E,1-_),w.push(d++)}f.push(w)}for(o=0;o<r;o++)for(g=0;g<i;g++){var R=f[g][o],O=f[g+1][o],N=f[g+1][o+1],C=f[g][o+1];u.push(R,O,C),u.push(O,N,C),b+=6}c.addGroup(v,b,0),v+=b}(),!1===o&&(t>0&&g(!0),e>0&&g(!1)),this.setIndex(u),this.setAttribute("position",new ue(l,3)),this.setAttribute("normal",new ue(h,3)),this.setAttribute("uv",new ue(p,2))}function Ra(t,e,n,r,i,o,a){Aa.call(this,0,t,e,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Oa(t,e,n,r,i,o,a){Pa.call(this,0,t,e,n,r,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Na(t,e,n,r){We.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Ca(t,e,n,r)),this.mergeVertices()}function Ca(t,e,n,r){be.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=[],u=[],l=new P,h=new y;for(s.push(0,0,0),c.push(0,0,1),u.push(.5,.5),o=0,i=3;o<=e;o++,i+=3){var p=n+o/e*r;l.x=t*Math.cos(p),l.y=t*Math.sin(p),s.push(l.x,l.y,l.z),c.push(0,0,1),h.x=(s[i]/t+1)/2,h.y=(s[i+1]/t+1)/2,u.push(h.x,h.y)}for(i=1;i<=e;i++)a.push(i,i+1,0);this.setIndex(a),this.setAttribute("position",new ue(s,3)),this.setAttribute("normal",new ue(c,3)),this.setAttribute("uv",new ue(u,2))}va.prototype=Object.create(We.prototype),va.prototype.constructor=va,ga.prototype=Object.create(da.prototype),ga.prototype.constructor=ga,ya.prototype=Object.create(We.prototype),ya.prototype.constructor=ya,xa.prototype=Object.create(be.prototype),xa.prototype.constructor=xa,ba.prototype=Object.create(We.prototype),ba.prototype.constructor=ba,Ma.prototype=Object.create(be.prototype),Ma.prototype.constructor=Ma,wa.prototype=Object.create(We.prototype),wa.prototype.constructor=wa,_a.prototype=Object.create(be.prototype),_a.prototype.constructor=_a,Sa.prototype=Object.create(We.prototype),Sa.prototype.constructor=Sa,Sa.prototype.toJSON=function(){var t=We.prototype.toJSON.call(this);return Ta(this.parameters.shapes,t)},Ea.prototype=Object.create(be.prototype),Ea.prototype.constructor=Ea,Ea.prototype.toJSON=function(){var t=be.prototype.toJSON.call(this);return Ta(this.parameters.shapes,t)},La.prototype=Object.create(be.prototype),La.prototype.constructor=La,Aa.prototype=Object.create(We.prototype),Aa.prototype.constructor=Aa,Pa.prototype=Object.create(be.prototype),Pa.prototype.constructor=Pa,Ra.prototype=Object.create(Aa.prototype),Ra.prototype.constructor=Ra,Oa.prototype=Object.create(Pa.prototype),Oa.prototype.constructor=Oa,Na.prototype=Object.create(We.prototype),Na.prototype.constructor=Na,Ca.prototype=Object.create(be.prototype),Ca.prototype.constructor=Ca;var Ia=Object.freeze({__proto__:null,WireframeGeometry:xo,ParametricGeometry:bo,ParametricBufferGeometry:Mo,TetrahedronGeometry:So,TetrahedronBufferGeometry:Eo,OctahedronGeometry:To,OctahedronBufferGeometry:Lo,IcosahedronGeometry:Ao,IcosahedronBufferGeometry:Po,DodecahedronGeometry:Ro,DodecahedronBufferGeometry:Oo,PolyhedronGeometry:wo,PolyhedronBufferGeometry:_o,TubeGeometry:No,TubeBufferGeometry:Co,TorusKnotGeometry:Io,TorusKnotBufferGeometry:Do,TorusGeometry:zo,TorusBufferGeometry:jo,TextGeometry:va,TextBufferGeometry:ga,SphereGeometry:ya,SphereBufferGeometry:xa,RingGeometry:ba,RingBufferGeometry:Ma,PlaneGeometry:un,PlaneBufferGeometry:ln,LatheGeometry:wa,LatheBufferGeometry:_a,ShapeGeometry:Sa,ShapeBufferGeometry:Ea,ExtrudeGeometry:pa,ExtrudeBufferGeometry:da,EdgesGeometry:La,ConeGeometry:Ra,ConeBufferGeometry:Oa,CylinderGeometry:Aa,CylinderBufferGeometry:Pa,CircleGeometry:Na,CircleBufferGeometry:Ca,BoxGeometry:class extends We{constructor(t,e,n,r,i,o){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o},this.fromBufferGeometry(new qe(t,e,n,r,i,o)),this.mergeVertices()}},BoxBufferGeometry:qe});function Da(t){Qt.call(this),this.type="ShadowMaterial",this.color=new qt(0),this.transparent=!0,this.setValues(t)}function za(t){Ze.call(this,t),this.type="RawShaderMaterial"}function ja(t){Qt.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new qt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function Ba(t){ja.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new y(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function ka(t){Qt.call(this),this.type="MeshPhongMaterial",this.color=new qt(16777215),this.specular=new qt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(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 Fa(t){Qt.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new qt(16777215),this.specular=new qt(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ua(t){Qt.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ga(t){Qt.call(this),this.type="MeshLambertMaterial",this.color=new qt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new qt(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 Ha(t){Qt.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new qt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new y(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Va(t){Zi.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Da.prototype=Object.create(Qt.prototype),Da.prototype.constructor=Da,Da.prototype.isShadowMaterial=!0,Da.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this},za.prototype=Object.create(Ze.prototype),za.prototype.constructor=za,za.prototype.isRawShaderMaterial=!0,ja.prototype=Object.create(Qt.prototype),ja.prototype.constructor=ja,ja.prototype.isMeshStandardMaterial=!0,ja.prototype.copy=function(t){return Qt.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.vertexTangents=t.vertexTangents,this},Ba.prototype=Object.create(ja.prototype),Ba.prototype.constructor=Ba,Ba.prototype.isMeshPhysicalMaterial=!0,Ba.prototype.copy=function(t){return ja.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new qt).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},ka.prototype=Object.create(Qt.prototype),ka.prototype.constructor=ka,ka.prototype.isMeshPhongMaterial=!0,ka.prototype.copy=function(t){return Qt.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},Fa.prototype=Object.create(Qt.prototype),Fa.prototype.constructor=Fa,Fa.prototype.isMeshToonMaterial=!0,Fa.prototype.copy=function(t){return Qt.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,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},Ua.prototype=Object.create(Qt.prototype),Ua.prototype.constructor=Ua,Ua.prototype.isMeshNormalMaterial=!0,Ua.prototype.copy=function(t){return Qt.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},Ga.prototype=Object.create(Qt.prototype),Ga.prototype.constructor=Ga,Ga.prototype.isMeshLambertMaterial=!0,Ga.prototype.copy=function(t){return Qt.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},Ha.prototype=Object.create(Qt.prototype),Ha.prototype.constructor=Ha,Ha.prototype.isMeshMatcapMaterial=!0,Ha.prototype.copy=function(t){return Qt.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},Va.prototype=Object.create(Zi.prototype),Va.prototype.constructor=Va,Va.prototype.isLineDashedMaterial=!0,Va.prototype.copy=function(t){return Zi.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Wa=Object.freeze({__proto__:null,ShadowMaterial:Da,SpriteMaterial:gi,RawShaderMaterial:za,ShaderMaterial:Ze,PointsMaterial:so,MeshPhysicalMaterial:Ba,MeshStandardMaterial:ja,MeshPhongMaterial:ka,MeshToonMaterial:Fa,MeshNormalMaterial:Ua,MeshLambertMaterial:Ga,MeshDepthMaterial:$r,MeshDistanceMaterial:ti,MeshBasicMaterial:$t,MeshMatcapMaterial:Ha,LineDashedMaterial:Va,LineBasicMaterial:Zi,Material:Qt}),qa={arraySlice:function(t,e,n){return qa.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))do{void 0!==(a=o[r])&&(e.push(o.time),n.push.apply(n,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(e.push(o.time),n.push(a)),o=t[i++]}while(void 0!==o)}},subclip:function(t,e,n,r,i){i=i||30;var o=t.clone();o.name=e;for(var a=[],s=0;s<o.tracks.length;++s){for(var c=o.tracks[s],u=c.getValueSize(),l=[],h=[],p=0;p<c.times.length;++p){var d=c.times[p]*i;if(!(d<n||d>=r)){l.push(c.times[p]);for(var f=0;f<u;++f)h.push(c.values[p*u+f])}}0!==l.length&&(c.times=qa.convertArray(l,c.times.constructor),c.values=qa.convertArray(h,c.values.constructor),a.push(c))}o.tracks=a;var m=1/0;for(s=0;s<o.tracks.length;++s)m>o.tracks[s].times[0]&&(m=o.tracks[s].times[0]);for(s=0;s<o.tracks.length;++s)o.tracks[s].shift(-1*m);return o.resetDuration(),o},makeClipAdditive:function(t,e,n,r){void 0===e&&(e=0),void 0===n&&(n=t),(void 0===r||r<=0)&&(r=30);for(var i=t.tracks.length,o=e/r,a=0;a<i;++a){var s=n.tracks[a],c=s.ValueTypeName;if("bool"!==c&&"string"!==c){var u=t.tracks.find((function(t){return t.name===s.name&&t.ValueTypeName===c}));if(void 0!==u){var l,h=s.getValueSize(),p=s.times.length-1;if(o<=s.times[0])l=qa.arraySlice(s.values,0,s.valueSize);else if(o>=s.times[p]){var d=p*h;l=qa.arraySlice(s.values,d)}else{var f=s.createInterpolant();f.evaluate(o),l=f.resultBuffer}if("quaternion"===c)new T(l[0],l[1],l[2],l[3]).normalize().conjugate().toArray(l);for(var m=u.times.length,v=0;v<m;++v){var g=v*h;if("quaternion"===c)T.multiplyQuaternionsFlat(u.values,g,l,0,u.values,g);else for(var y=0;y<h;++y)u.values[g+y]-=l[y]}}}}return t.blendMode=2501,t}};function Xa(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 Ya(t,e,n,r){Xa.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Ja(t,e,n,r){Xa.call(this,t,e,n,r)}function Za(t,e,n,r){Xa.call(this,t,e,n,r)}function Ka(t,e,n,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=qa.convertArray(e,this.TimeBufferType),this.values=qa.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Qa(t,e,n){Ka.call(this,t,e,n)}function $a(t,e,n,r){Ka.call(this,t,e,n,r)}function ts(t,e,n,r){Ka.call(this,t,e,n,r)}function es(t,e,n,r){Xa.call(this,t,e,n,r)}function ns(t,e,n,r){Ka.call(this,t,e,n,r)}function rs(t,e,n,r){Ka.call(this,t,e,n,r)}function is(t,e,n,r){Ka.call(this,t,e,n,r)}function os(t,e,n,r){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.blendMode=void 0!==r?r:2500,this.uuid=g.generateUUID(),this.duration<0&&this.resetDuration()}function as(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ts;case"vector":case"vector2":case"vector3":case"vector4":return is;case"color":return $a;case"quaternion":return ns;case"bool":case"boolean":return Qa;case"string":return rs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],r=[];qa.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(Xa.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(t>=i)break t;var s=e[1];t<s&&(n=2,i=s);for(a=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(n===a)break;if(r=i,t>=(i=e[--n-1]))break e}o=n,n=0}for(;n<o;){var c=n+o>>>1;t<e[c]?o=c:n=c+1}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(Xa.prototype,{beforeStart_:Xa.prototype.copySampleValue_,afterEnd_:Xa.prototype.copySampleValue_}),Ya.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Ya,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(t,e,n){var r=this.parameterPositions,i=t-2,o=t+1,a=r[i],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:i=t,a=2*e-n;break;case 2402:a=e+r[i=r.length-2]-r[i+1];break;default:i=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:o=t,s=2*n-e;break;case 2402:o=1,s=n+r[1]-r[0];break;default:o=t-1,s=e}var c=.5*(n-e),u=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(s-n),this._offsetPrev=i*u,this._offsetNext=o*u},interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,u=this._offsetPrev,l=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-e)/(r-e),f=d*d,m=f*d,v=-h*m+2*h*f-h*d,g=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,b=0;b!==a;++b)i[b]=v*o[u+b]+g*o[c+b]+y*o[s+b]+x*o[l+b];return i}}),Ja.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Ja,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,u=(n-e)/(r-e),l=1-u,h=0;h!==a;++h)i[h]=o[c+h]*l+o[s+h]*u;return i}}),Za.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Za,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Ka,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:qa.convertArray(t.times,Array),values:qa.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e}}),Object.assign(Ka.prototype,{constructor:Ka,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new Za(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Ja(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Ya(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,r=e.length;n!==r;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,r=n.length,i=0,o=r-1;i!==r&&n[i]<t;)++i;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=qa.arraySlice(n,i,o),this.values=qa.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==r&&qa.isTypedArray(r)){a=0;for(var c=r.length;a!==c;++a){var u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),t=!1;break}}}return t},optimize:function(){for(var t=qa.arraySlice(this.times),e=qa.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,o=t.length-1,a=1;a<o;++a){var s=!1,c=t[a];if(c!==t[a+1]&&(1!==a||c!==c[0]))if(r)s=!0;else for(var u=a*n,l=u-n,h=u+n,p=0;p!==n;++p){var d=e[u+p];if(d!==e[l+p]||d!==e[h+p]){s=!0;break}}if(s){if(a!==i){t[i]=t[a];var f=a*n,m=i*n;for(p=0;p!==n;++p)e[m+p]=e[f+p]}++i}}if(o>0){t[i]=t[o];for(f=o*n,m=i*n,p=0;p!==n;++p)e[m+p]=e[f+p];++i}return i!==t.length?(this.times=qa.arraySlice(t,0,i),this.values=qa.arraySlice(e,0,i*n)):(this.times=t,this.values=e),this},clone:function(){var t=qa.arraySlice(this.times,0),e=qa.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Qa.prototype=Object.assign(Object.create(Ka.prototype),{constructor:Qa,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),$a.prototype=Object.assign(Object.create(Ka.prototype),{constructor:$a,ValueTypeName:"color"}),ts.prototype=Object.assign(Object.create(Ka.prototype),{constructor:ts,ValueTypeName:"number"}),es.prototype=Object.assign(Object.create(Xa.prototype),{constructor:es,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),u=s+a;s!==u;s+=4)T.slerpFlat(i,0,o,s-a,o,s,c);return i}}),ns.prototype=Object.assign(Object.create(Ka.prototype),{constructor:ns,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new es(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),rs.prototype=Object.assign(Object.create(Ka.prototype),{constructor:rs,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),is.prototype=Object.assign(Object.create(Ka.prototype),{constructor:is,ValueTypeName:"vector"}),Object.assign(os,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,o=n.length;i!==o;++i)e.push(as(n[i]).scale(r));return new os(t.name,t.duration,e,t.blendMode)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode},i=0,o=n.length;i!==o;++i)e.push(Ka.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var i=e.length,o=[],a=0;a<i;a++){var s=[],c=[];s.push((a+i-1)%i,a,(a+1)%i),c.push(0,1,0);var u=qa.getKeyframeOrder(s);s=qa.sortedArray(s,1,u),c=qa.sortedArray(c,1,u),r||0!==s[0]||(s.push(i),c.push(c[0])),o.push(new ts(".morphTargetInfluences["+e[a].name+"]",s,c).scale(1/n))}return new os(t,-1,o)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){var r=t;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],c=s.name.match(i);if(c&&c.length>1){var u=r[h=c[1]];u||(r[h]=u=[]),u.push(s)}}var l=[];for(var h in r)l.push(os.CreateFromMorphTargetSequence(h,r[h],e,n));return l},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var o=[],a=[];qa.flattenJSON(n,o,a,r),0!==o.length&&i.push(new t(e,o,a))}},r=[],i=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.blendMode,c=t.hierarchy||[],u=0;u<c.length;u++){var l=c[u].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var h={},p=0;p<l.length;p++)if(l[p].morphTargets)for(var d=0;d<l[p].morphTargets.length;d++)h[l[p].morphTargets[d]]=-1;for(var f in h){var m=[],v=[];for(d=0;d!==l[p].morphTargets.length;++d){var g=l[p];m.push(g.time),v.push(g.morphTarget===f?1:0)}r.push(new ts(".morphTargetInfluence["+f+"]",m,v))}o=h.length*(a||1)}else{var y=".bones["+e[u].name+"]";n(is,y+".position",l,"pos",r),n(ns,y+".quaternion",l,"rot",r),n(is,y+".scale",l,"scl",r)}}return 0===r.length?null:new os(i,o,r,s)}}),Object.assign(os.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var r=this.tracks[e];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new os(this.name,this.duration,t,this.blendMode)}});var ss={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 cs(t,e,n){var r=this,i=!1,o=0,a=0,s=void 0,c=[];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},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){var e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=c.length;e<n;e+=2){var r=c[e],i=c[e+1];if(r.global&&(r.lastIndex=0),r.test(t))return i}return null}}var us=new cs;function ls(t){this.manager=void 0!==t?t:us,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(ls.prototype,{load:function(){},loadAsync:function(t,e){var n=this;return new Promise((function(r,i){n.load(t,r,e,i)}))},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});var hs={};function ps(t){ls.call(this,t)}function ds(t){ls.call(this,t)}function fs(t){ls.call(this,t)}function ms(t){ls.call(this,t)}function vs(t){ls.call(this,t)}function gs(t){ls.call(this,t)}function ys(t){ls.call(this,t)}function xs(){this.type="Curve",this.arcLengthDivisions=200}function bs(t,e,n,r,i,o,a,s){xs.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 Ms(t,e,n,r,i,o){bs.call(this,t,e,n,n,r,i,o),this.type="ArcCurve"}function ws(){var t=0,e=0,n=0,r=0;function i(i,o,a,s){t=i,e=a,n=-3*i+3*o-2*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,u=(n-e)/a-(r-e)/(a+s)+(r-n)/s;i(e,n,c*=a,u*=a)},calc:function(i){var o=i*i;return t+e*i+n*o+r*(o*i)}}}ps.prototype=Object.assign(Object.create(ls.prototype),{constructor:ps,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=ss.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===hs[t]){var a=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],c=!!a[2],u=a[3];u=decodeURIComponent(u),c&&(u=atob(u));try{var l,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var p=new Uint8Array(u.length),d=0;d<u.length;d++)p[d]=u.charCodeAt(d);l="blob"===h?new Blob([p.buffer],{type:s}):p.buffer;break;case"document":var f=new DOMParser;l=f.parseFromString(u,s);break;case"json":l=JSON.parse(u);break;default:l=u}setTimeout((function(){e&&e(l),i.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}),0)}}else{hs[t]=[],hs[t].push({onLoad:e,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var v in m.open("GET",t,!0),m.addEventListener("load",(function(e){var n=this.response,r=hs[t];if(delete hs[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),ss.add(t,n);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=hs[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=hs[t];delete hs[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=hs[t];delete hs[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(v,this.requestHeader[v]);m.send(null)}return i.manager.itemStart(t),m}hs[t].push({onLoad:e,onProgress:n,onError:r})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this}}),ds.prototype=Object.assign(Object.create(ls.prototype),{constructor:ds,load:function(t,e,n,r){var i=this,o=new ps(i.manager);o.setPath(i.path),o.load(t,(function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var r=os.parse(t[n]);e.push(r)}return e}}),fs.prototype=Object.assign(Object.create(ls.prototype),{constructor:fs,load:function(t,e,n,r){var i=this,o=[],a=new vo;a.image=o;var s=new ps(this.manager);function c(c){s.load(t[c],(function(t){var n=i.parse(t,!0);o[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(u+=1)&&(1===n.mipmapCount&&(a.minFilter=1006),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 u=0,l=0,h=t.length;l<h;++l)c(l);else s.load(t,(function(t){var n=i.parse(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=1006),a.format=n.format,a.needsUpdate=!0,e&&e(a)}),n,r);return a}}),ms.prototype=Object.assign(Object.create(ls.prototype),{constructor:ms,load:function(t,e,n,r){var i=this,o=new en,a=new ps(this.manager);return a.setResponseType("arraybuffer"),a.setPath(this.path),a.load(t,(function(t){var n=i.parse(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:1001,o.wrapT=void 0!==n.wrapT?n.wrapT:1001,o.magFilter=void 0!==n.magFilter?n.magFilter:1006,o.minFilter=void 0!==n.minFilter?n.minFilter:1006,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,o.minFilter=1008),1===n.mipmapCount&&(o.minFilter=1006),o.needsUpdate=!0,e&&e(o,n))}),n,r),o}}),vs.prototype=Object.assign(Object.create(ls.prototype),{constructor:vs,load:function(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var i=this,o=ss.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),ss.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}}),gs.prototype=Object.assign(Object.create(ls.prototype),{constructor:gs,load:function(t,e,n,r){var i=new Sn,o=new vs(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}}),ys.prototype=Object.assign(Object.create(ls.prototype),{constructor:ys,load:function(t,e,n,r){var i=new w,o=new vs(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(n){i.image=n;var r=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}),Object.assign(xs.prototype,{getPoint:function(){return console.warn("THREE.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,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(!(a>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(o-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(o-1)},getTangent:function(t,e){var n=t-1e-4,r=t+1e-4;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n),o=this.getPoint(r),a=e||(i.isVector2?new y:new P);return a.copy(o).sub(i).normalize(),a},getTangentAt:function(t,e){var n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){var n,r,i,o=new P,a=[],s=[],c=[],u=new P,l=new j;for(n=0;n<=t;n++)r=n/t,a[n]=this.getTangentAt(r,new P),a[n].normalize();s[0]=new P,c[0]=new P;var h=Number.MAX_VALUE,p=Math.abs(a[0].x),d=Math.abs(a[0].y),f=Math.abs(a[0].z);for(p<=h&&(h=p,o.set(1,0,0)),d<=h&&(h=d,o.set(0,1,0)),f<=h&&o.set(0,0,1),u.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],u),c[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),u.crossVectors(a[n-1],a[n]),u.length()>Number.EPSILON&&(u.normalize(),i=Math.acos(g.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(l.makeRotationAxis(u,i))),c[n].crossVectors(a[n],s[n]);if(!0===e)for(i=Math.acos(g.clamp(s[0].dot(s[t]),-1,1)),i/=t,a[0].dot(u.crossVectors(s[0],s[t]))>0&&(i=-i),n=1;n<=t;n++)s[n].applyMatrix4(l.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}}),bs.prototype=Object.create(xs.prototype),bs.prototype.constructor=bs,bs.prototype.isEllipseCurve=!0,bs.prototype.getPoint=function(t,e){for(var n=e||new y,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)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 u=Math.cos(this.aRotation),l=Math.sin(this.aRotation),h=s-this.aX,p=c-this.aY;s=h*u-p*l+this.aX,c=h*l+p*u+this.aY}return n.set(s,c)},bs.prototype.copy=function(t){return xs.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},bs.prototype.toJSON=function(){var t=xs.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},bs.prototype.fromJSON=function(t){return xs.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},Ms.prototype=Object.create(bs.prototype),Ms.prototype.constructor=Ms,Ms.prototype.isArcCurve=!0;var _s=new P,Ss=new ws,Es=new ws,Ts=new ws;function Ls(t,e,n,r){xs.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=r||.5}function As(t,e,n,r,i){var o=.5*(r-e),a=.5*(i-n),s=t*t;return(2*n-2*r+o+a)*(t*s)+(-3*n+3*r-2*o-a)*s+o*t+n}function Ps(t,e,n,r){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function Rs(t,e,n,r,i){return function(t,e){var n=1-t;return n*n*n*e}(t,e)+function(t,e){var n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}function Os(t,e,n,r){xs.call(this),this.type="CubicBezierCurve",this.v0=t||new y,this.v1=e||new y,this.v2=n||new y,this.v3=r||new y}function Ns(t,e,n,r){xs.call(this),this.type="CubicBezierCurve3",this.v0=t||new P,this.v1=e||new P,this.v2=n||new P,this.v3=r||new P}function Cs(t,e){xs.call(this),this.type="LineCurve",this.v1=t||new y,this.v2=e||new y}function Is(t,e){xs.call(this),this.type="LineCurve3",this.v1=t||new P,this.v2=e||new P}function Ds(t,e,n){xs.call(this),this.type="QuadraticBezierCurve",this.v0=t||new y,this.v1=e||new y,this.v2=n||new y}function zs(t,e,n){xs.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new P,this.v1=e||new P,this.v2=n||new P}function js(t){xs.call(this),this.type="SplineCurve",this.points=t||[]}Ls.prototype=Object.create(xs.prototype),Ls.prototype.constructor=Ls,Ls.prototype.isCatmullRomCurve3=!0,Ls.prototype.getPoint=function(t,e){var n,r,i,o,a=e||new P,s=this.points,c=s.length,u=(c-(this.closed?0:1))*t,l=Math.floor(u),h=u-l;if(this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/c)+1)*c:0===h&&l===c-1&&(l=c-2,h=1),this.closed||l>0?n=s[(l-1)%c]:(_s.subVectors(s[0],s[1]).add(s[0]),n=_s),r=s[l%c],i=s[(l+1)%c],this.closed||l+2<c?o=s[(l+2)%c]:(_s.subVectors(s[c-1],s[c-2]).add(s[c-1]),o=_s),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(r),p),f=Math.pow(r.distanceToSquared(i),p),m=Math.pow(i.distanceToSquared(o),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),Ss.initNonuniformCatmullRom(n.x,r.x,i.x,o.x,d,f,m),Es.initNonuniformCatmullRom(n.y,r.y,i.y,o.y,d,f,m),Ts.initNonuniformCatmullRom(n.z,r.z,i.z,o.z,d,f,m)}else"catmullrom"===this.curveType&&(Ss.initCatmullRom(n.x,r.x,i.x,o.x,this.tension),Es.initCatmullRom(n.y,r.y,i.y,o.y,this.tension),Ts.initCatmullRom(n.z,r.z,i.z,o.z,this.tension));return a.set(Ss.calc(h),Es.calc(h),Ts.calc(h)),a},Ls.prototype.copy=function(t){xs.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ls.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Ls.prototype.fromJSON=function(t){xs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new P).fromArray(r))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Os.prototype=Object.create(xs.prototype),Os.prototype.constructor=Os,Os.prototype.isCubicBezierCurve=!0,Os.prototype.getPoint=function(t,e){var n=e||new y,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Rs(t,r.x,i.x,o.x,a.x),Rs(t,r.y,i.y,o.y,a.y)),n},Os.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Os.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Os.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Ns.prototype=Object.create(xs.prototype),Ns.prototype.constructor=Ns,Ns.prototype.isCubicBezierCurve3=!0,Ns.prototype.getPoint=function(t,e){var n=e||new P,r=this.v0,i=this.v1,o=this.v2,a=this.v3;return n.set(Rs(t,r.x,i.x,o.x,a.x),Rs(t,r.y,i.y,o.y,a.y),Rs(t,r.z,i.z,o.z,a.z)),n},Ns.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Ns.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Ns.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Cs.prototype=Object.create(xs.prototype),Cs.prototype.constructor=Cs,Cs.prototype.isLineCurve=!0,Cs.prototype.getPoint=function(t,e){var n=e||new y;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Cs.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Cs.prototype.getTangent=function(t,e){return(e||new y).copy(this.v2).sub(this.v1).normalize()},Cs.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Cs.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Cs.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Is.prototype=Object.create(xs.prototype),Is.prototype.constructor=Is,Is.prototype.isLineCurve3=!0,Is.prototype.getPoint=function(t,e){var n=e||new P;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Is.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Is.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Is.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Is.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Ds.prototype=Object.create(xs.prototype),Ds.prototype.constructor=Ds,Ds.prototype.isQuadraticBezierCurve=!0,Ds.prototype.getPoint=function(t,e){var n=e||new y,r=this.v0,i=this.v1,o=this.v2;return n.set(Ps(t,r.x,i.x,o.x),Ps(t,r.y,i.y,o.y)),n},Ds.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ds.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ds.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},zs.prototype=Object.create(xs.prototype),zs.prototype.constructor=zs,zs.prototype.isQuadraticBezierCurve3=!0,zs.prototype.getPoint=function(t,e){var n=e||new P,r=this.v0,i=this.v1,o=this.v2;return n.set(Ps(t,r.x,i.x,o.x),Ps(t,r.y,i.y,o.y),Ps(t,r.z,i.z,o.z)),n},zs.prototype.copy=function(t){return xs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},zs.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},zs.prototype.fromJSON=function(t){return xs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},js.prototype=Object.create(xs.prototype),js.prototype.constructor=js,js.prototype.isSplineCurve=!0,js.prototype.getPoint=function(t,e){var n=e||new y,r=this.points,i=(r.length-1)*t,o=Math.floor(i),a=i-o,s=r[0===o?o:o-1],c=r[o],u=r[o>r.length-2?r.length-1:o+1],l=r[o>r.length-3?r.length-1:o+2];return n.set(As(a,s.x,c.x,u.x,l.x),As(a,s.y,c.y,u.y,l.y)),n},js.prototype.copy=function(t){xs.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push(r.clone())}return this},js.prototype.toJSON=function(){var t=xs.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var r=this.points[e];t.points.push(r.toArray())}return t},js.prototype.fromJSON=function(t){xs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var r=t.points[e];this.points.push((new y).fromArray(r))}return this};var Bs=Object.freeze({__proto__:null,ArcCurve:Ms,CatmullRomCurve3:Ls,CubicBezierCurve:Os,CubicBezierCurve3:Ns,EllipseCurve:bs,LineCurve:Cs,LineCurve3:Is,QuadraticBezierCurve:Ds,QuadraticBezierCurve3:zs,SplineCurve:js});function ks(){xs.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Fs(t){ks.call(this),this.type="Path",this.currentPoint=new y,t&&this.setFromPoints(t)}function Us(t){Fs.call(this,t),this.uuid=g.generateUUID(),this.type="Shape",this.holes=[]}function Gs(t,e){et.call(this),this.type="Light",this.color=new qt(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Hs(t,e,n){Gs.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(et.DefaultUp),this.updateMatrix(),this.groundColor=new qt(e)}function Vs(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new y(512,512),this.map=null,this.mapPass=null,this.matrix=new j,this._frustum=new on,this._frameExtents=new y(1,1),this._viewportCount=1,this._viewports=[new _(0,0,1,1)]}function Ws(){Vs.call(this,new Qe(50,1,.5,500))}function qs(t,e,n,r,i,o){Gs.call(this,t,e),this.type="SpotLight",this.position.copy(et.DefaultUp),this.updateMatrix(),this.target=new et,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==o?o:1,this.shadow=new Ws}function Xs(){Vs.call(this,new Qe(90,1,.5,500)),this._frameExtents=new y(4,2),this._viewportCount=6,this._viewports=[new _(2,1,1,1),new _(0,1,1,1),new _(3,1,1,1),new _(1,1,1,1),new _(3,0,1,1),new _(1,0,1,1)],this._cubeDirections=[new P(1,0,0),new P(-1,0,0),new P(0,0,1),new P(0,0,-1),new P(0,1,0),new P(0,-1,0)],this._cubeUps=[new P(0,1,0),new P(0,1,0),new P(0,1,0),new P(0,1,0),new P(0,0,1),new P(0,0,-1)]}function Ys(t,e,n,r){Gs.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new Xs}function Js(t,e,n,r,i,o){Ke.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 Zs(){Vs.call(this,new Js(-5,5,5,-5,.5,500))}function Ks(t,e){Gs.call(this,t,e),this.type="DirectionalLight",this.position.copy(et.DefaultUp),this.updateMatrix(),this.target=new et,this.shadow=new Zs}function Qs(t,e){Gs.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function $s(t,e,n,r){Gs.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function tc(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new P)}function ec(t,e){Gs.call(this,void 0,e),this.type="LightProbe",this.sh=void 0!==t?t:new tc}function nc(t){ls.call(this,t),this.textures={}}ks.prototype=Object.assign(Object.create(xs.prototype),{constructor:ks,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Cs(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=e){var i=n[r]-e,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],r=0,i=this.curves;r<i.length;r++)for(var o=i[r],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),c=0;c<s.length;c++){var u=s[c];e&&e.equals(u)||(n.push(u),e=u)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){xs.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push(r.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=xs.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var r=this.curves[e];t.curves.push(r.toJSON())}return t},fromJSON:function(t){xs.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var r=t.curves[e];this.curves.push((new Bs[r.type]).fromJSON(r))}return this}}),Fs.prototype=Object.assign(Object.create(ks.prototype),{constructor:Fs,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){var n=new Cs(this.currentPoint.clone(),new y(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,n,r){var i=new Ds(this.currentPoint.clone(),new y(t,e),new y(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(t,e,n,r,i,o){var a=new Os(this.currentPoint.clone(),new y(t,e),new y(n,r),new y(i,o));return this.curves.push(a),this.currentPoint.set(i,o),this},splineThru:function(t){var e=new js([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,n,r,i,o){var a=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+a,e+s,n,r,i,o),this},absarc:function(t,e,n,r,i,o){return this.absellipse(t,e,n,n,r,i,o),this},ellipse:function(t,e,n,r,i,o,a,s){var c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(t+c,e+u,n,r,i,o,a,s),this},absellipse:function(t,e,n,r,i,o,a,s){var c=new bs(t,e,n,r,i,o,a,s);if(this.curves.length>0){var u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);var l=c.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return ks.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=ks.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return ks.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Us.prototype=Object.assign(Object.create(Fs.prototype),{constructor:Us,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){Fs.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=Fs.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){Fs.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 Fs).fromJSON(r))}return this}}),Gs.prototype=Object.assign(Object.create(et.prototype),{constructor:Gs,isLight:!0,copy:function(t){return et.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=et.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Hs.prototype=Object.assign(Object.create(Gs.prototype),{constructor:Hs,isHemisphereLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Vs.prototype,{_projScreenMatrix:new j,_lightPositionWorld:new P,_lookTarget:new P,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){var e=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,o=this._lightPositionWorld;o.setFromMatrixPosition(t.matrixWorld),e.position.copy(o),i.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(i),e.updateMatrixWorld(),r.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Ws.prototype=Object.assign(Object.create(Vs.prototype),{constructor:Ws,isSpotLightShadow:!0,updateMatrices:function(t){var e=this.camera,n=2*g.RAD2DEG*t.angle,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix()),Vs.prototype.updateMatrices.call(this,t)}}),qs.prototype=Object.assign(Object.create(Gs.prototype),{constructor:qs,isSpotLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Xs.prototype=Object.assign(Object.create(Vs.prototype),{constructor:Xs,isPointLightShadow:!0,updateMatrices:function(t,e){void 0===e&&(e=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,o=this._lookTarget,a=this._projScreenMatrix;i.setFromMatrixPosition(t.matrixWorld),n.position.copy(i),o.copy(n.position),o.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(o),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),a.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(a)}}),Ys.prototype=Object.assign(Object.create(Gs.prototype),{constructor:Ys,isPointLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Js.prototype=Object.assign(Object.create(Ke.prototype),{constructor:Js,isOrthographicCamera:!0,copy:function(t,e){return Ke.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.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(i+=c*this.view.offsetX)+c*this.view.width,s=(a-=u*this.view.offsetY)-u*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=et.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}}),Zs.prototype=Object.assign(Object.create(Vs.prototype),{constructor:Zs,isDirectionalLightShadow:!0,updateMatrices:function(t){Vs.prototype.updateMatrices.call(this,t)}}),Ks.prototype=Object.assign(Object.create(Gs.prototype),{constructor:Ks,isDirectionalLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Qs.prototype=Object.assign(Object.create(Gs.prototype),{constructor:Qs,isAmbientLight:!0}),$s.prototype=Object.assign(Object.create(Gs.prototype),{constructor:$s,isRectAreaLight:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=Gs.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(tc.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*r),e.addScaledVector(o[2],.488603*i),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*r*1.092548),e.addScaledVector(o[5],r*i*1.092548),e.addScaledVector(o[6],.315392*(3*i*i-1)),e.addScaledVector(o[7],n*i*1.092548),e.addScaledVector(o[8],.546274*(n*n-r*r)),e},getIrradianceAt:function(t,e){var n=t.x,r=t.y,i=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*r),e.addScaledVector(o[2],1.023328*i),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*r),e.addScaledVector(o[5],.858086*r*i),e.addScaledVector(o[6],.743125*i*i-.247708),e.addScaledVector(o[7],.858086*n*i),e.addScaledVector(o[8],.429043*(n*n-r*r)),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},addScaledSH:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(t,e+3*r);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(t,e+3*r);return t}}),Object.assign(tc,{getBasisAt:function(t,e){var n=t.x,r=t.y,i=t.z;e[0]=.282095,e[1]=.488603*r,e[2]=.488603*i,e[3]=.488603*n,e[4]=1.092548*n*r,e[5]=1.092548*r*i,e[6]=.315392*(3*i*i-1),e[7]=1.092548*n*i,e[8]=.546274*(n*n-r*r)}}),ec.prototype=Object.assign(Object.create(Gs.prototype),{constructor:ec,isLightProbe:!0,copy:function(t){return Gs.prototype.copy.call(this,t),this.sh.copy(t.sh),this},fromJSON:function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this},toJSON:function(t){var e=Gs.prototype.toJSON.call(this,t);return e.object.sh=this.sh.toArray(),e}}),nc.prototype=Object.assign(Object.create(ls.prototype),{constructor:nc,load:function(t,e,n,r){var i=this,o=new ps(i.manager);o.setPath(i.path),o.load(t,(function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)},parse:function(t){var e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}var r=new Wa[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.sheen&&(r.sheen=(new qt).setHex(t.sheen)),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.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.stencilWrite&&(r.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(r.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(r.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(r.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(r.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(r.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(r.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(r.stencilZPass=t.stencilZPass),void 0!==t.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.morphNormals&&(r.morphNormals=t.morphNormals),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.vertexTangents&&(r.vertexTangents=t.vertexTangents),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.toneMapped&&(r.toneMapped=t.toneMapped),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?r.vertexColors=t.vertexColors>0:r.vertexColors=t.vertexColors),void 0!==t.uniforms)for(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 qt).setHex(o.value);break;case"v2":r.uniforms[i].value=(new y).fromArray(o.value);break;case"v3":r.uniforms[i].value=(new P).fromArray(o.value);break;case"v4":r.uniforms[i].value=(new _).fromArray(o.value);break;case"m3":r.uniforms[i].value=(new x).fromArray(o.value);case"m4":r.uniforms[i].value=(new j).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)),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 y).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.refractionRatio&&(r.refractionRatio=t.refractionRatio),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)),void 0!==t.clearcoatMap&&(r.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(r.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(r.clearcoatNormalScale=(new y).fromArray(t.clearcoatNormalScale)),r},setTextures:function(t){return this.textures=t,this}});var rc=function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)};function ic(){be.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function oc(t,e,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),ee.call(this,t,e,n),this.meshPerAttribute=r||1}function ac(t){ls.call(this,t)}ic.prototype=Object.assign(Object.create(be.prototype),{constructor:ic,isInstancedBufferGeometry:!0,copy:function(t){return be.prototype.copy.call(this,t),this.instanceCount=t.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=be.prototype.toJSON.call(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}),oc.prototype=Object.assign(Object.create(ee.prototype),{constructor:oc,isInstancedBufferAttribute:!0,copy:function(t){return ee.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=ee.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),ac.prototype=Object.assign(Object.create(ls.prototype),{constructor:ac,load:function(t,e,n,r){var i=this,o=new ps(i.manager);o.setPath(i.path),o.load(t,(function(n){try{e(i.parse(JSON.parse(n)))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)},parse:function(t){var e=t.isInstancedBufferGeometry?new ic:new be,n=t.data.index;if(void 0!==n){var r=new sc[n.type](n.array);e.setIndex(new ee(r,1))}var i=t.data.attributes;for(var o in i){var a=i[o],s=(r=new sc[a.type](a.array),new(a.isInstancedBufferAttribute?oc:ee)(r,a.itemSize,a.normalized));void 0!==a.name&&(s.name=a.name),e.setAttribute(o,s)}var c=t.data.morphAttributes;if(c)for(var o in c){for(var u=c[o],l=[],h=0,p=u.length;h<p;h++){a=u[h],s=new ee(r=new sc[a.type](a.array),a.itemSize,a.normalized);void 0!==a.name&&(s.name=a.name),l.push(s)}e.morphAttributes[o]=l}t.data.morphTargetsRelative&&(e.morphTargetsRelative=!0);var d=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==d){h=0;for(var f=d.length;h!==f;++h){var m=d[h];e.addGroup(m.start,m.count,m.materialIndex)}}var v=t.data.boundingSphere;if(void 0!==v){var g=new P;void 0!==v.center&&g.fromArray(v.center),e.boundingSphere=new xt(g,v.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e}});var sc={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function cc(t){ls.call(this,t)}cc.prototype=Object.assign(Object.create(ls.prototype),{constructor:cc,load:function(t,e,n,r){var i=this,o=""===this.path?rc(t):this.path;this.resourcePath=this.resourcePath||o;var a=new ps(i.manager);a.setPath(this.path),a.load(t,(function(n){var o=null;try{o=JSON.parse(n)}catch(e){return void 0!==r&&r(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t)}),n,r)},parse:function(t,e){var n=this.parseShape(t.shapes),r=this.parseGeometries(t.geometries,n),i=this.parseImages(t.images,(function(){void 0!==e&&e(s)})),o=this.parseTextures(t.textures,i),a=this.parseMaterials(t.materials,o),s=this.parseObject(t.object,r,a);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,r=t.length;n<r;n++){var i=(new Us).fromJSON(t[n]);e[i.uuid]=i}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var r=new ac,i=0,o=t.length;i<o;i++){var a,s=t[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new Ia[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new Ia[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new Ia[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new Ia[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new Ia[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new Ia[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":a=new Ia[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new Ia[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new Ia[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new Ia[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":a=new Ia[s.type]((new Bs[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":a=new Ia[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":a=new Ia[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],u=0,l=s.shapes.length;u<l;u++){var h=e[s.shapes[u]];c.push(h)}a=new Ia[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],u=0,l=s.shapes.length;u<l;u++){h=e[s.shapes[u]];c.push(h)}var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Bs[p.type]).fromJSON(p)),a=new Ia[s.type](c,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":a=r.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),!0===a.isBufferGeometry&&void 0!==s.userData&&(a.userData=s.userData),n[s.uuid]=a}return n},parseMaterials:function(t,e){var n={},r={};if(void 0!==t){var i=new nc;i.setTextures(e);for(var o=0,a=t.length;o<a;o++){var s=t[o];if("MultiMaterial"===s.type){for(var c=[],u=0;u<s.materials.length;u++){var l=s.materials[u];void 0===n[l.uuid]&&(n[l.uuid]=i.parse(l)),c.push(n[l.uuid])}r[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n],i=os.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),e.push(i)}return e},parseImages:function(t,e){var n=this,r={};function i(t){return n.manager.itemStart(t),o.load(t,(function(){n.manager.itemEnd(t)}),void 0,(function(){n.manager.itemError(t),n.manager.itemEnd(t)}))}if(void 0!==t&&t.length>0){var o=new vs(new cs(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var c=t[a],u=c.url;if(Array.isArray(u)){r[c.uuid]=[];for(var l=0,h=u.length;l<h;l++){var p=u[l],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;r[c.uuid].push(i(d))}}else{d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.resourcePath+c.url;r[c.uuid]=i(d)}}}return r},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var r={};if(void 0!==t)for(var i=0,o=t.length;i<o;i++){var a,s=t[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(a=Array.isArray(e[s.image])?new Sn(e[s.image]):new w(e[s.image])).needsUpdate=!0,a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=n(s.mapping,lc)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=n(s.wrap[0],hc),a.wrapT=n(s.wrap[1],hc)),void 0!==s.format&&(a.format=s.format),void 0!==s.type&&(a.type=s.type),void 0!==s.encoding&&(a.encoding=s.encoding),void 0!==s.minFilter&&(a.minFilter=n(s.minFilter,pc)),void 0!==s.magFilter&&(a.magFilter=n(s.magFilter,pc)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(a.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(a.unpackAlignment=s.unpackAlignment),r[s.uuid]=a}return r},parseObject:function(t,e,n){var r;function i(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function o(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],r=0,i=t.length;r<i;r++){var o=t[r];void 0===n[o]&&console.warn("THREE.ObjectLoader: Undefined material",o),e.push(n[o])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":r=new nt,void 0!==t.background&&Number.isInteger(t.background)&&(r.background=new qt(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?r.fog=new pi(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(r.fog=new hi(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":r=new Qe(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(r.focus=t.focus),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.filmGauge&&(r.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(r.filmOffset=t.filmOffset),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"OrthographicCamera":r=new Js(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"AmbientLight":r=new Qs(t.color,t.intensity);break;case"DirectionalLight":r=new Ks(t.color,t.intensity);break;case"PointLight":r=new Ys(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":r=new $s(t.color,t.intensity,t.width,t.height);break;case"SpotLight":r=new qs(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":r=new Hs(t.color,t.groundColor,t.intensity);break;case"LightProbe":r=(new ec).fromJSON(t);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":r=new Be(a=i(t.geometry),s=o(t.material));break;case"InstancedMesh":var a=i(t.geometry),s=o(t.material),c=t.count,u=t.instanceMatrix;(r=new Ji(a,s,c)).instanceMatrix=new ee(new Float32Array(u.array),16);break;case"LOD":r=new ki;break;case"Line":r=new no(i(t.geometry),o(t.material),t.mode);break;case"LineLoop":r=new ao(i(t.geometry),o(t.material));break;case"LineSegments":r=new oo(i(t.geometry),o(t.material));break;case"PointCloud":case"Points":r=new po(i(t.geometry),o(t.material));break;case"Sprite":r=new Ri(o(t.material));break;case"Group":r=new ai;break;default:r=new et}if(r.uuid=t.uuid,void 0!==t.name&&(r.name=t.name),void 0!==t.matrix?(r.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(r.matrixAutoUpdate=t.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==t.position&&r.position.fromArray(t.position),void 0!==t.rotation&&r.rotation.fromArray(t.rotation),void 0!==t.quaternion&&r.quaternion.fromArray(t.quaternion),void 0!==t.scale&&r.scale.fromArray(t.scale)),void 0!==t.castShadow&&(r.castShadow=t.castShadow),void 0!==t.receiveShadow&&(r.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(r.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(r.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&r.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(r.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.frustumCulled&&(r.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(r.renderOrder=t.renderOrder),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.layers&&(r.layers.mask=t.layers),void 0!==t.children)for(var l=t.children,h=0;h<l.length;h++)r.add(this.parseObject(l[h],e,n));if("LOD"===t.type){void 0!==t.autoUpdate&&(r.autoUpdate=t.autoUpdate);for(var p=t.levels,d=0;d<p.length;d++){var f=p[d],m=r.getObjectByProperty("uuid",f.object);void 0!==m&&r.addLevel(m,f.distance)}}return r}});var uc,lc={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},hc={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},pc={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};function dc(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),ls.call(this,t),this.options=void 0}function fc(){this.type="ShapePath",this.color=new qt,this.subPaths=[],this.currentPath=null}function mc(t){this.type="Font",this.data=t}function vc(t,e,n,r,i){var o=i.glyphs[t]||i.glyphs["?"];if(o){var a,s,c,u,l,h,p,d,f=new fc;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),v=0,g=m.length;v<g;){switch(m[v++]){case"m":a=m[v++]*e+n,s=m[v++]*e+r,f.moveTo(a,s);break;case"l":a=m[v++]*e+n,s=m[v++]*e+r,f.lineTo(a,s);break;case"q":c=m[v++]*e+n,u=m[v++]*e+r,l=m[v++]*e+n,h=m[v++]*e+r,f.quadraticCurveTo(l,h,c,u);break;case"b":c=m[v++]*e+n,u=m[v++]*e+r,l=m[v++]*e+n,h=m[v++]*e+r,p=m[v++]*e+n,d=m[v++]*e+r,f.bezierCurveTo(l,h,p,d,c,u)}}return{offsetX:o.ha*e,path:f}}console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".")}function gc(t){ls.call(this,t)}dc.prototype=Object.assign(Object.create(ls.prototype),{constructor:dc,setOptions:function(t){return this.options=t,this},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=ss.get(t);if(void 0!==o)return i.manager.itemStart(t),setTimeout((function(){e&&e(o),i.manager.itemEnd(t)}),0),o;fetch(t).then((function(t){return t.blob()})).then((function(t){return void 0===i.options?createImageBitmap(t):createImageBitmap(t,i.options)})).then((function(n){ss.add(t,n),e&&e(n),i.manager.itemEnd(t)})).catch((function(e){r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)})),i.manager.itemStart(t)}}),Object.assign(fc.prototype,{moveTo:function(t,e){return this.currentPath=new Fs,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this},bezierCurveTo:function(t,e,n,r,i,o){return this.currentPath.bezierCurveTo(t,e,n,r,i,o),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function n(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n],o=new Us;o.curves=i.curves,e.push(o)}return e}function r(t,e){for(var n=e.length,r=!1,i=n-1,o=0;o<n;i=o++){var a=e[i],s=e[o],c=s.x-a.x,u=s.y-a.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(a=e[o],c=-c,s=e[i],u=-u),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var l=u*(t.x-a.x)-c*(t.y-a.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return r}var i=ua.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,c,u=[];if(1===o.length)return s=o[0],(c=new Us).curves=s.curves,u.push(c),u;var l=!i(o[0].getPoints());l=t?!l:l;var h,p,d=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=o.length;g<y;g++)a=i(h=(s=o[g]).getPoints()),(a=t?!a:a)?(!l&&f[v]&&v++,f[v]={s:new Us,p:h},f[v].s.curves=s.curves,l&&v++,m[v]=[]):m[v].push({h:s,p:h[0]});if(!f[0])return n(o);if(f.length>1){for(var x=!1,b=[],M=0,w=f.length;M<w;M++)d[M]=[];for(M=0,w=f.length;M<w;M++)for(var _=m[M],S=0;S<_.length;S++){for(var E=_[S],T=!0,L=0;L<f.length;L++)r(E.p,f[L].p)&&(M!==L&&b.push({froms:M,tos:L,hole:S}),T?(T=!1,d[L].push(E)):x=!0);T&&d[M].push(E)}b.length>0&&(x||(m=d))}g=0;for(var A=f.length;g<A;g++){c=f[g].s,u.push(c);for(var P=0,R=(p=m[g]).length;P<R;P++)c.holes.push(p[P].h)}return u}}),Object.assign(mc.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],r=function(t,e,n){for(var r=Array.from?Array.from(t):String(t).split(""),i=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[],s=0,c=0,u=0;u<r.length;u++){var l=r[u];if("\n"===l)s=0,c-=o;else{var h=vc(l,i,s,c,n);s+=h.offsetX,a.push(h.path)}}return a}(t,e,this.data),i=0,o=r.length;i<o;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),gc.prototype=Object.assign(Object.create(ls.prototype),{constructor:gc,load:function(t,e,n,r){var i=this,o=new ps(this.manager);o.setPath(this.path),o.load(t,(function(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}var r=i.parse(n);e&&e(r)}),n,r)},parse:function(t){return new mc(t)}});var yc=function(){return void 0===uc&&(uc=new(window.AudioContext||window.webkitAudioContext)),uc};function xc(t){ls.call(this,t)}function bc(t,e,n){ec.call(this,void 0,n);var r=(new qt).set(t),i=(new qt).set(e),o=new P(r.r,r.g,r.b),a=new P(i.r,i.g,i.b),s=Math.sqrt(Math.PI),c=s*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(s),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}function Mc(t,e){ec.call(this,void 0,e);var n=(new qt).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}xc.prototype=Object.assign(Object.create(ls.prototype),{constructor:xc,load:function(t,e,n,r){var i=this,o=new ps(i.manager);o.setResponseType("arraybuffer"),o.setPath(i.path),o.load(t,(function(n){try{var o=n.slice(0);yc().decodeAudioData(o,(function(t){e(t)}))}catch(e){r?r(e):console.error(e),i.manager.itemError(t)}}),n,r)}}),bc.prototype=Object.assign(Object.create(ec.prototype),{constructor:bc,isHemisphereLightProbe:!0,copy:function(t){return ec.prototype.copy.call(this,t),this},toJSON:function(t){return ec.prototype.toJSON.call(this,t)}}),Mc.prototype=Object.assign(Object.create(ec.prototype),{constructor:Mc,isAmbientLightProbe:!0,copy:function(t){return ec.prototype.copy.call(this,t),this},toJSON:function(t){return ec.prototype.toJSON.call(this,t)}});var wc=new j,_c=new j;function Sc(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Qe,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Qe,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}.prototype,{update:function(t){var e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;var n,r,i=t.projectionMatrix.clone(),o=e.eyeSep/2,a=o*e.near/e.focus,s=e.near*Math.tan(g.DEG2RAD*e.fov*.5)/e.zoom;_c.elements[12]=-o,wc.elements[12]=o,n=-s*e.aspect+a,r=s*e.aspect+a,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*e.aspect-a,r=s*e.aspect-a,i.elements[0]=2*e.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(_c),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(wc)}}),Object.assign(Sc.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}});var Ec=new P,Tc=new T,Lc=new P,Ac=new P;function Pc(){et.call(this),this.type="AudioListener",this.context=yc(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Sc}function Rc(t){et.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._progress=0,this.filters=[]}Pc.prototype=Object.assign(Object.create(et.prototype),{constructor:Pc,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){et.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ec,Tc,Lc),Ac.set(0,0,-1).applyQuaternion(Tc),e.positionX){var r=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Ec.x,r),e.positionY.linearRampToValueAtTime(Ec.y,r),e.positionZ.linearRampToValueAtTime(Ec.z,r),e.forwardX.linearRampToValueAtTime(Ac.x,r),e.forwardY.linearRampToValueAtTime(Ac.y,r),e.forwardZ.linearRampToValueAtTime(Ac.z,r),e.upX.linearRampToValueAtTime(n.x,r),e.upY.linearRampToValueAtTime(n.y,r),e.upZ.linearRampToValueAtTime(n.z,r)}else e.setPosition(Ec.x,Ec.y,Ec.z),e.setOrientation(Ac.x,Ac.y,Ac.z,n.x,n.y,n.z)}}),Rc.prototype=Object.assign(Object.create(et.prototype),{constructor:Rc,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});var Oc=new P,Nc=new T,Cc=new P,Ic=new P;function Dc(t){Rc.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function zc(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function jc(t,e,n){var r,i,o;switch(this.binding=t,this.valueSize=n,e){case"quaternion":r=this._slerp,i=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Dc.prototype=Object.assign(Object.create(Rc.prototype),{constructor:Dc,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){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(t){if(et.prototype.updateMatrixWorld.call(this,t),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(Oc,Nc,Cc),Ic.set(0,0,1).applyQuaternion(Nc);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Oc.x,n),e.positionY.linearRampToValueAtTime(Oc.y,n),e.positionZ.linearRampToValueAtTime(Oc.z,n),e.orientationX.linearRampToValueAtTime(Ic.x,n),e.orientationY.linearRampToValueAtTime(Ic.y,n),e.orientationZ.linearRampToValueAtTime(Ic.z,n)}else e.setPosition(Oc.x,Oc.y,Oc.z),e.setOrientation(Ic.x,Ic.y,Ic.z)}}}),Object.assign(zc.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(jc.prototype,{accumulate:function(t,e){var n=this.buffer,r=this.valueSize,i=t*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)n[i+a]=n[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=o},accumulateAdditive:function(t){var e=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,r,0,t,n),this.cumulativeWeightAdditive+=t},apply:function(t){var e=this.valueSize,n=this.buffer,r=t*e+e,i=this.cumulativeWeight,o=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){var s=e*this._origIndex;this._mixBufferRegion(n,r,s,1-i,e)}o>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*e,1,e);for(var c=e,u=e+e;c!==u;++c)if(n[c]!==n[c+e]){a.setValue(n,r);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,r=n*this._origIndex;t.getValue(e,r);for(var i=n,o=r;i!==o;++i)e[i]=e[r+i%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){for(var t=this._addIndex*this.valueSize,e=t+this.valueSize,n=t;n<e;n++)this.buffer[n]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[4*this._addIndex+3]=1},_setAdditiveIdentityOther:function(){for(var t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]},_select:function(t,e,n,r,i){if(r>=.5)for(var o=0;o!==i;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,r){T.slerpFlat(t,e,t,e,t,n,r)},_slerpAdditive:function(t,e,n,r,i){var o=this._workIndex*i;T.multiplyQuaternionsFlat(t,o,t,e,t,n),T.slerpFlat(t,e,t,e,t,o,r)},_lerp:function(t,e,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*r}},_lerpAdditive:function(t,e,n,r,i){for(var o=0;o!==i;++o){var a=e+o;t[a]=t[a]+t[n+o]*r}}});var Bc=new RegExp("[\\[\\]\\.:\\/]","g"),kc="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Fc=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Uc=/(WCOD+)?/.source.replace("WCOD",kc),Gc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Hc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Vc=new RegExp("^"+Fc+Uc+Gc+Hc+"$"),Wc=["material","materials","bones"];function qc(t,e,n){var r=n||Xc.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}function Xc(t,e,n){this.path=e,this.parsedPath=n||Xc.parseTrackName(e),this.node=Xc.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Yc(t,e,n,r){this._mixer=t,this._clip=e,this._localRoot=n||null,this.blendMode=r||e.blendMode;for(var i=e.tracks,o=i.length,a=new Array(o),s={endingStart:2400,endingEnd:2400},c=0;c!==o;++c){var u=i[c].createInterpolant(null);a[c]=u,u.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Jc(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Zc(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Kc(t,e,n){di.call(this,t,e),this.meshPerAttribute=n||1}function Qc(t,e,n,r){this.ray=new Lt(t,e),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new U,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function $c(t,e){return t.distance-e.distance}function tu(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r)for(var i=t.children,o=0,a=i.length;o<a;o++)tu(i[o],e,n,!0)}Object.assign(qc.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Xc,{Composite:qc,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Xc.Composite(t,e,n):new Xc(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Bc,"")},parseTrackName:function(t){var e=Vc.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!==Wc.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){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var r=function(t){for(var n=0;n<t.length;n++){var i=t[n];if(i.name===e||i.uuid===e)return i;var o=r(i.children);if(o)return o}return null},i=r(t.children);if(i)return i}return null}}),Object.assign(Xc.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)t[e++]=n[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++]},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,r=e.propertyName,i=e.propertyIndex;if(t||(t=Xc.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var s=t[r];if(void 0!==s){var c=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[i]&&(i=t.morphTargetDictionary[i])}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][c]}else{var l=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+l+"."+r+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Xc.prototype,{_getValue_unbound:Xc.prototype.getValue,_setValue_unbound:Xc.prototype.setValue}),Object.assign(function(){this.uuid=g.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,c=void 0,u=0,l=arguments.length;u!==l;++u){var h=arguments[u],p=h.uuid,d=r[p];if(void 0===d){d=e++,r[p]=d,t.push(h);for(var f=0,m=s;f!==m;++f)a[f].push(new Xc(h,i[f],o[f]))}else if(d<n){c=t[d];var v=--n,g=t[v];r[g.uuid]=d,t[d]=g,r[p]=v,t[v]=h;for(f=0,m=s;f!==m;++f){var y=a[f],x=y[v],b=y[d];y[d]=x,void 0===b&&(b=new Xc(h,i[f],o[f])),y[v]=b}}else t[d]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],c=s.uuid,u=n[c];if(void 0!==u&&u>=e){var l=e++,h=t[l];n[h.uuid]=u,t[u]=h,n[c]=l,t[l]=s;for(var p=0,d=i;p!==d;++p){var f=r[p],m=f[l],v=f[u];f[u]=m,f[l]=v}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],u=c.uuid,l=r[u];if(void 0!==l)if(delete r[u],l<n){var h=--n,p=t[h],d=t[y=--e];r[p.uuid]=l,t[l]=p,r[d.uuid]=h,t[h]=d,t.pop();for(var f=0,m=o;f!==m;++f){var v=(x=i[f])[h],g=x[y];x[l]=v,x[h]=g,x.pop()}}else{var y;r[(d=t[y=--e]).uuid]=l,t[l]=d,t.pop();for(f=0,m=o;f!==m;++f){var x;(x=i[f])[l]=x[y],x.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,r=n[t],i=this._bindings;if(void 0!==r)return i[r];var o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,l=new Array(c);r=i.length,n[t]=r,o.push(t),a.push(e),i.push(l);for(var h=u,p=s.length;h!==p;++h){var d=s[h];l[h]=new Xc(d,t,e)}return l},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var r=this._paths,i=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=n,o[n]=s,o.pop(),i[n]=i[a],i.pop(),r[n]=r[a],r.pop()}}}),Object.assign(Yc.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var r=this._clip.duration,i=t._clip.duration,o=i/r,a=r/i;t.warp(1,o,e),this.warp(a,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var r=this._mixer,i=r.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=i,s[1]=i+n,c[0]=t/a,c[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var o=(t-i)*n;if(o<0||0===n)return;this._startTime=null,e=n*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0){var c=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case 2501:for(var l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].accumulateAdditive(s);break;case 2500:default:for(l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].accumulate(r,s)}}}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,r=this.loop,i=this._loopCount,o=2202===r;if(0===t)return-1===i?e:o&&1==(1&i)?n-e:e;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=n)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=n||e<0){var a=Math.floor(e/n);e-=n*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var c=t<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=e;if(o&&1==(1&i))return n-e}return e},_setEndings:function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(t,e,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=n,this}}),Jc.prototype=Object.assign(Object.create(d.prototype),{constructor:Jc,_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,u=c[s];void 0===u&&(u={},c[s]=u);for(var l=0;l!==i;++l){var h=r[l],p=h.name,d=u[p];if(void 0!==d)o[l]=d;else{if(void 0!==(d=o[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=e&&e._propertyBindings[l].binding.parsedPath;++(d=new jc(Xc.create(n,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),o[l]=d}a[l].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var r=this._actions,i=this._actionsByClip,o=i[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=r.length,r.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],r=t._cacheIndex;n._cacheIndex=r,e[r]=n,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,o=this._actionsByClip,a=o[i],s=a.knownActions,c=s[s.length-1],u=t._byClipCacheIndex;c._byClipCacheIndex=u,s[u]=c,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,r=this._nActiveActions++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,r=--this._nActiveActions,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_addInactiveBinding:function(t,e,n){var r=this._bindingsByRootAndName,i=r[e],o=this._bindings;void 0===i&&(i={},r[e]=i),i[n]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,r=n.rootNode.uuid,i=n.path,o=this._bindingsByRootAndName,a=o[r],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete a[i],0===Object.keys(a).length&&delete o[r]},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=this._nActiveBindings++,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,r=--this._nActiveBindings,i=e[r];t._cacheIndex=r,e[r]=t,i._cacheIndex=n,e[n]=i},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&((n=new Ja(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,r=--this._nActiveControlInterpolants,i=e[r];t.__cacheIndex=r,e[r]=t,i.__cacheIndex=n,e[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e,n){var r=e||this._root,i=r.uuid,o="string"==typeof t?os.findByName(r,t):t,a=null!==o?o.uuid:t,s=this._actionsByClip[a],c=null;if(void 0===n&&(n=null!==o?o.blendMode:2500),void 0!==s){var u=s.actionByRoot[i];if(void 0!==u&&u.blendMode===n)return u;c=s.knownActions[0],null===o&&(o=c._clip)}if(null===o)return null;var l=new Yc(this,o,e,n);return this._bindAction(l,c),this._addInactiveAction(l,a,i),l},existingAction:function(t,e){var n=e||this._root,r=n.uuid,i="string"==typeof t?os.findByName(n,t):t,o=i?i.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[r]||null},stopAllAction:function(){for(var t=this._actions,e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,r=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a){e[a]._update(r,t,i,o)}var s=this._bindings,c=this._nActiveBindings;for(a=0;a!==c;++a)s[a].apply(o);return this},setTime:function(t){this.time=0;for(var e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var o=i.knownActions,a=0,s=o.length;a!==s;++a){var c=o[a];this._deactivateAction(c);var u=c._cacheIndex,l=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,l._cacheIndex=u,e[u]=l,e.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[e];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var o=this._bindingsByRootAndName[e];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Zc.prototype.clone=function(){return new Zc(void 0===this.value.clone?this.value:this.value.clone())},Kc.prototype=Object.assign(Object.create(di.prototype),{constructor:Kc,isInstancedInterleavedBuffer:!0,copy:function(t){return di.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Qc.prototype,{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(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var r=n||[];return tu(t,this,r,e),r.sort($c),r},intersectObjects:function(t,e,n){var r=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,o=t.length;i<o;i++)tu(t[i],this,r,e);return r.sort($c),r}}),Object.assign(function(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(g.clamp(e/this.radius,-1,1))),this}}),Object.assign(function(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}});var eu=new y;function nu(t,e){this.min=void 0!==t?t:new y(1/0,1/0),this.max=void 0!==e?e:new y(-1/0,-1/0)}Object.assign(nu.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=eu.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},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=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new y),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new y),this.isEmpty()?t.set(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},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},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},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new y),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},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)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new y),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return eu.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),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)}});var ru=new P,iu=new P;function ou(t,e){this.start=void 0!==t?t:new P,this.end=void 0!==e?e:new P}function au(t){et.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Object.assign(ou.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new P),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new P),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new P),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){ru.subVectors(t,this.start),iu.subVectors(this.end,this.start);var n=iu.dot(iu),r=iu.dot(ru)/n;return e&&(r=g.clamp(r,0,1)),r},closestPointToPoint:function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new P),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),au.prototype=Object.create(et.prototype),au.prototype.constructor=au,au.prototype.isImmediateRenderObject=!0;var su=new P;function cu(t,e){et.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new be,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,o=1;i<32;i++,o++){var a=i/32*Math.PI*2,s=o/32*Math.PI*2;r.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new ue(r,3));var c=new Zi({fog:!1,toneMapped:!1});this.cone=new oo(n,c),this.add(this.cone),this.update()}cu.prototype=Object.create(et.prototype),cu.prototype.constructor=cu,cu.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},cu.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),su.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(su),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var uu=new P,lu=new j,hu=new j;function pu(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var r=0;r<e.children.length;r++)n.push.apply(n,t(e.children[r]));return n}(t),n=new be,r=[],i=[],o=new qt(0,0,1),a=new qt(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(o.r,o.g,o.b),i.push(a.r,a.g,a.b))}n.setAttribute("position",new ue(r,3)),n.setAttribute("color",new ue(i,3));var u=new Zi({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});oo.call(this,n,u),this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function du(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var r=new xa(e,4,2),i=new $t({wireframe:!0,fog:!1,toneMapped:!1});Be.call(this,r,i),this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}pu.prototype=Object.create(oo.prototype),pu.prototype.constructor=pu,pu.prototype.isSkeletonHelper=!0,pu.prototype.updateMatrixWorld=function(t){var e=this.bones,n=this.geometry,r=n.getAttribute("position");hu.getInverse(this.root.matrixWorld);for(var i=0,o=0;i<e.length;i++){var a=e[i];a.parent&&a.parent.isBone&&(lu.multiplyMatrices(hu,a.matrixWorld),uu.setFromMatrixPosition(lu),r.setXYZ(o,uu.x,uu.y,uu.z),lu.multiplyMatrices(hu,a.parent.matrixWorld),uu.setFromMatrixPosition(lu),r.setXYZ(o+1,uu.x,uu.y,uu.z),o+=2)}n.getAttribute("position").needsUpdate=!0,et.prototype.updateMatrixWorld.call(this,t)},du.prototype=Object.create(Be.prototype),du.prototype.constructor=du,du.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},du.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var fu=new P,mu=new qt,vu=new qt;function gu(t,e,n){et.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Lo(e);r.rotateY(.5*Math.PI),this.material=new $t({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);var i=r.getAttribute("position"),o=new Float32Array(3*i.count);r.setAttribute("color",new ee(o,3)),this.add(new Be(r,this.material)),this.update()}function yu(t,e,n,r){t=t||10,e=e||10,n=new qt(void 0!==n?n:4473924),r=new qt(void 0!==r?r:8947848);for(var i=e/2,o=t/e,a=t/2,s=[],c=[],u=0,l=0,h=-a;u<=e;u++,h+=o){s.push(-a,0,h,a,0,h),s.push(h,0,-a,h,0,a);var p=u===i?n:r;p.toArray(c,l),l+=3,p.toArray(c,l),l+=3,p.toArray(c,l),l+=3,p.toArray(c,l),l+=3}var d=new be;d.setAttribute("position",new ue(s,3)),d.setAttribute("color",new ue(c,3));var f=new Zi({vertexColors:!0,toneMapped:!1});oo.call(this,d,f),this.type="GridHelper"}function xu(t,e,n,r,i,o){t=t||10,e=e||16,n=n||8,r=r||64,i=new qt(void 0!==i?i:4473924),o=new qt(void 0!==o?o:8947848);var a,s,c,u,l,h,p,d=[],f=[];for(u=0;u<=e;u++)c=u/e*(2*Math.PI),a=Math.sin(c)*t,s=Math.cos(c)*t,d.push(0,0,0),d.push(a,0,s),p=1&u?i:o,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(u=0;u<=n;u++)for(p=1&u?i:o,h=t-t/n*u,l=0;l<r;l++)c=l/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,d.push(a,0,s),f.push(p.r,p.g,p.b),c=(l+1)/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,d.push(a,0,s),f.push(p.r,p.g,p.b);var m=new be;m.setAttribute("position",new ue(d,3)),m.setAttribute("color",new ue(f,3));var v=new Zi({vertexColors:!0,toneMapped:!1});oo.call(this,m,v),this.type="PolarGridHelper"}gu.prototype=Object.create(et.prototype),gu.prototype.constructor=gu,gu.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},gu.prototype.update=function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");mu.copy(this.light.color),vu.copy(this.light.groundColor);for(var n=0,r=e.count;n<r;n++){var i=n<r/2?mu:vu;e.setXYZ(n,i.r,i.g,i.b)}e.needsUpdate=!0}t.lookAt(fu.setFromMatrixPosition(this.light.matrixWorld).negate())},yu.prototype=Object.assign(Object.create(oo.prototype),{constructor:yu,copy:function(t){return oo.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),xu.prototype=Object.create(oo.prototype),xu.prototype.constructor=xu;var bu=new P,Mu=new P,wu=new P;function _u(t,e,n){et.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var r=new be;r.setAttribute("position",new ue([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new Zi({fog:!1,toneMapped:!1});this.lightPlane=new no(r,i),this.add(this.lightPlane),(r=new be).setAttribute("position",new ue([0,0,0,0,0,1],3)),this.targetLine=new no(r,i),this.add(this.targetLine),this.update()}_u.prototype=Object.create(et.prototype),_u.prototype.constructor=_u,_u.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},_u.prototype.update=function(){bu.setFromMatrixPosition(this.light.matrixWorld),Mu.setFromMatrixPosition(this.light.target.matrixWorld),wu.subVectors(Mu,bu),this.lightPlane.lookAt(Mu),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Mu),this.targetLine.scale.z=wu.length()};var Su=new P,Eu=new Ke;function Tu(t){var e=new be,n=new Zi({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],o={},a=new qt(16755200),s=new qt(16711680),c=new qt(43775),u=new qt(16777215),l=new qt(3355443);function h(t,e,n){p(t,n),p(e,n)}function p(t,e){r.push(0,0,0),i.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(r.length/3-1)}h("n1","n2",a),h("n2","n4",a),h("n4","n3",a),h("n3","n1",a),h("f1","f2",a),h("f2","f4",a),h("f4","f3",a),h("f3","f1",a),h("n1","f1",a),h("n2","f2",a),h("n3","f3",a),h("n4","f4",a),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c),h("c","t",u),h("p","c",l),h("cn1","cn2",l),h("cn3","cn4",l),h("cf1","cf2",l),h("cf3","cf4",l),e.setAttribute("position",new ue(r,3)),e.setAttribute("color",new ue(i,3)),oo.call(this,e,n),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function Lu(t,e,n,r,i,o,a){Su.set(i,o,a).unproject(r);var s=e[t];if(void 0!==s)for(var c=n.getAttribute("position"),u=0,l=s.length;u<l;u++)c.setXYZ(s[u],Su.x,Su.y,Su.z)}Tu.prototype=Object.create(oo.prototype),Tu.prototype.constructor=Tu,Tu.prototype.update=function(){var t=this.geometry,e=this.pointMap;Eu.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Lu("c",e,t,Eu,0,0,-1),Lu("t",e,t,Eu,0,0,1),Lu("n1",e,t,Eu,-1,-1,-1),Lu("n2",e,t,Eu,1,-1,-1),Lu("n3",e,t,Eu,-1,1,-1),Lu("n4",e,t,Eu,1,1,-1),Lu("f1",e,t,Eu,-1,-1,1),Lu("f2",e,t,Eu,1,-1,1),Lu("f3",e,t,Eu,-1,1,1),Lu("f4",e,t,Eu,1,1,1),Lu("u1",e,t,Eu,.7,1.1,-1),Lu("u2",e,t,Eu,-.7,1.1,-1),Lu("u3",e,t,Eu,0,2,-1),Lu("cf1",e,t,Eu,-1,0,1),Lu("cf2",e,t,Eu,1,0,1),Lu("cf3",e,t,Eu,0,-1,1),Lu("cf4",e,t,Eu,0,1,1),Lu("cn1",e,t,Eu,-1,0,-1),Lu("cn2",e,t,Eu,1,0,-1),Lu("cn3",e,t,Eu,0,-1,-1),Lu("cn4",e,t,Eu,0,1,-1),t.getAttribute("position").needsUpdate=!0};var Au=new vt;function Pu(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new be;i.setIndex(new ee(n,1)),i.setAttribute("position",new ee(r,3)),oo.call(this,i,new Zi({color:e,toneMapped:!1})),this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}function Ru(t,e){this.type="Box3Helper",this.box=t,e=e||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new be;r.setIndex(new ee(n,1)),r.setAttribute("position",new ue([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),oo.call(this,r,new Zi({color:e,toneMapped:!1})),this.type="Box3Helper",this.geometry.computeBoundingSphere()}function Ou(t,e,n){this.plane=t,this.size=void 0===e?1:e;var r=void 0!==n?n:16776960,i=new be;i.setAttribute("position",new ue([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),no.call(this,i,new Zi({color:r,toneMapped:!1})),this.type="PlaneHelper";var o=new be;o.setAttribute("position",new ue([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new Be(o,new $t({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}Pu.prototype=Object.create(oo.prototype),Pu.prototype.constructor=Pu,Pu.prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Au.setFromObject(this.object),!Au.isEmpty()){var e=Au.min,n=Au.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Pu.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Pu.prototype.copy=function(t){return oo.prototype.copy.call(this,t),this.object=t.object,this},Pu.prototype.clone=function(){return(new this.constructor).copy(this)},Ru.prototype=Object.create(oo.prototype),Ru.prototype.constructor=Ru,Ru.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),et.prototype.updateMatrixWorld.call(this,t))},Ou.prototype=Object.create(no.prototype),Ou.prototype.constructor=Ou,Ou.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?1:0,this.lookAt(this.plane.normal),et.prototype.updateMatrixWorld.call(this,t)};var Nu,Cu,Iu=new P;function Du(t,e,n,r,i,o){et.call(this),this.type="ArrowHelper",void 0===t&&(t=new P(0,0,1)),void 0===e&&(e=new P(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===o&&(o=.2*i),void 0===Nu&&((Nu=new be).setAttribute("position",new ue([0,0,0,0,1,0],3)),(Cu=new Pa(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new no(Nu,new Zi({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Be(Cu,new $t({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,i,o)}function zu(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new be;n.setAttribute("position",new ue(e,3)),n.setAttribute("color",new ue([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Zi({vertexColors:!0,toneMapped:!1});oo.call(this,n,r),this.type="AxesHelper"}Du.prototype=Object.create(et.prototype),Du.prototype.constructor=Du,Du.prototype.setDirection=function(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Iu.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Iu,e)}},Du.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Du.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Du.prototype.copy=function(t){return et.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Du.prototype.clone=function(){return(new this.constructor).copy(this)},zu.prototype=Object.create(oo.prototype),zu.prototype.constructor=zu;var ju=Math.pow(2,8),Bu=[.125,.215,.35,.446,.526,.582],ku=5+Bu.length,Fu={3e3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},Uu=new Js,{_lodPlanes:Gu,_sizeLods:Hu,_sigmas:Vu}=function(){for(var t=[],e=[],n=[],r=8,i=0;i<ku;i++){var o=Math.pow(2,r);e.push(o);var a=1/o;i>4?a=Bu[i-8+4-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),c=-s/2,u=1+s/2,l=[c,c,u,c,u,u,c,c,u,u,c,u],h=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,v=f>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];h.set(g,18*f),p.set(l,12*f);var y=[f,f,f,f,f,f];d.set(y,6*f)}var x=new be;x.setAttribute("position",new ee(h,3)),x.setAttribute("uv",new ee(p,2)),x.setAttribute("faceIndex",new ee(d,1)),t.push(x),r>4&&r--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}(),Wu=null,qu=(1+Math.sqrt(5))/2,Xu=1/qu,Yu=[new P(1,1,1),new P(-1,1,1),new P(1,1,-1),new P(-1,1,-1),new P(0,qu,Xu),new P(0,qu,-Xu),new P(Xu,0,qu),new P(-Xu,0,qu),new P(qu,Xu,0),new P(-qu,Xu,0)];function Ju(t){var e,n,r,i;this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=(e=20,n=new Float32Array(e),r=new P(0,1,0),(i=new za({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r},inputEncoding:{value:Fu[3e3]},outputEncoding:{value:Fu[3e3]}},vertexShader:el(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${nl()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",i),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Zu(t){return void 0!==t&&1009===t.type&&(3e3===t.encoding||3001===t.encoding||3007===t.encoding)}function Ku(t){var e=new S(3*ju,3*ju,t);return e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Qu(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function $u(){var t=new za({uniforms:{envMap:{value:null},texelSize:{value:new y(1,1)},inputEncoding:{value:Fu[3e3]},outputEncoding:{value:Fu[3e3]}},vertexShader:el(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n${nl()}\n\n#include <common>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv = equirectUv( outputDirection );\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function tl(){var t=new za({uniforms:{envMap:{value:null},inputEncoding:{value:Fu[3e3]},outputEncoding:{value:Fu[3e3]}},vertexShader:el(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n${nl()}\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1});return t.type="CubemapToCubeUV",t}function el(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function nl(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}Ju.prototype={constructor:Ju,fromScene:function(t,e=0,n=.1,r=100){Wu=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(t,n,r,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i},fromEquirectangular:function(t){return t.magFilter=1003,t.minFilter=1003,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){Wu=this._renderer.getRenderTarget();var e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=tl(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=$u(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var t=0;t<Gu.length;t++)Gu[t].dispose()},_cleanup:function(t){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Wu),t.scissorTest=!1,t.setSize(t.width,t.height)},_allocateTargets:function(t){var e={magFilter:1003,minFilter:1003,generateMipmaps:!1,type:1009,format:1023,encoding:Zu(t)?t.encoding:3002,depthBuffer:!1,stencilBuffer:!1},n=Ku(e);return n.depthBuffer=!t,this._pingPongRenderTarget=Ku(e),n},_compileMaterial:function(t){var e=new Be(Gu[0],t);this._renderer.compile(e,Uu)},_sceneToCubeUV:function(t,e,n,r){var i=new Qe(90,1,e,n),o=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],s=this._renderer,c=s.outputEncoding,u=s.toneMapping,l=s.toneMappingExposure,h=s.getClearColor(),p=s.getClearAlpha();s.toneMapping=1,s.toneMappingExposure=1,s.outputEncoding=3e3;var d=t.background;if(d&&d.isColor){d.convertSRGBToLinear();var f=Math.max(d.r,d.g,d.b),m=Math.min(Math.max(Math.ceil(Math.log2(f)),-128),127);d=d.multiplyScalar(Math.pow(2,-m));var v=(m+128)/255;s.setClearColor(d,v),t.background=null}for(var g=0;g<6;g++){var y=g%3;0==y?(i.up.set(0,o[g],0),i.lookAt(a[g],0,0)):1==y?(i.up.set(0,0,o[g]),i.lookAt(0,a[g],0)):(i.up.set(0,o[g],0),i.lookAt(0,0,a[g])),Qu(r,y*ju,g>2?ju:0,ju,ju),s.setRenderTarget(r),s.render(t,i)}s.toneMapping=u,s.toneMappingExposure=l,s.outputEncoding=c,s.setClearColor(h,p)},_textureToCubeUV:function(t,e){var n=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=tl()):null==this._equirectShader&&(this._equirectShader=$u());var r=t.isCubeTexture?this._cubemapShader:this._equirectShader,i=new Be(Gu[0],r),o=r.uniforms;o.envMap.value=t,t.isCubeTexture||o.texelSize.value.set(1/t.image.width,1/t.image.height),o.inputEncoding.value=Fu[t.encoding],o.outputEncoding.value=Fu[e.texture.encoding],Qu(e,0,0,3*ju,2*ju),n.setRenderTarget(e),n.render(i,Uu)},_applyPMREM:function(t){var e=this._renderer,n=e.autoClear;e.autoClear=!1;for(var r=1;r<ku;r++){var i=Math.sqrt(Vu[r]*Vu[r]-Vu[r-1]*Vu[r-1]),o=Yu[(r-1)%Yu.length];this._blur(t,r-1,r,i,o)}e.autoClear=n},_blur:function(t,e,n,r,i){var o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,r,"latitudinal",i),this._halfBlur(o,t,n,n,r,"longitudinal",i)},_halfBlur:function(t,e,n,r,i,o,a){var s=this._renderer,c=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");var u=new Be(Gu[r],c),l=c.uniforms,h=Hu[n]-1,p=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,d=i/p,f=isFinite(i)?1+Math.floor(3*d):20;f>20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);for(var m=[],v=0,g=0;g<20;++g){var y=g/d,x=Math.exp(-y*y/2);m.push(x),0==g?v+=x:g<f&&(v+=2*x)}for(g=0;g<m.length;g++)m[g]=m[g]/v;l.envMap.value=t.texture,l.samples.value=f,l.weights.value=m,l.latitudinal.value="latitudinal"===o,a&&(l.poleAxis.value=a),l.dTheta.value=p,l.mipInt.value=8-n,l.inputEncoding.value=Fu[t.texture.encoding],l.outputEncoding.value=Fu[t.texture.encoding];var b=Hu[r];Qu(e,y=3*Math.max(0,ju-2*b),(0===r?0:2*ju)+2*b*(r>4?r-8+4:0),3*b,2*b),s.setRenderTarget(e),s.render(u,Uu)}};function rl(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ls.call(this,t),this.type="catmullrom"}xs.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(xs.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(ks.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new We,n=0,r=t.length;n<r;n++){var i=t[n];e.vertices.push(new P(i.x,i.y,i.z||0))}return e}}),Object.assign(Fs.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Object.create(Ls.prototype),Object.create(Ls.prototype),rl.prototype=Object.create(Ls.prototype),Object.assign(rl.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),yu.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},pu.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(ls.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),rc(t)}}),ls.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(cc.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(nu.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(vt.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(xt.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),on.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},ou.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(g,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),g.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),g.ceilPowerOfTwo(t)}}),Object.assign(x.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(j.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new P).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,r,i,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,r,n,i,o)}}),Ot.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},T.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Lt.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Gt.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(Gt,{barycoordFromPoint:function(t,e,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Gt.getBarycoord(t,e,n,r,i)},normal:function(t,e,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Gt.getNormal(t,e,n,r)}}),Object.assign(Us.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new pa(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Sa(this,t)}}),Object.assign(y.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(P.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(_.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(We.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(et.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(et.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Be.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Be.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(ki.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Hi.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Fi.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(xs.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Qe.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Gs.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(ee.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(ee.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(be.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new ee(arguments[1],arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(be.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(ic.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(Qc.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(di.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(di.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(da.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Zc.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Qt.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new qt}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(ka.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Ze.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(li.prototype,{clearTarget:function(t,e,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,r)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(li.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?3001:3e3}}}),Object.defineProperties(ei.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(S.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Rc.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new xc).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),zc.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},$e.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};b.crossOrigin=void 0,b.loadTexture=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new ys;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},b.loadTextureCube=function(t,e,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new gs;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,n,void 0,r);return e&&(o.mapping=e),o},b.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},b.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"117"}}));var il,ol;n(29);function al(t){return/^[\da-f]{24}$/i.test(t)}function sl(){if(!il)try{(il=localStorage.getItem("mi-uuid"))||(il=p(),localStorage.setItem("mi-uuid",il))}catch(t){il="NLS-"+p()}return il}function cl(){if(!ol)try{(ol=sessionStorage.getItem("mi-session"))||(ol=p(),sessionStorage.setItem("mi-session",ol))}catch(t){ol="NSS-"+p()}return ol}},function(t,e,n){var r=n(74),i=n(46);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){t.exports=!1},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports={}},function(t,e,n){var r=n(18);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(34),i=n(23),o=n(9),a=n(32),s=n(13),c=n(56),u=Object.getOwnPropertyDescriptor;e.f=n(8)?u:function(t,e){if(t=o(t),e=a(e,!0),c)try{return u(t,e)}catch(t){}if(s(t,e))return i(!r.f.call(t,e),t[e])}},function(t,e,n){"use strict";var r,i;function o(t,e,n){if(!(this instanceof o))return new o(t,e,n);void 0===n&&(n=o.datum.WGS84),this.lat=Number(t),this.lon=Number(e),this.datum=n}t.exports&&(r=n(54)),t.exports&&(i=n(36)),o.ellipsoid={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}},o.datum={ED50:{ellipsoid:o.ellipsoid.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},Irl1975:{ellipsoid:o.ellipsoid.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,-1.042,-.214,-.631]},NAD27:{ellipsoid:o.ellipsoid.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:o.ellipsoid.GRS80,transform:[1.004,-1.91,-.515,-.0015,.0267,34e-5,.011]},NTF:{ellipsoid:o.ellipsoid.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:o.ellipsoid.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:o.ellipsoid.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:o.ellipsoid.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:o.ellipsoid.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:o.ellipsoid.WGS84,transform:[0,0,0,0,0,0,0]}},o.prototype.convertDatum=function(t){var e=this,n=null;if(e.datum==o.datum.WGS84&&(n=t.transform),t==o.datum.WGS84){n=[];for(var r=0;r<7;r++)n[r]=-e.datum.transform[r]}return null==n&&(e=this.convertDatum(o.datum.WGS84),n=t.transform),e.toCartesian().applyTransform(n).toLatLonE(t)},o.prototype.toCartesian=function(){var t=this.lat.toRadians(),e=this.lon.toRadians(),n=this.datum.ellipsoid.a,i=this.datum.ellipsoid.f,o=Math.sin(t),a=Math.cos(t),s=Math.sin(e),c=Math.cos(e),u=2*i-i*i,l=n/Math.sqrt(1-u*o*o);return new r((l+0)*a*c,(l+0)*a*s,(l*(1-u)+0)*o)},r.prototype.toLatLonE=function(t){var e=this.x,n=this.y,r=this.z,i=t.ellipsoid.a,a=t.ellipsoid.b,s=t.ellipsoid.f,c=2*s-s*s,u=c/(1-c),l=Math.sqrt(e*e+n*n),h=a*r/(i*l)*(1+u*a/Math.sqrt(l*l+r*r)),p=h/Math.sqrt(1+h*h),d=p/h,f=isNaN(d)?0:Math.atan2(r+u*a*p*p*p,l-c*i*d*d*d),m=Math.atan2(n,e),v=Math.sin(f);Math.cos(f),Math.sqrt(1-c*v*v);return new o(f.toDegrees(),m.toDegrees(),t)},r.prototype.applyTransform=function(t){var e=this.x,n=this.y,i=this.z,o=t[0],a=t[1],s=t[2],c=t[3]/1e6+1,u=(t[4]/3600).toRadians(),l=(t[5]/3600).toRadians(),h=(t[6]/3600).toRadians();return new r(o+e*c-n*h+i*l,a+e*h+n*c-i*u,s-e*l+n*u+i*c)},o.prototype.toString=function(t,e){return i.toLat(this.lat,t,e)+", "+i.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),t.exports&&(t.exports=o,t.exports.Vector3d=r)},function(t,e,n){"use strict";e.LatLonSpherical=n(140),e.LatLonEllipsoidal=n(28);var r=n(141);for(var i in r)e.LatLonEllipsoidal[i]=r[i];e.LatLonVectors=n(142),e.Vector3d=n(54),e.Utm=n(95),e.Mgrs=n(143),e.OsGridRef=n(144),e.Dms=n(36)},function(t,e,n){var r=n(10),i=n(0)("toStringTag"),o="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:o?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){var r=n(15),i=n(2),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(21)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e,n){var r=n(6);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(7).f,i=n(13),o=n(0)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(74),i=n(46).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){"use strict";var r={parseDMS:function(t){if("number"==typeof t&&isFinite(t))return Number(t);var e,n=String(t).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/);if(""==n[n.length-1]&&n.splice(n.length-1),""==n)return NaN;switch(n.length){case 3:e=n[0]/1+n[1]/60+n[2]/3600;break;case 2:e=n[0]/1+n[1]/60;break;case 1:e=n[0];break;default:return NaN}return/^-|[WS]$/i.test(t.trim())&&(e=-e),Number(e)},separator:"",toDMS:function(t,e,n){if(isNaN(t))return null;if(void 0===e&&(e="dms"),void 0===n)switch(e){case"d":case"deg":n=4;break;case"dm":case"deg+min":n=2;break;case"dms":case"deg+min+sec":n=0;break;default:e="dms",n=0}var i,o,a,s;switch(t=Math.abs(t),e){default:case"d":case"deg":(o=t.toFixed(n))<100&&(o="0"+o),o<10&&(o="0"+o),i=o+"°";break;case"dm":case"deg+min":o=Math.floor(t),60==(a=(60*t%60).toFixed(n))&&(a=0,o++),a<10&&(a="0"+a),i=(o=("000"+o).slice(-3))+"°"+r.separator+a+"′";break;case"dms":case"deg+min+sec":o=Math.floor(t),a=Math.floor(3600*t/60)%60,60==(s=(3600*t%60).toFixed(n))&&(s=(0).toFixed(n),a++),60==a&&(a=0,o++),o=("000"+o).slice(-3),a=("00"+a).slice(-2),s<10&&(s="0"+s),i=o+"°"+r.separator+a+"′"+r.separator+s+"″"}return i},toLat:function(t,e,n){var i=r.toDMS(t,e,n);return null===i?"–":i.slice(1)+r.separator+(t<0?"S":"N")},toLon:function(t,e,n){var i=r.toDMS(t,e,n);return null===i?"–":i+r.separator+(t<0?"W":"E")},toBrng:function(t,e,n){t=(Number(t)+360)%360;var i=r.toDMS(t,e,n);return null===i?"–":i.replace("360","0")},compassPoint:function(t,e){void 0===e&&(e=3),t=(t%360+360)%360;var n=4*Math.pow(2,e-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(t*n/360)%n*16/n]}};t.exports&&(t.exports=r)},function(t,e){t.exports=require("url")},function(t,e,n){"use strict";var r=n(30),i={};i[n(0)("toStringTag")]="z",i+""!="[object z]"&&n(11)(Object.prototype,"toString",(function(){return"[object "+r(this)+"]"}),!0)},function(t,e,n){var r=n(6),i=n(2).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(2).document;t.exports=r&&r.documentElement},function(t,e,n){"use strict";var r,i,o=n(114),a=RegExp.prototype.exec,s=String.prototype.replace,c=a,u=(r=/a/,i=/b*/g,a.call(r,"a"),a.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),l=void 0!==/()??/.exec("")[1];(u||l)&&(c=function(t){var e,n,r,i,c=this;return l&&(n=new RegExp("^"+c.source+"$(?!\\s)",o.call(c))),u&&(e=c.lastIndex),r=a.call(c,t),u&&r&&(c.lastIndex=c.global?r.index+r[0].length:e),l&&r&&r.length>1&&s.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r}),t.exports=c},function(t,e,n){var r=n(16),i=n(71),o=n(26),a=n(17),s=n(116);t.exports=function(t,e){var n=1==t,c=2==t,u=3==t,l=4==t,h=6==t,p=5==t||h,d=e||s;return function(e,s,f){for(var m,v,g=o(e),y=i(g),x=r(s,f,3),b=a(y.length),M=0,w=n?d(e,b):c?d(e,0):void 0;b>M;M++)if((p||M in y)&&(v=x(m=y[M],M,g),t))if(n)w[M]=v;else if(v)switch(t){case 3:return!0;case 5:return m;case 6:return M;case 2:w.push(m)}else if(l)return!1;return h?-1:u||l?l:w}}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t,e){return!!t&&r((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,n){var r=n(31)("keys"),i=n(22);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){"use strict";var r=n(1),i=n(80);r(r.P+r.F*n(82)("includes"),"String",{includes:function(t){return!!~i(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(1),i=n(75)(!0);r(r.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(49)("includes")},function(t,e,n){var r=n(0)("unscopables"),i=Array.prototype;null==i[r]&&n(12)(i,r,{}),t.exports=function(t){i[r][t]=!0}},function(t,e,n){"use strict";var r=n(2),i=n(13),o=n(8),a=n(1),s=n(11),c=n(123).KEY,u=n(4),l=n(31),h=n(33),p=n(22),d=n(0),f=n(84),m=n(124),v=n(125),g=n(72),y=n(3),x=n(6),b=n(9),M=n(32),w=n(23),_=n(52),S=n(127),E=n(27),T=n(7),L=n(20),A=E.f,P=T.f,R=S.f,O=r.Symbol,N=r.JSON,C=N&&N.stringify,I=d("_hidden"),D=d("toPrimitive"),z={}.propertyIsEnumerable,j=l("symbol-registry"),B=l("symbols"),k=l("op-symbols"),F=Object.prototype,U="function"==typeof O,G=r.QObject,H=!G||!G.prototype||!G.prototype.findChild,V=o&&u((function(){return 7!=_(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=A(F,e);r&&delete F[e],P(t,e,n),r&&t!==F&&P(F,e,r)}:P,W=function(t){var e=B[t]=_(O.prototype);return e._k=t,e},q=U&&"symbol"==typeof O.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof O},X=function(t,e,n){return t===F&&X(k,e,n),y(t),e=M(e,!0),y(n),i(B,e)?(n.enumerable?(i(t,I)&&t[I][e]&&(t[I][e]=!1),n=_(n,{enumerable:w(0,!1)})):(i(t,I)||P(t,I,w(1,{})),t[I][e]=!0),V(t,e,n)):P(t,e,n)},Y=function(t,e){y(t);for(var n,r=v(e=b(e)),i=0,o=r.length;o>i;)X(t,n=r[i++],e[n]);return t},J=function(t){var e=z.call(this,t=M(t,!0));return!(this===F&&i(B,t)&&!i(k,t))&&(!(e||!i(this,t)||!i(B,t)||i(this,I)&&this[I][t])||e)},Z=function(t,e){if(t=b(t),e=M(e,!0),t!==F||!i(B,e)||i(k,e)){var n=A(t,e);return!n||!i(B,e)||i(t,I)&&t[I][e]||(n.enumerable=!0),n}},K=function(t){for(var e,n=R(b(t)),r=[],o=0;n.length>o;)i(B,e=n[o++])||e==I||e==c||r.push(e);return r},Q=function(t){for(var e,n=t===F,r=R(n?k:b(t)),o=[],a=0;r.length>a;)!i(B,e=r[a++])||n&&!i(F,e)||o.push(B[e]);return o};U||(s((O=function(){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===F&&e.call(k,n),i(this,I)&&i(this[I],t)&&(this[I][t]=!1),V(this,t,w(1,n))};return o&&H&&V(F,t,{configurable:!0,set:e}),W(t)}).prototype,"toString",(function(){return this._k})),E.f=Z,T.f=X,n(35).f=S.f=K,n(34).f=J,n(51).f=Q,o&&!n(21)&&s(F,"propertyIsEnumerable",J,!0),f.f=function(t){return W(d(t))}),a(a.G+a.W+a.F*!U,{Symbol:O});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;$.length>tt;)d($[tt++]);for(var et=L(d.store),nt=0;et.length>nt;)m(et[nt++]);a(a.S+a.F*!U,"Symbol",{for:function(t){return i(j,t+="")?j[t]:j[t]=O(t)},keyFor:function(t){if(!q(t))throw TypeError(t+" is not a symbol!");for(var e in j)if(j[e]===t)return e},useSetter:function(){H=!0},useSimple:function(){H=!1}}),a(a.S+a.F*!U,"Object",{create:function(t,e){return void 0===e?_(t):Y(_(t),e)},defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:Z,getOwnPropertyNames:K,getOwnPropertySymbols:Q}),N&&a(a.S+a.F*(!U||u((function(){var t=O();return"[null]"!=C([t])||"{}"!=C({a:t})||"{}"!=C(Object(t))}))),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(x(e)||void 0!==t)&&!q(t))return g(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!q(e))return e}),r[1]=e,C.apply(N,r)}}),O.prototype[D]||n(12)(O.prototype,D,O.prototype.valueOf),h(O,"Symbol"),h(Math,"Math",!0),h(r.JSON,"JSON",!0)},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(3),i=n(126),o=n(46),a=n(45)("IE_PROTO"),s=function(){},c=function(){var t,e=n(39)("iframe"),r=o.length;for(e.style.display="none",n(41).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[o[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=r(t),n=new s,s.prototype=null,n[a]=t):n=c(),void 0===e?n:i(n,e)}},function(t,e,n){"use strict";var r=n(49),i=n(131),o=n(25),a=n(9);t.exports=n(92)(Array,"Array",(function(t,e){this._t=a(t),this._i=0,this._k=e}),(function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):i(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])}),"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(t,e,n){"use strict";function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);this.x=Number(t),this.y=Number(e),this.z=Number(n)}r.prototype.plus=function(t){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");return new r(this.x+t.x,this.y+t.y,this.z+t.z)},r.prototype.minus=function(t){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");return new r(this.x-t.x,this.y-t.y,this.z-t.z)},r.prototype.times=function(t){return t=Number(t),new r(this.x*t,this.y*t,this.z*t)},r.prototype.dividedBy=function(t){return t=Number(t),new r(this.x/t,this.y/t,this.z/t)},r.prototype.dot=function(t){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");return this.x*t.x+this.y*t.y+this.z*t.z},r.prototype.cross=function(t){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");return new r(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},r.prototype.negate=function(){return new r(-this.x,-this.y,-this.z)},r.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},r.prototype.unit=function(){var t=this.length();return 1==t||0==t?this:new r(this.x/t,this.y/t,this.z/t)},r.prototype.angleTo=function(t,e){if(!(t instanceof r))throw new TypeError("v is not Vector3d object");if(!(e instanceof r||null==e))throw new TypeError("n is not Vector3d object");var n=null==e?1:Math.sign(this.cross(t).dot(e)),i=this.cross(t).length()*n,o=this.dot(t);return Math.atan2(i,o)},r.prototype.rotateAround=function(t,e){if(!(t instanceof r))throw new TypeError("axis is not Vector3d object");for(var n=this.unit(),i=[n.x,n.y,n.z],o=t.unit(),a=Math.sin(e),s=Math.cos(e),c=[[o.x*o.x*(1-s)+s,o.x*o.y*(1-s)-o.z*a,o.x*o.z*(1-s)+o.y*a],[o.y*o.x*(1-s)+o.z*a,o.y*o.y*(1-s)+s,o.y*o.z*(1-s)-o.x*a],[o.z*o.x*(1-s)-o.y*a,o.z*o.y*(1-s)+o.x*a,o.z*o.z*(1-s)+s]],u=[0,0,0],l=0;l<3;l++)for(var h=0;h<3;h++)u[l]+=c[l][h]*i[h];return new r(u[0],u[1],u[2])},r.prototype.toString=function(t){var e=void 0===t?3:Number(t);return"["+this.x.toFixed(e)+","+this.y.toFixed(e)+","+this.z.toFixed(e)+"]"},void 0===Math.sign&&(Math.sign=function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1}),t.exports&&(t.exports=r)},function(t,e){t.exports=require("http")},function(t,e,n){t.exports=!n(8)&&!n(4)((function(){return 7!=Object.defineProperty(n(39)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){"use strict";var r,i,o,a,s=n(21),c=n(2),u=n(16),l=n(30),h=n(1),p=n(6),d=n(24),f=n(103),m=n(104),v=n(61),g=n(62).set,y=n(106)(),x=n(63),b=n(107),M=n(108),w=n(109),_=c.TypeError,S=c.process,E=S&&S.versions,T=E&&E.v8||"",L=c.Promise,A="process"==l(S),P=function(){},R=i=x.f,O=!!function(){try{var t=L.resolve(1),e=(t.constructor={})[n(0)("species")]=function(t){t(P,P)};return(A||"function"==typeof PromiseRejectionEvent)&&t.then(P)instanceof e&&0!==T.indexOf("6.6")&&-1===M.indexOf("Chrome/66")}catch(t){}}(),N=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},C=function(t,e){if(!t._n){t._n=!0;var n=t._c;y((function(){for(var r=t._v,i=1==t._s,o=0,a=function(e){var n,o,a,s=i?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(i||(2==t._h&&z(t),t._h=1),!0===s?n=r:(l&&l.enter(),n=s(r),l&&(l.exit(),a=!0)),n===e.promise?u(_("Promise-chain cycle")):(o=N(n))?o.call(n,c,u):c(n)):u(r)}catch(t){l&&!a&&l.exit(),u(t)}};n.length>o;)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&I(t)}))}},I=function(t){g.call(c,(function(){var e,n,r,i=t._v,o=D(t);if(o&&(e=b((function(){A?S.emit("unhandledRejection",i,t):(n=c.onunhandledrejection)?n({promise:t,reason:i}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",i)})),t._h=A||D(t)?2:1),t._a=void 0,o&&e.e)throw e.v}))},D=function(t){return 1!==t._h&&0===(t._a||t._c).length},z=function(t){g.call(c,(function(){var e;A?S.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})}))},j=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),C(e,!0))},B=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw _("Promise can't be resolved itself");(e=N(t))?y((function(){var r={_w:n,_d:!1};try{e.call(t,u(B,r,1),u(j,r,1))}catch(t){j.call(r,t)}})):(n._v=t,n._s=1,C(n,!1))}catch(t){j.call({_w:n,_d:!1},t)}}};O||(L=function(t){f(this,L,"Promise","_h"),d(t),r.call(this);try{t(u(B,this,1),u(j,this,1))}catch(t){j.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(110)(L.prototype,{then:function(t,e){var n=R(v(this,L));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=A?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&C(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r;this.promise=t,this.resolve=u(B,t,1),this.reject=u(j,t,1)},x.f=R=function(t){return t===L||t===a?new o(t):i(t)}),h(h.G+h.W+h.F*!O,{Promise:L}),n(33)(L,"Promise"),n(111)("Promise"),a=n(15).Promise,h(h.S+h.F*!O,"Promise",{reject:function(t){var e=R(this);return(0,e.reject)(t),e.promise}}),h(h.S+h.F*(s||!O),"Promise",{resolve:function(t){return w(s&&this===a?L:this,t)}}),h(h.S+h.F*!(O&&n(64)((function(t){L.all(t).catch(P)}))),"Promise",{all:function(t){var e=this,n=R(e),r=n.resolve,i=n.reject,o=b((function(){var n=[],o=0,a=1;m(t,!1,(function(t){var s=o++,c=!1;n.push(void 0),a++,e.resolve(t).then((function(t){c||(c=!0,n[s]=t,--a||r(n))}),i)})),--a||r(n)}));return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=R(e),r=n.reject,i=b((function(){m(t,!1,(function(t){e.resolve(t).then(n.resolve,r)}))}));return i.e&&r(i.v),n.promise}})},function(t,e,n){var r=n(3);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&r(o.call(t)),e}}},function(t,e,n){var r=n(25),i=n(0)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||o[i]===t)}},function(t,e,n){var r=n(30),i=n(0)("iterator"),o=n(25);t.exports=n(15).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(3),i=n(24),o=n(0)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},function(t,e,n){var r,i,o,a=n(16),s=n(105),c=n(41),u=n(39),l=n(2),h=l.process,p=l.setImmediate,d=l.clearImmediate,f=l.MessageChannel,m=l.Dispatch,v=0,g={},y=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},x=function(t){y.call(t.data)};p&&d||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return g[++v]=function(){s("function"==typeof t?t:Function(t),e)},r(v),v},d=function(t){delete g[t]},"process"==n(10)(h)?r=function(t){h.nextTick(a(y,t,1))}:m&&m.now?r=function(t){m.now(a(y,t,1))}:f?(o=(i=new f).port2,i.port1.onmessage=x,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",x,!1)):r="onreadystatechange"in u("script")?function(t){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),y.call(t)}}:function(t){setTimeout(a(y,t,1),0)}),t.exports={set:p,clear:d}},function(t,e,n){"use strict";var r=n(24);function i(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new i(t)}},function(t,e,n){var r=n(0)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o=[7],a=o[r]();a.next=function(){return{done:n=!0}},o[r]=function(){return a},t(o)}catch(t){}return n}},function(t,e,n){"use strict";var r=n(3),i=n(112),o=n(66);n(67)("search",1,(function(t,e,n,a){return[function(n){var r=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var s=r(t),c=String(this),u=s.lastIndex;i(u,0)||(s.lastIndex=0);var l=o(s,c);return i(s.lastIndex,u)||(s.lastIndex=u),null===l?-1:l.index}]}))},function(t,e,n){"use strict";var r=n(30),i=RegExp.prototype.exec;t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var o=n.call(t,e);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},function(t,e,n){"use strict";n(113);var r=n(11),i=n(12),o=n(4),a=n(18),s=n(0),c=n(42),u=s("species"),l=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),h=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var p=s(t),d=!o((function(){var e={};return e[p]=function(){return 7},7!=""[t](e)})),f=d?!o((function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[u]=function(){return n}),n[p](""),!e})):void 0;if(!d||!f||"replace"===t&&!l||"split"===t&&!h){var m=/./[p],v=n(a,p,""[t],(function(t,e,n,r,i){return e.exec===c?d&&!i?{done:!0,value:m.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}})),g=v[0],y=v[1];r(String.prototype,t,g),i(RegExp.prototype,p,2==e?function(t,e){return y.call(t,this,e)}:function(t){return y.call(t,this)})}}},function(t,e,n){"use strict";var r=n(115);t.exports=function(t,e){return/^\/\//.test(t)&&(t="https:"+t),r.call(this,t,e)},global.fetch||(global.fetch=t.exports,global.Response=r.Response,global.Headers=r.Headers,global.Request=r.Request)},function(t,e){!function(){"use strict";t.exports=function(t){return(t instanceof Buffer?t:Buffer.from(t.toString(),"binary")).toString("base64")}}()},function(t,e,n){"use strict";var r=n(1),i=n(43)(1);r(r.P+r.F*!n(44)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},function(t,e,n){var r=n(10);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(10);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){var r=n(26),i=n(20);n(77)("keys",(function(){return function(t){return i(r(t))}}))},function(t,e,n){var r=n(13),i=n(9),o=n(75)(!1),a=n(45)("IE_PROTO");t.exports=function(t,e){var n,s=i(t),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);for(;e.length>c;)r(s,n=e[c++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var r=n(9),i=n(17),o=n(76);t.exports=function(t){return function(e,n,a){var s,c=r(e),u=i(c.length),l=o(a,u);if(t&&n!=n){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(40),i=Math.max,o=Math.min;t.exports=function(t,e){return(t=r(t))<0?i(t+e,0):o(t,e)}},function(t,e,n){var r=n(1),i=n(15),o=n(4);t.exports=function(t,e){var n=(i.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*o((function(){n(1)})),"Object",a)}},function(t,e,n){var r=n(7).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||n(8)&&r(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,e,n){var r=n(1),i=n(118)(!1);r(r.S,"Object",{values:function(t){return i(t)}})},function(t,e,n){var r=n(81),i=n(18);t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(i(t))}},function(t,e,n){var r=n(6),i=n(10),o=n(0)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},function(t,e,n){var r=n(0)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){var r=n(40),i=n(18);t.exports=function(t){return function(e,n){var o,a,s=String(i(e)),c=r(n),u=s.length;return c<0||c>=u?t?"":void 0:(o=s.charCodeAt(c))<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):o:t?s.slice(c,c+2):a-56320+(o-55296<<10)+65536}}},function(t,e,n){e.f=n(0)},function(t,e,n){"use strict";var r=n(1),i=n(43)(2);r(r.P+r.F*!n(44)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},function(t,e,n){var r=n(9),i=n(27).f;n(77)("getOwnPropertyDescriptor",(function(){return function(t,e){return i(r(t),e)}}))},function(t,e,n){var r=n(1),i=n(128),o=n(9),a=n(27),s=n(88);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=o(t),c=a.f,u=i(r),l={},h=0;u.length>h;)void 0!==(n=c(r,e=u[h++]))&&s(l,e,n);return l}})},function(t,e,n){"use strict";var r=n(7),i=n(23);t.exports=function(t,e,n){e in t?r.f(t,e,i(0,n)):t[e]=n}},function(t,e,n){"use strict";var r=n(1),i=n(41),o=n(10),a=n(76),s=n(17),c=[].slice;r(r.P+r.F*n(4)((function(){i&&c.call(i)})),"Array",{slice:function(t,e){var n=s(this.length),r=o(this);if(e=void 0===e?n:e,"Array"==r)return c.call(this,t,e);for(var i=a(t,n),u=a(e,n),l=s(u-i),h=new Array(l),p=0;p<l;p++)h[p]="String"==r?this.charAt(i+p):this[i+p];return h}})},function(t,e,n){"use strict";var r=n(16),i=n(1),o=n(26),a=n(58),s=n(59),c=n(17),u=n(88),l=n(60);i(i.S+i.F*!n(64)((function(t){Array.from(t)})),"Array",{from:function(t){var e,n,i,h,p=o(t),d="function"==typeof this?this:Array,f=arguments.length,m=f>1?arguments[1]:void 0,v=void 0!==m,g=0,y=l(p);if(v&&(m=r(m,f>2?arguments[2]:void 0,2)),null==y||d==Array&&s(y))for(n=new d(e=c(p.length));e>g;g++)u(n,g,v?m(p[g],g):p[g]);else for(h=y.call(p),n=new d;!(i=h.next()).done;g++)u(n,g,v?a(h,m,[i.value,g],!0):i.value);return n.length=g,n}})},function(t,e,n){"use strict";var r=n(83)(!0);n(92)(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})}))},function(t,e,n){"use strict";var r=n(21),i=n(1),o=n(11),a=n(12),s=n(25),c=n(129),u=n(33),l=n(130),h=n(0)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,f,m,v,g){c(n,e,f);var y,x,b,M=function(t){if(!p&&t in E)return E[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",_="values"==m,S=!1,E=t.prototype,T=E[h]||E["@@iterator"]||m&&E[m],L=T||M(m),A=m?_?M("entries"):L:void 0,P="Array"==e&&E.entries||T;if(P&&(b=l(P.call(new t)))!==Object.prototype&&b.next&&(u(b,w,!0),r||"function"==typeof b[h]||a(b,h,d)),_&&T&&"values"!==T.name&&(S=!0,L=function(){return T.call(this)}),r&&!g||!p&&!S&&E[h]||a(E,h,L),s[e]=L,s[w]=d,m)if(y={values:_?L:M("values"),keys:v?L:M("keys"),entries:A},g)for(x in y)x in E||o(E,x,y[x]);else i(i.P+i.F*(p||S),e,y);return y}},function(t,e,n){for(var r=n(53),i=n(20),o=n(11),a=n(2),s=n(12),c=n(25),u=n(0),l=u("iterator"),h=u("toStringTag"),p=c.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},f=i(d),m=0;m<f.length;m++){var v,g=f[m],y=d[g],x=a[g],b=x&&x.prototype;if(b&&(b[l]||s(b,l,p),b[h]||s(b,h,g),c[g]=p,y))for(v in r)b[v]||o(b,v,r[v],!0)}},function(t,e,n){"use strict";var r=n(1),i=n(43)(5),o=!0;"find"in[]&&Array(1).find((function(){o=!1})),r(r.P+r.F*o,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n(49)("find")},function(t,e,n){"use strict";var r;function i(t,e,n,o,a,s,c){if(!(this instanceof i))return new i(t,e,n,o,a,s,c);if(void 0===a&&(a=r.datum.WGS84),void 0===s&&(s=null),void 0===c&&(c=null),!(1<=t&&t<=60))throw new Error("Invalid UTM zone "+t);if(!e.match(/[NS]/i))throw new Error("Invalid UTM hemisphere "+e);this.zone=Number(t),this.hemisphere=e.toUpperCase(),this.easting=Number(n),this.northing=Number(o),this.datum=a,this.convergence=null===s?null:Number(s),this.scale=null===c?null:Number(c)}t.exports&&(r=n(28)),r.prototype.toUtm=function(){if(isNaN(this.lat)||isNaN(this.lon))throw new Error("Invalid point");if(!(-80<=this.lat&&this.lat<=84))throw new Error("Outside UTM limits");var t=Math.floor((this.lon+180)/6)+1,e=(6*(t-1)-180+3).toRadians(),n="CDEFGHJKLMNPQRSTUVWXX".charAt(Math.floor(this.lat/8+10));31==t&&"V"==n&&this.lon>=3&&(t++,e+=6..toRadians()),32==t&&"X"==n&&this.lon<9&&(t--,e-=6..toRadians()),32==t&&"X"==n&&this.lon>=9&&(t++,e+=6..toRadians()),34==t&&"X"==n&&this.lon<21&&(t--,e-=6..toRadians()),34==t&&"X"==n&&this.lon>=21&&(t++,e+=6..toRadians()),36==t&&"X"==n&&this.lon<33&&(t--,e-=6..toRadians()),36==t&&"X"==n&&this.lon>=33&&(t++,e+=6..toRadians());for(var r=this.lat.toRadians(),o=this.lon.toRadians()-e,a=this.datum.ellipsoid.a,s=this.datum.ellipsoid.f,c=.9996,u=Math.sqrt(s*(2-s)),l=s/(2-s),h=l*l,p=l*h,d=l*p,f=l*d,m=l*f,v=Math.cos(o),g=Math.sin(o),y=Math.tan(o),x=Math.tan(r),b=Math.sinh(u*Math.atanh(u*x/Math.sqrt(1+x*x))),M=x*Math.sqrt(1+b*b)-b*Math.sqrt(1+x*x),w=Math.atan2(M,v),_=Math.asinh(g/Math.sqrt(M*M+v*v)),S=a/(1+l)*(1+1/4*h+1/64*d+1/256*m),E=[null,.5*l-2/3*h+5/16*p+41/180*d-127/288*f+7891/37800*m,13/48*h-.6*p+557/1440*d+281/630*f-1983433/1935360*m,61/240*p-103/140*d+15061/26880*f+167603/181440*m,49561/161280*d-179/168*f+6601661/7257600*m,34729/80640*f-3418889/1995840*m,.6650675310896665*m],T=w,L=1;L<=6;L++)T+=E[L]*Math.sin(2*L*w)*Math.cosh(2*L*_);var A=_;for(L=1;L<=6;L++)A+=E[L]*Math.cos(2*L*w)*Math.sinh(2*L*_);var P=c*S*A,R=c*S*T,O=1;for(L=1;L<=6;L++)O+=2*L*E[L]*Math.cos(2*L*w)*Math.cosh(2*L*_);var N=0;for(L=1;L<=6;L++)N+=2*L*E[L]*Math.sin(2*L*w)*Math.sinh(2*L*_);var C=Math.atan(M/Math.sqrt(1+M*M)*y)+Math.atan2(N,O),I=Math.sin(r),D=c*(Math.sqrt(1-u*u*I*I)*Math.sqrt(1+x*x)/Math.sqrt(M*M+v*v))*(S/a*Math.sqrt(O*O+N*N));P+=5e5,R<0&&(R+=1e7),P=Number(P.toFixed(6)),R=Number(R.toFixed(6));var z=Number(C.toDegrees().toFixed(9)),j=Number(D.toFixed(12));return new i(t,this.lat>=0?"N":"S",P,R,this.datum,z,j)},i.prototype.toLatLonE=function(){var t=this.zone,e=this.hemisphere,n=this.easting,i=this.northing;if(isNaN(t)||isNaN(n)||isNaN(i))throw new Error("Invalid coordinate");var o=this.datum.ellipsoid.a,a=this.datum.ellipsoid.f,s=.9996;n-=5e5,i="S"==e?i-1e7:i;for(var c=Math.sqrt(a*(2-a)),u=a/(2-a),l=u*u,h=u*l,p=u*h,d=u*p,f=u*d,m=o/(1+u)*(1+1/4*l+1/64*p+1/256*f),v=n/(s*m),g=i/(s*m),y=[null,.5*u-2/3*l+37/96*h-1/360*p-81/512*d+96199/604800*f,1/48*l+1/15*h-437/1440*p+46/105*d-1118711/3870720*f,17/480*h-37/840*p-209/4480*d+5569/90720*f,4397/161280*p-11/504*d-830251/7257600*f,4583/161280*d-108847/3991680*f,20648693/638668800*f],x=g,b=1;b<=6;b++)x-=y[b]*Math.sin(2*b*g)*Math.cosh(2*b*v);var M=v;for(b=1;b<=6;b++)M-=y[b]*Math.cos(2*b*g)*Math.sinh(2*b*v);var w=Math.sinh(M),_=Math.sin(x),S=Math.cos(x),E=_/Math.sqrt(w*w+S*S),T=E;do{var L=Math.sinh(c*Math.atanh(c*T/Math.sqrt(1+T*T))),A=T*Math.sqrt(1+L*L)-L*Math.sqrt(1+T*T),P=(E-A)/Math.sqrt(1+A*A)*(1+(1-c*c)*T*T)/((1-c*c)*Math.sqrt(1+T*T));T+=P}while(Math.abs(P)>1e-12);var R=T,O=Math.atan(R),N=Math.atan2(w,S),C=1;for(b=1;b<=6;b++)C-=2*b*y[b]*Math.cos(2*b*g)*Math.cosh(2*b*v);var I=0;for(b=1;b<=6;b++)I+=2*b*y[b]*Math.sin(2*b*g)*Math.sinh(2*b*v);var D=Math.atan(Math.tan(x)*Math.tanh(M))+Math.atan2(I,C),z=Math.sin(O),j=s*(Math.sqrt(1-c*c*z*z)*Math.sqrt(1+R*R)*Math.sqrt(w*w+S*S))*(m/o/Math.sqrt(C*C+I*I));N+=(6*(t-1)-180+3).toRadians();var B=Number(O.toDegrees().toFixed(11)),k=Number(N.toDegrees().toFixed(11)),F=Number(D.toDegrees().toFixed(9)),U=Number(j.toFixed(12)),G=new r(B,k,this.datum);return G.convergence=F,G.scale=U,G},i.parse=function(t,e){if(void 0===e&&(e=r.datum.WGS84),null==(t=t.trim().match(/\S+/g))||4!=t.length)throw new Error("Invalid UTM coordinate ‘"+t+"’");return new i(t[0],t[1],t[2],t[3],e)},i.prototype.toString=function(t){t=Number(t||0);var e=this.zone<10?"0"+this.zone:this.zone,n=this.hemisphere,r=this.easting,i=this.northing;return isNaN(e)||!n.match(/[NS]/)||isNaN(r)||isNaN(i)?"":e+" "+n+" "+r.toFixed(t)+" "+i.toFixed(t)},void 0===Math.sinh&&(Math.sinh=function(t){return(Math.exp(t)-Math.exp(-t))/2}),void 0===Math.cosh&&(Math.cosh=function(t){return(Math.exp(t)+Math.exp(-t))/2}),void 0===Math.tanh&&(Math.tanh=function(t){return(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))}),void 0===Math.asinh&&(Math.asinh=function(t){return Math.log(t+Math.sqrt(1+t*t))}),void 0===Math.atanh&&(Math.atanh=function(t){return Math.log((1+t)/(1-t))/2}),t.exports&&(t.exports=i)},function(t,e){t.exports=require("https")},function(t,e,n){"use strict";(function(t){n(70),n(73),n(78),n(79),n(65),n(47),n(48),n(119),n(121),n(122),n(38),n(57),n(50),n(85),n(86),n(87),n(89),n(90),n(91),n(53),n(93);var r=n(19);function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}e.a=function(e){e=e||{},this.ASSET_TYPES={LOCATION:"location",EVENT:"event",CATEGORY:"category"};var n=this;n.useSmartSearch=e.smart;var o=e.endpoint||e.baseUrl||(n.useSmartSearch?"https://api-gateway.mappedin.com/search/":"https://search.mappedin.com/"),a=e.venue,c=e.key,u=e.secret,l=e.locations||[],h=e.categories||[],p=n.useSmartSearch?"/search":"/suggest",d={Authorization:"Basic "+t(c+":"+u),"mi-context":"web","mi-session":Object(r.b)(),"mi-device":Object(r.a)()},f=function(t){return Object.keys(t).map((function(e){return e+"="+encodeURIComponent(t[e])})).join("&")},m=function(t){this.assetType=t.assetType,this.score=t.score||t.strength,this.name=t.name,this.id=t.id,this.description=t.description,n.useSmartSearch&&(this.strength=t.strength,t.ids&&(this.id=t.ids[0]))},v=function(t){m.call(this,t),this.categories=t.categories,this.logo=t.logo,this.assetType=n.ASSET_TYPES.LOCATION},g=function(t){m.call(this,t),this.assetType=n.ASSET_TYPES.CATEGORY},y=function(t){m.call(this,t),this.location=t.location,this.startData=t.startDate,this.endData=t.endDate,this.showDate=t.showDate},x=function(t,e,r){if(this.query=t,this.total=e.total,this.page=r.pn||1,n.useSmartSearch){var i=e.categories,o=e.locations,a={locations:[],categories:[]},c={};o.map((function(t){t.ids.forEach((function(e){c[e]||(c[e]=new v(s(s({},t),{},{ids:[e]})))}))})),a.locations=Object.values(c),a.categories=i.map((function(t){return new g(t)})),this.hits=a}else this.hits=e.hits.map((function(t){switch(t.assetType){case n.ASSET_TYPES.LOCATION:return new v(t);case n.ASSET_TYPES.EVENT:return new y(t)}}));this.getNextPage=function(){return r.pn+=1,n.search(t,r)},this.hasNextPage=function(){return r.pn*r.ps<e.total}},b=function(t,e){this.query=t,this.total=e.total,this.hits=e.hits.map((function(t){return t.text}))},M=function(t,e){var n=function(t,e){var n=t.toLowerCase(),r=[],o=[];if(l.forEach((function(t){var e=t.name.toLowerCase();if(n.includes(" ")&&e.includes(n))r.push(new v(t));else{var o,a=i(e.split(/\s+/));try{for(a.s();!(o=a.n()).done;){if(o.value.startsWith(n)){r.push(new v(t));break}}}catch(t){a.e(t)}finally{a.f()}}})),e.expandCategories){var a=r.map((function(t){return t.id}));h.forEach((function(t){var e=t.name.toLowerCase(),i=t.id;e===n&&l.forEach((function(t){t.categories.includes(i)&&!a.includes(t.id)&&r.push(new v(t))}))}))}else h.forEach((function(t){var e=t.name.toLowerCase();if(n.includes(" ")&&e.includes(n))o.push(new g(t));else{var r,a=i(e.split(/\s+/));try{for(a.s();!(r=a.n()).done;){if(r.value.startsWith(n)){o.push(new g(t));break}}}catch(t){a.e(t)}finally{a.f()}}}));var s=r.concat(o);return s.sort((function(t,e){var n=t.name,r=e.name;return n.localeCompare(r)})),s}(t,e);this.query=t,this.total=n.length,this.hits=n,this.fallbackSearch=!0,this.page=e.pn||1,this.getNextPage=function(){},this.hasNextPage=!1};this.search=function(t,e){(e=e||{}).q=t,n.useSmartSearch?(e.ln=null==e.ln?20:e.ln,e.cn=null==e.cn?5:e.cn,e.lang=null==e.lang?"en":e.lang):(e.ps=null==e.ps?10:e.ps,e.pn=null==e.pn?1:e.pn);var r=!1;e.expandCategories&&(r=e.expandCategories,delete e.expandCategories);var i=o+a+"/search?"+f(e),c={method:"GET",mode:"cors",headers:d};return new Promise((function(n,r){0!=t.length?fetch(i,c).then((function(i){200!=i.status?r({message:i.status+" "+i.statusText,response:i}):i.json().then((function(r){n(new x(t,r,e))}),r)}),r):r({message:"Empty Search",response:{}})})).catch((function(n){var i=l.length||h.length,o=n&&n.message&&"Empty Search"===n.message;if(!i||o)throw n;return new M(t,s({expandCategories:r},e))}))},this.suggest=function(t){if(n.useSmartSearch){console.warn("Smart Search doesn't support the Suggest API; please use the Search API.");return new b(t,{total:0,hits:[]})}(e={}).q=t.toLowerCase();var r=o+a+p+"?"+f(e),i={method:"GET",mode:"cors",headers:d};return new Promise((function(e,n){0!=t.length?fetch(r,i).then((function(r){200!=r.status?n({message:r.status+" "+r.statusText,response:r}):r.json().then((function(n){e(new b(t,n))}),n)}),n):n({message:"Empty query",response:{}})})).catch((function(e){return new M(t,{expandCategories:!1})}))}}}).call(this,n(69))},function(t,e){t.exports=require("crypto")},function(t,e,n){"use strict";(function(t){n(94),n(47),n(48),n(79),n(73),n(50),n(85),n(86),n(87);var r=n(19),i=n(100),o=n.n(i);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){c(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u=["websdk","web","webv2"],l=function e(n){var i=(n=n||{}).key,a=n.secret,c=n.noAuth,l="https://api-gateway.mappedin.com/track-analytics/a/";c||!i||Object(r.c)(i)||(l="https://web-proxy.mappedin.com/a/");var h=n.url||n.baseUrl||l;h+=n.venue+"/";var p=!1,d=n.testMode,f=u.find((function(t){return t===n.context}))||u[0],m=Object(r.a)(),v=Object(r.b)(),g=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!0!==d&&"True"!==d&&"true"!==d){var r=s(s({},n),{},{g:p}),u=h+e+"?"+o.a.stringify(r),l={method:"GET",mode:"cors",headers:{"mi-context":f,"mi-session":v,"mi-device":m}};c||(l.headers.Authorization="Basic "+t(i+":"+a)),fetch(u,l)}};this.locationSelected=function(t){var e=t.id||t;g("select-location",{id:e})},this.categorySelected=function(t){var e=t.id||t;g("select-category",{id:e})},this.mapViewLoaded=function(t,e,n,r){g("load-mapview",{type:t,force:e,benchmark:n||-1,reason:r||"success"}),delete this.mapViewLoaded},this.getDirections=function(t,e){g("query-directions",{start:t,end:e,type:"location_to_location"})},this.getSessionID=function(){return v},this.getDeviceID=function(){return m},this.setGeolocationMode=function(t){p=t},this.trackBlueDotEvent=function(t){t&&Object.values(e.BLUEDOT_EVENT).includes(t)?g(t):console.warn('Ignored unsupported blue dot event: "'.concat(t,'".'))}};l.BLUEDOT_EVENT={ATTEMPT_BLUEDOT:"attempt-bluedot",FOUND_POSITION:"found-position",FOUND_FLOOR:"found-floor"},e.a=l}).call(this,n(69))},function(t,e,n){"use strict";var r=n(145),i=n(146),o=n(147);function a(t,e){return e.encode?e.strict?r(t):encodeURIComponent(t):t}function s(t){var e=t.indexOf("?");return-1===e?"":t.slice(e+1)}function c(t,e){var n=function(t){var e;switch(t.arrayFormat){case"index":return function(t,n,r){e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===r[t]&&(r[t]={}),r[t][e[1]]=n):r[t]=n};case"bracket":return function(t,n,r){e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==r[t]?r[t]=[].concat(r[t],n):r[t]=[n]:r[t]=n};default:return function(t,e,n){void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e=i({arrayFormat:"none"},e)),r=Object.create(null);return"string"!=typeof t?r:(t=t.trim().replace(/^[?#&]/,""))?(t.split("&").forEach((function(t){var e=t.replace(/\+/g," ").split("="),i=e.shift(),a=e.length>0?e.join("="):void 0;a=void 0===a?null:o(a),n(o(i),a,r)})),Object.keys(r).sort().reduce((function(t,e){var n=r[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort((function(t,e){return Number(t)-Number(e)})).map((function(t){return e[t]})):e}(n):t[e]=n,t}),Object.create(null))):r}e.extract=s,e.parse=c,e.stringify=function(t,e){!1===(e=i({encode:!0,strict:!0,arrayFormat:"none"},e)).sort&&(e.sort=function(){});var n=function(t){switch(t.arrayFormat){case"index":return function(e,n,r){return null===n?[a(e,t),"[",r,"]"].join(""):[a(e,t),"[",a(r,t),"]=",a(n,t)].join("")};case"bracket":return function(e,n){return null===n?a(e,t):[a(e,t),"[]=",a(n,t)].join("")};default:return function(e,n){return null===n?a(e,t):[a(e,t),"=",a(n,t)].join("")}}}(e);return t?Object.keys(t).sort(e.sort).map((function(r){var i=t[r];if(void 0===i)return"";if(null===i)return a(r,e);if(Array.isArray(i)){var o=[];return i.slice().forEach((function(t){void 0!==t&&o.push(n(r,t,o.length))})),o.join("&")}return a(r,e)+"="+a(i,e)})).filter((function(t){return t.length>0})).join("&"):""},e.parseUrl=function(t,e){return{url:t.split("?")[0]||"",query:c(s(t),e)}}},function(t,e,n){t.exports=n(148)},function(t,e,n){t.exports=n(31)("native-function-to-string",Function.toString)},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(16),i=n(58),o=n(59),a=n(3),s=n(17),c=n(60),u={},l={};(e=t.exports=function(t,e,n,h,p){var d,f,m,v,g=p?function(){return t}:c(t),y=r(n,h,e?2:1),x=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(o(g)){for(d=s(t.length);d>x;x++)if((v=e?y(a(f=t[x])[0],f[1]):y(t[x]))===u||v===l)return v}else for(m=g.call(t);!(f=m.next()).done;)if((v=i(m,y,f.value,e))===u||v===l)return v}).BREAK=u,e.RETURN=l},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(2),i=n(62).set,o=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n(10)(a);t.exports=function(){var t,e,n,u=function(){var r,i;for(c&&(r=a.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(u)};else if(!o||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);n=function(){l.then(u)}}else n=function(){i.call(r,u)};else{var h=!0,p=document.createTextNode("");new o(u).observe(p,{characterData:!0}),n=function(){p.data=h=!h}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(2).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){var r=n(3),i=n(6),o=n(63);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){var r=n(11);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){"use strict";var r=n(2),i=n(7),o=n(8),a=n(0)("species");t.exports=function(t){var e=r[t];o&&e&&!e[a]&&i.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){"use strict";var r=n(42);n(1)({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},function(t,e,n){"use strict";var r=n(3);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";n.r(e),n.d(e,"Headers",(function(){return P})),n.d(e,"Request",(function(){return H})),n.d(e,"Response",(function(){return j})),n.d(e,"FetchError",(function(){return p}));var r=n(5),i=n(55),o=n(37),a=n(96),s=n(14);const c=r.Readable,u=Symbol("buffer"),l=Symbol("type");class h{constructor(){this[l]="";const t=arguments[0],e=arguments[1],n=[];let r=0;if(t){const e=t,i=Number(e.length);for(let t=0;t<i;t++){const i=e[t];let o;o=i instanceof Buffer?i:ArrayBuffer.isView(i)?Buffer.from(i.buffer,i.byteOffset,i.byteLength):i instanceof ArrayBuffer?Buffer.from(i):i instanceof h?i[u]:Buffer.from("string"==typeof i?i:String(i)),r+=o.length,n.push(o)}}this[u]=Buffer.concat(n);let i=e&&void 0!==e.type&&String(e.type).toLowerCase();i&&!/[^\u0020-\u007E]/.test(i)&&(this[l]=i)}get size(){return this[u].length}get type(){return this[l]}text(){return Promise.resolve(this[u].toString())}arrayBuffer(){const t=this[u],e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return Promise.resolve(e)}stream(){const t=new c;return t._read=function(){},t.push(this[u]),t.push(null),t}toString(){return"[object Blob]"}slice(){const t=this.size,e=arguments[0],n=arguments[1];let r,i;r=void 0===e?0:e<0?Math.max(t+e,0):Math.min(e,t),i=void 0===n?t:n<0?Math.max(t+n,0):Math.min(n,t);const o=Math.max(i-r,0),a=this[u].slice(r,r+o),s=new h([],{type:arguments[2]});return s[u]=a,s}}function p(t,e,n){Error.call(this,t),this.message=t,this.type=e,n&&(this.code=this.errno=n.code),Error.captureStackTrace(this,this.constructor)}let d;Object.defineProperties(h.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}}),Object.defineProperty(h.prototype,Symbol.toStringTag,{value:"Blob",writable:!1,enumerable:!1,configurable:!0}),p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.name="FetchError";try{d=require("encoding").convert}catch(t){}const f=Symbol("Body internals"),m=r.PassThrough;function v(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.size;let o=void 0===i?0:i;var a=n.timeout;let s=void 0===a?0:a;null==t?t=null:y(t)?t=Buffer.from(t.toString()):x(t)||Buffer.isBuffer(t)||("[object ArrayBuffer]"===Object.prototype.toString.call(t)?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof r||(t=Buffer.from(String(t)))),this[f]={body:t,disturbed:!1,error:null},this.size=o,this.timeout=s,t instanceof r&&t.on("error",(function(t){const n="AbortError"===t.name?t:new p(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t);e[f].error=n}))}function g(){var t=this;if(this[f].disturbed)return v.Promise.reject(new TypeError("body used already for: "+this.url));if(this[f].disturbed=!0,this[f].error)return v.Promise.reject(this[f].error);let e=this.body;if(null===e)return v.Promise.resolve(Buffer.alloc(0));if(x(e)&&(e=e.stream()),Buffer.isBuffer(e))return v.Promise.resolve(e);if(!(e instanceof r))return v.Promise.resolve(Buffer.alloc(0));let n=[],i=0,o=!1;return new v.Promise((function(r,a){let s;t.timeout&&(s=setTimeout((function(){o=!0,a(new p(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))}),t.timeout)),e.on("error",(function(e){"AbortError"===e.name?(o=!0,a(e)):a(new p(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e))})),e.on("data",(function(e){if(!o&&null!==e){if(t.size&&i+e.length>t.size)return o=!0,void a(new p(`content size at ${t.url} over limit: ${t.size}`,"max-size"));i+=e.length,n.push(e)}})),e.on("end",(function(){if(!o){clearTimeout(s);try{r(Buffer.concat(n,i))}catch(e){a(new p(`Could not create Buffer from response body for ${t.url}: ${e.message}`,"system",e))}}}))}))}function y(t){return"object"==typeof t&&"function"==typeof t.append&&"function"==typeof t.delete&&"function"==typeof t.get&&"function"==typeof t.getAll&&"function"==typeof t.has&&"function"==typeof t.set&&("URLSearchParams"===t.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(t)||"function"==typeof t.sort)}function x(t){return"object"==typeof t&&"function"==typeof t.arrayBuffer&&"string"==typeof t.type&&"function"==typeof t.stream&&"function"==typeof t.constructor&&"string"==typeof t.constructor.name&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function b(t){let e,n,i=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof r&&"function"!=typeof i.getBoundary&&(e=new m,n=new m,i.pipe(e),i.pipe(n),t[f].body=e,i=n),i}function M(t){return null===t?null:"string"==typeof t?"text/plain;charset=UTF-8":y(t)?"application/x-www-form-urlencoded;charset=UTF-8":x(t)?t.type||null:Buffer.isBuffer(t)||"[object ArrayBuffer]"===Object.prototype.toString.call(t)||ArrayBuffer.isView(t)?null:"function"==typeof t.getBoundary?"multipart/form-data;boundary="+t.getBoundary():t instanceof r?null:"text/plain;charset=UTF-8"}function w(t){const e=t.body;return null===e?0:x(e)?e.size:Buffer.isBuffer(e)?e.length:e&&"function"==typeof e.getLengthSync&&(e._lengthRetrievers&&0==e._lengthRetrievers.length||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}v.prototype={get body(){return this[f].body},get bodyUsed(){return this[f].disturbed},arrayBuffer(){return g.call(this).then((function(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}))},blob(){let t=this.headers&&this.headers.get("content-type")||"";return g.call(this).then((function(e){return Object.assign(new h([],{type:t.toLowerCase()}),{[u]:e})}))},json(){var t=this;return g.call(this).then((function(e){try{return JSON.parse(e.toString())}catch(e){return v.Promise.reject(new p(`invalid json response body at ${t.url} reason: ${e.message}`,"invalid-json"))}}))},text(){return g.call(this).then((function(t){return t.toString()}))},buffer(){return g.call(this)},textConverted(){var t=this;return g.call(this).then((function(e){return function(t,e){if("function"!=typeof d)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=e.get("content-type");let r,i,o="utf-8";n&&(r=/charset=([^;]*)/i.exec(n));i=t.slice(0,1024).toString(),!r&&i&&(r=/<meta.+?charset=(['"])(.+?)\1/i.exec(i));!r&&i&&(r=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(i),r||(r=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(i),r&&r.pop()),r&&(r=/charset=(.*)/i.exec(r.pop())));!r&&i&&(r=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(i));r&&(o=r.pop(),"gb2312"!==o&&"gbk"!==o||(o="gb18030"));return d(t,"UTF-8",o).toString()}(e,t.headers)}))}},Object.defineProperties(v.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}}),v.mixIn=function(t){for(const e of Object.getOwnPropertyNames(v.prototype))if(!(e in t)){const n=Object.getOwnPropertyDescriptor(v.prototype,e);Object.defineProperty(t,e,n)}},v.Promise=global.Promise;const _=/[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/,S=/[^\t\x20-\x7e\x80-\xff]/;function E(t){if(t=""+t,_.test(t)||""===t)throw new TypeError(t+" is not a legal HTTP header name")}function T(t){if(t=""+t,S.test(t))throw new TypeError(t+" is not a legal HTTP header value")}function L(t,e){e=e.toLowerCase();for(const n in t)if(n.toLowerCase()===e)return n}const A=Symbol("map");class P{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[A]=Object.create(null),t instanceof P){const e=t.raw(),n=Object.keys(e);for(const t of n)for(const n of e[t])this.append(t,n)}else if(null==t);else{if("object"!=typeof t)throw new TypeError("Provided initializer must be an object");{const e=t[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const n=[];for(const e of t){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(e))}for(const t of n){if(2!==t.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(t[0],t[1])}}else for(const e of Object.keys(t)){const n=t[e];this.append(e,n)}}}}get(t){E(t=""+t);const e=L(this[A],t);return void 0===e?null:this[A][e].join(", ")}forEach(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=R(this),r=0;for(;r<n.length;){var i=n[r];const o=i[0],a=i[1];t.call(e,a,o,this),n=R(this),r++}}set(t,e){e=""+e,E(t=""+t),T(e);const n=L(this[A],t);this[A][void 0!==n?n:t]=[e]}append(t,e){e=""+e,E(t=""+t),T(e);const n=L(this[A],t);void 0!==n?this[A][n].push(e):this[A][t]=[e]}has(t){return E(t=""+t),void 0!==L(this[A],t)}delete(t){E(t=""+t);const e=L(this[A],t);void 0!==e&&delete this[A][e]}raw(){return this[A]}keys(){return N(this,"key")}values(){return N(this,"value")}[Symbol.iterator](){return N(this,"key+value")}}function R(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key+value";const n=Object.keys(t[A]).sort();return n.map("key"===e?function(t){return t.toLowerCase()}:"value"===e?function(e){return t[A][e].join(", ")}:function(e){return[e.toLowerCase(),t[A][e].join(", ")]})}P.prototype.entries=P.prototype[Symbol.iterator],Object.defineProperty(P.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(P.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const O=Symbol("internal");function N(t,e){const n=Object.create(C);return n[O]={target:t,kind:e,index:0},n}const C=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==C)throw new TypeError("Value of `this` is not a HeadersIterator");var t=this[O];const e=t.target,n=t.kind,r=t.index,i=R(e,n);return r>=i.length?{value:void 0,done:!0}:(this[O].index=r+1,{value:i[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function I(t){const e=Object.assign({__proto__:null},t[A]),n=L(t[A],"Host");return void 0!==n&&(e[n]=e[n][0]),e}Object.defineProperty(C,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const D=Symbol("Response internals"),z=i.STATUS_CODES;class j{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};v.call(this,t,e);const n=e.status||200,r=new P(e.headers);if(null!=t&&!r.has("Content-Type")){const e=M(t);e&&r.append("Content-Type",e)}this[D]={url:e.url,status:n,statusText:e.statusText||z[n],headers:r,counter:e.counter}}get url(){return this[D].url||""}get status(){return this[D].status}get ok(){return this[D].status>=200&&this[D].status<300}get redirected(){return this[D].counter>0}get statusText(){return this[D].statusText}get headers(){return this[D].headers}clone(){return new j(b(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}v.mixIn(j.prototype),Object.defineProperties(j.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(j.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const B=Symbol("Request internals"),k=o.parse,F=o.format,U="destroy"in r.Readable.prototype;function G(t){return"object"==typeof t&&"object"==typeof t[B]}class H{constructor(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};G(t)?e=k(t.url):(e=t&&t.href?k(t.href):k(""+t),t={});let r=n.method||t.method||"GET";if(r=r.toUpperCase(),(null!=n.body||G(t)&&null!==t.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let i=null!=n.body?n.body:G(t)&&null!==t.body?b(t):null;v.call(this,i,{timeout:n.timeout||t.timeout||0,size:n.size||t.size||0});const o=new P(n.headers||t.headers||{});if(null!=i&&!o.has("Content-Type")){const t=M(i);t&&o.append("Content-Type",t)}let a=G(t)?t.signal:null;if("signal"in n&&(a=n.signal),null!=a&&!function(t){const e=t&&"object"==typeof t&&Object.getPrototypeOf(t);return!(!e||"AbortSignal"!==e.constructor.name)}(a))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[B]={method:r,redirect:n.redirect||t.redirect||"follow",headers:o,parsedURL:e,signal:a},this.follow=void 0!==n.follow?n.follow:void 0!==t.follow?t.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===t.compress||t.compress,this.counter=n.counter||t.counter||0,this.agent=n.agent||t.agent}get method(){return this[B].method}get url(){return F(this[B].parsedURL)}get headers(){return this[B].headers}get redirect(){return this[B].redirect}get signal(){return this[B].signal}clone(){return new H(this)}}function V(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}v.mixIn(H.prototype),Object.defineProperty(H.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(H.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),V.prototype=Object.create(Error.prototype),V.prototype.constructor=V,V.prototype.name="AbortError";const W=r.PassThrough,q=o.resolve;function X(t,e){if(!X.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return v.Promise=X.Promise,new X.Promise((function(n,o){const c=new H(t,e),u=function(t){const e=t[B].parsedURL,n=new P(t[B].headers);if(n.has("Accept")||n.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof r.Readable&&!U)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let i=null;if(null==t.body&&/^(POST|PUT)$/i.test(t.method)&&(i="0"),null!=t.body){const e=w(t);"number"==typeof e&&(i=String(e))}i&&n.set("Content-Length",i),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate");let o=t.agent;return"function"==typeof o&&(o=o(e)),n.has("Connection")||o||n.set("Connection","close"),Object.assign({},e,{method:t.method,headers:I(n),agent:o})}(c),l=("https:"===u.protocol?a:i).request,h=c.signal;let d=null;const f=function(){let t=new V("The user aborted a request.");o(t),c.body&&c.body instanceof r.Readable&&c.body.destroy(t),d&&d.body&&d.body.emit("error",t)};if(h&&h.aborted)return void f();const m=function(){f(),y()},v=l(u);let g;function y(){v.abort(),h&&h.removeEventListener("abort",m),clearTimeout(g)}h&&h.addEventListener("abort",m),c.timeout&&v.once("socket",(function(t){g=setTimeout((function(){o(new p("network timeout at: "+c.url,"request-timeout")),y()}),c.timeout)})),v.on("error",(function(t){o(new p(`request to ${c.url} failed, reason: ${t.message}`,"system",t)),y()})),v.on("response",(function(t){clearTimeout(g);const e=function(t){const e=new P;for(const n of Object.keys(t))if(!_.test(n))if(Array.isArray(t[n]))for(const r of t[n])S.test(r)||(void 0===e[A][n]?e[A][n]=[r]:e[A][n].push(r));else S.test(t[n])||(e[A][n]=[t[n]]);return e}(t.headers);if(X.isRedirect(t.statusCode)){const r=e.get("Location"),i=null===r?null:q(c.url,r);switch(c.redirect){case"error":return o(new p("uri requested responds with a redirect, redirect mode is set to error: "+c.url,"no-redirect")),void y();case"manual":if(null!==i)try{e.set("Location",i)}catch(t){o(t)}break;case"follow":if(null===i)break;if(c.counter>=c.follow)return o(new p("maximum redirect reached at: "+c.url,"max-redirect")),void y();const r={headers:new P(c.headers),follow:c.follow,counter:c.counter+1,agent:c.agent,compress:c.compress,method:c.method,body:c.body,signal:c.signal,timeout:c.timeout,size:c.size};return 303!==t.statusCode&&c.body&&null===w(c)?(o(new p("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void y()):(303!==t.statusCode&&(301!==t.statusCode&&302!==t.statusCode||"POST"!==c.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),n(X(new H(i,r))),void y())}}t.once("end",(function(){h&&h.removeEventListener("abort",m)}));let r=t.pipe(new W);const i={url:c.url,status:t.statusCode,statusText:t.statusMessage,headers:e,size:c.size,timeout:c.timeout,counter:c.counter},a=e.get("Content-Encoding");if(!c.compress||"HEAD"===c.method||null===a||204===t.statusCode||304===t.statusCode)return d=new j(r,i),void n(d);const u={flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return r=r.pipe(s.createGunzip(u)),d=new j(r,i),void n(d);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof s.createBrotliDecompress)return r=r.pipe(s.createBrotliDecompress()),d=new j(r,i),void n(d);d=new j(r,i),n(d)}else{t.pipe(new W).once("data",(function(t){r=8==(15&t[0])?r.pipe(s.createInflate()):r.pipe(s.createInflateRaw()),d=new j(r,i),n(d)}))}})),function(t,e){const n=e.body;null===n?t.end():x(n)?n.stream().pipe(t):Buffer.isBuffer(n)?(t.write(n),t.end()):n.pipe(t)}(v,c)}))}X.isRedirect=function(t){return 301===t||302===t||303===t||307===t||308===t},X.Promise=global.Promise,e.default=X},function(t,e,n){var r=n(117);t.exports=function(t,e){return new(r(t))(e)}},function(t,e,n){var r=n(6),i=n(72),o=n(0)("species");t.exports=function(t){var e;return i(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&null===(e=e[o])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){var r=n(20),i=n(9),o=n(34).f;t.exports=function(t){return function(e){for(var n,a=i(e),s=r(a),c=s.length,u=0,l=[];c>u;)o.call(a,n=s[u++])&&l.push(t?[n,a[n]]:a[n]);return l}}},function(t,e,n){"use strict";var r=n(81),i=n(3),o=n(61),a=n(120),s=n(17),c=n(66),u=n(42),l=n(4),h=Math.min,p=[].push,d="length",f=!l((function(){RegExp(4294967295,"y")}));n(67)("split",2,(function(t,e,n,l){var m;return m="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1)[d]||2!="ab".split(/(?:ab)*/)[d]||4!=".".split(/(.?)(.?)/)[d]||".".split(/()()/)[d]>1||"".split(/.?/)[d]?function(t,e){var i=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(i,t,e);for(var o,a,s,c=[],l=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),h=0,f=void 0===e?4294967295:e>>>0,m=new RegExp(t.source,l+"g");(o=u.call(m,i))&&!((a=m.lastIndex)>h&&(c.push(i.slice(h,o.index)),o[d]>1&&o.index<i[d]&&p.apply(c,o.slice(1)),s=o[0][d],h=a,c[d]>=f));)m.lastIndex===o.index&&m.lastIndex++;return h===i[d]?!s&&m.test("")||c.push(""):c.push(i.slice(h)),c[d]>f?c.slice(0,f):c}:"0".split(void 0,0)[d]?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var i=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):m.call(String(i),n,r)},function(t,e){var r=l(m,t,this,e,m!==n);if(r.done)return r.value;var u=i(t),p=String(this),d=o(u,RegExp),v=u.unicode,g=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.unicode?"u":"")+(f?"y":"g"),y=new d(f?u:"^(?:"+u.source+")",g),x=void 0===e?4294967295:e>>>0;if(0===x)return[];if(0===p.length)return null===c(y,p)?[p]:[];for(var b=0,M=0,w=[];M<p.length;){y.lastIndex=f?M:0;var _,S=c(y,f?p:p.slice(M));if(null===S||(_=h(s(y.lastIndex+(f?0:M)),p.length))===b)M=a(p,M,v);else{if(w.push(p.slice(b,M)),w.length===x)return w;for(var E=1;E<=S.length-1;E++)if(w.push(S[E]),w.length===x)return w;M=b=_}}return w.push(p.slice(b)),w}]}))},function(t,e,n){"use strict";var r=n(83)(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},function(t,e,n){"use strict";var r=n(1),i=n(17),o=n(80),a="".startsWith;r(r.P+r.F*n(82)("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=i(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return a?a.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";var r=n(1),i=n(24),o=n(26),a=n(4),s=[].sort,c=[1,2,3];r(r.P+r.F*(a((function(){c.sort(void 0)}))||!a((function(){c.sort(null)}))||!n(44)(s)),"Array",{sort:function(t){return void 0===t?s.call(o(this)):s.call(o(this),i(t))}})},function(t,e,n){var r=n(22)("meta"),i=n(6),o=n(13),a=n(7).f,s=0,c=Object.isExtensible||function(){return!0},u=!n(4)((function(){return c(Object.preventExtensions({}))})),l=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},h=t.exports={KEY:r,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,r)){if(!c(t))return"F";if(!e)return"E";l(t)}return t[r].i},getWeak:function(t,e){if(!o(t,r)){if(!c(t))return!0;if(!e)return!1;l(t)}return t[r].w},onFreeze:function(t){return u&&h.NEED&&c(t)&&!o(t,r)&&l(t),t}}},function(t,e,n){var r=n(2),i=n(15),o=n(21),a=n(84),s=n(7).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e,n){var r=n(20),i=n(51),o=n(34);t.exports=function(t){var e=r(t),n=i.f;if(n)for(var a,s=n(t),c=o.f,u=0;s.length>u;)c.call(t,a=s[u++])&&e.push(a);return e}},function(t,e,n){var r=n(7),i=n(3),o=n(20);t.exports=n(8)?Object.defineProperties:function(t,e){i(t);for(var n,a=o(e),s=a.length,c=0;s>c;)r.f(t,n=a[c++],e[n]);return t}},function(t,e,n){var r=n(9),i=n(35).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return a.slice()}}(t):i(r(t))}},function(t,e,n){var r=n(35),i=n(51),o=n(3),a=n(2).Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(o(t)),n=i.f;return n?e.concat(n(t)):e}},function(t,e,n){"use strict";var r=n(52),i=n(23),o=n(33),a={};n(12)(a,n(0)("iterator"),(function(){return this})),t.exports=function(t,e,n){t.prototype=r(a,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(13),i=n(26),o=n(45)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),r(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){"use strict";n(133)("sub",(function(t){return function(){return t(this,"sub","","")}}))},function(t,e,n){var r=n(1),i=n(4),o=n(18),a=/"/g,s=function(t,e,n,r){var i=String(o(t)),s="<"+e;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+"</"+e+">"};t.exports=function(t,e){var n={};n[t]=e(s),r(r.P+r.F*i((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",n)}},function(t,e,n){var r=n(1);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){"use strict";var r=n(2),i=n(13),o=n(10),a=n(136),s=n(32),c=n(4),u=n(35).f,l=n(27).f,h=n(7).f,p=n(138).trim,d=r.Number,f=d,m=d.prototype,v="Number"==o(n(52)(m)),g="trim"in String.prototype,y=function(t){var e=s(t,!1);if("string"==typeof e&&e.length>2){var n,r,i,o=(e=g?e.trim():p(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+e}for(var a,c=e.slice(2),u=0,l=c.length;u<l;u++)if((a=c.charCodeAt(u))<48||a>i)return NaN;return parseInt(c,r)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof d&&(v?c((function(){m.valueOf.call(n)})):"Number"!=o(n))?a(new f(y(e)),n,d):y(e)};for(var x,b=n(8)?u(f):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),M=0;b.length>M;M++)i(f,x=b[M])&&!i(d,x)&&h(d,x,l(f,x));d.prototype=m,m.constructor=d,n(11)(r,"Number",d)}},function(t,e,n){var r=n(6),i=n(137).set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&r(o)&&i&&i(t,o),t}},function(t,e,n){var r=n(6),i=n(3),o=function(t,e){if(i(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n(16)(Function.call,n(27).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:o}},function(t,e,n){var r=n(1),i=n(18),o=n(4),a=n(139),s="["+a+"]",c=RegExp("^"+s+s+"*"),u=RegExp(s+s+"*$"),l=function(t,e,n){var i={},s=o((function(){return!!a[t]()||"
"!="
"[t]()})),c=i[t]=s?e(h):a[t];n&&(i[n]=c),r(r.P+r.F*s,"String",i)},h=l.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(c,"")),2&e&&(t=t.replace(u,"")),t};t.exports=l},function(t,e){t.exports="\t\n\v\f\r \u2028\u2029\ufeff"},function(t,e,n){"use strict";var r;function i(t,e){if(!(this instanceof i))return new i(t,e);this.lat=Number(t),this.lon=Number(e)}t.exports&&(r=n(36)),i.prototype.distanceTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var n=e=void 0===e?6371e3:Number(e),r=this.lat.toRadians(),o=this.lon.toRadians(),a=t.lat.toRadians(),s=a-r,c=t.lon.toRadians()-o,u=Math.sin(s/2)*Math.sin(s/2)+Math.cos(r)*Math.cos(a)*Math.sin(c/2)*Math.sin(c/2);return n*(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)))},i.prototype.bearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians(),o=Math.sin(r)*Math.cos(n),a=Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(r);return(Math.atan2(o,a).toDegrees()+360)%360},i.prototype.finalBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");return(t.bearingTo(this)+180)%360},i.prototype.midpointTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),o=(t.lon-this.lon).toRadians(),a=Math.cos(r)*Math.cos(o),s=Math.cos(r)*Math.sin(o),c=Math.sqrt((Math.cos(e)+a)*(Math.cos(e)+a)+s*s),u=Math.sin(e)+Math.sin(r),l=Math.atan2(u,c),h=n+Math.atan2(s,Math.cos(e)+a);return new i(l.toDegrees(),(h.toDegrees()+540)%360-180)},i.prototype.intermediatePointTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var n=this.lat.toRadians(),r=this.lon.toRadians(),o=t.lat.toRadians(),a=t.lon.toRadians(),s=Math.sin(n),c=Math.cos(n),u=Math.sin(r),l=Math.cos(r),h=Math.sin(o),p=Math.cos(o),d=Math.sin(a),f=Math.cos(a),m=o-n,v=a-r,g=Math.sin(m/2)*Math.sin(m/2)+Math.cos(n)*Math.cos(o)*Math.sin(v/2)*Math.sin(v/2),y=2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g)),x=Math.sin((1-e)*y)/Math.sin(y),b=Math.sin(e*y)/Math.sin(y),M=x*c*l+b*p*f,w=x*c*u+b*p*d,_=x*s+b*h,S=Math.atan2(_,Math.sqrt(M*M+w*w)),E=Math.atan2(w,M);return new i(S.toDegrees(),(E.toDegrees()+540)%360-180)},i.prototype.destinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var r=Number(t)/n,o=Number(e).toRadians(),a=this.lat.toRadians(),s=this.lon.toRadians(),c=Math.sin(a),u=Math.cos(a),l=Math.sin(r),h=Math.cos(r),p=Math.sin(o),d=c*h+u*l*Math.cos(o),f=Math.asin(d),m=p*l*u,v=h-c*d,g=s+Math.atan2(m,v);return new i(f.toDegrees(),(g.toDegrees()+540)%360-180)},i.intersection=function(t,e,n,r){if(!(t instanceof i))throw new TypeError("p1 is not LatLon object");if(!(n instanceof i))throw new TypeError("p2 is not LatLon object");var o=t.lat.toRadians(),a=t.lon.toRadians(),s=n.lat.toRadians(),c=n.lon.toRadians(),u=Number(e).toRadians(),l=Number(r).toRadians(),h=s-o,p=c-a,d=2*Math.asin(Math.sqrt(Math.sin(h/2)*Math.sin(h/2)+Math.cos(o)*Math.cos(s)*Math.sin(p/2)*Math.sin(p/2)));if(0==d)return null;var f=Math.acos((Math.sin(s)-Math.sin(o)*Math.cos(d))/(Math.sin(d)*Math.cos(o)));isNaN(f)&&(f=0);var m=Math.acos((Math.sin(o)-Math.sin(s)*Math.cos(d))/(Math.sin(d)*Math.cos(s))),v=u-(Math.sin(c-a)>0?f:2*Math.PI-f),g=(Math.sin(c-a)>0?2*Math.PI-m:m)-l;if(0==Math.sin(v)&&0==Math.sin(g))return null;if(Math.sin(v)*Math.sin(g)<0)return null;var y=Math.acos(-Math.cos(v)*Math.cos(g)+Math.sin(v)*Math.sin(g)*Math.cos(d)),x=Math.atan2(Math.sin(d)*Math.sin(v)*Math.sin(g),Math.cos(g)+Math.cos(v)*Math.cos(y)),b=Math.asin(Math.sin(o)*Math.cos(x)+Math.cos(o)*Math.sin(x)*Math.cos(u)),M=a+Math.atan2(Math.sin(u)*Math.sin(x)*Math.cos(o),Math.cos(x)-Math.sin(o)*Math.sin(b));return new i(b.toDegrees(),(M.toDegrees()+540)%360-180)},i.prototype.crossTrackDistanceTo=function(t,e,n){if(!(t instanceof i))throw new TypeError("pathStart is not LatLon object");if(!(e instanceof i))throw new TypeError("pathEnd is not LatLon object");var r=void 0===n?6371e3:Number(n),o=t.distanceTo(this,r)/r,a=t.bearingTo(this).toRadians(),s=t.bearingTo(e).toRadians();return Math.asin(Math.sin(o)*Math.sin(a-s))*r},i.prototype.alongTrackDistanceTo=function(t,e,n){if(!(t instanceof i))throw new TypeError("pathStart is not LatLon object");if(!(e instanceof i))throw new TypeError("pathEnd is not LatLon object");var r=void 0===n?6371e3:Number(n),o=t.distanceTo(this,r)/r,a=t.bearingTo(this).toRadians(),s=t.bearingTo(e).toRadians(),c=Math.asin(Math.sin(o)*Math.sin(a-s));return Math.acos(Math.cos(o)/Math.abs(Math.cos(c)))*Math.sign(Math.cos(s-a))*r},i.prototype.maxLatitude=function(t){var e=Number(t).toRadians(),n=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(e)*Math.cos(n))).toDegrees()},i.crossingParallels=function(t,e,n){var r=Number(n).toRadians(),i=t.lat.toRadians(),o=t.lon.toRadians(),a=e.lat.toRadians(),s=e.lon.toRadians()-o,c=Math.sin(i)*Math.cos(a)*Math.cos(r)*Math.sin(s),u=Math.sin(i)*Math.cos(a)*Math.cos(r)*Math.cos(s)-Math.cos(i)*Math.sin(a)*Math.cos(r),l=Math.cos(i)*Math.cos(a)*Math.sin(r)*Math.sin(s);if(l*l>c*c+u*u)return null;var h=Math.atan2(-u,c),p=Math.acos(l/Math.sqrt(c*c+u*u)),d=o+h+p;return{lon1:((o+h-p).toDegrees()+540)%360-180,lon2:(d.toDegrees()+540)%360-180}},i.prototype.rhumbDistanceTo=function(t,e){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var n=e=void 0===e?6371e3:Number(e),r=this.lat.toRadians(),o=t.lat.toRadians(),a=o-r,s=Math.abs(t.lon-this.lon).toRadians();s>Math.PI&&(s-=2*Math.PI);var c=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),u=Math.abs(c)>1e-11?a/c:Math.cos(r);return Math.sqrt(a*a+u*u*s*s)*n},i.prototype.rhumbBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=t.lat.toRadians(),r=(t.lon-this.lon).toRadians();r>Math.PI&&(r-=2*Math.PI),r<-Math.PI&&(r+=2*Math.PI);var o=Math.log(Math.tan(n/2+Math.PI/4)/Math.tan(e/2+Math.PI/4));return(Math.atan2(r,o).toDegrees()+360)%360},i.prototype.rhumbDestinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var r=Number(t)/n,o=this.lat.toRadians(),a=this.lon.toRadians(),s=Number(e).toRadians(),c=r*Math.cos(s),u=o+c;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var l=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),h=Math.abs(l)>1e-11?c/l:Math.cos(o),p=a+r*Math.sin(s)/h;return new i(u.toDegrees(),(p.toDegrees()+540)%360-180)},i.prototype.rhumbMidpointTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");var e=this.lat.toRadians(),n=this.lon.toRadians(),r=t.lat.toRadians(),o=t.lon.toRadians();Math.abs(o-n)>Math.PI&&(n+=2*Math.PI);var a=(e+r)/2,s=Math.tan(Math.PI/4+e/2),c=Math.tan(Math.PI/4+r/2),u=Math.tan(Math.PI/4+a/2),l=((o-n)*Math.log(u)+n*Math.log(c)-o*Math.log(s))/Math.log(c/s);return isFinite(l)||(l=(n+o)/2),i(a.toDegrees(),(l.toDegrees()+540)%360-180)},i.areaOf=function(t,e){var n=void 0===e?6371e3:Number(e),r=t[0].equals(t[t.length-1]);r||t.push(t[0]);for(var i=t.length-1,o=0,a=0;a<i;a++){var s=t[a].lat.toRadians(),c=t[a+1].lat.toRadians(),u=(t[a+1].lon-t[a].lon).toRadians();o+=2*Math.atan2(Math.tan(u/2)*(Math.tan(s/2)+Math.tan(c/2)),1+Math.tan(s/2)*Math.tan(c/2))}(function(t){for(var e=0,n=t[0].bearingTo(t[1]),r=0;r<t.length-1;r++){var i=t[r].bearingTo(t[r+1]),o=t[r].finalBearingTo(t[r+1]);e+=(i-n+540)%360-180,e+=(o-i+540)%360-180,n=o}i=t[0].bearingTo(t[1]);return e+=(i-n+540)%360-180,Math.abs(e)<90})(t)&&(o=Math.abs(o)-2*Math.PI);var l=Math.abs(o*n*n);return r||t.pop(),l},i.prototype.equals=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");return this.lat==t.lat&&this.lon==t.lon},i.prototype.toString=function(t,e){return r.toLat(this.lat,t,e)+", "+r.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),t.exports&&(t.exports=i)},function(t,e,n){"use strict";var r;t.exports&&(r=n(28)),r.prototype.distanceTo=function(t){if(!(t instanceof r))throw new TypeError("point is not LatLon object");try{return Number(this.inverse(t).distance.toFixed(3))}catch(t){return NaN}},r.prototype.initialBearingTo=function(t){if(!(t instanceof r))throw new TypeError("point is not LatLon object");try{return Number(this.inverse(t).initialBearing.toFixed(9))}catch(t){return NaN}},r.prototype.finalBearingTo=function(t){if(!(t instanceof r))throw new TypeError("point is not LatLon object");try{return Number(this.inverse(t).finalBearing.toFixed(9))}catch(t){return NaN}},r.prototype.destinationPoint=function(t,e){return this.direct(Number(t),Number(e)).point},r.prototype.finalBearingOn=function(t,e){return Number(this.direct(Number(t),Number(e)).finalBearing.toFixed(9))},r.prototype.direct=function(t,e){var n,i,o,a,s=this.lat.toRadians(),c=this.lon.toRadians(),u=e.toRadians(),l=t,h=this.datum.ellipsoid.a,p=this.datum.ellipsoid.b,d=this.datum.ellipsoid.f,f=Math.sin(u),m=Math.cos(u),v=(1-d)*Math.tan(s),g=1/Math.sqrt(1+v*v),y=v*g,x=Math.atan2(v,m),b=g*f,M=1-b*b,w=M*(h*h-p*p)/(p*p),_=1+w/16384*(4096+w*(w*(320-175*w)-768)),S=w/1024*(256+w*(w*(74-47*w)-128)),E=l/(p*_),T=0;do{n=Math.cos(2*x+E),a=E,E=l/(p*_)+S*(i=Math.sin(E))*(n+S/4*((o=Math.cos(E))*(2*n*n-1)-S/6*n*(4*i*i-3)*(4*n*n-3)))}while(Math.abs(E-a)>1e-12&&++T<100);if(T>=100)throw new Error("Formula failed to converge");var L=y*i-g*o*m,A=Math.atan2(y*o+g*i*m,(1-d)*Math.sqrt(b*b+L*L)),P=d/16*M*(4+d*(4-3*M)),R=(c+(Math.atan2(i*f,g*o-y*i*m)-(1-P)*d*b*(E+P*i*(n+P*o*(2*n*n-1))))+3*Math.PI)%(2*Math.PI)-Math.PI,O=Math.atan2(b,-L);return O=(O+2*Math.PI)%(2*Math.PI),{point:new r(A.toDegrees(),R.toDegrees(),this.datum),finalBearing:O.toDegrees(),iterations:T}},r.prototype.inverse=function(t){var e=t;-180==this.lon&&(this.lon=180);var n,r,i,o,a,s,c=this.lat.toRadians(),u=this.lon.toRadians(),l=e.lat.toRadians(),h=e.lon.toRadians(),p=this.datum.ellipsoid.a,d=this.datum.ellipsoid.b,f=this.datum.ellipsoid.f,m=h-u,v=(1-f)*Math.tan(c),g=1/Math.sqrt(1+v*v),y=v*g,x=(1-f)*Math.tan(l),b=1/Math.sqrt(1+x*x),M=x*b,w=0,_=0,S=0,E=0,T=0,L=m,A=0,P=Math.abs(m)>Math.PI;do{if(0==(i=b*(n=Math.sin(L))*(b*n)+(g*M-y*b*(r=Math.cos(L)))*(g*M-y*b*r)))break;if(_=y*M+g*b*r,s=L,L=m+(1-(a=f/16*(E=1-(o=g*b*n/(w=Math.sqrt(i)))*o)*(4+f*(4-3*E))))*f*o*((S=Math.atan2(w,_))+a*w*((T=0!=E?_-2*y*M/E:0)+a*_*(2*T*T-1))),(P?Math.abs(L)-Math.PI:Math.abs(L))>Math.PI)throw new Error("λ > π")}while(Math.abs(L-s)>1e-12&&++A<1e3);if(A>=1e3)throw new Error("Formula failed to converge");var R=E*(p*p-d*d)/(d*d),O=R/1024*(256+R*(R*(74-47*R)-128)),N=d*(1+R/16384*(4096+R*(R*(320-175*R)-768)))*(S-O*w*(T+O/4*(_*(2*T*T-1)-O/6*T*(4*w*w-3)*(4*T*T-3)))),C=Math.atan2(b*n,g*M-y*b*r),I=Math.atan2(g*n,-y*b+g*M*r);return C=(C+2*Math.PI)%(2*Math.PI),I=(I+2*Math.PI)%(2*Math.PI),{distance:N,initialBearing:0==N?NaN:C.toDegrees(),finalBearing:0==N?NaN:I.toDegrees(),iterations:A}},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),t.exports&&(t.exports=r)},function(t,e,n){"use strict";var r,i;function o(t,e){if(!(this instanceof o))return new o(t,e);this.lat=Number(t),this.lon=Number(e)}t.exports&&(r=n(54)),t.exports&&(i=n(36)),o.prototype.toVector=function(){var t=this.lat.toRadians(),e=this.lon.toRadians(),n=Math.cos(t)*Math.cos(e),i=Math.cos(t)*Math.sin(e),o=Math.sin(t);return new r(n,i,o)},r.prototype.toLatLonS=function(){var t=Math.atan2(this.z,Math.sqrt(this.x*this.x+this.y*this.y)),e=Math.atan2(this.y,this.x);return new o(t.toDegrees(),e.toDegrees())},o.prototype.greatCircle=function(t){var e=this.lat.toRadians(),n=this.lon.toRadians(),i=Number(t).toRadians(),o=Math.sin(n)*Math.cos(i)-Math.sin(e)*Math.cos(n)*Math.sin(i),a=-Math.cos(n)*Math.cos(i)-Math.sin(e)*Math.sin(n)*Math.sin(i),s=Math.cos(e)*Math.sin(i);return new r(o,a,s)},r.prototype.greatCircle=function(t){var e=Number(t).toRadians(),n=new r(0,0,1).cross(this),i=this.cross(n),o=n.times(Math.cos(e)/n.length());return i.times(Math.sin(e)/i.length()).minus(o)},o.prototype.distanceTo=function(t,e){if(!(t instanceof o))throw new TypeError("point is not LatLon object");e=void 0===e?6371e3:Number(e);var n=this.toVector(),r=t.toVector();return n.angleTo(r)*e},o.prototype.bearingTo=function(t){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var e=this.toVector(),n=t.toVector(),i=new r(0,0,1),a=e.cross(n),s=e.cross(i);return(a.angleTo(s,e).toDegrees()+360)%360},o.prototype.midpointTo=function(t){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var e=this.toVector(),n=t.toVector();return e.plus(n).unit().toLatLonS()},o.prototype.intermediatePointTo=function(t,e){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var n=this.toVector(),i=t.toVector(),a=n.cross(i).length(),s=n.dot(i),c=Math.atan2(a,s)*Number(e),u=Math.sin(c),l=Math.cos(c),h=n.cross(i).unit().cross(n),p=n.times(l).plus(h.times(u));return new r(p.x,p.y,p.z).toLatLonS()},o.prototype.intermediatePointOnChordTo=function(t,e){if(!(t instanceof o))throw new TypeError("point is not LatLon object");var n=this.toVector(),i=t.toVector(),a=n.plus(i.minus(n).times(Number(e)));return new r(a.x,a.y,a.z).toLatLonS()},o.prototype.destinationPoint=function(t,e,n){n=void 0===n?6371e3:Number(n);var i=this.toVector(),o=Number(t)/n,a=Number(e).toRadians(),s=new r(0,0,1).cross(i).unit(),c=i.cross(s),u=s.times(Math.sin(a)),l=c.times(Math.cos(a)).plus(u),h=i.times(Math.cos(o)),p=l.times(Math.sin(o));return h.plus(p).toLatLonS()},o.intersection=function(t,e,n,r){if(!(t instanceof o))throw new TypeError("path1start is not LatLon object");if(!(n instanceof o))throw new TypeError("path2start is not LatLon object");if(!(e instanceof o)&&isNaN(e))throw new TypeError("path1brngEnd is not LatLon object or bearing");if(!(r instanceof o)&&isNaN(r))throw new TypeError("path2brngEnd is not LatLon object or bearing");var i,a,s,c,u=t.toVector(),l=n.toVector();e instanceof o?(i=u.cross(e.toVector()),s="endpoint"):(i=t.greatCircle(Number(e)),s="bearing"),r instanceof o?(a=l.cross(r.toVector()),c="endpoint"):(a=n.greatCircle(Number(r)),c="bearing");var h=i.cross(a),p=a.cross(i),d=null;switch(s+"+"+c){case"bearing+bearing":switch(Math.sign(i.cross(u).dot(h))+Math.sign(a.cross(l).dot(h))){case 2:d=h;break;case-2:d=p;break;case 0:d=u.plus(l).dot(h)>0?p:h}break;case"bearing+endpoint":d=Math.sign(i.cross(u).dot(h))>0?h:p;break;case"endpoint+bearing":d=Math.sign(a.cross(l).dot(h))>0?h:p;break;case"endpoint+endpoint":d=u.plus(l).plus(e.toVector()).plus(r.toVector()).dot(h)>0?h:p}return d.toLatLonS()},o.prototype.crossTrackDistanceTo=function(t,e,n){if(!(t instanceof o))throw new TypeError("pathStart is not LatLon object");var r=void 0===n?6371e3:Number(n),i=this.toVector();return((e instanceof o?t.toVector().cross(e.toVector()):t.greatCircle(Number(e))).angleTo(i)-Math.PI/2)*r},o.prototype.alongTrackDistanceTo=function(t,e,n){if(!(t instanceof o))throw new TypeError("pathStart is not LatLon object");var r=void 0===n?6371e3:Number(n),i=this.toVector(),a=e instanceof o?t.toVector().cross(e.toVector()):t.greatCircle(Number(e)),s=a.cross(i).cross(a);return t.toVector().angleTo(s,a)*r},o.prototype.nearestPointOnSegment=function(t,e){var n=null;if(this.isBetween(t,e)){var r=this.toVector(),i=t.toVector(),o=e.toVector(),a=i.cross(o),s=r.cross(a);n=a.cross(s).toLatLonS()}else{n=this.distanceTo(t)<this.distanceTo(e)?t:e}return n},o.prototype.isBetween=function(t,e){var n=this.toVector(),r=t.toVector(),i=e.toVector(),o=n.minus(r),a=i.minus(r),s=n.minus(i),c=r.minus(i),u=o.dot(a),l=s.dot(c),h=u>=0&&l>=0,p=n.dot(r)>=0&&n.dot(i)>=0;return h&&p},o.prototype.enclosedBy=function(t){var e=t[0].equals(t[t.length-1]);e||t.push(t[0]);for(var n=t.length-1,r=this.toVector(),i=[],o=0;o<n;o++)i[o]=r.minus(t[o].toVector());i.push(i[0]);var a=0;for(o=0;o<n;o++)a+=i[o].angleTo(i[o+1],r);var s=Math.abs(a)>Math.PI;return e||t.pop(),s},o.areaOf=function(t,e){var n=null==e?6371e3:Number(e),r=t[0].equals(t[t.length-1]);r||t.push(t[0]);for(var i=t.length-1,o=[],a=0;a<i;a++){var s=t[a].toVector(),c=t[a+1].toVector();o[a]=s.cross(c)}o.push(o[0]);var u=t[0].toVector(),l=0;for(a=0;a<i;a++)l+=o[a].angleTo(o[a+1],u);var h=(i*Math.PI-Math.abs(l)-(i-2)*Math.PI)*n*n;return r||t.pop(),h},o.meanOf=function(t){for(var e=new r(0,0,0),n=0;n<t.length;n++)e=e.plus(t[n].toVector());return e.unit().toLatLonS()},o.prototype.equals=function(t){if(!(t instanceof o))throw new TypeError("point is not LatLon object");return this.lat==t.lat&&this.lon==t.lon},o.prototype.toString=function(t,e){return i.toLat(this.lat,t,e)+", "+i.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),void 0===Math.sign&&(Math.sign=function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1}),t.exports&&(t.exports=o,t.exports.Vector3d=r)},function(t,e,n){"use strict";var r,i;function o(t,e,n,r,a,s,c){if(!(this instanceof o))return new o(t,e,n,r,a,s,c);if(void 0===c&&(c=i.datum.WGS84),!(1<=t&&t<=60))throw new Error("Invalid MGRS grid reference (zone ‘"+t+"’)");if(1!=e.length)throw new Error("Invalid MGRS grid reference (band ‘"+e+"’)");if(-1==o.latBands.indexOf(e))throw new Error("Invalid MGRS grid reference (band ‘"+e+"’)");if(1!=n.length)throw new Error("Invalid MGRS grid reference (e100k ‘"+n+"’)");if(1!=r.length)throw new Error("Invalid MGRS grid reference (n100k ‘"+r+"’)");this.zone=Number(t),this.band=e,this.e100k=n,this.n100k=r,this.easting=Number(a),this.northing=Number(s),this.datum=c}t.exports&&(r=n(95)),t.exports&&(i=n(28)),o.latBands="CDEFGHJKLMNPQRSTUVWXX",o.e100kLetters=["ABCDEFGH","JKLMNPQR","STUVWXYZ"],o.n100kLetters=["ABCDEFGHJKLMNPQRSTUV","FGHJKLMNPQRSTUVABCDE"],r.prototype.toMgrs=function(){if(isNaN(this.zone+this.easting+this.northing))throw new Error("Invalid UTM coordinate ‘"+this.toString()+"’");var t=this.zone,e=this.toLatLonE(),n=o.latBands.charAt(Math.floor(e.lat/8+10)),r=Math.floor(this.easting/1e5),i=o.e100kLetters[(t-1)%3].charAt(r-1),a=Math.floor(this.northing/1e5)%20,s=o.n100kLetters[(t-1)%2].charAt(a),c=this.easting%1e5,u=this.northing%1e5;return new o(t,n,i,s,c=Number(c.toFixed(6)),u=Number(u.toFixed(6)))},o.prototype.toUtm=function(){for(var t=this.zone,e=this.band,n=this.e100k,a=this.n100k,s=this.easting,c=this.northing,u=e>="N"?"N":"S",l=1e5*(o.e100kLetters[(t-1)%3].indexOf(n)+1),h=1e5*o.n100kLetters[(t-1)%2].indexOf(a),p=8*(o.latBands.indexOf(e)-10),d=1e5*Math.floor(new i(p,0).toUtm().northing/1e5),f=0;f+h+c<d;)f+=2e6;return new r(t,u,l+s,f+h+c,this.datum)},o.parse=function(t){if(!(t=t.trim()).match(/\s/)){var e=t.slice(5);e=e.slice(0,e.length/2)+" "+e.slice(-e.length/2),t=t.slice(0,3)+" "+t.slice(3,5)+" "+e}if(null==(t=t.match(/\S+/g))||4!=t.length)throw new Error("Invalid MGRS grid reference ‘"+t+"’");var n=t[0],r=n.slice(0,2),i=n.slice(2,3),a=t[1],s=a.slice(0,1),c=a.slice(1,2),u=t[2],l=t[3];return new o(r,i,s,c,u=u.length>=5?u:(u+"00000").slice(0,5),l=l.length>=5?l:(l+"00000").slice(0,5))},o.prototype.toString=function(t){if(t=void 0===t?10:Number(t),-1==[2,4,6,8,10].indexOf(t))throw new Error("Invalid precision ‘"+t+"’");var e=("00"+this.zone).slice(-2),n=this.band,r=this.e100k,i=this.n100k,o=Math.floor(this.easting/Math.pow(10,5-t/2)),a=Math.floor(this.northing/Math.pow(10,5-t/2));return e+n+" "+r+i+" "+("00000"+o).slice(-t/2)+" "+("00000"+a).slice(-t/2)},t.exports&&(t.exports=o)},function(t,e,n){"use strict";var r;function i(t,e){if(!(this instanceof i))return new i(t,e);this.easting=Number(t),this.northing=Number(e)}t.exports&&(r=n(28)),i.latLonToOsGrid=function(t){if(!(t instanceof r))throw new TypeError("point is not LatLon object");t.datum!=r.datum.OSGB36&&(t=t.convertDatum(r.datum.OSGB36));var e=t.lat.toRadians(),n=t.lon.toRadians(),o=6377563.396,a=6356256.909,s=.9996012717,c=49..toRadians(),u=(-2).toRadians(),l=1-a*a/(o*o),h=(o-a)/(o+a),p=h*h,d=h*h*h,f=Math.cos(e),m=Math.sin(e),v=o*s/Math.sqrt(1-l*m*m),g=o*s*(1-l)/Math.pow(1-l*m*m,1.5),y=v/g-1,x=a*s*(1.0016767257673973*(e-c)-(3*h+3*h*h+21/8*d)*Math.sin(e-c)*Math.cos(e+c)+(15/8*p+15/8*d)*Math.sin(2*(e-c))*Math.cos(2*(e+c))-35/24*d*Math.sin(3*(e-c))*Math.cos(3*(e+c))),b=f*f*f,M=b*f*f,w=Math.tan(e)*Math.tan(e),_=w*w,S=n-u,E=S*S,T=E*S,L=T*S,A=L*S,P=x+-1e5+v/2*m*f*E+v/24*m*b*(5-w+9*y)*L+v/720*m*M*(61-58*w+_)*(A*S),R=4e5+v*f*S+v/6*b*(v/g-w)*T+v/120*M*(5-18*w+_+14*y-58*w*y)*A;return P=Number(P.toFixed(3)),new i(R=Number(R.toFixed(3)),P)},i.osGridToLatLon=function(t,e){if(!(t instanceof i))throw new TypeError("gridref is not OsGridRef object");void 0===e&&(e=r.datum.WGS84);var n=t.easting,o=t.northing,a=6377563.396,s=6356256.909,c=.9996012717,u=49..toRadians(),l=(-2).toRadians(),h=1-s*s/(a*a),p=(a-s)/(a+s),d=p*p,f=p*p*p,m=u,v=0;do{v=s*c*(1.0016767257673973*((m=(o- -1e5-v)/(a*c)+m)-u)-(3*p+3*p*p+21/8*f)*Math.sin(m-u)*Math.cos(m+u)+(15/8*d+15/8*f)*Math.sin(2*(m-u))*Math.cos(2*(m+u))-35/24*f*Math.sin(3*(m-u))*Math.cos(3*(m+u)))}while(o- -1e5-v>=1e-5);var g=Math.cos(m),y=Math.sin(m),x=a*c/Math.sqrt(1-h*y*y),b=a*c*(1-h)/Math.pow(1-h*y*y,1.5),M=x/b-1,w=Math.tan(m),_=w*w,S=_*_,E=1/g,T=x*x*x,L=T*x*x,A=n-4e5,P=A*A,R=P*A,O=P*P,N=R*P,C=l+E/x*A-E/(6*T)*(x/b+2*_)*R+E/(120*L)*(5+28*_+24*S)*N-E/(5040*(L*x*x))*(61+662*_+1320*S+720*(S*_))*(N*P),I=new r((m=m-w/(2*b*x)*P+w/(24*b*T)*(5+3*_+M-9*_*M)*O-w/(720*b*L)*(61+90*_+45*S)*(O*P)).toDegrees(),C.toDegrees(),r.datum.OSGB36);return e!=r.datum.OSGB36&&(I=I.convertDatum(e)),I},i.parse=function(t){var e=(t=String(t).trim()).match(/^(\d+),\s*(\d+)$/);if(e)return new i(e[1],e[2]);if(!(e=t.match(/^[A-Z]{2}\s*[0-9]+\s*[0-9]+$/i)))throw new Error("Invalid grid reference");var n=t.toUpperCase().charCodeAt(0)-"A".charCodeAt(0),r=t.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);n>7&&n--,r>7&&r--;var o=(n-2)%5*5+r%5,a=19-5*Math.floor(n/5)-Math.floor(r/5),s=t.slice(2).trim().split(/\s+/);if(1==s.length&&(s=[s[0].slice(0,s[0].length/2),s[0].slice(s[0].length/2)]),o<0||o>6||a<0||a>12)throw new Error("Invalid grid reference");if(2!=s.length)throw new Error("Invalid grid reference");if(s[0].length!=s[1].length)throw new Error("Invalid grid reference");return s[0]=(s[0]+"00000").slice(0,5),s[1]=(s[1]+"00000").slice(0,5),new i(o+s[0],a+s[1])},i.prototype.toString=function(t){if(t=void 0===t?10:Number(t),isNaN(t)||t%2!=0||t>16)throw new RangeError("Invalid precision ‘"+t+"’");var e=this.easting,n=this.northing;if(isNaN(e)||isNaN(n))throw new Error("Invalid grid reference");if(0==t){var r=Math.floor(e),i=e-r,o=Math.floor(n),a=n-o;return("000000"+r).slice(-6)+(i>0?i.toFixed(3).slice(1):"")+","+((o<1e6?("000000"+o).slice(-6):o)+(a>0?a.toFixed(3).slice(1):""))}var s=Math.floor(e/1e5),c=Math.floor(n/1e5);if(s<0||s>6||c<0||c>12)return"";var u=19-c-(19-c)%5+Math.floor((s+10)/5),l=5*(19-c)%25+s%5;u>7&&u++,l>7&&l++;var h=String.fromCharCode(u+"A".charCodeAt(0),l+"A".charCodeAt(0));return e=Math.floor(e%1e5/Math.pow(10,5-t/2)),n=Math.floor(n%1e5/Math.pow(10,5-t/2)),h+" "+(e=("00000000"+e).slice(-t/2))+" "+(n=("00000000"+n).slice(-t/2))},t.exports&&(t.exports=i)},function(t,e,n){"use strict";t.exports=function(t){return encodeURIComponent(t).replace(/[!'()*]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}},function(t,e,n){"use strict";
|
|
2
2
|
/*
|
|
3
3
|
object-assign
|
|
4
4
|
(c) Sindre Sorhus
|