OASISViewer.min.js 793 KB

1
  1. !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).SCOASIS={})}(this,function(t){"use strict";function h(){this.a=0,this.b=0,this.set=function(t,e){this.a=t,this.b=e},this.d2S=function(t){var e=this.a-t.a,n=this.b-t.b;return e*e+n*n}}function l(t,e,n){this.aa=t,this.ab=e,this.ac=n,this.set=function(t,e,n){this.aa=t,this.ab=e,this.ac=n},this.applyMx=function(t){var e=this.aa,n=this.ab,i=this.ac,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.aa=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.ab=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.ac=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this},this.addSV=function(t,e){return this.aa+=t.aa*e,this.ab+=t.ab*e,this.ac+=t.ac*e,this},this.d2S=function(t){var e=this.aa-t.aa,n=this.ab-t.ab,i=this.ac-t.ac;return e*e+n*n+i*i}}function e(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.setFA=function(t){for(var e=0;e<16;e++)this.elements[e]=t[e];return this},this.mM4=function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[4],s=n[8],h=n[12],l=n[1],c=n[5],u=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],w=i[0],_=i[4],M=i[8],S=i[12],T=i[1],E=i[5],A=i[9],C=i[13],L=i[2],P=i[6],R=i[10],O=i[14],k=i[3],z=i[7],I=i[11],D=i[15];return r[0]=o*w+a*T+s*L+h*k,r[4]=o*_+a*E+s*P+h*z,r[8]=o*M+a*A+s*R+h*I,r[12]=o*S+a*C+s*O+h*D,r[1]=l*w+c*T+u*L+p*k,r[5]=l*_+c*E+u*P+p*z,r[9]=l*M+c*A+u*R+p*I,r[13]=l*S+c*C+u*O+p*D,r[2]=d*w+f*T+m*L+v*k,r[6]=d*_+f*E+m*P+v*z,r[10]=d*M+f*A+m*R+v*I,r[14]=d*S+f*C+m*O+v*D,r[3]=g*w+y*T+x*L+b*k,r[7]=g*_+y*E+x*P+b*z,r[11]=g*M+y*A+x*R+b*I,r[15]=g*S+y*C+x*O+b*D,this}}function _t(){this.matrix1=new e,this.matrix2=new e,this.pstn=new l,this.up=new l,this.set=function(t,e,n,i){this.matrix1.setFA(t),this.matrix2.setFA(e),this.pstn.set(n.x,n.y,n.z),this.up.set(i.x,i.y,i.z)},this.compute=function(){var t=new e;return t.mM4(this.matrix1,this.matrix2),t},this.distance=function(t,e,n){var i=t.clone();return i.addSV(this.up,e),t.applyMx(n),i.applyMx(n),t.d2S(i)}}Object.assign(l.prototype,{clone:function(){return new this.constructor(this.aa,this.ab,this.ac)}});var i={_d1:new Date};function Mt(r){var o=1,a=2;this.cPixel=0,this.cw=0;function t(){var t=517376,e=1536,n=7680;return{tt:t>>=8,tm:e>>=8,td:n>>=8}}var s=1;function n(t,e){var n=r.getBoundingClientRect(),i=new h;return 0===n.width||i.set((t-n.left)/n.width*a-o,(e-n.top)/n.height*-a+o),i}i._d1.getFullYear()<t().tt||i._d1.getFullYear()==t().tt&&i._d1.getMonth()+1<t().tm||i._d1.getFullYear()==t().tt&&i._d1.getMonth()+1==t().tm&&i._d1.getDate()<=t().td||(s=0),this.setValue=function(t){this.cPixel=t,this.update()},this.compute=function(t,e){var n=t.center,i=t.radius,r=e.compute(),o=new l;return o.set(n.x,n.y,n.z),!(e.distance(o,i,r)<this.cw)||!s&&parseInt(2*Math.random())},this.update=function(){var t=n(0,0),e=n(0,.5*this.cPixel);this.cw=t.d2S(e)}}var ea="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function n(){}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:0<t?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");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}),Object.assign(n.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 i=n.indexOf(e);-1!==i&&n.splice(i,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),i=0,r=n.length;i<r;i++)n[i].call(this,t)}}}});var r,o,c,u,a,s,p,d,f,m,v,g,y,x,b,w,_,M,S,T,E,A,q=0,X=1,Y=2,I=1,k=2,D=0,St=1,Tt=2,C=0,It=2,Z=0,J=1,K=2,Q=3,$=4,tt=5,et=100,L=101,P=102,R=103,O=104,z=200,B=201,N=202,F=203,U=204,j=205,V=206,G=207,H=208,W=209,nt=210,it=0,rt=1,ot=2,at=3,st=4,ht=5,lt=6,ct=7,ut=0,pt=1,dt=2,ft=0,Et=1,mt=2,vt=3,gt=4,yt=301,xt=302,bt=303,wt=304,At=305,Ct=306,Lt=307,Pt=1e3,Rt=1001,Ot=1002,kt=1003,zt=1004,Dt=1005,Bt=1006,Nt=1007,Ft=1008,Ut=1009,jt=1010,Vt=1011,Gt=1012,Ht=1013,Wt=1014,qt=1015,Xt=1016,Yt=1017,Zt=1018,Jt=1019,Kt=1020,Qt=1021,$t=1022,te=1023,ee=1024,ne=1025,ie=1026,re=1027,oe=1028,ae=33776,se=33777,he=33778,le=33779,ce=35840,ue=35841,pe=35842,de=35843,fe=36196,me=37808,ve=37809,ge=37810,ye=37811,xe=37812,be=37813,we=37814,_e=37815,Me=37816,Se=37817,Te=37818,Ee=37819,Ae=37820,Ce=37821,Le=2300,Pe=2301,Re=2302,Oe=2400,ke=2401,ze=0,Ie=1,De=2,Be=3e3,Ne=3001,Fe=3007,Ue=3002,je=3004,Ve=3005,Ge=3006,He=3200,We=3201,qe=0,Xe=1,Ye={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var r=[],t=0;t<256;t++)r[t]=(t<16?"0":"")+t.toString(16);return function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(r[255&t]+r[t>>8&255]+r[t>>16&255]+r[t>>24&255]+"-"+r[255&e]+r[e>>8&255]+"-"+r[e>>16&15|64]+r[e>>24&255]+"-"+r[63&n|128]+r[n>>8&255]+"-"+r[n>>16&255]+r[n>>24&255]+r[255&i]+r[i>>8&255]+r[i>>16&255]+r[i>>24&255]).toUpperCase()}}(),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Ye.DEG2RAD},radToDeg:function(t){return t*Ye.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};function Ze(t,e){this.x=t||0,this.y=e||0}function Je(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Ke(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}function Qe(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function $e(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(Ze.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(Ze.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,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[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:(r=new Ze,o=new Ze,function(t,e){return r.set(t,t),o.set(e,e),this.clamp(r,o)}),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("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),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}}),Object.assign(Je.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,o,a,s,h,l,c,u,p,d,f,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=i,v[1]=r,v[5]=o,v[9]=a,v[13]=s,v[2]=h,v[6]=l,v[10]=c,v[14]=u,v[3]=p,v[7]=d,v[11]=f,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Je).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:(v=new Qe,function(t){var e=this.elements,n=t.elements,i=1/v.setFromMatrixColumn(t,0).length(),r=1/v.setFromMatrixColumn(t,1).length(),o=1/v.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,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,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(i),h=Math.sin(i),l=Math.cos(r),c=Math.sin(r);if("XYZ"===t.order){var u=o*l,p=o*c,d=a*l,f=a*c;e[0]=s*l,e[4]=-s*c,e[8]=h,e[1]=p+d*h,e[5]=u-f*h,e[9]=-a*s,e[2]=f-u*h,e[6]=d+p*h,e[10]=o*s}else if("YXZ"===t.order){var m=s*l,v=s*c,g=h*l,y=h*c;e[0]=m+y*a,e[4]=g*a-v,e[8]=o*h,e[1]=o*c,e[5]=o*l,e[9]=-a,e[2]=v*a-g,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*l,v=s*c,g=h*l,y=h*c;e[0]=m-y*a,e[4]=-o*c,e[8]=g+v*a,e[1]=v+g*a,e[5]=o*l,e[9]=y-m*a,e[2]=-o*h,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){u=o*l,p=o*c,d=a*l,f=a*c;e[0]=s*l,e[4]=d*h-p,e[8]=u*h+f,e[1]=s*c,e[5]=f*h+u,e[9]=p*h-d,e[2]=-h,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var x=o*s,b=o*h,w=a*s,_=a*h;e[0]=s*l,e[4]=_-x*c,e[8]=w*c+b,e[1]=c,e[5]=o*l,e[9]=-a*l,e[2]=-h*l,e[6]=b*c+w,e[10]=x-_*c}else if("XZY"===t.order){x=o*s,b=o*h,w=a*s,_=a*h;e[0]=s*l,e[4]=-c,e[8]=h*l,e[1]=x*c+_,e[5]=o*l,e[9]=b*c-w,e[2]=w*c-b,e[6]=a*l,e[10]=_*c+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:(f=new Qe(0,0,0),m=new Qe(1,1,1),function(t){return this.compose(f,t,m)}),lookAt:(s=new Qe,p=new Qe,d=new Qe,function(t,e,n){var i=this.elements;return d.subVectors(t,e),0===d.lengthSq()&&(d.z=1),d.normalize(),s.crossVectors(n,d),0===s.lengthSq()&&(1===Math.abs(n.z)?d.x+=1e-4:d.z+=1e-4,d.normalize(),s.crossVectors(n,d)),s.normalize(),p.crossVectors(d,s),i[0]=s.x,i[4]=p.x,i[8]=d.x,i[1]=s.y,i[5]=p.y,i[9]=d.y,i[2]=s.z,i[6]=p.z,i[10]=d.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,i=e.elements,r=this.elements,o=n[0],a=n[4],s=n[8],h=n[12],l=n[1],c=n[5],u=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],w=i[0],_=i[4],M=i[8],S=i[12],T=i[1],E=i[5],A=i[9],C=i[13],L=i[2],P=i[6],R=i[10],O=i[14],k=i[3],z=i[7],I=i[11],D=i[15];return r[0]=o*w+a*T+s*L+h*k,r[4]=o*_+a*E+s*P+h*z,r[8]=o*M+a*A+s*R+h*I,r[12]=o*S+a*C+s*O+h*D,r[1]=l*w+c*T+u*L+p*k,r[5]=l*_+c*E+u*P+p*z,r[9]=l*M+c*A+u*R+p*I,r[13]=l*S+c*C+u*O+p*D,r[2]=d*w+f*T+m*L+v*k,r[6]=d*_+f*E+m*P+v*z,r[10]=d*M+f*A+m*R+v*I,r[14]=d*S+f*C+m*O+v*D,r[3]=g*w+y*T+x*L+b*k,r[7]=g*_+y*E+x*P+b*z,r[11]=g*M+y*A+x*R+b*I,r[15]=g*S+y*C+x*O+b*D,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:(a=new Qe,function(t){for(var e=0,n=t.count;e<n;e++)a.x=t.getX(e),a.y=t.getY(e),a.z=t.getZ(e),a.applyMatrix4(this),t.setXYZ(e,a.x,a.y,a.z);return t}),determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],s=t[9],h=t[13],l=t[2],c=t[6],u=t[10],p=t[14];return t[3]*(+r*s*c-i*h*c-r*a*u+n*h*u+i*a*p-n*s*p)+t[7]*(+e*s*p-e*h*u+r*o*u-i*o*p+i*h*l-r*s*l)+t[11]*(+e*h*c-e*a*p-r*o*c+n*o*p+r*a*l-n*h*l)+t[15]*(-i*a*l-e*s*c+e*a*u+i*o*c-n*o*u+n*s*l)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var n=this.elements,i=t.elements,r=i[0],o=i[1],a=i[2],s=i[3],h=i[4],l=i[5],c=i[6],u=i[7],p=i[8],d=i[9],f=i[10],m=i[11],v=i[12],g=i[13],y=i[14],x=i[15],b=d*y*u-g*f*u+g*c*m-l*y*m-d*c*x+l*f*x,w=v*f*u-p*y*u-v*c*m+h*y*m+p*c*x-h*f*x,_=p*g*u-v*d*u+v*l*m-h*g*m-p*l*x+h*d*x,M=v*d*c-p*g*c-v*l*f+h*g*f+p*l*y-h*d*y,S=r*b+o*w+a*_+s*M;if(0==S){var T="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(T);return console.warn(T),this.identity()}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]=(l*y*s-g*c*s+g*a*u-o*y*u-l*a*x+o*c*x)*E,n[3]=(d*c*s-l*f*s-d*a*u+o*f*u+l*a*m-o*c*m)*E,n[4]=w*E,n[5]=(p*y*s-v*f*s+v*a*m-r*y*m-p*a*x+r*f*x)*E,n[6]=(v*c*s-h*y*s-v*a*u+r*y*u+h*a*x-r*c*x)*E,n[7]=(h*f*s-p*c*s+p*a*u-r*f*u-h*a*m+r*c*m)*E,n[8]=_*E,n[9]=(v*d*s-p*g*s-v*o*m+r*g*m+p*o*x-r*d*x)*E,n[10]=(h*g*s-v*l*s+v*o*u-r*g*u-h*o*x+r*l*x)*E,n[11]=(p*l*s-h*d*s-p*o*u+r*d*u+h*o*m-r*l*m)*E,n[12]=M*E,n[13]=(p*g*a-v*d*a+v*o*f-r*g*f-p*o*y+r*d*y)*E,n[14]=(v*l*a-h*g*a-v*o*c+r*g*c+h*o*y-r*l*y)*E,n[15]=(h*d*a-p*l*a+p*o*c-r*d*c-h*o*f+r*l*f)*E,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,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],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},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),i=Math.sin(e),r=1-n,o=t.x,a=t.y,s=t.z,h=r*o,l=r*a;return this.set(h*o+n,h*a-i*s,h*s+i*a,0,h*a+i*s,l*a+n,l*s-i*o,0,h*s-i*a,l*s+i*o,r*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 i=this.elements,r=e._x,o=e._y,a=e._z,s=e._w,h=r+r,l=o+o,c=a+a,u=r*h,p=r*l,d=r*c,f=o*l,m=o*c,v=a*c,g=s*h,y=s*l,x=s*c,b=n.x,w=n.y,_=n.z;return i[0]=(1-(f+v))*b,i[1]=(p+x)*b,i[2]=(d-y)*b,i[3]=0,i[4]=(p-x)*w,i[5]=(1-(u+v))*w,i[6]=(m+g)*w,i[7]=0,i[8]=(d+y)*_,i[9]=(m-g)*_,i[10]=(1-(u+f))*_,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:(c=new Qe,u=new Je,function(t,e,n){var i=this.elements,r=c.set(i[0],i[1],i[2]).length(),o=c.set(i[4],i[5],i[6]).length(),a=c.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],u.copy(this);var s=1/r,h=1/o,l=1/a;return u.elements[0]*=s,u.elements[1]*=s,u.elements[2]*=s,u.elements[4]*=h,u.elements[5]*=h,u.elements[6]*=h,u.elements[8]*=l,u.elements[9]*=l,u.elements[10]*=l,e.setFromRotationMatrix(u),n.x=r,n.y=o,n.z=a,this}),makePerspective:function(t,e,n,i,r,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*r/(e-t),h=2*r/(n-i),l=(e+t)/(e-t),c=(n+i)/(n-i),u=-(o+r)/(o-r),p=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=h,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,i,r,o){var a=this.elements,s=1/(e-t),h=1/(n-i),l=1/(o-r),c=(e+t)*s,u=(n+i)*h,p=(o+r)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*h,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*l,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,i=0;i<16;i++)if(e[i]!==n[i])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}}),Object.assign(Ke,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,o,a){var s=n[i+0],h=n[i+1],l=n[i+2],c=n[i+3],u=r[o+0],p=r[o+1],d=r[o+2],f=r[o+3];if(c!==f||s!==u||h!==p||l!==d){var m=1-a,v=s*u+h*p+l*d+c*f,g=0<=v?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 w=a*g;if(s=s*m+u*w,h=h*m+p*w,l=l*m+d*w,c=c*m+f*w,m===1-a){var _=1/Math.sqrt(s*s+h*h+l*l+c*c);s*=_,h*=_,l*=_,c*=_}}t[e]=s,t[e+1]=h,t[e+2]=l,t[e+3]=c}}),Object.defineProperties(Ke.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(Ke.prototype,{isQuaternion:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,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,i=t._y,r=t._z,o=t.order,a=Math.cos,s=Math.sin,h=a(n/2),l=a(i/2),c=a(r/2),u=s(n/2),p=s(i/2),d=s(r/2);return"XYZ"===o?(this._x=u*l*c+h*p*d,this._y=h*p*c-u*l*d,this._z=h*l*d+u*p*c,this._w=h*l*c-u*p*d):"YXZ"===o?(this._x=u*l*c+h*p*d,this._y=h*p*c-u*l*d,this._z=h*l*d-u*p*c,this._w=h*l*c+u*p*d):"ZXY"===o?(this._x=u*l*c-h*p*d,this._y=h*p*c+u*l*d,this._z=h*l*d+u*p*c,this._w=h*l*c-u*p*d):"ZYX"===o?(this._x=u*l*c-h*p*d,this._y=h*p*c+u*l*d,this._z=h*l*d-u*p*c,this._w=h*l*c+u*p*d):"YZX"===o?(this._x=u*l*c+h*p*d,this._y=h*p*c+u*l*d,this._z=h*l*d-u*p*c,this._w=h*l*c-u*p*d):"XZY"===o&&(this._x=u*l*c-h*p*d,this._y=h*p*c-u*l*d,this._z=h*l*d+u*p*c,this._w=h*l*c+u*p*d),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],o=n[8],a=n[1],s=n[5],h=n[9],l=n[2],c=n[6],u=n[10],p=i+s+u;return 0<p?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(c-h)*e,this._y=(o-l)*e,this._z=(a-r)*e):s<i&&u<i?(e=2*Math.sqrt(1+i-s-u),this._w=(c-h)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+l)/e):u<s?(e=2*Math.sqrt(1+s-i-u),this._w=(o-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(h+c)/e):(e=2*Math.sqrt(1+u-i-s),this._w=(a-r)/e,this._x=(o+l)/e,this._y=(h+c)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:(y=new Qe,function(t,e){return void 0===y&&(y=new Qe),(g=t.dot(e)+1)<1e-6?(g=0,Math.abs(t.x)>Math.abs(t.z)?y.set(-t.y,t.x,0):y.set(0,-t.z,t.y)):y.crossVectors(t,e),this._x=y.x,this._y=y.y,this._z=y.z,this._w=g,this.normalize()}),angleTo:function(t){return 2*Math.acos(Math.abs(Ye.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var i=Math.min(1,e/n);return this.slerp(t,i),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,i=t._y,r=t._z,o=t._w,a=e._x,s=e._y,h=e._z,l=e._w;return this._x=n*l+o*a+i*h-r*s,this._y=i*l+o*s+r*a-n*h,this._z=r*l+o*h+n*s-i*a,this._w=o*l-n*a-i*s-r*h,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+r*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),1<=a)return this._w=o,this._x=n,this._y=i,this._z=r,this;var s=1-a*a;if(s<=Number.EPSILON){var h=1-e;return this._w=h*o+e*this._w,this._x=h*n+e*this._x,this._y=h*i+e*this._y,this._z=h*r+e*this._z,this.normalize()}var l=Math.sqrt(s),c=Math.atan2(l,a),u=Math.sin((1-e)*c)/l,p=Math.sin(e*c)/l;return this._w=o*u+this._w*p,this._x=n*u+this._x*p,this._y=i*u+this._y*p,this._z=r*u+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},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Qe.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:(T=new Ke,function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(T.setFromEuler(t))}),applyAxisAngle:(S=new Ke,function(t,e){return this.applyQuaternion(S.setFromAxisAngle(t,e))}),applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,s=t.w,h=s*e+o*i-a*n,l=s*n+a*e-r*i,c=s*i+r*n-o*e,u=-r*e-o*n-a*i;return this.x=h*s+u*-r+l*-a-c*-o,this.y=l*s+u*-o+c*-r-h*-a,this.z=c*s+u*-a+h*-o-l*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:(M=new Je,function(t){return this.applyMatrix4(M.getInverse(t.projectionMatrix)).applyMatrix4(t.matrixWorld)}),transformDirection:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,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:(w=new Qe,_=new Qe,function(t,e){return w.set(t,t,t),_.set(e,e,e),this.clamp(w,_)}),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("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,i=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-i*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:(b=new Qe,function(t){return b.copy(this).projectOnVector(t),this.sub(b)}),reflect:(x=new Qe,function(t){return this.sub(x.copy(t).multiplyScalar(2*this.dot(t)))}),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Ye.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},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 i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*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(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign($e.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,o,a,s,h){var l=this.elements;return l[0]=t,l[1]=i,l[2]=a,l[3]=e,l[4]=r,l[5]=s,l[6]=n,l[7]=o,l[8]=h,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:(E=new Qe,function(t){for(var e=0,n=t.count;e<n;e++)E.x=t.getX(e),E.y=t.getY(e),E.z=t.getZ(e),E.applyMatrix3(this),t.setXYZ(e,E.x,E.y,E.z);return t}),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[3],s=n[6],h=n[1],l=n[4],c=n[7],u=n[2],p=n[5],d=n[8],f=i[0],m=i[3],v=i[6],g=i[1],y=i[4],x=i[7],b=i[2],w=i[5],_=i[8];return r[0]=o*f+a*g+s*b,r[3]=o*m+a*y+s*w,r[6]=o*v+a*x+s*_,r[1]=h*f+l*g+c*b,r[4]=h*m+l*y+c*w,r[7]=h*v+l*x+c*_,r[2]=u*f+p*g+d*b,r[5]=u*m+p*y+d*w,r[8]=u*v+p*x+d*_,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],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],h=t[7],l=t[8];return e*o*l-e*a*h-n*r*l+n*a*s+i*r*h-i*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,i=this.elements,r=n[0],o=n[1],a=n[2],s=n[3],h=n[4],l=n[5],c=n[6],u=n[7],p=n[8],d=p*h-l*u,f=l*c-p*s,m=u*s-h*c,v=r*d+o*f+a*m;if(0==v){var g="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(g);return console.warn(g),this.identity()}var y=1/v;return i[0]=d*y,i[1]=(a*u-p*o)*y,i[2]=(l*o-a*h)*y,i[3]=f*y,i[4]=(p*r-a*c)*y,i[5]=(a*s-l*r)*y,i[6]=m*y,i[7]=(o*c-u*r)*y,i[8]=(h*r-o*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,o,a){var s=Math.cos(r),h=Math.sin(r);this.set(n*s,n*h,-n*(s*o+h*a)+o+t,-i*h,i*s,-i*(-h*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),i=this.elements,r=i[0],o=i[3],a=i[6],s=i[1],h=i[4],l=i[7];return i[0]=e*r+n*s,i[3]=e*o+n*h,i[6]=e*a+n*l,i[1]=-n*r+e*s,i[4]=-n*o+e*h,i[7]=-n*a+e*l,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])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 tn,en,nn,rn,on,an,sn,hn,ln,cn,un,pn,dn,fn,mn,vn,gn,yn,xn,bn,wn,_n,Mn,Sn,Tn,En,An,Cn,Ln,Pn,Rn={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===A&&(A=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),A.width=t.width,A.height=t.height;var n=A.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=A}return 2048<e.width||2048<e.height?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},On=0;function kn(t,e,n,i,r,o,a,s,h,l){Object.defineProperty(this,"id",{value:On++}),this.uuid=Ye.generateUUID(),this.name="",this.image=void 0!==t?t:kn.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:kn.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:Rt,this.wrapT=void 0!==i?i:Rt,this.magFilter=void 0!==r?r:Bt,this.minFilter=void 0!==o?o:Ft,this.anisotropy=void 0!==h?h:1,this.format=void 0!==a?a:te,this.type=void 0!==s?s:Ut,this.offset=new Ze(0,0),this.repeat=new Ze(1,1),this.center=new Ze(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new $e,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:Be,this.version=0,this.onUpdate=null}function zn(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function In(t,e,n){this.width=t,this.height=e,this.scissor=new zn(0,0,t,e),this.scissorTest=!1,this.viewport=new zn(0,0,t,e),n=n||{},this.texture=new kn(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Bt,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 Dn(t,e,n){In.call(this,t,e,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function Bn(t,e,n,i,r,o,a,s,h,l,c,u){kn.call(this,null,o,a,s,h,l,i,r,c,u),this.image={data:t,width:e,height:n},this.magFilter=void 0!==h?h:kt,this.minFilter=void 0!==l?l:kt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Nn(t,e){this.min=void 0!==t?t:new Qe(1/0,1/0,1/0),this.max=void 0!==e?e:new Qe(-1/0,-1/0,-1/0)}function Fn(t){var e,n;for(e=0,n=t.length-3;e<=n;e+=3){pn.fromArray(t,e);var i=fn.x*Math.abs(pn.x)+fn.y*Math.abs(pn.y)+fn.z*Math.abs(pn.z),r=an.dot(pn),o=sn.dot(pn),a=hn.dot(pn);if(Math.max(-Math.max(r,o,a),Math.min(r,o,a))>i)return!1}return!0}function Un(t){var e=t.geometry;if(void 0!==e)if(e.isGeometry){var n=e.vertices;for(yn=0,xn=n.length;yn<xn;yn++)bn.copy(n[yn]),bn.applyMatrix4(t.matrixWorld),gn.expandByPoint(bn)}else if(e.isBufferGeometry){var i=e.attributes.position;if(void 0!==i)for(yn=0,xn=i.count;yn<xn;yn++)bn.fromBufferAttribute(i,yn).applyMatrix4(t.matrixWorld),gn.expandByPoint(bn)}}function jn(t,e){this.center=void 0!==t?t:new Qe,this.radius=void 0!==e?e:0}function Vn(t,e){this.normal=void 0!==t?t:new Qe(1,0,0),this.constant=void 0!==e?e:0}function Gn(t,e,n,i,r,o){this.planes=[void 0!==t?t:new Vn,void 0!==e?e:new Vn,void 0!==n?n:new Vn,void 0!==i?i:new Vn,void 0!==r?r:new Vn,void 0!==o?o:new Vn]}kn.DEFAULT_IMAGE=void 0,kn.DEFAULT_MAPPING=300,kn.prototype=Object.assign(Object.create(n.prototype),{constructor:kn,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.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,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=Ye.generateUUID()),!e&&void 0===t.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var o=0,a=i.length;o<a;o++)r.push(Rn.getDataURL(i[o]))}else r=Rn.getDataURL(i);t.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.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||1<t.x)switch(this.wrapS){case Pt:t.x=t.x-Math.floor(t.x);break;case Rt:t.x=t.x<0?0:1;break;case Ot: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||1<t.y)switch(this.wrapT){case Pt:t.y=t.y-Math.floor(t.y);break;case Rt:t.y=t.y<0?0:1;break;case Ot: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(kn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(zn.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,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,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,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,i,r,o=t.elements,a=o[0],s=o[4],h=o[8],l=o[1],c=o[5],u=o[9],p=o[2],d=o[6],f=o[10];if(Math.abs(s-l)<.01&&Math.abs(h-p)<.01&&Math.abs(u-d)<.01){if(Math.abs(s+l)<.1&&Math.abs(h+p)<.1&&Math.abs(u+d)<.1&&Math.abs(a+c+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,v=(c+1)/2,g=(f+1)/2,y=(s+l)/4,x=(h+p)/4,b=(u+d)/4;return v<m&&g<m?r=m<.01?(n=0,i=.707106781):(i=y/(n=Math.sqrt(m)),x/n):g<v?r=v<.01?(i=0,n=.707106781):(n=y/(i=Math.sqrt(v)),b/i):g<.01?(i=n=.707106781,r=0):(n=x/(r=Math.sqrt(g)),i=b/r),this.set(n,i,r,e),this}var w=Math.sqrt((d-u)*(d-u)+(h-p)*(h-p)+(l-s)*(l-s));return Math.abs(w)<.001&&(w=1),this.x=(d-u)/w,this.y=(h-p)/w,this.z=(l-s)/w,this.w=Math.acos((a+c+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return void 0===tn&&(tn=new zn,en=new zn),tn.set(t,t,t,t),en.set(e,e,e,e),this.clamp(tn,en)},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("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}}),In.prototype=Object.assign(Object.create(n.prototype),{constructor:In,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),((Dn.prototype=Object.create(In.prototype)).constructor=Dn).prototype.isWebGLRenderTargetCube=!0,((Bn.prototype=Object.create(kn.prototype)).constructor=Bn).prototype.isDataTexture=!0,Object.assign(Nn.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,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,h=t.length;s<h;s+=3){var l=t[s],c=t[s+1],u=t[s+2];l<e&&(e=l),c<n&&(n=c),u<i&&(i=u),r<l&&(r=l),o<c&&(o=c),a<u&&(a=u)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,h=t.count;s<h;s++){var l=t.getX(s),c=t.getY(s),u=t.getZ(s);l<e&&(e=l),c<n&&(n=c),u<i&&(i=u),r<l&&(r=l),o<c&&(o=c),a<u&&(a=u)}return this.min.set(e,n,i),this.max.set(r,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:(wn=new Qe,function(t,e){var n=wn.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 Qe),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 Qe),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:(bn=new Qe,function(t){return gn=this,t.updateMatrixWorld(!0),t.traverse(Un),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 Qe),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:(vn=new Qe,function(t){return this.clampPoint(t.center,vn),vn.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,n;return n=0<t.normal.x?(e=t.normal.x*this.min.x,t.normal.x*this.max.x):(e=t.normal.x*this.max.x,t.normal.x*this.min.x),0<t.normal.y?(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),0<t.normal.z?(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:(an=new Qe,sn=new Qe,hn=new Qe,ln=new Qe,cn=new Qe,un=new Qe,pn=new Qe,dn=new Qe,fn=new Qe,mn=new Qe,function(t){if(this.isEmpty())return!1;this.getCenter(dn),fn.subVectors(this.max,dn),an.subVectors(t.a,dn),sn.subVectors(t.b,dn),hn.subVectors(t.c,dn),ln.subVectors(sn,an),cn.subVectors(hn,sn),un.subVectors(an,hn);var e=[0,-ln.z,ln.y,0,-cn.z,cn.y,0,-un.z,un.y,ln.z,0,-ln.x,cn.z,0,-cn.x,un.z,0,-un.x,-ln.y,ln.x,0,-cn.y,cn.x,0,-un.y,un.x,0];return!!Fn(e)&&!!Fn(e=[1,0,0,0,1,0,0,0,1])&&(mn.crossVectors(ln,cn),Fn(e=[mn.x,mn.y,mn.z]))}),clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Qe),e.copy(t).clamp(this.min,this.max)},distanceToPoint:(on=new Qe,function(t){return on.copy(t).clamp(this.min,this.max).sub(t).length()}),getBoundingSphere:(rn=new Qe,function(t){return void 0===t&&(console.warn("THREE.Box3: .getBoundingSphere() target is now required"),t=new jn),this.getCenter(t.center),t.radius=.5*this.getSize(rn).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:(nn=[new Qe,new Qe,new Qe,new Qe,new Qe,new Qe,new Qe,new Qe],function(t){return this.isEmpty()||(nn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),nn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),nn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),nn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),nn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),nn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),nn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),nn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(nn)),this}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(jn.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(_n=new Nn,function(t,e){var n=this.center;void 0!==e?n.copy(e):_n.setFromPoints(t).getCenter(n);for(var i=0,r=0,o=t.length;r<o;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new Qe),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 Nn),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(Vn.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:(En=new Qe,An=new Qe,function(t,e,n){var i=En.subVectors(n,e).cross(An.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,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 Qe),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:(Tn=new Qe,function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new Qe);var n=t.delta(Tn),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||1<r?void 0:e.copy(n).multiplyScalar(r).add(t.start)}),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&0<n||n<0&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Qe),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:(Mn=new Qe,Sn=new $e,function(t,e){var n=e||Sn.getNormalMatrix(t),i=this.coplanarPoint(Mn).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(Gn.prototype,{set:function(t,e,n,i,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],h=n[5],l=n[6],c=n[7],u=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-i,c-s,f-u,y-m).normalize(),e[1].setComponents(a+i,c+s,f+u,y+m).normalize(),e[2].setComponents(a+r,c+h,f+p,y+v).normalize(),e[3].setComponents(a-r,c-h,f-p,y-v).normalize(),e[4].setComponents(a-o,c-l,f-d,y-g).normalize(),e[5].setComponents(a+o,c+l,f+d,y+g).normalize(),this},intersectsObject:(Pn=new jn,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Pn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Pn)}),intersectsSprite:(Ln=new jn,function(t){return Ln.center.set(0,0,0),Ln.radius=.7071067811865476,Ln.applyMatrix4(t.matrixWorld),this.intersectsSphere(Ln)}),intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)<i)return!1}return!0},intersectsBox:(Cn=new Qe,function(t){for(var e=this.planes,n=0;n<6;n++){var i=e[n];if(Cn.x=0<i.normal.x?t.max.x:t.min.x,Cn.y=0<i.normal.y?t.max.y:t.min.y,Cn.z=0<i.normal.z?t.max.z:t.min.z,i.distanceToPoint(Cn)<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 Hn,Wn,qn,Xn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float 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}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\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\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\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",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\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\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 = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif\n",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",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\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif\n",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif\n",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, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif\n",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",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#endif\n",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",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\n",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#endif\n",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 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",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}\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}\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}\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}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\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}\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}\n",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\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}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\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}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#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}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\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}\n",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\tvec4 matcapColor = texture2D( matcap, uv );\n\tmatcapColor = matcapTexelToLinear( matcapColor );\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\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}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphysical_vert:"#define PHYSICAL\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}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}\n",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}\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}\n",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n"},Yn={merge:function(t){for(var e={},n=0;n<t.length;n++){var i=this.clone(t[n]);for(var r in i)e[r]=i[r]}return e},clone:function(t){var e={};for(var n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}return e}},Zn={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};function Jn(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function Kn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Qn(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function $n(t,e,n){return n<0&&(n+=1),1<n&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}Object.assign(Jn.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=Ye.euclideanModulo(t,1),e=Ye.clamp(e,0,1),n=Ye.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=$n(r,i,t+1/3),this.g=$n(r,i,t),this.b=$n(r,i,t-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,r=n[1],o=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,h=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(a,s,h)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l,c=(l=n[1]).length;if(3===c)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}e&&0<e.length&&(void 0!==(l=Zn[e])?this.setHex(l):console.warn("THREE.Color: Unknown color "+e));return 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=0<e?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=Qn(t.r),this.g=Qn(t.g),this.b=Qn(t.b),this},copyLinearToSRGB:function(t){return this.r=Kn(t.r),this.g=Kn(t.g),this.b=Kn(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,i=this.r,r=this.g,o=this.b,a=Math.max(i,r,o),s=Math.min(i,r,o),h=(s+a)/2;if(s===a)n=e=0;else{var l=a-s;switch(n=h<=.5?l/(a+s):l/(2-a-s),a){case i:e=(r-o)/l+(r<o?6:0);break;case r:e=(o-i)/l+2;break;case o:e=(i-r)/l+4}e/=6}return t.h=e,t.s=n,t.l=h,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(qn={},function(t,e,n){return this.getHSL(qn),qn.h+=t,qn.s+=e,qn.l+=n,this.setHSL(qn.h,qn.s,qn.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:(Hn={h:0,s:0,l:0},Wn={h:0,s:0,l:0},function(t,e){this.getHSL(Hn),t.getHSL(Wn);var n=Ye.lerp(Hn.h,Wn.h,e),i=Ye.lerp(Hn.s,Wn.s,e),r=Ye.lerp(Hn.l,Wn.l,e);return this.setHSL(n,i,r),this}),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var ti,ei,ni={common:{diffuse:{value:new Jn(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new $e},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 Ze(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 Jn(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Jn(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new $e}},sprite:{diffuse:{value:new Jn(15658734)},opacity:{value:1},center:{value:new Ze(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new $e}}},ii={basic:{uniforms:Yn.merge([ni.common,ni.specularmap,ni.envmap,ni.aomap,ni.lightmap,ni.fog]),vertexShader:Xn.meshbasic_vert,fragmentShader:Xn.meshbasic_frag},lambert:{uniforms:Yn.merge([ni.common,ni.specularmap,ni.envmap,ni.aomap,ni.lightmap,ni.emissivemap,ni.fog,ni.lights,{emissive:{value:new Jn(0)}}]),vertexShader:Xn.meshlambert_vert,fragmentShader:Xn.meshlambert_frag},phong:{uniforms:Yn.merge([ni.common,ni.specularmap,ni.envmap,ni.aomap,ni.lightmap,ni.emissivemap,ni.bumpmap,ni.normalmap,ni.displacementmap,ni.gradientmap,ni.fog,ni.lights,{emissive:{value:new Jn(0)},specular:{value:new Jn(1118481)},shininess:{value:30}}]),vertexShader:Xn.meshphong_vert,fragmentShader:Xn.meshphong_frag},standard:{uniforms:Yn.merge([ni.common,ni.envmap,ni.aomap,ni.lightmap,ni.emissivemap,ni.bumpmap,ni.normalmap,ni.displacementmap,ni.roughnessmap,ni.metalnessmap,ni.fog,ni.lights,{emissive:{value:new Jn(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Xn.meshphysical_vert,fragmentShader:Xn.meshphysical_frag},matcap:{uniforms:Yn.merge([ni.common,ni.bumpmap,ni.normalmap,ni.displacementmap,ni.fog,{matcap:{value:null}}]),vertexShader:Xn.meshmatcap_vert,fragmentShader:Xn.meshmatcap_frag},points:{uniforms:Yn.merge([ni.points,ni.fog]),vertexShader:Xn.points_vert,fragmentShader:Xn.points_frag},dashed:{uniforms:Yn.merge([ni.common,ni.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xn.linedashed_vert,fragmentShader:Xn.linedashed_frag},depth:{uniforms:Yn.merge([ni.common,ni.displacementmap]),vertexShader:Xn.depth_vert,fragmentShader:Xn.depth_frag},normal:{uniforms:Yn.merge([ni.common,ni.bumpmap,ni.normalmap,ni.displacementmap,{opacity:{value:1}}]),vertexShader:Xn.normal_vert,fragmentShader:Xn.normal_frag},sprite:{uniforms:Yn.merge([ni.sprite,ni.fog]),vertexShader:Xn.sprite_vert,fragmentShader:Xn.sprite_frag},background:{uniforms:{uvTransform:{value:new $e},t2D:{value:null}},vertexShader:Xn.background_vert,fragmentShader:Xn.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Xn.cube_vert,fragmentShader:Xn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xn.equirect_vert,fragmentShader:Xn.equirect_frag},distanceRGBA:{uniforms:Yn.merge([ni.common,ni.displacementmap,{referencePosition:{value:new Qe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xn.distanceRGBA_vert,fragmentShader:Xn.distanceRGBA_frag},shadow:{uniforms:Yn.merge([ni.lights,ni.fog,{color:{value:new Jn(0)},opacity:{value:1}}]),vertexShader:Xn.shadow_vert,fragmentShader:Xn.shadow_frag}};function ri(){var n=null,i=!1,r=null;function o(t,e){!1!==i&&(r(t,e),n.requestAnimationFrame(o))}return{start:function(){!0!==i&&null!==r&&(n.requestAnimationFrame(o),i=!0)},stop:function(){i=!1},setAnimationLoop:function(t){r=t},setContext:function(t){n=t}}}function oi(a){var i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var e=i.get(t);e&&(a.deleteBuffer(e.buffer),i.delete(t))},update:function(t,e){t.isInterleavedBufferAttribute&&(t=t.data);var n=i.get(t);void 0===n?i.set(t,function(t,e){var n=t.array,i=t.dynamic?35048:35044,r=a.createBuffer();a.bindBuffer(e,r),a.bufferData(e,n,i),t.onUploadCallback();var o=5126;return n instanceof Float32Array?o=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?o=5123:n instanceof Int16Array?o=5122:n instanceof Uint32Array?o=5125:n instanceof Int32Array?o=5124:n instanceof Int8Array?o=5120:n instanceof Uint8Array&&(o=5121),{buffer:r,type:o,bytesPerElement:n.BYTES_PER_ELEMENT,version:t.version}}(t,e)):n.version<t.version&&(function(t,e,n){var i=e.array,r=e.updateRange;a.bindBuffer(n,t),!1===e.dynamic?a.bufferData(n,i,35044):-1===r.count?a.bufferSubData(n,0,i):0===r.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(a.bufferSubData(n,r.offset*i.BYTES_PER_ELEMENT,i.subarray(r.offset,r.offset+r.count)),r.count=-1)}(n.buffer,t,e),n.version=t.version)}}}function ai(t,e,n,i,r,o){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new Qe,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new Jn,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}function si(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||si.DefaultOrder}function hi(){this.mask=1}ii.physical={uniforms:Yn.merge([ii.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Xn.meshphysical_vert,fragmentShader:Xn.meshphysical_frag},Object.assign(ai.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}}),si.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],si.DefaultOrder="XYZ",Object.defineProperties(si.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(si.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||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 i=Ye.clamp,r=t.elements,o=r[0],a=r[4],s=r[8],h=r[1],l=r[5],c=r[9],u=r[2],p=r[6],d=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-u,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(h,o))):"ZYX"===e?(this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(p,d),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-a,l))):"YZX"===e?(this._z=Math.asin(i(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===e?(this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(p,l),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-c,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:(ei=new Je,function(t,e,n){return ei.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ei,e,n)}),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(ti=new Ke,function(t){return ti.setFromEuler(this),this.setFromQuaternion(ti,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 Qe(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(hi.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!=(this.mask&t.mask)}});var li,ci,ui,pi,di,fi,mi,vi,gi,yi,xi,bi,wi,_i,Mi,Si,Ti,Ei,Ai=0;function Ci(){Object.defineProperty(this,"id",{value:Ai++}),this.uuid=Ye.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ci.DefaultUp.clone();var t=new Qe,e=new si,n=new Ke,i=new Qe(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:i},modelViewMatrix:{value:new Je},normalMatrix:{value:new $e}}),this.matrix=new Je,this.matrixWorld=new Je,this.matrixAutoUpdate=Ci.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new hi,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}Ci.DefaultUp=new Qe(0,1,0),Ci.DefaultMatrixAutoUpdate=!0,Ci.prototype=Object.assign(Object.create(n.prototype),{constructor:Ci,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),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:(Ei=new Ke,function(t,e){return Ei.setFromAxisAngle(t,e),this.quaternion.multiply(Ei),this}),rotateOnWorldAxis:(Ti=new Ke,function(t,e){return Ti.setFromAxisAngle(t,e),this.quaternion.premultiply(Ti),this}),rotateX:(Si=new Qe(1,0,0),function(t){return this.rotateOnAxis(Si,t)}),rotateY:(Mi=new Qe(0,1,0),function(t){return this.rotateOnAxis(Mi,t)}),rotateZ:(_i=new Qe(0,0,1),function(t){return this.rotateOnAxis(_i,t)}),translateOnAxis:(wi=new Qe,function(t,e){return wi.copy(t).applyQuaternion(this.quaternion),this.position.add(wi.multiplyScalar(e)),this}),translateX:(bi=new Qe(1,0,0),function(t){return this.translateOnAxis(bi,t)}),translateY:(xi=new Qe(0,1,0),function(t){return this.translateOnAxis(xi,t)}),translateZ:(yi=new Qe(0,0,1),function(t){return this.translateOnAxis(yi,t)}),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:(gi=new Je,function(t){return t.applyMatrix4(gi.getInverse(this.matrixWorld))}),lookAt:(di=new Ke,fi=new Je,mi=new Qe,vi=new Qe,function(t,e,n){t.isVector3?mi.copy(t):mi.set(t,e,n);var i=this.parent;this.updateWorldMatrix(!0,!1),vi.setFromMatrixPosition(this.matrixWorld),this.isCamera?fi.lookAt(vi,mi,this.up):fi.lookAt(mi,vi,this.up),this.quaternion.setFromRotationMatrix(fi),i&&(fi.extractRotation(i.matrixWorld),di.setFromRotationMatrix(fi),this.quaternion.premultiply(di.inverse()))}),add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},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,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new Qe),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(ui=new Qe,pi=new Qe,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new Ke),this.updateMatrixWorld(!0),this.matrixWorld.decompose(ui,t,pi),t}),getWorldScale:(li=new Qe,ci=new Ke,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new Qe),this.updateMatrixWorld(!0),this.matrixWorld.decompose(li,ci,t),t}),getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Qe),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,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,i=e.length;n<i;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),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=this.children,n=0,i=e.length;n<i;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 i=this.children,r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(n){var t=void 0===n||"string"==typeof n,e={};t&&(n={geometries:{},materials:{},textures:{},images:{},shapes:{}},e.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(t,e){return void 0===t[e.uuid]&&(t[e.uuid]=e.toJSON(n)),e.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isMesh||this.isLine||this.isPoints){i.geometry=r(n.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,h=a.length;s<h;s++){var l=a[s];r(n.shapes,l)}else r(n.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var c=[];for(s=0,h=this.material.length;s<h;s++)c.push(r(n.materials,this.material[s]));i.material=c}else i.material=r(n.materials,this.material);if(0<this.children.length){i.children=[];for(s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(n).object)}if(t){var u=m(n.geometries),p=m(n.materials),d=m(n.textures),f=m(n.images);a=m(n.shapes);0<u.length&&(e.geometries=u),0<p.length&&(e.materials=p),0<d.length&&(e.textures=d),0<f.length&&(e.images=f),0<a.length&&(e.shapes=a)}return e.object=i,e;function m(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}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 i=t.children[n];this.add(i.clone())}return this}});var Li,Pi,Ri,Oi,ki,zi,Ii,Di=0;function Bi(){Object.defineProperty(this,"id",{value:Di+=2}),this.uuid=Ye.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Ni(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.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Fi(t,e,n){Ni.call(this,new Int8Array(t),e,n)}function Ui(t,e,n){Ni.call(this,new Uint8Array(t),e,n)}function ji(t,e,n){Ni.call(this,new Uint8ClampedArray(t),e,n)}function Vi(t,e,n){Ni.call(this,new Int16Array(t),e,n)}function Gi(t,e,n){Ni.call(this,new Uint16Array(t),e,n)}function Hi(t,e,n){Ni.call(this,new Int32Array(t),e,n)}function Wi(t,e,n){Ni.call(this,new Uint32Array(t),e,n)}function qi(t,e,n){Ni.call(this,new Float32Array(t),e,n)}function Xi(t,e,n){Ni.call(this,new Float64Array(t),e,n)}function Yi(){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 Zi(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}Bi.prototype=Object.assign(Object.create(n.prototype),{constructor:Bi,isGeometry:!0,applyMatrix:function(t){for(var e=(new $e).getNormalMatrix(t),n=0,i=this.vertices.length;n<i;n++){this.vertices[n].applyMatrix4(t)}for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(e).normalize();for(var o=0,a=r.vertexNormals.length;o<a;o++)r.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:(Ii=new Je,function(t){return Ii.makeRotationX(t),this.applyMatrix(Ii),this}),rotateY:(zi=new Je,function(t){return zi.makeRotationY(t),this.applyMatrix(zi),this}),rotateZ:(ki=new Je,function(t){return ki.makeRotationZ(t),this.applyMatrix(ki),this}),translate:(Oi=new Je,function(t,e,n){return Oi.makeTranslation(t,e,n),this.applyMatrix(Oi),this}),scale:(Ri=new Je,function(t,e,n){return Ri.makeScale(t,e,n),this.applyMatrix(Ri),this}),lookAt:(Pi=new Ci,function(t){Pi.lookAt(t),Pi.updateMatrix(),this.applyMatrix(Pi.matrix)}),fromBufferGeometry:function(t){var a=this,e=null!==t.index?t.index.array:void 0,n=t.attributes,i=n.position.array,s=void 0!==n.normal?n.normal.array:void 0,h=void 0!==n.color?n.color.array:void 0,l=void 0!==n.uv?n.uv.array:void 0,c=void 0!==n.uv2?n.uv2.array:void 0;void 0!==c&&(this.faceVertexUvs[1]=[]);for(var r=0,o=0;r<i.length;r+=3,o+=2)a.vertices.push((new Qe).fromArray(i,r)),void 0!==h&&a.colors.push((new Jn).fromArray(h,r));function u(t,e,n,i){var r=void 0===h?[]:[a.colors[t].clone(),a.colors[e].clone(),a.colors[n].clone()],o=new ai(t,e,n,void 0===s?[]:[(new Qe).fromArray(s,3*t),(new Qe).fromArray(s,3*e),(new Qe).fromArray(s,3*n)],r,i);a.faces.push(o),void 0!==l&&a.faceVertexUvs[0].push([(new Ze).fromArray(l,2*t),(new Ze).fromArray(l,2*e),(new Ze).fromArray(l,2*n)]),void 0!==c&&a.faceVertexUvs[1].push([(new Ze).fromArray(c,2*t),(new Ze).fromArray(c,2*e),(new Ze).fromArray(c,2*n)])}var p=t.groups;if(0<p.length)for(r=0;r<p.length;r++)for(var d=p[r],f=d.start,m=(o=f,f+d.count);o<m;o+=3)void 0!==e?u(e[o],e[o+1],e[o+2],d.materialIndex):u(o,o+1,o+2,d.materialIndex);else if(void 0!==e)for(r=0;r<e.length;r+=3)u(e[r],e[r+1],e[r+2]);else for(r=0;r<i.length/3;r+=3)u(r,r+1,r+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:(Li=new Qe,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Li).negate(),this.translate(Li.x,Li.y,Li.z),this}),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,i=new Je;return i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var t=new Qe,e=new Qe,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],o=this.vertices[r.a],a=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,n,i,r,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 Qe;if(t){var s,h,l,c=new Qe,u=new Qe;for(i=0,r=this.faces.length;i<r;i++)o=this.faces[i],s=this.vertices[o.a],h=this.vertices[o.b],l=this.vertices[o.c],c.subVectors(l,h),u.subVectors(s,h),c.cross(u),a[o.a].add(c),a[o.b].add(c),a[o.c].add(c)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)a[(o=this.faces[i]).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(i=0,r=this.faces.length;i<r;i++){var p=(o=this.faces[i]).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())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var i=(n=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var o=new Bi;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,i=this.faces.length;n<i;n++)h=new Qe,l={a:new Qe,b:new Qe,c:new Qe},a.push(h),s.push(l)}var h,l,c=this.morphNormals[t];for(o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],h=c.faceNormals[n],l=c.vertexNormals[n],h.copy(r.normal),l.a.copy(r.vertexNormals[0]),l.b.copy(r.vertexNormals[1]),l.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Nn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new jn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var i,r=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,h=t.faces,l=this.faceVertexUvs[0],c=t.faceVertexUvs[0],u=this.colors,p=t.colors;void 0===n&&(n=0),void 0!==e&&(i=(new $e).getNormalMatrix(e));for(var d=0,f=a.length;d<f;d++){var m=a[d].clone();void 0!==e&&m.applyMatrix4(e),o.push(m)}for(d=0,f=p.length;d<f;d++)u.push(p[d].clone());for(d=0,f=h.length;d<f;d++){var v,g,y,x=h[d],b=x.vertexNormals,w=x.vertexColors;(v=new ai(x.a+r,x.b+r,x.c+r)).normal.copy(x.normal),void 0!==i&&v.normal.applyMatrix3(i).normalize();for(var _=0,M=b.length;_<M;_++)g=b[_].clone(),void 0!==i&&g.applyMatrix3(i).normalize(),v.vertexNormals.push(g);v.color.copy(x.color);for(_=0,M=w.length;_<M;_++)y=w[_],v.vertexColors.push(y.clone());v.materialIndex=x.materialIndex+n,s.push(v)}for(d=0,f=c.length;d<f;d++){var S=c[d],T=[];if(void 0!==S){for(_=0,M=S.length;_<M;_++)T.push(S[_].clone());l.push(T)}}}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,i,r,o,a,s,h={},l=[],c=[],u=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)t=this.vertices[n],void 0===h[e=Math.round(t.x*u)+"_"+Math.round(t.y*u)+"_"+Math.round(t.z*u)]?(h[e]=n,l.push(this.vertices[n]),c[n]=l.length-1):c[n]=c[h[e]];var p=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=c[r.a],r.b=c[r.b],r.c=c[r.c],o=[r.a,r.b,r.c];for(var d=0;d<3;d++)if(o[d]===o[(d+1)%3]){p.push(n);break}}for(n=p.length-1;0<=n;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-l.length;return this.vertices=l,m},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];this.vertices.push(new Qe(i.x,i.y,i.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 i,r,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===e&&(i=[]),a&&a.length===e&&(r=[]);for(n=0;n<e;n++){var s=t[n]._id;i&&i.push(o[s]),r&&r.push(a[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},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 i=[],r=0;r<this.vertices.length;r++){var o=this.vertices[r];i.push(o.x,o.y,o.z)}var a=[],s=[],h={},l=[],c={},u=[],p={};for(r=0;r<this.faces.length;r++){var d=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],m=0<d.normal.length(),v=0<d.vertexNormals.length,g=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=0<d.vertexColors.length,x=0;if(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x=M(x,0,0),1,!0),2,!1),3,f),4,m),5,v),6,g),7,y),a.push(x),a.push(d.a,d.b,d.c),a.push(d.materialIndex),f){var b=this.faceVertexUvs[0][r];a.push(E(b[0]),E(b[1]),E(b[2]))}if(m&&a.push(S(d.normal)),v){var w=d.vertexNormals;a.push(S(w[0]),S(w[1]),S(w[2]))}if(g&&a.push(T(d.color)),y){var _=d.vertexColors;a.push(T(_[0]),T(_[1]),T(_[2]))}}function M(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!==h[e]||(h[e]=s.length/3,s.push(t.x,t.y,t.z)),h[e]}function T(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==c[e]||(c[e]=l.length,l.push(t.getHex())),c[e]}function E(t){var e=t.x.toString()+t.y.toString();return void 0!==p[e]||(p[e]=u.length/2,u.push(t.x,t.y)),p[e]}return t.data={},t.data.vertices=i,t.data.normals=s,0<l.length&&(t.data.colors=l),0<u.length&&(t.data.uvs=[u]),t.data.faces=a,t},clone:function(){return(new Bi).copy(this)},copy:function(t){var e,n,i,r,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 h=t.colors;for(e=0,n=h.length;e<n;e++)this.colors.push(h[e].clone());var l=t.faces;for(e=0,n=l.length;e<n;e++)this.faces.push(l[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var c=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),i=0,r=c.length;i<r;i++){var u=c[i],p=[];for(o=0,a=u.length;o<a;o++){var d=u[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=[],i=0,r=f[e].vertices.length;i<r;i++)m.vertices.push(f[e].vertices[i].clone());if(void 0!==f[e].normals)for(m.normals=[],i=0,r=f[e].normals.length;i<r;i++)m.normals.push(f[e].normals[i].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=[],i=0,r=v[e].vertexNormals.length;i<r;i++){var y=v[e].vertexNormals[i],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=[],i=0,r=v[e].faceNormals.length;i<r;i++)g.faceNormals.push(v[e].faceNormals[i].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 w=t.skinIndices;for(e=0,n=w.length;e<n;e++)this.skinIndices.push(w[e].clone());var _=t.lineDistances;for(e=0,n=_.length;e<n;e++)this.lineDistances.push(_[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.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"})}}),Object.defineProperty(Ni.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Ni.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new Jn),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new Ze),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new Qe),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new zn),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),(Fi.prototype=Object.create(Ni.prototype)).constructor=Fi,(Ui.prototype=Object.create(Ni.prototype)).constructor=Ui,(ji.prototype=Object.create(Ni.prototype)).constructor=ji,(Vi.prototype=Object.create(Ni.prototype)).constructor=Vi,(Gi.prototype=Object.create(Ni.prototype)).constructor=Gi,(Hi.prototype=Object.create(Ni.prototype)).constructor=Hi,(Wi.prototype=Object.create(Ni.prototype)).constructor=Wi,(qi.prototype=Object.create(Ni.prototype)).constructor=qi,(Xi.prototype=Object.create(Ni.prototype)).constructor=Xi,Object.assign(Yi.prototype,{computeGroups:function(t){for(var e,n=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var a=r[o];a.materialIndex!==i&&(i=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:i})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,i=t.vertices,r=t.faceVertexUvs,o=r[0]&&0<r[0].length,a=r[1]&&0<r[1].length,s=t.morphTargets,h=s.length;if(0<h){e=[];for(var l=0;l<h;l++)e[l]={name:s[l].name,data:[]};this.morphTargets.position=e}var c,u=t.morphNormals,p=u.length;if(0<p){c=[];for(l=0;l<p;l++)c[l]={name:u[l].name,data:[]};this.morphTargets.normal=c}var d=t.skinIndices,f=t.skinWeights,m=d.length===i.length,v=f.length===i.length;0<i.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(l=0;l<n.length;l++){var g=n[l];this.vertices.push(i[g.a],i[g.b],i[g.c]);var y=g.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var x=g.normal;this.normals.push(x,x,x)}var b,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!==(b=r[0][l])?this.uvs.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new Ze,new Ze,new Ze));if(!0===a)void 0!==(b=r[1][l])?this.uvs2.push(b[0],b[1],b[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new Ze,new Ze,new Ze));for(var M=0;M<h;M++){var S=s[M].vertices;e[M].data.push(S[g.a],S[g.b],S[g.c])}for(M=0;M<p;M++){var T=u[M].vertexNormals[l];c[M].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,this}});var Ji,Ki,Qi,$i,tr,er,nr,ir,rr,or,ar=1;function sr(){Object.defineProperty(this,"id",{value:ar+=2}),this.uuid=Ye.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function hr(t,e,n,i,r,o){Bi.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new lr(t,e,n,i,r,o)),this.mergeVertices()}function lr(t,e,n,i,r,o){sr.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};var L=this;t=t||1,e=e||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;var P=[],R=[],O=[],k=[],z=0,I=0;function a(t,e,n,i,r,o,a,s,h,l,c){var u,p,d=o/h,f=a/l,m=o/2,v=a/2,g=s/2,y=h+1,x=l+1,b=0,w=0,_=new Qe;for(p=0;p<x;p++){var M=p*f-v;for(u=0;u<y;u++){var S=u*d-m;_[t]=S*i,_[e]=M*r,_[n]=g,R.push(_.x,_.y,_.z),_[t]=0,_[e]=0,_[n]=0<s?1:-1,O.push(_.x,_.y,_.z),k.push(u/h),k.push(1-p/l),b+=1}}for(p=0;p<l;p++)for(u=0;u<h;u++){var T=z+u+y*p,E=z+u+y*(p+1),A=z+(u+1)+y*(p+1),C=z+(u+1)+y*p;P.push(T,E,C),P.push(E,A,C),w+=6}L.addGroup(I,w,c),I+=w,z+=b}a("z","y","x",-1,-1,n,e,t,o,r,0),a("z","y","x",1,-1,n,e,-t,o,r,1),a("x","z","y",1,1,t,n,e,i,o,2),a("x","z","y",1,-1,t,n,-e,i,o,3),a("x","y","z",1,-1,t,e,n,i,r,4),a("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(P),this.addAttribute("position",new qi(R,3)),this.addAttribute("normal",new qi(O,3)),this.addAttribute("uv",new qi(k,2))}function cr(t,e,n,i){Bi.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new ur(t,e,n,i)),this.mergeVertices()}function ur(t,e,n,i){sr.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};var r,o,a=(t=t||1)/2,s=(e=e||1)/2,h=Math.floor(n)||1,l=Math.floor(i)||1,c=h+1,u=l+1,p=t/h,d=e/l,f=[],m=[],v=[],g=[];for(o=0;o<u;o++){var y=o*d-s;for(r=0;r<c;r++){var x=r*p-a;m.push(x,-y,0),v.push(0,0,1),g.push(r/h),g.push(1-o/l)}}for(o=0;o<l;o++)for(r=0;r<h;r++){var b=r+c*o,w=r+c*(o+1),_=r+1+c*(o+1),M=r+1+c*o;f.push(b,w,M),f.push(w,_,M)}this.setIndex(f),this.addAttribute("position",new qi(m,3)),this.addAttribute("normal",new qi(v,3)),this.addAttribute("uv",new qi(g,2))}sr.prototype=Object.assign(Object.create(n.prototype),{constructor:sr,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<Zi(t)?Wi:Gi)(t,1):this.index=t},addAttribute:function(t,e,n){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?("index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e)):this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new Ni(e,n)))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new $e).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:(or=new Je,function(t){return or.makeRotationX(t),this.applyMatrix(or),this}),rotateY:(rr=new Je,function(t){return rr.makeRotationY(t),this.applyMatrix(rr),this}),rotateZ:(ir=new Je,function(t){return ir.makeRotationZ(t),this.applyMatrix(ir),this}),translate:(nr=new Je,function(t,e,n){return nr.makeTranslation(t,e,n),this.applyMatrix(nr),this}),scale:(er=new Je,function(t,e,n){return er.makeScale(t,e,n),this.applyMatrix(er),this}),lookAt:(tr=new Ci,function(t){tr.lookAt(t),tr.updateMatrix(),this.applyMatrix(tr.matrix)}),center:($i=new Qe,function(){return this.computeBoundingBox(),this.boundingBox.getCenter($i).negate(),this.translate($i.x,$i.y,$i.z),this}),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new qi(3*e.vertices.length,3),i=new qi(3*e.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(e.vertices)),this.addAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new qi(e.lineDistances.length,1);this.addAttribute("lineDistance",r.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,i=t.length;n<i;n++){var r=t[n];e.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new qi(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}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 Yi).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new Ni(e,3).copyVector3sArray(t.vertices)),0<t.normals.length){var n=new Float32Array(3*t.normals.length);this.addAttribute("normal",new Ni(n,3).copyVector3sArray(t.normals))}if(0<t.colors.length){var i=new Float32Array(3*t.colors.length);this.addAttribute("color",new Ni(i,3).copyColorsArray(t.colors))}if(0<t.uvs.length){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new Ni(r,2).copyVector2sArray(t.uvs))}if(0<t.uvs2.length){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new Ni(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],h=t.morphTargets[a],l=0,c=h.length;l<c;l++){var u=h[l],p=new qi(3*u.data.length,3);p.name=u.name,s.push(p.copyVector3sArray(u.data))}this.morphAttributes[a]=s}if(0<t.skinIndices.length){var d=new qi(4*t.skinIndices.length,4);this.addAttribute("skinIndex",d.copyVector4sArray(t.skinIndices))}if(0<t.skinWeights.length){var f=new qi(4*t.skinWeights.length,4);this.addAttribute("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 Nn);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):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:(Ki=new Nn,Qi=new Qe,function(){null===this.boundingSphere&&(this.boundingSphere=new jn);var t=this.attributes.position;if(t){var e=this.boundingSphere.center;Ki.setFromBufferAttribute(t),Ki.getCenter(e);for(var n=0,i=0,r=t.count;i<r;i++)Qi.x=t.getX(i),Qi.y=t.getY(i),Qi.z=t.getZ(i),n=Math.max(n,e.distanceToSquared(Qi));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}),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.addAttribute("normal",new Ni(new Float32Array(n.length),3));else for(var i=e.normal.array,r=0,o=i.length;r<o;r++)i[r]=0;var a,s,h,l=e.normal.array,c=new Qe,u=new Qe,p=new Qe,d=new Qe,f=new Qe;if(t){var m=t.array;for(r=0,o=t.count;r<o;r+=3)a=3*m[r+0],s=3*m[r+1],h=3*m[r+2],c.fromArray(n,a),u.fromArray(n,s),p.fromArray(n,h),d.subVectors(p,u),f.subVectors(c,u),d.cross(f),l[a]+=d.x,l[1+a]+=d.y,l[2+a]+=d.z,l[s]+=d.x,l[1+s]+=d.y,l[2+s]+=d.z,l[h]+=d.x,l[1+h]+=d.y,l[2+h]+=d.z}else for(r=0,o=n.length;r<o;r+=9)c.fromArray(n,r),u.fromArray(n,r+3),p.fromArray(n,r+6),d.subVectors(p,u),f.subVectors(c,u),d.cross(f),l[r]=d.x,l[r+1]=d.y,l[r+2]=d.z,l[r+3]=d.x,l[r+4]=d.y,l[r+5]=d.z,l[r+6]=d.x,l[r+7]=d.y,l[r+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 i in n)if(void 0!==t.attributes[i])for(var r=n[i].array,o=t.attributes[i],a=o.array,s=0,h=o.itemSize*e;s<a.length;s++,h++)r[h]=a[s];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:(Ji=new Qe,function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)Ji.x=t.getX(e),Ji.y=t.getY(e),Ji.z=t.getZ(e),Ji.normalize(),t.setXYZ(e,Ji.x,Ji.y,Ji.z)}),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new sr,e=this.index.array,n=this.attributes;for(var i in n){for(var r=n[i],o=r.array,a=r.itemSize,s=new o.constructor(e.length*a),h=0,l=0,c=0,u=e.length;c<u;c++){h=e[c]*a;for(var p=0;p<a;p++)s[l++]=o[h++]}t.addAttribute(i,new Ni(s,a))}var d=this.groups;for(c=0,u=d.length;c<u;c++){var f=d[c];t.addGroup(f.start,f.count,f.materialIndex)}return t},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),0<Object.keys(this.userData).length&&(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 i=this.index;if(null!==i){var r=Array.prototype.slice.call(i.array);t.data.index={type:i.array.constructor.name,array:r}}var o=this.attributes;for(var n in o){var a=o[n];r=Array.prototype.slice.call(a.array);t.data.attributes[n]={itemSize:a.itemSize,type:a.array.constructor.name,array:r,normalized:a.normalized}}var s=this.groups;0<s.length&&(t.data.groups=JSON.parse(JSON.stringify(s)));var h=this.boundingSphere;return null!==h&&(t.data.boundingSphere={center:h.center.toArray(),radius:h.radius}),t},clone:function(){return(new sr).copy(this)},copy:function(t){var e,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var o=t.attributes;for(e in o){var a=o[e];this.addAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var h=[],l=s[e];for(n=0,i=l.length;n<i;n++)h.push(l[n].clone());this.morphAttributes[e]=h}var c=t.groups;for(n=0,i=c.length;n<i;n++){var u=c[n];this.addGroup(u.start,u.count,u.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"})}}),(hr.prototype=Object.create(Bi.prototype)).constructor=hr,(lr.prototype=Object.create(sr.prototype)).constructor=lr,(cr.prototype=Object.create(Bi.prototype)).constructor=cr,(ur.prototype=Object.create(sr.prototype)).constructor=ur;var pr,dr,fr,mr,vr,gr,yr,xr,br,wr,_r,Mr,Sr,Tr,Er,Ar,Cr,Lr,Pr,Rr,Or,kr,zr,Ir,Dr,Br,Nr,Fr,Ur,jr,Vr,Gr,Hr,Wr,qr,Xr,Yr,Zr,Jr,Kr=0;function Qr(){Object.defineProperty(this,"id",{value:Kr++}),this.uuid=Ye.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=J,this.side=D,this.flatShading=!1,this.vertexColors=C,this.opacity=1,this.transparent=!1,this.blendSrc=U,this.blendDst=j,this.blendEquation=et,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=at,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.userData={},this.needsUpdate=!0}function $r(t){Qr.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 to(t,e){this.origin=void 0!==t?t:new Qe,this.direction=void 0!==e?e:new Qe}function eo(t,e,n){this.a=void 0!==t?t:new Qe,this.b=void 0!==e?e:new Qe,this.c=void 0!==n?n:new Qe}function no(t){Qr.call(this),this.type="MeshBasicMaterial",this.color=new Jn(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=ut,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function io(t,e){Ci.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new sr,this.material=void 0!==e?e:new no({color:16777215*Math.random()}),this.drawMode=ze,this.updateMorphTargets()}function ro(t,e,n,i,r,o,a,s){if(null===(e.side===St?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,e.side!==Tt,s)))return null;Jr.copy(s),Jr.applyMatrix4(t.matrixWorld);var h=n.ray.origin.distanceTo(Jr);return h<n.near||h>n.far?null:{distance:h,point:Jr.clone(),object:t}}function oo(t,e,n,i,r,o,a,s,h){Ur.fromBufferAttribute(r,a),jr.fromBufferAttribute(r,s),Vr.fromBufferAttribute(r,h);var l=ro(t,e,n,i,Ur,jr,Vr,Zr);if(l){o&&(qr.fromBufferAttribute(o,a),Xr.fromBufferAttribute(o,s),Yr.fromBufferAttribute(o,h),l.uv=eo.getUV(Zr,Ur,jr,Vr,qr,Xr,Yr,new Ze));var c=new ai(a,s,h);eo.getNormal(Ur,jr,Vr,c.normal),l.face=c}return l}function ao(o,n,a,i){var s,h,l=new Jn(0),c=0;function u(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,i)}return{getClearColor:function(){return l},setClearColor:function(t,e){l.set(t),u(l,c=void 0!==e?e:1)},getClearAlpha:function(){return c},setClearAlpha:function(t){u(l,c=t)},render:function(t,e,n,i){var r=e.background;null===r?u(l,c):r&&r.isColor&&(u(r,1),i=!0),(o.autoClear||i)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),r&&(r.isCubeTexture||r.isWebGLRenderTargetCube)?(void 0===h&&((h=new io(new lr(1,1,1),new $r({type:"BackgroundCubeMaterial",uniforms:Yn.clone(ii.cube.uniforms),vertexShader:ii.cube.vertexShader,fragmentShader:ii.cube.fragmentShader,side:St,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),h.geometry.removeAttribute("uv"),h.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.tCube.value}}),a.update(h)),h.material.uniforms.tCube.value=r.isWebGLRenderTargetCube?r.texture:r,h.material.uniforms.tFlip.value=r.isWebGLRenderTargetCube?1:-1,t.push(h,h.geometry,h.material,0,null)):r&&r.isTexture&&(void 0===s&&((s=new io(new ur(2,2),new $r({type:"BackgroundMaterial",uniforms:Yn.clone(ii.background.uniforms),vertexShader:ii.background.vertexShader,fragmentShader:ii.background.fragmentShader,side:D,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(s)),!0===(s.material.uniforms.t2D.value=r).matrixAutoUpdate&&r.updateMatrix(),s.material.uniforms.uvTransform.value.copy(r.matrix),t.push(s,s.geometry,s.material,0,null))}}}function so(r,o,a,s){var h;this.setMode=function(t){h=t},this.render=function(t,e){r.drawArrays(h,t,e),a.update(e,h)},this.renderInstances=function(t,e,n){var i;if(s.isWebGL2)i=r;else if(null===(i=o.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");i[s.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](h,e,n,t.maxInstancedCount),a.update(n,h,t.maxInstancedCount)}}function ho(e,n,t){var i;function r(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(35633,36338).precision&&0<e.getShaderPrecisionFormat(35632,36338).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(35633,36337).precision&&0<e.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,a=void 0!==t.precision?t.precision:"highp",s=r(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var h=!0===t.logarithmicDepthBuffer,l=e.getParameter(34930),c=e.getParameter(35660),u=e.getParameter(3379),p=e.getParameter(34076),d=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),v=e.getParameter(36349),g=0<c,y=o||!!n.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==i)return i;var t=n.get("EXT_texture_filter_anisotropic");return i=null!==t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:h,maxTextures:l,maxVertexTextures:c,maxTextureSize:u,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y}}function lo(){var c=this,u=null,p=0,d=!1,f=!1,m=new Vn,v=new $e,g={value:null,needsUpdate:!1};function y(){g.value!==u&&(g.value=u,g.needsUpdate=0<p),c.numPlanes=p,c.numIntersection=0}function x(t,e,n,i){var r=null!==t?t.length:0,o=null;if(0!==r){if(o=g.value,!0!==i||null===o){var a=n+4*r,s=e.matrixWorldInverse;v.getNormalMatrix(s),(null===o||o.length<a)&&(o=new Float32Array(a));for(var h=0,l=n;h!==r;++h,l+=4)m.copy(t[h]).applyMatrix4(s,v),m.normal.toArray(o,l),o[l+3]=m.constant}g.value=o,g.needsUpdate=!0}return c.numPlanes=r,o}this.uniform=g,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,n){var i=0!==t.length||e||0!==p||d;return d=e,u=x(t,n,0),p=t.length,i},this.beginShadows=function(){f=!0,x(null)},this.endShadows=function(){f=!1,y()},this.setState=function(t,e,n,i,r,o){if(!d||null===t||0===t.length||f&&!n)f?x(null):y();else{var a=f?0:p,s=4*a,h=r.clippingState||null;g.value=h,h=x(t,i,s,o);for(var l=0;l!==s;++l)h[l]=u[l];r.clippingState=h,this.numIntersection=e?this.numPlanes:0,this.numPlanes+=a}}}function co(n){var i={};return{get:function(t){if(void 0!==i[t])return i[t];var e;switch(t){case"WEBGL_depth_texture":e=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":e=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":e=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":e=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:e=n.getExtension(t)}return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),i[t]=e}}}function uo(t,u,o){var a={},p={};function s(t){var e=t.target,n=a[e.id];for(var i in null!==n.index&&u.remove(n.index),n.attributes)u.remove(n.attributes[i]);e.removeEventListener("dispose",s),delete a[e.id];var r=p[n.id];r&&(u.remove(r),delete p[n.id]),o.memory.geometries--}return{get:function(t,e){var n=a[e.id];return n||(e.addEventListener("dispose",s),e.isBufferGeometry?n=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new sr).setFromObject(t)),n=e._bufferGeometry),a[e.id]=n,o.memory.geometries++,n)},update:function(t){var e=t.index,n=t.attributes;for(var i in null!==e&&u.update(e,34963),n)u.update(n[i],34962);var r=t.morphAttributes;for(var i in r)for(var o=r[i],a=0,s=o.length;a<s;a++)u.update(o[a],34962)},getWireframeAttribute:function(t){var e=p[t.id];if(e)return e;var n,i=[],r=t.index,o=t.attributes;if(null!==r)for(var a=0,s=(n=r.array).length;a<s;a+=3){var h=n[a+0],l=n[a+1],c=n[a+2];i.push(h,l,l,c,c,h)}else for(a=0,s=(n=o.position.array).length/3-1;a<s;a+=3){h=a+0,l=a+1,c=a+2;i.push(h,l,l,c,c,h)}return e=new(65535<Zi(i)?Wi:Gi)(i,1),u.update(e,34963),p[t.id]=e}}}function po(r,o,a,s){var h,l,c;this.setMode=function(t){h=t},this.setIndex=function(t){l=t.type,c=t.bytesPerElement},this.render=function(t,e){r.drawElements(h,e,l,t*c),a.update(e,h)},this.renderInstances=function(t,e,n){var i;if(s.isWebGL2)i=r;else if(null===(i=o.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");i[s.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](h,n,l,e*c,t.maxInstancedCount),a.update(n,h,t.maxInstancedCount)}}function fo(t){var i={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:i,programs:null,autoReset:!0,reset:function(){i.frame++,i.calls=0,i.triangles=0,i.points=0,i.lines=0},update:function(t,e,n){switch(n=n||1,i.calls++,e){case 4:i.triangles+=n*(t/3);break;case 5:case 6:i.triangles+=n*(t-2);break;case 1:i.lines+=n*(t/2);break;case 3:i.lines+=n*(t-1);break;case 2:i.lines+=n*t;break;case 0:i.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e)}}}}function mo(t,e){return Math.abs(e[1])-Math.abs(t[1])}function vo(d){var f={},m=new Float32Array(8);return{update:function(t,e,n,i){var r=t.morphTargetInfluences,o=r.length,a=f[e.id];if(void 0===a){a=[];for(var s=0;s<o;s++)a[s]=[s,0];f[e.id]=a}var h=n.morphTargets&&e.morphAttributes.position,l=n.morphNormals&&e.morphAttributes.normal;for(s=0;s<o;s++){0!==(c=a[s])[1]&&(h&&e.removeAttribute("morphTarget"+s),l&&e.removeAttribute("morphNormal"+s))}for(s=0;s<o;s++){(c=a[s])[0]=s,c[1]=r[s]}for(a.sort(mo),s=0;s<8;s++){var c;if(c=a[s]){var u=c[0],p=c[1];if(p){h&&e.addAttribute("morphTarget"+s,h[u]),l&&e.addAttribute("morphNormal"+s,l[u]),m[s]=p;continue}}m[s]=0}i.getUniforms().setValue(d,"morphTargetInfluences",m)}}}function go(r,o){var a={};return{update:function(t){var e=o.render.frame,n=t.geometry,i=r.get(t,n);return a[i.id]!==e&&(n.isGeometry&&i.updateFromObject(t),r.update(i),a[i.id]=e),i},dispose:function(){a={}}}}function yo(t,e,n,i,r,o,a,s,h,l){kn.call(this,t=void 0!==t?t:[],e=void 0!==e?e:yt,n,i,r,o,a,s,h,l),this.flipY=!1}function xo(t,e,n,i){kn.call(this,null),this.image={data:t,width:e,height:n,depth:i},this.magFilter=kt,this.minFilter=kt,this.generateMipmaps=!1,this.flipY=!1}Qr.prototype=Object.assign(Object.create(n.prototype),{constructor:Qr,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 i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.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 i(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}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.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),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.map&&this.map.isTexture&&(n.map=this.map.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,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),this.blending!==J&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==D&&(n.side=this.side),this.vertexColors!==C&&(n.vertexColors=this.vertexColors),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,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),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),0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(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.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var r=i(t.textures),o=i(t.images);0<r.length&&(n.textures=r),0<o.length&&(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.lights=t.lights,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.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.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),(($r.prototype=Object.create(Qr.prototype)).constructor=$r).prototype.isShaderMaterial=!0,$r.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Yn.clone(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},$r.prototype.toJSON=function(t){var e=Qr.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var i=this.uniforms[n].value;i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}return 0<Object.keys(this.defines).length&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},Object.assign(to.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 Qe),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:(_r=new Qe,function(t){return this.origin.copy(this.at(t,_r)),this}),closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Qe),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:(wr=new Qe,function(t){var e=wr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(wr.copy(this.direction).multiplyScalar(e).add(this.origin),wr.distanceToSquared(t))}),distanceSqToSegment:(yr=new Qe,xr=new Qe,br=new Qe,function(t,e,n,i){yr.copy(t).add(e).multiplyScalar(.5),xr.copy(e).sub(t).normalize(),br.copy(this.origin).sub(yr);var r,o,a,s,h=.5*t.distanceTo(e),l=-this.direction.dot(xr),c=br.dot(this.direction),u=-br.dot(xr),p=br.lengthSq(),d=Math.abs(1-l*l);if(0<d)if(o=l*c-u,s=h*d,0<=(r=l*u-c))if(-s<=o)if(o<=s){var f=1/d;a=(r*=f)*(r+l*(o*=f)+2*c)+o*(l*r+o+2*u)+p}else o=h,a=-(r=Math.max(0,-(l*o+c)))*r+o*(o+2*u)+p;else o=-h,a=-(r=Math.max(0,-(l*o+c)))*r+o*(o+2*u)+p;else a=o<=-s?-(r=Math.max(0,-(-l*h+c)))*r+(o=0<r?-h:Math.min(Math.max(-h,-u),h))*(o+2*u)+p:o<=s?(r=0,(o=Math.min(Math.max(-h,-u),h))*(o+2*u)+p):-(r=Math.max(0,-(l*h+c)))*r+(o=0<r?h:Math.min(Math.max(-h,-u),h))*(o+2*u)+p;else o=0<l?-h:h,a=-(r=Math.max(0,-(l*o+c)))*r+o*(o+2*u)+p;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(xr).multiplyScalar(o).add(yr),a}),intersectSphere:(gr=new Qe,function(t,e){gr.subVectors(t.center,this.origin);var n=gr.dot(this.direction),i=gr.dot(gr)-n*n,r=t.radius*t.radius;if(r<i)return null;var o=Math.sqrt(r-i),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)}),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return 0<=n?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,i,r,o,a,s,h=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,u=this.origin;return i=0<=h?(n=(t.min.x-u.x)*h,(t.max.x-u.x)*h):(n=(t.max.x-u.x)*h,(t.min.x-u.x)*h),(o=0<=l?(r=(t.min.y-u.y)*l,(t.max.y-u.y)*l):(r=(t.max.y-u.y)*l,(t.min.y-u.y)*l))<n||i<r?null:((n<r||n!=n)&&(n=r),(o<i||i!=i)&&(i=o),(s=0<=c?(a=(t.min.z-u.z)*c,(t.max.z-u.z)*c):(a=(t.max.z-u.z)*c,(t.min.z-u.z)*c))<n||i<a?null:((n<a||n!=n)&&(n=a),(s<i||i!=i)&&(i=s),i<0?null:this.at(0<=n?n:i,e)))},intersectsBox:(vr=new Qe,function(t){return null!==this.intersectBox(t,vr)}),intersectTriangle:(pr=new Qe,dr=new Qe,fr=new Qe,mr=new Qe,function(t,e,n,i,r){dr.subVectors(e,t),fr.subVectors(n,t),mr.crossVectors(dr,fr);var o,a=this.direction.dot(mr);if(0<a){if(i)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}pr.subVectors(this.origin,t);var s=o*this.direction.dot(fr.crossVectors(pr,fr));if(s<0)return null;var h=o*this.direction.dot(dr.cross(pr));if(h<0)return null;if(a<s+h)return null;var l=-o*pr.dot(mr);return l<0?null:this.at(l/a,r)}),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(eo,{getNormal:(Cr=new Qe,function(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Qe),i.subVectors(n,e),Cr.subVectors(t,e),i.cross(Cr);var r=i.lengthSq();return 0<r?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}),getBarycoord:(Tr=new Qe,Er=new Qe,Ar=new Qe,function(t,e,n,i,r){Tr.subVectors(i,e),Er.subVectors(n,e),Ar.subVectors(t,e);var o=Tr.dot(Tr),a=Tr.dot(Er),s=Tr.dot(Ar),h=Er.dot(Er),l=Er.dot(Ar),c=o*h-a*a;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Qe),0==c)return r.set(-2,-1,-1);var u=1/c,p=(h*s-a*l)*u,d=(o*l-a*s)*u;return r.set(1-p-d,d,p)}),containsPoint:(Sr=new Qe,function(t,e,n,i){return eo.getBarycoord(t,e,n,i,Sr),0<=Sr.x&&0<=Sr.y&&Sr.x+Sr.y<=1}),getUV:(Mr=new Qe,function(t,e,n,i,r,o,a,s){return this.getBarycoord(t,e,n,i,Mr),s.set(0,0),s.addScaledVector(r,Mr.x),s.addScaledVector(o,Mr.y),s.addScaledVector(a,Mr.z),s})}),Object.assign(eo.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,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),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:(Ir=new Qe,Dr=new Qe,function(){return Ir.subVectors(this.c,this.b),Dr.subVectors(this.a,this.b),.5*Ir.cross(Dr).length()}),getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Qe),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return eo.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 Qe),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return eo.getBarycoord(t,this.a,this.b,this.c,e)},containsPoint:function(t){return eo.containsPoint(t,this.a,this.b,this.c)},getUV:function(t,e,n,i,r){return eo.getUV(t,this.a,this.b,this.c,e,n,i,r)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:(Lr=new Qe,Pr=new Qe,Rr=new Qe,Or=new Qe,kr=new Qe,zr=new Qe,function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new Qe);var n,i,r=this.a,o=this.b,a=this.c;Lr.subVectors(o,r),Pr.subVectors(a,r),Or.subVectors(t,r);var s=Lr.dot(Or),h=Pr.dot(Or);if(s<=0&&h<=0)return e.copy(r);kr.subVectors(t,o);var l=Lr.dot(kr),c=Pr.dot(kr);if(0<=l&&c<=l)return e.copy(o);var u=s*c-l*h;if(u<=0&&0<=s&&l<=0)return n=s/(s-l),e.copy(r).addScaledVector(Lr,n);zr.subVectors(t,a);var p=Lr.dot(zr),d=Pr.dot(zr);if(0<=d&&p<=d)return e.copy(a);var f=p*h-s*d;if(f<=0&&0<=h&&d<=0)return i=h/(h-d),e.copy(r).addScaledVector(Pr,i);var m=l*d-p*c;if(m<=0&&0<=c-l&&0<=p-d)return Rr.subVectors(a,o),i=(c-l)/(c-l+(p-d)),e.copy(o).addScaledVector(Rr,i);var v=1/(m+f+u);return n=f*v,i=u*v,e.copy(r).addScaledVector(Lr,n).addScaledVector(Pr,i)}),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((no.prototype=Object.create(Qr.prototype)).constructor=no).prototype.isMeshBasicMaterial=!0,no.prototype.copy=function(t){return Qr.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},io.prototype=Object.assign(Object.create(Ci.prototype),{constructor:io,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return Ci.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var a=r[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=i.morphTargets;if(void 0!==s&&0<s.length)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=s.length;t<e;t++)n=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}},raycast:(Br=new Je,Nr=new to,Fr=new jn,Ur=new Qe,jr=new Qe,Vr=new Qe,Gr=new Qe,Hr=new Qe,Wr=new Qe,qr=new Ze,Xr=new Ze,Yr=new Ze,Zr=new Qe,Jr=new Qe,function(t,e){var n,i=this.geometry,r=this.material,o=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),Fr.copy(i.boundingSphere),Fr.applyMatrix4(o),!1!==t.ray.intersectsSphere(Fr)&&(Br.getInverse(o),Nr.copy(t.ray).applyMatrix4(Br),null===i.boundingBox||!1!==Nr.intersectsBox(i.boundingBox))))if(i.isBufferGeometry){var a,s,h,l,c,u,p,d,f,m=i.index,v=i.attributes.position,g=i.attributes.uv,y=i.groups,x=i.drawRange;if(null!==m)if(Array.isArray(r))for(l=0,u=y.length;l<u;l++)for(f=r[(d=y[l]).materialIndex],c=Math.max(d.start,x.start),p=Math.min(d.start+d.count,x.start+x.count);c<p;c+=3)a=m.getX(c),s=m.getX(c+1),h=m.getX(c+2),(n=oo(this,f,t,Nr,v,g,a,s,h))&&(n.faceIndex=Math.floor(c/3),e.push(n));else for(l=Math.max(0,x.start),u=Math.min(m.count,x.start+x.count);l<u;l+=3)a=m.getX(l),s=m.getX(l+1),h=m.getX(l+2),(n=oo(this,r,t,Nr,v,g,a,s,h))&&(n.faceIndex=Math.floor(l/3),e.push(n));else if(void 0!==v)if(Array.isArray(r))for(l=0,u=y.length;l<u;l++)for(f=r[(d=y[l]).materialIndex],c=Math.max(d.start,x.start),p=Math.min(d.start+d.count,x.start+x.count);c<p;c+=3)(n=oo(this,f,t,Nr,v,g,a=c,s=c+1,h=c+2))&&(n.faceIndex=Math.floor(c/3),e.push(n));else for(l=Math.max(0,x.start),u=Math.min(v.count,x.start+x.count);l<u;l+=3)(n=oo(this,r,t,Nr,v,g,a=l,s=l+1,h=l+2))&&(n.faceIndex=Math.floor(l/3),e.push(n))}else if(i.isGeometry){var b,w,_,M,S=Array.isArray(r),T=i.vertices,E=i.faces,A=i.faceVertexUvs[0];0<A.length&&(M=A);for(var C=0,L=E.length;C<L;C++){var P=E[C],R=S?r[P.materialIndex]:r;if(void 0!==R){if(b=T[P.a],w=T[P.b],_=T[P.c],!0===R.morphTargets){var O=i.morphTargets,k=this.morphTargetInfluences;Ur.set(0,0,0),jr.set(0,0,0),Vr.set(0,0,0);for(var z=0,I=O.length;z<I;z++){var D=k[z];if(0!==D){var B=O[z].vertices;Ur.addScaledVector(Gr.subVectors(B[P.a],b),D),jr.addScaledVector(Hr.subVectors(B[P.b],w),D),Vr.addScaledVector(Wr.subVectors(B[P.c],_),D)}}Ur.add(b),jr.add(w),Vr.add(_),b=Ur,w=jr,_=Vr}if(n=ro(this,R,t,Nr,b,w,_,Zr)){if(M&&M[C]){var N=M[C];qr.copy(N[0]),Xr.copy(N[1]),Yr.copy(N[2]),n.uv=eo.getUV(Zr,b,w,_,qr,Xr,Yr,new Ze)}n.face=P,n.faceIndex=C,e.push(n)}}}}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),((yo.prototype=Object.create(kn.prototype)).constructor=yo).prototype.isCubeTexture=!0,Object.defineProperty(yo.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((xo.prototype=Object.create(kn.prototype)).constructor=xo).prototype.isDataTexture3D=!0;var bo=new kn,wo=new xo,_o=new yo;function Mo(){this.seq=[],this.map={}}var So=[],To=[],Eo=new Float32Array(16),Ao=new Float32Array(9),Co=new Float32Array(4);function Lo(t,e,n){var i=t[0];if(i<=0||0<i)return t;var r=e*n,o=So[r];if(void 0===o&&(o=new Float32Array(r),So[r]=o),0!==e){i.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Po(t,e){if(t.length!==e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Ro(t,e){for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}function Oo(t,e){var n=To[e];void 0===n&&(n=new Int32Array(e),To[e]=n);for(var i=0;i!==e;++i)n[i]=t.allocTextureUnit();return n}function ko(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function zo(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Io(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(Po(n,e))return;t.uniform2fv(this.addr,e),Ro(n,e)}}function Do(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(Po(n,e))return;t.uniform3fv(this.addr,e),Ro(n,e)}}function Bo(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(Po(n,e))return;t.uniform4fv(this.addr,e),Ro(n,e)}}function No(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(Po(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ro(n,e)}else{if(Po(n,i))return;Co.set(i),t.uniformMatrix2fv(this.addr,!1,Co),Ro(n,i)}}function Fo(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(Po(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ro(n,e)}else{if(Po(n,i))return;Ao.set(i),t.uniformMatrix3fv(this.addr,!1,Ao),Ro(n,i)}}function Uo(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(Po(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ro(n,e)}else{if(Po(n,i))return;Eo.set(i),t.uniformMatrix4fv(this.addr,!1,Eo),Ro(n,i)}}function jo(t,e,n){var i=this.cache,r=n.allocTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2D(e||bo,r)}function Vo(t,e,n){var i=this.cache,r=n.allocTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||wo,r)}function Go(t,e,n){var i=this.cache,r=n.allocTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTextureCube(e||_o,r)}function Ho(t,e){var n=this.cache;Po(n,e)||(t.uniform2iv(this.addr,e),Ro(n,e))}function Wo(t,e){var n=this.cache;Po(n,e)||(t.uniform3iv(this.addr,e),Ro(n,e))}function qo(t,e){var n=this.cache;Po(n,e)||(t.uniform4iv(this.addr,e),Ro(n,e))}function Xo(t,e){var n=this.cache;Po(n,e)||(t.uniform1fv(this.addr,e),Ro(n,e))}function Yo(t,e){var n=this.cache;Po(n,e)||(t.uniform1iv(this.addr,e),Ro(n,e))}function Zo(t,e){var n=this.cache,i=Lo(e,this.size,2);Po(n,i)||(t.uniform2fv(this.addr,i),this.updateCache(i))}function Jo(t,e){var n=this.cache,i=Lo(e,this.size,3);Po(n,i)||(t.uniform3fv(this.addr,i),this.updateCache(i))}function Ko(t,e){var n=this.cache,i=Lo(e,this.size,4);Po(n,i)||(t.uniform4fv(this.addr,i),this.updateCache(i))}function Qo(t,e){var n=this.cache,i=Lo(e,this.size,4);Po(n,i)||(t.uniformMatrix2fv(this.addr,!1,i),this.updateCache(i))}function $o(t,e){var n=this.cache,i=Lo(e,this.size,9);Po(n,i)||(t.uniformMatrix3fv(this.addr,!1,i),this.updateCache(i))}function ta(t,e){var n=this.cache,i=Lo(e,this.size,16);Po(n,i)||(t.uniformMatrix4fv(this.addr,!1,i),this.updateCache(i))}function na(t,e,n){var i=this.cache,r=e.length,o=Oo(n,r);!1===Po(i,o)&&(t.uniform1iv(this.addr,o),Ro(i,o));for(var a=0;a!==r;++a)n.setTexture2D(e[a]||bo,o[a])}function ia(t,e,n){var i=this.cache,r=e.length,o=Oo(n,r);!1===Po(i,o)&&(t.uniform1iv(this.addr,o),Ro(i,o));for(var a=0;a!==r;++a)n.setTextureCube(e[a]||_o,o[a])}function ra(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return ko;case 35664:return Io;case 35665:return Do;case 35666:return Bo;case 35674:return No;case 35675:return Fo;case 35676:return Uo;case 35678:case 36198:return jo;case 35679:return Vo;case 35680:return Go;case 5124:case 35670:return zo;case 35667:case 35671:return Ho;case 35668:case 35672:return Wo;case 35669:case 35673:return qo}}(e.type)}function oa(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Xo;case 35664:return Zo;case 35665:return Jo;case 35666:return Ko;case 35674:return Qo;case 35675:return $o;case 35676:return ta;case 35678:return na;case 35680:return ia;case 5124:case 35670:return Yo;case 35667:case 35671:return Ho;case 35668:case 35672:return Wo;case 35669:case 35673:return qo}}(e.type)}function aa(t){this.id=t,Mo.call(this)}oa.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Ro(e,t)},aa.prototype.setValue=function(t,e,n){for(var i=this.seq,r=0,o=i.length;r!==o;++r){var a=i[r];a.setValue(t,e[a.id],n)}};var sa=/([\w\d_]+)(\])?(\[|\.)?/g;function ha(t,e){t.seq.push(e),t.map[e.id]=e}function la(t,e,n){var i=t.name,r=i.length;for(sa.lastIndex=0;;){var o=sa.exec(i),a=sa.lastIndex,s=o[1],h="]"===o[2],l=o[3];if(h&&(s|=0),void 0===l||"["===l&&a+2===r){ha(n,void 0===l?new ra(s,t,e):new oa(s,t,e));break}var c=n.map[s];void 0===c&&ha(n,c=new aa(s)),n=c}}function ca(t,e,n){Mo.call(this),this.renderer=n;for(var i=t.getProgramParameter(e,35718),r=0;r<i;++r){var o=t.getActiveUniform(e,r);la(o,t.getUniformLocation(e,o.name),this)}}function ua(t,e,n){var i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),!1===t.getShaderParameter(i,35713)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(i)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",35633===e?"vertex":"fragment",t.getShaderInfoLog(i),function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(n)),i}ca.prototype.setValue=function(t,e,n){var i=this.map[e];void 0!==i&&i.setValue(t,n,this.renderer)},ca.prototype.setOptional=function(t,e,n){var i=e[n];void 0!==i&&this.setValue(t,n,i)},ca.upload=function(t,e,n,i){for(var r=0,o=e.length;r!==o;++r){var a=e[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,i)}},ca.seqWithValue=function(t,e){for(var n=[],i=0,r=t.length;i!==r;++i){var o=t[i];o.id in e&&n.push(o)}return n};var pa=0;function da(t){switch(t){case Be:return["Linear","( value )"];case Ne:return["sRGB","( value )"];case Ue:return["RGBE","( value )"];case je:return["RGBM","( value, 7.0 )"];case Ve:return["RGBM","( value, 16.0 )"];case Ge:return["RGBD","( value, 256.0 )"];case Fe:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function fa(t,e){var n=da(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function ma(t){return""!==t}function va(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function ga(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function ya(t){return t.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,function(t,e){var n=Xn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return ya(n)})}function xa(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,n,i){for(var r="",o=parseInt(e);o<parseInt(n);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]");return r})}function ba(t,e,n,i,r,o,a){var s=t.context,h=i.defines,l=r.vertexShader,c=r.fragmentShader,u="SHADOWMAP_TYPE_BASIC";o.shadowMapType===I?u="SHADOWMAP_TYPE_PCF":o.shadowMapType===k&&(u="SHADOWMAP_TYPE_PCF_SOFT");var p="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(i.envMap.mapping){case yt:case xt:p="ENVMAP_TYPE_CUBE";break;case Ct:case Lt:p="ENVMAP_TYPE_CUBE_UV";break;case bt:case wt:p="ENVMAP_TYPE_EQUIREC";break;case At:p="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case xt:case wt:d="ENVMAP_MODE_REFRACTION"}switch(i.combine){case ut:f="ENVMAP_BLENDING_MULTIPLY";break;case pt:f="ENVMAP_BLENDING_MIX";break;case dt:f="ENVMAP_BLENDING_ADD"}}var m,v,g=0<t.gammaFactor?t.gammaFactor:1,y=a.isWebGL2?"":function(t,e,n){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap&&!e.objectSpaceNormalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ma).join("\n")}(i.extensions,o,e),x=function(t){var e=[];for(var n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(h),b=s.createProgram();if(i.isRawShaderMaterial?(0<(m=[x].filter(ma).join("\n")).length&&(m+="\n"),0<(v=[y,x].filter(ma).join("\n")).length&&(v+="\n")):(m=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,x,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+g,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+d:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_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(ma).join("\n"),v=[y,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,x,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+g,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+p:"",o.envMap?"#define "+d:"",o.envMap?"#define "+f:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+u:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(a.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",o.toneMapping!==ft?"#define TONE_MAPPING":"",o.toneMapping!==ft?Xn.tonemapping_pars_fragment:"",o.toneMapping!==ft?function(t,e){var n;switch(e){case Et:n="Linear";break;case mt:n="Reinhard";break;case vt:n="Uncharted2";break;case gt:n="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.matcapEncoding||o.envMapEncoding||o.emissiveMapEncoding?Xn.encodings_pars_fragment:"",o.mapEncoding?fa("mapTexelToLinear",o.mapEncoding):"",o.matcapEncoding?fa("matcapTexelToLinear",o.matcapEncoding):"",o.envMapEncoding?fa("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?fa("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?function(t,e){var n=da(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}("linearToOutputTexel",o.outputEncoding):"",o.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(ma).join("\n")),l=ga(l=va(l=ya(l),o),o),c=ga(c=va(c=ya(c),o),o),l=xa(l),c=xa(c),a.isWebGL2&&!i.isRawShaderMaterial){var w=!1,_=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==l.match(_)&&null!==c.match(_)&&(w=!0,l=l.replace(_,""),c=c.replace(_,"")),m=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,v=["#version 300 es\n","#define varying in",w?"":"out highp vec4 pc_fragColor;",w?"":"#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"+v}var M=v+c,S=ua(s,35633,m+l),T=ua(s,35632,M);s.attachShader(b,S),s.attachShader(b,T),void 0!==i.index0AttributeName?s.bindAttribLocation(b,0,i.index0AttributeName):!0===o.morphTargets&&s.bindAttribLocation(b,0,"position"),s.linkProgram(b);var E,A,C=s.getProgramInfoLog(b).trim(),L=s.getShaderInfoLog(S).trim(),P=s.getShaderInfoLog(T).trim(),R=!0,O=!0;return!1===s.getProgramParameter(b,35714)?(R=!1,console.error("THREE.WebGLProgram: shader error: ",s.getError(),"35715",s.getProgramParameter(b,35715),"gl.getProgramInfoLog",C,L,P)):""!==C?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):""!==L&&""!==P||(O=!1),O&&(this.diagnostics={runnable:R,material:i,programLog:C,vertexShader:{log:L,prefix:m},fragmentShader:{log:P,prefix:v}}),s.deleteShader(S),s.deleteShader(T),this.getUniforms=function(){return void 0===E&&(E=new ca(s,b,t)),E},this.getAttributes=function(){return void 0===A&&(A=function(t,e){for(var n={},i=t.getProgramParameter(e,35721),r=0;r<i;r++){var o=t.getActiveAttrib(e,r).name;n[o]=t.getAttribLocation(e,o)}return n}(s,b)),A},this.destroy=function(){s.deleteProgram(b),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.name=r.name,this.id=pa++,this.code=n,this.usedTimes=1,this.program=b,this.vertexShader=S,this.fragmentShader=T,this}function wa(u,h,p){var l=[],d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},o=["precision","supportsVertexTextures","map","mapEncoding","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function f(t,e){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=Be,n===Be&&e&&(n=Fe),n}this.getParameters=function(t,e,n,i,r,o,a){var s=d[t.type],h=a.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(p.floatVertexTextures)return 1024;var n=p.maxVertexUniforms,i=Math.floor((n-20)/4),r=Math.min(i,e.length);return r<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+r+"."),0):r}(a):0,l=p.precision;null!==t.precision&&(l=p.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",l,"instead.");var c=u.getRenderTarget();return{shaderID:s,precision:l,supportsVertexTextures:p.vertexTextures,outputEncoding:f(c?c.texture:null,u.gammaOutput),map:!!t.map,mapEncoding:f(t.map,u.gammaInput),matcap:!!t.matcap,matcapEncoding:f(t.matcap,u.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:f(t.envMap,u.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===Ct||t.envMap.mapping===Lt),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:f(t.emissiveMap,u.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===Xe,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!i,useFog:t.fog,fogExp:i&&i.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:p.logarithmicDepthBuffer,skinning:t.skinning&&0<h,maxBones:h,useVertexTexture:p.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:u.maxMorphTargets,maxMorphNormals:u.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numClippingPlanes:r,numClipIntersection:o,dithering:t.dithering,shadowMapEnabled:u.shadowMap.enabled&&a.receiveShadow&&0<n.length,shadowMapType:u.shadowMap.type,toneMapping:u.toneMapping,physicallyCorrectLights:u.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===Tt,flipSided:t.side===St,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)n.push(i),n.push(t.defines[i]);for(var r=0;r<o.length;r++)n.push(e[o[r]]);return n.push(t.onBeforeCompile.toString()),n.push(u.gammaOutput),n.push(u.gammaFactor),n.join()},this.acquireProgram=function(t,e,n,i){for(var r,o=0,a=l.length;o<a;o++){var s=l[o];if(s.code===i){++(r=s).usedTimes;break}}return void 0===r&&(r=new ba(u,h,i,t,e,n,p),l.push(r)),r},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=l.indexOf(t);l[e]=l[l.length-1],l.pop(),t.destroy()}},this.programs=l}function _a(){var i=new WeakMap;return{get:function(t){var e=i.get(t);return void 0===e&&(e={},i.set(t,e)),e},remove:function(t){i.delete(t)},update:function(t,e,n){i.get(t)[e]=n},dispose:function(){i=new WeakMap}}}function Ma(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program&&e.program&&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 Sa(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ta(){var a=[],s=0,h=[],l=[];return{opaque:h,transparent:l,init:function(){s=0,h.length=0,l.length=0},push:function(t,e,n,i,r){var o=a[s];void 0===o?(o={id:t.id,object:t,geometry:e,material:n,program:n.program,renderOrder:t.renderOrder,z:i,group:r},a[s]=o):(o.id=t.id,o.object=t,o.geometry=e,o.material=n,o.program=n.program,o.renderOrder=t.renderOrder,o.z=i,o.group=r),(!0===n.transparent?l:h).push(o),s++},sort:function(){1<h.length&&h.sort(Ma),1<l.length&&l.sort(Sa)}}}function Ea(){var r={};return{get:function(t,e){var n,i=r[t.id];return void 0===i?(n=new Ta,r[t.id]={},r[t.id][e.id]=n):void 0===(n=i[e.id])&&(n=new Ta,i[e.id]=n),n},dispose:function(){r={}}}}function Aa(){var n={};return{get:function(t){if(void 0!==n[t.id])return n[t.id];var e;switch(t.type){case"DirectionalLight":e={direction:new Qe,color:new Jn,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"SpotLight":e={position:new Qe,direction:new Qe,color:new Jn,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"PointLight":e={position:new Qe,color:new Jn,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ze,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":e={direction:new Qe,skyColor:new Jn,groundColor:new Jn};break;case"RectAreaLight":e={color:new Jn,position:new Qe,halfWidth:new Qe,halfHeight:new Qe}}return n[t.id]=e}}}var Ca=0;function La(){var w=new Aa,_={id:Ca++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},M=new Qe,S=new Je,T=new Je;return{setup:function(t,e,n){for(var i=0,r=0,o=0,a=0,s=0,h=0,l=0,c=0,u=n.matrixWorldInverse,p=0,d=t.length;p<d;p++){var f=t[p],m=f.color,v=f.intensity,g=f.distance,y=f.shadow&&f.shadow.map?f.shadow.map.texture:null;if(f.isAmbientLight)i+=m.r*v,r+=m.g*v,o+=m.b*v;else if(f.isDirectionalLight){if((b=w.get(f)).color.copy(f.color).multiplyScalar(f.intensity),b.direction.setFromMatrixPosition(f.matrixWorld),M.setFromMatrixPosition(f.target.matrixWorld),b.direction.sub(M),b.direction.transformDirection(u),b.shadow=f.castShadow,f.castShadow){var x=f.shadow;b.shadowBias=x.bias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize}_.directionalShadowMap[a]=y,_.directionalShadowMatrix[a]=f.shadow.matrix,_.directional[a]=b,a++}else if(f.isSpotLight){if((b=w.get(f)).position.setFromMatrixPosition(f.matrixWorld),b.position.applyMatrix4(u),b.color.copy(m).multiplyScalar(v),b.distance=g,b.direction.setFromMatrixPosition(f.matrixWorld),M.setFromMatrixPosition(f.target.matrixWorld),b.direction.sub(M),b.direction.transformDirection(u),b.coneCos=Math.cos(f.angle),b.penumbraCos=Math.cos(f.angle*(1-f.penumbra)),b.decay=f.decay,b.shadow=f.castShadow,f.castShadow){x=f.shadow;b.shadowBias=x.bias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize}_.spotShadowMap[h]=y,_.spotShadowMatrix[h]=f.shadow.matrix,_.spot[h]=b,h++}else if(f.isRectAreaLight){(b=w.get(f)).color.copy(m).multiplyScalar(v),b.position.setFromMatrixPosition(f.matrixWorld),b.position.applyMatrix4(u),T.identity(),S.copy(f.matrixWorld),S.premultiply(u),T.extractRotation(S),b.halfWidth.set(.5*f.width,0,0),b.halfHeight.set(0,.5*f.height,0),b.halfWidth.applyMatrix4(T),b.halfHeight.applyMatrix4(T),_.rectArea[l]=b,l++}else if(f.isPointLight){if((b=w.get(f)).position.setFromMatrixPosition(f.matrixWorld),b.position.applyMatrix4(u),b.color.copy(f.color).multiplyScalar(f.intensity),b.distance=f.distance,b.decay=f.decay,b.shadow=f.castShadow,f.castShadow){x=f.shadow;b.shadowBias=x.bias,b.shadowRadius=x.radius,b.shadowMapSize=x.mapSize,b.shadowCameraNear=x.camera.near,b.shadowCameraFar=x.camera.far}_.pointShadowMap[s]=y,_.pointShadowMatrix[s]=f.shadow.matrix,_.point[s]=b,s++}else if(f.isHemisphereLight){var b;(b=w.get(f)).direction.setFromMatrixPosition(f.matrixWorld),b.direction.transformDirection(u),b.direction.normalize(),b.skyColor.copy(f.color).multiplyScalar(v),b.groundColor.copy(f.groundColor).multiplyScalar(v),_.hemi[c]=b,c++}}_.ambient[0]=i,_.ambient[1]=r,_.ambient[2]=o,_.directional.length=a,_.spot.length=h,_.rectArea.length=l,_.point.length=s,_.hemi.length=c,_.hash.stateID=_.id,_.hash.directionalLength=a,_.hash.pointLength=s,_.hash.spotLength=h,_.hash.rectAreaLength=l,_.hash.hemiLength=c,_.hash.shadowsLength=e.length},state:_}}function Pa(){var e=new La,n=[],i=[];return{init:function(){n.length=0,i.length=0},state:{lightsArray:n,shadowsArray:i,lights:e},setupLights:function(t){e.setup(n,i,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){i.push(t)}}}function Ra(){var i={};return{get:function(t,e){var n;return void 0===i[t.id]?(n=new Pa,i[t.id]={},i[t.id][e.id]=n):void 0===i[t.id][e.id]?(n=new Pa,i[t.id][e.id]=n):n=i[t.id][e.id],n},dispose:function(){i={}}}}function Oa(t){Qr.call(this),this.type="MeshDepthMaterial",this.depthPacking=He,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function ka(t){Qr.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Qe,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function za(y,m,t){for(var x=new Gn,b=new Je,w=new Ze,_=new Ze(t,t),M=new Qe,S=new Qe,g=1,T=2,e=1+(g|T),E=new Array(e),A=new Array(e),C={},L={0:St,1:D,2:Tt},P=[new Qe(1,0,0),new Qe(-1,0,0),new Qe(0,0,1),new Qe(0,0,-1),new Qe(0,1,0),new Qe(0,-1,0)],R=[new Qe(0,1,0),new Qe(0,1,0),new Qe(0,1,0),new Qe(0,1,0),new Qe(0,0,1),new Qe(0,0,-1)],O=[new zn,new zn,new zn,new zn,new zn,new zn],n=0;n!==e;++n){var i=0!=(n&g),r=0!=(n&T),o=new Oa({depthPacking:We,morphTargets:i,skinning:r});E[n]=o;var a=new ka({morphTargets:i,skinning:r});A[n]=a}var k=this;function v(t,e,n,i,r,o){var a=t.geometry,s=null,h=E,l=t.customDepthMaterial;if(n&&(h=A,l=t.customDistanceMaterial),l)s=l;else{var c=!1;e.morphTargets&&(a&&a.isBufferGeometry?c=a.morphAttributes&&a.morphAttributes.position&&0<a.morphAttributes.position.length:a&&a.isGeometry&&(c=a.morphTargets&&0<a.morphTargets.length)),t.isSkinnedMesh&&!1===e.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var u=t.isSkinnedMesh&&e.skinning,p=0;c&&(p|=g),u&&(p|=T),s=h[p]}if(y.localClippingEnabled&&!0===e.clipShadows&&0!==e.clippingPlanes.length){var d=s.uuid,f=e.uuid,m=C[d];void 0===m&&(m={},C[d]=m);var v=m[f];void 0===v&&(v=s.clone(),m[f]=v),s=v}return s.visible=e.visible,s.wireframe=e.wireframe,s.side=null!=e.shadowSide?e.shadowSide:L[e.side],s.clipShadows=e.clipShadows,s.clippingPlanes=e.clippingPlanes,s.clipIntersection=e.clipIntersection,s.wireframeLinewidth=e.wireframeLinewidth,s.linewidth=e.linewidth,n&&s.isMeshDistanceMaterial&&(s.referencePosition.copy(i),s.nearDistance=r,s.farDistance=o),s}function z(t,e,n,i){if(!1!==t.visible){if(t.layers.test(e.layers)&&(t.isMesh||t.isLine||t.isPoints)&&t.castShadow&&(!t.frustumCulled||x.intersectsObject(t))){t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld);var r=m.update(t),o=t.material;if(Array.isArray(o))for(var a=r.groups,s=0,h=a.length;s<h;s++){var l=a[s],c=o[l.materialIndex];if(c&&c.visible){var u=v(t,c,i,S,n.near,n.far);y.renderBufferDirect(n,null,r,u,t,l)}}else if(o.visible){u=v(t,o,i,S,n.near,n.far);y.renderBufferDirect(n,null,r,u,t,null)}}for(var p=t.children,d=0,f=p.length;d<f;d++)z(p[d],e,n,i)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=I,this.render=function(t,e,n){if(!1!==k.enabled&&(!1!==k.autoUpdate||!1!==k.needsUpdate)&&0!==t.length){y.context;var i,r=y.state;r.disable(3042),r.buffers.color.setClear(1,1,1,1),r.buffers.depth.setTest(!0),r.setScissorTest(!1);for(var o=0,a=t.length;o<a;o++){var s=t[o],h=s.shadow,l=s&&s.isPointLight;if(void 0!==h){var c=h.camera;if(w.copy(h.mapSize),w.min(_),l){var u=w.x,p=w.y;O[0].set(2*u,p,u,p),O[1].set(0,p,u,p),O[2].set(3*u,p,u,p),O[3].set(u,p,u,p),O[4].set(3*u,0,u,p),O[5].set(u,0,u,p),w.x*=4,w.y*=2}if(null===h.map){var d={minFilter:kt,magFilter:kt,format:te};h.map=new In(w.x,w.y,d),h.map.texture.name=s.name+".shadowMap",c.updateProjectionMatrix()}h.isSpotLightShadow&&h.update(s);var f=h.map,m=h.matrix;S.setFromMatrixPosition(s.matrixWorld),c.position.copy(S),l?(i=6,m.makeTranslation(-S.x,-S.y,-S.z)):(i=1,M.setFromMatrixPosition(s.target.matrixWorld),c.lookAt(M),c.updateMatrixWorld(),m.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),m.multiply(c.projectionMatrix),m.multiply(c.matrixWorldInverse)),y.setRenderTarget(f),y.clear();for(var v=0;v<i;v++){if(l){M.copy(c.position),M.add(P[v]),c.up.copy(R[v]),c.lookAt(M),c.updateMatrixWorld();var g=O[v];r.viewport(g)}b.multiplyMatrices(c.projectionMatrix,c.matrixWorldInverse),x.setFromMatrix(b),z(e,n,c,l)}}else console.warn("THREE.WebGLShadowMap:",s,"has no shadow.")}k.needsUpdate=!1}}}function Ia(c,n,h,i){var r=new function(){var e=!1,o=new zn,n=null,a=new zn(0,0,0,0);return{setMask:function(t){n===t||e||(c.colorMask(t,t,t,t),n=t)},setLocked:function(t){e=t},setClear:function(t,e,n,i,r){!0===r&&(t*=i,e*=i,n*=i),o.set(t,e,n,i),!1===a.equals(o)&&(c.clearColor(t,e,n,i),a.copy(o))},reset:function(){e=!1,n=null,a.set(-1,0,0,0)}}},o=new function(){var e=!1,n=null,i=null,r=null;return{setTest:function(t){t?F(2929):U(2929)},setMask:function(t){n===t||e||(c.depthMask(t),n=t)},setFunc:function(t){if(i!==t){if(t)switch(t){case it:c.depthFunc(512);break;case rt:c.depthFunc(519);break;case ot:c.depthFunc(513);break;case at:c.depthFunc(515);break;case st:c.depthFunc(514);break;case ht:c.depthFunc(518);break;case lt:c.depthFunc(516);break;case ct:c.depthFunc(517);break;default:c.depthFunc(515)}else c.depthFunc(515);i=t}},setLocked:function(t){e=t},setClear:function(t){r!==t&&(c.clearDepth(t),r=t)},reset:function(){e=!1,r=i=n=null}}},e=new function(){var e=!1,n=null,i=null,r=null,o=null,a=null,s=null,h=null,l=null;return{setTest:function(t){t?F(2960):U(2960)},setMask:function(t){n===t||e||(c.stencilMask(t),n=t)},setFunc:function(t,e,n){i===t&&r===e&&o===n||(c.stencilFunc(t,e,n),i=t,r=e,o=n)},setOp:function(t,e,n){a===t&&s===e&&h===n||(c.stencilOp(t,e,n),a=t,s=e,h=n)},setLocked:function(t){e=t},setClear:function(t){l!==t&&(c.clearStencil(t),l=t)},reset:function(){e=!1,l=h=s=a=o=r=i=n=null}}},t=c.getParameter(34921),a=new Uint8Array(t),s=new Uint8Array(t),l=new Uint8Array(t),u={},p=null,d=null,f=null,m=null,v=null,g=null,y=null,x=null,b=null,w=null,_=!1,M=null,S=null,T=null,E=null,A=null,C=c.getParameter(35661),L=!1,P=0,R=c.getParameter(7938);-1!==R.indexOf("WebGL")?(P=parseFloat(/^WebGL\ ([0-9])/.exec(R)[1]),L=1<=P):-1!==R.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(R)[1]),L=2<=P);var O=null,k={},z=new zn,I=new zn;function D(t,e,n){var i=new Uint8Array(4),r=c.createTexture();c.bindTexture(t,r),c.texParameteri(t,10241,9728),c.texParameteri(t,10240,9728);for(var o=0;o<n;o++)c.texImage2D(e+o,0,6408,1,1,0,6408,5121,i);return r}var B={};function N(t,e){a[t]=1,0===s[t]&&(c.enableVertexAttribArray(t),s[t]=1),l[t]!==e&&((i.isWebGL2?c:n.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,e),l[t]=e)}function F(t){!0!==u[t]&&(c.enable(t),u[t]=!0)}function U(t){!1!==u[t]&&(c.disable(t),u[t]=!1)}function j(t,e,n,i,r,o,a,s){if(t!==Z){if(f||(F(3042),f=!0),t===tt)r=r||e,o=o||n,a=a||i,e===v&&r===x||(c.blendEquationSeparate(h.convert(e),h.convert(r)),v=e,x=r),n===g&&i===y&&o===b&&a===w||(c.blendFuncSeparate(h.convert(n),h.convert(i),h.convert(o),h.convert(a)),g=n,y=i,b=o,w=a),m=t,_=null;else if(t!==m||s!==_){if(v===et&&x===et||(c.blendEquation(32774),x=v=et),s)switch(t){case J:c.blendFuncSeparate(1,771,1,771);break;case K:c.blendFunc(1,1);break;case Q:c.blendFuncSeparate(0,0,769,771);break;case $:c.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case J:c.blendFuncSeparate(770,771,1,771);break;case K:c.blendFunc(770,1);break;case Q:c.blendFunc(0,769);break;case $:c.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}w=b=y=g=null,m=t,_=s}}else f&&(U(3042),f=!1)}function V(t){M!==t&&(t?c.frontFace(2304):c.frontFace(2305),M=t)}function G(t){t!==q?(F(2884),t!==S&&(t===X?c.cullFace(1029):t===Y?c.cullFace(1028):c.cullFace(1032))):U(2884),S=t}function H(t,e,n){t?(F(32823),E===e&&A===n||(c.polygonOffset(e,n),E=e,A=n)):U(32823)}function W(t){void 0===t&&(t=33984+C-1),O!==t&&(c.activeTexture(t),O=t)}return B[3553]=D(3553,3553,1),B[34067]=D(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),e.setClear(0),F(2929),o.setFunc(at),V(!1),G(X),F(2884),j(Z),{buffers:{color:r,depth:o,stencil:e},initAttributes:function(){for(var t=0,e=a.length;t<e;t++)a[t]=0},enableAttribute:function(t){N(t,0)},enableAttributeAndDivisor:N,disableUnusedAttributes:function(){for(var t=0,e=s.length;t!==e;++t)s[t]!==a[t]&&(c.disableVertexAttribArray(t),s[t]=0)},enable:F,disable:U,getCompressedTextureFormats:function(){if(null===p&&(p=[],n.get("WEBGL_compressed_texture_pvrtc")||n.get("WEBGL_compressed_texture_s3tc")||n.get("WEBGL_compressed_texture_etc1")||n.get("WEBGL_compressed_texture_astc")))for(var t=c.getParameter(34467),e=0;e<t.length;e++)p.push(t[e]);return p},useProgram:function(t){return d!==t&&(c.useProgram(t),d=t,!0)},setBlending:j,setMaterial:function(t,e){t.side===Tt?U(2884):F(2884);var n=t.side===St;e&&(n=!n),V(n),t.blending===J&&!1===t.transparent?j(Z):j(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),r.setMask(t.colorWrite),H(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:V,setCullFace:G,setLineWidth:function(t){t!==T&&(L&&c.lineWidth(t),T=t)},setPolygonOffset:H,setScissorTest:function(t){t?F(3089):U(3089)},activeTexture:W,bindTexture:function(t,e){null===O&&W();var n=k[O];void 0===n&&(n={type:void 0,texture:void 0},k[O]=n),n.type===t&&n.texture===e||(c.bindTexture(t,e||B[t]),n.type=t,n.texture=e)},compressedTexImage2D:function(){try{c.compressedTexImage2D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{c.texImage2D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{c.texImage3D.apply(c,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===z.equals(t)&&(c.scissor(t.x,t.y,t.z,t.w),z.copy(t))},viewport:function(t){!1===I.equals(t)&&(c.viewport(t.x,t.y,t.z,t.w),I.copy(t))},reset:function(){for(var t=0;t<s.length;t++)1===s[t]&&(c.disableVertexAttribArray(t),s[t]=0);u={},k={},S=M=m=d=O=p=null,r.reset(),o.reset(),e.reset()}}}function Da(v,r,g,y,x,b,w){var d,o={};function _(t,e){if(t.width>e||t.height>e){if("data"in t)return void console.warn("THREE.WebGLRenderer: image in DataTexture is too big ("+t.width+"x"+t.height+").");var n=e/Math.max(t.width,t.height),i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return i.width=Math.floor(t.width*n),i.height=Math.floor(t.height*n),i.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+i.width+"x"+i.height),i}return t}function M(t){return Ye.isPowerOfTwo(t.width)&&Ye.isPowerOfTwo(t.height)}function S(t,e){return t.generateMipmaps&&e&&t.minFilter!==kt&&t.minFilter!==Bt}function T(t,e,n,i){v.generateMipmap(t),y.get(e).__maxMipLevel=Math.log(Math.max(n,i))*Math.LOG2E}function E(t,e){if(!x.isWebGL2)return t;if(6403===t){if(5126===e)return 33326;if(5131===e)return 33325;if(5121===e)return 33321}if(6407===t){if(5126===e)return 34837;if(5131===e)return 34843;if(5121===e)return 32849}if(6408===t){if(5126===e)return 34836;if(5131===e)return 34842;if(5121===e)return 32856}return t}function a(t){return t===kt||t===zt||t===Dt?9728:9729}function A(t){var e=t.target;e.removeEventListener("dispose",A),function(t){var e=y.get(t);if(t.image&&e.__image__webglTextureCube)v.deleteTexture(e.__image__webglTextureCube);else{if(void 0===e.__webglInit)return;v.deleteTexture(e.__webglTexture)}y.remove(t)}(e),e.isVideoTexture&&delete o[e.id],w.memory.textures--}function s(t){var e=t.target;e.removeEventListener("dispose",s),function(t){var e=y.get(t),n=y.get(t.texture);if(!t)return;void 0!==n.__webglTexture&&v.deleteTexture(n.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var i=0;i<6;i++)v.deleteFramebuffer(e.__webglFramebuffer[i]),e.__webglDepthbuffer&&v.deleteRenderbuffer(e.__webglDepthbuffer[i]);else v.deleteFramebuffer(e.__webglFramebuffer),e.__webglDepthbuffer&&v.deleteRenderbuffer(e.__webglDepthbuffer);y.remove(t.texture),y.remove(t)}(e),w.memory.textures--}function h(t,e){var n=y.get(t);if(t.isVideoTexture&&function(t){var e=t.id,n=w.render.frame;o[e]!==n&&(o[e]=n,t.update())}(t),0<t.version&&n.__version!==t.version){var i=t.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void l(n,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}g.activeTexture(33984+e),g.bindTexture(3553,n.__webglTexture)}function C(t,e,n){var i;if(n?(v.texParameteri(t,10242,b.convert(e.wrapS)),v.texParameteri(t,10243,b.convert(e.wrapT)),v.texParameteri(t,10240,b.convert(e.magFilter)),v.texParameteri(t,10241,b.convert(e.minFilter))):(v.texParameteri(t,10242,33071),v.texParameteri(t,10243,33071),e.wrapS===Rt&&e.wrapT===Rt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),v.texParameteri(t,10240,a(e.magFilter)),v.texParameteri(t,10241,a(e.minFilter)),e.minFilter!==kt&&e.minFilter!==Bt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),i=r.get("EXT_texture_filter_anisotropic")){if(e.type===qt&&null===r.get("OES_texture_float_linear"))return;if(e.type===Xt&&null===(x.isWebGL2||r.get("OES_texture_half_float_linear")))return;(1<e.anisotropy||y.get(e).__currentAnisotropy)&&(v.texParameterf(t,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,x.getMaxAnisotropy())),y.get(e).__currentAnisotropy=e.anisotropy)}}function l(t,e,n){var i;i=e.isDataTexture3D?32879:3553,void 0===t.__webglInit&&(t.__webglInit=!0,e.addEventListener("dispose",A),t.__webglTexture=v.createTexture(),w.memory.textures++),g.activeTexture(33984+n),g.bindTexture(i,t.__webglTexture),v.pixelStorei(37440,e.flipY),v.pixelStorei(37441,e.premultiplyAlpha),v.pixelStorei(3317,e.unpackAlignment);var r=_(e.image,x.maxTextureSize);!function(t){return!x.isWebGL2&&(t.wrapS!==Rt||t.wrapT!==Rt||t.minFilter!==kt&&t.minFilter!==Bt)}(e)||!1!==M(r)||(r=function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof ImageBitmap?(void 0===d&&(d=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),d.width=Ye.floorPowerOfTwo(t.width),d.height=Ye.floorPowerOfTwo(t.height),d.getContext("2d").drawImage(t,0,0,d.width,d.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+d.width+"x"+d.height),d):t}(r));var o=M(r),a=b.convert(e.format),s=b.convert(e.type),h=E(a,s);C(i,e,o);var l,c=e.mipmaps;if(e.isDepthTexture){if(h=6402,e.type===qt){if(!x.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");h=36012}else x.isWebGL2&&(h=33189);e.format===ie&&6402===h&&e.type!==Gt&&e.type!==Wt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),e.type=Gt,s=b.convert(e.type)),e.format===re&&(h=34041,e.type!==Kt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),e.type=Kt,s=b.convert(e.type))),g.texImage2D(3553,0,h,r.width,r.height,0,a,s,null)}else if(e.isDataTexture)if(0<c.length&&o){for(var u=0,p=c.length;u<p;u++)l=c[u],g.texImage2D(3553,u,h,l.width,l.height,0,a,s,l.data);e.generateMipmaps=!1,t.__maxMipLevel=c.length-1}else g.texImage2D(3553,0,h,r.width,r.height,0,a,s,r.data),t.__maxMipLevel=0;else if(e.isCompressedTexture){for(u=0,p=c.length;u<p;u++)l=c[u],e.format!==te&&e.format!==$t?-1<g.getCompressedTextureFormats().indexOf(a)?g.compressedTexImage2D(3553,u,h,l.width,l.height,0,l.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):g.texImage2D(3553,u,h,l.width,l.height,0,a,s,l.data);t.__maxMipLevel=c.length-1}else if(e.isDataTexture3D)g.texImage3D(32879,0,h,r.width,r.height,r.depth,0,a,s,r.data),t.__maxMipLevel=0;else if(0<c.length&&o){for(u=0,p=c.length;u<p;u++)l=c[u],g.texImage2D(3553,u,h,a,s,l);e.generateMipmaps=!1,t.__maxMipLevel=c.length-1}else g.texImage2D(3553,0,h,a,s,r),t.__maxMipLevel=0;S(e,o)&&T(3553,e,r.width,r.height),t.__version=e.version,e.onUpdate&&e.onUpdate(e)}function c(t,e,n,i){var r=b.convert(e.texture.format),o=b.convert(e.texture.type),a=E(r,o);g.texImage2D(i,0,a,e.width,e.height,0,r,o,null),v.bindFramebuffer(36160,t),v.framebufferTexture2D(36160,n,i,y.get(e.texture).__webglTexture,0),v.bindFramebuffer(36160,null)}function u(t,e){v.bindRenderbuffer(36161,t),e.depthBuffer&&!e.stencilBuffer?(v.renderbufferStorage(36161,33189,e.width,e.height),v.framebufferRenderbuffer(36160,36096,36161,t)):e.depthBuffer&&e.stencilBuffer?(v.renderbufferStorage(36161,34041,e.width,e.height),v.framebufferRenderbuffer(36160,33306,36161,t)):v.renderbufferStorage(36161,32854,e.width,e.height),v.bindRenderbuffer(36161,null)}function p(t){var e=y.get(t),n=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,e){if(e&&e.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(v.bindFramebuffer(36160,t),!e.depthTexture||!e.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");y.get(e.depthTexture).__webglTexture&&e.depthTexture.image.width===e.width&&e.depthTexture.image.height===e.height||(e.depthTexture.image.width=e.width,e.depthTexture.image.height=e.height,e.depthTexture.needsUpdate=!0),h(e.depthTexture,0);var n=y.get(e.depthTexture).__webglTexture;if(e.depthTexture.format===ie)v.framebufferTexture2D(36160,36096,3553,n,0);else{if(e.depthTexture.format!==re)throw new Error("Unknown depthTexture format");v.framebufferTexture2D(36160,33306,3553,n,0)}}(e.__webglFramebuffer,t)}else if(n){e.__webglDepthbuffer=[];for(var i=0;i<6;i++)v.bindFramebuffer(36160,e.__webglFramebuffer[i]),e.__webglDepthbuffer[i]=v.createRenderbuffer(),u(e.__webglDepthbuffer[i],t)}else v.bindFramebuffer(36160,e.__webglFramebuffer),e.__webglDepthbuffer=v.createRenderbuffer(),u(e.__webglDepthbuffer,t);v.bindFramebuffer(36160,null)}this.setTexture2D=h,this.setTexture3D=function(t,e){var n=y.get(t);0<t.version&&n.__version!==t.version?l(n,t,e):(g.activeTexture(33984+e),g.bindTexture(32879,n.__webglTexture))},this.setTextureCube=function(t,e){var n=y.get(t);if(6===t.image.length)if(0<t.version&&n.__version!==t.version){n.__image__webglTextureCube||(t.addEventListener("dispose",A),n.__image__webglTextureCube=v.createTexture(),w.memory.textures++),g.activeTexture(33984+e),g.bindTexture(34067,n.__image__webglTextureCube),v.pixelStorei(37440,t.flipY);for(var i=t&&t.isCompressedTexture,r=t.image[0]&&t.image[0].isDataTexture,o=[],a=0;a<6;a++)o[a]=i||r?r?t.image[a].image:t.image[a]:_(t.image[a],x.maxCubemapSize);var s=o[0],h=M(s),l=b.convert(t.format),c=b.convert(t.type),u=E(l,c);C(34067,t,h);for(a=0;a<6;a++)if(i)for(var p,d=o[a].mipmaps,f=0,m=d.length;f<m;f++)p=d[f],t.format!==te&&t.format!==$t?-1<g.getCompressedTextureFormats().indexOf(l)?g.compressedTexImage2D(34069+a,f,u,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g.texImage2D(34069+a,f,u,p.width,p.height,0,l,c,p.data);else r?g.texImage2D(34069+a,0,u,o[a].width,o[a].height,0,l,c,o[a].data):g.texImage2D(34069+a,0,u,l,c,o[a]);n.__maxMipLevel=i?d.length-1:0,S(t,h)&&T(34067,t,s.width,s.height),n.__version=t.version,t.onUpdate&&t.onUpdate(t)}else g.activeTexture(33984+e),g.bindTexture(34067,n.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,e){g.activeTexture(33984+e),g.bindTexture(34067,y.get(t).__webglTexture)},this.setupRenderTarget=function(t){var e=y.get(t),n=y.get(t.texture);t.addEventListener("dispose",s),n.__webglTexture=v.createTexture(),w.memory.textures++;var i=!0===t.isWebGLRenderTargetCube,r=M(t);if(i){e.__webglFramebuffer=[];for(var o=0;o<6;o++)e.__webglFramebuffer[o]=v.createFramebuffer()}else e.__webglFramebuffer=v.createFramebuffer();if(i){g.bindTexture(34067,n.__webglTexture),C(34067,t.texture,r);for(o=0;o<6;o++)c(e.__webglFramebuffer[o],t,36064,34069+o);S(t.texture,r)&&T(34067,t.texture,t.width,t.height),g.bindTexture(34067,null)}else g.bindTexture(3553,n.__webglTexture),C(3553,t.texture,r),c(e.__webglFramebuffer,t,36064,3553),S(t.texture,r)&&T(3553,t.texture,t.width,t.height),g.bindTexture(3553,null);t.depthBuffer&&p(t)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(S(e,M(t))){var n=t.isWebGLRenderTargetCube?34067:3553,i=y.get(e).__webglTexture;g.bindTexture(n,i),T(n,e,t.width,t.height),g.bindTexture(n,null)}}}function Ba(t,n,i){return{convert:function(t){var e;if(t===Pt)return 10497;if(t===Rt)return 33071;if(t===Ot)return 33648;if(t===kt)return 9728;if(t===zt)return 9984;if(t===Dt)return 9986;if(t===Bt)return 9729;if(t===Nt)return 9985;if(t===Ft)return 9987;if(t===Ut)return 5121;if(t===Yt)return 32819;if(t===Zt)return 32820;if(t===Jt)return 33635;if(t===jt)return 5120;if(t===Vt)return 5122;if(t===Gt)return 5123;if(t===Ht)return 5124;if(t===Wt)return 5125;if(t===qt)return 5126;if(t===Xt){if(i.isWebGL2)return 5131;if(null!==(e=n.get("OES_texture_half_float")))return e.HALF_FLOAT_OES}if(t===Qt)return 6406;if(t===$t)return 6407;if(t===te)return 6408;if(t===ee)return 6409;if(t===ne)return 6410;if(t===ie)return 6402;if(t===re)return 34041;if(t===oe)return 6403;if(t===et)return 32774;if(t===L)return 32778;if(t===P)return 32779;if(t===z)return 0;if(t===B)return 1;if(t===N)return 768;if(t===F)return 769;if(t===U)return 770;if(t===j)return 771;if(t===V)return 772;if(t===G)return 773;if(t===H)return 774;if(t===W)return 775;if(t===nt)return 776;if((t===ae||t===se||t===he||t===le)&&null!==(e=n.get("WEBGL_compressed_texture_s3tc"))){if(t===ae)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===se)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===he)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===le)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===ce||t===ue||t===pe||t===de)&&null!==(e=n.get("WEBGL_compressed_texture_pvrtc"))){if(t===ce)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===ue)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===pe)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===de)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===fe&&null!==(e=n.get("WEBGL_compressed_texture_etc1")))return e.COMPRESSED_RGB_ETC1_WEBGL;if((t===me||t===ve||t===ge||t===ye||t===xe||t===be||t===we||t===_e||t===Me||t===Se||t===Te||t===Ee||t===Ae||t===Ce)&&null!==(e=n.get("WEBGL_compressed_texture_astc")))return t;if(t===R||t===O){if(i.isWebGL2){if(t===R)return 32775;if(t===O)return 32776}if(null!==(e=n.get("EXT_blend_minmax"))){if(t===R)return e.MIN_EXT;if(t===O)return e.MAX_EXT}}if(t===Kt){if(i.isWebGL2)return 34042;if(null!==(e=n.get("WEBGL_depth_texture")))return e.UNSIGNED_INT_24_8_WEBGL}return 0}}}function Na(){Ci.call(this),this.type="Group"}function Fa(){Ci.call(this),this.type="Camera",this.matrixWorldInverse=new Je,this.projectionMatrix=new Je,this.projectionMatrixInverse=new Je}function Ua(t,e,n,i){Fa.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!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function ja(t){Ua.call(this),this.cameras=t||[]}((Oa.prototype=Object.create(Qr.prototype)).constructor=Oa).prototype.isMeshDepthMaterial=!0,Oa.prototype.copy=function(t){return Qr.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},((ka.prototype=Object.create(Qr.prototype)).constructor=ka).prototype.isMeshDistanceMaterial=!0,ka.prototype.copy=function(t){return Qr.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},Na.prototype=Object.assign(Object.create(Ci.prototype),{constructor:Na,isGroup:!0}),Fa.prototype=Object.assign(Object.create(Ci.prototype),{constructor:Fa,isCamera:!0,copy:function(t,e){return Ci.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 Qe),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Ci.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Ua.prototype=Object.assign(Object.create(Fa.prototype),{constructor:Ua,isPerspectiveCamera:!0,copy:function(t,e){return Fa.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*Ye.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Ye.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Ye.RAD2DEG*Math.atan(Math.tan(.5*Ye.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,i,r,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=i,this.view.width=r,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*Ye.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/a,e-=o.offsetY*n/s,i*=o.width/a,n*=o.height/s}var h=this.filmOffset;0!==h&&(r+=t*h/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Ci.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}}),ja.prototype=Object.assign(Object.create(Ua.prototype),{constructor:ja,isArrayCamera:!0});var Va,Ga,Ha,Wa,qa,Xa,Ya,Za,Ja,Ka,Qa,$a,ts,es,ns,is,rs,os,as,ss,hs,ls,cs,us,ps,ds,fs,ms,vs=new Qe,gs=new Qe;function ys(t,e,n){vs.setFromMatrixPosition(e.matrixWorld),gs.setFromMatrixPosition(n.matrixWorld);var i=vs.distanceTo(gs),r=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),h=(r[9]+1)/r[5],l=(r[9]-1)/r[5],c=(r[8]-1)/r[0],u=(o[8]+1)/o[0],p=a*c,d=a*u,f=i/(u-c),m=f*-c;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=i-m+d,b=h*s/g*v,w=l*s/g*v;t.projectionMatrix.makePerspective(y,x,b,w,v,g)}function xs(i){var r=this,h=null,l=null,c=null,u=[],p=new Je,d=new Je,o=1,f="stage";"undefined"!=typeof window&&"VRFrameData"in window&&(l=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",t,!1));var m=new Je,v=new Ke,g=new Qe,y=new Ua;y.bounds=new zn(0,0,.5,1),y.layers.enable(1);var x=new Ua;x.bounds=new zn(.5,0,.5,1),x.layers.enable(2);var a,s,b=new ja([y,x]);function w(){return null!==h&&!0===h.isPresenting}function t(){if(w()){var t=h.getEyeParameters("left"),e=t.renderWidth*o,n=t.renderHeight*o;s=i.getPixelRatio(),a=i.getSize(),i.setDrawingBufferSize(2*e,n,1),S.start()}else r.enabled&&i.setDrawingBufferSize(a.width,a.height,s),S.stop()}b.layers.enable(1),b.layers.enable(2);var _=[];function M(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),n=0,i=0,r=e.length;n<r;n++){var o=e[n];if(o&&("Daydream Controller"===o.id||"Gear VR Controller"===o.id||"Oculus Go Controller"===o.id||"OpenVR Gamepad"===o.id||o.id.startsWith("Oculus Touch")||o.id.startsWith("Spatial Controller"))){if(i===t)return o;i++}}}this.enabled=!1,this.getController=function(t){var e=u[t];return void 0===e&&((e=new Na).matrixAutoUpdate=!1,e.visible=!1,u[t]=e),e},this.getDevice=function(){return h},this.setDevice=function(t){void 0!==t&&(h=t),S.setContext(t)},this.setFramebufferScaleFactor=function(t){o=t},this.setFrameOfReferenceType=function(t){f=t},this.setPoseTarget=function(t){void 0!==t&&(c=t)},this.getCamera=function(t){var e="stage"===f?1.6:0;if(null===h)return t.position.set(0,e,0),t;if(h.depthNear=t.near,h.depthFar=t.far,h.getFrameData(l),"stage"===f){var n=h.stageParameters;n?p.fromArray(n.sittingToStandingTransform):p.makeTranslation(0,e,0)}var i=l.pose,r=null!==c?c:t;if(r.matrix.copy(p),r.matrix.decompose(r.position,r.quaternion,r.scale),null!==i.orientation&&(v.fromArray(i.orientation),r.quaternion.multiply(v)),null!==i.position&&(v.setFromRotationMatrix(p),g.fromArray(i.position),g.applyQuaternion(v),r.position.add(g)),r.updateMatrixWorld(),!1===h.isPresenting)return t;y.near=t.near,x.near=t.near,y.far=t.far,x.far=t.far,y.matrixWorldInverse.fromArray(l.leftViewMatrix),x.matrixWorldInverse.fromArray(l.rightViewMatrix),d.getInverse(p),"stage"===f&&(y.matrixWorldInverse.multiply(d),x.matrixWorldInverse.multiply(d));var o=r.parent;null!==o&&(m.getInverse(o.matrixWorld),y.matrixWorldInverse.multiply(m),x.matrixWorldInverse.multiply(m)),y.matrixWorld.getInverse(y.matrixWorldInverse),x.matrixWorld.getInverse(x.matrixWorldInverse),y.projectionMatrix.fromArray(l.leftProjectionMatrix),x.projectionMatrix.fromArray(l.rightProjectionMatrix),ys(b,y,x);var a=h.getLayers();if(a.length){var s=a[0];null!==s.leftBounds&&4===s.leftBounds.length&&y.bounds.fromArray(s.leftBounds),null!==s.rightBounds&&4===s.rightBounds.length&&x.bounds.fromArray(s.rightBounds)}return function(){for(var t=0;t<u.length;t++){var e=u[t],n=M(t);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&e.position.set(.2,-.6,-.05),null!==i.position&&e.position.fromArray(i.position),null!==i.orientation&&e.quaternion.fromArray(i.orientation),e.matrix.compose(e.position,e.quaternion,e.scale),e.matrix.premultiply(p),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0;var r="Daydream Controller"===n.id?0:1;_[t]!==n.buttons[r].pressed&&(_[t]=n.buttons[r].pressed,!0===_[t]?e.dispatchEvent({type:"selectstart"}):(e.dispatchEvent({type:"selectend"}),e.dispatchEvent({type:"select"})))}else e.visible=!1}}(),b},this.getStandingMatrix=function(){return p},this.isPresenting=w;var S=new ri;this.setAnimationLoop=function(t){S.setAnimationLoop(t)},this.submitFrame=function(){w()&&h.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",t)}}function bs(e){var n=e.context,i=null,p=null,r=1,d=null,o="stage",f=null,m=[],v=[];function a(){return null!==p&&null!==d}var s=new Ua;s.layers.enable(1),s.viewport=new zn;var h=new Ua;h.layers.enable(2),h.viewport=new zn;var g=new ja([s,h]);function l(t){var e=m[v.indexOf(t.inputSource)];e&&e.dispatchEvent({type:t.type})}function c(){e.setFramebuffer(null),x.stop()}function u(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}g.layers.enable(1),g.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=m[t];return void 0===e&&((e=new Na).matrixAutoUpdate=!1,e.visible=!1,m[t]=e),e},this.getDevice=function(){return i},this.setDevice=function(t){void 0!==t&&(i=t),t instanceof XRDevice&&n.setCompatibleXRDevice(t)},this.setFramebufferScaleFactor=function(t){r=t},this.setFrameOfReferenceType=function(t){o=t},this.setSession=function(t){null!==(p=t)&&(p.addEventListener("select",l),p.addEventListener("selectstart",l),p.addEventListener("selectend",l),p.addEventListener("end",c),p.baseLayer=new XRWebGLLayer(p,n,{framebufferScaleFactor:r}),p.requestFrameOfReference(o).then(function(t){d=t,e.setFramebuffer(p.baseLayer.framebuffer),x.setContext(p),x.start()}),v=p.getInputSources(),p.addEventListener("inputsourceschange",function(){v=p.getInputSources(),console.log(v);for(var t=0;t<m.length;t++){m[t].userData.inputSource=v[t]}}))},this.getCamera=function(t){if(a()){var e=t.parent,n=g.cameras;u(g,e);for(var i=0;i<n.length;i++)u(n[i],e);t.matrixWorld.copy(g.matrixWorld);for(var r=t.children,o=(i=0,r.length);i<o;i++)r[i].updateMatrixWorld(!0);return ys(g,s,h),g}return t},this.isPresenting=a;var y=null;var x=new ri;x.setAnimationLoop(function(t,e){if(null!==(f=e.getDevicePose(d)))for(var n=p.baseLayer,i=e.views,r=0;r<i.length;r++){var o=i[r],a=n.getViewport(o),s=f.getViewMatrix(o),h=g.cameras[r];h.matrix.fromArray(s).getInverse(h.matrix),h.projectionMatrix.fromArray(o.projectionMatrix),h.viewport.set(a.x,a.y,a.width,a.height),0===r&&g.matrix.copy(h.matrix)}for(r=0;r<m.length;r++){var l=m[r],c=v[r];if(c){var u=e.getInputPose(c,d);if(null!==u){"targetRay"in u?l.matrix.elements=u.targetRay.transformMatrix:"pointerMatrix"in u&&(l.matrix.elements=u.pointerMatrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.visible=!0;continue}}l.visible=!1}y&&y(t)}),this.setAnimationLoop=function(t){y=t},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new THREE.Matrix4},this.submitFrame=function(){}}function ws(t){console.log("init oasviewer");var i=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),e=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=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,h=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,l=void 0!==t.powerPreference?t.powerPreference:"default",v=null,w=null;this.domElement=i,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=Et,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.dynamicValue=0,this._sfcCamera=new _t,this._sfcCulling=new Mt(i);var M,S,T,E,c,_,u,A,C,g,y,p,d,f,L,P,R,m,O=this,x=!1,b=null,k=null,z=null,I=-1,D={geometry:null,program:null,wireframe:!1},B=null,N=null,F=new zn,U=new zn,j=null,V=0,G=i.width,H=i.height,W=1,q=new zn(0,0,G,H),X=new zn(0,0,G,H),Y=!1,Z=new Gn,J=new lo,K=!1,Q=!1,$=new Je,tt=new Qe;function et(){return null===k?W:1}try{var nt={alpha:n,depth:r,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:h,powerPreference:l};if(i.addEventListener("webglcontextlost",at,!1),i.addEventListener("webglcontextrestored",st,!1),null===(M=e||i.getContext("webgl",nt)||i.getContext("experimental-webgl",nt)))throw null!==i.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===M.getShaderPrecisionFormat&&(M.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){console.error("THREE.WebGLRenderer: "+t.message)}function it(){S=new co(M),(T=new ho(M,S,t)).isWebGL2||(S.get("WEBGL_depth_texture"),S.get("OES_texture_float"),S.get("OES_texture_half_float"),S.get("OES_texture_half_float_linear"),S.get("OES_standard_derivatives"),S.get("OES_element_index_uint"),S.get("ANGLE_instanced_arrays")),S.get("OES_texture_float_linear"),m=new Ba(M,S,T),(E=new Ia(M,S,m,T)).scissor(U.copy(X).multiplyScalar(W)),E.viewport(F.copy(q).multiplyScalar(W)),c=new fo(M),_=new _a,u=new Da(M,S,E,_,T,m,c),A=new oi(M),C=new uo(M,A,c),g=new go(C,c),L=new vo(M),y=new wa(O,S,T),p=new Ea,d=new Ra,f=new ao(O,E,g,s),P=new so(M,S,c,T),R=new po(M,S,c,T),c.programs=y.programs,O.context=M,O.capabilities=T,O.extensions=S,O.properties=_,O.renderLists=p,O.state=E,O.info=c}it();var rt=null;"undefined"!=typeof navigator&&(rt="xr"in navigator?new bs(O):new xs(O)),this.vr=rt;var ot=new za(O,g,T.maxTextureSize);function at(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function st(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1,it()}function ht(t){var e=t.target;e.removeEventListener("dispose",ht),function(t){lt(t),_.remove(t)}(e)}function lt(t){var e=_.get(t).program;(t.program=void 0)!==e&&y.releaseProgram(e)}this.shadowMap=ot,this.setDynamiceValue=function(t){this.dynamicValue=t,this._sfcCulling.setValue(t)},this.getContext=function(){return M},this.getContextAttributes=function(){return M.getContextAttributes()},this.forceContextLoss=function(){var t=S.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=S.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return W},this.setPixelRatio=function(t){void 0!==t&&(W=t,this.setSize(G,H,!1))},this.getSize=function(){return{width:G,height:H}},this.setSize=function(t,e,n){rt.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(G=t,H=e,i.width=t*W,i.height=e*W,!1!==n&&(i.style.width=t+"px",i.style.height=e+"px"),this.setViewport(0,0,t,e),this._sfcCulling.update())},this.getDrawingBufferSize=function(){return{width:G*W,height:H*W}},this.setDrawingBufferSize=function(t,e,n){G=t,H=e,W=n,i.width=t*n,i.height=e*n,this.setViewport(0,0,t,e)},this.getCurrentViewport=function(){return F},this.setViewport=function(t,e,n,i){q.set(t,H-e-i,n,i),E.viewport(F.copy(q).multiplyScalar(W))},this.setScissor=function(t,e,n,i){X.set(t,H-e-i,n,i),E.scissor(U.copy(X).multiplyScalar(W))},this.setScissorTest=function(t){E.setScissorTest(Y=t)},this.getClearColor=function(){return f.getClearColor()},this.setClearColor=function(){f.setClearColor.apply(f,arguments)},this.getClearAlpha=function(){return f.getClearAlpha()},this.setClearAlpha=function(){f.setClearAlpha.apply(f,arguments)},this.clear=function(t,e,n){var i=0;void 0!==t&&!t||(i|=16384),void 0!==e&&!e||(i|=256),void 0!==n&&!n||(i|=1024),M.clear(i)},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(){i.removeEventListener("webglcontextlost",at,!1),i.removeEventListener("webglcontextrestored",st,!1),p.dispose(),d.dispose(),_.dispose(),g.dispose(),rt.dispose(),ft.stop()},this.renderBufferImmediate=function(t,e){E.initAttributes();var n=_.get(t);t.hasPositions&&!n.position&&(n.position=M.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=M.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=M.createBuffer()),t.hasColors&&!n.color&&(n.color=M.createBuffer());var i=e.getAttributes();t.hasPositions&&(M.bindBuffer(34962,n.position),M.bufferData(34962,t.positionArray,35048),E.enableAttribute(i.position),M.vertexAttribPointer(i.position,3,5126,!1,0,0)),t.hasNormals&&(M.bindBuffer(34962,n.normal),M.bufferData(34962,t.normalArray,35048),E.enableAttribute(i.normal),M.vertexAttribPointer(i.normal,3,5126,!1,0,0)),t.hasUvs&&(M.bindBuffer(34962,n.uv),M.bufferData(34962,t.uvArray,35048),E.enableAttribute(i.uv),M.vertexAttribPointer(i.uv,2,5126,!1,0,0)),t.hasColors&&(M.bindBuffer(34962,n.color),M.bufferData(34962,t.colorArray,35048),E.enableAttribute(i.color),M.vertexAttribPointer(i.color,3,5126,!1,0,0)),E.disableUnusedAttributes(),M.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,i,r,o){var a=r.isMesh&&r.normalMatrix.determinant()<0;E.setMaterial(i,a);var s=yt(t,e,i,r),h=!1;D.geometry===n.id&&D.program===s.id&&D.wireframe===(!0===i.wireframe)||(D.geometry=n.id,D.program=s.id,D.wireframe=!0===i.wireframe,h=!0),r.morphTargetInfluences&&(L.update(r,n,i,s),h=!0);var l,c=n.index,u=n.attributes.position,p=1;!0===i.wireframe&&(c=C.getWireframeAttribute(n),p=2);var d=P;null!==c&&(l=A.get(c),(d=R).setIndex(l)),h&&(function(t,e,n){if(n&&n.isInstancedBufferGeometry&!T.isWebGL2&&null===S.get("ANGLE_instanced_arrays"))return console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");E.initAttributes();var i=n.attributes,r=e.getAttributes(),o=t.defaultAttributeValues;for(var a in r){var s=r[a];if(0<=s){var h=i[a];if(void 0!==h){var l=h.normalized,c=h.itemSize,u=A.get(h);if(void 0===u)continue;var p=u.buffer,d=u.type,f=u.bytesPerElement;if(h.isInterleavedBufferAttribute){var m=h.data,v=m.stride,g=h.offset;m&&m.isInstancedInterleavedBuffer?(E.enableAttributeAndDivisor(s,m.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=m.meshPerAttribute*m.count)):E.enableAttribute(s),M.bindBuffer(34962,p),M.vertexAttribPointer(s,c,d,l,v*f,g*f)}else h.isInstancedBufferAttribute?(E.enableAttributeAndDivisor(s,h.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=h.meshPerAttribute*h.count)):E.enableAttribute(s),M.bindBuffer(34962,p),M.vertexAttribPointer(s,c,d,l,0,0)}else if(void 0!==o){var y=o[a];if(void 0!==y)switch(y.length){case 2:M.vertexAttrib2fv(s,y);break;case 3:M.vertexAttrib3fv(s,y);break;case 4:M.vertexAttrib4fv(s,y);break;default:M.vertexAttrib1fv(s,y)}}}}E.disableUnusedAttributes()}(i,s,n),null!==c&&M.bindBuffer(34963,l.buffer));var f=1/0;null!==c?f=c.count:void 0!==u&&(f=u.count);var m=n.drawRange.start*p,v=n.drawRange.count*p,g=null!==o?o.start*p:0,y=null!==o?o.count*p:1/0,x=Math.max(m,g),b=Math.min(f,m+v,g+y)-1,w=Math.max(0,b-x+1);if(0!==w){if(r.isMesh)if(!0===i.wireframe)E.setLineWidth(i.wireframeLinewidth*et()),d.setMode(1);else switch(r.drawMode){case ze:d.setMode(4);break;case Ie:d.setMode(5);break;case De:d.setMode(6)}else if(r.isLine){var _=i.linewidth;void 0===_&&(_=1),E.setLineWidth(_*et()),r.isLineSegments?d.setMode(1):r.isLineLoop?d.setMode(2):d.setMode(3)}else r.isPoints?d.setMode(0):r.isSprite&&d.setMode(4);n&&n.isInstancedBufferGeometry?0<n.maxInstancedCount&&d.renderInstances(n,x,w):d.render(x,w)}},this.compile=function(n,t){(w=d.get(n,t)).init(),n.traverse(function(t){t.isLight&&(w.pushLight(t),t.castShadow&&w.pushShadow(t))}),w.setupLights(t),n.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var e=0;e<t.material.length;e++)gt(t.material[e],n.fog,t);else gt(t.material,n.fog,t)})};var ct=null;var ut,pt,dt,ft=new ri;function mt(t,e,n,i){for(var r=0,o=t.length;r<o;r++){var a=t[r],s=a.object,h=a.geometry,l=void 0===i?a.material:i,c=a.group;if(n.isArrayCamera)for(var u=(N=n).cameras,p=0,d=u.length;p<d;p++){var f=u[p];if(s.layers.test(f.layers)){if("viewport"in f)E.viewport(F.copy(f.viewport));else{var m=f.bounds,v=m.x*G,g=m.y*H,y=m.z*G,x=m.w*H;E.viewport(F.set(v,g,y,x).multiplyScalar(W))}w.setupLights(f),vt(s,e,f,h,l,c)}}else N=null,vt(s,e,n,h,l,c)}}function vt(t,e,n,i,r,o){if(t.onBeforeRender(O,e,n,i,r,o),w=d.get(e,N||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){E.setMaterial(r);var a=yt(n,e.fog,r,t);D.geometry=null,D.program=null,D.wireframe=!1,function(t,e){t.render(function(t){O.renderBufferImmediate(t,e)})}(t,a)}else O.renderBufferDirect(n,e.fog,i,r,t,o);t.onAfterRender(O,e,n,i,r,o),w=d.get(e,N||n)}function gt(t,e,n){var i=_.get(t),r=w.state.lights,o=w.state.shadowsArray,a=i.lightsHash,s=r.state.hash,h=y.getParameters(t,r.state,o,e,J.numPlanes,J.numIntersection,n),l=y.getProgramCode(t,h),c=i.program,u=!0;if(void 0===c)t.addEventListener("dispose",ht);else if(c.code!==l)lt(t);else if(a.stateID!==s.stateID||a.directionalLength!==s.directionalLength||a.pointLength!==s.pointLength||a.spotLength!==s.spotLength||a.rectAreaLength!==s.rectAreaLength||a.hemiLength!==s.hemiLength||a.shadowsLength!==s.shadowsLength)a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,u=!1;else{if(void 0!==h.shaderID)return;u=!1}if(u){if(h.shaderID){var p=ii[h.shaderID];i.shader={name:t.type,uniforms:Yn.clone(p.uniforms),vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}else i.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(i.shader,O),l=y.getProgramCode(t,h),c=y.acquireProgram(t,i.shader,h,l),i.program=c,t.program=c}var d=c.getAttributes();if(t.morphTargets)for(var f=t.numSupportedMorphTargets=0;f<O.maxMorphTargets;f++)0<=d["morphTarget"+f]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(f=t.numSupportedMorphNormals=0;f<O.maxMorphNormals;f++)0<=d["morphNormal"+f]&&t.numSupportedMorphNormals++;var m=i.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=J.numPlanes,i.numIntersection=J.numIntersection,m.clippingPlanes=J.uniform),i.fog=e,void 0===a&&(i.lightsHash=a={}),a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,t.lights&&(m.ambientLightColor.value=r.state.ambient,m.directionalLights.value=r.state.directional,m.spotLights.value=r.state.spot,m.rectAreaLights.value=r.state.rectArea,m.pointLights.value=r.state.point,m.hemisphereLights.value=r.state.hemi,m.directionalShadowMap.value=r.state.directionalShadowMap,m.directionalShadowMatrix.value=r.state.directionalShadowMatrix,m.spotShadowMap.value=r.state.spotShadowMap,m.spotShadowMatrix.value=r.state.spotShadowMatrix,m.pointShadowMap.value=r.state.pointShadowMap,m.pointShadowMatrix.value=r.state.pointShadowMatrix);var v=i.program.getUniforms(),g=ca.seqWithValue(v.seq,m);i.uniformsList=g}function yt(t,e,n,i){V=0;var r=_.get(n),o=w.state.lights,a=r.lightsHash,s=o.state.hash;if(K&&(Q||t!==B)){var h=t===B&&n.id===I;J.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,r,h)}!1===n.needsUpdate&&(void 0===r.program?n.needsUpdate=!0:n.fog&&r.fog!==e?n.needsUpdate=!0:(!n.lights||a.stateID===s.stateID&&a.directionalLength===s.directionalLength&&a.pointLength===s.pointLength&&a.spotLength===s.spotLength&&a.rectAreaLength===s.rectAreaLength&&a.hemiLength===s.hemiLength&&a.shadowsLength===s.shadowsLength)&&(void 0===r.numClippingPlanes||r.numClippingPlanes===J.numPlanes&&r.numIntersection===J.numIntersection)||(n.needsUpdate=!0)),n.needsUpdate&&(gt(n,e,i),n.needsUpdate=!1);var l=!1,c=!1,u=!1,p=r.program,d=p.getUniforms(),f=r.shader.uniforms;if(E.useProgram(p.program)&&(u=c=l=!0),n.id!==I&&(I=n.id,c=!0),l||B!==t){if(d.setValue(M,"projectionMatrix",t.projectionMatrix),T.logarithmicDepthBuffer&&d.setValue(M,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),B!==t&&(B=t,u=c=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var m=d.map.cameraPosition;void 0!==m&&m.setValue(M,tt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&d.setValue(M,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){d.setOptional(M,i,"bindMatrix"),d.setOptional(M,i,"bindMatrixInverse");var v=i.skeleton;if(v){var g=v.bones;if(T.floatVertexTextures){if(void 0===v.boneTexture){var y=Math.sqrt(4*g.length);y=Ye.ceilPowerOfTwo(y),y=Math.max(y,4);var x=new Float32Array(y*y*4);x.set(v.boneMatrices);var b=new Bn(x,y,y,te,qt);b.needsUpdate=!0,v.boneMatrices=x,v.boneTexture=b,v.boneTextureSize=y}d.setValue(M,"boneTexture",v.boneTexture),d.setValue(M,"boneTextureSize",v.boneTextureSize)}else d.setOptional(M,v,"boneMatrices")}}return c&&(d.setValue(M,"toneMappingExposure",O.toneMappingExposure),d.setValue(M,"toneMappingWhitePoint",O.toneMappingWhitePoint),n.lights&&function(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}(f,u),e&&n.fog&&function(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(f,e),n.isMeshBasicMaterial?xt(f,n):n.isMeshLambertMaterial?(xt(f,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(f,n)):n.isMeshPhongMaterial?(xt(f,n),n.isMeshToonMaterial?function(t,e){bt(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(f,n):bt(f,n)):n.isMeshStandardMaterial?(xt(f,n),n.isMeshPhysicalMaterial?function(t,e){wt(t,e),t.reflectivity.value=e.reflectivity,t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness}(f,n):wt(f,n)):n.isMeshMatcapMaterial?(xt(f,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===St&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===St&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(f,n)):n.isMeshDepthMaterial?(xt(f,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(f,n)):n.isMeshDistanceMaterial?(xt(f,n),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}(f,n)):n.isMeshNormalMaterial?(xt(f,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===St&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===St&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(f,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}(f,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(f,n)):n.isPointsMaterial?function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*W,t.scale.value=.5*H,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(f,n):n.isSpriteMaterial?function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.rotation.value=e.rotation,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(f,n):n.isShadowMaterial&&(f.color.value=n.color,f.opacity.value=n.opacity),void 0!==f.ltc_1&&(f.ltc_1.value=ni.LTC_1),void 0!==f.ltc_2&&(f.ltc_2.value=ni.LTC_2),ca.upload(M,r.uniformsList,f,O)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(ca.upload(M,r.uniformsList,f,O),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&d.setValue(M,"center",i.center),d.setValue(M,"modelViewMatrix",i.modelViewMatrix),d.setValue(M,"normalMatrix",i.normalMatrix),d.setValue(M,"modelMatrix",i.matrixWorld),p}function xt(t,e){var n;t.opacity.value=e.opacity,e.color&&(t.diffuse.value=e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap&&e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=_.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function bt(t,e){t.specular.value=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,e.side===St&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===St&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function wt(t,e){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,e.side===St&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===St&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}ft.setAnimationLoop(function(t){rt.isPresenting()||ct&&ct(t)}),"undefined"!=typeof window&&ft.setContext(window),this.setAnimationLoop=function(t){ct=t,rt.setAnimationLoop(t),ft.start()},this.render=function(t,e,n,i){if(e&&e.isCamera){if(!x){D.geometry=null,D.program=null,D.wireframe=!1,I=-1,!(B=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),rt.enabled&&(e=rt.getCamera(e)),(w=d.get(t,e)).init(),t.onBeforeRender(O,t,e,n),$.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Z.setFromMatrix($),this.dynamicValue&&this._sfcCamera.set(e.projectionMatrix.toArray(),e.matrixWorldInverse.toArray(),{x:e.position.x,y:e.position.y,z:e.position.z},{x:e.up.x,y:e.up.y,z:e.up.z}),Q=this.localClippingEnabled,K=J.init(this.clippingPlanes,Q,e),(v=p.get(t,e)).init(),function t(e,n,i){if(!1===e.visible)return;var r=e.layers.test(n.layers);if(r)if(e.isLight)w.pushLight(e),e.castShadow&&w.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Z.intersectsSprite(e)){i&&tt.setFromMatrixPosition(e.matrixWorld).applyMatrix4($);var o=g.update(e),a=e.material;v.push(e,o,a,tt.z,null)}}else if(e.isImmediateRenderObject)i&&tt.setFromMatrixPosition(e.matrixWorld).applyMatrix4($),v.push(e,null,e.material,tt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||Z.intersectsObject(e)))if(O.dynamicValue){var s=new jn,o=e.geometry;null===o.boundingSphere&&o.computeBoundingSphere(),s.copy(o.boundingSphere).applyMatrix4(e.matrixWorld);var h=s.center,l=s.radius;if(O._sfcCulling.compute({center:{x:h.x,y:h.y,z:h.z},radius:l,id:e.id},O._sfcCamera)){i&&tt.setFromMatrixPosition(e.matrixWorld).applyMatrix4($);var o=g.update(e),a=e.material;if(Array.isArray(a))for(var c=o.groups,u=0,p=c.length;u<p;u++){var d=c[u],f=a[d.materialIndex];f&&f.visible&&v.push(e,o,f,tt.z,d)}else a.visible&&v.push(e,o,a,tt.z,null)}}else{i&&tt.setFromMatrixPosition(e.matrixWorld).applyMatrix4($);var o=g.update(e),a=e.material;if(Array.isArray(a))for(var c=o.groups,u=0,p=c.length;u<p;u++){var d=c[u],f=a[d.materialIndex];f&&f.visible&&v.push(e,o,f,tt.z,d)}else a.visible&&v.push(e,o,a,tt.z,null)}var m=e.children;for(var u=0,p=m.length;u<p;u++)t(m[u],n,i)}(t,e,O.sortObjects),!0===O.sortObjects&&v.sort(),K&&J.beginShadows();var r=w.state.shadowsArray;ot.render(r,t,e),w.setupLights(e),K&&J.endShadows(),this.info.autoReset&&this.info.reset(),void 0===n&&(n=null),this.setRenderTarget(n),f.render(v,t,e,i);var o=v.opaque,a=v.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&mt(o,t,e,s),a.length&&mt(a,t,e,s)}else o.length&&mt(o,t,e),a.length&&mt(a,t,e);n&&u.updateRenderTargetMipmap(n),E.buffers.depth.setTest(!0),E.buffers.depth.setMask(!0),E.buffers.color.setMask(!0),E.setPolygonOffset(!1),t.onAfterRender(O,t,e),rt.enabled&&rt.submitFrame(),w=v=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.allocTextureUnit=function(){var t=V;return t>=T.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+T.maxTextures),V+=1,t},this.setTexture2D=(ut=!1,function(t,e){t&&t.isWebGLRenderTarget&&(ut||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),ut=!0),t=t.texture),u.setTexture2D(t,e)}),this.setTexture3D=function(t,e){u.setTexture3D(t,e)},this.setTexture=(pt=!1,function(t,e){pt||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),pt=!0),u.setTexture2D(t,e)}),this.setTextureCube=(dt=!1,function(t,e){t&&t.isWebGLRenderTargetCube&&(dt||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),dt=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?u.setTextureCube(t,e):u.setTextureCubeDynamic(t,e)}),this.setFramebuffer=function(t){b=t},this.getRenderTarget=function(){return k},this.setRenderTarget=function(t){(k=t)&&void 0===_.get(t).__webglFramebuffer&&u.setupRenderTarget(t);var e=b,n=!1;if(t){var i=_.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(e=i[t.activeCubeFace],n=!0):e=i,F.copy(t.viewport),U.copy(t.scissor),j=t.scissorTest}else F.copy(q).multiplyScalar(W),U.copy(X).multiplyScalar(W),j=Y;if(z!==e&&(M.bindFramebuffer(36160,e),z=e),E.viewport(F),E.scissor(U),E.setScissorTest(j),n){var r=_.get(t.texture);M.framebufferTexture2D(36160,36064,34069+t.activeCubeFace,r.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,n,i,r,o){if(t&&t.isWebGLRenderTarget){var a=_.get(t).__webglFramebuffer;if(a){var s=!1;a!==z&&(M.bindFramebuffer(36160,a),s=!0);try{var h=t.texture,l=h.format,c=h.type;if(l!==te&&m.convert(l)!==M.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===Ut||m.convert(c)===M.getParameter(35738)||c===qt&&(T.isWebGL2||S.get("OES_texture_float")||S.get("WEBGL_color_buffer_float"))||c===Xt&&(T.isWebGL2?S.get("EXT_color_buffer_float"):S.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===M.checkFramebufferStatus(36160)?0<=e&&e<=t.width-i&&0<=n&&n<=t.height-r&&M.readPixels(e,n,i,r,m.convert(l),m.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&M.bindFramebuffer(36160,z)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){var i=e.image.width,r=e.image.height,o=m.convert(e.format);this.setTexture2D(e,0),M.copyTexImage2D(3553,n||0,o,t.x,t.y,i,r,0)},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,o=e.image.height,a=m.convert(n.format),s=m.convert(n.type);this.setTexture2D(n,0),e.isDataTexture?M.texSubImage2D(3553,i||0,t.x,t.y,r,o,a,s,e.image.data):M.texSubImage2D(3553,i||0,t.x,t.y,a,s,e.image)}}function _s(t,e){this.name="",this.color=new Jn(t),this.density=void 0!==e?e:25e-5}function Ms(t,e,n){this.name="",this.color=new Jn(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Ss(){Ci.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Ts(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Es(t,e,n,i){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===i}function As(t){Qr.call(this),this.type="SpriteMaterial",this.color=new Jn(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function Cs(t){if(Ci.call(this),this.type="Sprite",void 0===Va){Va=new sr;var e=new Ts(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Va.setIndex([0,1,2,0,2,3]),Va.addAttribute("position",new Es(e,3,0,!1)),Va.addAttribute("uv",new Es(e,2,3,!1))}this.geometry=Va,this.material=void 0!==t?t:new As,this.center=new Ze(.5,.5)}function Ls(t,e,n,i,r,o){qa.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Xa.x=o*qa.x-r*qa.y,Xa.y=r*qa.x+o*qa.y):Xa.copy(qa),t.copy(e),t.x+=Xa.x,t.y+=Xa.y,t.applyMatrix4(Ya)}function Ps(){Ci.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Rs(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),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,i=this.bones.length;n<i;n++)this.boneInverses.push(new Je)}}function Os(){Ci.call(this),this.type="Bone"}function ks(t,e){io.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Je,this.bindMatrixInverse=new Je;var n=new Rs(this.initBones());this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function zs(t){Qr.call(this),this.type="LineBasicMaterial",this.color=new Jn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function Is(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Ci.call(this),this.type="Line",this.geometry=void 0!==t?t:new sr,this.material=void 0!==e?e:new zs({color:16777215*Math.random()})}function Ds(t,e){Is.call(this,t,e),this.type="LineSegments"}function Bs(t,e){Is.call(this,t,e),this.type="LineLoop"}function Ns(t){Qr.call(this),this.type="PointsMaterial",this.color=new Jn(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function Fs(t,e){Ci.call(this),this.type="Points",this.geometry=void 0!==t?t:new sr,this.material=void 0!==e?e:new Ns({color:16777215*Math.random()})}function Us(t,e,n,i,r,o,a,s,h){kn.call(this,t,e,n,i,r,o,a,s,h),this.format=void 0!==a?a:$t,this.minFilter=void 0!==o?o:Bt,this.magFilter=void 0!==r?r:Bt,this.generateMipmaps=!1}function js(t,e,n,i,r,o,a,s,h,l,c,u){kn.call(this,null,o,a,s,h,l,i,r,c,u),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Vs(t,e,n,i,r,o,a,s,h){kn.call(this,t,e,n,i,r,o,a,s,h),this.needsUpdate=!0}function Gs(t,e,n,i,r,o,a,s,h,l){if((l=void 0!==l?l:ie)!==ie&&l!==re)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===ie&&(n=Gt),void 0===n&&l===re&&(n=Kt),kn.call(this,null,i,r,o,a,s,l,n,h),this.image={width:t,height:e},this.magFilter=void 0!==a?a:kt,this.minFilter=void 0!==s?s:kt,this.flipY=!1,this.generateMipmaps=!1}function Hs(t){sr.call(this),this.type="WireframeGeometry";var e,n,i,r,o,a,s,h,l,c,u=[],p=[0,0],d={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,i=m.length;e<i;e++){var v=m[e];for(n=0;n<3;n++)s=v[f[n]],h=v[f[(n+1)%3]],p[0]=Math.min(s,h),p[1]=Math.max(s,h),void 0===d[l=p[0]+","+p[1]]&&(d[l]={index1:p[0],index2:p[1]})}for(l in d)a=d[l],c=t.vertices[a.index1],u.push(c.x,c.y,c.z),c=t.vertices[a.index2],u.push(c.x,c.y,c.z)}else if(t&&t.isBufferGeometry){var g,y,x,b,w,_;if(c=new Qe,null!==t.index){for(g=t.attributes.position,y=t.index,0===(x=t.groups).length&&(x=[{start:0,count:y.count,materialIndex:0}]),r=0,o=x.length;r<o;++r)for(i=(e=(b=x[r]).start)+b.count;e<i;e+=3)for(n=0;n<3;n++)s=y.getX(e+n),h=y.getX(e+(n+1)%3),p[0]=Math.min(s,h),p[1]=Math.max(s,h),void 0===d[l=p[0]+","+p[1]]&&(d[l]={index1:p[0],index2:p[1]});for(l in d)a=d[l],c.fromBufferAttribute(g,a.index1),u.push(c.x,c.y,c.z),c.fromBufferAttribute(g,a.index2),u.push(c.x,c.y,c.z)}else for(e=0,i=(g=t.attributes.position).count/3;e<i;e++)for(n=0;n<3;n++)w=3*e+n,c.fromBufferAttribute(g,w),u.push(c.x,c.y,c.z),_=3*e+(n+1)%3,c.fromBufferAttribute(g,_),u.push(c.x,c.y,c.z)}this.addAttribute("position",new qi(u,3))}function Ws(t,e,n){Bi.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new qs(t,e,n)),this.mergeVertices()}function qs(t,e,n){sr.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var i,r,o=[],a=[],s=[],h=[],l=new Qe,c=new Qe,u=new Qe,p=new Qe,d=new Qe;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var f=e+1;for(i=0;i<=n;i++){var m=i/n;for(r=0;r<=e;r++){var v=r/e;t(v,m,c),a.push(c.x,c.y,c.z),0<=v-1e-5?(t(v-1e-5,m,u),p.subVectors(c,u)):(t(1e-5+v,m,u),p.subVectors(u,c)),0<=m-1e-5?(t(v,m-1e-5,u),d.subVectors(c,u)):(t(v,1e-5+m,u),d.subVectors(u,c)),l.crossVectors(p,d).normalize(),s.push(l.x,l.y,l.z),h.push(v,m)}}for(i=0;i<n;i++)for(r=0;r<e;r++){var g=i*f+r,y=i*f+r+1,x=(i+1)*f+r+1,b=(i+1)*f+r;o.push(g,y,b),o.push(y,x,b)}this.setIndex(o),this.addAttribute("position",new qi(a,3)),this.addAttribute("normal",new qi(s,3)),this.addAttribute("uv",new qi(h,2))}function Xs(t,e,n,i){Bi.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new Ys(t,e,n,i)),this.mergeVertices()}function Ys(i,o,t,e){sr.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:i,indices:o,radius:t,detail:e},t=t||1;var c=[],u=[];function a(t,e,n,i){var r,o,a=Math.pow(2,i),s=[];for(r=0;r<=a;r++){s[r]=[];var h=t.clone().lerp(n,r/a),l=e.clone().lerp(n,r/a),c=a-r;for(o=0;o<=c;o++)s[r][o]=0===o&&r===a?h:h.clone().lerp(l,o/c)}for(r=0;r<a;r++)for(o=0;o<2*(a-r)-1;o++){var u=Math.floor(o/2);o%2==0?(p(s[r][u+1]),p(s[r+1][u]),p(s[r][u])):(p(s[r][u+1]),p(s[r+1][u+1]),p(s[r+1][u]))}}function p(t){c.push(t.x,t.y,t.z)}function s(t,e){var n=3*t;e.x=i[0+n],e.y=i[1+n],e.z=i[2+n]}function d(t,e,n,i){i<0&&1===t.x&&(u[e]=t.x-1),0===n.x&&0===n.z&&(u[e]=i/2/Math.PI+.5)}function f(t){return Math.atan2(t.z,-t.x)}!function(t){for(var e=new Qe,n=new Qe,i=new Qe,r=0;r<o.length;r+=3)s(o[r+0],e),s(o[r+1],n),s(o[r+2],i),a(e,n,i,t)}(e=e||0),function(t){for(var e=new Qe,n=0;n<c.length;n+=3)e.x=c[n+0],e.y=c[n+1],e.z=c[n+2],e.normalize().multiplyScalar(t),c[n+0]=e.x,c[n+1]=e.y,c[n+2]=e.z}(t),function(){for(var t=new Qe,e=0;e<c.length;e+=3){t.x=c[e+0],t.y=c[e+1],t.z=c[e+2];var n=f(t)/2/Math.PI+.5,i=(r=t,Math.atan2(-r.y,Math.sqrt(r.x*r.x+r.z*r.z))/Math.PI+.5);u.push(n,1-i)}var r;(function(){for(var t=new Qe,e=new Qe,n=new Qe,i=new Qe,r=new Ze,o=new Ze,a=new Ze,s=0,h=0;s<c.length;s+=9,h+=6){t.set(c[s+0],c[s+1],c[s+2]),e.set(c[s+3],c[s+4],c[s+5]),n.set(c[s+6],c[s+7],c[s+8]),r.set(u[h+0],u[h+1]),o.set(u[h+2],u[h+3]),a.set(u[h+4],u[h+5]),i.copy(t).add(e).add(n).divideScalar(3);var l=f(i);d(r,h+0,t,l),d(o,h+2,e,l),d(a,h+4,n,l)}})(),function(){for(var t=0;t<u.length;t+=6){var e=u[t+0],n=u[t+2],i=u[t+4],r=Math.max(e,n,i),o=Math.min(e,n,i);.9<r&&o<.1&&(e<.2&&(u[t+0]+=1),n<.2&&(u[t+2]+=1),i<.2&&(u[t+4]+=1))}}()}(),this.addAttribute("position",new qi(c,3)),this.addAttribute("normal",new qi(c.slice(),3)),this.addAttribute("uv",new qi(u,2)),0===e?this.computeVertexNormals():this.normalizeNormals()}function Zs(t,e){Bi.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Js(t,e)),this.mergeVertices()}function Js(t,e){Ys.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 Ks(t,e){Bi.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Qs(t,e)),this.mergeVertices()}function Qs(t,e){Ys.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 $s(t,e){Bi.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new th(t,e)),this.mergeVertices()}function th(t,e){var n=(1+Math.sqrt(5))/2;Ys.call(this,[-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],[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 eh(t,e){Bi.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new nh(t,e)),this.mergeVertices()}function nh(t,e){var n=(1+Math.sqrt(5))/2,i=1/n;Ys.call(this,[-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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,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 ih(t,e,n,i,r,o){Bi.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new rh(t,e,n,i,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function rh(a,s,h,l,t){sr.call(this),this.type="TubeBufferGeometry",this.parameters={path:a,tubularSegments:s,radius:h,radialSegments:l,closed:t},s=s||64,h=h||1,l=l||8,t=t||!1;var c=a.computeFrenetFrames(s,t);this.tangents=c.tangents,this.normals=c.normals,this.binormals=c.binormals;var r,u,p=new Qe,d=new Qe,e=new Ze,f=new Qe,m=[],v=[],n=[],o=[];function i(t){f=a.getPointAt(t/s,f);var e=c.normals[t],n=c.binormals[t];for(u=0;u<=l;u++){var i=u/l*Math.PI*2,r=Math.sin(i),o=-Math.cos(i);d.x=o*e.x+r*n.x,d.y=o*e.y+r*n.y,d.z=o*e.z+r*n.z,d.normalize(),v.push(d.x,d.y,d.z),p.x=f.x+h*d.x,p.y=f.y+h*d.y,p.z=f.z+h*d.z,m.push(p.x,p.y,p.z)}}!function(){for(r=0;r<s;r++)i(r);i(!1===t?s:0),function(){for(r=0;r<=s;r++)for(u=0;u<=l;u++)e.x=r/s,e.y=u/l,n.push(e.x,e.y)}(),function(){for(u=1;u<=s;u++)for(r=1;r<=l;r++){var t=(l+1)*(u-1)+(r-1),e=(l+1)*u+(r-1),n=(l+1)*u+r,i=(l+1)*(u-1)+r;o.push(t,e,i),o.push(e,n,i)}}()}(),this.setIndex(o),this.addAttribute("position",new qi(m,3)),this.addAttribute("normal",new qi(v,3)),this.addAttribute("uv",new qi(n,2))}function oh(t,e,n,i,r,o,a){Bi.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new ah(t,e,n,i,r,o)),this.mergeVertices()}function ah(t,e,n,i,r,o){sr.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,o=o||3;var a,s,h=[],l=[],c=[],u=[],p=new Qe,d=new Qe,f=new Qe,m=new Qe,v=new Qe,g=new Qe,y=new Qe;for(a=0;a<=n;++a){var x=a/n*r*Math.PI*2;for(A(x,r,o,t,f),A(.01+x,r,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<=i;++s){var b=s/i*Math.PI*2,w=-e*Math.cos(b),_=e*Math.sin(b);p.x=f.x+(w*y.x+_*v.x),p.y=f.y+(w*y.y+_*v.y),p.z=f.z+(w*y.z+_*v.z),l.push(p.x,p.y,p.z),d.subVectors(p,f).normalize(),c.push(d.x,d.y,d.z),u.push(a/n),u.push(s/i)}}for(s=1;s<=n;s++)for(a=1;a<=i;a++){var M=(i+1)*(s-1)+(a-1),S=(i+1)*s+(a-1),T=(i+1)*s+a,E=(i+1)*(s-1)+a;h.push(M,S,E),h.push(S,T,E)}function A(t,e,n,i,r){var o=Math.cos(t),a=Math.sin(t),s=n/e*t,h=Math.cos(s);r.x=i*(2+h)*.5*o,r.y=i*(2+h)*a*.5,r.z=i*Math.sin(s)*.5}this.setIndex(h),this.addAttribute("position",new qi(l,3)),this.addAttribute("normal",new qi(c,3)),this.addAttribute("uv",new qi(u,2))}function sh(t,e,n,i,r){Bi.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new hh(t,e,n,i,r)),this.mergeVertices()}function hh(t,e,n,i,r){sr.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var o,a,s=[],h=[],l=[],c=[],u=new Qe,p=new Qe,d=new Qe;for(o=0;o<=n;o++)for(a=0;a<=i;a++){var f=a/i*r,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),h.push(p.x,p.y,p.z),u.x=t*Math.cos(f),u.y=t*Math.sin(f),d.subVectors(p,u).normalize(),l.push(d.x,d.y,d.z),c.push(a/i),c.push(o/n)}for(o=1;o<=n;o++)for(a=1;a<=i;a++){var v=(i+1)*o+a-1,g=(i+1)*(o-1)+a-1,y=(i+1)*(o-1)+a,x=(i+1)*o+a;s.push(v,g,x),s.push(g,y,x)}this.setIndex(s),this.addAttribute("position",new qi(h,3)),this.addAttribute("normal",new qi(l,3)),this.addAttribute("uv",new qi(c,2))}_s.prototype.isFogExp2=!0,_s.prototype.clone=function(){return new _s(this.color,this.density)},_s.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},Ms.prototype.isFog=!0,Ms.prototype.clone=function(){return new Ms(this.color,this.near,this.far)},Ms.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Ss.prototype=Object.assign(Object.create(Ci.prototype),{constructor:Ss,copy:function(t,e){return Ci.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=Ci.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}),Object.defineProperty(Ts.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Ts.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(Es.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Es.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,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]=i,this},setXYZW:function(t,e,n,i,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]=i,this.data.array[t+3]=r,this}}),((As.prototype=Object.create(Qr.prototype)).constructor=As).prototype.isSpriteMaterial=!0,As.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},Cs.prototype=Object.assign(Object.create(Ci.prototype),{constructor:Cs,isSprite:!0,raycast:(Ga=new Qe,Ha=new Qe,Wa=new Qe,qa=new Ze,Xa=new Ze,Ya=new Je,Za=new Qe,Ja=new Qe,Ka=new Qe,Qa=new Ze,$a=new Ze,ts=new Ze,function(t,e){Ha.setFromMatrixScale(this.matrixWorld),Ya.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld),Wa.setFromMatrixPosition(this.modelViewMatrix);var n,i,r=this.material.rotation;0!==r&&(i=Math.cos(r),n=Math.sin(r));var o=this.center;Ls(Za.set(-.5,-.5,0),Wa,o,Ha,n,i),Ls(Ja.set(.5,-.5,0),Wa,o,Ha,n,i),Ls(Ka.set(.5,.5,0),Wa,o,Ha,n,i),Qa.set(0,0),$a.set(1,0),ts.set(1,1);var a=t.ray.intersectTriangle(Za,Ja,Ka,!1,Ga);if(null!==a||(Ls(Ja.set(-.5,.5,0),Wa,o,Ha,n,i),$a.set(0,1),null!==(a=t.ray.intersectTriangle(Za,Ka,Ja,!1,Ga)))){var s=t.ray.origin.distanceTo(Ga);s<t.near||s>t.far||e.push({distance:s,point:Ga.clone(),uv:eo.getUV(Ga,Za,Ja,Ka,Qa,$a,ts,new Ze),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Ci.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),Ps.prototype=Object.assign(Object.create(Ci.prototype),{constructor:Ps,copy:function(t){Ci.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n<i;n++){var r=e[n];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,i=0;i<n.length&&!(e<n[i].distance);i++);n.splice(i,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,n=1,i=e.length;n<i&&!(t<e[n].distance);n++);return e[n-1].object},raycast:(is=new Qe,function(t,e){is.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(is);this.getObjectForDistance(n).raycast(t,e)}),update:(es=new Qe,ns=new Qe,function(t){var e=this.levels;if(1<e.length){es.setFromMatrixPosition(t.matrixWorld),ns.setFromMatrixPosition(this.matrixWorld);var n=es.distanceTo(ns);e[0].object.visible=!0;for(var i=1,r=e.length;i<r&&n>=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(;i<r;i++)e[i].object.visible=!1}}),toJSON:function(t){var e=Ci.prototype.toJSON.call(this,t);e.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var o=n[i];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),Object.assign(Rs.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new Je;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:(rs=new Je,os=new Je,function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,o=t.length;r<o;r++){var a=t[r]?t[r].matrixWorld:os;rs.multiplyMatrices(a,e[r]),rs.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)}),clone:function(){return new Rs(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var i=this.bones[e];if(i.name===t)return i}}}),Os.prototype=Object.assign(Object.create(Ci.prototype),{constructor:Os,isBone:!0}),ks.prototype=Object.assign(Object.create(io.prototype),{constructor:ks,isSkinnedMesh:!0,initBones:function(){var t,e,n,i,r=[];if(this.geometry&&void 0!==this.geometry.bones){for(n=0,i=this.geometry.bones.length;n<i;n++)e=this.geometry.bones[n],t=new Os,r.push(t),t.name=e.name,t.position.fromArray(e.pos),t.quaternion.fromArray(e.rotq),void 0!==e.scl&&t.scale.fromArray(e.scl);for(n=0,i=this.geometry.bones.length;n<i;n++)-1!==(e=this.geometry.bones[n]).parent&&null!==e.parent&&void 0!==r[e.parent]?r[e.parent].add(r[n]):this.add(r[n])}return this.updateMatrixWorld(!0),r},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(){var t,e;if(this.geometry&&this.geometry.isGeometry)for(e=0;e<this.geometry.skinWeights.length;e++){var n=this.geometry.skinWeights[e];(t=1/n.manhattanLength())!==1/0?n.multiplyScalar(t):n.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var i=new zn,r=this.geometry.attributes.skinWeight;for(e=0;e<r.count;e++)i.x=r.getX(e),i.y=r.getY(e),i.z=r.getZ(e),i.w=r.getW(e),(t=1/i.manhattanLength())!==1/0?i.multiplyScalar(t):i.set(1,0,0,0),r.setXYZW(e,i.x,i.y,i.z,i.w)}},updateMatrixWorld:function(t){io.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)}}),((zs.prototype=Object.create(Qr.prototype)).constructor=zs).prototype.isLineBasicMaterial=!0,zs.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},Is.prototype=Object.assign(Object.create(Ci.prototype),{constructor:Is,isLine:!0,computeLineDistances:(ls=new Qe,cs=new Qe,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],i=1,r=e.count;i<r;i++)ls.fromBufferAttribute(e,i-1),cs.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=ls.distanceTo(cs);t.addAttribute("lineDistance",new qi(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;for((n=t.lineDistances)[0]=0,i=1,r=o.length;i<r;i++)n[i]=n[i-1],n[i]+=o[i-1].distanceTo(o[i])}return this}),raycast:(as=new Je,ss=new to,hs=new jn,function(t,e){var n=t.linePrecision,i=this.geometry,r=this.matrixWorld;if(null===i.boundingSphere&&i.computeBoundingSphere(),hs.copy(i.boundingSphere),hs.applyMatrix4(r),hs.radius+=n,!1!==t.ray.intersectsSphere(hs)){as.getInverse(r),ss.copy(t.ray).applyMatrix4(as);var o=n/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,s=new Qe,h=new Qe,l=new Qe,c=new Qe,u=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var p=i.index,d=i.attributes.position.array;if(null!==p)for(var f=p.array,m=0,v=f.length-1;m<v;m+=u){var g=f[m],y=f[m+1];s.fromArray(d,3*g),h.fromArray(d,3*y),a<ss.distanceSqToSegment(s,h,c,l)||(c.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(c))<t.near||w>t.far||e.push({distance:w,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else for(m=0,v=d.length/3-1;m<v;m+=u)s.fromArray(d,3*m),h.fromArray(d,3*m+3),a<ss.distanceSqToSegment(s,h,c,l)||(c.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(c))<t.near||w>t.far||e.push({distance:w,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}else if(i.isGeometry){var x=i.vertices,b=x.length;for(m=0;m<b-1;m+=u){var w;a<ss.distanceSqToSegment(x[m],x[m+1],c,l)||(c.applyMatrix4(this.matrixWorld),(w=t.ray.origin.distanceTo(c))<t.near||w>t.far||e.push({distance:w,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}))}}}}),copy:function(t){return Ci.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),Ds.prototype=Object.assign(Object.create(Is.prototype),{constructor:Ds,isLineSegments:!0,computeLineDistances:(us=new Qe,ps=new Qe,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],i=0,r=e.count;i<r;i+=2)us.fromBufferAttribute(e,i),ps.fromBufferAttribute(e,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+us.distanceTo(ps);t.addAttribute("lineDistance",new qi(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,i=0,r=o.length;i<r;i+=2)us.copy(o[i]),ps.copy(o[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+us.distanceTo(ps)}return this})}),Bs.prototype=Object.assign(Object.create(Is.prototype),{constructor:Bs,isLineLoop:!0}),((Ns.prototype=Object.create(Qr.prototype)).constructor=Ns).prototype.isPointsMaterial=!0,Ns.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},Fs.prototype=Object.assign(Object.create(Ci.prototype),{constructor:Fs,isPoints:!0,raycast:(ds=new Je,fs=new to,ms=new jn,function(r,o){var a=this,t=this.geometry,s=this.matrixWorld,e=r.params.Points.threshold;if(null===t.boundingSphere&&t.computeBoundingSphere(),ms.copy(t.boundingSphere),ms.applyMatrix4(s),ms.radius+=e,!1!==r.ray.intersectsSphere(ms)){ds.getInverse(s),fs.copy(r.ray).applyMatrix4(ds);var n=e/((this.scale.x+this.scale.y+this.scale.z)/3),h=n*n,i=new Qe,l=new Qe;if(t.isBufferGeometry){var c=t.index,u=t.attributes.position.array;if(null!==c)for(var p=c.array,d=0,f=p.length;d<f;d++){var m=p[d];i.fromArray(u,3*m),y(i,m)}else{d=0;for(var v=u.length/3;d<v;d++)i.fromArray(u,3*d),y(i,d)}}else{var g=t.vertices;for(d=0,v=g.length;d<v;d++)y(g[d],d)}}function y(t,e){var n=fs.distanceSqToPoint(t);if(n<h){fs.closestPointToPoint(t,l),l.applyMatrix4(s);var i=r.ray.origin.distanceTo(l);if(i<r.near||i>r.far)return;o.push({distance:i,distanceToRay:Math.sqrt(n),point:l.clone(),index:e,face:null,object:a})}}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Us.prototype=Object.assign(Object.create(kn.prototype),{constructor:Us,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((js.prototype=Object.create(kn.prototype)).constructor=js).prototype.isCompressedTexture=!0,((Vs.prototype=Object.create(kn.prototype)).constructor=Vs).prototype.isCanvasTexture=!0,((Gs.prototype=Object.create(kn.prototype)).constructor=Gs).prototype.isDepthTexture=!0,(Hs.prototype=Object.create(sr.prototype)).constructor=Hs,(Ws.prototype=Object.create(Bi.prototype)).constructor=Ws,(qs.prototype=Object.create(sr.prototype)).constructor=qs,(Xs.prototype=Object.create(Bi.prototype)).constructor=Xs,(Ys.prototype=Object.create(sr.prototype)).constructor=Ys,(Zs.prototype=Object.create(Bi.prototype)).constructor=Zs,(Js.prototype=Object.create(Ys.prototype)).constructor=Js,(Ks.prototype=Object.create(Bi.prototype)).constructor=Ks,(Qs.prototype=Object.create(Ys.prototype)).constructor=Qs,($s.prototype=Object.create(Bi.prototype)).constructor=$s,(th.prototype=Object.create(Ys.prototype)).constructor=th,(eh.prototype=Object.create(Bi.prototype)).constructor=eh,(nh.prototype=Object.create(Ys.prototype)).constructor=nh,(ih.prototype=Object.create(Bi.prototype)).constructor=ih,(rh.prototype=Object.create(sr.prototype)).constructor=rh,(oh.prototype=Object.create(Bi.prototype)).constructor=oh,(ah.prototype=Object.create(sr.prototype)).constructor=ah,(sh.prototype=Object.create(Bi.prototype)).constructor=sh,(hh.prototype=Object.create(sr.prototype)).constructor=hh;var lh=function(t,e,n){n=n||2;var i,r,o,a,s,h,l,c=e&&e.length,u=c?e[0]*n:t.length,p=ch(t,0,u,n,!0),d=[];if(!p)return d;if(c&&(p=function(t,e,n,i){var r,o,a,s,h,l=[];for(r=0,o=e.length;r<o;r++)a=e[r]*i,s=r<o-1?e[r+1]*i:t.length,(h=ch(t,a,s,i,!1))===h.next&&(h.steiner=!0),l.push(bh(h));for(l.sort(gh),r=0;r<l.length;r++)yh(l[r],n),n=uh(n,n.next);return n}(t,e,p,n)),t.length>80*n){i=o=t[0],r=a=t[1];for(var f=n;f<u;f+=n)(s=t[f])<i&&(i=s),(h=t[f+1])<r&&(r=h),o<s&&(o=s),a<h&&(a=h);l=0!==(l=Math.max(o-i,a-r))?1/l:0}return ph(p,d,n,i,r,l),d};function ch(t,e,n,i,r){var o,a;if(r===0<function(t,e,n,i){for(var r=0,o=e,a=n-i;o<n;o+=i)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}(t,e,n,i))for(o=e;o<n;o+=i)a=Ah(o,t[o],t[o+1],a);else for(o=n-i;e<=o;o-=i)a=Ah(o,t[o],t[o+1],a);return a&&Mh(a,a.next)&&(Ch(a),a=a.next),a}function uh(t,e){if(!t)return t;e=e||t;var n,i=t;do{if(n=!1,i.steiner||!Mh(i,i.next)&&0!==_h(i.prev,i,i.next))i=i.next;else{if(Ch(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function ph(t,e,n,i,r,o,a){if(t){!a&&o&&function(t,e,n,i){var r=t;for(;null===r.z&&(r.z=xh(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,a,s,h,l=1;do{for(n=t,o=t=null,a=0;n;){for(a++,i=n,e=s=0;e<l&&(s++,i=i.nextZ);e++);for(h=l;0<s||0<h&&i;)0!==s&&(0===h||!i||n.z<=i.z)?(n=(r=n).nextZ,s--):(i=(r=i).nextZ,h--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(1<a)}(r)}(t,i,r,o);for(var s,h,l=t;t.prev!==t.next;)if(s=t.prev,h=t.next,o?fh(t,i,r,o):dh(t))e.push(s.i/n),e.push(t.i/n),e.push(h.i/n),Ch(t),t=h.next,l=h.next;else if((t=h)===l){a?1===a?ph(t=mh(t,e,n),e,n,i,r,o,2):2===a&&vh(t,e,n,i,r,o):ph(uh(t),e,n,i,r,o,1);break}}}function dh(t){var e=t.prev,n=t,i=t.next;if(0<=_h(e,n,i))return!1;for(var r=t.next.next;r!==t.prev;){if(wh(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&0<=_h(r.prev,r,r.next))return!1;r=r.next}return!0}function fh(t,e,n,i){var r=t.prev,o=t,a=t.next;if(0<=_h(r,o,a))return!1;for(var s=r.x<o.x?r.x<a.x?r.x:a.x:o.x<a.x?o.x:a.x,h=r.y<o.y?r.y<a.y?r.y:a.y:o.y<a.y?o.y:a.y,l=r.x>o.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,c=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,u=xh(s,h,e,n,i),p=xh(l,c,e,n,i),d=t.nextZ;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&wh(r.x,r.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=_h(d.prev,d,d.next))return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=u;){if(d!==t.prev&&d!==t.next&&wh(r.x,r.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=_h(d.prev,d,d.next))return!1;d=d.prevZ}return!0}function mh(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!Mh(r,o)&&Sh(r,i,i.next,o)&&Th(r,o)&&Th(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),Ch(i),Ch(i.next),i=t=o),i=i.next}while(i!==t);return i}function vh(t,e,n,i,r,o){var a,s,h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&(s=l,(a=h).next.i!==s.i&&a.prev.i!==s.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&&Sh(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(a,s)&&Th(a,s)&&Th(s,a)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next,n!==t;);return i}(a,s))){var c=Eh(h,l);return h=uh(h,h.next),c=uh(c,c.next),ph(h,e,n,i,r,o),void ph(c,e,n,i,r,o)}l=l.next}h=h.next}while(h!==t)}function gh(t,e){return t.x-e.x}function yh(t,e){if(e=function(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&a<s){if((a=s)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===a)return n.prev;var h,l=n,c=n.x,u=n.y,p=1/0;i=n.next;for(;i!==l;)r>=i.x&&i.x>=c&&r!==i.x&&wh(o<u?r:a,o,c,u,o<u?a:r,o,i.x,i.y)&&((h=Math.abs(o-i.y)/(r-i.x))<p||h===p&&i.x>n.x)&&Th(i,t)&&(n=i,p=h),i=i.next;return n}(t,e)){var n=Eh(e,t);uh(n,n.next)}}function xh(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function bh(t){for(var e=t,n=t;e.x<n.x&&(n=e),(e=e.next)!==t;);return n}function wh(t,e,n,i,r,o,a,s){return 0<=(r-a)*(e-s)-(t-a)*(o-s)&&0<=(t-a)*(i-s)-(n-a)*(e-s)&&0<=(n-a)*(o-s)-(r-a)*(i-s)}function _h(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Mh(t,e){return t.x===e.x&&t.y===e.y}function Sh(t,e,n,i){return!!(Mh(t,e)&&Mh(n,i)||Mh(t,i)&&Mh(n,e))||0<_h(t,e,n)!=0<_h(t,e,i)&&0<_h(n,i,t)!=0<_h(n,i,e)}function Th(t,e){return _h(t.prev,t,t.next)<0?0<=_h(t,e,t.next)&&0<=_h(t,t.prev,e):_h(t,e,t.prev)<0||_h(t,t.next,e)<0}function Eh(t,e){var n=new Lh(t.i,t.x,t.y),i=new Lh(e.i,e.x,e.y),r=t.next,o=e.prev;return(t.next=e).prev=t,(n.next=r).prev=n,(i.next=n).prev=i,(o.next=i).prev=o,i}function Ah(t,e,n,i){var r=new Lh(t,e,n);return i?(r.next=i.next,(r.prev=i).next.prev=r,i.next=r):(r.prev=r).next=r,r}function Ch(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 Lh(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 Ph={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return Ph.area(t)<0},triangulateShape:function(t,e){var n=[],i=[],r=[];Rh(t),Oh(n,t);var o=t.length;e.forEach(Rh);for(var a=0;a<e.length;a++)i.push(o),o+=e[a].length,Oh(n,e[a]);var s=lh(n,i);for(a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}};function Rh(t){var e=t.length;2<e&&t[e-1].equals(t[0])&&t.pop()}function Oh(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function kh(t,e){Bi.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new zh(t,e)),this.mergeVertices()}function zh(t,J){sr.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:J},t=Array.isArray(t)?t:[t];for(var K=this,Q=[],$=[],e=0,n=t.length;e<n;e++){i(t[e])}function i(t){var i=[],e=void 0!==J.curveSegments?J.curveSegments:12,h=void 0!==J.steps?J.steps:1,n=void 0!==J.depth?J.depth:100,r=void 0===J.bevelEnabled||J.bevelEnabled,o=void 0!==J.bevelThickness?J.bevelThickness:6,a=void 0!==J.bevelSize?J.bevelSize:o-2,l=void 0!==J.bevelSegments?J.bevelSegments:3,s=J.extrudePath,c=void 0!==J.UVGenerator?J.UVGenerator:Ih;void 0!==J.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),n=J.amount);var u,p,d,f,m,v,g,y,x=!1;s&&(u=s.getSpacedPoints(h),r=!(x=!0),p=s.computeFrenetFrames(h,!1),d=new Qe,f=new Qe,m=new Qe),r||(a=o=l=0);var b=t.extractPoints(e),w=b.shape,_=b.holes;if(!Ph.isClockWise(w))for(w=w.reverse(),g=0,y=_.length;g<y;g++)v=_[g],Ph.isClockWise(v)&&(_[g]=v.reverse());var M=Ph.triangulateShape(w,_),S=w;for(g=0,y=_.length;g<y;g++)v=_[g],w=w.concat(v);function T(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}var E,A,C,L,P,R,O=w.length,k=M.length;function z(t,e,n){var i,r,o,a=t.x-e.x,s=t.y-e.y,h=n.x-t.x,l=n.y-t.y,c=a*a+s*s,u=a*l-s*h;if(Math.abs(u)>Number.EPSILON){var p=Math.sqrt(c),d=Math.sqrt(h*h+l*l),f=e.x-s/p,m=e.y+a/p,v=((n.x-l/d-f)*l-(n.y+h/d-m)*h)/(a*l-s*h),g=(i=f+a*v-t.x)*i+(r=m+s*v-t.y)*r;if(g<=2)return new Ze(i,r);o=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?h>Number.EPSILON&&(y=!0):a<-Number.EPSILON?h<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),o=y?(i=-s,r=a,Math.sqrt(c)):(i=a,r=s,Math.sqrt(c/2))}return new Ze(i/o,r/o)}for(var I=[],D=0,B=S.length,N=B-1,F=D+1;D<B;D++,N++,F++)N===B&&(N=0),F===B&&(F=0),I[D]=z(S[D],S[N],S[F]);var U,j,V=[],G=I.concat();for(g=0,y=_.length;g<y;g++){for(v=_[g],U=[],D=0,N=(B=v.length)-1,F=D+1;D<B;D++,N++,F++)N===B&&(N=0),F===B&&(F=0),U[D]=z(v[D],v[N],v[F]);V.push(U),G=G.concat(U)}for(E=0;E<l;E++){for(C=E/l,L=o*Math.cos(C*Math.PI/2),A=a*Math.sin(C*Math.PI/2),D=0,B=S.length;D<B;D++)W((P=T(S[D],I[D],A)).x,P.y,-L);for(g=0,y=_.length;g<y;g++)for(v=_[g],U=V[g],D=0,B=v.length;D<B;D++)W((P=T(v[D],U[D],A)).x,P.y,-L)}for(A=a,D=0;D<O;D++)P=r?T(w[D],G[D],A):w[D],x?(f.copy(p.normals[0]).multiplyScalar(P.x),d.copy(p.binormals[0]).multiplyScalar(P.y),m.copy(u[0]).add(f).add(d),W(m.x,m.y,m.z)):W(P.x,P.y,0);for(j=1;j<=h;j++)for(D=0;D<O;D++)P=r?T(w[D],G[D],A):w[D],x?(f.copy(p.normals[j]).multiplyScalar(P.x),d.copy(p.binormals[j]).multiplyScalar(P.y),m.copy(u[j]).add(f).add(d),W(m.x,m.y,m.z)):W(P.x,P.y,n/h*j);for(E=l-1;0<=E;E--){for(C=E/l,L=o*Math.cos(C*Math.PI/2),A=a*Math.sin(C*Math.PI/2),D=0,B=S.length;D<B;D++)W((P=T(S[D],I[D],A)).x,P.y,n+L);for(g=0,y=_.length;g<y;g++)for(v=_[g],U=V[g],D=0,B=v.length;D<B;D++)P=T(v[D],U[D],A),x?W(P.x,P.y+u[h-1].y,u[h-1].x+L):W(P.x,P.y,n+L)}function H(t,e){var n,i;for(D=t.length;0<=--D;){(i=(n=D)-1)<0&&(i=t.length-1);var r=0,o=h+2*l;for(r=0;r<o;r++){var a=O*r,s=O*(r+1);X(e+n+a,e+i+a,e+i+s,e+n+s)}}}function W(t,e,n){i.push(t),i.push(e),i.push(n)}function q(t,e,n){Y(t),Y(e),Y(n);var i=Q.length/3,r=c.generateTopUV(K,Q,i-3,i-2,i-1);Z(r[0]),Z(r[1]),Z(r[2])}function X(t,e,n,i){Y(t),Y(e),Y(i),Y(e),Y(n),Y(i);var r=Q.length/3,o=c.generateSideWallUV(K,Q,r-6,r-3,r-2,r-1);Z(o[0]),Z(o[1]),Z(o[3]),Z(o[1]),Z(o[2]),Z(o[3])}function Y(t){Q.push(i[3*t+0]),Q.push(i[3*t+1]),Q.push(i[3*t+2])}function Z(t){$.push(t.x),$.push(t.y)}!function(){var t=Q.length/3;if(r){var e=0,n=O*e;for(D=0;D<k;D++)q((R=M[D])[2]+n,R[1]+n,R[0]+n);for(n=O*(e=h+2*l),D=0;D<k;D++)q((R=M[D])[0]+n,R[1]+n,R[2]+n)}else{for(D=0;D<k;D++)q((R=M[D])[2],R[1],R[0]);for(D=0;D<k;D++)q((R=M[D])[0]+O*h,R[1]+O*h,R[2]+O*h)}K.addGroup(t,Q.length/3-t,0)}(),function(){var t=Q.length/3,e=0;for(H(S,e),e+=S.length,g=0,y=_.length;g<y;g++)H(v=_[g],e),e+=v.length;K.addGroup(t,Q.length/3-t,1)}()}this.addAttribute("position",new qi(Q,3)),this.addAttribute("uv",new qi($,2)),this.computeVertexNormals()}((kh.prototype=Object.create(Bi.prototype)).constructor=kh).prototype.toJSON=function(){var t=Bi.prototype.toJSON.call(this);return Dh(this.parameters.shapes,this.parameters.options,t)},((zh.prototype=Object.create(sr.prototype)).constructor=zh).prototype.toJSON=function(){var t=sr.prototype.toJSON.call(this);return Dh(this.parameters.shapes,this.parameters.options,t)};var Ih={generateTopUV:function(t,e,n,i,r){var o=e[3*n],a=e[3*n+1],s=e[3*i],h=e[3*i+1],l=e[3*r],c=e[3*r+1];return[new Ze(o,a),new Ze(s,h),new Ze(l,c)]},generateSideWallUV:function(t,e,n,i,r,o){var a=e[3*n],s=e[3*n+1],h=e[3*n+2],l=e[3*i],c=e[3*i+1],u=e[3*i+2],p=e[3*r],d=e[3*r+1],f=e[3*r+2],m=e[3*o],v=e[3*o+1],g=e[3*o+2];return Math.abs(s-c)<.01?[new Ze(a,1-h),new Ze(l,1-u),new Ze(p,1-f),new Ze(m,1-g)]:[new Ze(s,1-h),new Ze(c,1-u),new Ze(d,1-f),new Ze(v,1-g)]}};function Dh(t,e,n){if(n.shapes=[],Array.isArray(t))for(var i=0,r=t.length;i<r;i++){var o=t[i];n.shapes.push(o.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Bh(t,e){Bi.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Nh(t,e)),this.mergeVertices()}function Nh(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 Bi;var i=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),zh.call(this,i,e),this.type="TextBufferGeometry"}function Fh(t,e,n,i,r,o,a){Bi.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new Uh(t,e,n,i,r,o,a)),this.mergeVertices()}function Uh(t,e,n,i,r,o,a){sr.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var s,h,l=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),c=0,u=[],p=new Qe,d=new Qe,f=[],m=[],v=[],g=[];for(h=0;h<=n;h++){var y=[],x=h/n;for(s=0;s<=e;s++){var b=s/e;p.x=-t*Math.cos(i+b*r)*Math.sin(o+x*a),p.y=t*Math.cos(o+x*a),p.z=t*Math.sin(i+b*r)*Math.sin(o+x*a),m.push(p.x,p.y,p.z),d.set(p.x,p.y,p.z).normalize(),v.push(d.x,d.y,d.z),g.push(b,1-x),y.push(c++)}u.push(y)}for(h=0;h<n;h++)for(s=0;s<e;s++){var w=u[h][s+1],_=u[h][s],M=u[h+1][s],S=u[h+1][s+1];(0!==h||0<o)&&f.push(w,_,S),(h!==n-1||l<Math.PI)&&f.push(_,M,S)}this.setIndex(f),this.addAttribute("position",new qi(m,3)),this.addAttribute("normal",new qi(v,3)),this.addAttribute("uv",new qi(g,2))}function jh(t,e,n,i,r,o){Bi.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new Vh(t,e,n,i,r,o)),this.mergeVertices()}function Vh(t,e,n,i,r,o){sr.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},t=t||.5,e=e||1,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var a,s,h,l=[],c=[],u=[],p=[],d=t,f=(e-t)/(i=void 0!==i?Math.max(1,i):1),m=new Qe,v=new Ze;for(s=0;s<=i;s++){for(h=0;h<=n;h++)a=r+h/n*o,m.x=d*Math.cos(a),m.y=d*Math.sin(a),c.push(m.x,m.y,m.z),u.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<i;s++){var g=s*(n+1);for(h=0;h<n;h++){var y=a=h+g,x=a+n+1,b=a+n+2,w=a+1;l.push(y,x,w),l.push(x,b,w)}}this.setIndex(l),this.addAttribute("position",new qi(c,3)),this.addAttribute("normal",new qi(u,3)),this.addAttribute("uv",new qi(p,2))}function Gh(t,e,n,i){Bi.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new Hh(t,e,n,i)),this.mergeVertices()}function Hh(t,e,n,i){sr.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=Ye.clamp(i,0,2*Math.PI);var r,o,a,s=[],h=[],l=[],c=1/e,u=new Qe,p=new Ze;for(o=0;o<=e;o++){var d=n+o*c*i,f=Math.sin(d),m=Math.cos(d);for(a=0;a<=t.length-1;a++)u.x=t[a].x*f,u.y=t[a].y,u.z=t[a].x*m,h.push(u.x,u.y,u.z),p.x=o/e,p.y=a/(t.length-1),l.push(p.x,p.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){var v=r=a+o*t.length,g=r+t.length,y=r+t.length+1,x=r+1;s.push(v,g,x),s.push(g,y,x)}if(this.setIndex(s),this.addAttribute("position",new qi(h,3)),this.addAttribute("uv",new qi(l,2)),this.computeVertexNormals(),i===2*Math.PI){var b=this.attributes.normal.array,w=new Qe,_=new Qe,M=new Qe;for(r=e*t.length*3,a=o=0;o<t.length;o++,a+=3)w.x=b[a+0],w.y=b[a+1],w.z=b[a+2],_.x=b[r+a+0],_.y=b[r+a+1],_.z=b[r+a+2],M.addVectors(w,_).normalize(),b[a+0]=b[r+a+0]=M.x,b[a+1]=b[r+a+1]=M.y,b[a+2]=b[r+a+2]=M.z}}function Wh(t,e){Bi.call(this),this.type="ShapeGeometry","object"===(void 0===e?"undefined":ea(e))&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new qh(t,e)),this.mergeVertices()}function qh(t,f){sr.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:f},f=f||12;var m=[],v=[],g=[],y=[],e=0,x=0;if(!1===Array.isArray(t))i(t);else for(var n=0;n<t.length;n++)i(t[n]),this.addGroup(e,x,n),e+=x,x=0;function i(t){var e,n,i,r=v.length/3,o=t.extractPoints(f),a=o.shape,s=o.holes;if(!1===Ph.isClockWise(a))for(a=a.reverse(),e=0,n=s.length;e<n;e++)i=s[e],!0===Ph.isClockWise(i)&&(s[e]=i.reverse());var h=Ph.triangulateShape(a,s);for(e=0,n=s.length;e<n;e++)i=s[e],a=a.concat(i);for(e=0,n=a.length;e<n;e++){var l=a[e];v.push(l.x,l.y,0),g.push(0,0,1),y.push(l.x,l.y)}for(e=0,n=h.length;e<n;e++){var c=h[e],u=c[0]+r,p=c[1]+r,d=c[2]+r;m.push(u,p,d),x+=3}}this.setIndex(m),this.addAttribute("position",new qi(v,3)),this.addAttribute("normal",new qi(g,3)),this.addAttribute("uv",new qi(y,2))}function Xh(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function Yh(t,e){sr.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,i,r,o,a=[],s=Math.cos(Ye.DEG2RAD*e),h=[0,0],l={},c=["a","b","c"];t.isBufferGeometry?(o=new Bi).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var u=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[c[v]],i=m[c[(v+1)%3]],h[0]=Math.min(n,i),h[1]=Math.max(n,i),void 0===l[r=h[0]+","+h[1]]?l[r]={index1:h[0],index2:h[1],face1:d,face2:void 0}:l[r].face2=d;for(r in l){var g=l[r];if(void 0===g.face2||p[g.face1].normal.dot(p[g.face2].normal)<=s){var y=u[g.index1];a.push(y.x,y.y,y.z),y=u[g.index2],a.push(y.x,y.y,y.z)}}this.addAttribute("position",new qi(a,3))}function Zh(t,e,n,i,r,o,a,s){Bi.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Jh(t,e,n,i,r,o,a,s)),this.mergeVertices()}function Jh(g,y,x,b,w,t,_,M){sr.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:g,radiusBottom:y,height:x,radialSegments:b,heightSegments:w,openEnded:t,thetaStart:_,thetaLength:M};var S=this;g=void 0!==g?g:1,y=void 0!==y?y:1,x=x||1,b=Math.floor(b)||8,w=Math.floor(w)||1,t=void 0!==t&&t,_=void 0!==_?_:0,M=void 0!==M?M:2*Math.PI;var T=[],E=[],A=[],C=[],L=0,P=[],R=x/2,O=0;function e(t){var e,n,i,r=new Ze,o=new Qe,a=0,s=!0===t?g:y,h=!0===t?1:-1;for(n=L,e=1;e<=b;e++)E.push(0,R*h,0),A.push(0,h,0),C.push(.5,.5),L++;for(i=L,e=0;e<=b;e++){var l=e/b*M+_,c=Math.cos(l),u=Math.sin(l);o.x=s*u,o.y=R*h,o.z=s*c,E.push(o.x,o.y,o.z),A.push(0,h,0),r.x=.5*c+.5,r.y=.5*u*h+.5,C.push(r.x,r.y),L++}for(e=0;e<b;e++){var p=n+e,d=i+e;!0===t?T.push(d,d+1,p):T.push(d+1,d,p),a+=3}S.addGroup(O,a,!0===t?1:2),O+=a}!function(){var t,e,n=new Qe,i=new Qe,r=0,o=(y-g)/x;for(e=0;e<=w;e++){var a=[],s=e/w,h=s*(y-g)+g;for(t=0;t<=b;t++){var l=t/b,c=l*M+_,u=Math.sin(c),p=Math.cos(c);i.x=h*u,i.y=-s*x+R,i.z=h*p,E.push(i.x,i.y,i.z),n.set(u,o,p).normalize(),A.push(n.x,n.y,n.z),C.push(l,1-s),a.push(L++)}P.push(a)}for(t=0;t<b;t++)for(e=0;e<w;e++){var d=P[e][t],f=P[e+1][t],m=P[e+1][t+1],v=P[e][t+1];T.push(d,f,v),T.push(f,m,v),r+=6}S.addGroup(O,r,0),O+=r}(),!1===t&&(0<g&&e(!0),0<y&&e(!1)),this.setIndex(T),this.addAttribute("position",new qi(E,3)),this.addAttribute("normal",new qi(A,3)),this.addAttribute("uv",new qi(C,2))}function Kh(t,e,n,i,r,o,a){Zh.call(this,0,t,e,n,i,r,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Qh(t,e,n,i,r,o,a){Jh.call(this,0,t,e,n,i,r,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function $h(t,e,n,i){Bi.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new tl(t,e,n,i)),this.mergeVertices()}function tl(t,e,n,i){sr.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,o,a=[],s=[],h=[],l=[],c=new Qe,u=new Ze;for(s.push(0,0,0),h.push(0,0,1),l.push(.5,.5),o=0,r=3;o<=e;o++,r+=3){var p=n+o/e*i;c.x=t*Math.cos(p),c.y=t*Math.sin(p),s.push(c.x,c.y,c.z),h.push(0,0,1),u.x=(s[r]/t+1)/2,u.y=(s[r+1]/t+1)/2,l.push(u.x,u.y)}for(r=1;r<=e;r++)a.push(r,r+1,0);this.setIndex(a),this.addAttribute("position",new qi(s,3)),this.addAttribute("normal",new qi(h,3)),this.addAttribute("uv",new qi(l,2))}(Bh.prototype=Object.create(Bi.prototype)).constructor=Bh,(Nh.prototype=Object.create(zh.prototype)).constructor=Nh,(Fh.prototype=Object.create(Bi.prototype)).constructor=Fh,(Uh.prototype=Object.create(sr.prototype)).constructor=Uh,(jh.prototype=Object.create(Bi.prototype)).constructor=jh,(Vh.prototype=Object.create(sr.prototype)).constructor=Vh,(Gh.prototype=Object.create(Bi.prototype)).constructor=Gh,(Hh.prototype=Object.create(sr.prototype)).constructor=Hh,((Wh.prototype=Object.create(Bi.prototype)).constructor=Wh).prototype.toJSON=function(){var t=Bi.prototype.toJSON.call(this);return Xh(this.parameters.shapes,t)},((qh.prototype=Object.create(sr.prototype)).constructor=qh).prototype.toJSON=function(){var t=sr.prototype.toJSON.call(this);return Xh(this.parameters.shapes,t)},(Yh.prototype=Object.create(sr.prototype)).constructor=Yh,(Zh.prototype=Object.create(Bi.prototype)).constructor=Zh,(Jh.prototype=Object.create(sr.prototype)).constructor=Jh,(Kh.prototype=Object.create(Zh.prototype)).constructor=Kh,(Qh.prototype=Object.create(Jh.prototype)).constructor=Qh,($h.prototype=Object.create(Bi.prototype)).constructor=$h,(tl.prototype=Object.create(sr.prototype)).constructor=tl;var el=Object.freeze({WireframeGeometry:Hs,ParametricGeometry:Ws,ParametricBufferGeometry:qs,TetrahedronGeometry:Zs,TetrahedronBufferGeometry:Js,OctahedronGeometry:Ks,OctahedronBufferGeometry:Qs,IcosahedronGeometry:$s,IcosahedronBufferGeometry:th,DodecahedronGeometry:eh,DodecahedronBufferGeometry:nh,PolyhedronGeometry:Xs,PolyhedronBufferGeometry:Ys,TubeGeometry:ih,TubeBufferGeometry:rh,TorusKnotGeometry:oh,TorusKnotBufferGeometry:ah,TorusGeometry:sh,TorusBufferGeometry:hh,TextGeometry:Bh,TextBufferGeometry:Nh,SphereGeometry:Fh,SphereBufferGeometry:Uh,RingGeometry:jh,RingBufferGeometry:Vh,PlaneGeometry:cr,PlaneBufferGeometry:ur,LatheGeometry:Gh,LatheBufferGeometry:Hh,ShapeGeometry:Wh,ShapeBufferGeometry:qh,ExtrudeGeometry:kh,ExtrudeBufferGeometry:zh,EdgesGeometry:Yh,ConeGeometry:Kh,ConeBufferGeometry:Qh,CylinderGeometry:Zh,CylinderBufferGeometry:Jh,CircleGeometry:$h,CircleBufferGeometry:tl,BoxGeometry:hr,BoxBufferGeometry:lr});function nl(t){Qr.call(this),this.type="ShadowMaterial",this.color=new Jn(0),this.transparent=!0,this.setValues(t)}function il(t){$r.call(this,t),this.type="RawShaderMaterial"}function rl(t){Qr.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Jn(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Jn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ol(t){rl.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function al(t){Qr.call(this),this.type="MeshPhongMaterial",this.color=new Jn(16777215),this.specular=new Jn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Jn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ut,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 sl(t){al.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function hl(t){Qr.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ll(t){Qr.call(this),this.type="MeshLambertMaterial",this.color=new Jn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Jn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ut,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 cl(t){if(Qr.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Jn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(t),null===this.matcap){var e=document.createElement("canvas");e.width=1,e.height=1;var n=e.getContext("2d");n.fillStyle="#fff",n.fillRect(0,0,1,1),this.matcap=new THREE.CanvasTexture(e)}}function ul(t){zs.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}((nl.prototype=Object.create(Qr.prototype)).constructor=nl).prototype.isShadowMaterial=!0,nl.prototype.copy=function(t){return Qr.prototype.copy.call(this,t),this.color.copy(t.color),this},((il.prototype=Object.create($r.prototype)).constructor=il).prototype.isRawShaderMaterial=!0,((rl.prototype=Object.create(Qr.prototype)).constructor=rl).prototype.isMeshStandardMaterial=!0,rl.prototype.copy=function(t){return Qr.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},((ol.prototype=Object.create(rl.prototype)).constructor=ol).prototype.isMeshPhysicalMaterial=!0,ol.prototype.copy=function(t){return rl.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},((al.prototype=Object.create(Qr.prototype)).constructor=al).prototype.isMeshPhongMaterial=!0,al.prototype.copy=function(t){return Qr.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},((sl.prototype=Object.create(al.prototype)).constructor=sl).prototype.isMeshToonMaterial=!0,sl.prototype.copy=function(t){return al.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},((hl.prototype=Object.create(Qr.prototype)).constructor=hl).prototype.isMeshNormalMaterial=!0,hl.prototype.copy=function(t){return Qr.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},((ll.prototype=Object.create(Qr.prototype)).constructor=ll).prototype.isMeshLambertMaterial=!0,ll.prototype.copy=function(t){return Qr.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},((cl.prototype=Object.create(Qr.prototype)).constructor=cl).prototype.isMeshMatcapMaterial=!0,cl.prototype.copy=function(t){return Qr.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},((ul.prototype=Object.create(zs.prototype)).constructor=ul).prototype.isLineDashedMaterial=!0,ul.prototype.copy=function(t){return zs.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var pl=Object.freeze({ShadowMaterial:nl,SpriteMaterial:As,RawShaderMaterial:il,ShaderMaterial:$r,PointsMaterial:Ns,MeshPhysicalMaterial:ol,MeshStandardMaterial:rl,MeshPhongMaterial:al,MeshToonMaterial:sl,MeshNormalMaterial:hl,MeshLambertMaterial:ll,MeshDepthMaterial:Oa,MeshDistanceMaterial:ka,MeshBasicMaterial:no,MeshMatcapMaterial:cl,LineDashedMaterial:ul,LineBasicMaterial:zs,Material:Qr}),dl={arraySlice:function(t,e,n){return dl.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(n){for(var t=n.length,e=new Array(t),i=0;i!==t;++i)e[i]=i;return e.sort(function(t,e){return n[t]-n[e]}),e},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),o=0,a=0;a!==i;++o)for(var s=n[o]*e,h=0;h!==e;++h)r[a++]=t[s+h];return r},flattenJSON:function(t,e,n,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var a=o[i];if(void 0!==a)if(Array.isArray(a))for(;void 0!==(a=o[i])&&(e.push(o.time),n.push.apply(n,a)),void 0!==(o=t[r++]););else if(void 0!==a.toArray)for(;void 0!==(a=o[i])&&(e.push(o.time),a.toArray(n,n.length)),void 0!==(o=t[r++]););else for(;void 0!==(a=o[i])&&(e.push(o.time),n.push(a)),void 0!==(o=t[r++]););}}};function fl(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function ml(t,e,n,i){fl.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function vl(t,e,n,i){fl.call(this,t,e,n,i)}function gl(t,e,n,i){fl.call(this,t,e,n,i)}function yl(t,e,n,i){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=dl.convertArray(e,this.TimeBufferType),this.values=dl.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function xl(t,e,n){yl.call(this,t,e,n)}function bl(t,e,n,i){yl.call(this,t,e,n,i)}function wl(t,e,n,i){yl.call(this,t,e,n,i)}function _l(t,e,n,i){fl.call(this,t,e,n,i)}function Ml(t,e,n,i){yl.call(this,t,e,n,i)}function Sl(t,e,n,i){yl.call(this,t,e,n,i)}function Tl(t,e,n,i){yl.call(this,t,e,n,i)}function El(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Ye.generateUUID(),this.duration<0&&this.resetDuration()}function Al(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 wl;case"vector":case"vector2":case"vector3":case"vector4":return Tl;case"color":return bl;case"quaternion":return Ml;case"bool":case"boolean":return xl;case"string":return Sl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],i=[];dl.flattenJSON(t.keys,n,i,"value"),t.times=n,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(fl.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{var o;n:{i:if(!(t<i)){for(var a=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,r)}if(n===a)break;if(r=i,t<(i=e[++n]))break e}o=e.length;break n}if(r<=t)break t;var s=e[1];t<s&&(n=2,r=s);for(a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(n===a)break;if(i=r,(r=e[--n-1])<=t)break e}o=n,n=0}for(;n<o;){var h=n+o>>>1;t<e[h]?o=h:n=1+h}if(i=e[n],void 0===(r=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,r,t)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i,o=0;o!==i;++o)e[o]=n[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(fl.prototype,{beforeStart_:fl.prototype.copySampleValue_,afterEnd_:fl.prototype.copySampleValue_}),ml.prototype=Object.assign(Object.create(fl.prototype),{constructor:ml,DefaultSettings_:{endingStart:Oe,endingEnd:Oe},intervalChanged_:function(t,e,n){var i=this.parameterPositions,r=t-2,o=t+1,a=i[r],s=i[o];if(void 0===a)switch(this.getSettings_().endingStart){case ke:r=t,a=2*e-n;break;case 2402:a=e+i[r=i.length-2]-i[r+1];break;default:r=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case ke:o=t,s=2*n-e;break;case 2402:s=n+i[o=1]-i[0];break;default:o=t-1,s=e}var h=.5*(n-e),l=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(s-n),this._offsetPrev=r*l,this._offsetNext=o*l},interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,h=s-a,l=this._offsetPrev,c=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(n-e)/(i-e),f=d*d,m=f*d,v=-u*m+2*u*f-u*d,g=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,b=0;b!==a;++b)r[b]=v*o[l+b]+g*o[h+b]+y*o[s+b]+x*o[c+b];return r}}),vl.prototype=Object.assign(Object.create(fl.prototype),{constructor:vl,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,h=s-a,l=(n-e)/(i-e),c=1-l,u=0;u!==a;++u)r[u]=o[h+u]*c+o[s+u]*l;return r}}),gl.prototype=Object.assign(Object.create(fl.prototype),{constructor:gl,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(yl,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:dl.convertArray(t.times,Array),values:dl.convertArray(t.values,Array)};var i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}}),Object.assign(yl.prototype,{constructor:yl,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Pe,InterpolantFactoryMethodDiscrete:function(t){return new gl(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new vl(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new ml(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case Le:e=this.InterpolantFactoryMethodDiscrete;break;case Pe:e=this.InterpolantFactoryMethodLinear;break;case Re:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)return this.createInterpolant=e,this;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},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Le;case this.InterpolantFactoryMethodLinear:return Pe;case this.InterpolantFactoryMethodSmooth:return Re}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,i=n.length,r=0,o=i-1;r!==i&&n[r]<t;)++r;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==r||o!==i){o<=r&&(r=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=dl.arraySlice(n,r,o),this.values=dl.arraySlice(this.values,r*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,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==r;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&&s<o){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==i&&dl.isTypedArray(i)){a=0;for(var h=i.length;a!==h;++a){var l=i[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),i=this.getInterpolation()===Re,r=1,o=t.length-1,a=1;a<o;++a){var s=!1,h=t[a];if(h!==t[a+1]&&(1!==a||h!==h[0]))if(i)s=!0;else for(var l=a*n,c=l-n,u=l+n,p=0;p!==n;++p){var d=e[l+p];if(d!==e[c+p]||d!==e[u+p]){s=!0;break}}if(s){if(a!==r){t[r]=t[a];var f=a*n,m=r*n;for(p=0;p!==n;++p)e[m+p]=e[f+p]}++r}}if(0<o){t[r]=t[o];for(f=o*n,m=r*n,p=0;p!==n;++p)e[m+p]=e[f+p];++r}return r!==t.length&&(this.times=dl.arraySlice(t,0,r),this.values=dl.arraySlice(e,0,r*n)),this}}),xl.prototype=Object.assign(Object.create(yl.prototype),{constructor:xl,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Le,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),bl.prototype=Object.assign(Object.create(yl.prototype),{constructor:bl,ValueTypeName:"color"}),wl.prototype=Object.assign(Object.create(yl.prototype),{constructor:wl,ValueTypeName:"number"}),_l.prototype=Object.assign(Object.create(fl.prototype),{constructor:_l,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,h=(n-e)/(i-e),l=s+a;s!==l;s+=4)Ke.slerpFlat(r,0,o,s-a,o,s,h);return r}}),Ml.prototype=Object.assign(Object.create(yl.prototype),{constructor:Ml,ValueTypeName:"quaternion",DefaultInterpolation:Pe,InterpolantFactoryMethodLinear:function(t){return new _l(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Sl.prototype=Object.assign(Object.create(yl.prototype),{constructor:Sl,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Le,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Tl.prototype=Object.assign(Object.create(yl.prototype),{constructor:Tl,ValueTypeName:"vector"}),Object.assign(El,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,o=n.length;r!==o;++r)e.push(Al(n[r]).scale(i));return new El(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,o=n.length;r!==o;++r)e.push(yl.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,o=[],a=0;a<r;a++){var s=[],h=[];s.push((a+r-1)%r,a,(a+1)%r),h.push(0,1,0);var l=dl.getKeyframeOrder(s);s=dl.sortedArray(s,1,l),h=dl.sortedArray(h,1,l),i||0!==s[0]||(s.push(r),h.push(h[0])),o.push(new wl(".morphTargetInfluences["+e[a].name+"]",s,h).scale(1/n))}return new El(t,-1,o)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){var i=t;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],h=s.name.match(r);if(h&&1<h.length){var l=i[u=h[1]];l||(i[u]=l=[]),l.push(s)}}var c=[];for(var u in i)c.push(El.CreateFromMorphTargetSequence(u,i[u],e,n));return c},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){if(0!==n.length){var o=[],a=[];dl.flattenJSON(n,o,a,i),0!==o.length&&r.push(new t(e,o,a))}},i=[],r=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],h=0;h<s.length;h++){var l=s[h].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var c={},u=0;u<l.length;u++)if(l[u].morphTargets)for(var p=0;p<l[u].morphTargets.length;p++)c[l[u].morphTargets[p]]=-1;for(var d in c){var f=[],m=[];for(p=0;p!==l[u].morphTargets.length;++p){var v=l[u];f.push(v.time),m.push(v.morphTarget===d?1:0)}i.push(new wl(".morphTargetInfluence["+d+"]",f,m))}o=c.length*(a||1)}else{var g=".bones["+e[h].name+"]";n(Tl,g+".position",l,"pos",i),n(Ml,g+".quaternion",l,"rot",i),n(Tl,g+".scale",l,"scl",i)}}return 0===i.length?null:new El(r,o,i)}}),Object.assign(El.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var i=this.tracks[e];t=Math.max(t,i.times[i.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}});var Cl={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 Ll(t,e,n){var i=this,r=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,a),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,a),o===a&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}var Pl=new Ll,Rl={};function Ol(t){this.manager=void 0!==t?t:Pl}function kl(t){this.manager=void 0!==t?t:Pl}function zl(t){this.manager=void 0!==t?t:Pl}function Il(t){this.manager=void 0!==t?t:Pl}function Dl(){this.type="Curve",this.arcLengthDivisions=200}function Bl(t,e,n,i,r,o,a,s){Dl.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function Nl(t,e,n,i,r,o){Bl.call(this,t,e,n,n,i,r,o),this.type="ArcCurve"}function Fl(){var r=0,o=0,a=0,s=0;function l(t,e,n,i){a=-3*(r=t)+3*e-2*(o=n)-i,s=2*t-2*e+n+i}return{initCatmullRom:function(t,e,n,i,r){l(e,n,r*(n-t),r*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,r,o,a){var s=(e-t)/r-(n-t)/(r+o)+(n-e)/o,h=(n-e)/o-(i-e)/(o+a)+(i-n)/a;l(e,n,s*=o,h*=o)},calc:function(t){var e=t*t;return r+o*t+a*e+s*(e*t)}}}Object.assign(Ol.prototype,{load:function(a,t,e,n){void 0===a&&(a=""),void 0!==this.path&&(a=this.path+a),a=this.manager.resolveURL(a);var s=this,i=Cl.get(a);if(void 0!==i)return s.manager.itemStart(a),setTimeout(function(){t&&t(i),s.manager.itemEnd(a)},0),i;if(void 0===Rl[a]){var r=a.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var o=r[1],h=!!r[2],l=r[3];l=decodeURIComponent(l),h&&(l=atob(l));try{var c,u=(this.responseType||"").toLowerCase();switch(u){case"arraybuffer":case"blob":for(var p=new Uint8Array(l.length),d=0;d<l.length;d++)p[d]=l.charCodeAt(d);c="blob"===u?new Blob([p.buffer],{type:o}):p.buffer;break;case"document":var f=new DOMParser;c=f.parseFromString(l,o);break;case"json":c=JSON.parse(l);break;default:c=l}setTimeout(function(){t&&t(c),s.manager.itemEnd(a)},0)}catch(t){setTimeout(function(){n&&n(t),s.manager.itemError(a),s.manager.itemEnd(a)},0)}}else{Rl[a]=[],Rl[a].push({onLoad:t,onProgress:e,onError:n});var m=new XMLHttpRequest;for(var v in m.open("GET",a,!0),m.addEventListener("load",function(t){var e=this.response;Cl.add(a,e);var n=Rl[a];if(delete Rl[a],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var i=0,r=n.length;i<r;i++){(o=n[i]).onLoad&&o.onLoad(e)}s.manager.itemEnd(a)}else{for(i=0,r=n.length;i<r;i++){var o;(o=n[i]).onError&&o.onError(t)}s.manager.itemError(a),s.manager.itemEnd(a)}},!1),m.addEventListener("progress",function(t){for(var e=Rl[a],n=0,i=e.length;n<i;n++){var r=e[n];r.onProgress&&r.onProgress(t)}},!1),m.addEventListener("error",function(t){var e=Rl[a];delete Rl[a];for(var n=0,i=e.length;n<i;n++){var r=e[n];r.onError&&r.onError(t)}s.manager.itemError(a),s.manager.itemEnd(a)},!1),m.addEventListener("abort",function(t){var e=Rl[a];delete Rl[a];for(var n=0,i=e.length;n<i;n++){var r=e[n];r.onError&&r.onError(t)}s.manager.itemError(a),s.manager.itemEnd(a)},!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 s.manager.itemStart(a),m}Rl[a].push({onLoad:t,onProgress:e,onError:n})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(function(t){this.manager=void 0!==t?t:Pl}.prototype,{load:function(t,e,n,i){var r=this,o=new Ol(r.manager);o.setPath(r.path),o.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t,e){for(var n=[],i=0;i<t.length;i++){var r=El.parse(t[i]);n.push(r)}e(n)},setPath:function(t){return this.path=t,this}}),Object.assign(function(t){this.manager=void 0!==t?t:Pl,this._parser=null}.prototype,{load:function(t,o,e,i){var a=this,s=[],h=new js;h.image=s;var r=new Ol(this.manager);function n(n){r.load(t[n],function(t){var e=a._parser(t,!0);s[n]={width:e.width,height:e.height,format:e.format,mipmaps:e.mipmaps},6===(l+=1)&&(1===e.mipmapCount&&(h.minFilter=Bt),h.format=e.format,h.needsUpdate=!0,o&&o(h))},e,i)}if(r.setPath(this.path),r.setResponseType("arraybuffer"),Array.isArray(t))for(var l=0,c=0,u=t.length;c<u;++c)n(c);else r.load(t,function(t){var e=a._parser(t,!0);if(e.isCubemap)for(var n=e.mipmaps.length/e.mipmapCount,i=0;i<n;i++){s[i]={mipmaps:[]};for(var r=0;r<e.mipmapCount;r++)s[i].mipmaps.push(e.mipmaps[i*e.mipmapCount+r]),s[i].format=e.format,s[i].width=e.width,s[i].height=e.height}else h.image.width=e.width,h.image.height=e.height,h.mipmaps=e.mipmaps;1===e.mipmapCount&&(h.minFilter=Bt),h.format=e.format,h.needsUpdate=!0,o&&o(h)},e,i);return h},setPath:function(t){return this.path=t,this}}),Object.assign(function(t){this.manager=void 0!==t?t:Pl,this._parser=null}.prototype,{load:function(t,n,e,i){var r=this,o=new Bn,a=new Ol(this.manager);return a.setResponseType("arraybuffer"),a.setPath(this.path),a.load(t,function(t){var e=r._parser(t);e&&(void 0!==e.image?o.image=e.image:void 0!==e.data&&(o.image.width=e.width,o.image.height=e.height,o.image.data=e.data),o.wrapS=void 0!==e.wrapS?e.wrapS:Rt,o.wrapT=void 0!==e.wrapT?e.wrapT:Rt,o.magFilter=void 0!==e.magFilter?e.magFilter:Bt,o.minFilter=void 0!==e.minFilter?e.minFilter:Ft,o.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.format&&(o.format=e.format),void 0!==e.type&&(o.type=e.type),void 0!==e.mipmaps&&(o.mipmaps=e.mipmaps),1===e.mipmapCount&&(o.minFilter=Bt),o.needsUpdate=!0,n&&n(o,e))},e,i),o},setPath:function(t){return this.path=t,this}}),Object.assign(kl.prototype,{crossOrigin:"anonymous",load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,o=Cl.get(e);if(void 0!==o)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",h,!1),Cl.add(e,this),t&&t(this),r.manager.itemEnd(e)}function h(t){a.removeEventListener("load",s,!1),a.removeEventListener("error",h,!1),i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}return a.addEventListener("load",s,!1),a.addEventListener("error",h,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(e),a.src=e,a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(zl.prototype,{crossOrigin:"anonymous",load:function(t,n,e,i){var r=new yo,o=new kl(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(e){o.load(t[e],function(t){r.images[e]=t,6===++a&&(r.needsUpdate=!0,n&&n(r))},void 0,i)}for(var h=0;h<t.length;++h)s(h);return r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Il.prototype,{crossOrigin:"anonymous",load:function(n,i,t,e){var r=new kn,o=new kl(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(n,function(t){r.image=t;var e=0<n.search(/\.jpe?g($|\?)/i)||0===n.search(/^data\:image\/jpeg/);r.format=e?$t:te,r.needsUpdate=!0,void 0!==i&&i(r)},t,e),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Dl.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,i=[],r=this.getPoint(0),o=0;for(i.push(0),n=1;n<=t;n++)o+=(e=this.getPoint(n/t)).distanceTo(r),i.push(o),r=e;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,o=i.length;n=e||t*i[o-1];for(var a,s=0,h=o-1;s<=h;)if((a=i[r=Math.floor(s+(h-s)/2)]-n)<0)s=r+1;else{if(!(0<a)){h=r;break}h=r-1}if(i[r=h]===n)return r/(o-1);var l=i[r];return(r+(n-l)/(i[r+1]-l))/(o-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),1<n&&(n=1);var i=this.getPoint(e);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,i,r,o=new Qe,a=[],s=[],h=[],l=new Qe,c=new Je;for(n=0;n<=t;n++)i=n/t,a[n]=this.getTangentAt(i),a[n].normalize();s[0]=new Qe,h[0]=new Qe;var u=Number.MAX_VALUE,p=Math.abs(a[0].x),d=Math.abs(a[0].y),f=Math.abs(a[0].z);for(p<=u&&(u=p,o.set(1,0,0)),d<=u&&(u=d,o.set(0,1,0)),f<=u&&o.set(0,0,1),l.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],l),h[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),h[n]=h[n-1].clone(),l.crossVectors(a[n-1],a[n]),l.length()>Number.EPSILON&&(l.normalize(),r=Math.acos(Ye.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(c.makeRotationAxis(l,r))),h[n].crossVectors(a[n],s[n]);if(!0===e)for(r=Math.acos(Ye.clamp(s[0].dot(s[t]),-1,1)),r/=t,0<a[0].dot(l.crossVectors(s[0],s[t]))&&(r=-r),n=1;n<=t;n++)s[n].applyMatrix4(c.makeRotationAxis(a[n],r*n)),h[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:h}},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}}),((Bl.prototype=Object.create(Dl.prototype)).constructor=Bl).prototype.isEllipseCurve=!0,Bl.prototype.getPoint=function(t,e){for(var n=e||new Ze,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;i<r;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);var a=this.aStartAngle+t*r,s=this.aX+this.xRadius*Math.cos(a),h=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var l=Math.cos(this.aRotation),c=Math.sin(this.aRotation),u=s-this.aX,p=h-this.aY;s=u*l-p*c+this.aX,h=u*c+p*l+this.aY}return n.set(s,h)},Bl.prototype.copy=function(t){return Dl.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},Bl.prototype.toJSON=function(){var t=Dl.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},Bl.prototype.fromJSON=function(t){return Dl.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},((Nl.prototype=Object.create(Bl.prototype)).constructor=Nl).prototype.isArcCurve=!0;var Ul=new Qe,jl=new Fl,Vl=new Fl,Gl=new Fl;function Hl(t,e,n,i){Dl.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=i||.5}function Wl(t,e,n,i,r){var o=.5*(i-e),a=.5*(r-n),s=t*t;return(2*n-2*i+o+a)*(t*s)+(-3*n+3*i-2*o-a)*s+o*t+n}function ql(t,e,n,i){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,i)}function Xl(t,e,n,i,r){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,i)+function(t,e){return t*t*t*e}(t,r)}function Yl(t,e,n,i){Dl.call(this),this.type="CubicBezierCurve",this.v0=t||new Ze,this.v1=e||new Ze,this.v2=n||new Ze,this.v3=i||new Ze}function Zl(t,e,n,i){Dl.call(this),this.type="CubicBezierCurve3",this.v0=t||new Qe,this.v1=e||new Qe,this.v2=n||new Qe,this.v3=i||new Qe}function Jl(t,e){Dl.call(this),this.type="LineCurve",this.v1=t||new Ze,this.v2=e||new Ze}function Kl(t,e){Dl.call(this),this.type="LineCurve3",this.v1=t||new Qe,this.v2=e||new Qe}function Ql(t,e,n){Dl.call(this),this.type="QuadraticBezierCurve",this.v0=t||new Ze,this.v1=e||new Ze,this.v2=n||new Ze}function $l(t,e,n){Dl.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Qe,this.v1=e||new Qe,this.v2=n||new Qe}function tc(t){Dl.call(this),this.type="SplineCurve",this.points=t||[]}((Hl.prototype=Object.create(Dl.prototype)).constructor=Hl).prototype.isCatmullRomCurve3=!0,Hl.prototype.getPoint=function(t,e){var n,i,r,o,a=e||new Qe,s=this.points,h=s.length,l=(h-(this.closed?0:1))*t,c=Math.floor(l),u=l-c;if(this.closed?c+=0<c?0:(Math.floor(Math.abs(c)/h)+1)*h:0===u&&c===h-1&&(c=h-2,u=1),n=this.closed||0<c?s[(c-1)%h]:(Ul.subVectors(s[0],s[1]).add(s[0]),Ul),i=s[c%h],r=s[(c+1)%h],o=this.closed||c+2<h?s[(c+2)%h]:(Ul.subVectors(s[h-1],s[h-2]).add(s[h-1]),Ul),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(i),p),f=Math.pow(i.distanceToSquared(r),p),m=Math.pow(r.distanceToSquared(o),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),jl.initNonuniformCatmullRom(n.x,i.x,r.x,o.x,d,f,m),Vl.initNonuniformCatmullRom(n.y,i.y,r.y,o.y,d,f,m),Gl.initNonuniformCatmullRom(n.z,i.z,r.z,o.z,d,f,m)}else"catmullrom"===this.curveType&&(jl.initCatmullRom(n.x,i.x,r.x,o.x,this.tension),Vl.initCatmullRom(n.y,i.y,r.y,o.y,this.tension),Gl.initCatmullRom(n.z,i.z,r.z,o.z,this.tension));return a.set(jl.calc(u),Vl.calc(u),Gl.calc(u)),a},Hl.prototype.copy=function(t){Dl.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Hl.prototype.toJSON=function(){var t=Dl.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Hl.prototype.fromJSON=function(t){Dl.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new Qe).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((Yl.prototype=Object.create(Dl.prototype)).constructor=Yl).prototype.isCubicBezierCurve=!0,Yl.prototype.getPoint=function(t,e){var n=e||new Ze,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(Xl(t,i.x,r.x,o.x,a.x),Xl(t,i.y,r.y,o.y,a.y)),n},Yl.prototype.copy=function(t){return Dl.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},Yl.prototype.toJSON=function(){var t=Dl.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},Yl.prototype.fromJSON=function(t){return Dl.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},((Zl.prototype=Object.create(Dl.prototype)).constructor=Zl).prototype.isCubicBezierCurve3=!0,Zl.prototype.getPoint=function(t,e){var n=e||new Qe,i=this.v0,r=this.v1,o=this.v2,a=this.v3;return n.set(Xl(t,i.x,r.x,o.x,a.x),Xl(t,i.y,r.y,o.y,a.y),Xl(t,i.z,r.z,o.z,a.z)),n},Zl.prototype.copy=function(t){return Dl.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},Zl.prototype.toJSON=function(){var t=Dl.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},Zl.prototype.fromJSON=function(t){return Dl.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},((Jl.prototype=Object.create(Dl.prototype)).constructor=Jl).prototype.isLineCurve=!0,Jl.prototype.getPoint=function(t,e){var n=e||new Ze;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Jl.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Jl.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Jl.prototype.copy=function(t){return Dl.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Jl.prototype.toJSON=function(){var t=Dl.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Jl.prototype.fromJSON=function(t){return Dl.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Kl.prototype=Object.create(Dl.prototype)).constructor=Kl).prototype.isLineCurve3=!0,Kl.prototype.getPoint=function(t,e){var n=e||new Qe;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Kl.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Kl.prototype.copy=function(t){return Dl.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Kl.prototype.toJSON=function(){var t=Dl.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Kl.prototype.fromJSON=function(t){return Dl.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Ql.prototype=Object.create(Dl.prototype)).constructor=Ql).prototype.isQuadraticBezierCurve=!0,Ql.prototype.getPoint=function(t,e){var n=e||new Ze,i=this.v0,r=this.v1,o=this.v2;return n.set(ql(t,i.x,r.x,o.x),ql(t,i.y,r.y,o.y)),n},Ql.prototype.copy=function(t){return Dl.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Ql.prototype.toJSON=function(){var t=Dl.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Ql.prototype.fromJSON=function(t){return Dl.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},(($l.prototype=Object.create(Dl.prototype)).constructor=$l).prototype.isQuadraticBezierCurve3=!0,$l.prototype.getPoint=function(t,e){var n=e||new Qe,i=this.v0,r=this.v1,o=this.v2;return n.set(ql(t,i.x,r.x,o.x),ql(t,i.y,r.y,o.y),ql(t,i.z,r.z,o.z)),n},$l.prototype.copy=function(t){return Dl.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},$l.prototype.toJSON=function(){var t=Dl.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},$l.prototype.fromJSON=function(t){return Dl.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((tc.prototype=Object.create(Dl.prototype)).constructor=tc).prototype.isSplineCurve=!0,tc.prototype.getPoint=function(t,e){var n=e||new Ze,i=this.points,r=(i.length-1)*t,o=Math.floor(r),a=r-o,s=i[0===o?o:o-1],h=i[o],l=i[o>i.length-2?i.length-1:o+1],c=i[o>i.length-3?i.length-1:o+2];return n.set(Wl(a,s.x,h.x,l.x,c.x),Wl(a,s.y,h.y,l.y,c.y)),n},tc.prototype.copy=function(t){Dl.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this},tc.prototype.toJSON=function(){var t=Dl.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t},tc.prototype.fromJSON=function(t){Dl.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new Ze).fromArray(i))}return this};var ec=Object.freeze({ArcCurve:Nl,CatmullRomCurve3:Hl,CubicBezierCurve:Yl,CubicBezierCurve3:Zl,EllipseCurve:Bl,LineCurve:Jl,LineCurve3:Kl,QuadraticBezierCurve:Ql,QuadraticBezierCurve3:$l,SplineCurve:tc});function nc(){Dl.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function ic(t){nc.call(this),this.type="Path",this.currentPoint=new Ze,t&&this.setFromPoints(t)}function rc(t){ic.call(this,t),this.uuid=Ye.generateUUID(),this.type="Shape",this.holes=[]}function oc(t,e){Ci.call(this),this.type="Light",this.color=new Jn(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function ac(t,e,n){oc.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Ci.DefaultUp),this.updateMatrix(),this.groundColor=new Jn(e)}function sc(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new Ze(512,512),this.map=null,this.matrix=new Je}function hc(){sc.call(this,new Ua(50,1,.5,500))}function lc(t,e,n,i,r,o){oc.call(this,t,e),this.type="SpotLight",this.position.copy(Ci.DefaultUp),this.updateMatrix(),this.target=new Ci,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!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new hc}function cc(t,e,n,i){oc.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!==i?i:1,this.shadow=new sc(new Ua(90,1,.5,500))}function uc(t,e,n,i,r,o){Fa.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!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function pc(){sc.call(this,new uc(-5,5,5,-5,.5,500))}function dc(t,e){oc.call(this,t,e),this.type="DirectionalLight",this.position.copy(Ci.DefaultUp),this.updateMatrix(),this.target=new Ci,this.shadow=new pc}function fc(t,e){oc.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function mc(t,e,n,i){oc.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function vc(t){this.manager=void 0!==t?t:Pl,this.textures={}}nc.prototype=Object.assign(Object.create(Dl.prototype),{constructor:nc,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 Jl(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=e){var r=n[i]-e,o=this.curves[i],a=o.getLength(),s=0===a?0:1-r/a;return o.getPointAt(s)}i++}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,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=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=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),h=0;h<s.length;h++){var l=s[h];e&&e.equals(l)||(n.push(l),e=l)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Dl.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Dl.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){Dl.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push((new ec[i.type]).fromJSON(i))}return this}}),ic.prototype=Object.assign(Object.create(nc.prototype),{constructor:ic,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)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new Jl(this.currentPoint.clone(),new Ze(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,i){var r=new Ql(this.currentPoint.clone(),new Ze(t,e),new Ze(n,i));this.curves.push(r),this.currentPoint.set(n,i)},bezierCurveTo:function(t,e,n,i,r,o){var a=new Yl(this.currentPoint.clone(),new Ze(t,e),new Ze(n,i),new Ze(r,o));this.curves.push(a),this.currentPoint.set(r,o)},splineThru:function(t){var e=new tc([this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,n,i,r,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+a,e+s,n,i,r,o)},absarc:function(t,e,n,i,r,o){this.absellipse(t,e,n,n,i,r,o)},ellipse:function(t,e,n,i,r,o,a,s){var h=this.currentPoint.x,l=this.currentPoint.y;this.absellipse(t+h,e+l,n,i,r,o,a,s)},absellipse:function(t,e,n,i,r,o,a,s){var h=new Bl(t,e,n,i,r,o,a,s);if(0<this.curves.length){var l=h.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(h);var c=h.getPoint(1);this.currentPoint.copy(c)},copy:function(t){return nc.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=nc.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return nc.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),rc.prototype=Object.assign(Object.create(ic.prototype),{constructor:rc,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n<i;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){ic.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){var t=ic.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){ic.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push((new ic).fromJSON(i))}return this}}),oc.prototype=Object.assign(Object.create(Ci.prototype),{constructor:oc,isLight:!0,copy:function(t){return Ci.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Ci.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}}),ac.prototype=Object.assign(Object.create(oc.prototype),{constructor:ac,isHemisphereLight:!0,copy:function(t){return oc.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(sc.prototype,{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}}),hc.prototype=Object.assign(Object.create(sc.prototype),{constructor:hc,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*Ye.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix())}}),lc.prototype=Object.assign(Object.create(oc.prototype),{constructor:lc,isSpotLight:!0,copy:function(t){return oc.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}}),cc.prototype=Object.assign(Object.create(oc.prototype),{constructor:cc,isPointLight:!0,copy:function(t){return oc.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),uc.prototype=Object.assign(Object.create(Fa.prototype),{constructor:uc,isOrthographicCamera:!0,copy:function(t,e){return Fa.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,i,r,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=i,this.view.width=r,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,i=(this.top+this.bottom)/2,r=n-t,o=n+t,a=i+e,s=i-e;if(null!==this.view&&this.view.enabled){var h=this.zoom/(this.view.width/this.view.fullWidth),l=this.zoom/(this.view.height/this.view.fullHeight),c=(this.right-this.left)/this.view.width,u=(this.top-this.bottom)/this.view.height;o=(r+=c*(this.view.offsetX/h))+c*(this.view.width/h),s=(a-=u*(this.view.offsetY/l))-u*(this.view.height/l)}this.projectionMatrix.makeOrthographic(r,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Ci.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}}),pc.prototype=Object.assign(Object.create(sc.prototype),{constructor:pc}),dc.prototype=Object.assign(Object.create(oc.prototype),{constructor:dc,isDirectionalLight:!0,copy:function(t){return oc.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),fc.prototype=Object.assign(Object.create(oc.prototype),{constructor:fc,isAmbientLight:!0}),mc.prototype=Object.assign(Object.create(oc.prototype),{constructor:mc,isRectAreaLight:!0,copy:function(t){return oc.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=oc.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(vc.prototype,{load:function(t,e,n,i){var r=this,o=new Ol(r.manager);o.setPath(r.path),o.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},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 i=new pl[t.type];if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&i.specular.setHex(t.specular),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearCoat&&(i.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(i.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.vertexColors&&(i.vertexColors=t.vertexColors),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(i.skinning=t.skinning),void 0!==t.morphTargets&&(i.morphTargets=t.morphTargets),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.uniforms)for(var r in t.uniforms){var o=t.uniforms[r];switch(i.uniforms[r]={},o.type){case"t":i.uniforms[r].value=n(o.value);break;case"c":i.uniforms[r].value=(new Jn).setHex(o.value);break;case"v2":i.uniforms[r].value=(new Ze).fromArray(o.value);break;case"v3":i.uniforms[r].value=(new Qe).fromArray(o.value);break;case"v4":i.uniforms[r].value=(new zn).fromArray(o.value);break;case"m4":i.uniforms[r].value=(new Je).fromArray(o.value);break;default:i.uniforms[r].value=o.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap),i.transparent=!0),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){var a=t.normalScale;!1===Array.isArray(a)&&(a=[a,a]),i.normalScale=(new Ze).fromArray(a)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),i},setPath:function(t){return this.path=t,this},setTextures:function(t){return this.textures=t,this}});var gc=function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)};function yc(t){this.manager=void 0!==t?t:Pl}Object.assign(yc.prototype,{load:function(t,e,n,i){var r=this,o=new Ol(r.manager);o.setPath(r.path),o.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){var e=new sr,n=t.data.index;if(void 0!==n){var i=new Mc[n.type](n.array);e.setIndex(new Ni(i,1))}var r=t.data.attributes;for(var o in r){var a=r[o];i=new Mc[a.type](a.array);e.addAttribute(o,new Ni(i,a.itemSize,a.normalized))}var s=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==s)for(var h=0,l=s.length;h!==l;++h){var c=s[h];e.addGroup(c.start,c.count,c.materialIndex)}var u=t.data.boundingSphere;if(void 0!==u){var p=new Qe;void 0!==u.center&&p.fromArray(u.center),e.boundingSphere=new jn(p,u.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e},setPath:function(t){return this.path=t,this}});var xc,bc,wc,_c,Mc={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Sc(){}function Tc(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:Pl,this.withCredentials=!1}function Ec(t){this.manager=void 0!==t?t:Pl,this.resourcePath=""}Sc.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,n=0,i=e.length;n<i;n+=2){var r=e[n],o=e[n+1];if(r.test(t))return o}return null}},Object.assign(Sc.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,n){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],e,n);return i},createMaterial:(xc={NoBlending:Z,NormalBlending:J,AdditiveBlending:K,SubtractiveBlending:Q,MultiplyBlending:$,CustomBlending:tt},bc=new Jn,wc=new Il,_c=new vc,function(t,l,c){var u={};function e(t,e,n,i,r){var o,a=l+t,s=Sc.Handlers.get(a);o=null!==s?s.load(a):(wc.setCrossOrigin(c),wc.load(a)),void 0!==e&&(o.repeat.fromArray(e),1!==e[0]&&(o.wrapS=Pt),1!==e[1]&&(o.wrapT=Pt)),void 0!==n&&o.offset.fromArray(n),void 0!==i&&("repeat"===i[0]&&(o.wrapS=Pt),"mirror"===i[0]&&(o.wrapS=Ot),"repeat"===i[1]&&(o.wrapT=Pt),"mirror"===i[1]&&(o.wrapT=Ot)),void 0!==r&&(o.anisotropy=r);var h=Ye.generateUUID();return u[h]=o,h}var n={uuid:Ye.generateUUID(),type:"MeshLambertMaterial"};for(var i in t){var r=t[i];switch(i){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":n.name=r;break;case"blending":n.blending=xc[r];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",i,"is no longer supported.");break;case"colorDiffuse":n.color=bc.fromArray(r).getHex();break;case"colorSpecular":n.specular=bc.fromArray(r).getHex();break;case"colorEmissive":n.emissive=bc.fromArray(r).getHex();break;case"specularCoef":n.shininess=r;break;case"shading":"basic"===r.toLowerCase()&&(n.type="MeshBasicMaterial"),"phong"===r.toLowerCase()&&(n.type="MeshPhongMaterial"),"standard"===r.toLowerCase()&&(n.type="MeshStandardMaterial");break;case"mapDiffuse":n.map=e(r,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":n.emissiveMap=e(r,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":n.lightMap=e(r,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":n.aoMap=e(r,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":n.bumpMap=e(r,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":n.bumpScale=r;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":n.normalMap=e(r,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":n.normalScale=r;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":n.specularMap=e(r,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":n.metalnessMap=e(r,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":n.roughnessMap=e(r,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":n.alphaMap=e(r,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":n.side=St;break;case"doubleSided":n.side=Tt;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),n.opacity=r;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":n[i]=r;break;case"vertexColors":!0===r&&(n.vertexColors=It),"face"===r&&(n.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",i,r)}}return"MeshBasicMaterial"===n.type&&delete n.emissive,"MeshPhongMaterial"!==n.type&&delete n.specular,n.opacity<1&&(n.transparent=!0),_c.setTextures(u),_c.parse(n)})}),Object.assign(Tc.prototype,{crossOrigin:"anonymous",load:function(o,a,t,e){var s=this,h=void 0===this.path?gc(o):this.path,n=new Ol(this.manager);n.setPath(this.path),n.setWithCredentials(this.withCredentials),n.load(o,function(t){var e=JSON.parse(t),n=e.metadata;if(void 0!==n){var i=n.type;if(void 0!==i&&"object"===i.toLowerCase())return void console.error("THREE.JSONLoader: "+o+" should be loaded with THREE.ObjectLoader instead.")}var r=s.parse(e,h);a(r.geometry,r.materials)},t,e)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){void 0!==t.data&&(t=t.data),void 0!==t.scale?t.scale=1/t.scale:t.scale=1;var n=new Bi;return function(t,e){function n(t,e){return t&1<<e}var i,r,o,a,s,h,l,c,u,p,d,f,m,v,g,y,x,b,w,_,M,S,T,E,A,C=t.faces,L=t.vertices,P=t.normals,R=t.colors,O=t.scale,k=0;if(void 0!==t.uvs){for(i=0;i<t.uvs.length;i++)t.uvs[i].length&&k++;for(i=0;i<k;i++)e.faceVertexUvs[i]=[]}for(a=0,s=L.length;a<s;)(b=new Qe).x=L[a++]*O,b.y=L[a++]*O,b.z=L[a++]*O,e.vertices.push(b);for(a=0,s=C.length;a<s;)if(d=n(p=C[a++],0),f=n(p,1),m=n(p,3),v=n(p,4),g=n(p,5),y=n(p,6),x=n(p,7),d){if((_=new ai).a=C[a],_.b=C[a+1],_.c=C[a+3],(M=new ai).a=C[a+1],M.b=C[a+2],M.c=C[a+3],a+=4,f&&(u=C[a++],_.materialIndex=u,M.materialIndex=u),o=e.faces.length,m)for(i=0;i<k;i++)for(E=t.uvs[i],e.faceVertexUvs[i][o]=[],e.faceVertexUvs[i][o+1]=[],r=0;r<4;r++)A=new Ze(E[2*(c=C[a++])],E[2*c+1]),2!==r&&e.faceVertexUvs[i][o].push(A),0!==r&&e.faceVertexUvs[i][o+1].push(A);if(v&&(l=3*C[a++],_.normal.set(P[l++],P[l++],P[l]),M.normal.copy(_.normal)),g)for(i=0;i<4;i++)l=3*C[a++],T=new Qe(P[l++],P[l++],P[l]),2!==i&&_.vertexNormals.push(T),0!==i&&M.vertexNormals.push(T);if(y&&(S=R[h=C[a++]],_.color.setHex(S),M.color.setHex(S)),x)for(i=0;i<4;i++)S=R[h=C[a++]],2!==i&&_.vertexColors.push(new Jn(S)),0!==i&&M.vertexColors.push(new Jn(S));e.faces.push(_),e.faces.push(M)}else{if((w=new ai).a=C[a++],w.b=C[a++],w.c=C[a++],f&&(u=C[a++],w.materialIndex=u),o=e.faces.length,m)for(i=0;i<k;i++)for(E=t.uvs[i],e.faceVertexUvs[i][o]=[],r=0;r<3;r++)A=new Ze(E[2*(c=C[a++])],E[2*c+1]),e.faceVertexUvs[i][o].push(A);if(v&&(l=3*C[a++],w.normal.set(P[l++],P[l++],P[l])),g)for(i=0;i<3;i++)l=3*C[a++],T=new Qe(P[l++],P[l++],P[l]),w.vertexNormals.push(T);if(y&&(h=C[a++],w.color.setHex(R[h])),x)for(i=0;i<3;i++)h=C[a++],w.vertexColors.push(new Jn(R[h]));e.faces.push(w)}}(t,n),function(t,e){var n=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,r=t.skinWeights.length;i<r;i+=n){var o=t.skinWeights[i],a=1<n?t.skinWeights[i+1]:0,s=2<n?t.skinWeights[i+2]:0,h=3<n?t.skinWeights[i+3]:0;e.skinWeights.push(new zn(o,a,s,h))}if(t.skinIndices)for(i=0,r=t.skinIndices.length;i<r;i+=n){var l=t.skinIndices[i],c=1<n?t.skinIndices[i+1]:0,u=2<n?t.skinIndices[i+2]:0,p=3<n?t.skinIndices[i+3]:0;e.skinIndices.push(new zn(l,c,u,p))}e.bones=t.bones,e.bones&&0<e.bones.length&&(e.skinWeights.length!==e.skinIndices.length||e.skinIndices.length!==e.vertices.length)&&console.warn("When skinning, number of vertices ("+e.vertices.length+"), skinIndices ("+e.skinIndices.length+"), and skinWeights ("+e.skinWeights.length+") should match.")}(t,n),function(t,e){var n=t.scale;if(void 0!==t.morphTargets)for(var i=0,r=t.morphTargets.length;i<r;i++){e.morphTargets[i]={},e.morphTargets[i].name=t.morphTargets[i].name,e.morphTargets[i].vertices=[];for(var o=e.morphTargets[i].vertices,a=t.morphTargets[i].vertices,s=0,h=a.length;s<h;s+=3){var l=new Qe;l.x=a[s]*n,l.y=a[s+1]*n,l.z=a[s+2]*n,o.push(l)}}if(void 0!==t.morphColors&&0<t.morphColors.length){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var c=e.faces,u=t.morphColors[0].colors;for(i=0,r=c.length;i<r;i++)c[i].color.fromArray(u,3*i)}}(t,n),function(t,e){var n=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var r=0;r<i.length;r++){var o=El.parseAnimation(i[r],e.bones);o&&n.push(o)}if(e.morphTargets){var a=El.CreateClipsFromMorphTargetSequences(e.morphTargets,10);n=n.concat(a)}0<n.length&&(e.animations=n)}(t,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:n}:{geometry:n,materials:Sc.prototype.initMaterials(t.materials,this.resourcePath||e,this.crossOrigin)}}}),Object.assign(Ec.prototype,{crossOrigin:"anonymous",load:function(i,r,t,o){var a=this,e=void 0===this.path?gc(i):this.path;this.resourcePath=this.resourcePath||e;var n=new Ol(a.manager);n.setPath(this.path),n.load(i,function(t){var e=null;try{e=JSON.parse(t)}catch(t){return void 0!==o&&o(t),void console.error("THREE:ObjectLoader: Can't parse "+i+".",t.message)}var n=e.metadata;void 0!==n&&void 0!==n.type&&"geometry"!==n.type.toLowerCase()?a.parse(e,r):console.error("THREE.ObjectLoader: Can't load "+i+". Use THREE.JSONLoader instead.")},t,o)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){var n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),r=this.parseImages(t.images,function(){void 0!==e&&e(s)}),o=this.parseTextures(t.textures,r),a=this.parseMaterials(t.materials,o),s=this.parseObject(t.object,i,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,i=t.length;n<i;n++){var r=(new rc).fromJSON(t[n]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var i=new Tc,r=new yc,o=0,a=t.length;o<a;o++){var s,h=t[o];switch(h.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new el[h.type](h.width,h.height,h.widthSegments,h.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new el[h.type](h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new el[h.type](h.radius,h.segments,h.thetaStart,h.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new el[h.type](h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded,h.thetaStart,h.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new el[h.type](h.radius,h.height,h.radialSegments,h.heightSegments,h.openEnded,h.thetaStart,h.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new el[h.type](h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new el[h.type](h.radius,h.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new el[h.type](h.innerRadius,h.outerRadius,h.thetaSegments,h.phiSegments,h.thetaStart,h.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new el[h.type](h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new el[h.type](h.radius,h.tube,h.tubularSegments,h.radialSegments,h.p,h.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new el[h.type](h.points,h.segments,h.phiStart,h.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new el[h.type](h.vertices,h.indices,h.radius,h.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],c=0,u=h.shapes.length;c<u;c++){var p=e[h.shapes[c]];l.push(p)}s=new el[h.type](l,h.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],c=0,u=h.shapes.length;c<u;c++){p=e[h.shapes[c]];l.push(p)}var d=h.options.extrudePath;void 0!==d&&(h.options.extrudePath=(new ec[d.type]).fromJSON(d)),s=new el[h.type](l,h.options);break;case"BufferGeometry":s=r.parse(h);break;case"Geometry":s=i.parse(h,this.resourcePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+h.type+'"');continue}s.uuid=h.uuid,void 0!==h.name&&(s.name=h.name),!0===s.isBufferGeometry&&void 0!==h.userData&&(s.userData=h.userData),n[h.uuid]=s}return n},parseMaterials:function(t,e){var n={},i={};if(void 0!==t){var r=new vc;r.setTextures(e);for(var o=0,a=t.length;o<a;o++){var s=t[o];if("MultiMaterial"===s.type){for(var h=[],l=0;l<s.materials.length;l++){var c=s.materials[l];void 0===n[c.uuid]&&(n[c.uuid]=r.parse(c)),h.push(n[c.uuid])}i[s.uuid]=h}else i[s.uuid]=r.parse(s),n[s.uuid]=i[s.uuid]}}return i},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n],r=El.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),e.push(r)}return e},parseImages:function(t,e){var n=this,i={};function r(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&&0<t.length){var o=new kl(new Ll(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var h=t[a],l=h.url;if(Array.isArray(l)){i[h.uuid]=[];for(var c=0,u=l.length;c<u;c++){var p=l[c],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;i[h.uuid].push(r(d))}}else{d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:n.resourcePath+h.url;i[h.uuid]=r(d)}}}return i},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 i={};if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var a,s=t[r];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 yo(e[s.image]):new kn(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,Cc)),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],Lc),a.wrapT=n(s.wrap[1],Lc)),void 0!==s.format&&(a.format=s.format),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),i[s.uuid]=a}return i},parseObject:function(t,e,o){var n;function i(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function r(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];void 0===o[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(o[r])}return e}return void 0===o[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),o[t]}}switch(t.type){case"Scene":n=new Ss,void 0!==t.background&&Number.isInteger(t.background)&&(n.background=new Jn(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new Ms(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new _s(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":n=new Ua(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new uc(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new fc(t.color,t.intensity);break;case"DirectionalLight":n=new dc(t.color,t.intensity);break;case"PointLight":n=new cc(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new mc(t.color,t.intensity,t.width,t.height);break;case"SpotLight":n=new lc(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":n=new ac(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var a=i(t.geometry),s=r(t.material);n=a.bones&&0<a.bones.length?new ks(a,s):new io(a,s);break;case"LOD":n=new Ps;break;case"Line":n=new Is(i(t.geometry),r(t.material),t.mode);break;case"LineLoop":n=new Bs(i(t.geometry),r(t.material));break;case"LineSegments":n=new Ds(i(t.geometry),r(t.material));break;case"PointCloud":case"Points":n=new Fs(i(t.geometry),r(t.material));break;case"Sprite":n=new Cs(r(t.material));break;case"Group":n=new Na;break;default:n=new Ci}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children)for(var h=t.children,l=0;l<h.length;l++)n.add(this.parseObject(h[l],e,o));if("LOD"===t.type)for(var c=t.levels,u=0;u<c.length;u++){var p=c[u],d=n.getObjectByProperty("uuid",p.object);void 0!==d&&n.addLevel(d,p.distance)}return n}});var Ac,Cc={UVMapping:300,CubeReflectionMapping:yt,CubeRefractionMapping:xt,EquirectangularReflectionMapping:bt,EquirectangularRefractionMapping:wt,SphericalReflectionMapping:At,CubeUVReflectionMapping:Ct,CubeUVRefractionMapping:Lt},Lc={RepeatWrapping:Pt,ClampToEdgeWrapping:Rt,MirroredRepeatWrapping:Ot},Pc={NearestFilter:kt,NearestMipMapNearestFilter:zt,NearestMipMapLinearFilter:Dt,LinearFilter:Bt,LinearMipMapNearestFilter:Nt,LinearMipMapLinearFilter:Ft};function Rc(){this.type="ShapePath",this.color=new Jn,this.subPaths=[],this.currentPath=null}function Oc(t){this.type="Font",this.data=t}function kc(t,e,n,i,r){var o=r.glyphs[t]||r.glyphs["?"];if(o){var a,s,h,l,c,u,p,d,f=new Rc;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+i,f.moveTo(a,s);break;case"l":a=m[v++]*e+n,s=m[v++]*e+i,f.lineTo(a,s);break;case"q":h=m[v++]*e+n,l=m[v++]*e+i,c=m[v++]*e+n,u=m[v++]*e+i,f.quadraticCurveTo(c,u,h,l);break;case"b":h=m[v++]*e+n,l=m[v++]*e+i,c=m[v++]*e+n,u=m[v++]*e+i,p=m[v++]*e+n,d=m[v++]*e+i,f.bezierCurveTo(c,u,p,d,h,l)}}return{offsetX:o.ha*e,path:f}}}function zc(t){this.manager=void 0!==t?t:Pl}Object.assign(Rc.prototype,{moveTo:function(t,e){this.currentPath=new ic,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,n,i){this.currentPath.quadraticCurveTo(t,e,n,i)},bezierCurveTo:function(t,e,n,i,r,o){this.currentPath.bezierCurveTo(t,e,n,i,r,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function n(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n],o=new rc;o.curves=r.curves,e.push(o)}return e}function i(t,e){for(var n=e.length,i=!1,r=n-1,o=0;o<n;r=o++){var a=e[r],s=e[o],h=s.x-a.x,l=s.y-a.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(a=e[o],h=-h,s=e[r],l=-l),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var c=l*(t.x-a.x)-h*(t.y-a.y);if(0==c)return!0;if(c<0)continue;i=!i}}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 i}var r=Ph.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,h,l=[];if(1===o.length)return s=o[0],(h=new rc).curves=s.curves,l.push(h),l;var c=!r(o[0].getPoints());c=t?!c:c;var u,p,d=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=o.length;g<y;g++)a=r(u=(s=o[g]).getPoints()),(a=t?!a:a)?(!c&&f[v]&&v++,f[v]={s:new rc,p:u},f[v].s.curves=s.curves,c&&v++,m[v]=[]):m[v].push({h:s,p:u[0]});if(!f[0])return n(o);if(1<f.length){for(var x=!1,b=[],w=0,_=f.length;w<_;w++)d[w]=[];for(w=0,_=f.length;w<_;w++)for(var M=m[w],S=0;S<M.length;S++){for(var T=M[S],E=!0,A=0;A<f.length;A++)i(T.p,f[A].p)&&(w!==A&&b.push({froms:w,tos:A,hole:S}),E?(E=!1,d[A].push(T)):x=!0);E&&d[w].push(T)}0<b.length&&(x||(m=d))}g=0;for(var C=f.length;g<C;g++){h=f[g].s,l.push(h);for(var L=0,P=(p=m[g]).length;L<P;L++)h.holes.push(p[L].h)}return l}}),Object.assign(Oc.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],i=function(t,e,n){for(var i=Array.from?Array.from(t):String(t).split(""),r=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,a=[],s=0,h=0,l=0;l<i.length;l++){var c=i[l];if("\n"===c)s=0,h-=o;else{var u=kc(c,r,s,h,n);s+=u.offsetX,a.push(u.path)}}return a}(t,e,this.data),r=0,o=i.length;r<o;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),Object.assign(zc.prototype,{load:function(t,i,e,n){var r=this,o=new Ol(this.manager);o.setPath(this.path),o.load(t,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var t=r.parse(n);i&&i(t)},e,n)},parse:function(t){return new Oc(t)},setPath:function(t){return this.path=t,this}});var Ic,Dc,Bc,Nc,Fc,Uc,jc,Vc,Gc,Hc,Wc,qc,Xc,Yc,Zc,Jc,Kc,Qc,$c,tu=function(){return void 0===Ac&&(Ac=new(window.AudioContext||window.webkitAudioContext)),Ac};function eu(t){this.manager=void 0!==t?t:Pl}function nu(t,e,n,i){Ci.call(this),this.type="CubeCamera";var r=new Ua(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new Qe(1,0,0)),this.add(r);var o=new Ua(90,1,t,e);o.up.set(0,-1,0),o.lookAt(new Qe(-1,0,0)),this.add(o);var a=new Ua(90,1,t,e);a.up.set(0,0,1),a.lookAt(new Qe(0,1,0)),this.add(a);var s=new Ua(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new Qe(0,-1,0)),this.add(s);var h=new Ua(90,1,t,e);h.up.set(0,-1,0),h.lookAt(new Qe(0,0,1)),this.add(h);var l=new Ua(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new Qe(0,0,-1)),this.add(l),i=i||{format:$t,magFilter:Bt,minFilter:Bt},this.renderTarget=new Dn(n,n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,i=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,t.render(e,r,n),n.activeCubeFace=1,t.render(e,o,n),n.activeCubeFace=2,t.render(e,a,n),n.activeCubeFace=3,t.render(e,s,n),n.activeCubeFace=4,t.render(e,h,n),n.texture.generateMipmaps=i,n.activeCubeFace=5,t.render(e,l,n),t.setRenderTarget(null)},this.clear=function(t,e,n,i){for(var r=this.renderTarget,o=0;o<6;o++)r.activeCubeFace=o,t.setRenderTarget(r),t.clear(e,n,i);t.setRenderTarget(null)}}function iu(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function ru(){Ci.call(this),this.type="AudioListener",this.context=tu(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function ou(t){Ci.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.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function au(t){ou.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function su(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 hu(t,e,n){this.binding=t,this.valueSize=n;var i,r=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(eu.prototype,{load:function(t,n,e,i){var r=new Ol(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(t,function(t){var e=t.slice(0);tu().decodeAudioData(e,function(t){n(t)})},e,i)},setPath:function(t){return this.path=t,this}}),Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ua,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ua,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}.prototype,{update:(Gc=new Je,Hc=new Je,function(t){if(Ic!==this||Dc!==t.focus||Bc!==t.fov||Nc!==t.aspect*this.aspect||Fc!==t.near||Uc!==t.far||jc!==t.zoom||Vc!==this.eyeSep){Ic=this,Dc=t.focus,Bc=t.fov,Nc=t.aspect*this.aspect,Fc=t.near,Uc=t.far,jc=t.zoom;var e,n,i=t.projectionMatrix.clone(),r=(Vc=this.eyeSep/2)*Fc/Dc,o=Fc*Math.tan(Ye.DEG2RAD*Bc*.5)/jc;Hc.elements[12]=-Vc,Gc.elements[12]=Vc,e=-o*Nc+r,n=o*Nc+r,i.elements[0]=2*Fc/(n-e),i.elements[8]=(n+e)/(n-e),this.cameraL.projectionMatrix.copy(i),e=-o*Nc-r,n=o*Nc-r,i.elements[0]=2*Fc/(n-e),i.elements[8]=(n+e)/(n-e),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Hc),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Gc)})}),(nu.prototype=Object.create(Ci.prototype)).constructor=nu,Object.assign(iu.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}}),ru.prototype=Object.assign(Object.create(Ci.prototype),{constructor:ru,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:(Wc=new Qe,qc=new Ke,Xc=new Qe,Yc=new Qe,Zc=new iu,function(t){Ci.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=Zc.getDelta(),this.matrixWorld.decompose(Wc,qc,Xc),Yc.set(0,0,-1).applyQuaternion(qc),e.positionX){var i=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Wc.x,i),e.positionY.linearRampToValueAtTime(Wc.y,i),e.positionZ.linearRampToValueAtTime(Wc.z,i),e.forwardX.linearRampToValueAtTime(Yc.x,i),e.forwardY.linearRampToValueAtTime(Yc.y,i),e.forwardZ.linearRampToValueAtTime(Yc.z,i),e.upX.linearRampToValueAtTime(n.x,i),e.upY.linearRampToValueAtTime(n.y,i),e.upZ.linearRampToValueAtTime(n.z,i)}else e.setPosition(Wc.x,Wc.y,Wc.z),e.setOrientation(Yc.x,Yc.y,Yc.z,n.x,n.y,n.z)})}),ou.prototype=Object.assign(Object.create(Ci.prototype),{constructor:ou,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},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,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.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){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(0<this.filters.length){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},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.setValueAtTime(this.playbackRate,this.context.currentTime),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.")},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}),au.prototype=Object.assign(Object.create(ou.prototype),{constructor:au,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:(Jc=new Qe,Kc=new Ke,Qc=new Qe,$c=new Qe,function(t){Ci.prototype.updateMatrixWorld.call(this,t);var e=this.panner;if(this.matrixWorld.decompose(Jc,Kc,Qc),$c.set(0,0,1).applyQuaternion(Kc),e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Jc.x,n),e.positionY.linearRampToValueAtTime(Jc.y,n),e.positionZ.linearRampToValueAtTime(Jc.z,n),e.orientationX.linearRampToValueAtTime($c.x,n),e.orientationY.linearRampToValueAtTime($c.y,n),e.orientationZ.linearRampToValueAtTime($c.z,n)}else e.setPosition(Jc.x,Jc.y,Jc.z),e.setOrientation($c.x,$c.y,$c.z)})}),Object.assign(su.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(hu.prototype,{accumulate:function(t,e){var n=this.buffer,i=this.valueSize,r=t*i+i,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==i;++a)n[r+a]=n[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,r<1){var a=3*e;this._mixBufferRegion(n,i,a,1-r,e)}for(var s=e,h=e+e;s!==h;++s)if(n[s]!==n[s+e]){o.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=3*n;t.getValue(e,i);for(var r=n,o=i;r!==o;++r)e[r]=e[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,i,r){if(.5<=i)for(var o=0;o!==r;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,i){Ke.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var o=1-i,a=0;a!==r;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*i}}});var lu,cu,uu,pu,du,fu,mu,vu,gu,yu,xu,bu,wu,_u,Mu,Su,Tu,Eu,Au,Cu,Lu,Pu,Ru,Ou,ku,zu,Iu,Du,Bu,Nu,Fu,Uu,ju,Vu,Gu,Hu,Wu,qu,Xu,Yu,Zu="\\[\\]\\.:\\/";function Ju(t,e,n){var i=n||Ku.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function Ku(t,e,n){this.path=e,this.parsedPath=n||Ku.parseTrackName(e),this.node=Ku.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Qu(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,o=new Array(r),a={endingStart:Oe,endingEnd:Oe},s=0;s!==r;++s){var h=i[s].createInterpolant(null);(o[s]=h).settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(r),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 $u(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function tp(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function ep(){sr.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function np(t,e,n){Ts.call(this,t,e),this.meshPerAttribute=n||1}function ip(t,e,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Ni.call(this,t,e,n),this.meshPerAttribute=i||1}function rp(t,e,n,i){this.ray=new to(t,e),this.near=n||0,this.far=i||1/0,this.params={Mesh:{},Line:{},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 op(t,e){return t.distance-e.distance}function ap(t,e,n,i){if(!1!==t.visible&&(t.raycast(e,n),!0===i))for(var r=t.children,o=0,a=r.length;o<a;o++)ap(r[o],e,n,!0)}function sp(t,e){this.min=void 0!==t?t:new Ze(1/0,1/0),this.max=void 0!==e?e:new Ze(-1/0,-1/0)}function hp(t,e){this.start=void 0!==t?t:new Qe,this.end=void 0!==e?e:new Qe}function lp(t){Ci.call(this),this.material=t,this.render=function(){}}function cp(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16711680,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var h=new sr,l=new qi(2*a*3,3);h.addAttribute("position",l),Ds.call(this,h,new zs({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function up(t,e){Ci.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new sr,i=[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],r=0,o=1;r<32;r++,o++){var a=r/32*Math.PI*2,s=o/32*Math.PI*2;i.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.addAttribute("position",new qi(i,3));var h=new zs({fog:!1});this.cone=new Ds(n,h),this.add(this.cone),this.update()}function pp(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var i=0;i<e.children.length;i++)n.push.apply(n,t(e.children[i]));return n}(t),n=new sr,i=[],r=[],o=new Jn(0,0,1),a=new Jn(0,1,0),s=0;s<e.length;s++){var h=e[s];h.parent&&h.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}n.addAttribute("position",new qi(i,3)),n.addAttribute("color",new qi(r,3));var l=new zs({vertexColors:It,depthTest:!1,depthWrite:!1,transparent:!0});Ds.call(this,n,l),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function dp(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var i=new Uh(e,4,2),r=new no({wireframe:!0,fog:!1});io.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function fp(t,e){Ci.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;var n=new zs({fog:!1}),i=new sr;i.addAttribute("position",new Ni(new Float32Array(15),3)),this.line=new Is(i,n),this.add(this.line),this.update()}function mp(t,e,n){Ci.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new Qs(e);i.rotateY(.5*Math.PI),this.material=new no({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=It);var r=i.getAttribute("position"),o=new Float32Array(3*r.count);i.addAttribute("color",new Ni(o,3)),this.add(new io(i,this.material)),this.update()}function vp(t,e,n,i){t=t||10,e=e||10,n=new Jn(void 0!==n?n:4473924),i=new Jn(void 0!==i?i:8947848);for(var r=e/2,o=t/e,a=t/2,s=[],h=[],l=0,c=0,u=-a;l<=e;l++,u+=o){s.push(-a,0,u,a,0,u),s.push(u,0,-a,u,0,a);var p=l===r?n:i;p.toArray(h,c),c+=3,p.toArray(h,c),c+=3,p.toArray(h,c),c+=3,p.toArray(h,c),c+=3}var d=new sr;d.addAttribute("position",new qi(s,3)),d.addAttribute("color",new qi(h,3));var f=new zs({vertexColors:It});Ds.call(this,d,f)}function gp(t,e,n,i,r,o){t=t||10,e=e||16,n=n||8,i=i||64,r=new Jn(void 0!==r?r:4473924),o=new Jn(void 0!==o?o:8947848);var a,s,h,l,c,u,p,d=[],f=[];for(l=0;l<=e;l++)h=l/e*(2*Math.PI),a=Math.sin(h)*t,s=Math.cos(h)*t,d.push(0,0,0),d.push(a,0,s),p=1&l?r:o,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(l=0;l<=n;l++)for(p=1&l?r:o,u=t-t/n*l,c=0;c<i;c++)h=c/i*(2*Math.PI),a=Math.sin(h)*u,s=Math.cos(h)*u,d.push(a,0,s),f.push(p.r,p.g,p.b),h=(c+1)/i*(2*Math.PI),a=Math.sin(h)*u,s=Math.cos(h)*u,d.push(a,0,s),f.push(p.r,p.g,p.b);var m=new sr;m.addAttribute("position",new qi(d,3)),m.addAttribute("color",new qi(f,3));var v=new zs({vertexColors:It});Ds.call(this,m,v)}function yp(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==n?n:16776960,o=void 0!==i?i:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var h=new sr,l=new qi(2*a*3,3);h.addAttribute("position",l),Ds.call(this,h,new zs({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function xp(t,e,n){Ci.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);var i=new sr;i.addAttribute("position",new qi([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new zs({fog:!1});this.lightPlane=new Is(i,r),this.add(this.lightPlane),(i=new sr).addAttribute("position",new qi([0,0,0,0,0,1],3)),this.targetLine=new Is(i,r),this.add(this.targetLine),this.update()}function bp(t){var e=new sr,n=new zs({color:16777215,vertexColors:1}),i=[],r=[],o={},a=new Jn(16755200),s=new Jn(16711680),h=new Jn(43775),l=new Jn(16777215),c=new Jn(3355443);function u(t,e,n){p(t,n),p(e,n)}function p(t,e){i.push(0,0,0),r.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}u("n1","n2",a),u("n2","n4",a),u("n4","n3",a),u("n3","n1",a),u("f1","f2",a),u("f2","f4",a),u("f4","f3",a),u("f3","f1",a),u("n1","f1",a),u("n2","f2",a),u("n3","f3",a),u("n4","f4",a),u("p","n1",s),u("p","n2",s),u("p","n3",s),u("p","n4",s),u("u1","u2",h),u("u2","u3",h),u("u3","u1",h),u("c","t",l),u("p","c",c),u("cn1","cn2",c),u("cn3","cn4",c),u("cf1","cf2",c),u("cf3","cf4",c),e.addAttribute("position",new qi(i,3)),e.addAttribute("color",new qi(r,3)),Ds.call(this,e,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function wp(t,e,n,i){ju.set(e,n,i).unproject(Vu);var r=Uu[t];if(void 0!==r)for(var o=Fu.getAttribute("position"),a=0,s=r.length;a<s;a++)o.setXYZ(r[a],ju.x,ju.y,ju.z)}function _p(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]),i=new Float32Array(24),r=new sr;r.setIndex(new Ni(n,1)),r.addAttribute("position",new Ni(i,3)),Ds.call(this,r,new zs({color:e})),this.matrixAutoUpdate=!1,this.update()}function Mp(t,e){this.type="Box3Helper",this.box=t;var n=void 0!==e?e:16776960,i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new sr;r.setIndex(new Ni(i,1)),r.addAttribute("position",new qi([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)),Ds.call(this,r,new zs({color:n})),this.geometry.computeBoundingSphere()}function Sp(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var i=void 0!==n?n:16776960,r=new sr;r.addAttribute("position",new qi([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)),r.computeBoundingSphere(),Is.call(this,r,new zs({color:i}));var o=new sr;o.addAttribute("position",new qi([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new io(o,new no({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}function Tp(t,e,n,i,r,o){Ci.call(this),void 0===t&&(t=new THREE.Vector3(0,0,1)),void 0===e&&(e=new THREE.Vector3(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===o&&(o=.2*r),void 0===Hu&&((Hu=new sr).addAttribute("position",new qi([0,0,0,0,1,0],3)),(Wu=new Jh(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new Is(Hu,new zs({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new io(Wu,new no({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,o)}function Ep(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 sr;n.addAttribute("position",new qi(e,3)),n.addAttribute("color",new qi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new zs({vertexColors:It});Ds.call(this,n,i)}function Ap(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Hl.call(this,t),this.type="catmullrom"}function Cp(t){return(Cp="function"==typeof Symbol&&"symbol"===ea(Symbol.iterator)?function(t){return void 0===t?"undefined":ea(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":ea(t)})(t)}function Lp(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Pp(t,e,n){return e&&Lp(t.prototype,e),n&&Lp(t,n),t}function Rp(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Object.assign(Ju.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].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(Ku,{Composite:Ju,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Ku.Composite(t,e,n):new Ku(t,e,n)},sanitizeNodeName:(gu=new RegExp("["+Zu+"]","g"),function(t){return t.replace(/\s/g,"_").replace(gu,"")}),parseTrackName:(lu="[^"+Zu+"]",cu="[^"+Zu.replace("\\.","")+"]",uu=/((?:WC+[\/:])*)/.source.replace("WC",lu),pu=/(WCOD+)?/.source.replace("WCOD",cu),du=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",lu),fu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",lu),mu=new RegExp("^"+uu+pu+du+fu+"$"),vu=["material","materials","bones"],function(t){var e=mu.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]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==vu.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}),findNode:function(t,o){if(!o||""===o||"root"===o||"."===o||-1===o||o===t.name||o===t.uuid)return t;if(t.skeleton){var e=t.skeleton.getBoneByName(o);if(void 0!==e)return e}if(t.children){var n=function t(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===o||i.uuid===o)return i;var r=t(i.children);if(r)return r}return null}(t.children);if(n)return n}return null}}),Object.assign(Ku.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,i=0,r=n.length;i!==r;++i)t[e++]=n[i]},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,i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=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,i=e.propertyName,r=e.propertyIndex;if(t||(t=Ku.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[i];if(void 0!==s){var h=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?h=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(h=this.Versioning.MatrixWorldNeedsUpdate);var l=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){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){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(t.geometry.morphAttributes.position[a].name===r){r=a;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===r){r=a;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][h]}else{var c=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" 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(Ku.prototype,{_getValue_unbound:Ku.prototype.getValue,_setValue_unbound:Ku.prototype.setValue}),Object.assign(function(){this.uuid=Ye.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 i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,h=void 0,l=0,c=arguments.length;l!==c;++l){var u=arguments[l],p=u.uuid,d=i[p];if(void 0===d){d=e++,i[p]=d,t.push(u);for(var f=0,m=s;f!==m;++f)a[f].push(new Ku(u,r[f],o[f]))}else if(d<n){h=t[d];var v=--n,g=t[v];t[i[g.uuid]=d]=g,t[i[p]=v]=u;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 Ku(u,r[f],o[f])),y[v]=b}}else t[d]!==h&&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,i=this._bindings,r=i.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],h=s.uuid,l=n[h];if(void 0!==l&&e<=l){var c=e++,u=t[c];t[n[u.uuid]=l]=u,t[n[h]=c]=s;for(var p=0,d=r;p!==d;++p){var f=i[p],m=f[c],v=f[l];f[l]=m,f[c]=v}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,o=r.length,a=0,s=arguments.length;a!==s;++a){var h=arguments[a].uuid,l=i[h];if(void 0!==l)if(delete i[h],l<n){var c=--n,u=t[c],p=t[g=--e];t[i[u.uuid]=l]=u,t[i[p.uuid]=c]=p,t.pop();for(var d=0,f=o;d!==f;++d){var m=(y=r[d])[c],v=y[g];y[l]=m,y[c]=v,y.pop()}}else{var g;t[i[(p=t[g=--e]).uuid]=l]=p,t.pop();for(d=0,f=o;d!==f;++d){var y;(y=r[d])[l]=y[g],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var o=this._paths,a=this._parsedPaths,s=this._objects,h=s.length,l=this.nCachedObjects_,c=new Array(h);i=r.length,n[t]=i,o.push(t),a.push(e),r.push(c);for(var u=l,p=s.length;u!==p;++u){var d=s[u];c[u]=new Ku(d,t,e)}return c},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var i=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];o[e[t[a]]=n]=s,o.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}),Object.assign(Qu.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 i=this._clip.duration,r=t._clip.duration,o=r/i,a=i/r;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 i=this._mixer,r=i.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,h=o.sampleValues;return s[0]=r,s[1]=r+n,h[0]=t/a,h[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,i){if(this.enabled){var r=this._startTime;if(null!==r){var o=(t-r)*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(0<s)for(var h=this._interpolants,l=this._propertyBindings,c=0,u=h.length;c!==u;++c)h[c].evaluate(a),l[c].accumulate(i,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 i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=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},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,i=this.loop,r=this._loopCount,o=2202===i;if(0===t)return-1===r?e:o&&1==(1&r)?n-e:e;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n<=e)e=n;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(0<=t?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),n<=e||e<0){var a=Math.floor(e/n);e-=n*a,r+=Math.abs(a);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=0<t?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1});else{if(1==s){var h=t<0;this._setEndings(h,!h,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1==(1&r))return n-(this.time=e)}return this.time=e},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=ke,i.endingEnd=ke):(i.endingStart=t?this.zeroSlopeAtStart?ke:Oe:2402,i.endingEnd=e?this.zeroSlopeAtEnd?ke:Oe:2402)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=r,s[0]=e,a[1]=r+t,s[1]=n,this}}),$u.prototype=Object.assign(Object.create(n.prototype),{constructor:$u,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,h=this._bindingsByRootAndName,l=h[s];void 0===l&&(l={},h[s]=l);for(var c=0;c!==r;++c){var u=i[c],p=u.name,d=l[p];if(void 0!==d)o[c]=d;else{if(void 0!==(d=o[c])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=e&&e._propertyBindings[c].binding.parsedPath;++(d=new hu(Ku.create(n,p,f),u.ValueTypeName,u.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),o[c]=d}a[c].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,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,o=0,a=r.length;o!==a;++o){var s=r[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,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}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 i=this._actions,r=this._actionsByClip,o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=i.length,i.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],i=t._cacheIndex;e[n._cacheIndex=i]=n,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,o=this._actionsByClip,a=o[r],s=a.knownActions,h=s[s.length-1],l=t._byClipCacheIndex;s[h._byClipCacheIndex=l]=h,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_addInactiveBinding:function(t,e,n){var i=this._bindingsByRootAndName,r=i[e],o=this._bindings;void 0===r&&(r={},i[e]=r),(r[n]=t)._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,a=o[i],s=e[e.length-1],h=t._cacheIndex;e[s._cacheIndex=h]=s,e.pop(),delete a[r];t:{for(var l in a)break t;delete o[i]}},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(t[(n=new vl(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];e[t.__cacheIndex=i]=t,e[r.__cacheIndex=n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?El.findByName(n,t):t,o=null!==r?r.uuid:t,a=this._actionsByClip[o],s=null;if(void 0!==a){var h=a.actionByRoot[i];if(void 0!==h)return h;s=a.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var l=new Qu(this,r,e);return this._bindAction(l,s),this._addInactiveAction(l,o,i),l},existingAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?El.findByName(n,t):t,o=r?r.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[i]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0;for(var r=this._nActiveBindings=0;r!==e;++r)t[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a){e[a]._update(i,t,r,o)}var s=this._bindings,h=this._nActiveBindings;for(a=0;a!==h;++a)s[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var o=r.knownActions,a=0,s=o.length;a!==s;++a){var h=o[a];this._deactivateAction(h);var l=h._cacheIndex,c=e[e.length-1];h._cacheIndex=null,h._byClipCacheIndex=null,e[c._cacheIndex=l]=c,e.pop(),this._removeInactiveBindingsForAction(h)}delete i[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}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))}}),tp.prototype.clone=function(){return new tp(void 0===this.value.clone?this.value:this.value.clone())},ep.prototype=Object.assign(Object.create(sr.prototype),{constructor:ep,isInstancedBufferGeometry:!0,copy:function(t){return sr.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),np.prototype=Object.assign(Object.create(Ts.prototype),{constructor:np,isInstancedInterleavedBuffer:!0,copy:function(t){return Ts.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),ip.prototype=Object.assign(Object.create(Ni.prototype),{constructor:ip,isInstancedBufferAttribute:!0,copy:function(t){return Ni.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(rp.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){var i=n||[];return ap(t,this,i,e),i.sort(op),i},intersectObjects:function(t,e,n){var i=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,o=t.length;r<o;r++)ap(t[r],this,i,e);return i.sort(op),i}}),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(Ye.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}}),Object.assign(sp.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:(xu=new Ze,function(t,e){var n=xu.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 Ze),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 Ze),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 Ze),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 Ze),e.copy(t).clamp(this.min,this.max)},distanceToPoint:(yu=new Ze,function(t){return yu.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)}}),Object.assign(hp.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 Qe),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 Qe),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 Qe),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(bu=new Qe,wu=new Qe,function(t,e){bu.subVectors(t,this.start),wu.subVectors(this.end,this.start);var n=wu.dot(wu),i=wu.dot(bu)/n;return e&&(i=Ye.clamp(i,0,1)),i}),closestPointToPoint:function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Qe),this.delta(n).multiplyScalar(i).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)}}),((lp.prototype=Object.create(Ci.prototype)).constructor=lp).prototype.isImmediateRenderObject=!0,((cp.prototype=Object.create(Ds.prototype)).constructor=cp).prototype.update=(_u=new Qe,Mu=new Qe,Su=new $e,function(){var t=["a","b","c"];this.object.updateMatrixWorld(!0),Su.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,n=this.geometry.attributes.position,i=this.object.geometry;if(i&&i.isGeometry)for(var r=i.vertices,o=i.faces,a=0,s=0,h=o.length;s<h;s++)for(var l=o[s],c=0,u=l.vertexNormals.length;c<u;c++){var p=r[l[t[c]]],d=l.vertexNormals[c];_u.copy(p).applyMatrix4(e),Mu.copy(d).applyMatrix3(Su).normalize().multiplyScalar(this.size).add(_u),n.setXYZ(a,_u.x,_u.y,_u.z),a+=1,n.setXYZ(a,Mu.x,Mu.y,Mu.z),a+=1}else if(i&&i.isBufferGeometry){var f=i.attributes.position,m=i.attributes.normal;for(c=a=0,u=f.count;c<u;c++)_u.set(f.getX(c),f.getY(c),f.getZ(c)).applyMatrix4(e),Mu.set(m.getX(c),m.getY(c),m.getZ(c)),Mu.applyMatrix3(Su).normalize().multiplyScalar(this.size).add(_u),n.setXYZ(a,_u.x,_u.y,_u.z),a+=1,n.setXYZ(a,Mu.x,Mu.y,Mu.z),a+=1}n.needsUpdate=!0}),((up.prototype=Object.create(Ci.prototype)).constructor=up).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},up.prototype.update=(Tu=new Qe,Eu=new Qe,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),Tu.setFromMatrixPosition(this.light.matrixWorld),Eu.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Eu.sub(Tu)),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}),((pp.prototype=Object.create(Ds.prototype)).constructor=pp).prototype.updateMatrixWorld=(Au=new Qe,Cu=new Je,Lu=new Je,function(t){var e=this.bones,n=this.geometry,i=n.getAttribute("position");Lu.getInverse(this.root.matrixWorld);for(var r=0,o=0;r<e.length;r++){var a=e[r];a.parent&&a.parent.isBone&&(Cu.multiplyMatrices(Lu,a.matrixWorld),Au.setFromMatrixPosition(Cu),i.setXYZ(o,Au.x,Au.y,Au.z),Cu.multiplyMatrices(Lu,a.parent.matrixWorld),Au.setFromMatrixPosition(Cu),i.setXYZ(o+1,Au.x,Au.y,Au.z),o+=2)}n.getAttribute("position").needsUpdate=!0,Ci.prototype.updateMatrixWorld.call(this,t)}),((dp.prototype=Object.create(io.prototype)).constructor=dp).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},dp.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},((fp.prototype=Object.create(Ci.prototype)).constructor=fp).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},fp.prototype.update=function(){var t=.5*this.light.width,e=.5*this.light.height,n=this.line.geometry.attributes.position,i=n.array;i[0]=t,i[1]=-e,i[2]=0,i[3]=t,i[4]=e,i[5]=0,i[6]=-t,i[7]=e,i[8]=0,i[9]=-t,i[10]=-e,i[11]=0,i[12]=t,i[13]=-e,i[14]=0,n.needsUpdate=!0,void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)},((mp.prototype=Object.create(Ci.prototype)).constructor=mp).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},mp.prototype.update=(Pu=new Qe,Ru=new Jn,Ou=new Jn,function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");Ru.copy(this.light.color),Ou.copy(this.light.groundColor);for(var n=0,i=e.count;n<i;n++){var r=n<i/2?Ru:Ou;e.setXYZ(n,r.r,r.g,r.b)}e.needsUpdate=!0}t.lookAt(Pu.setFromMatrixPosition(this.light.matrixWorld).negate())}),(vp.prototype=Object.create(Ds.prototype)).constructor=vp,(gp.prototype=Object.create(Ds.prototype)).constructor=gp,((yp.prototype=Object.create(Ds.prototype)).constructor=yp).prototype.update=(ku=new Qe,zu=new Qe,Iu=new $e,function(){this.object.updateMatrixWorld(!0),Iu.getNormalMatrix(this.object.matrixWorld);for(var t=this.object.matrixWorld,e=this.geometry.attributes.position,n=this.object.geometry,i=n.vertices,r=n.faces,o=0,a=0,s=r.length;a<s;a++){var h=r[a],l=h.normal;ku.copy(i[h.a]).add(i[h.b]).add(i[h.c]).divideScalar(3).applyMatrix4(t),zu.copy(l).applyMatrix3(Iu).normalize().multiplyScalar(this.size).add(ku),e.setXYZ(o,ku.x,ku.y,ku.z),o+=1,e.setXYZ(o,zu.x,zu.y,zu.z),o+=1}e.needsUpdate=!0}),((xp.prototype=Object.create(Ci.prototype)).constructor=xp).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},xp.prototype.update=(Du=new Qe,Bu=new Qe,Nu=new Qe,function(){Du.setFromMatrixPosition(this.light.matrixWorld),Bu.setFromMatrixPosition(this.light.target.matrixWorld),Nu.subVectors(Bu,Du),this.lightPlane.lookAt(Bu),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(Bu),this.targetLine.scale.z=Nu.length()}),((bp.prototype=Object.create(Ds.prototype)).constructor=bp).prototype.update=(ju=new Qe,Vu=new Fa,function(){Fu=this.geometry,Uu=this.pointMap,Vu.projectionMatrix.copy(this.camera.projectionMatrix),wp("c",0,0,-1),wp("t",0,0,1),wp("n1",-1,-1,-1),wp("n2",1,-1,-1),wp("n3",-1,1,-1),wp("n4",1,1,-1),wp("f1",-1,-1,1),wp("f2",1,-1,1),wp("f3",-1,1,1),wp("f4",1,1,1),wp("u1",.7,1.1,-1),wp("u2",-.7,1.1,-1),wp("u3",0,2,-1),wp("cf1",-1,0,1),wp("cf2",1,0,1),wp("cf3",0,-1,1),wp("cf4",0,1,1),wp("cn1",-1,0,-1),wp("cn2",1,0,-1),wp("cn3",0,-1,-1),wp("cn4",0,1,-1),Fu.getAttribute("position").needsUpdate=!0}),((_p.prototype=Object.create(Ds.prototype)).constructor=_p).prototype.update=(Gu=new Nn,function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Gu.setFromObject(this.object),!Gu.isEmpty()){var e=Gu.min,n=Gu.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}),_p.prototype.setFromObject=function(t){return this.object=t,this.update(),this},_p.prototype.copy=function(t){return Ds.prototype.copy.call(this,t),this.object=t.object,this},_p.prototype.clone=function(){return(new this.constructor).copy(this)},((Mp.prototype=Object.create(Ds.prototype)).constructor=Mp).prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Ci.prototype.updateMatrixWorld.call(this,t))},((Sp.prototype=Object.create(Is.prototype)).constructor=Sp).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?St:D,this.lookAt(this.plane.normal),Ci.prototype.updateMatrixWorld.call(this,t)},((Tp.prototype=Object.create(Ci.prototype)).constructor=Tp).prototype.setDirection=(Xu=new Qe,function(t){.99999<t.y?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(Xu.set(t.z,0,-t.x).normalize(),qu=Math.acos(t.y),this.quaternion.setFromAxisAngle(Xu,qu))}),Tp.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(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Tp.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},Tp.prototype.copy=function(t){return Ci.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Tp.prototype.clone=function(){return(new this.constructor).copy(this)},(Ep.prototype=Object.create(Ds.prototype)).constructor=Ep,Dl.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Dl.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},Object.assign(nc.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 Bi,n=0,i=t.length;n<i;n++){var r=t[n];e.vertices.push(new Qe(r.x,r.y,r.z||0))}return e}}),Object.assign(ic.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Ap.prototype=Object.create(Hl.prototype),Object.assign(Ap.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.")}}),vp.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},pp.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Sc.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),gc(t)}}),Object.assign(Tc.prototype,{setTexturePath:function(t){return console.warn("THREE.JSONLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(Ec.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(sp.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(Nn.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)}}),hp.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(Ye,{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()."),Ye.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Ye.ceilPowerOfTwo(t)}}),Object.assign($e.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.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Je.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 void 0===Yu&&(Yu=new Qe),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),Yu.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.")},applyToBuffer:function(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,o)}}),Vn.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Ke.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(to.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(eo.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(eo,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),eo.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),eo.getNormal(t,e,n,i)}}),Object.assign(rc.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 kh(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Wh(this,t)}}),Object.assign(Ze.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(Qe.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(zn.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(Bi.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.")}}),Object.assign(Ci.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.")}}),Object.defineProperties(Ci.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.defineProperties(Ps.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Rs.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(Dl.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}}),Ua.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(oc.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(Ni.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(sr.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},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.")}}),Object.defineProperties(sr.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.assign(zh.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(tp.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(Qr.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 Jn}},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}}}),Object.defineProperties(al.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($r.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(ws.prototype,{clearTarget:function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},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.")}}),Object.defineProperties(ws.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.")}}}),Object.defineProperties(za.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(In.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(xs.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),ou.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new eu).load(t,function(t){e.setBuffer(t)}),this},su.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},nu.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},Rn.crossOrigin=void 0,Rn.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new Il;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},Rn.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new zl;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},Rn.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Rn.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};function Op(){for(var t=0;t<Np.length;t++)Np[t]()}function kp(t){var e=Bp.indexOf(t);-1<e&&Bp.splice(e,1),Bp.push(t),Fp=0,Op()}function zp(t){var e=Bp.indexOf(t);-1!==e&&Bp.splice(e,1)}var Ip="undefined"!=typeof window?window:global,Dp=(Ip.requestAnimationFrame,function(){if("undefined"==typeof process||void 0===process.hrtime||process.versions&&void 0!==process.versions.electron){if(void 0!==Ip.performance&&void 0!==Ip.performance.now)return Ip.performance.now.bind(Ip.performance);var t=Ip.performance&&Ip.performance.timing&&Ip.performance.timing.navigationStart?Ip.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}return function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}}()),Bp=[],Np=[],Fp=0,Up=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Dp(),e=1<arguments.length?arguments[1]:void 0;if(120<=Fp)return Fp=0,!1;Op(),Bp.length||Fp++;for(var n=0,i=Bp.length;n<i;)Bp[n++].update(t,e),i>Bp.length&&n--,i=Bp.length;return!0},jp={},Vp={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return--t*t*(2.70158*t+1.70158)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((1+e)*t-e)*.5:.5*((t-=2)*t*((1+e)*t+e)+2)}},Bounce:{In:function(t){return 1-Vp.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*Vp.Bounce.In(2*t):.5*Vp.Bounce.Out(2*t-1)+.5}},Stepped:{steps:function(e){return function(t){return(t*e|0)/e}}}},Gp="_chainedTweens",Hp="Callback",Wp="STRING_PROP",qp=/\s+|([A-Za-z?().,{}:""[\]#%]+)|([-+]=+)?([-+]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]=?\d+)?/g;function Xp(t){if(t&&t.nodeType||void 0===t||"object"!==Cp(t))return t;if(Array.isArray(t))return[].concat(t);if("object"!==Cp(t))return t;var e={};for(var n in t)e[n]=Xp(t[n]);return e}var Yp=function(t){return isNaN(+t)||("+"===t[0]||"-"===t[0])&&"="===t[1]||""===t||" "===t},Zp=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,Jp=function(t,e){var n,i,r;3===e.length&&(e=(n=e[0])+n+(i=e[1])+i+(r=e[2])+r);var o=parseInt(e,16);return"rgb("+(n=o>>16&255)+","+(i=o>>8&255)+","+(r=255&o)+")"};function Kp(t){return"string"!=typeof t?t:t.replace(Zp,Jp).match(qp).map(function(t){return Yp(t)?t:+t})}function Qp(n,i,t,e){var r=t[n],o=e[n];if("string"==typeof r||"string"==typeof o){for(var a=Array.isArray(r)&&r[0]===Wp?r:Kp(r),s=Array.isArray(o)&&o[0]===Wp?o:Kp(o),h=1;h<a.length;)a[h]===s[h]&&"string"==typeof a[h-1]?(a.splice(h-1,2,a[h-1]+a[h]),s.splice(h-1,2,s[h-1]+s[h])):h++;a[h=0]===Wp&&a.shift(),s[0]===Wp&&s.shift();for(var l={isString:!0,length:a.length},c={isString:!0,length:s.length};h<l.length;)l[h]=a[h],c[h]=s[h],h++;return t[n]=l,e[n]=c,!0}if("object"!==Cp(r)||"object"!==Cp(o))return!1;if(Array.isArray(r))return r.map(function(t,e){return Qp(e,i[n],r,o)});for(var u in o)Qp(u,i[n],r,o);return!0}var $p=Math.pow(10,4),td="rgba(",ed=function(t,e,n){var i=2<arguments.length&&void 0!==n?n:"rgb(";return"number"==typeof t[e]&&(t[e-1]===i||t[e-3]===i||t[e-5]===i)};function nd(t,e,n,i,r,o,a){var s=a?n:n[t],h=a?i:i[t];if(void 0===h)return s;if(void 0===s||"string"==typeof s||s===h)return h;if("object"===Cp(s)&&"object"===Cp(h)){if(!s||!h)return e[t];if("object"===Cp(s)&&s&&s.isString){for(var l="",c=0,u=s.length;c<u;c++){var p="number"==typeof s[c]&&"string"==typeof h[c]&&"="===h[c][1],d="number"!=typeof s[c]?s[c]:((p?s[c]+parseFloat(h[c][0]+h[c].substr(2))*r:s[c]+(h[c]-s[c])*r)*$p|0)/$p;(ed(s,c)||ed(s,c,td))&&(d|=0),l+=d,p&&1===o&&(s[c]=s[c]+parseFloat(h[c][0]+h[c].substr(2)))}return a||(e[t]=l),l}if(Array.isArray(s)&&s[0]!==Wp)for(var f=0,m=s.length;f<m;f++)s[f]!==h[f]&&nd(f,e[t],s,h,r,o);else if("object"===Cp(s)&&s&&!s.isString)for(var v in s)s[v]!==h[v]&&nd(v,e[t],s,h,r,o)}else if("number"==typeof s){var g="string"==typeof h;e[t]=((g?s+parseFloat(h[0]+h.substr(2))*r:s+(h-s)*r)*$p|0)/$p,g&&1===o&&(n[t]=e[t])}else"function"==typeof h&&(e[t]=h(r));return e[t]}function id(t,e){var r=t[e],o=e.replace(hd,"").split(sd),a=o.length-1,s=Array.isArray(t),h="object"===Cp(t)&&!s;return h?(t[e]=null,delete t[e]):s&&t.splice(e,1),o.reduce(function(t,e,n){s&&"."!==e&&"["!==e&&(e*=1);var i="["===o[n+1];if("."===e||"["===e)return"."===e?s=!(h=!0):"["===e&&(s=!(h=!1)),t;if(void 0===t[e]){if(s||h)return t[e]=n===a?r:s||i?[]:h?{}:null,h=s=!1,t[e]}else if(void 0!==t[e])return n===a&&(t[e]=r),t[e];return t},t)}function rd(t){if("object"===Cp(t)&&t)for(var e in t)if(-1!==e.indexOf(".")||-1!==e.indexOf("["))id(t,e);else if("object"===Cp(t[e])&&t[e]){var n=t[e];for(var i in n)if(-1!==i.indexOf(".")||-1!==i.indexOf("["))id(n,i);else if("object"===Cp(n[i])&&n[i]){var r=n[i];for(var o in r)-1===o.indexOf(".")&&-1===o.indexOf("[")||id(r,o)}}return t}function od(t,e,n){if(!t||!t.nodeType)return e;var i=t.queueID||"q_"+Date.now();t.queueID||(t.queueID=i);var r=cd[i];if(r){if(r.object===e&&t===r.tween.node&&n._startTime===r.tween._startTime)zp(r.tween);else if("object"===Cp(e)&&e&&r.object){for(var o in e)o in r.object&&(n._startTime===r.tween._startTime?delete r.object[o]:r.propNormaliseRequired=!0);r.object=function(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},e=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),e.forEach(function(t){var e,n,i;e=r,i=o[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return r}({},r.object,e)}return r.object}return"object"===Cp(e)&&e?(cd[i]={tween:n,object:e,propNormaliseRequired:!1},cd[i].object):e}var ad,sd=/([.[])/g,hd=/\]/g,ld={Linear:function(t,e,n){var i=t.length-1,r=i*e,o=Math.floor(r),a=ld.Utils.Linear;return e<0?a(t[0],t[1],r,n):1<e?a(t[i],t[i-1],i-r,n):a(t[o],t[i<o+1?i:o+1],r-o,n)},Bezier:function(t,e,n){for(var i=ld.Utils.Reset(n),r=t.length-1,o=Math.pow,a=ld.Utils.Bernstein,s=Array.isArray(i),h=0;h<=r;h++)if("number"==typeof i)i+=o(1-e,r-h)*o(e,h)*t[h]*a(r,h);else if(s)for(var l=0,c=i.length;l<c;l++)"number"==typeof i[l]?i[l]+=o(1-e,r-h)*o(e,h)*t[h][l]*a(r,h):i[l]=t[h][l];else if("object"===Cp(i))for(var u in i)"number"==typeof i[u]?i[u]+=o(1-e,r-h)*o(e,h)*t[h][u]*a(r,h):i[u]=t[h][u];else if("string"==typeof i){for(var p="",d=t[Math.round(r*e)],f=1,m=d.length;f<m;f++)p+=d[f];return p}return i},CatmullRom:function(t,e,n){var i=t.length-1,r=i*e,o=Math.floor(r),a=ld.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(o=Math.floor(r=i*(1+e))),a(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],r-o,n)):e<0?a(t[1],t[1],t[0],t[0],-e,n):1<e?a(t[i-1],t[i-1],t[i],t[i],(0|e)-e,n):a(t[o?o-1:0],t[o],t[i<o+1?i:o+1],t[i<o+2?i:o+2],r-o,n)},Utils:{Linear:function(t,e,n,i){if("string"==typeof t)return e;if("number"==typeof t)return"function"==typeof t?t(n):t+(e-t)*n;if("object"===Cp(t)){if(void 0!==t.length){if(t[0]===Wp){for(var r="",o=1,a=t.length;o<a;o++){var s="number"==typeof t[o]?t[o]+(e[o]-t[o])*n:e[o];(ed(t,o)||ed(t,o,td))&&(s|=0),r+=s}return r}for(var h=0,l=i.length;h<l;h++)i[h]=ld.Utils.Linear(t[h],e[h],n,i[h])}else for(var c in i)i[c]=ld.Utils.Linear(t[c],e[c],n,i[c]);return i}},Reset:function(t){if(Array.isArray(t)){for(var e=0,n=t.length;e<n;e++)t[e]=ld.Utils.Reset(t[e]);return t}if("object"!==Cp(t))return"number"==typeof t?0:t;for(var i in t)t[i]=ld.Utils.Reset(t[i]);return t},Bernstein:function(t,e){var n=ld.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(ad=[1],function(t){var e=1;if(ad[t])return ad[t];for(var n=t;1<n;n--)e*=n;return ad[t]=e}),CatmullRom:function(t,e,n,i,r,o){if("string"==typeof t)return e;if("number"==typeof t){var a=.5*(n-t),s=.5*(i-e),h=r*r;return(2*e-2*n+a+s)*(r*h)+(-3*e+3*n-2*a-s)*h+a*r+e}if("object"===Cp(t)){if(void 0!==t.length){if(t[0]===Wp){for(var l="",c=1,u=t.length;c<u;c++){var p="number"==typeof t[c]?ld.Utils.CatmullRom(t[c],e[c],n[c],i[c],r):i[c];(ed(t,c)||ed(t,c,td))&&(p|=0),l+=p}return l}for(var d=0,f=o.length;d<f;d++)o[d]=ld.Utils.CatmullRom(t[d],e[d],n[d],i[d],r,o[d])}else for(var m in o)o[m]=ld.Utils.CatmullRom(t[m],e[m],n[m],i[m],r,o[m]);return o}}}},cd={},ud=0,pd=Vp.Linear.None,dd=function(){function k(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,k),this.id=ud++,!t||"object"!==Cp(t)||e||t.nodeType?t&&(t.nodeType||t.length||"string"==typeof t)&&(t=this.node=function(t,e){return e?t?t===window||t===document?[t]:"string"==typeof t?!!document.querySelectorAll&&document.querySelectorAll(t):Array.isArray(t)?t:t.nodeType?[t]:[]:null:t?t===window||t===document?t:"string"==typeof t?!!document.querySelector&&document.querySelector(t):Array.isArray(t)?t[0]:t.nodeType?t:null:null}(t),e=this.object=od(t,e,this)):(e=this.object=t,t=null),this._valuesEnd=null,this._valuesStart={},this._duration=1e3,this._easingFunction=pd,this._easingReverse=pd,this._interpolationFunction=ld.Linear,this._startTime=0,this._initTime=0,this._delayTime=0,this._repeat=0,this._r=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._pausedTime=null,this._isFinite=!0,this._maxListener=15,this._chainedTweensCount=0,this._prevTime=null,this}return Pp(k,null,[{key:"fromTo",value:function(t,e,n,i){var r=3<arguments.length&&void 0!==i?i:{};r.quickRender=r.quickRender?r.quickRender:!n;var o=new k(t,e).to(n,r);return r.quickRender&&(o.render().update(o._startTime),o._rendered=!1,o._onStartCallbackFired=!1),o}},{key:"to",value:function(t,e,n){return k.fromTo(t,null,e,n)}},{key:"from",value:function(t,e,n){return k.fromTo(t,e,null,n)}}]),Pp(k,[{key:"setMaxListener",value:function(t){var e=0<arguments.length&&void 0!==t?t:15;return this._maxListener=e,this}},{key:"on",value:function(t,e){for(var n=this._maxListener,i=t+Hp,r=0;r<n;r++){var o=i+r;if(!this[o]){this[o]=e;break}}return this}},{key:"once",value:function(t,e){return this}},{key:"off",value:function(t,e){for(var n=this._maxListener,i=t+Hp,r=0;r<n;r++){var o=i+r;this[o]===e&&(this[o]=null)}return this}},{key:"emit",value:function(t,e,n,i,r){var o=this._maxListener,a=t+Hp;if(!this[a+0])return this;for(var s=0;s<o;s++){var h=a+s;this[h]&&this[h](e,n,i,r)}return this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"isStarted",value:function(){return this._onStartCallbackFired}},{key:"reverse",value:function(t){var e=this._reversed;return this._reversed=void 0!==t?t:!e,this}},{key:"reversed",value:function(){return this._reversed}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,zp(this),this._pausedTime=Dp(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=Dp()-this._pausedTime,this._initTime=this._startTime,kp(this),this._pausedTime=Dp(),this.emit("play",this.object))}},{key:"restart",value:function(t){return this._repeat=this._r,this.reassignValues(),kp(this),this.emit("restart",this.object)}},{key:"seek",value:function(t,e){var n=this._duration,i=this._initTime,r=this._startTime,o=this._reversed,a=i+t;return this._isPlaying=!0,a<r&&i<=r&&(this._startTime-=n,this._reversed=!o),this.update(t,!1),this.emit("seek",t,this.object),e?this:this.pause()}},{key:"duration",value:function(t){return this._duration="function"==typeof t?t(this._duration):t,this}},{key:"to",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:1e3;if(this._valuesEnd=t,"number"==typeof n||"function"==typeof n)this._duration="function"==typeof n?n(this._duration):n;else if("object"===Cp(n))for(var i in n)if("function"==typeof this[i]){var r=Rp(Array.isArray(n[i])?n[i]:[n[i]],4),o=r[0],a=void 0===o?null:o,s=r[1],h=void 0===s?null:s,l=r[2],c=void 0===l?null:l,u=r[3],p=void 0===u?null:u;this[i](a,h,c,p)}return this}},{key:"render",value:function(){if(this._rendered)return this;var t=this._valuesStart,e=this._valuesEnd,n=this.object,i=this.node,r=this.InitialValues;if(rd(n),rd(e),i&&i.queueID&&cd[i.queueID]){var o=cd[i.queueID];o.propNormaliseRequired&&o.tween!==this&&(o.normalisedProp=!0,o.propNormaliseRequired=!1)}for(var a in i&&r&&(n&&0!==Object.keys(n).length?e&&0!==Object.keys(e).length||(e=this._valuesEnd=r(i,n)):n=this.object=od(i,r(i,e),this)),e){var s=n&&n[a]&&Xp(n[a]),h=e[a];if(!(jp[a]&&jp[a].init&&(jp[a].init.call(this,s,h,a,n),void 0===s&&t[a]&&(s=t[a]),jp[a].skipProcess))&&!("number"==typeof s&&isNaN(s)||null===s||null===h||!1===s||!1===h||void 0===s||void 0===h||s===h)){if(Array.isArray(h)&&!Array.isArray(s)){h.unshift(s);for(var l=0,c=h.length;l<c;l++)if("string"==typeof h[l]){for(var u=Kp(h[l]),p={length:u.length,isString:!0},d=0,f=u.length;d<f;d++)p[d]=u[d];h[l]=p}}"number"==typeof(t[a]=s)&&"string"==typeof h&&"="===h[1]||Qp(a,n,t,e)}}return k.Renderer&&this.node&&k.Renderer.init&&(k.Renderer.init.call(this,n,t,e),this.__render=!0),this}},{key:"start",value:function(t){return this._startTime=void 0!==t?"string"==typeof t?Dp()+parseFloat(t):t:Dp(),this._startTime+=this._delayTime,this._initTime=this._prevTime=this._startTime,this._onStartCallbackFired=!1,this._rendered=!1,this._isPlaying=!0,kp(this),this}},{key:"stop",value:function(){var t=this._isPlaying,e=this._isFinite,n=this.object,i=this._startTime,r=this._duration,o=this._r,a=this._yoyo,s=this._reversed;if(!t)return this;var h=e?(o+1)%2==1:!s;return this._reversed=!1,a&&h?this.update(i):this.update(i+r),zp(this),this.emit("stop",n)}},{key:"delay",value:function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this}},{key:"chainedTweens",value:function(){if(this._chainedTweensCount=arguments.length,!this._chainedTweensCount)return this;for(var t=0,e=this._chainedTweensCount;t<e;t++)this[Gp+t]=arguments[t];return this}},{key:"repeat",value:function(t){return this._repeat=this._duration?"function"==typeof t?t(this._repeat):t:0,this._r=this._repeat,this._isFinite=isFinite(t),this}},{key:"reverseDelay",value:function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this}},{key:"yoyo",value:function(t,e){return this._yoyo="function"==typeof t?t(this._yoyo):null===t?this._yoyo:t,t||(this._reversed=!1),this._easingReverse=e||null,this}},{key:"easing",value:function(t){return this._easingFunction=t,this}},{key:"interpolation",value:function(t){return"function"==typeof t&&(this._interpolationFunction=t),this}},{key:"reassignValues",value:function(t){var e=this._valuesStart,n=this.object,i=this._delayTime;for(var r in this._isPlaying=!0,this._startTime=void 0!==t?t:Dp(),this._startTime+=i,this._reversed=!1,kp(this),e){var o=e[r];n[r]=o}return this}},{key:"update",value:function(t,e,n){var i,r,o,a=this._onStartCallbackFired,s=this._easingFunction,h=this._interpolationFunction,l=this._easingReverse,c=this._repeat,u=this._delayTime,p=this._reverseDelayTime,d=this._yoyo,f=this._reversed,m=this._startTime,v=this._prevTime,g=this._duration,y=this._valuesStart,x=this._valuesEnd,b=this.object,w=this._isFinite,_=this._isPlaying,M=this.__render,S=this._chainedTweensCount,T=0;if(g){var E=(t=void 0!==t?t:Dp())-v;if(this._prevTime=t,250<E&&(t-=E-50/3),!_||t<m&&!n)return!0;i=1<(i=(t-m)/g)?1:i,i=f?1-i:i}else i=1,c=0;if(a||(this._rendered||(this.render(),this._rendered=!0),this.emit("start",b),this._onStartCallbackFired=!0),r=f&&l||s,!b)return!0;for(o in x){var A=y[o];if(null!=A||jp[o]&&jp[o].update){var C=x[o],L=r[o]?r[o](i):"function"==typeof r?r(i):pd(i),P=h[o]?h[o]:"function"==typeof h?h:ld.Linear;"number"==typeof C?b[o]=A+(C-A)*L:Array.isArray(C)&&!Array.isArray(A)?b[o]=P(C,L,b[o]):C&&C.update?C.update(L):"function"==typeof C?b[o]=C(L):"string"==typeof C&&"number"==typeof A?b[o]=A+parseFloat(C[0]+C.substr(2))*L:nd(o,b,y,x,L,i),jp[o]&&jp[o].update&&jp[o].update.call(this,b[o],A,C,L,i,o),T++}}if(!T)return zp(this),!1;if(M&&k.Renderer&&k.Renderer.update&&k.Renderer.update.call(this,b,i),this.emit("update",b,i,t),1===i||f&&0===i){if(0<c&&0<g){if(w&&this._repeat--,d)this._reversed=!f;else for(o in x){var R=x[o];"string"==typeof R&&"number"==typeof y[o]&&(y[o]+=parseFloat(R[0]+R.substr(2)))}return this.emit(d&&!f?"reverse":"repeat",b),this._startTime=f&&p?t-p:t+u,!0}if(e||(this._isPlaying=!1,zp(this),ud--),this.emit("complete",b),this._repeat=this._r,S)for(var O=0;O<S;O++)this[Gp+O].start(t+g);return!1}return!0}}]),k}(),fd=(function(){function t(t,e){return t(e={exports:{}},e.exports),e.exports}function g(t){return"object"===(void 0===t?"undefined":ea(t))?null!==t:"function"==typeof t}function f(t){if(!g(t))throw TypeError(t+" is not an object!");return t}function y(t){try{return!!t()}catch(t){return!0}}function i(t){return r?n.createElement(t):{}}function c(t,e){if(!g(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!g(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!g(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!g(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}function x(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}function h(t,e){return p.call(t,e)}function l(t){return"Symbol(".concat(void 0===t?"":t,")_",(++d+M).toString(36))}function e(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}function m(i,r,t){if(e(i),void 0===r)return i;switch(t){case 1:return function(t){return i.call(r,t)};case 2:return function(t,e){return i.call(r,t,e)};case 3:return function(t,e,n){return i.call(r,t,e,n)}}return function(){return i.apply(r,arguments)}}function v(t,e,n){var i,r,o,a,s=t&v.F,h=t&v.G,l=t&v.P,c=t&v.B,u=h?b:t&v.S?b[e]||(b[e]={}):(b[e]||{})[T],p=h?w:w[e]||(w[e]={}),d=p[T]||(p[T]={});for(i in h&&(n=e),n)o=((r=!s&&u&&void 0!==u[i])?u:n)[i],a=c&&r?m(o,b):l&&"function"==typeof o?m(Function.call,o):o,u&&S(u,i,o,t&v.U),p[i]!=o&&_(p,i,a),l&&d[i]!=o&&(d[i]=o)}var b=t(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),w=t(function(t){var e=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)}),a=!y(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),n=b.document,r=g(n)&&g(n.createElement),o=!a&&!y(function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}),s=Object.defineProperty,u={f:a?Object.defineProperty:function(t,e,n){if(f(t),e=c(e,!0),f(n),o)try{return s(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}},_=a?function(t,e,n){return u.f(t,e,x(1,n))}:function(t,e,n){return t[e]=n,t},p={}.hasOwnProperty,d=0,M=Math.random(),S=t(function(t){var o=l("src"),e="toString",n=Function[e],a=(""+n).split(e);w.inspectSource=function(t){return n.call(t)},(t.exports=function(t,e,n,i){var r="function"==typeof n;r&&(h(n,"name")||_(n,"name",e)),t[e]!==n&&(r&&(h(n,o)||_(n,o,t[e]?""+t[e]:a.join(String(e)))),t===b?t[e]=n:i?t[e]?t[e]=n:_(t,e,n):(delete t[e],_(t,e,n)))})(Function.prototype,e,function(){return"function"==typeof this&&this[o]||n.call(this)})}),T="prototype";b.core=w,v.F=1,v.G=2,v.S=4,v.P=8,v.B=16,v.W=32,v.U=64,v.R=128;function E(t){return D.call(t).slice(8,-1)}function A(t){if(null==t)throw TypeError("Can't call method on "+t);return t}function C(t){return B(A(t))}function L(t){return isNaN(t=+t)?0:(0<t?F:N)(t)}function P(t){return 0<t?U(L(t),9007199254740991):0}function R(s){return function(t,e,n){var i,r=C(t),o=P(r.length),a=function(t,e){return(t=L(t))<0?j(t+e,0):V(t,e)}(n,o);if(s&&e!=e){for(;a<o;)if((i=r[a++])!=i)return!0}else for(;a<o;a++)if((s||a in r)&&r[a]===e)return s||a||0;return!s&&-1}}function O(t){return H[t]||(H[t]=l(t))}function k(t,e){var n,i=C(t),r=0,o=[];for(n in i)n!=q&&h(i,n)&&o.push(n);for(;e.length>r;)h(i,n=e[r++])&&(~W(o,n)||o.push(n));return o}function z(t){return Object(A(t))}var I=v,D={}.toString,B=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==E(t)?t.split(""):Object(t)},N=Math.ceil,F=Math.floor,U=Math.min,j=Math.max,V=Math.min,G=t(function(t){var e="__core-js_shared__",n=b[e]||(b[e]={});(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:w.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})}),H=G("keys"),W=R(!1),q=O("IE_PROTO"),X="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Y=Object.keys||function(t){return k(t,X)},Z={f:Object.getOwnPropertySymbols},J={f:{}.propertyIsEnumerable},K=Object.assign,Q=!K||y(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=K({},t)[n]||Object.keys(K({},e)).join("")!=i})?function(t,e){for(var n=z(t),i=arguments.length,r=1,o=Z.f,a=J.f;r<i;)for(var s,h=B(arguments[r++]),l=o?Y(h).concat(o(h)):Y(h),c=l.length,u=0;u<c;)a.call(h,s=l[u++])&&(n[s]=h[s]);return n}:K;I(I.S+I.F,"Object",{assign:Q});var $=u.f,tt=Function.prototype,et=/^\s*function ([^ (]*)/;function nt(t){return(nt="function"==typeof Symbol&&"symbol"===ea(Symbol.iterator)?function(t){return void 0===t?"undefined":ea(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":ea(t)})(t)}function it(t){return(it="function"==typeof Symbol&&"symbol"===nt(Symbol.iterator)?function(t){return nt(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":nt(t)})(t)}"name"in tt||a&&$(tt,"name",{configurable:!0,get:function(){try{return(""+this).match(et)[1]}catch(t){return""}}});var rt=t(function(t){var e=G("wks"),n=b.Symbol,i="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=i&&n[t]||(i?n:l)("Symbol."+t))}).store=e}),ot=rt("unscopables"),at=Array.prototype;null==at[ot]&&_(at,ot,{});function st(t){at[ot][t]=!0}function ht(t,e){return{value:e,done:!!t}}function lt(){}function ct(t,e,n){t&&!h(t=n?t:t.prototype,bt)&&xt(t,bt,{configurable:!0,value:e})}var ut={},pt=a?Object.defineProperties:function(t,e){f(t);for(var n,i=Y(e),r=i.length,o=0;o<r;)u.f(t,n=i[o++],e[n]);return t},dt=b.document,ft=dt&&dt.documentElement,mt=O("IE_PROTO"),vt="prototype",gt=function(){var t,e=i("iframe"),n=X.length;for(e.style.display="none",ft.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),gt=t.F;n--;)delete gt[vt][X[n]];return gt()},yt=Object.create||function(t,e){var n;return null!==t?(lt[vt]=f(t),n=new lt,lt[vt]=null,n[mt]=t):n=gt(),void 0===e?n:pt(n,e)},xt=u.f,bt=rt("toStringTag"),wt={};_(wt,rt("iterator"),function(){return this});function _t(){return this}function Mt(t,e,n,i,r,o,a){function s(t){if(!Ct&&t in f)return f[t];switch(t){case"keys":case Lt:return function(){return new n(this,t)}}return function(){return new n(this,t)}}!function(t,e,n){t.prototype=yt(wt,{next:x(1,n)}),ct(t,e+" Iterator")}(n,e,i);var h,l,c,u=e+" Iterator",p=r==Lt,d=!1,f=t.prototype,m=f[At]||f["@@iterator"]||r&&f[r],v=m||s(r),g=r?p?s("entries"):v:void 0,y="Array"==e&&f.entries||m;if(y&&(c=Et(y.call(new t)))!==Object.prototype&&c.next&&(ct(c,u,!0),"function"!=typeof c[At]&&_(c,At,_t)),p&&m&&m.name!==Lt&&(d=!0,v=function(){return m.call(this)}),!Ct&&!d&&f[At]||_(f,At,v),ut[e]=v,ut[u]=_t,r)if(h={values:p?v:s(Lt),keys:o?v:s("keys"),entries:g},a)for(l in h)l in f||S(f,l,h[l]);else I(I.P+I.F*(Ct||d),e,h);return h}var St=O("IE_PROTO"),Tt=Object.prototype,Et=Object.getPrototypeOf||function(t){return t=z(t),h(t,St)?t[St]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Tt:null},At=rt("iterator"),Ct=!([].keys&&"next"in[].keys()),Lt="values",Pt=Mt(Array,"Array",function(t,e){this._t=C(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,ht(1)):ht(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");ut.Arguments=ut.Array,st("keys"),st("values"),st("entries");var Rt,Ot=(Rt=!0,function(t,e){var n,i,r=String(A(t)),o=L(e),a=r.length;return o<0||a<=o?Rt?"":void 0:(n=r.charCodeAt(o))<55296||56319<n||o+1===a||(i=r.charCodeAt(o+1))<56320||57343<i?Rt?r.charAt(o):n:Rt?r.slice(o,o+2):i-56320+(n-55296<<10)+65536});Mt(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=Ot(e,n),this._i+=t.length,{value:t,done:!1})});function kt(t,e,n){for(var i in e)S(t,i,e[i],n);return t}function zt(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t}function It(e,t,n,i){try{return i?t(f(n)[0],n[1]):t(n)}catch(t){var r=e.return;throw void 0!==r&&f(r.call(e)),t}}function Dt(t,e){if(!g(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}function Bt(t,e){var n,i=Yt(e);if("F"!==i)return t._i[i];for(n=t._f;n;n=n.n)if(n.k==e)return n}var Nt=rt("iterator"),Ft=Array.prototype,Ut=rt("toStringTag"),jt="Arguments"==E(function(){return arguments}()),Vt=rt("iterator"),Gt=w.getIteratorMethod=function(t){if(null!=t)return t[Vt]||t["@@iterator"]||ut[function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ut))?n:jt?E(e):"Object"==(i=E(e))&&"function"==typeof e.callee?"Arguments":i}(t)]},Ht=t(function(t){var p={},d={},e=t.exports=function(t,e,n,i,r){var o,a,s,h,l=r?function(){return t}:Gt(t),c=m(n,i,e?2:1),u=0;if("function"!=typeof l)throw TypeError(t+" is not iterable!");if(function(t){return void 0!==t&&(ut.Array===t||Ft[Nt]===t)}(l)){for(o=P(t.length);u<o;u++)if((h=e?c(f(a=t[u])[0],a[1]):c(t[u]))===p||h===d)return h}else for(s=l.call(t);!(a=s.next()).done;)if((h=It(s,c,a.value,e))===p||h===d)return h};e.BREAK=p,e.RETURN=d}),Wt=rt("species"),qt=t(function(t){function n(t){e(t,i,{value:{i:"O"+ ++r,w:{}}})}var i=l("meta"),e=u.f,r=0,o=Object.isExtensible||function(){return!0},a=!y(function(){return o(Object.preventExtensions({}))}),s=t.exports={KEY:i,NEED:!1,fastKey:function(t,e){if(!g(t))return"symbol"==(void 0===t?"undefined":ea(t))?t:("string"==typeof t?"S":"P")+t;if(!h(t,i)){if(!o(t))return"F";if(!e)return"E";n(t)}return t[i].i},getWeak:function(t,e){if(!h(t,i)){if(!o(t))return!0;if(!e)return!1;n(t)}return t[i].w},onFreeze:function(t){return a&&s.NEED&&o(t)&&!h(t,i)&&n(t),t}}}),Xt=u.f,Yt=qt.fastKey,Zt=a?"_s":"size",Jt={getConstructor:function(t,o,n,i){var r=t(function(t,e){zt(t,r,o,"_i"),t._t=o,t._i=yt(null),t._f=void 0,t._l=void 0,t[Zt]=0,null!=e&&Ht(e,n,t[i],t)});return kt(r.prototype,{clear:function(){for(var t=Dt(this,o),e=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete e[n.i];t._f=t._l=void 0,t[Zt]=0},delete:function(t){var e=Dt(this,o),n=Bt(e,t);if(n){var i=n.n,r=n.p;delete e._i[n.i],n.r=!0,r&&(r.n=i),i&&(i.p=r),e._f==n&&(e._f=i),e._l==n&&(e._l=r),e[Zt]--}return!!n},forEach:function(t,e){Dt(this,o);for(var n,i=m(t,1<arguments.length?e:void 0,3);n=n?n.n:this._f;)for(i(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!Bt(Dt(this,o),t)}}),a&&Xt(r.prototype,"size",{get:function(){return Dt(this,o)[Zt]}}),r},def:function(t,e,n){var i,r,o=Bt(t,e);return o?o.v=n:(t._l=o={i:r=Yt(e,!0),k:e,v:n,p:i=t._l,n:void 0,r:!1},t._f||(t._f=o),i&&(i.n=o),t[Zt]++,"F"!==r&&(t._i[r]=o)),t},getEntry:Bt,setStrong:function(t,n,e){Mt(t,n,function(t,e){this._t=Dt(t,n),this._k=e,this._l=void 0},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?ht(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,ht(1))},e?"entries":"values",!e,!0),function(t){var e=b[t];a&&e&&!e[Wt]&&u.f(e,Wt,{configurable:!0,get:function(){return this}})}(n)}},Kt=rt("iterator"),Qt=!1;try{[7][Kt]().return=function(){Qt=!0}}catch(t){}function $t(t,e){if(f(t),!g(e)&&null!==e)throw TypeError(e+": can't set as prototype!")}function te(t,e,n){var i,r=e.constructor;return r!==n&&"function"==typeof r&&(i=r.prototype)!==n.prototype&&g(i)&&ie&&ie(t,i),t}var ee=Object.getOwnPropertyDescriptor,ne={f:a?ee:function(t,e){if(t=C(t),e=c(e,!0),o)try{return ee(t,e)}catch(t){}if(h(t,e))return x(!J.f.call(t,e),t[e])}},ie={set:Object.setPrototypeOf||("__proto__"in{}?function(t,n,i){try{(i=m(Function.call,ne.f(Object.prototype,"__proto__").set,2))(t,[]),n=!(t instanceof Array)}catch(t){n=!0}return function(t,e){return $t(t,e),n?t.__proto__=e:i(t,e),t}}({},!1):void 0),check:$t}.set;!function(i,t,e,n,r,o){function a(t){var n=c[t];S(c,t,"delete"==t?function(t){return!(o&&!g(t))&&n.call(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!g(t))&&n.call(this,0===t?0:t)}:"get"==t?function(t){return o&&!g(t)?void 0:n.call(this,0===t?0:t)}:"add"==t?function(t){return n.call(this,0===t?0:t),this}:function(t,e){return n.call(this,0===t?0:t,e),this})}var s=b[i],h=s,l=r?"set":"add",c=h&&h.prototype,u={};if("function"==typeof h&&(o||c.forEach&&!y(function(){(new h).entries().next()}))){var p=new h,d=p[l](o?{}:-0,1)!=p,f=y(function(){p.has(1)}),m=function(t,e){if(!e&&!Qt)return!1;var n=!1;try{var i=[7],r=i[Kt]();r.next=function(){return{done:n=!0}},i[Kt]=function(){return r},t(i)}catch(t){}return n}(function(t){new h(t)}),v=!o&&y(function(){for(var t=new h,e=5;e--;)t[l](e,e);return!t.has(-0)});m||(((h=t(function(t,e){zt(t,h,i);var n=te(new s,t,h);return null!=e&&Ht(e,r,n[l],n),n})).prototype=c).constructor=h),(f||v)&&(a("delete"),a("has"),r&&a("get")),(v||d)&&a(l),o&&c.clear&&delete c.clear}else h=n.getConstructor(t,i,r,l),kt(h.prototype,e),qt.NEED=!0;ct(h,i),u[i]=h,I(I.G+I.W+I.F*(h!=s),u),o||n.setStrong(h,i,r)}("Set",function(e){return function(t){return e(this,0<arguments.length?t:void 0)}},{add:function(t){return Jt.def(Dt(this,"Set"),t=0===t?0:t,t)}},Jt);function re(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function oe(t){var e=w.Symbol||(w.Symbol=b.Symbol||{});"_"==t.charAt(0)||t in e||se(e,t,{value:ae.f(t)})}var ae={f:rt},se=u.f;oe("asyncIterator");function he(t){var e=ke[t]=yt(Te[Ce]);return e._k=t,e}function le(t,e){f(t);for(var n,i=function(t){var e=Y(t),n=Z.f;if(n)for(var i,r=n(t),o=J.f,a=0;r.length>a;)o.call(t,i=r[a++])&&e.push(i);return e}(e=C(e)),r=0,o=i.length;r<o;)je(t,n=i[r++],e[n]);return t}function ce(t){var e=Re.call(this,t=c(t,!0));return!(this===Ie&&h(ke,t)&&!h(ze,t))&&(!(e||!h(this,t)||!h(ke,t)||h(this,Le)&&this[Le][t])||e)}function ue(t,e){if(t=C(t),e=c(e,!0),t!==Ie||!h(ke,e)||h(ze,e)){var n=_e(t,e);return!n||!h(ke,e)||h(t,Le)&&t[Le][e]||(n.enumerable=!0),n}}function pe(t){for(var e,n=Se(C(t)),i=[],r=0;n.length>r;)h(ke,e=n[r++])||e==Le||e==we||i.push(e);return i}function de(t){for(var e,n=t===Ie,i=Se(n?ze:C(t)),r=[],o=0;i.length>o;)!h(ke,e=i[o++])||n&&!h(Ie,e)||r.push(ke[e]);return r}var fe=Array.isArray||function(t){return"Array"==E(t)},me=X.concat("length","prototype"),ve={f:Object.getOwnPropertyNames||function(t){return k(t,me)}},ge=ve.f,ye={}.toString,xe="object"==("undefined"==typeof window?"undefined":ea(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],be={f:function(t){return xe&&"[object Window]"==ye.call(t)?function(t){try{return ge(t)}catch(t){return xe.slice()}}(t):ge(C(t))}},we=qt.KEY,_e=ne.f,Me=u.f,Se=be.f,Te=b.Symbol,Ee=b.JSON,Ae=Ee&&Ee.stringify,Ce="prototype",Le=rt("_hidden"),Pe=rt("toPrimitive"),Re={}.propertyIsEnumerable,Oe=G("symbol-registry"),ke=G("symbols"),ze=G("op-symbols"),Ie=Object[Ce],De="function"==typeof Te,Be=b.QObject,Ne=!Be||!Be[Ce]||!Be[Ce].findChild,Fe=a&&y(function(){return 7!=yt(Me({},"a",{get:function(){return Me(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=_e(Ie,e);i&&delete Ie[e],Me(t,e,n),i&&t!==Ie&&Me(Ie,e,i)}:Me,Ue=De&&"symbol"==ea(Te.iterator)?function(t){return"symbol"==(void 0===t?"undefined":ea(t))}:function(t){return t instanceof Te},je=function(t,e,n){return t===Ie&&je(ze,e,n),f(t),e=c(e,!0),f(n),h(ke,e)?(n.enumerable?(h(t,Le)&&t[Le][e]&&(t[Le][e]=!1),n=yt(n,{enumerable:x(0,!1)})):(h(t,Le)||Me(t,Le,x(1,{})),t[Le][e]=!0),Fe(t,e,n)):Me(t,e,n)};De||(S((Te=function(t){if(this instanceof Te)throw TypeError("Symbol is not a constructor!");var n=l(0<arguments.length?t:void 0);return a&&Ne&&Fe(Ie,n,{configurable:!0,set:function t(e){this===Ie&&t.call(ze,e),h(this,Le)&&h(this[Le],n)&&(this[Le][n]=!1),Fe(this,n,x(1,e))}}),he(n)})[Ce],"toString",function(){return this._k}),ne.f=ue,u.f=je,ve.f=be.f=pe,J.f=ce,Z.f=de,a&&S(Ie,"propertyIsEnumerable",ce,!0),ae.f=function(t){return he(rt(t))}),I(I.G+I.W+I.F*!De,{Symbol:Te});for(var Ve="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Ge=0;Ve.length>Ge;)rt(Ve[Ge++]);for(var He=Y(rt.store),We=0;He.length>We;)oe(He[We++]);I(I.S+I.F*!De,"Symbol",{for:function(t){return h(Oe,t+="")?Oe[t]:Oe[t]=Te(t)},keyFor:function(t){if(!Ue(t))throw TypeError(t+" is not a symbol!");for(var e in Oe)if(Oe[e]===t)return e},useSetter:function(){Ne=!0},useSimple:function(){Ne=!1}}),I(I.S+I.F*!De,"Object",{create:function(t,e){return void 0===e?yt(t):le(yt(t),e)},defineProperty:je,defineProperties:le,getOwnPropertyDescriptor:ue,getOwnPropertyNames:pe,getOwnPropertySymbols:de}),Ee&&I(I.S+I.F*(!De||y(function(){var t=Te();return"[null]"!=Ae([t])||"{}"!=Ae({a:t})||"{}"!=Ae(Object(t))})),"JSON",{stringify:function(t){for(var e,n,i=[t],r=1;r<arguments.length;)i.push(arguments[r++]);if(n=e=i[1],(g(e)||void 0!==t)&&!Ue(t))return fe(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Ue(e))return e}),i[1]=e,Ae.apply(Ee,i)}}),Te[Ce][Pe]||_(Te[Ce],Pe,Te[Ce].valueOf),ct(Te,"Symbol"),ct(Math,"Math",!0),ct(b.JSON,"JSON",!0);for(var qe=rt("iterator"),Xe=rt("toStringTag"),Ye=ut.Array,Ze={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},Je=Y(Ze),Ke=0;Ke<Je.length;Ke++){var Qe,$e=Je[Ke],tn=Ze[$e],en=b[$e],nn=en&&en.prototype;if(nn&&(nn[qe]||_(nn,qe,Ye),nn[Xe]||_(nn,Xe,$e),ut[$e]=Ye,tn))for(Qe in Pt)nn[Qe]||S(nn,Qe,Pt[Qe],!0)}var rn={},on=[];function an(t,e){if(Array.isArray(t)){var n=!0,i=!1,r=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){an(o.value,e)}}catch(t){i=!0,r=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw r}}}else if("object"!==it(t))hn(Object.getOwnPropertyNames(e)),rn[t]=Object.assign(rn[t]||{},e);else for(var s in t)an(s,t[s])}function sn(t){return rn[t]||{}}function hn(t){on.push.apply(on,re(t))}var ln=R(!0);I(I.P,"Array",{includes:function(t,e){return ln(this,t,1<arguments.length?e:void 0)}}),st("includes");function cn(t){var e;return g(t)&&(void 0!==(e=t[un])?!!e:"RegExp"==E(t))}var un=rt("match"),pn=rt("match");I(I.P+I.F*function(e){var n=/./;try{"/./"[e](n)}catch(t){try{return n[pn]=!1,!"/./"[e](n)}catch(t){}}return!0}("includes"),"String",{includes:function(t,e){return!!~function(t,e,n){if(cn(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(A(t))}(this,t,"includes").indexOf(t,1<arguments.length?e:void 0)}});function dn(e,t,n){var i=rt(e),r=n(A,i,""[e]),o=r[0],a=r[1];y(function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})&&(S(String.prototype,e,o),_(RegExp.prototype,i,2==t?function(t,e){return a.call(t,this,e)}:function(t){return a.call(t,this)}))}function fn(t,e){var n,i=t.length,r=[];for(n=0;n<i;n++)r.push(e(t[n]));return r}function mn(t){return t%360*Math.PI/180}function vn(t){return t.toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()})}function gn(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})}function yn(t){return t.charAt(0).toUpperCase()+t.slice(1)}function xn(t,e,n,i){return null!=e&&null!=n||(i=i||t.bbox(),null==e?e=i.width/i.height*n:null==n&&(n=i.height/i.width*e)),{width:e,height:n}}function bn(t,e){var n,i,r=t.origin;if("string"==typeof r||null==r){var o=(r||"center").toLowerCase().trim(),a=e.bbox(),s=a.height,h=a.width,l=a.x,c=a.y,u=o.includes("left")?l:o.includes("right")?l+h:l+h/2,p=o.includes("top")?c:o.includes("bottom")?c+s:c+s/2;n=null!=t.ox?t.ox:u,i=null!=t.oy?t.oy:p}else n=r[0],i=r[1];return[n,i]}dn("replace",2,function(r,o,a){return[function(t,e){var n=r(this),i=null==t?void 0:t[o];return void 0!==i?i.call(t,n,e):a.call(String(n),t,e)},a]});var wn={map:fn,filter:function(t,e){var n,i=t.length,r=[];for(n=0;n<i;n++)e(t[n])&&r.push(t[n]);return r},radians:mn,degrees:function(t){return 180*t/Math.PI%360},camelCase:vn,unCamelCase:gn,capitalize:yn,proportionalSize:xn,getOrigin:bn},_n="http://www.w3.org/2000/svg",Mn="http://www.w3.org/2000/xmlns/",Sn="http://www.w3.org/1999/xlink",Tn="http://svgjs.com/svgjs",En={ns:_n,xmlns:Mn,xlink:Sn,svgjs:Tn},An={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};function Cn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Ln=function t(){Cn(this,t)},Pn={},Rn="___SYMBOL___ROOT___";function On(t){return An.document.createElementNS(_n,t)}function kn(t){if(t instanceof Ln)return t;if("object"===it(t))return Dn(t);if(null==t)return new Pn[Rn];if("string"==typeof t&&"<"!==t.charAt(0))return Dn(An.document.querySelector(t));var e=On("svg");return e.innerHTML=t,t=Dn(e.firstChild)}function zn(t,e){return e instanceof An.window.Node?e:On(t)}function In(t){if(!t)return null;if(t.instance instanceof Ln)return t.instance;var e=yn(t.nodeName||"Dom");return"LinearGradient"===e||"RadialGradient"===e?e="Gradient":Pn[e]||(e="Dom"),new Pn[e](t)}var Dn=In;function Bn(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t.name,n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];return Pn[e]=t,n&&(Pn[Rn]=t),hn(Object.getOwnPropertyNames(t.prototype)),t}function Nn(t){return Pn[t]}var Fn=1e3;function Un(t){return"Svgjs"+yn(t)+Fn++}function jn(t){for(var e=t.children.length-1;0<=e;e--)jn(t.children[e]);return t.id?In(t).id(Un(t.nodeName)):In(t)}function Vn(t,e,n){var i,r;for(r=(t=Array.isArray(t)?t:[t]).length-1;0<=r;r--)for(i in e){var o=e[i];n&&(o=Gn(e[i])),t[r].prototype[i]=o}}function Gn(r){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e[e.length-1];return!i||i.constructor!==Object||i instanceof Array?r.apply(this,e):r.apply(this,e.slice(0,-1)).attr(i)}}an("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){var t=this.position()+1,e=this.parent();return e.removeElement(this).add(this,t),"function"==typeof e.isRoot&&e.isRoot()&&e.node.appendChild(e.defs().node),this},backward:function(){var t=this.position();return 0<t&&this.parent().removeElement(this).add(this,t-1),this},front:function(){var t=this.parent();return t.node.appendChild(this.node),"function"==typeof t.isRoot&&t.isRoot()&&t.node.appendChild(t.defs().node),this},back:function(){return 0<this.position()&&this.parent().removeElement(this).add(this,0),this},before:function(t){(t=kn(t)).remove();var e=this.position();return this.parent().add(t,e),this},after:function(t){(t=kn(t)).remove();var e=this.position();return this.parent().add(t,e+1),this},insertBefore:function(t){return(t=kn(t)).before(this),this},insertAfter:function(t){return(t=kn(t)).after(this),this}}),dn("split",2,function(r,o,a){var d=cn,f=a,m=[].push,t="split",v="length";if("c"=="abbc"[t](/(b)*/)[1]||4!="test"[t](/(?:)/,-1)[v]||2!="ab"[t](/(?:ab)*/)[v]||4!="."[t](/(.?)(.?)/)[v]||1<"."[t](/()()/)[v]||""[t](/.?/)[v]){var g=void 0===/()??/.exec("")[1];a=function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!d(t))return f.call(n,t,e);var i,r,o,a,s,h=[],l=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),c=0,u=void 0===e?4294967295:e>>>0,p=new RegExp(t.source,l+"g");for(g||(i=new RegExp("^"+p.source+"$(?!\\s)",l));(r=p.exec(n))&&!(c<(o=r.index+r[0][v])&&(h.push(n.slice(c,r.index)),!g&&1<r[v]&&r[0].replace(i,function(){for(s=1;s<arguments[v]-2;s++)void 0===arguments[s]&&(r[s]=void 0)}),1<r[v]&&r.index<n[v]&&m.apply(h,r.slice(1)),a=r[0][v],c=o,h[v]>=u));)p.lastIndex===r.index&&p.lastIndex++;return c===n[v]?!a&&p.test("")||h.push(""):h.push(n.slice(c)),h[v]>u?h.slice(0,u):h}}else"0"[t](void 0,0)[v]&&(a=function(t,e){return void 0===t&&0===e?[]:f.call(this,t,e)});return[function(t,e){var n=r(this),i=null==t?void 0:t[o];return void 0!==i?i.call(t,n,e):a.call(String(n),t,e)},a]});var Hn=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Wn=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,qn=/rgb\((\d+),(\d+),(\d+)\)/,Xn=/(#[a-z0-9\-_]+)/i,Yn=/\)\s*,?\s*/,Zn=/\s/g,Jn=/^#[a-f0-9]{3,6}$/i,Kn=/^rgb\(/,Qn=/^(\s+)?$/,$n=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ti=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,ei=/[\s,]+/,ni=/([^e])-/gi,ii=/[MLHVCSQTAZ]/gi,ri=/[MLHVCSQTAZ]/i,oi=/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,ai=/\./g,si={numberAndUnit:Hn,hex:Wn,rgb:qn,reference:Xn,transforms:Yn,whitespace:Zn,isHex:Jn,isRgb:Kn,isCss:/[^:]+:[^;]+;?/,isBlank:Qn,isNumber:$n,isPercent:/^-?[\d.]+%$/,isImage:ti,delimiter:ei,hyphen:ni,pathLetters:ii,isPathLetter:ri,numbersWithDots:oi,dots:ai};an("Dom",{classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(ei)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){var e=this.classes();e.push(t),this.attr("class",e.join(" "))}return this},removeClass:function(e){return this.hasClass(e)&&this.attr("class",this.classes().filter(function(t){return t!==e}).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),an("Dom",{css:function(t,e){var n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter(function(t){return!!t.length}).forEach(function(t){var e=t.split(/\s*:\s*/);n[e[0]]=e[1]}),n;if(arguments.length<2){if(Array.isArray(t)){var i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done);i=!0){var h=vn(a.value);n[h]=this.node.style[h]}}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}if("string"==typeof t)return this.node.style[vn(t)];if("object"===it(t))for(var l in t)this.node.style[vn(l)]=null==t[l]||Qn.test(t[l])?"":t[l]}return 2===arguments.length&&(this.node.style[vn(t)]=null==e||Qn.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),an("Dom",{data:function(e,t,n){if("object"===it(e))for(t in e)this.data(t,e[t]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+e))}catch(t){return this.attr("data-"+e)}else this.attr("data-"+e,null===t?null:!0===n||"string"==typeof t||"number"==typeof t?t:JSON.stringify(t));return this}}),an("Dom",{remember:function(t,e){if("object"===it(t))for(var n in t)this.remember(n,t[n]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=e}return this},forget:function(){if(0===arguments.length)this._memory={};else for(var t=arguments.length-1;0<=t;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});var hi=0,li={};function ci(t){var e=t.getEventHolder();return e===An.window&&(e=li),e.events||(e.events={}),e.events}function ui(t){return t.getEventTarget()}function pi(t,e,i,n,r){var o=i.bind(n||t),a=kn(t),s=ci(a),h=ui(a);e=Array.isArray(e)?e:e.split(ei),i._svgjsListenerId||(i._svgjsListenerId=++hi),e.forEach(function(t){var e=t.split(".")[0],n=t.split(".")[1]||"*";s[e]=s[e]||{},s[e][n]=s[e][n]||{},s[e][n][i._svgjsListenerId]=o,h.addEventListener(e,o,r||!1)})}function di(t,e,o,a){var s=kn(t),h=ci(s),l=ui(s);"function"==typeof o&&!(o=o._svgjsListenerId)||(e=Array.isArray(e)?e:(e||"").split(ei)).forEach(function(t){var e,n,i=t&&t.split(".")[0],r=t&&t.split(".")[1];if(o)h[i]&&h[i][r||"*"]&&(l.removeEventListener(i,h[i][r||"*"][o],a||!1),delete h[i][r||"*"][o]);else if(i&&r){if(h[i]&&h[i][r]){for(n in h[i][r])di(l,[i,r].join("."),n);delete h[i][r]}}else if(r)for(t in h)for(e in h[t])r===e&&di(l,[t,r].join("."));else if(i){if(h[i]){for(e in h[i])di(l,[i,e].join("."));delete h[i]}}else{for(t in h)di(l,t);!function(t){var e=t.getEventHolder();e.events&&(e.events={})}(s)}})}function fi(t,e,n){var i=ui(t);return e instanceof An.window.Event||(e=new An.window.CustomEvent(e,{detail:n,cancelable:!0})),i.dispatchEvent(e),e}function mi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function vi(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function gi(t,e,n){return e&&vi(t.prototype,e),n&&vi(t,n),t}function yi(){var t=f(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}a&&"g"!=/./g.flags&&u.f(RegExp.prototype,"flags",{configurable:!0,get:yi});function xi(t){S(RegExp.prototype,bi,t,!0)}var bi="toString",wi=/./[bi];function _i(t){var e=Math.round(t),n=Math.max(0,Math.min(255,e)).toString(16);return 1===n.length?"0"+n:n}function Mi(t,e){for(var n=e.length;n--;)if(null==t[e[n]])return!1;return!0}function Si(t,e,n){return n<0&&(n+=1),1<n&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}y(function(){return"/a/b"!=wi.call({source:"a",flags:"b"})})?xi(function(){var t=f(this);return"/".concat(t.source,"/","flags"in t?t.flags:!a&&t instanceof RegExp?yi.call(t):void 0)}):wi.name!=bi&&xi(function(){return wi.call(this)});var Ti,Ei,Ai,Ci,Li=function(){function E(){Cn(this,E),this.init.apply(this,arguments)}return gi(E,[{key:"init",value:function(t,e,n,i,r){var o=0<arguments.length&&void 0!==t?t:0,a=1<arguments.length&&void 0!==e?e:0,s=2<arguments.length&&void 0!==n?n:0,h=3<arguments.length&&void 0!==i?i:0,l=4<arguments.length&&void 0!==r?r:"rgb";if(o=o||0,this.space)for(var c in this.space)delete this[this.space[c]];if("number"==typeof o)l="string"==typeof h?h:l,h="string"==typeof h?0:h,Object.assign(this,{_a:o,_b:a,_c:s,_d:h,space:l});else if(o instanceof Array)this.space=a||("string"==typeof o[3]?o[3]:o[4])||"rgb",Object.assign(this,{_a:o[0],_b:o[1],_c:o[2],_d:o[3]||0});else if(o instanceof Object){var u=function(t,e){var n=Mi(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,space:"rgb"}:Mi(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:Mi(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:Mi(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:Mi(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:Mi(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=e||n.space,n}(o,a);Object.assign(this,u)}else if("string"==typeof o)if(Kn.test(o)){var p=o.replace(Zn,""),d=mi(qn.exec(p).slice(1,4).map(function(t){return parseInt(t)}),3),f=d[0],m=d[1],v=d[2];Object.assign(this,{_a:f,_b:m,_c:v,_d:0,space:"rgb"})}else{if(!Jn.test(o))throw Error("Unsupported string format, can't construct Color");var g=mi(Wn.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(o)).map(function(t){return parseInt(t,16)}),4),y=g[1],x=g[2],b=g[3];Object.assign(this,{_a:y,_b:x,_c:b,_d:0,space:"rgb"})}var w=this._a,_=this._b,M=this._c,S=this._d,T="rgb"===this.space?{r:w,g:_,b:M}:"xyz"===this.space?{x:w,y:_,z:M}:"hsl"===this.space?{h:w,s:_,l:M}:"lab"===this.space?{l:w,a:_,b:M}:"lch"===this.space?{l:w,c:_,h:M}:"cmyk"===this.space?{c:w,m:_,y:M,k:S}:{};Object.assign(this,T)}},{key:"rgb",value:function(){if("rgb"===this.space)return this;if(function(t){return"lab"===t||"xyz"===t||"lch"===t}(this.space)){var t=this.x,e=this.y,n=this.z;if("lab"===this.space||"lch"===this.space){var i=this.l,r=this.a,o=this.b;if("lch"===this.space){var a=this.c,s=this.h,h=Math.PI/180;r=a*Math.cos(h*s),o=a*Math.sin(h*s)}var l=(i+16)/116,c=r/500+l,u=l-o/200;t=.95047*(.008856<Math.pow(c,3)?Math.pow(c,3):(c-16/116)/7.787),e=1*(.008856<Math.pow(l,3)?Math.pow(l,3):(l-16/116)/7.787),n=1.08883*(.008856<Math.pow(u,3)?Math.pow(u,3):(u-16/116)/7.787)}var p=3.2406*t+-1.5372*e+-.4986*n,d=-.9689*t+1.8758*e+.0415*n,f=.0557*t+-.204*e+1.057*n,m=Math.pow,v=.0031308;return new E(255*(v<p?1.055*m(p,1/2.4)-.055:12.92*p),255*(v<d?1.055*m(d,1/2.4)-.055:12.92*d),255*(v<f?1.055*m(f,1/2.4)-.055:12.92*f))}if("hsl"===this.space){var g=this.h,y=this.s,x=this.l;if(g/=360,x/=100,0==(y/=100))return new E(x*=255,x,x);var b=x<.5?x*(1+y):x+y-x*y,w=2*x-b;return new E(255*Si(w,b,g+1/3),255*Si(w,b,g),255*Si(w,b,g-1/3))}if("cmyk"!==this.space)return this;var _=this.c,M=this.m,S=this.y,T=this.k;return new E(255*(1-Math.min(1,_*(1-T)+T)),255*(1-Math.min(1,M*(1-T)+T)),255*(1-Math.min(1,S*(1-T)+T)))}},{key:"lab",value:function(){var t=this.xyz(),e=t.x,n=t.y;return new E(116*n-16,500*(e-n),200*(n-t.z),"lab")}},{key:"xyz",value:function(){var t=this.rgb(),e=mi([t._a,t._b,t._c].map(function(t){return t/255}),3),n=e[0],i=e[1],r=e[2],o=.04045<n?Math.pow((n+.055)/1.055,2.4):n/12.92,a=.04045<i?Math.pow((i+.055)/1.055,2.4):i/12.92,s=.04045<r?Math.pow((r+.055)/1.055,2.4):r/12.92,h=(.4124*o+.3576*a+.1805*s)/.95047,l=(.2126*o+.7152*a+.0722*s)/1,c=(.0193*o+.1192*a+.9505*s)/1.08883;return new E(.008856<h?Math.pow(h,1/3):7.787*h+16/116,.008856<l?Math.pow(l,1/3):7.787*l+16/116,.008856<c?Math.pow(c,1/3):7.787*c+16/116,"xyz")}},{key:"lch",value:function(){var t=this.lab(),e=t.l,n=t.a,i=t.b,r=Math.sqrt(Math.pow(n,2)+Math.pow(i,2)),o=180*Math.atan2(i,n)/Math.PI;return o<0&&(o=360-(o*=-1)),new E(e,r,o,"lch")}},{key:"hsl",value:function(){var t=this.rgb(),e=mi([t._a,t._b,t._c].map(function(t){return t/255}),3),n=e[0],i=e[1],r=e[2],o=Math.max(n,i,r),a=Math.min(n,i,r),s=(o+a)/2,h=o===a,l=o-a;return new E(360*(h?0:o===n?((i-r)/l+(i<r?6:0))/6:o===i?((r-n)/l+2)/6:o===r?((n-i)/l+4)/6:0),100*(h?0:.5<s?l/(2-o-a):l/(o+a)),100*s,"hsl")}},{key:"cmyk",value:function(){var t=this.rgb(),e=mi([t._a,t._b,t._c].map(function(t){return t/255}),3),n=e[0],i=e[1],r=e[2],o=Math.min(1-n,1-i,1-r);return 1===o?new E(0,0,0,1,"cmyk"):new E((1-n-o)/(1-o),(1-i-o)/(1-o),(1-r-o)/(1-o),o,"cmyk")}},{key:"_clamped",value:function(){var t=this.rgb(),e=t._a,n=t._b,i=t._c,r=Math.max,o=Math.min,a=Math.round;return[e,n,i].map(function(t){return r(0,o(a(t),255))})}},{key:"toHex",value:function(){var t=mi(this._clamped().map(_i),3),e=t[0],n=t[1],i=t[2];return"#".concat(e).concat(n).concat(i)}},{key:"toString",value:function(){return this.toHex()}},{key:"toRgb",value:function(){var t=mi(this._clamped(),3),e=t[0],n=t[1],i=t[2];return"rgb(".concat(e,",").concat(n,",").concat(i,")")}},{key:"toArray",value:function(){return[this._a,this._b,this._c,this._d,this.space]}}],[{key:"random",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"vibrant",e=1<arguments.length?arguments[1]:void 0,n=Math.random,i=Math.round,r=Math.sin,o=Math.PI;if("vibrant"===t)return new E(24*n()+57,38*n()+45,360*n(),"lch");if("sine"===t)return new E(i(80*r(2*o*(e=null==e?n():e)/.5+.01)+150),i(50*r(2*o*e/.5+4.6)+200),i(100*r(2*o*e/.5+2.3)+150));if("pastel"===t)return new E(8*n()+86,17*n()+9,360*n(),"lch");if("dark"===t)return new E(10+10*n(),50*n()+86,360*n(),"lch");if("rgb"===t)return new E(255*n(),255*n(),255*n());if("lab"===t)return new E(100*n(),256*n()-128,256*n()-128,"lab");if("grey"===t){var a=255*n();return new E(a,a,a)}}},{key:"test",value:function(t){return"string"==typeof t&&(Jn.test(t)||Kn.test(t))}},{key:"isRgb",value:function(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}},{key:"isColor",value:function(t){return t&&(t instanceof E||this.isRgb(t)||this.test(t))}}]),E}();function Pi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ri(t,e){return!e||"object"!==it(e)&&"function"!=typeof e?Pi(t):e}function Oi(t){return(Oi=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function ki(t,e,n){return(ki="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Oi(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function zi(t,e){return(zi=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Ii(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zi(t,e)}Ti="keys",Ei=function(){return function(t){return Y(z(t))}},Ai=(w.Object||{})[Ti]||Object[Ti],(Ci={})[Ti]=Ei(Ai),I(I.S+I.F*y(function(){Ai(1)}),"Object",Ci),dn("match",1,function(i,r,t){return[function(t){var e=i(this),n=null==t?void 0:t[r];return void 0!==n?n.call(t,e):new RegExp(t)[r](String(e))},t]});function Di(t,e,n){var i={},r=y(function(){return!!Ni[t]()||"​…"!="​…"[t]()}),o=i[t]=r?e(Vi):Ni[t];n&&(i[n]=o),I(I.P+I.F*r,"String",i)}function Bi(t){var e=c(t,!1);if("string"==typeof e&&2<e.length){var n,i,r,o=(e=$i?e.trim():Xi(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:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+e}for(var a,s=e.slice(2),h=0,l=s.length;h<l;h++)if((a=s.charCodeAt(h))<48||r<a)return NaN;return parseInt(s,i)}}return+e}var Ni="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff",Fi="["+Ni+"]",Ui=RegExp("^"+Fi+Fi+"*"),ji=RegExp(Fi+Fi+"*$"),Vi=Di.trim=function(t,e){return t=String(A(t)),1&e&&(t=t.replace(Ui,"")),2&e&&(t=t.replace(ji,"")),t},Gi=Di,Hi=ve.f,Wi=ne.f,qi=u.f,Xi=Gi.trim,Yi="Number",Zi=b[Yi],Ji=Zi,Ki=Zi.prototype,Qi=E(yt(Ki))==Yi,$i="trim"in String.prototype;if(!Zi(" 0o1")||!Zi("0b1")||Zi("+0x1")){Zi=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof Zi&&(Qi?y(function(){Ki.valueOf.call(n)}):E(n)!=Yi)?te(new Ji(Bi(e)),n,Zi):Bi(e)};for(var tr,er=a?Hi(Ji):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),nr=0;er.length>nr;nr++)h(Ji,tr=er[nr])&&!h(Zi,tr)&&qi(Zi,tr,Wi(Ji,tr));(Zi.prototype=Ki).constructor=Zi,S(b,Yi,Zi)}var ir=function(){function t(){Cn(this,t),this.init.apply(this,arguments)}return gi(t,[{key:"init",value:function(t,e){var n,i=0,r=0;return n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"===it(t)?{x:t.x,y:t.y}:{x:t,y:e},this.x=null==n.x?i:n.x,this.y=null==n.y?r:n.y,this}},{key:"clone",value:function(){return new t(this)}},{key:"transform",value:function(t){return this.clone().transformO(t)}},{key:"transformO",value:function(t){or.isMatrixLike(t)||(t=new or(t));var e=this.x,n=this.y;return this.x=t.a*e+t.c*n+t.e,this.y=t.b*e+t.d*n+t.f,this}},{key:"toArray",value:function(){return[this.x,this.y]}}]),t}();function rr(t,e,n){return Math.abs(e-t)<(n||1e-6)}var or=function(){function l(){Cn(this,l),this.init.apply(this,arguments)}return gi(l,[{key:"init",value:function(t){var e=l.fromArray([1,0,0,1,0,0]);return t=t instanceof Mr?t.matrixify():"string"==typeof t?l.fromArray(t.split(ei).map(parseFloat)):Array.isArray(t)?l.fromArray(t):"object"===it(t)&&l.isMatrixLike(t)?t:"object"===it(t)?(new l).transform(t):6===arguments.length?l.fromArray([].slice.call(arguments)):e,this.a=null!=t.a?t.a:e.a,this.b=null!=t.b?t.b:e.b,this.c=null!=t.c?t.c:e.c,this.d=null!=t.d?t.d:e.d,this.e=null!=t.e?t.e:e.e,this.f=null!=t.f?t.f:e.f,this}},{key:"clone",value:function(){return new l(this)}},{key:"transform",value:function(t){if(l.isMatrixLike(t))return new l(t).multiplyO(this);var e=l.formatTransforms(t),n=new ir(e.ox,e.oy).transform(this),i=n.x,r=n.y,o=(new l).translateO(e.rx,e.ry).lmultiplyO(this).translateO(-i,-r).scaleO(e.scaleX,e.scaleY).skewO(e.skewX,e.skewY).shearO(e.shear).rotateO(e.theta).translateO(i,r);if(isFinite(e.px)||isFinite(e.py)){var a=new ir(i,r).transform(o),s=e.px?e.px-a.x:0,h=e.py?e.py-a.y:0;o.translateO(s,h)}return o.translateO(e.tx,e.ty),o}},{key:"compose",value:function(t){t.origin&&(t.originX=t.origin[0],t.originY=t.origin[1]);var e=t.originX||0,n=t.originY||0,i=t.scaleX||1,r=t.scaleY||1,o=t.shear||0,a=t.rotate||0,s=t.translateX||0,h=t.translateY||0;return(new l).translateO(-e,-n).scaleO(i,r).shearO(o).rotateO(a).translateO(s,h).lmultiplyO(this).translateO(e,n)}},{key:"decompose",value:function(t,e){var n=0<arguments.length&&void 0!==t?t:0,i=1<arguments.length&&void 0!==e?e:0,r=this.a,o=this.b,a=this.c,s=this.d,h=this.e,l=this.f,c=r*s-o*a,u=0<c?1:-1,p=u*Math.sqrt(r*r+o*o),d=Math.atan2(u*o,u*r),f=180/Math.PI*d,m=Math.cos(d),v=Math.sin(d),g=(r*a+o*s)/c,y=a*p/(g*r-o)||s*p/(g*o+r);return{scaleX:p,scaleY:y,shear:g,rotate:f,translateX:h-n+n*m*p+i*(g*m*p-v*y),translateY:l-i+n*v*p+i*(g*v*p+m*y),originX:n,originY:i,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}},{key:"multiply",value:function(t){return this.clone().multiplyO(t)}},{key:"multiplyO",value:function(t){var e=t instanceof l?t:new l(t);return l.matrixMultiply(this,e,this)}},{key:"lmultiply",value:function(t){return this.clone().lmultiplyO(t)}},{key:"lmultiplyO",value:function(t){var e=t instanceof l?t:new l(t);return l.matrixMultiply(e,this,this)}},{key:"inverseO",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,o=this.f,a=t*i-e*n;if(!a)throw new Error("Cannot invert "+this);var s=i/a,h=-e/a,l=-n/a,c=t/a,u=-(s*r+l*o),p=-(h*r+c*o);return this.a=s,this.b=h,this.c=l,this.d=c,this.e=u,this.f=p,this}},{key:"inverse",value:function(){return this.clone().inverseO()}},{key:"translate",value:function(t,e){return this.clone().translateO(t,e)}},{key:"translateO",value:function(t,e){return this.e+=t||0,this.f+=e||0,this}},{key:"scale",value:function(t,e,n,i){var r;return(r=this.clone()).scaleO.apply(r,arguments)}},{key:"scaleO",value:function(t,e,n,i){var r=1<arguments.length&&void 0!==e?e:t,o=2<arguments.length&&void 0!==n?n:0,a=3<arguments.length&&void 0!==i?i:0;3===arguments.length&&(a=o,o=r,r=t);var s=this.a,h=this.b,l=this.c,c=this.d,u=this.e,p=this.f;return this.a=s*t,this.b=h*r,this.c=l*t,this.d=c*r,this.e=u*t-o*t+o,this.f=p*r-a*r+a,this}},{key:"rotate",value:function(t,e,n){return this.clone().rotateO(t,e,n)}},{key:"rotateO",value:function(t,e,n){var i=1<arguments.length&&void 0!==e?e:0,r=2<arguments.length&&void 0!==n?n:0;t=mn(t);var o=Math.cos(t),a=Math.sin(t),s=this.a,h=this.b,l=this.c,c=this.d,u=this.e,p=this.f;return this.a=s*o-h*a,this.b=h*o+s*a,this.c=l*o-c*a,this.d=c*o+l*a,this.e=u*o-p*a+r*a-i*o+i,this.f=p*o+u*a-i*a-r*o+r,this}},{key:"flip",value:function(t,e){return this.clone().flipO(t,e)}},{key:"flipO",value:function(t,e){return"x"===t?this.scaleO(-1,1,e,0):"y"===t?this.scaleO(1,-1,0,e):this.scaleO(-1,-1,t,e||t)}},{key:"shear",value:function(t,e,n){return this.clone().shearO(t,e,n)}},{key:"shearO",value:function(t,e,n){var i=2<arguments.length&&void 0!==n?n:0,r=this.a,o=this.b,a=this.c,s=this.d,h=this.e,l=this.f;return this.a=r+o*t,this.c=a+s*t,this.e=h+l*t-i*t,this}},{key:"skew",value:function(t,e,n,i){var r;return(r=this.clone()).skewO.apply(r,arguments)}},{key:"skewO",value:function(t,e,n,i){var r=1<arguments.length&&void 0!==e?e:t,o=2<arguments.length&&void 0!==n?n:0,a=3<arguments.length&&void 0!==i?i:0;3===arguments.length&&(a=o,o=r,r=t),t=mn(t),r=mn(r);var s=Math.tan(t),h=Math.tan(r),l=this.a,c=this.b,u=this.c,p=this.d,d=this.e,f=this.f;return this.a=l+c*s,this.b=c+l*h,this.c=u+p*s,this.d=p+u*h,this.e=d+f*s-a*s,this.f=f+d*h-o*h,this}},{key:"skewX",value:function(t,e,n){return this.skew(t,0,e,n)}},{key:"skewXO",value:function(t,e,n){return this.skewO(t,0,e,n)}},{key:"skewY",value:function(t,e,n){return this.skew(0,t,e,n)}},{key:"skewYO",value:function(t,e,n){return this.skewO(0,t,e,n)}},{key:"aroundO",value:function(t,e,n){var i=t||0,r=e||0;return this.translateO(-i,-r).lmultiplyO(n).translateO(i,r)}},{key:"around",value:function(t,e,n){return this.clone().aroundO(t,e,n)}},{key:"equals",value:function(t){var e=new l(t);return rr(this.a,e.a)&&rr(this.b,e.b)&&rr(this.c,e.c)&&rr(this.d,e.d)&&rr(this.e,e.e)&&rr(this.f,e.f)}},{key:"toString",value:function(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}},{key:"toArray",value:function(){return[this.a,this.b,this.c,this.d,this.e,this.f]}},{key:"valueOf",value:function(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}],[{key:"fromArray",value:function(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}},{key:"isMatrixLike",value:function(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}},{key:"formatTransforms",value:function(t){var e="both"===t.flip||!0===t.flip,n=t.flip&&(e||"x"===t.flip)?-1:1,i=t.flip&&(e||"y"===t.flip)?-1:1,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,o=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,a=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,s=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,h=t.shear||0,l=t.rotate||t.theta||0,c=new ir(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),u=c.x,p=c.y,d=new ir(t.position||t.px||t.positionX,t.py||t.positionY),f=d.x,m=d.y,v=new ir(t.translate||t.tx||t.translateX,t.ty||t.translateY),g=v.x,y=v.y,x=new ir(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:a,scaleY:s,skewX:r,skewY:o,shear:h,theta:l,rx:x.x,ry:x.y,tx:g,ty:y,ox:u,oy:p,px:f,py:m}}},{key:"matrixMultiply",value:function(t,e,n){var i=t.a*e.a+t.c*e.b,r=t.b*e.a+t.d*e.b,o=t.a*e.c+t.c*e.d,a=t.b*e.c+t.d*e.d,s=t.e+t.a*e.e+t.c*e.f,h=t.f+t.b*e.e+t.d*e.f;return n.a=i,n.b=r,n.c=o,n.d=a,n.e=s,n.f=h,n}}]),l}();function ar(){if(!ar.nodes){var t=kn().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false");var e=t.path().node;ar.nodes={svg:t,path:e}}if(!ar.nodes.svg.node.parentNode){var n=An.document.body||An.document.documentElement;ar.nodes.svg.addTo(n)}return ar.nodes}function sr(t){return!(t.width||t.height||t.x||t.y)}Bn(or,"Matrix");var hr=function(){function a(){Cn(this,a),this.init.apply(this,arguments)}return gi(a,[{key:"init",value:function(t){return t="string"==typeof t?t.split(ei).map(parseFloat):Array.isArray(t)?t:"object"===it(t)?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}},{key:"merge",value:function(t){var e=Math.min(this.x,t.x),n=Math.min(this.y,t.y);return new a(e,n,Math.max(this.x+this.width,t.x+t.width)-e,Math.max(this.y+this.height,t.y+t.height)-n)}},{key:"transform",value:function(e){e instanceof or||(e=new or(e));var n=1/0,i=-1/0,r=1/0,o=-1/0;return[new ir(this.x,this.y),new ir(this.x2,this.y),new ir(this.x,this.y2),new ir(this.x2,this.y2)].forEach(function(t){t=t.transform(e),n=Math.min(n,t.x),i=Math.max(i,t.x),r=Math.min(r,t.y),o=Math.max(o,t.y)}),new a(n,r,i-n,o-r)}},{key:"addOffset",value:function(){return this.x+=An.window.pageXOffset,this.y+=An.window.pageYOffset,this}},{key:"toString",value:function(){return this.x+" "+this.y+" "+this.width+" "+this.height}},{key:"toArray",value:function(){return[this.x,this.y,this.width,this.height]}},{key:"isNulled",value:function(){return sr(this)}}]),a}();function lr(t,e){var n;try{if(sr(n=t(this.node))&&!function(t){return t===An.document||(An.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===An.document}).call(An.document.documentElement,t)}(this.node))throw new Error("Element not in the dom")}catch(t){n=e(this)}return n}an({viewbox:{viewbox:function(t,e,n,i){return null==t?new hr(this.attr("viewBox")):this.attr("viewBox",new hr(t,e,n,i))},zoom:function(t,e){var n=this.node.clientWidth,i=this.node.clientHeight,r=this.viewbox();if(!n&&!i){var o=window.getComputedStyle(this.node);n=parseFloat(o.getPropertyValue("width")),i=parseFloat(o.getPropertyValue("height"))}var a=n/r.width,s=i/r.height,h=Math.min(a,s);if(null==t)return h;var l=h/t;l===1/0&&(l=Number.MIN_VALUE),e=e||new ir(n/2/a+r.x,i/2/s+r.y);var c=new hr(r).transform(new or({scale:l,origin:e}));return this.viewbox(c)}}}),Bn(hr,"Box");var cr=function(){try{return Function("name","baseClass","_constructor",["baseClass = baseClass || Array","return {"," [name]: class extends baseClass {"," constructor (...args) {"," super(...args)"," _constructor && _constructor.apply(this, args)"," }"," }","}[name]"].join("\n"))}catch(t){return function(t){function n(){e.apply(this,arguments),i&&i.apply(this,arguments)}var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Array,i=2<arguments.length?arguments[2]:void 0;return((n.prototype=Object.create(e.prototype)).constructor=n).prototype.map=function(t){var e=new n;return e.push.apply(e,Array.prototype.map.call(this,t)),e},n}}}(),ur=cr("List",Array,function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];if("number"==typeof t)return this;this.length=0,this.push.apply(this,re(t))});Vn(ur,{each:function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return"function"==typeof e?this.map(function(t){return e.call(t,t)}):this.map(function(t){return t[e].apply(t,n)})},toArray:function(){return Array.prototype.concat.apply([],this)}});var pr=["toArray","constructor","each"];function dr(t,e){return new ur(fn((e||An.document).querySelectorAll(t),function(t){return In(t)}))}ur.extend=function(t){t=t.reduce(function(t,i){return pr.includes(i)||"_"===i[0]||(t[i]=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.each.apply(this,[i].concat(e))}),t},{}),Vn(ur,t)};var fr=function(){function i(){var t,e=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).events,n=void 0===e?{}:e;return Cn(this,i),(t=Ri(this,Oi(i).call(this))).events=n,t}return Ii(i,Ln),gi(i,[{key:"addEventListener",value:function(){}},{key:"dispatch",value:function(t,e){return fi(this,t,e)}},{key:"dispatchEvent",value:function(t){var e=this.getEventHolder().events;if(!e)return!0;var n=e[t.type];for(var i in n)for(var r in n[i])n[i][r](t);return!t.defaultPrevented}},{key:"fire",value:function(t,e){return this.dispatch(t,e),this}},{key:"getEventHolder",value:function(){return this}},{key:"getEventTarget",value:function(){return this}},{key:"off",value:function(t,e){return di(this,t,e),this}},{key:"on",value:function(t,e,n,i){return pi(this,t,e,n,i),this}},{key:"removeEventListener",value:function(){}}]),i}();function mr(){}Bn(fr,"EventTarget");var vr={duration:400,ease:">",delay:0},gr={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"},yr={noop:mr,timeline:vr,attrs:gr},xr=cr("SVGArray",Array,function(t){this.init(t)});Vn(xr,{init:function(t){return"number"==typeof t||(this.length=0,this.push.apply(this,re(this.parse(t)))),this},toArray:function(){return Array.prototype.concat.apply([],this)},toString:function(){return this.join(" ")},valueOf:function(){var t=[];return t.push.apply(t,re(this)),t},parse:function(t){var e=0<arguments.length&&void 0!==t?t:[];return e instanceof Array?e:e.trim().split(ei).map(parseFloat)},clone:function(){return new this.constructor(this)},toSet:function(){return new Set(this)}});var br=function(){function n(){Cn(this,n),this.init.apply(this,arguments)}return gi(n,[{key:"init",value:function(t,e){return e=Array.isArray(t)?t[1]:e,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(Hn))&&(this.value=parseFloat(e[1]),"%"===e[5]?this.value/=100:"s"===e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof n&&(this.value=t.valueOf(),this.unit=t.unit),this}},{key:"toString",value:function(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}},{key:"toJSON",value:function(){return this.toString()}},{key:"toArray",value:function(){return[this.value,this.unit]}},{key:"valueOf",value:function(){return this.value}},{key:"plus",value:function(t){return new n(this+(t=new n(t)),this.unit||t.unit)}},{key:"minus",value:function(t){return new n(this-(t=new n(t)),this.unit||t.unit)}},{key:"times",value:function(t){return new n(this*(t=new n(t)),this.unit||t.unit)}},{key:"divide",value:function(t){return new n(this/(t=new n(t)),this.unit||t.unit)}},{key:"convert",value:function(t){return new n(this.value,t)}}]),n}(),wr=[];var _r=function(){function i(t,e){var n;return Cn(this,i),(n=Ri(this,Oi(i).call(this,t))).node=t,n.type=t.nodeName,e&&t!==e&&n.attr(e),n}return Ii(i,fr),gi(i,[{key:"add",value:function(t,e){return t=kn(t),null==e?this.node.appendChild(t.node):t.node!==this.node.childNodes[e]&&this.node.insertBefore(t.node,this.node.childNodes[e]),this}},{key:"addTo",value:function(t){return kn(t).put(this)}},{key:"children",value:function(){return new ur(fn(this.node.children,function(t){return In(t)}))}},{key:"clear",value:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}},{key:"clone",value:function(){return this.writeDataToDom(),jn(this.node.cloneNode(!0))}},{key:"each",value:function(t,e){var n,i,r=this.children();for(n=0,i=r.length;n<i;n++)t.apply(r[n],[n,r]),e&&r[n].each(t,e);return this}},{key:"element",value:function(t){return this.put(new i(On(t)))}},{key:"first",value:function(){return In(this.node.firstChild)}},{key:"get",value:function(t){return In(this.node.childNodes[t])}},{key:"getEventHolder",value:function(){return this.node}},{key:"getEventTarget",value:function(){return this.node}},{key:"has",value:function(t){return 0<=this.index(t)}},{key:"id",value:function(t){return void 0!==t||this.node.id||(this.node.id=Un(this.type)),this.attr("id",t)}},{key:"index",value:function(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}},{key:"last",value:function(){return In(this.node.lastChild)}},{key:"matches",value:function(t){var e=this.node;return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)}},{key:"parent",value:function(t){var e=this;if(!e.node.parentNode)return null;if(e=In(e.node.parentNode),!t)return e;for(;e;){if("string"==typeof t?e.matches(t):e instanceof t)return e;if(!e.node.parentNode||"#document"===e.node.parentNode.nodeName||"#document-fragment"===e.node.parentNode.nodeName)return null;e=In(e.node.parentNode)}}},{key:"put",value:function(t,e){return this.add(t,e),t}},{key:"putIn",value:function(t){return kn(t).add(this)}},{key:"remove",value:function(){return this.parent()&&this.parent().removeElement(this),this}},{key:"removeElement",value:function(t){return this.node.removeChild(t.node),this}},{key:"replace",value:function(t){return t=kn(t),this.node.parentNode.replaceChild(t.node,this.node),t}},{key:"round",value:function(t,e){var n=0<arguments.length&&void 0!==t?t:2,i=1<arguments.length?e:void 0,r=Math.pow(10,n),o=this.attr();i=i||Object.keys(o);var a={};return i.forEach(function(t){a[t]=Math.round(o[t]*r)/r}),this.attr(a),this}},{key:"toString",value:function(){return this.id()}},{key:"svg",value:function(n,t){var e,i,r;if(!1===n&&(t=!1,n=null),null==n||"function"==typeof n){t=null==t||t,this.writeDataToDom();var o=this;if(null!=n){if(o=In(o.node.cloneNode(!0)),t){var a=n(o);if(o=a||o,!1===a)return""}o.each(function(){var t=n(this),e=t||this;!1===t?this.remove():t&&this!==e&&this.replace(e)},!0)}return t?o.node.outerHTML:o.node.innerHTML}for(t=null!=t&&t,e=An.document.createElementNS(_n,"svg"),r=An.document.createDocumentFragment(),e.innerHTML=n,i=e.children.length;i--;)r.appendChild(e.firstElementChild);var s=this.parent();return t?this.replace(r)&&s:this.add(r)}},{key:"words",value:function(t){return this.node.textContent=t,this}},{key:"writeDataToDom",value:function(){return this.each(function(){this.writeDataToDom()}),this}}]),i}();Vn(_r,{attr:function(n,t,e){var i=this;if(null==n){n={},t=this.node.attributes;var r=!0,o=!1,a=void 0;try{for(var s,h=t[Symbol.iterator]();!(r=(s=h.next()).done);r=!0){var l=s.value;n[l.nodeName]=$n.test(l.nodeValue)?parseFloat(l.nodeValue):l.nodeValue}}catch(t){o=!0,a=t}finally{try{r||null==h.return||h.return()}finally{if(o)throw a}}return n}if(n instanceof Array)return n.reduce(function(t,e){return t[e]=i.attr(e),t},{});if("object"===it(n)&&n.constructor===Object)for(t in n)this.attr(t,n[t]);else if(null===t)this.node.removeAttribute(n);else{if(null==t)return null==(t=this.node.getAttribute(n))?gr[n]:$n.test(t)?parseFloat(t):t;"number"==typeof(t=wr.reduce(function(t,e){return e(n,t,i)},t))?t=new br(t):Li.isColor(t)?t=new Li(t):t.constructor===Array&&(t=new xr(t)),"leading"===n?this.leading&&this.leading(t):"string"==typeof e?this.node.setAttributeNS(e,n,t.toString()):this.node.setAttribute(n,t.toString()),!this.rebuild||"font-size"!==n&&"x"!==n||this.rebuild()}return this},find:function(t){return dr(t,this.node)},findOne:function(t){return In(this.node.querySelector(t))}}),Bn(_r,"Dom");var Mr=function(){function i(t,e){var n;return Cn(this,i),(n=Ri(this,Oi(i).call(this,t,e))).dom={},n.node.instance=Pi(Pi(n)),t.hasAttribute("svgjs:data")&&n.setData(JSON.parse(t.getAttribute("svgjs:data"))||{}),n}return Ii(i,_r),gi(i,[{key:"center",value:function(t,e){return this.cx(t).cy(e)}},{key:"cx",value:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}},{key:"cy",value:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}},{key:"defs",value:function(){return this.root().defs()}},{key:"dmove",value:function(t,e){return this.dx(t).dy(e)}},{key:"dx",value:function(t){return this.x(new br(t).plus(this.x()))}},{key:"dy",value:function(t){return this.y(new br(t).plus(this.y()))}},{key:"root",value:function(){var t=this.parent(Nn(Rn));return t&&t.root()}},{key:"getEventHolder",value:function(){return this}},{key:"height",value:function(t){return this.attr("height",t)}},{key:"inside",value:function(t,e){var n=this.bbox();return t>n.x&&e>n.y&&t<n.x+n.width&&e<n.y+n.height}},{key:"move",value:function(t,e){return this.x(t).y(e)}},{key:"parents",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:An.document;t=kn(t);for(var e=new ur,n=this;(n=n.parent())&&n.node!==t.node&&n.node!==An.document;)e.push(n);return e}},{key:"reference",value:function(t){if(!(t=this.attr(t)))return null;var e=t.match(Xn);return e?kn(e[1]):null}},{key:"setData",value:function(t){return this.dom=t,this}},{key:"size",value:function(t,e){var n=xn(this,t,e);return this.width(new br(n.width)).height(new br(n.height))}},{key:"width",value:function(t){return this.attr("width",t)}},{key:"writeDataToDom",value:function(){return this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),ki(Oi(i.prototype),"writeDataToDom",this).call(this)}},{key:"x",value:function(t){return this.attr("x",t)}},{key:"y",value:function(t){return this.attr("y",t)}}]),i}();Vn(Mr,{bbox:function(){return new hr(lr.call(this,function(t){return t.getBBox()},function(e){try{var t=e.clone().addTo(ar().svg).show(),n=t.node.getBBox();return t.remove(),n}catch(t){throw new Error('Getting bbox of element "'+e.node.nodeName+'" is not possible. '+t.toString())}}))},rbox:function(t){var e=new hr(lr.call(this,function(t){return t.getBoundingClientRect()},function(t){throw new Error('Getting rbox of element "'+t.node.nodeName+'" is not possible')}));return t?e.transform(t.screenCTM().inverse()):e.addOffset()},point:function(t,e){return new ir(t,e).transform(this.screenCTM().inverse())},ctm:function(){return new or(this.node.getCTM())},screenCTM:function(){if("function"!=typeof this.isRoot||this.isRoot())return new or(this.node.getScreenCTM());var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new or(e)}}),Bn(Mr,"Element");var Sr={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,e){return"color"===e?t:t+"-"+e}};function Tr(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},e=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))),e.forEach(function(t){var e,n,i;e=r,i=o[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return r}function Er(t){return this.attr("rx",t)}function Ar(t){return this.attr("ry",t)}function Cr(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Lr(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function Pr(t){return null==t?this.attr("cx"):this.attr("cx",t)}function Rr(t){return null==t?this.attr("cy"):this.attr("cy",t)}function Or(t){return null==t?2*this.rx():this.rx(new br(t).divide(2))}function kr(t){return null==t?2*this.ry():this.ry(new br(t).divide(2))}["fill","stroke"].forEach(function(e){var n,t={};t[e]=function(t){if(void 0===t)return this.attr(e);if("string"==typeof t||t instanceof Li||Li.isRgb(t)||t instanceof Mr)this.attr(e,t);else for(n=Sr[e].length-1;0<=n;n--)null!=t[Sr[e][n]]&&this.attr(Sr.prefix(e,Sr[e][n]),t[Sr[e][n]]);return this},an(["Element","Runner"],t)}),an(["Element","Runner"],{matrix:function(t,e,n,i,r,o){return null==t?new or(this):this.attr("transform",new or(t,e,n,i,r,o))},rotate:function(t,e,n){return this.transform({rotate:t,ox:e,oy:n},!0)},skew:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({skew:t,ox:e,oy:n},!0):this.transform({skew:[t,e],ox:n,oy:i},!0)},shear:function(t,e,n){return this.transform({shear:t,ox:e,oy:n},!0)},scale:function(t,e,n,i){return 1===arguments.length||3===arguments.length?this.transform({scale:t,ox:e,oy:n},!0):this.transform({scale:[t,e],ox:n,oy:i},!0)},translate:function(t,e){return this.transform({translate:[t,e]},!0)},relative:function(t,e){return this.transform({relative:[t,e]},!0)},flip:function(t,e){var n="string"==typeof t?t:(isFinite(t),"both"),i="both"===t&&isFinite(e)?[e,e]:"x"===t?[e,0]:"y"===t?[0,e]:isFinite(t)?[t,t]:[0,0];return this.transform({flip:n,origin:i},!0)},opacity:function(t){return this.attr("opacity",t)}}),an("radius",{radius:function(t,e){var n=(this._element||this).type;return"radialGradient"===n||"radialGradient"===n?this.attr("r",new br(t)):this.rx(t).ry(null==e?t:e)}}),an("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new ir(this.node.getPointAtLength(t))}}),an(["Element","Runner"],{font:function(t,e){if("object"!==it(t))return"leading"===t?this.leading(e):"anchor"===t?this.attr("text-anchor",e):"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?this.attr("font-"+t,e):this.attr(t,e);for(e in t)this.font(e,t[e]);return this}}),an("Text",{ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},amove:function(t,e){return this.ax(t).ay(e)}}),an("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce(function(t,e){return t[e]=function(t){return null===t?di(this,e):pi(this,e,t),this},t},{})),an("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(Yn).slice(0,-1).map(function(t){var e=t.trim().split("(");return[e[0],e[1].split(ei).map(function(t){return parseFloat(t)})]}).reverse().reduce(function(t,e){return"matrix"===e[0]?t.lmultiply(or.fromArray(e[1])):t[e[0]].apply(t,e[1])},new or)},toParent:function(t){if(this===t)return this;var e=this.screenCTM(),n=t.screenCTM().inverse();return this.addTo(t).untransform().transform(n.multiply(e)),this},toRoot:function(){return this.toParent(this.root())},transform:function(t,e){if(null==t||"string"==typeof t){var n=new or(this).decompose();return null==t?n:n[t]}or.isMatrixLike(t)||(t=Tr({},t,{origin:bn(t,this)}));var i=new or(!0===e?this:e||!1).transform(t);return this.attr("transform",i)}});var zr={rx:Er,ry:Ar,x:Cr,y:Lr,cx:Pr,cy:Rr,width:Or,height:kr},Ir=function(){function t(){return Cn(this,t),Ri(this,Oi(t).apply(this,arguments))}return Ii(t,Mr),t}();Bn(Ir,"Shape");var Dr=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("circle",t),t))}return Ii(e,Ir),gi(e,[{key:"radius",value:function(t){return this.attr("r",t)}},{key:"rx",value:function(t){return this.attr("r",t)}},{key:"ry",value:function(t){return this.rx(t)}},{key:"size",value:function(t){return this.radius(new br(t).divide(2))}}]),e}();Vn(Dr,{x:Cr,y:Lr,cx:Pr,cy:Rr,width:Or,height:kr}),an({Container:{circle:Gn(function(t){return this.put(new Dr).size(t).move(0,0)})}}),Bn(Dr,"Circle");var Br=function(){function e(){return Cn(this,e),Ri(this,Oi(e).apply(this,arguments))}return Ii(e,Mr),gi(e,[{key:"flatten",value:function(t){return this.each(function(){return this instanceof e?this.flatten(t).ungroup(t):this.toParent(t)}),this.node.firstElementChild||this.remove(),this}},{key:"ungroup",value:function(t){return t=t||this.parent(),this.each(function(){return this.toParent(t)}),this.remove(),this}}]),e}();Bn(Br,"Container");var Nr=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("defs",t),t))}return Ii(e,Br),gi(e,[{key:"flatten",value:function(){return this}},{key:"ungroup",value:function(){return this}}]),e}();Bn(Nr,"Defs");var Fr=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("ellipse",t),t))}return Ii(e,Ir),gi(e,[{key:"size",value:function(t,e){var n=xn(this,t,e);return this.rx(new br(n.width).divide(2)).ry(new br(n.height).divide(2))}}]),e}();Vn(Fr,zr),an("Container",{ellipse:Gn(function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t;return this.put(new Fr).size(t,e).move(0,0)})}),Bn(Fr,"Ellipse");var Ur=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("stop",t),t))}return Ii(e,Mr),gi(e,[{key:"update",value:function(t,e,n){return("number"==typeof t||t instanceof br)&&(t={offset:arguments[0],color:e,opacity:n}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new br(t.offset)),this}}]),e}();function jr(t,e){return"radialGradient"===(this._element||this).type?this.attr({fx:new br(t),fy:new br(e)}):this.attr({x1:new br(t),y1:new br(e)})}function Vr(t,e){return"radialGradient"===(this._element||this).type?this.attr({cx:new br(t),cy:new br(e)}):this.attr({x2:new br(t),y2:new br(e)})}Bn(Ur,"Stop");var Gr={from:jr,to:Vr},Hr=function(){function i(t,e){return Cn(this,i),Ri(this,Oi(i).call(this,zn(t+"Gradient","string"==typeof t?null:t),e))}return Ii(i,Br),gi(i,[{key:"stop",value:function(t,e,n){return this.put(new Ur).update(t,e,n)}},{key:"update",value:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}},{key:"url",value:function(){return"url(#"+this.id()+")"}},{key:"toString",value:function(){return this.url()}},{key:"attr",value:function(t,e,n){return"transform"===t&&(t="gradientTransform"),ki(Oi(i.prototype),"attr",this).call(this,t,e,n)}},{key:"targets",value:function(){return dr('svg [fill*="'+this.id()+'"]')}},{key:"bbox",value:function(){return new hr}}]),i}();Vn(Hr,Gr),an({Container:{gradient:Gn(function(t,e){return this.defs().gradient(t,e)})},Defs:{gradient:Gn(function(t,e){return this.put(new Hr(t)).update(e)})}}),Bn(Hr,"Gradient");var Wr=function(){function i(t){return Cn(this,i),Ri(this,Oi(i).call(this,zn("pattern",t),t))}return Ii(i,Br),gi(i,[{key:"url",value:function(){return"url(#"+this.id()+")"}},{key:"update",value:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}},{key:"toString",value:function(){return this.url()}},{key:"attr",value:function(t,e,n){return"transform"===t&&(t="patternTransform"),ki(Oi(i.prototype),"attr",this).call(this,t,e,n)}},{key:"targets",value:function(){return dr('svg [fill*="'+this.id()+'"]')}},{key:"bbox",value:function(){return new hr}}]),i}();an({Container:{pattern:function(){var t;return(t=this.defs()).pattern.apply(t,arguments)}},Defs:{pattern:Gn(function(t,e,n){return this.put(new Wr).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})})}}),Bn(Wr,"Pattern");var qr,Xr=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("image",t),t))}return Ii(e,Ir),gi(e,[{key:"load",value:function(t,n){if(!t)return this;var i=new An.window.Image;return pi(i,"load",function(t){var e=this.parent(Wr);0===this.width()&&0===this.height()&&this.size(i.width,i.height),e instanceof Wr&&0===e.width()&&0===e.height()&&e.size(this.width(),this.height()),"function"==typeof n&&n.call(this,t)},this),pi(i,"load error",function(){di(i)}),this.attr("href",i.src=t,Sn)}}]),e}();qr=function(t,e,n){return"fill"!==t&&"stroke"!==t||ti.test(e)&&(e=n.root().defs().image(e)),e instanceof Xr&&(e=n.root().defs().pattern(0,0,function(t){t.add(e)})),e},wr.push(qr),an({Container:{image:Gn(function(t,e){return this.put(new Xr).size(0,0).load(t,e)})}}),Bn(Xr,"Image");var Yr=cr("PointArray",xr);Vn(Yr,{toString:function(){for(var t=0,e=this.length,n=[];t<e;t++)n.push(this[t].join(","));return n.join(" ")},toLine:function(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}},at:function(t){if(!this.destination)return this;for(var e=0,n=this.length,i=[];e<n;e++)i.push([this[e][0]+(this.destination[e][0]-this[e][0])*t,this[e][1]+(this.destination[e][1]-this[e][1])*t]);return new Yr(i)},parse:function(t){var e=0<arguments.length&&void 0!==t?t:[[0,0]],n=[];if(e instanceof Array){if(e[0]instanceof Array)return e}else e=e.trim().split(ei).map(parseFloat);e.length%2!=0&&e.pop();for(var i=0,r=e.length;i<r;i+=2)n.push([e[i],e[i+1]]);return n},transform:function(t){for(var e=[],n=0;n<this.length;n++){var i=this[n];e.push([t.a*i[0]+t.c*i[1]+t.e,t.b*i[0]+t.d*i[1]+t.f])}return new Yr(e)},move:function(t,e){var n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(var i=this.length-1;0<=i;i--)this[i]=[this[i][0]+t,this[i][1]+e];return this},size:function(t,e){var n,i=this.bbox();for(n=this.length-1;0<=n;n--)i.width&&(this[n][0]=(this[n][0]-i.x)*t/i.width+i.x),i.height&&(this[n][1]=(this[n][1]-i.y)*e/i.height+i.y);return this},bbox:function(){var e=-1/0,n=-1/0,i=1/0,r=1/0;return this.forEach(function(t){e=Math.max(t[0],e),n=Math.max(t[1],n),i=Math.min(t[0],i),r=Math.min(t[1],r)}),{x:i,y:r,width:e-i,height:n-r}}});var Zr={MorphArray:Yr,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){var e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){var e=this.bbox();return null==t?e.height:this.size(e.width,t)}},Jr=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("line",t),t))}return Ii(e,Ir),gi(e,[{key:"array",value:function(){return new Yr([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}},{key:"plot",value:function(t,e,n,i){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:i}:new Yr(t).toLine(),this.attr(t))}},{key:"move",value:function(t,e){return this.attr(this.array().move(t,e).toLine())}},{key:"size",value:function(t,e){var n=xn(this,t,e);return this.attr(this.array().size(n.width,n.height).toLine())}}]),e}();Vn(Jr,Zr),an({Container:{line:Gn(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Jr.prototype.plot.apply(this.put(new Jr),null!=e[0]?e:[0,0,0,0])})}}),Bn(Jr,"Line");var Kr=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("marker",t),t))}return Ii(e,Br),gi(e,[{key:"width",value:function(t){return this.attr("markerWidth",t)}},{key:"height",value:function(t){return this.attr("markerHeight",t)}},{key:"ref",value:function(t,e){return this.attr("refX",t).attr("refY",e)}},{key:"update",value:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}},{key:"toString",value:function(){return"url(#"+this.id()+")"}}]),e}();an({Container:{marker:function(){var t;return(t=this.defs()).marker.apply(t,arguments)}},Defs:{marker:Gn(function(t,e,n){return this.put(new Kr).size(t,e).ref(t/2,e/2).viewbox(0,0,t,e).attr("orient","auto").update(n)})},marker:{marker:function(t,e,n,i){var r=["marker"];return"all"!==t&&r.push(t),r=r.join("-"),t=e instanceof Kr?e:this.defs().marker(e,n,i),this.attr(r,t)}}}),Bn(Kr,"Marker");var Qr,$r,to=[].sort,eo=[1,2,3];function no(e,n){return function(t){return null==t?this[t]:(this[e]=t,n&&n.call(this),this)}}I(I.P+I.F*(y(function(){eo.sort(void 0)})||!y(function(){eo.sort(null)})||!((Qr=to)&&y(function(){$r?Qr.call(null,function(){},1):Qr.call(null)}))),"Array",{sort:function(t){return void 0===t?to.call(z(this)):to.call(z(this),e(t))}});var io={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(e,n,i,r){return function(t){return t<0?0<e?n/e*t:0<i?r/i*t:0:1<t?i<1?(1-r)/(1-i)*t+(r-i)/(1-i):e<1?(1-n)/(1-e)*t+(n-e)/(1-e):1:3*t*Math.pow(1-t,2)*n+3*Math.pow(t,2)*(1-t)*r+Math.pow(t,3)}},steps:function(r,t){var o=1<arguments.length&&void 0!==t?t:"end";o=o.split("-").reverse()[0];var a=r;return"none"===o?--a:"both"===o&&++a,function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=Math.floor(t*r),i=t*n%1==0;return"start"!==o&&"both"!==o||++n,e&&i&&--n,0<=t&&n<0&&(n=0),t<=1&&a<n&&(n=a),n/a}}},ro=function(){function t(){Cn(this,t)}return gi(t,[{key:"done",value:function(){return!1}}]),t}(),oo=function(){function n(t){var e;return Cn(this,n),(e=Ri(this,Oi(n).call(this))).ease=io[t||vr.ease]||t,e}return Ii(n,ro),gi(n,[{key:"step",value:function(t,e,n){return"number"!=typeof t?n<1?t:e:t+(e-t)*this.ease(n)}}]),n}(),ao=function(){function n(t){var e;return Cn(this,n),(e=Ri(this,Oi(n).call(this))).stepper=t,e}return Ii(n,ro),gi(n,[{key:"step",value:function(t,e,n,i){return this.stepper(t,e,n,i)}},{key:"done",value:function(t){return t.done}}]),n}();function so(){var t=(this._duration||500)/1e3,e=this._overshoot||0,n=Math.PI,i=Math.log(e/100+1e-10),r=-i/Math.sqrt(n*n+i*i),o=3.9/(r*t);this.d=2*r*o,this.k=o*o}var ho=function(){function i(t,e){var n;return Cn(this,i),(n=Ri(this,Oi(i).call(this))).duration(t||500).overshoot(e||0),n}return Ii(i,ao),gi(i,[{key:"step",value:function(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;100<n&&(n=16),n/=1e3;var r=i.velocity||0,o=-this.d*r-this.k*(t-e),a=t+r*n+o*n*n/2;return i.velocity=r+o*n,i.done=Math.abs(e-a)+Math.abs(r)<.002,i.done?e:a}}]),i}();Vn(ho,{duration:no("_duration",so),overshoot:no("_overshoot",so)});var lo=function(){function o(t,e,n,i){var r;return Cn(this,o),t=null==t?.1:t,e=null==e?.01:e,n=null==n?0:n,i=null==i?1e3:i,(r=Ri(this,Oi(o).call(this))).p(t).i(e).d(n).windup(i),r}return Ii(o,ao),gi(o,[{key:"step",value:function(t,e,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return e;if(0===n)return t;var r=e-t,o=(i.integral||0)+r*n,a=(r-(i.error||0))/n,s=this.windup;return!1!==s&&(o=Math.max(-s,Math.min(o,s))),i.error=r,i.integral=o,i.done=Math.abs(r)<.001,i.done?e:t+(this.P*r+this.I*o+this.D*a)}}]),o}();Vn(lo,{windup:no("windup"),p:no("P"),i:no("I"),d:no("D")});var co=cr("PathArray",xr);function uo(t,e,n,i){return n+i.replace(ai," .")}for(var po={M:function(t,e,n){return e.x=n.x=t[0],e.y=n.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,n){return e.x=n.x,e.y=n.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},fo="mlhvqtcsaz".split(""),mo=0,vo=fo.length;mo<vo;++mo)po[fo[mo]]=function(o){return function(t,e,n){if("H"===o)t[0]=t[0]+e.x;else if("V"===o)t[0]=t[0]+e.y;else if("A"===o)t[5]=t[5]+e.x,t[6]=t[6]+e.y;else for(var i=0,r=t.length;i<r;++i)t[i]=t[i]+(i%2?e.y:e.x);return po[o](t,e,n)}}(fo[mo].toUpperCase());Vn(co,{toString:function(){return function(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e][0],null!=t[e][1]&&(i+=t[e][1],null!=t[e][2]&&(i+=" ",i+=t[e][2],null!=t[e][3]&&(i+=" ",i+=t[e][3],i+=" ",i+=t[e][4],null!=t[e][5]&&(i+=" ",i+=t[e][5],i+=" ",i+=t[e][6],null!=t[e][7]&&(i+=" ",i+=t[e][7])))));return i+" "}(this)},move:function(t,e){var n=this.bbox();if(t-=n.x,e-=n.y,!isNaN(t)&&!isNaN(e))for(var i,r=this.length-1;0<=r;r--)"M"===(i=this[r][0])||"L"===i||"T"===i?(this[r][1]+=t,this[r][2]+=e):"H"===i?this[r][1]+=t:"V"===i?this[r][1]+=e:"C"===i||"S"===i||"Q"===i?(this[r][1]+=t,this[r][2]+=e,this[r][3]+=t,this[r][4]+=e,"C"===i&&(this[r][5]+=t,this[r][6]+=e)):"A"===i&&(this[r][6]+=t,this[r][7]+=e);return this},size:function(t,e){var n,i,r=this.bbox();for(r.width=0===r.width?1:r.width,r.height=0===r.height?1:r.height,n=this.length-1;0<=n;n--)"M"===(i=this[n][0])||"L"===i||"T"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y):"H"===i?this[n][1]=(this[n][1]-r.x)*t/r.width+r.x:"V"===i?this[n][1]=(this[n][1]-r.y)*e/r.height+r.y:"C"===i||"S"===i||"Q"===i?(this[n][1]=(this[n][1]-r.x)*t/r.width+r.x,this[n][2]=(this[n][2]-r.y)*e/r.height+r.y,this[n][3]=(this[n][3]-r.x)*t/r.width+r.x,this[n][4]=(this[n][4]-r.y)*e/r.height+r.y,"C"===i&&(this[n][5]=(this[n][5]-r.x)*t/r.width+r.x,this[n][6]=(this[n][6]-r.y)*e/r.height+r.y)):"A"===i&&(this[n][1]=this[n][1]*t/r.width,this[n][2]=this[n][2]*e/r.height,this[n][6]=(this[n][6]-r.x)*t/r.width+r.x,this[n][7]=(this[n][7]-r.y)*e/r.height+r.y);return this},equalCommands:function(t){var e,n,i;for(t=new co(t),i=this.length===t.length,e=0,n=this.length;i&&e<n;e++)i=this[e][0]===t[e][0];return i},morph:function(t){return t=new co(t),this.equalCommands(t)?this.destination=t:this.destination=null,this},at:function(t){if(!this.destination)return this;var e,n,i,r,o=this.destination.value,a=[],s=new co;for(e=0,n=this.length;e<n;e++){for(a[e]=[this[e][0]],i=1,r=this[e].length;i<r;i++)a[e][i]=this[e][i]+(o[e][i]-this[e][i])*t;"A"===a[e][0]&&(a[e][4]=+(0!==a[e][4]),a[e][5]=+(0!==a[e][5]))}return s.value=a,s},parse:function(t){var e,n=0<arguments.length&&void 0!==t?t:[["M",0,0]];if(n instanceof co)return n;var i={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};n="string"==typeof n?n.replace(oi,uo).replace(ii," $& ").replace(ni,"$1 -").trim().split(ei):n.reduce(function(t,e){return[].concat.call(t,e)},[]);for(var r=[],o=new ir,a=new ir,s=0,h=n.length;ri.test(n[s])?(e=n[s],++s):"M"===e?e="L":"m"===e&&(e="l"),r.push(po[e].call(null,n.slice(s,s+=i[e.toUpperCase()]).map(parseFloat),o,a)),s<h;);return r},bbox:function(){return ar().path.setAttribute("d",this.toString()),ar.nodes.path.getBBox()}});var go=function(){function e(t){Cn(this,e),this._stepper=t||new oo("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}return gi(e,[{key:"from",value:function(t){return null==t?this._from:(this._from=this._set(t),this)}},{key:"to",value:function(t){return null==t?this._to:(this._to=this._set(t),this)}},{key:"type",value:function(t){return null==t?this._type:(this._type=t,this)}},{key:"_set",value:function(t){if(!this._type){var e=it(t);"number"===e?this.type(br):"string"===e?Li.isColor(t)?this.type(Li):ei.test(t)?this.type(ii.test(t)?co:xr):Hn.test(t)?this.type(br):this.type(yo):-1<wo.indexOf(t.constructor)?this.type(t.constructor):Array.isArray(t)?this.type(xr):"object"===e?this.type(bo):this.type(yo)}var n=new this._type(t);return this._type===Li&&(n=this._to?n[this._to[4]]():this._from?n[this._from[4]]():n),n=n.toArray(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(n.length)).map(Object).map(function(t){return t.done=!0,t}),n}},{key:"stepper",value:function(t){return null==t?this._stepper:(this._stepper=t,this)}},{key:"done",value:function(){return this._context.map(this._stepper.done).reduce(function(t,e){return t&&e},!0)}},{key:"at",value:function(n){var i=this;return this._morphObj.fromArray(this._from.map(function(t,e){return i._stepper.step(t,i._to[e],n,i._context[e],i._context)}))}}]),e}(),yo=function(){function t(){Cn(this,t),this.init.apply(this,arguments)}return gi(t,[{key:"init",value:function(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}},{key:"valueOf",value:function(){return this.value}},{key:"toArray",value:function(){return[this.value]}}]),t}(),xo=function(){function e(){Cn(this,e),this.init.apply(this,arguments)}return gi(e,[{key:"init",value:function(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,e.defaults,t),this}},{key:"toArray",value:function(){return[this.scaleX,this.scaleY,this.shear,this.rotate,this.translateX,this.translateY,this.originX,this.originY]}}]),e}();xo.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};var bo=function(){function t(){Cn(this,t),this.init.apply(this,arguments)}return gi(t,[{key:"init",value:function(t){if(this.values=[],!Array.isArray(t)){t=t||{};var e=[];for(var n in t)e.push([n,t[n]]);return e.sort(function(t,e){return t[0]-e[0]}),this.values=e.reduce(function(t,e){return t.concat(e)},[]),this}this.values=t}},{key:"valueOf",value:function(){for(var t={},e=this.values,n=0,i=e.length;n<i;n+=2)t[e[n]]=e[n+1];return t}},{key:"toArray",value:function(){return this.values}}]),t}(),wo=[yo,xo,bo];function _o(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];wo.push.apply(wo,re([].concat(t)))}function Mo(){Vn(wo,{to:function(t){return(new go).type(this.constructor).from(this.valueOf()).to(t)},fromArray:function(t){return this.init(t),this}})}var So=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("path",t),t))}return Ii(e,Ir),gi(e,[{key:"array",value:function(){return this._array||(this._array=new co(this.attr("d")))}},{key:"plot",value:function(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new co(t))}},{key:"clear",value:function(){return delete this._array,this}},{key:"move",value:function(t,e){return this.attr("d",this.array().move(t,e))}},{key:"x",value:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}},{key:"y",value:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}},{key:"size",value:function(t,e){var n=xn(this,t,e);return this.attr("d",this.array().size(n.width,n.height))}},{key:"width",value:function(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}},{key:"height",value:function(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}},{key:"targets",value:function(){return dr('svg textpath [href*="'+this.id()+'"]')}}]),e}();So.prototype.MorphArray=co,an({Container:{path:Gn(function(t){return this.put(new So).plot(t||new co)})}}),Bn(So,"Path");var To={array:function(){return this._array||(this._array=new Yr(this.attr("points")))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new Yr(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},size:function(t,e){var n=xn(this,t,e);return this.attr("points",this.array().size(n.width,n.height))}},Eo=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("polygon",t),t))}return Ii(e,Ir),e}();an({Container:{polygon:Gn(function(t){return this.put(new Eo).plot(t||new Yr)})}}),Vn(Eo,Zr),Vn(Eo,To),Bn(Eo,"Polygon");var Ao=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("polyline",t),t))}return Ii(e,Ir),e}();an({Container:{polyline:Gn(function(t){return this.put(new Ao).plot(t||new Yr)})}}),Vn(Ao,Zr),Vn(Ao,To),Bn(Ao,"Polyline");var Co=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("rect",t),t))}return Ii(e,Ir),e}();Vn(Co,{rx:Er,ry:Ar}),an({Container:{rect:Gn(function(t,e){return this.put(new Co).size(t,e)})}}),Bn(Co,"Rect");function Lo(t){var e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}}function Po(){var t=An.window;return(t.performance||t.Date).now()}var Ro=function(){function t(){Cn(this,t),this._first=null,this._last=null}return gi(t,[{key:"push",value:function(t){var e=t.next?t:{value:t,next:null,prev:null};return this._last?(e.prev=this._last,this._last.next=e,this._last=e):(this._last=e,this._first=e),e}},{key:"shift",value:function(){var t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}},{key:"first",value:function(){return this._first&&this._first.value}},{key:"last",value:function(){return this._last&&this._last.value}},{key:"remove",value:function(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}}]),t}(),Oo={nextDraw:null,frames:new Ro,timeouts:new Ro,immediates:new Ro,timer:function(){return An.window.performance||An.window.Date},transforms:[],frame:function(t){var e=Oo.frames.push({run:t});return null===Oo.nextDraw&&(Oo.nextDraw=An.window.requestAnimationFrame(Oo._draw)),e},timeout:function(t,e){e=e||0;var n=Oo.timer().now()+e,i=Oo.timeouts.push({run:t,time:n});return null===Oo.nextDraw&&(Oo.nextDraw=An.window.requestAnimationFrame(Oo._draw)),i},immediate:function(t){var e=Oo.immediates.push(t);return null===Oo.nextDraw&&(Oo.nextDraw=An.window.requestAnimationFrame(Oo._draw)),e},cancelFrame:function(t){null!=t&&Oo.frames.remove(t)},clearTimeout:function(t){null!=t&&Oo.timeouts.remove(t)},cancelImmediate:function(t){null!=t&&Oo.immediates.remove(t)},_draw:function(t){for(var e=null,n=Oo.timeouts.last();(e=Oo.timeouts.shift())&&(t>=e.time?e.run():Oo.timeouts.push(e),e!==n););for(var i=null,r=Oo.frames.last();i!==r&&(i=Oo.frames.shift());)i.run(t);for(var o=null;o=Oo.immediates.shift();)o();Oo.nextDraw=Oo.timeouts.first()||Oo.frames.first()?An.window.requestAnimationFrame(Oo._draw):null}},ko=function(){function n(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Po;return Cn(this,n),(t=Ri(this,Oi(n).call(this)))._timeSource=e,t._startTime=0,t._speed=1,t._persist=0,t._nextFrame=null,t._paused=!0,t._runners=[],t._runnerIds=[],t._lastRunnerId=-1,t._time=0,t._lastSourceTime=0,t._lastStepTime=0,t._step=t._stepFn.bind(Pi(Pi(t)),!1),t._stepImmediate=t._stepFn.bind(Pi(Pi(t)),!0),t}return Ii(n,fr),gi(n,[{key:"schedule",value:function(t,e,n){if(null==t)return this._runners.map(Lo);var i=0,r=this.getEndTime();if(e=e||0,null==n||"last"===n||"after"===n)i=r;else if("absolute"===n||"start"===n)i=e,e=0;else if("now"===n)i=this._time;else{if("relative"!==n)throw new Error('Invalid value for the "when" parameter');var o=this._runners[t.id];o&&(i=o.start+e,e=0)}t.unschedule(),t.timeline(this);var a=t.persist(),s={persist:null===a?this._persist:a,start:i+e,runner:t};return this._lastRunnerId=t.id,this._runners.push(s),this._runners.sort(function(t,e){return t.start-e.start}),this._runnerIds=this._runners.map(function(t){return t.runner.id}),this.updateTime()._continue(),this}},{key:"unschedule",value:function(t){var e=this._runnerIds.indexOf(t.id);return e<0||(this._runners.splice(e,1),this._runnerIds.splice(e,1),t.timeline(null)),this}},{key:"getEndTime",value:function(){var t=this._runners[this._runnerIds.indexOf(this._lastRunnerId)],e=t?t.runner.duration():0;return(t?t.start:0)+e}},{key:"getEndTimeOfTimeline",value:function(){for(var t=0,e=0;e<this._runners.length;e++){var n=this._runners[e],i=n?n.runner.duration():0,r=(n?n.start:0)+i;t<r&&(t=r)}return t}},{key:"updateTime",value:function(){return this.active()||(this._lastSourceTime=this._timeSource()),this}},{key:"play",value:function(){return this._paused=!1,this.updateTime()._continue()}},{key:"pause",value:function(){return this._paused=!0,this._continue()}},{key:"stop",value:function(){return this.time(0),this.pause()}},{key:"finish",value:function(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}},{key:"speed",value:function(t){return null==t?this._speed:(this._speed=t,this)}},{key:"reverse",value:function(t){var e=this.speed();if(null==t)return this.speed(-e);var n=Math.abs(e);return this.speed(t?n:-n)}},{key:"seek",value:function(t){return this.time(this._time+t)}},{key:"time",value:function(t){return null==t?this._time:(this._time=t,this._continue(!0))}},{key:"persist",value:function(t){return null==t?this._persist:(this._persist=t,this)}},{key:"source",value:function(t){return null==t?this._timeSource:(this._timeSource=t,this)}},{key:"_stepFn",value:function(t){var e=0<arguments.length&&void 0!==t&&t,n=this._timeSource(),i=n-this._lastSourceTime;e&&(i=0);var r=this._speed*i+(this._time-this._lastStepTime);this._lastSourceTime=n,e||(this._time+=r,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(var o=this._runners.length;o--;){var a=this._runners[o],s=a.runner;this._time-a.start<=0&&s.reset()}for(var h=!1,l=0,c=this._runners.length;l<c;l++){var u=this._runners[l],p=u.runner,d=r,f=this._time-u.start;if(f<=0)h=!0;else if(f<d&&(d=f),p.active())if(p.step(d).done){if(!0!==u.persist){p.duration()-p.time()+this._time+u.persist<this._time&&(p.unschedule(),--l,--c)}}else h=!0}return h&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&0<this._time?this._continue():(this.pause(),this.fire("finished")),this}},{key:"_continue",value:function(t){var e=0<arguments.length&&void 0!==t&&t;return Oo.cancelFrame(this._nextFrame),this._nextFrame=null,e?this._stepImmediate():(this._paused||(this._nextFrame=Oo.frame(this._step)),this)}},{key:"active",value:function(){return!!this._nextFrame}}]),n}();an({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new ko,this._timeline):(this._timeline=t,this)}}});var zo=function(){function o(t){var e;return Cn(this,o),(e=Ri(this,Oi(o).call(this))).id=o.id++,t="function"==typeof(t=null==t?vr.duration:t)?new ao(t):t,e._element=null,e._timeline=null,e.done=!1,e._queue=[],e._duration="number"==typeof t&&t,e._isDeclarative=t instanceof ao,e._stepper=e._isDeclarative?t:new oo,e._history={},e.enabled=!0,e._time=0,e._lastTime=0,e._reseted=!0,e.transforms=new or,e.transformId=1,e._haveReversed=!1,e._reverse=!1,e._loopsDone=0,e._swing=!1,e._wait=0,e._times=1,e._frameId=null,e._persist=!!e._isDeclarative||null,e}return Ii(o,fr),gi(o,[{key:"element",value:function(t){return null==t?this._element:((this._element=t)._prepareRunner(),this)}},{key:"timeline",value:function(t){return void 0===t?this._timeline:(this._timeline=t,this)}},{key:"animate",value:function(t,e,n){var i=o.sanitise(t,e,n),r=new o(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(e,n)}},{key:"schedule",value:function(t,e,n){if(t instanceof ko||(n=e,e=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,e,n),this}},{key:"unschedule",value:function(){var t=this.timeline();return t&&t.unschedule(this),this}},{key:"loop",value:function(t,e,n){return"object"===it(t)&&(e=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=e||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}},{key:"delay",value:function(t){return this.animate(0,t)}},{key:"queue",value:function(t,e,n,i){return this._queue.push({initialiser:t||mr,runner:e||mr,retarget:n,isTransform:i,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}},{key:"during",value:function(t){return this.queue(null,t)}},{key:"after",value:function(t){return this.on("finished",t)}},{key:"time",value:function(t){if(null==t)return this._time;var e=t-this._time;return this.step(e),this}},{key:"duration",value:function(){return this._times*(this._wait+this._duration)-this._wait}},{key:"loops",value:function(t){var e=this._duration+this._wait;if(null==t){var n=Math.floor(this._time/e),i=(this._time-n*e)/this._duration;return Math.min(n+i,this._times)}var r=t%1,o=e*Math.floor(t)+this._duration*r;return this.time(o)}},{key:"persist",value:function(t){return null==t?this._persist:(this._persist=t,this)}},{key:"position",value:function(t){var e,n=this._time,r=this._duration,o=this._wait,i=this._times,a=this._swing,s=this._reverse;if(null==t){var h=function(t){var e=a*Math.floor(t%(2*(o+r))/(o+r)),n=e&&!s||!e&&s,i=Math.pow(-1,n)*(t%(o+r))/r+n;return Math.max(Math.min(i,1),0)},l=i*(o+r)-o;return e=n<=0?Math.round(h(1e-5)):n<l?h(n):Math.round(h(l-1e-5)),e}var c=Math.floor(this.loops()),u=a&&c%2==0;return e=c+(u&&!s||s&&u?t:1-t),this.loops(e)}},{key:"progress",value:function(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}},{key:"step",value:function(t){if(!this.enabled)return this;t=null==t?16:t,this._time+=t;var e=this.position(),n=this._lastPosition!==e&&0<=this._time;this._lastPosition=e;var i=this.duration(),r=this._lastTime<=0&&0<this._time,o=this._lastTime<i&&this._time>=i;this._lastTime=this._time,r&&this.fire("start",this);var a=this._isDeclarative;if(this.done=!a&&!o&&this._time>=i,this._reseted=!1,n||a){this._initialise(n),this.transforms=new or;var s=this._run(a?t:e);this.fire("step",this)}return this.done=this.done||s&&a,o&&this.fire("finished",this),this}},{key:"reset",value:function(){return this._reseted||(this.time(0),this._reseted=!0),this}},{key:"finish",value:function(){return this.step(1/0)}},{key:"reverse",value:function(t){return this._reverse=null==t?!this._reverse:t,this}},{key:"ease",value:function(t){return this._stepper=new oo(t),this}},{key:"active",value:function(t){return null==t?this.enabled:(this.enabled=t,this)}},{key:"_rememberMorpher",value:function(t,e){if(this._history[t]={morpher:e,caller:this._queue[this._queue.length-1]},this._isDeclarative){var n=this.timeline();n&&n.play()}}},{key:"_tryRetarget",value:function(t,e,n){if(this._history[t]){if(!this._history[t].caller.initialised){var i=this._queue.indexOf(this._history[t].caller);return this._queue.splice(i,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget(e,n):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;var r=this.timeline();return r&&r.play(),!0}return!1}},{key:"_initialise",value:function(t){if(t||this._isDeclarative)for(var e=0,n=this._queue.length;e<n;++e){var i=this._queue[e],r=this._isDeclarative||!i.initialised&&t;t=!i.finished,r&&t&&(i.initialiser.call(this),i.initialised=!0)}}},{key:"_run",value:function(t){for(var e=!0,n=0,i=this._queue.length;n<i;++n){var r=this._queue[n],o=r.runner.call(this,t);r.finished=r.finished||!0===o,e=e&&r.finished}return e}},{key:"addTransform",value:function(t,e){return this.transforms.lmultiplyO(t),this}},{key:"clearTransform",value:function(){return this.transforms=new or,this}},{key:"clearTransformsFromQueue",value:function(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter(function(t){return!t.isTransform}))}}],[{key:"sanitise",value:function(t,e,n){var i=1,r=!1,o=0;return e=e||vr.delay,n=n||"last","object"!==it(t=t||vr.duration)||t instanceof ro||(e=t.delay||e,n=t.when||n,r=t.swing||r,i=t.times||i,o=t.wait||o,t=t.duration||vr.duration),{duration:t,delay:e,swing:r,times:i,wait:o,when:n}}}]),o}();zo.id=0;var Io=function(){function i(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new or,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1,n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];Cn(this,i),this.transforms=t,this.id=e,this.done=n}return gi(i,[{key:"clearTransformsFromQueue",value:function(){}}]),i}();Vn([zo,Io],{mergeWith:function(t){return new Io(t.transforms.lmultiply(this.transforms),t.id)}});function Do(t,e){return t.lmultiplyO(e)}function Bo(t){return t.transforms}var No=function(){function t(){Cn(this,t),this.runners=[],this.ids=[]}return gi(t,[{key:"add",value:function(t){if(!this.runners.includes(t)){var e=t.id+1;return this.runners.push(t),this.ids.push(e),this}}},{key:"getByID",value:function(t){return this.runners[this.ids.indexOf(t+1)]}},{key:"remove",value:function(t){var e=this.ids.indexOf(t+1);return this.ids.splice(e,1),this.runners.splice(e,1),this}},{key:"merge",value:function(){var n=this,i=null;return this.runners.forEach(function(t,e){!(i&&t.done&&i.done)||t._timeline&&t._timeline._runnerIds.includes(t.id)||i._timeline&&i._timeline._runnerIds.includes(i.id)||(n.remove(t.id),n.edit(i.id,t.mergeWith(i))),i=t}),this}},{key:"edit",value:function(t,e){var n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,e),this}},{key:"length",value:function(){return this.ids.length}},{key:"clearBefore",value:function(t){var e=this.ids.indexOf(t+1)||1;return this.ids.splice(0,e,0),this.runners.splice(0,e,new Io).forEach(function(t){return t.clearTransformsFromQueue()}),this}}]),t}();an({Element:{animate:function(t,e,n){var i=zo.sanitise(t,e,n),r=this.timeline();return new zo(i.duration).loop(i).element(this).timeline(r.play()).schedule(e,n)},delay:function(t,e){return this.animate(0,t,e)},_clearTransformRunnersBefore:function(t){this._transformationRunners.clearBefore(t.id)},_currentTransform:function(e){return this._transformationRunners.runners.filter(function(t){return t.id<=e.id}).map(Bo).reduce(Do,new or)},_addRunner:function(t){this._transformationRunners.add(t),Oo.cancelImmediate(this._frameId),this._frameId=Oo.immediate(function(){var t=this._transformationRunners.runners.map(Bo).reduce(Do,new or);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}.bind(this))},_prepareRunner:function(){null==this._frameId&&(this._transformationRunners=(new No).add(new Io(new or(this))))}}}),Vn(zo,{attr:function(t,e){return this.styleAttr("attr",t,e)},css:function(t,e){return this.styleAttr("css",t,e)},styleAttr:function(e,n,t){if("object"===it(n)){for(var i in n)this.styleAttr(e,i,n[i]);return this}var r=new go(this._stepper).to(t);return this.queue(function(){r=r.from(this.element()[e](n))},function(t){return this.element()[e](n,r.at(t)),r.done()}),this},zoom:function(t,n){if(this._tryRetarget("zoom",Vr,n))return this;var i=new go(this._stepper).to(new br(t));return this.queue(function(){i=i.from(this.element().zoom())},function(t){return this.element().zoom(i.at(t),n),i.done()},function(t,e){n=e,i.to(t)}),this._rememberMorpher("zoom",i),this},transform:function(d,f,m){if(f=d.relative||f,this._isDeclarative&&!f&&this._tryRetarget("transform",d))return this;var v=or.isMatrixLike(d);m=null!=d.affine?d.affine:null!=m?m:!v;var g,y,x,b,w,_=new go(this._stepper).type(m?xo:or);return this.queue(function(){y=y||this.element(),g=g||bn(d,y),w=new or(f?void 0:y),y._addRunner(this),f||y._clearTransformRunnersBefore(this)},function(t){f||this.clearTransform();var e=new ir(g).transform(y._currentTransform(this)),n=e.x,i=e.y,r=new or(Tr({},d,{origin:[n,i]})),o=this._isDeclarative&&x?x:w;if(m){r=r.decompose(n,i),o=o.decompose(n,i);var a=r.rotate,s=o.rotate,h=[a-360,a,a+360],l=h.map(function(t){return Math.abs(t-s)}),c=Math.min.apply(Math,re(l)),u=l.indexOf(c);r.rotate=h[u]}f&&(v||(r.rotate=d.rotate||0),this._isDeclarative&&b&&(o.rotate=b)),_.from(o),_.to(r);var p=_.at(t);return b=p.rotate,x=new or(p),this.addTransform(x),y._addRunner(this),_.done()},function(t){(t.origin||"center").toString()!==(d.origin||"center").toString()&&(g=bn(d,y)),d=Tr({},t,{origin:g})},!0),this._isDeclarative&&this._rememberMorpher("transform",_),this},x:function(t,e){return this._queueNumber("x",t)},y:function(t){return this._queueNumber("y",t)},dx:function(t){return this._queueNumberDelta("x",t)},dy:function(t){return this._queueNumberDelta("y",t)},_queueNumberDelta:function(e,t){if(t=new br(t),this._tryRetarget(e,t))return this;var n=new go(this._stepper).to(t),i=null;return this.queue(function(){i=this.element()[e](),n.from(i),n.to(i+t)},function(t){return this.element()[e](n.at(t)),n.done()},function(t){n.to(i+new br(t))}),this._rememberMorpher(e,n),this},_queueObject:function(e,t){if(this._tryRetarget(e,t))return this;var n=new go(this._stepper).to(t);return this.queue(function(){n.from(this.element()[e]())},function(t){return this.element()[e](n.at(t)),n.done()}),this._rememberMorpher(e,n),this},_queueNumber:function(t,e){return this._queueObject(t,new br(e))},cx:function(t){return this._queueNumber("cx",t)},cy:function(t){return this._queueNumber("cy",t)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},size:function(t,e){var n;return t&&e||(n=this._element.bbox()),t=t||n.width/n.height*e,e=e||n.height/n.width*t,this.width(t).height(e)},width:function(t){return this._queueNumber("width",t)},height:function(t){return this._queueNumber("height",t)},plot:function(t,e,n,i){if(4===arguments.length)return this.plot([t,e,n,i]);if(this._tryRetarget("plot",t))return this;var r=new go(this._stepper).type(this._element.MorphArray).to(t);return this.queue(function(){r.from(this._element.array())},function(t){return this._element.plot(r.at(t)),r.done()}),this._rememberMorpher("plot",r),this},leading:function(t){return this._queueNumber("leading",t)},viewbox:function(t,e,n,i){return this._queueObject("viewbox",new hr(t,e,n,i))},update:function(t,e,n){return"object"!==it(t)?this.update({offset:t,color:e,opacity:n}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),Vn(zo,{rx:Er,ry:Ar,from:jr,to:Vr}),Bn(zo,"Runner");var Fo=function(){function n(t){var e;return Cn(this,n),(e=Ri(this,Oi(n).call(this,zn("svg",t),t))).namespace(),e}return Ii(n,Br),gi(n,[{key:"isRoot",value:function(){return!(this.node.parentNode&&this.node.parentNode instanceof An.window.SVGElement&&"#document"!==this.node.parentNode.nodeName)}},{key:"root",value:function(){return this.isRoot()?this:ki(Oi(n.prototype),"root",this).call(this)}},{key:"namespace",value:function(){return this.isRoot()?this.attr({xmlns:_n,version:"1.1"}).attr("xmlns:xlink",Sn,Mn).attr("xmlns:svgjs",Tn,Mn):this.root().namespace()}},{key:"defs",value:function(){return this.isRoot()?In(this.node.querySelector("defs"))||this.put(new Nr):this.root().defs()}},{key:"parent",value:function(t){return this.isRoot()?"#document"===this.node.parentNode.nodeName?null:In(this.node.parentNode):ki(Oi(n.prototype),"parent",this).call(this,t)}},{key:"clear",value:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this}}]),n}();an({Container:{nested:Gn(function(){return this.put(new Fo)})}}),Bn(Fo,"Svg",!0);var Uo=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("symbol",t),t))}return Ii(e,Br),e}();an({Container:{symbol:Gn(function(){return this.put(new Uo)})}}),Bn(Uo,"Symbol");var jo={plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(An.document.createTextNode(t)),this},length:function(){return this.node.getComputedTextLength()}},Vo=function(){function n(t){var e;return Cn(this,n),(e=Ri(this,Oi(n).call(this,zn("text",t),t))).dom.leading=new br(1.3),e._rebuild=!0,e._build=!1,e}return Ii(n,Ir),gi(n,[{key:"x",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:this.bbox();return null==t?n.x:this.attr("x",this.attr("x")+t-n.x)}},{key:"y",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:this.bbox();return null==t?n.y:this.attr("y",this.attr("y")+t-n.y)}},{key:"move",value:function(t,e,n){var i=2<arguments.length&&void 0!==n?n:this.bbox();return this.x(t,i).y(e,i)}},{key:"cx",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:this.bbox();return null==t?n.cx:this.attr("x",this.attr("x")+t-n.cx)}},{key:"cy",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:this.bbox();return null==t?n.cy:this.attr("y",this.attr("y")+t-n.cy)}},{key:"center",value:function(t,e,n){var i=2<arguments.length&&void 0!==n?n:this.bbox();return this.cx(t,i).cy(e,i)}},{key:"text",value:function(t){if(void 0===t){var e=this.node.childNodes,n=0;t="";for(var i=0,r=e.length;i<r;++i)"textPath"!==e[i].nodeName?(i!==n&&3!==e[i].nodeType&&!0===In(e[i]).dom.newLined&&(t+="\n"),t+=e[i].textContent):0===i&&(n=1);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(var o=0,a=(t=t.split("\n")).length;o<a;o++)this.tspan(t[o]).newLine();return this.build(!1).rebuild()}},{key:"leading",value:function(t){return null==t?this.dom.leading:(this.dom.leading=new br(t),this.rebuild())}},{key:"rebuild",value:function(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){var n=this,i=0,r=this.dom.leading;this.each(function(){var t=An.window.getComputedStyle(this.node).getPropertyValue("font-size"),e=r*new br(t);this.dom.newLined&&(this.attr("x",n.attr("x")),"\n"===this.text()?i+=e:(this.attr("dy",e+i),i=0))}),this.fire("rebuild")}return this}},{key:"build",value:function(t){return this._build=!!t,this}},{key:"setData",value:function(t){return this.dom=t,this.dom.leading=new br(t.leading||1.3),this}}]),n}();Vn(Vo,jo),an({Container:{text:Gn(function(t){return this.put(new Vo).text(t)}),plain:Gn(function(t){return this.put(new Vo).plain(t)})}}),Bn(Vo,"Text");var Go=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("tspan",t),t))}return Ii(e,Vo),gi(e,[{key:"text",value:function(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?t.call(this,this):this.plain(t),this)}},{key:"dx",value:function(t){return this.attr("dx",t)}},{key:"dy",value:function(t){return this.attr("dy",t)}},{key:"x",value:function(t){return this.attr("x",t)}},{key:"y",value:function(t){return this.attr("x",t)}},{key:"move",value:function(t,e){return this.x(t).y(e)}},{key:"newLine",value:function(){var t=this.parent(Vo);this.dom.newLined=!0;var e=An.window.getComputedStyle(this.node).getPropertyValue("font-size"),n=t.dom.leading*new br(e);return this.dy(n).attr("x",t.x())}}]),e}();Vn(Go,jo),an({Tspan:{tspan:Gn(function(t){var e=new Go;return this._build||this.clear(),this.node.appendChild(e.node),e.text(t)})}}),Bn(Go,"Tspan");var Ho=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("clipPath",t),t))}return Ii(e,Br),gi(e,[{key:"remove",value:function(){return this.targets().forEach(function(t){t.unclip()}),ki(Oi(e.prototype),"remove",this).call(this)}},{key:"targets",value:function(){return dr('svg [clip-path*="'+this.id()+'"]')}}]),e}();an({Container:{clip:Gn(function(){return this.defs().put(new Ho)})},Element:{clipWith:function(t){var e=t instanceof Ho?t:this.parent().clip().add(t);return this.attr("clip-path",'url("#'+e.id()+'")')},unclip:function(){return this.attr("clip-path",null)},clipper:function(){return this.reference("clip-path")}}}),Bn(Ho,"ClipPath");var Wo=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("foreignObject",t),t))}return Ii(e,Mr),e}();an({Container:{foreignObject:Gn(function(t,e){return this.put(new Wo).size(t,e)})}}),Bn(Wo,"ForeignObject");var qo=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("g",t),t))}return Ii(e,Br),gi(e,[{key:"x",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:this.bbox();return null==t?n.x:this.move(t,n.y,n)}},{key:"y",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:this.bbox();return null==t?n.y:this.move(n.x,t,n)}},{key:"move",value:function(t,e,n){var i=0<arguments.length&&void 0!==t?t:0,r=1<arguments.length&&void 0!==e?e:0,o=2<arguments.length&&void 0!==n?n:this.bbox(),a=i-o.x,s=r-o.y;return this.dmove(a,s)}},{key:"dx",value:function(t){return this.dmove(t,0)}},{key:"dy",value:function(t){return this.dmove(0,t)}},{key:"dmove",value:function(a,s){return this.children().forEach(function(t,e){var n=t.bbox(),i=new or(t),r=i.translate(a,s).transform(i.inverse()),o=new ir(n.x,n.y).transform(r);t.move(o.x,o.y)}),this}},{key:"width",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:this.bbox();return null==t?n.width:this.size(t,n.height,n)}},{key:"height",value:function(t,e){var n=1<arguments.length&&void 0!==e?e:this.bbox();return null==t?n.height:this.size(n.width,t,n)}},{key:"size",value:function(t,e,n){var i=2<arguments.length&&void 0!==n?n:this.bbox(),r=xn(this,t,e,i),o=r.width/i.width,a=r.height/i.height;return this.children().forEach(function(t,e){var n=new ir(i).transform(new or(t).inverse());t.scale(o,a,n.x,n.y)}),this}}]),e}();an({Container:{group:Gn(function(){return this.put(new qo)})}}),Bn(qo,"G");var Xo=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("a",t),t))}return Ii(e,Br),gi(e,[{key:"to",value:function(t){return this.attr("href",t,Sn)}},{key:"target",value:function(t){return this.attr("target",t)}}]),e}();an({Container:{link:Gn(function(t){return this.put(new Xo).to(t)})},Element:{linkTo:function(t){var e=new Xo;return"function"==typeof t?t.call(e,e):e.to(t),this.parent().put(e).put(this)}}}),Bn(Xo,"A");var Yo=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("mask",t),t))}return Ii(e,Br),gi(e,[{key:"remove",value:function(){return this.targets().forEach(function(t){t.unmask()}),ki(Oi(e.prototype),"remove",this).call(this)}},{key:"targets",value:function(){return dr('svg [mask*="'+this.id()+'"]')}}]),e}();an({Container:{mask:Gn(function(){return this.defs().put(new Yo)})},Element:{maskWith:function(t){var e=t instanceof Yo?t:this.parent().mask().add(t);return this.attr("mask",'url("#'+e.id()+'")')},unmask:function(){return this.attr("mask",null)},masker:function(){return this.reference("mask")}}}),Bn(Yo,"Mask");var Zo=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("style",t),t))}return Ii(e,Mr),gi(e,[{key:"addText",value:function(t){var e=0<arguments.length&&void 0!==t?t:"";return this.node.textContent+=e,this}},{key:"font",value:function(t,e,n){var i=2<arguments.length&&void 0!==n?n:{};return this.rule("@font-face",Tr({fontFamily:t,src:e},i))}},{key:"rule",value:function(t,e){return this.addText(function(t,e){if(!t)return"";if(!e)return t;var n=t+"{";for(var i in e)n+=gn(i)+":"+e[i]+";";return n+="}"}(t,e))}}]),e}();an("Dom",{style:Gn(function(t,e){return this.put(new Zo).rule(t,e)}),fontface:Gn(function(t,e,n){return this.put(new Zo).font(t,e,n)})}),Bn(Zo,"Style");var Jo=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("textPath",t),t))}return Ii(e,Vo),gi(e,[{key:"array",value:function(){var t=this.track();return t?t.array():null}},{key:"plot",value:function(t){var e=this.track(),n=null;return e&&(n=e.plot(t)),null==t?n:this}},{key:"track",value:function(){return this.reference("href")}}]),e}();an({Container:{textPath:Gn(function(t,e){return t instanceof Vo||(t=this.text(t)),t.path(e)})},Text:{path:Gn(function(t){var e,n=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],i=new Jo;if(t instanceof So||(t=this.defs().path(t)),i.attr("href","#"+t,Sn),n)for(;e=this.node.firstChild;)i.node.appendChild(e);return this.put(i)}),textPath:function(){return this.findOne("textPath")}},Path:{text:Gn(function(t){return t instanceof Vo||(t=(new Vo).addTo(this.parent()).text(t)),t.path(this)}),targets:function(){return dr('svg [href*="'+this.id()+'"]')}}}),Jo.prototype.MorphArray=co,Bn(Jo,"TextPath");var Ko=function(){function e(t){return Cn(this,e),Ri(this,Oi(e).call(this,zn("use",t),t))}return Ii(e,Ir),gi(e,[{key:"element",value:function(t,e){return this.attr("href",(e||"")+"#"+t,Sn)}}]),e}();an({Container:{use:Gn(function(t,e){return this.put(new Ko).element(t,e)})}}),Bn(Ko,"Use");var Qo=kn;Vn([Fo,Uo,Xr,Wr,Kr],sn("viewbox")),Vn([Jr,Ao,Eo,So],sn("marker")),Vn(Vo,sn("Text")),Vn(So,sn("Path")),Vn(Nr,sn("Defs")),Vn([Vo,Go],sn("Tspan")),Vn([Co,Fr,Dr,Hr],sn("radius")),Vn(fr,sn("EventTarget")),Vn(_r,sn("Dom")),Vn(Mr,sn("Element")),Vn(Ir,sn("Shape")),Vn(Br,sn("Container")),Vn(zo,sn("Runner")),ur.extend(re(new Set(on))),_o([br,Li,hr,or,xr,Yr,co]),Mo();var $o={Morphable:go,registerMorphableType:_o,makeMorphable:Mo,TransformBag:xo,ObjectBag:bo,NonMorphable:yo,defaults:yr,utils:wn,namespaces:En,regex:si,SVG:Qo,parser:ar,find:dr,registerWindow:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;An.window=t,An.document=e},Animator:Oo,Controller:ao,Ease:oo,PID:lo,Spring:ho,easing:io,Queue:Ro,Runner:zo,Timeline:ko,Array:xr,Box:hr,Color:Li,EventTarget:fr,Matrix:or,Number:br,PathArray:co,Point:ir,PointArray:Yr,List:ur,Circle:Dr,ClipPath:Ho,Container:Br,Defs:Nr,Dom:_r,Element:Mr,Ellipse:Fr,ForeignObject:Wo,Gradient:Hr,G:qo,A:Xo,Image:Xr,Line:Jr,Marker:Kr,Mask:Yo,Path:So,Pattern:Wr,Polygon:Eo,Polyline:Ao,Rect:Co,Shape:Ir,Stop:Ur,Style:Zo,Svg:Fo,Symbol:Uo,Text:Vo,TextPath:Jo,Tspan:Go,Use:Ko,on:pi,off:di,dispatch:fi,root:Rn,create:On,makeInstance:kn,nodeOrNew:zn,adopt:In,mockAdopt:function(){Dn=0<arguments.length&&void 0!==arguments[0]?arguments[0]:In},register:Bn,getClass:Nn,eid:Un,assignNewId:jn,extend:Vn,wrapWithAttrCheck:Gn,invent:function(e){var t="function"==typeof e.create?e.create:function(t){this.constructor(t||On(e.create))};return e.inherit&&(t.prototype=new e.inherit,t.prototype.constructor=t),e.extend&&Vn(t,e.extend),e.construct&&Vn(e.parent||Pn.Container,e.construct),t}};function ta(t){return kn(t)}Object.assign(ta,$o)}(),function(t){var e,n,i=t.split("");for(e=0,n=i.length;e<n;e++)i[e]=(255&i[e].charCodeAt(0))>>>0;return i});function md(t,e){switch(this.buffer,this.blocks=[],this.bufferSize=32768,this.totalpos=0,this.ip=0,this.bitsbuf=0,this.bitsbuflen=0,this.input=wd?new Uint8Array(t):t,this.output,this.op,this.bfinal=!1,this.bufferType=md.BufferType.ADAPTIVE,this.resize=!1,(e||(e={},0))&&(e.index&&(this.ip=e.index),e.bufferSize&&(this.bufferSize=e.bufferSize),e.bufferType&&(this.bufferType=e.bufferType),e.resize&&(this.resize=e.resize)),this.bufferType){case md.BufferType.BLOCK:this.op=md.MaxBackwardLength,this.output=new(wd?Uint8Array:Array)(md.MaxBackwardLength+this.bufferSize+md.MaxCopyLength);break;case md.BufferType.ADAPTIVE:this.op=0,this.output=new(wd?Uint8Array:Array)(this.bufferSize),this.expandBuffer=this.expandBufferAdaptive,this.concatBuffer=this.concatBufferDynamic,this.decodeHuffman=this.decodeHuffmanAdaptive;break;default:throw new Error("invalid inflate mode")}}var vd,gd,yd,xd,bd,wd="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView,_d=function(t){var e,n,i,r,o,a,s,h,l,c,u,p=t.length,d=0,f=Number.POSITIVE_INFINITY;for(h=0,l=p;h<l;++h)t[h]>d&&(d=t[h]),t[h]<f&&(f=t[h]);for(e=1<<d,n=new(wd?Uint32Array:Array)(e),i=1,r=0,o=2;i<=d;){for(h=0;h<p;++h)if(t[h]===i){for(s=r,c=a=0;c<i;++c)a=a<<1|1&s,s>>=1;for(u=i<<16|h,c=a;c<e;c+=o)n[c]=u;++r}++i,r<<=1,o<<=1}return[n,d,f]};md.BufferType={BLOCK:0,ADAPTIVE:1},md.prototype.decompress=function(){for(;!this.bfinal;)this.parseBlock();return this.concatBuffer()},md.MaxBackwardLength=32768,md.MaxCopyLength=258,md.Order=(vd=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],wd?new Uint16Array(vd):vd),md.LengthCodeTable=(gd=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],wd?new Uint16Array(gd):gd),md.LengthExtraTable=(yd=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],wd?new Uint8Array(yd):yd),md.DistCodeTable=(xd=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],wd?new Uint16Array(xd):xd),md.DistExtraTable=(bd=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],wd?new Uint8Array(bd):bd),md.FixedLiteralLengthTable=function(){var t,e,n=new(wd?Uint8Array:Array)(288);for(t=0,e=n.length;t<e;++t)n[t]=t<=143?8:t<=255?9:t<=279?7:8;return _d(n)}(),md.FixedDistanceTable=function(){var t,e,n=new(wd?Uint8Array:Array)(30);for(t=0,e=n.length;t<e;++t)n[t]=5;return _d(n)}(),md.prototype.parseBlock=function(){var t=this.readBits(3);switch(1&t&&(this.bfinal=!0),t>>>=1){case 0:this.parseUncompressedBlock();break;case 1:this.parseFixedHuffmanBlock();break;case 2:this.parseDynamicHuffmanBlock();break;default:throw new Error("unknown BTYPE: "+t)}},md.prototype.readBits=function(t){for(var e,n=this.bitsbuf,i=this.bitsbuflen,r=this.input,o=this.ip,a=r.length;i<t;){if(a<=o)throw new Error("input buffer is broken");n|=r[o++]<<i,i+=8}return e=n&(1<<t)-1,n>>>=t,i-=t,this.bitsbuf=n,this.bitsbuflen=i,this.ip=o,e},md.prototype.readCodeByTable=function(t){for(var e,n,i=this.bitsbuf,r=this.bitsbuflen,o=this.input,a=this.ip,s=o.length,h=t[0],l=t[1];r<l&&!(s<=a);)i|=o[a++]<<r,r+=8;if(r<(n=(e=h[i&(1<<l)-1])>>>16))throw new Error("invalid code length: "+n);return this.bitsbuf=i>>n,this.bitsbuflen=r-n,this.ip=a,65535&e},md.prototype.parseUncompressedBlock=function(){var t,e,n=this.input,i=this.ip,r=this.output,o=this.op,a=n.length,s=r.length;if(this.bitsbuf=0,this.bitsbuflen=0,a<=i+1)throw new Error("invalid uncompressed block header: LEN");if(t=n[i++]|n[i++]<<8,a<=i+1)throw new Error("invalid uncompressed block header: NLEN");if(t===~(n[i++]|n[i++]<<8))throw new Error("invalid uncompressed block header: length verify");if(i+t>n.length)throw new Error("input buffer is broken");switch(this.bufferType){case md.BufferType.BLOCK:for(;o+t>r.length;){if(t-=e=s-o,wd)r.set(n.subarray(i,i+e),o),o+=e,i+=e;else for(;e--;)r[o++]=n[i++];this.op=o,r=this.expandBuffer(),o=this.op}break;case md.BufferType.ADAPTIVE:for(;o+t>r.length;)r=this.expandBuffer({fixRatio:2});break;default:throw new Error("invalid inflate mode")}if(wd)r.set(n.subarray(i,i+t),o),o+=t,i+=t;else for(;t--;)r[o++]=n[i++];this.ip=i,this.op=o,this.output=r},md.prototype.parseFixedHuffmanBlock=function(){this.decodeHuffman(md.FixedLiteralLengthTable,md.FixedDistanceTable)},md.prototype.parseDynamicHuffmanBlock=function(){var t,e,n,i,r,o,a,s,h,l=this.readBits(5)+257,c=this.readBits(5)+1,u=this.readBits(4)+4,p=new(wd?Uint8Array:Array)(md.Order.length);for(s=0;s<u;++s)p[md.Order[s]]=this.readBits(3);if(!wd)for(s=u,u=p.length;s<u;++s)p[md.Order[s]]=0;for(t=_d(p),i=new(wd?Uint8Array:Array)(l+c),s=0,h=l+c;s<h;)switch(r=this.readCodeByTable(t)){case 16:for(a=3+this.readBits(2);a--;)i[s++]=o;break;case 17:for(a=3+this.readBits(3);a--;)i[s++]=0;o=0;break;case 18:for(a=11+this.readBits(7);a--;)i[s++]=0;o=0;break;default:o=i[s++]=r}e=_d(wd?i.subarray(0,l):i.slice(0,l)),n=_d(wd?i.subarray(l):i.slice(l)),this.decodeHuffman(e,n)},md.prototype.decodeHuffman=function(t,e){var n=this.output,i=this.op;this.currentLitlenTable=t;for(var r,o,a,s,h=n.length-md.MaxCopyLength;256!==(r=this.readCodeByTable(t));)if(r<256)h<=i&&(this.op=i,n=this.expandBuffer(),i=this.op),n[i++]=r;else for(s=md.LengthCodeTable[o=r-257],0<md.LengthExtraTable[o]&&(s+=this.readBits(md.LengthExtraTable[o])),r=this.readCodeByTable(e),a=md.DistCodeTable[r],0<md.DistExtraTable[r]&&(a+=this.readBits(md.DistExtraTable[r])),h<=i&&(this.op=i,n=this.expandBuffer(),i=this.op);s--;)n[i]=n[i++-a];for(;8<=this.bitsbuflen;)this.bitsbuflen-=8,this.ip--;this.op=i},md.prototype.decodeHuffmanAdaptive=function(t,e){var n=this.output,i=this.op;this.currentLitlenTable=t;for(var r,o,a,s,h=n.length;256!==(r=this.readCodeByTable(t));)if(r<256)h<=i&&(h=(n=this.expandBuffer()).length),n[i++]=r;else for(s=md.LengthCodeTable[o=r-257],0<md.LengthExtraTable[o]&&(s+=this.readBits(md.LengthExtraTable[o])),r=this.readCodeByTable(e),a=md.DistCodeTable[r],0<md.DistExtraTable[r]&&(a+=this.readBits(md.DistExtraTable[r])),h<i+s&&(h=(n=this.expandBuffer()).length);s--;)n[i]=n[i++-a];for(;8<=this.bitsbuflen;)this.bitsbuflen-=8,this.ip--;this.op=i},md.prototype.expandBuffer=function(t){var e,n,i=new(wd?Uint8Array:Array)(this.op-md.MaxBackwardLength),r=this.op-md.MaxBackwardLength,o=this.output;if(wd)i.set(o.subarray(md.MaxBackwardLength,i.length));else for(e=0,n=i.length;e<n;++e)i[e]=o[e+md.MaxBackwardLength];if(this.blocks.push(i),this.totalpos+=i.length,wd)o.set(o.subarray(r,r+md.MaxBackwardLength));else for(e=0;e<md.MaxBackwardLength;++e)o[e]=o[r+e];return this.op=md.MaxBackwardLength,o},md.prototype.expandBufferAdaptive=function(t){var e,n,i,r=this.input.length/this.ip+1|0,o=this.input,a=this.output;return t&&("number"==typeof t.fixRatio&&(r=t.fixRatio),"number"==typeof t.addRatio&&(r+=t.addRatio)),n=r<2?(i=(o.length-this.ip)/this.currentLitlenTable[2]/2*258|0)<a.length?a.length+i:a.length<<1:a.length*r,wd?(e=new Uint8Array(n)).set(a):e=a,this.output=e,this.output},md.prototype.concatBuffer=function(){var t,e,n,i,r,o=0,a=this.totalpos+(this.op-md.MaxBackwardLength),s=this.output,h=this.blocks,l=new(wd?Uint8Array:Array)(a);if(0===h.length)return wd?this.output.subarray(md.MaxBackwardLength,this.op):this.output.slice(md.MaxBackwardLength,this.op);for(e=0,n=h.length;e<n;++e)for(i=0,r=(t=h[e]).length;i<r;++i)l[o++]=t[i];for(e=md.MaxBackwardLength,n=this.op;e<n;++e)l[o++]=s[e];return this.blocks=[],this.buffer=l,this.buffer},md.prototype.concatBufferDynamic=function(){var t,e=this.op;return wd?this.resize?(t=new Uint8Array(e)).set(this.output.subarray(0,e)):t=this.output.subarray(0,e):(this.output.length>e&&(this.output.length=e),t=this.output),this.buffer=t,this.buffer};function Md(t,e){var n,i;switch(this.input=t,this.ip=0,this.rawinflate,this.verify,(e||(e={},0))&&(e.index&&(this.ip=e.index),e.verify&&(this.verify=e.verify)),n=t[this.ip++],i=t[this.ip++],15&n){case Sd:this.method=Sd;break;default:throw new Error("unsupported compression method")}if(((n<<8)+i)%31!=0)throw new Error("invalid fcheck flag:"+((n<<8)+i)%31);if(32&i)throw new Error("fdict flag is not supported");this.rawinflate=new md(t,{index:this.ip,bufferSize:e.bufferSize,bufferType:e.bufferType,resize:e.resize})}var Sd=8;function Td(t){this.manager=void 0!==t?t:Pl}function Ed(){var r={};return{get:function(t){return r[t]},add:function(t,e){r[t]=e},remove:function(t){delete r[t]},removeAll:function(){r={}},update:function(t,e){for(var n in r){var i=r[n];i.update&&i.update(t,e)}}}}Md.BufferType=md.BufferType,Md.prototype.decompress=function(){var t,e=this.input;if(t=this.rawinflate.decompress(),this.ip=this.rawinflate.ip,this.verify&&(e[this.ip++]<<24|e[this.ip++]<<16|e[this.ip++]<<8|e[this.ip++])>>>0!==function(t){return"string"==typeof t&&(t=fd(t)),function(t,e){for(var n,i=65535&t,r=t>>>16&65535,o=e.length,a=0;0<o;){for(o-=n=1024<o?1024:o;r+=i+=e[a++],--n;);i%=65521,r%=65521}return(r<<16|i)>>>0}(1,t)}(t))throw new Error("invalid adler-32 checksum");return t},Td.prototype={constructor:Td,crossOrigin:"Anonymous",load:function(t,e,n,i){var r=this,o=this.path&&"string"==typeof this.path?this.path:gc(t),a=new Ol(r.manager);a.setResponseType("arraybuffer"),a.load(t,function(t){try{r.parse(t,o,e,i)}catch(t){i(t.constructor===Error?t:new Error("OASLoader: Unable to parse model."))}},n,i)},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t},parse:function(t,e,o,n){var i,r={};if("oasis"===ef(new Uint8Array(t,0,5))){var a=new Md(new Uint8Array(t,5,t.byteLength-5)).decompress(),s=a.byteLength;t=a.buffer.slice(0,s)}var h=ef(new Uint8Array(t,0,4));i=h===Pd||h===Rd||h===Od?(r[Ad.KHR_BINARY_GLTF]=new Id(t),r[Ad.KHR_BINARY_GLTF].content):ef(new Uint8Array(t));var l=JSON.parse(i);void 0===l.asset||l.asset.version[0]<2?n(new Error("OAS: Unsupported asset. glTF versions >=2.0 are supported.")):(l.extensionsUsed&&(0<=l.extensionsUsed.indexOf(Ad.KHR_LIGHTS)&&(r[Ad.KHR_LIGHTS]=new Cd(l)),0<=l.extensionsUsed.indexOf(Ad.KHR_MATERIALS_COMMON)&&(r[Ad.KHR_MATERIALS_COMMON]=new Ld(l)),0<=l.extensionsUsed.indexOf(Ad.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)&&(r[Ad.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new Dd)),console.time("OASLoader"),new rf(l,r,{path:e||this.path,crossOrigin:this.crossOrigin}).parse(function(t,e,n,i){console.timeEnd("OASLoader");var r={scene:t,scenes:e,cameras:n,animations:i};o(r),r.scene=null,r.scenes=null,r.cameras=null,r.animations=null,r=null},n))}};var Ad={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_COMMON:"KHR_materials_common",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness"};function Cd(t){this.name=Ad.KHR_LIGHTS,this.lights={};var e=(t.extensions&&t.extensions[Ad.KHR_LIGHTS]||{}).lights||{};for(var n in e){var i,r=e[n],o=(new Jn).fromArray(r.color);switch(r.type){case"directional":(i=new dc(o)).position.set(0,0,1);break;case"point":i=new cc(o);break;case"spot":(i=new lc(o)).position.set(0,0,1);break;case"ambient":i=new fc(o)}i&&(void 0!==r.constantAttenuation&&(i.intensity=r.constantAttenuation),void 0!==r.linearAttenuation&&(i.distance=1/r.linearAttenuation),void 0!==r.quadraticAttenuation&&(i.decay=r.quadraticAttenuation),void 0!==r.fallOffAngle&&(i.angle=r.fallOffAngle),void 0!==r.fallOffExponent&&console.warn("OASLoader:: light.fallOffExponent not currently supported."),i.name=r.name||"light_"+n,this.lights[n]=i)}}function Ld(t){this.name=Ad.KHR_MATERIALS_COMMON}Ld.prototype.getMaterialType=function(t){switch(t.extensions[this.name].type){case"commonBlinn":case"commonPhong":return al;case"commonLambert":return ll;case"commonConstant":default:return no}},Ld.prototype.extendParams=function(t,e,n){var i=e.extensions[this.name],r=[],o=[];switch(i.type){case"commonBlinn":case"commonPhong":o.push("diffuseFactor","diffuseTexture","specularFactor","specularTexture","shininessFactor");break;case"commonLambert":o.push("diffuseFactor","diffuseTexture")}var a={};return o.forEach(function(t){void 0!==i[t]&&(a[t]=i[t])}),void 0!==a.diffuseFactor&&(t.color=(new Jn).fromArray(a.diffuseFactor),t.opacity=a.diffuseFactor[3]),void 0!==a.diffuseTexture&&r.push(n.assignTexture(t,"map",a.diffuseTexture.index)),void 0!==a.specularFactor&&(t.specular=(new Jn).fromArray(a.specularFactor)),void 0!==a.specularTexture&&r.push(n.assignTexture(t,"specularMap",a.specularTexture.index)),void 0!==a.shininessFactor&&(t.shininess=a.shininessFactor),Promise.all(r)};var Pd="ogdw",Rd="glTF",Od="sogd",kd=12,zd={JSON:1313821514,BIN:5130562};function Id(t){this.name=Ad.KHR_BINARY_GLTF,this.content=null,this.body=null;var e=new DataView(t,0,kd);if(this.header={magic:ef(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==Pd&&this.header.magic!==Rd&&this.header.magic!==Od)throw new Error("OASLoader: Unsupported header.");if(this.header.version<2)throw new Error("OASLoader: Legacy binary file detected.");for(var n=new DataView(t,kd),i=0;i<n.byteLength;){var r=n.getUint32(i,!0);i+=4;var o=n.getUint32(i,!0);if(i+=4,o===zd.JSON){var a=new Uint8Array(t,kd+i,r);this.content=ef(a)}else if(o===zd.BIN){var s=kd+i;this.body=t.slice(s,s+r)}i+=r}if(null===this.content)throw new Error("OASLoader: JSON content not found.")}function Dd(){return{name:Ad.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,getMaterialType:function(){return $r},extendParams:function(t,e,n){var i=e.extensions[this.name],r=ii.standard,o=Yn.clone(r.uniforms),a=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),s=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),h=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),l=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),c=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),u=r.fragmentShader.replace("#include <specularmap_fragment>","").replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",a).replace("#include <metalnessmap_pars_fragment>",s).replace("#include <roughnessmap_fragment>",h).replace("#include <metalnessmap_fragment>",l).replace("#include <lights_physical_fragment>",c);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new Jn).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},t.vertexShader=r.vertexShader,t.fragmentShader=u,t.uniforms=o,t.defines={STANDARD:""},t.color=new Jn(1,1,1),t.opacity=1;var p=[];if(Array.isArray(i.diffuseFactor)){var d=i.diffuseFactor;t.color.fromArray(d),t.opacity=d[3]}if(void 0!==i.diffuseTexture&&p.push(n.assignTexture(t,"map",i.diffuseTexture.index)),t.emissive=new Jn(0,0,0),t.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,t.specular=new Jn(1,1,1),Array.isArray(i.specularFactor)&&t.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var f=i.specularGlossinessTexture.index;p.push(n.assignTexture(t,"glossinessMap",f)),p.push(n.assignTexture(t,"specularMap",f))}return Promise.all(p)},createMaterial:function(t){var e=new $r({defines:t.defines,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,fog:!0,lights:!0,opacity:t.opacity,transparent:t.transparent});return e.isGLTFSpecularGlossinessMaterial=!0,e.color=t.color,e.map=void 0===t.map?null:t.map,e.lightMap=null,e.lightMapIntensity=1,e.aoMap=void 0===t.aoMap?null:t.aoMap,e.aoMapIntensity=1,e.emissive=t.emissive,e.emissiveIntensity=1,e.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,e.bumpMap=void 0===t.bumpMap?null:t.bumpMap,e.bumpScale=1,e.normalMap=void 0===t.normalMap?null:t.normalMap,e.normalScale=new Ze(1,1),e.displacementMap=null,e.displacementScale=1,e.displacementBias=0,e.specularMap=void 0===t.specularMap?null:t.specularMap,e.specular=t.specular,e.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,e.glossiness=t.glossiness,e.alphaMap=null,e.envMap=void 0===t.envMap?null:t.envMap,e.envMapIntensity=1,e.refractionRatio=.98,e.extensions.derivatives=!0,e},refreshUniforms:function(t,e,n,i,r,o){var a,s=r.uniforms,h=r.defines;if(s.opacity.value=r.opacity,s.diffuse.value.copy(r.color),s.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),s.map.value=r.map,s.specularMap.value=r.specularMap,s.alphaMap.value=r.alphaMap,s.lightMap.value=r.lightMap,s.lightMapIntensity.value=r.lightMapIntensity,s.aoMap.value=r.aoMap,s.aoMapIntensity.value=r.aoMapIntensity,r.map?a=r.map:r.specularMap?a=r.specularMap:r.displacementMap?a=r.displacementMap:r.normalMap?a=r.normalMap:r.bumpMap?a=r.bumpMap:r.glossinessMap?a=r.glossinessMap:r.alphaMap?a=r.alphaMap:r.emissiveMap&&(a=r.emissiveMap),void 0!==a){a.isWebGLRenderTarget&&(a=a.texture);var l=a.offset,c=a.repeat;s.offsetRepeat.value.set(l.x,l.y,c.x,c.y)}s.envMap.value=r.envMap,s.envMapIntensity.value=r.envMapIntensity,s.flipEnvMap.value=r.envMap&&r.envMap.isCubeTexture?-1:1,s.refractionRatio.value=r.refractionRatio,s.specular.value.copy(r.specular),s.glossiness.value=r.glossiness,s.glossinessMap.value=r.glossinessMap,s.emissiveMap.value=r.emissiveMap,s.bumpMap.value=r.bumpMap,s.normalMap.value=r.normalMap,s.displacementMap.value=r.displacementMap,s.displacementScale.value=r.displacementScale,s.displacementBias.value=r.displacementBias,null!==s.glossinessMap.value&&void 0===h.USE_GLOSSINESSMAP&&(h.USE_GLOSSINESSMAP="",h.USE_ROUGHNESSMAP=""),null===s.glossinessMap.value&&void 0!==h.USE_GLOSSINESSMAP&&(delete h.USE_GLOSSINESSMAP,delete h.USE_ROUGHNESSMAP)}}}var Bd=0,Nd=1,Fd=2,Ud=3,jd=4,Vd=5,Gd=6,Hd={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Wd={9728:kt,9729:Bt,9984:zt,9985:Nt,9986:Dt,9987:Ft},qd={33071:Rt,33648:Ot,10497:Pt},Xd={6406:Qt,6407:$t,6408:te,6409:ee,6410:ne},Yd={5121:Ut,32819:Yt,32820:Zt,33635:Jt},Zd={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Jd={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Kd={CATMULLROMSPLINE:Re,CUBICSPLINE:Re,LINEAR:Pe,STEP:Le},Qd="OPAQUE";function $d(t,e,n){if(!t)return Promise.resolve();var i,r=[];if("[object Array]"===Object.prototype.toString.call(t)){i=[];for(var o=t.length,a=0;a<o;a++){(h=e.call(n||this,t[a],a))&&(r.push(h),h instanceof Promise?h.then(function(t,e){i[t]=e}.bind(this,a)):i[a]=h)}}else for(var s in i={},t){var h;if(t.hasOwnProperty(s))(h=e.call(n||this,t[s],s))&&(r.push(h),h instanceof Promise?h.then(function(t,e){i[t]=e}.bind(this,s)):i[s]=h)}return Promise.all(r).then(function(){return i})}function tf(t,e){return"string"!=typeof t||""===t?"":/^(https?:)?\/\//i.test(t)?t:/^data:.*,.*$/i.test(t)?t:/^blob:.*$/i.test(t)?t:(e||"")+t}function ef(t){if(void 0!==window.TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,i=t.length;n<i;n++)e+=String.fromCharCode(t[n]);return e}function nf(t,e,n,i){var r=t.geometry,o=t.material,a=n.targets,s=r.morphAttributes;s.position=[],s.normal=[],o.morphTargets=!0;for(var h=0,l=a.length;h<l;h++){var c,u,p=a[h],d="morphTarget"+h;if(void 0!==p.POSITION){c=i.accessors[p.POSITION].clone();for(var f=r.attributes.position,m=0,v=c.count;m<v;m++)c.setXYZ(m,c.getX(m)+f.getX(m),c.getY(m)+f.getY(m),c.getZ(m)+f.getZ(m))}else c=r.attributes.position.clone();if(void 0!==p.NORMAL){o.morphNormals=!0,u=i.accessors[p.NORMAL].clone();var g=r.attributes.normal;for(m=0,v=u.count;m<v;m++)u.setXYZ(m,u.getX(m)+g.getX(m),u.getY(m)+g.getY(m),u.getZ(m)+g.getZ(m))}else u=r.attributes.normal.clone();p.TANGENT,c.name=d,u.name=d,s.position.push(c),s.normal.push(u)}if(t.updateMorphTargets(),void 0!==e.weights)for(h=0,l=e.weights.length;h<l;h++)t.morphTargetInfluences[h]=e.weights[h]}function rf(t,e,n){this.json=t||{},this.extensions=e||{},this.options=n||{},this.cache=new Ed,this.saveGeometry={}}function of(i,r){var o={_front:!1,_back:!1,_left:!1,_right:!1,_rotateLeft:!1,_rotateRight:!1},a=new Qe(-1,0,0),s=new Qe(0,0,1);this.start=function(){var t=new Nn;t.setFromObject(i);var e=new Qe;t.getCenter(e);var n=new Qe(e.x,e.y,e.z);n.addScaledVector(a,4),n.addScaledVector(s,4),r.position.copy(n),r.up.copy(s),r.lookAt(e)},this.keydown=function(t){switch(t.key.toUpperCase()){case"W":o._front=!0;break;case"S":o._back=!0;break;case"A":o._left=!0;break;case"D":o._right=!0}},this.keyup=function(t){switch(t.key.toUpperCase()){case"W":o._front=!1;break;case"S":o._back=!1;break;case"A":o._left=!1;break;case"D":o._right=!1}},this.update=function(t){var e=!1;if(o._front&&(i.translateX(.4*t),e=!0),o._back&&(i.translateX(-.4*t),e=!0),o._left&&(i.translateZ(-.3*t),e=!0),o._right&&(i.translateZ(.3*t),e=!0),e){var n=new Qe(i.position.x,i.position.y,i.position.z);n.addScaledVector(a,4),n.addScaledVector(s,4),r.position.copy(n),r.up.copy(s),r.lookAt(i.position)}}}rf.prototype._withDependencies=function(t){for(var e={},n=0;n<t.length;n++){var i=t[n],r="load"+i.charAt(0).toUpperCase()+i.slice(1),o=this.cache.get(i);if(void 0!==o)e[i]=o;else if(this[r]){var a=this[r]();this.cache.add(i,a),e[i]=a}}return $d(e,function(t){return t})},rf.prototype.parse=function(s,t){var h=this.json;this.cache.removeAll(),this._withDependencies(["scenes","cameras","animations"]).then(function(t){var e=[];for(var n in t.scenes)e.push(t.scenes[n]);var i=void 0!==h.scene?t.scenes[h.scene]:e[0],r=[];for(var n in t.cameras){var o=t.cameras[n];r.push(o)}var a=[];for(var n in t.animations)a.push(t.animations[n]);s(i,e,r,a)}).catch(t)},rf.prototype.getDependency=function(t,e){var n=t+":"+e,i=this.cache.get(n);i||(i=this["load"+t.charAt(0).toUpperCase()+t.slice(1)](e),this.cache.add(n,i));return i},rf.prototype.loadBuffer=function(t){var n=this.json.buffers[t];if(n.type&&"arraybuffer"!==n.type)throw new Error("OASLoader: %s buffer type is not supported.",n.type);if(void 0===n.uri&&0===t)return Promise.resolve(this.extensions[Ad.KHR_BINARY_GLTF].body);var i=this.options;return new Promise(function(t){var e=new Ol;e.setResponseType("arraybuffer"),e.load(tf(n.uri,i.path),t)})},rf.prototype.loadBufferView=function(t){var i=this.json.bufferViews[t];return this.getDependency("buffer",i.buffer).then(function(t){var e=i.byteLength||0,n=i.byteOffset||0;return t.slice(n,n+e)})},rf.prototype.loadAccessors=function(){var t=this,s=this.json;return $d(s.accessors,function(a){return t.getDependency("bufferView",a.bufferView).then(function(t){var e=Zd[a.type],n=Hd[a.componentType],i=n.BYTES_PER_ELEMENT,r=i*e,o=s.bufferViews[a.bufferView].byteStride;return o&&o!==r?new Es(new Ts(new n(t),o/i),e,a.byteOffset/i):new Ni(new n(t,a.byteOffset,a.count*e),e)})})},rf.prototype.loadTexture=function(t){var n=this.json,r=this.options,i=window.URL||window.webkitURL,o=n.textures[t],a=n.images[o.source],s=a.uri,h=!1;return void 0!==a.bufferView&&(s=this.getDependency("bufferView",a.bufferView).then(function(t){h=!0;var e=new Blob([t],{type:a.mimeType});return s=i.createObjectURL(e)})),Promise.resolve(s).then(function(n){var i=Sc.Handlers.get(n)||new Il;return i.setCrossOrigin(r.crossOrigin),new Promise(function(t,e){i.load(tf(n,r.path),t,void 0,e)})}).then(function(t){void 0!==h&&i.revokeObjectURL(s),t.flipY=!1,void 0!==o.name&&(t.name=o.name),t.format=void 0!==o.format?Xd[o.format]:te,void 0!==o.internalFormat&&t.format!==Xd[o.internalFormat]&&console.warn("OASLoader: webgl does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),t.type=void 0!==o.type?Yd[o.type]:Ut;var e=(n.samplers||{})[o.sampler]||{};return t.magFilter=Wd[e.magFilter]||Bt,t.minFilter=Wd[e.minFilter]||Ft,t.wrapS=qd[e.wrapS]||Pt,t.wrapT=qd[e.wrapT]||Pt,t})},rf.prototype.assignTexture=function(e,n,t){return this.getDependency("texture",t).then(function(t){e[n]=t})},rf.prototype.loadMaterials=function(){var u=this,t=this.json,p=this.extensions;return $d(t.materials,function(e){var n,i={},t=e.extensions||{},r=[];if(t[Ad.KHR_MATERIALS_COMMON]){var o=p[Ad.KHR_MATERIALS_COMMON];n=o.getMaterialType(e),r.push(o.extendParams(i,e,u))}else if(t[Ad.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var a=p[Ad.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];n=a.getMaterialType(e),r.push(a.extendParams(i,e,u))}else if(void 0!==e.pbrMetallicRoughness){n=rl;var s=e.pbrMetallicRoughness;if(i.color=new Jn(1,1,1),i.opacity=1,Array.isArray(s.baseColorFactor)){var h=s.baseColorFactor;i.color.fromArray(h),i.opacity=h[3]}if(void 0!==s.baseColorTexture&&r.push(u.assignTexture(i,"map",s.baseColorTexture.index)),i.metalness=void 0!==s.metallicFactor?s.metallicFactor:0,i.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:0,void 0!==s.metallicRoughnessTexture){var l=s.metallicRoughnessTexture.index;r.push(u.assignTexture(i,"metalnessMap",l)),r.push(u.assignTexture(i,"roughnessMap",l))}}else n=al;!0===e.doubleSided&&(i.side=Tt);var c=e.alphaMode||Qd;return i.transparent=c!==Qd,void 0!==e.normalTexture&&r.push(u.assignTexture(i,"normalMap",e.normalTexture.index)),void 0!==e.occlusionTexture&&r.push(u.assignTexture(i,"aoMap",e.occlusionTexture.index)),void 0!==e.emissiveFactor&&(n===no?i.color=(new Jn).fromArray(e.emissiveFactor):i.emissive=(new Jn).fromArray(e.emissiveFactor)),void 0!==e.emissiveTexture&&(n===no?r.push(u.assignTexture(i,"map",e.emissiveTexture.index)):r.push(u.assignTexture(i,"emissiveMap",e.emissiveTexture.index))),Promise.all(r).then(function(){var t;return t=n===$r?p[Ad.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(i):new n(i),void 0!==e.name&&(t.name=e.name),t.normalScale.x=-1,t.userData=e.extras,t})})},rf.prototype.loadGeometries=function(t){var s=this;return this._withDependencies(["accessors"]).then(function(a){return $d(t,function(t){if(s.saveGeometry.hasOwnProperty(t.indices))return s.saveGeometry[t.indices];var e=new sr,n=t.attributes;for(var i in n){var r=n[i];if(void 0===r)return;var o=a.accessors[r];switch(i){case"POSITION":e.addAttribute("position",o);break;case"NORMAL":e.addAttribute("normal",o);break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":e.addAttribute("uv",o);break;case"TEXCOORD_1":e.addAttribute("uv2",o);break;case"COLOR_0":case"COLOR0":case"COLOR":e.addAttribute("color",o);break;case"WEIGHTS_0":case"WEIGHT":e.addAttribute("skinWeight",o);break;case"JOINTS_0":case"JOINT":e.addAttribute("skinIndex",o)}}return void 0!==t.indices&&e.setIndex(a.accessors[t.indices]),s.saveGeometry[t.indices]=e})})},rf.prototype.loadMeshes=function(){var t=this,e=this.json;return this._withDependencies(["accessors","materials"]).then(function(u){return $d(e.meshes,function(h){var l=new Na;void 0!==h.name&&(l.name=h.name),h.extras&&(l.userData=h.extras);var c=h.primitives||[];return t.loadGeometries(c).then(function(t){for(var e in c){var n,i=c[e],r=t[e],o=void 0===i.material?new rl({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:D}):u.materials[i.material];if(o.aoMap&&void 0===r.attributes.uv2&&void 0!==r.attributes.uv&&(console.log("OASLoader: Duplicating UVs to support aoMap."),r.addAttribute("uv2",new Ni(r.attributes.uv.array,2))),void 0!==r.attributes.color&&(o.vertexColors=It,o.needsUpdate=!0),void 0===r.attributes.normal&&(void 0!==o.flatShading?o.flatShading=!0:o.shading=1),i.mode===jd||void 0===i.mode)n=new io(r,o);else if(i.mode===Vd)(n=new io(r,o)).drawMode=Ie;else if(i.mode===Gd)(n=new io(r,o)).drawMode=De;else if(i.mode===Nd)n=new Ds(r,o);else if(i.mode===Ud)n=new Is(r,o);else if(i.mode===Fd)n=new Bs(r,o);else{if(i.mode!==Bd)throw new Error("OASLoader: Primitive mode unsupported: ",i.mode);n=new Fs(r,o)}if(n.name=l.name+"_"+e,void 0!==i.targets&&nf(n,h,i,u),i.extras&&(n.userData=i.extras),i.extensions&&i.extensions.matrix){var a=i.extensions.matrix,s=new Je;s.fromArray(a),n.applyMatrix(s)}l.add(n)}return l})})})},rf.prototype.loadCameras=function(){return $d(this.json.cameras,function(t){var e,n=t[t.type];if(n){if("perspective"===t.type){var i=n.aspectRatio||1,r=n.yfov*i;e=new Ua(Ye.radToDeg(r),i,n.znear||1,n.zfar||2e6)}else"orthographic"===t.type&&(e=new uc(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar));return void 0!==t.name&&(e.name=t.name),t.extras&&(e.userData=t.extras),e}console.warn("OASLoader: Missing camera parameters.")})},rf.prototype.loadSkins=function(){var t=this.json;return this._withDependencies(["accessors"]).then(function(e){return $d(t.skins,function(t){return{joints:t.joints,inverseBindMatrices:e.accessors[t.inverseBindMatrices]}})})},rf.prototype.loadAnimations=function(){var t=this.json;return this._withDependencies(["accessors","nodes"]).then(function(x){return $d(t.animations,function(t,e){var n=[];for(var i in t.channels){var r=t.channels[i],o=t.samplers[r.sampler];if(o){var a=r.target,s=void 0!==a.node?a.node:a.id,h=void 0!==t.parameters?t.parameters[o.input]:o.input,l=void 0!==t.parameters?t.parameters[o.output]:o.output,c=x.accessors[h],u=x.accessors[l],p=x.nodes[s];if(p){var d;switch(p.updateMatrix(),p.matrixAutoUpdate=!0,Jd[a.path]){case Jd.weights:d=wl;break;case Jd.rotation:d=Ml;break;case Jd.position:case Jd.scale:default:d=Tl}var f=p.name?p.name:p.uuid;"CATMULLROMSPLINE"===o.interpolation&&console.warn("OASLoader: CATMULLROMSPLINE interpolation is not supported. Using CUBICSPLINE instead.");var m=void 0!==o.interpolation?Kd[o.interpolation]:Pe,v=[];Jd[a.path]===Jd.weights?p.traverse(function(t){!0===t.isMesh&&!0===t.material.morphTargets&&v.push(t.name?t.name:t.uuid)}):v.push(f);for(var g=0,y=v.length;g<y;g++)n.push(new d(v[g]+"."+Jd[a.path],dl.arraySlice(c.array,0),dl.arraySlice(u.array,0),m))}}}return new El(s=void 0!==t.name?t.name:"animation_"+e,void 0,n)})})},rf.prototype.loadNodes=function(){var O=this.json,k=this.extensions,t=this,e=O.nodes||[];return(O.skins||[]).forEach(function(t){t.joints.forEach(function(t){e[t].isBone=!0})}),$d(O.nodes,function(t){var e=new Je,n=!0===t.isBone?new Os:new Ci;return void 0!==t.name&&(n.name=Ku.sanitizeNodeName(t.name)),t.extras&&(n.userData=t.extras),void 0!==t.matrix?(e.fromArray(t.matrix),n.applyMatrix(e)):(void 0!==t.translation&&n.position.fromArray(t.translation),void 0!==t.rotation&&n.quaternion.fromArray(t.rotation),void 0!==t.scale&&n.scale.fromArray(t.scale)),n}).then(function(R){return t._withDependencies(["meshes","skins","cameras"]).then(function(P){return $d(R,function(t,e){var n,i=O.nodes[e];if(void 0!==i.mesh?n=[i.mesh]:void 0!==i.meshes&&(console.warn("OASLoader: Nodes may have no more than one mesh."),n=i.meshes),void 0!==n)for(var r in n){var o=n[r],a=P.meshes[o];if(void 0!==a){var s=a.clone(!1);for(var h in a.children){var l,c=a.children[h],u=c,p=c.material,d=c.geometry,f=c.morphTargetInfluences,m=c.userData,v=c.name,g=c.matrix,y=p;switch(c.type){case"LineSegments":c=new Ds(d,y);break;case"LineLoop":c=new Bs(d,y);break;case"Line":c=new Is(d,y);break;case"Points":c=new Fs(d,y);break;default:(c=new io(d,y)).drawMode=u.drawMode,c.applyMatrix(g)}if(c.castShadow=!0,c.morphTargetInfluences=f,c.userData=m,c.name=v,void 0!==i.skin&&(l=P.skins[i.skin]),l){var x=d;(y=p).skinning=!0,(c=new ks(x,y)).castShadow=!0,c.userData=m,c.name=v;for(var b=[],w=[],_=0,M=l.joints.length;_<M;_++){var S=l.joints[_],T=R[S];if(T){b.push(T);var E=l.inverseBindMatrices.array,A=(new Je).fromArray(E,16*_);w.push(A)}else console.warn('OASLoader: Joint "%s" could not be found.',S)}c.bind(new Rs(b,w),c.matrixWorld)}s.add(c)}t.add(s)}else console.warn('OASLoader: Could not find node "'+o+'".')}if(void 0!==i.camera){var C=P.cameras[i.camera];t.add(C)}if(i.extensions&&i.extensions[Ad.KHR_LIGHTS]&&void 0!==i.extensions[Ad.KHR_LIGHTS].light){var L=k[Ad.KHR_LIGHTS].lights;t.add(L[i.extensions[Ad.KHR_LIGHTS].light])}return t})})})},rf.prototype.loadScenes=function(){var h=this.json,s=this.extensions;function l(t,e,n){var i=n[t];e.add(i);var r=h.nodes[t];if(r.children)for(var o=r.children,a=0,s=o.length;a<s;a++){l(o[a],i,n)}}return this._withDependencies(["nodes"]).then(function(a){return $d(h.scenes,function(t){var e=new Ss;void 0!==t.name&&(e.name=t.name),t.extras&&(e.userData=t.extras);for(var n=t.nodes||[],i=0,r=n.length;i<r;i++){l(n[i],e,a.nodes)}if(e.traverse(function(t){t.material&&t.material.isGLTFSpecularGlossinessMaterial&&(t.onBeforeRender=s[Ad.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms)}),t.extensions&&t.extensions[Ad.KHR_LIGHTS]&&void 0!==t.extensions[Ad.KHR_LIGHTS].light){var o=s[Ad.KHR_LIGHTS].lights;e.add(o[t.extensions[Ad.KHR_LIGHTS].light])}return e})})};var af,sf,hf,lf,cf={Front:0,Back:1,Left:2,Right:3,Top:4,Bottom:5,FrontTop:6,FrontRight:7,FrontLeft:8,FrontBottom:9,RightBack:10,RightBottom:11,RightTop:12,BackLeft:13,BackTop:14,BackBottom:15,LeftBottom:16,LeftTop:17,FrontRightTop:18,FrontRightBottom:19,FrontLeftTop:20,FrontLeftBottom:21,BackRightTop:22,BackRightBottom:23,BackLeftTop:24,BackLeftBottom:25,East:26,South:27,West:28,North:29},uf={None:0,Coordinate:1,Point2PointDistance:2},pf=0,df=1,ff=2;function mf(t){$r.call(this,{type:"LineMaterial",uniforms:Yn.clone(ii.line.uniforms),vertexShader:ii.line.vertexShader,fragmentShader:ii.line.fragmentShader}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),this.setValues(t)}function vf(){ep.call(this),this.type="LineSegmentsGeometry";new sr;this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.addAttribute("position",new qi([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.addAttribute("uv",new qi([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}function gf(){vf.call(this),this.type="LineGeometry"}function yf(t,e){io.call(this),this.type="LineSegments2",this.geometry=void 0!==t?t:new vf,this.material=void 0!==e?e:new mf({color:16777215*Math.random()})}function xf(t,e){yf.call(this),this.type="Line2",this.geometry=void 0!==t?t:new gf,this.material=void 0!==e?e:new mf({color:16777215*Math.random()})}ni.line={linewidth:{value:1},resolution:{value:new Ze(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},ii.line={uniforms:Yn.merge([ni.common,ni.fog,ni.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <premultiplied_alpha_fragment>\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\n\t\t}\n\t\t"},((mf.prototype=Object.create($r.prototype)).constructor=mf).prototype.isLineMaterial=!0,mf.prototype.copy=function(t){return $r.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.resolution=t.resolution,this},vf.prototype=Object.assign(Object.create(ep.prototype),{constructor:vf,isLineSegmentsGeometry:!0,applyMatrix:function(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(t.applyToBufferAttribute(e),t.applyToBufferAttribute(n),e.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},setPositions:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new np(e,6,1);return this.addAttribute("instanceStart",new Es(n,3,0)),this.addAttribute("instanceEnd",new Es(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},setColors:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new np(e,6,1);return this.addAttribute("instanceColorStart",new Es(n,3,0)),this.addAttribute("instanceColorEnd",new Es(n,3,3)),this},fromWireframeGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromEdgesGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromMesh:function(t){return this.fromWireframeGeometry(new Hs(t.geometry)),this},fromLineSegements:function(t){var e=t.geometry;return e.isGeometry?this.setPositions(e.vertices):e.isBufferGeometry&&this.setPositions(e.position.array),this},computeBoundingBox:(sf=new Nn,function(){null===this.boundingBox&&(this.boundingBox=new Nn);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),sf.setFromBufferAttribute(e),this.boundingBox.union(sf))}),computeBoundingSphere:(af=new Qe,function(){null===this.boundingSphere&&(this.boundingSphere=new jn),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var n=this.boundingSphere.center;this.boundingBox.getCenter(n);for(var i=0,r=0,o=t.count;r<o;r++)af.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(af)),af.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(af));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("OASLineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}),toJSON:function(){},clone:function(){},copy:function(t){return this}}),gf.prototype=Object.assign(Object.create(vf.prototype),{constructor:gf,isLineGeometry:!0,setPositions:function(t){for(var e=t.length-3,n=new Float32Array(2*e),i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return vf.prototype.setPositions.call(this,n),this},editPosition:function(t){var e=this.getAttribute("instanceStart");if(e&&t.length===e.array.length){for(var n=0;n<t.length;n+=3){var i=parseInt(n/3);e.setXYZ(i,t[n+0],t[n+1],t[n+2])}e.data.needsUpdate=!0,this.computeBoundingBox(),this.computeBoundingSphere()}return this},editPositionByIndex:function(t,e){var n=this.getAttribute("instanceStart");return n.setXYZ(t,e.x,e.y,e.z),n.data.needsUpdate=!0,this.computeBoundingBox(),this.computeBoundingSphere(),this},setColors:function(t){for(var e=t.length-3,n=new Float32Array(2*e),i=0;i<e;i+=3)n[2*i]=t[i],n[2*i+1]=t[i+1],n[2*i+2]=t[i+2],n[2*i+3]=t[i+3],n[2*i+4]=t[i+4],n[2*i+5]=t[i+5];return vf.prototype.setColors.call(this,n),this},fromLine:function(t){var e=t.geometry;return e.isGeometry?this.setPositions(e.vertices):e.isBufferGeometry&&this.setPositions(e.position.array),this},copy:function(t){return this}}),yf.prototype=Object.assign(Object.create(io.prototype),{constructor:yf,isLineSegments2:!0,computeLineDistances:(hf=new Qe,lf=new Qe,function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.data.count),r=0,o=0,a=e.data.count;r<a;r++,o+=2)hf.fromBufferAttribute(e,r),lf.fromBufferAttribute(n,r),i[o]=0===o?0:i[o-1],i[o+1]=i[o]+hf.distanceTo(lf);var s=new np(i,2,1);return t.addAttribute("instanceDistanceStart",new Es(s,1,0)),t.addAttribute("instanceDistanceEnd",new Es(s,1,1)),this}),copy:function(t){return this}}),xf.prototype=Object.assign(Object.create(yf.prototype),{constructor:xf,isLine2:!0,copy:function(t){return this}});var bf=1,wf={convertUint8ArrayToString:function(t){if(void 0!==window.TextDecoder)return(new TextDecoder).decode(t);for(var e="",n=0,i=array.length;n<i;n++)e+=String.fromCharCode(array[n]);return e},getOneTextHeight:function(t){var e=document.createElement("span");e.style.visibility="hidden",e.style.position="absolute",e.style.width="auto",e.style.height="auto",document.body.appendChild(e);var n=e.offsetHeight;return e.style.fontSize=t,e.style.textAlign="center",e.innerHTML="度",n=e.offsetHeight-n,document.body.removeChild(e),n},getTextWidth:function(t,e,n){var i=document.createElement("span");i.style.visibility="hidden",i.style.position="absolute",i.style.width="auto",i.style.height="auto",document.body.appendChild(i);var r=i.offsetWidth;return n&&(i.style.display="block",i.style.wordWrap="break-word",i.style.whiteSpace="normal"),i.style.fontSize=t,i.style.textAlign="center",i.innerHTML=e,r=i.offsetWidth-r,document.body.removeChild(i),r},defaultValue:function(t,e){return null!=t?t:e},hex2CSSRGB:function(t){return"rgb("+(t>>16&255)+","+(t>>8&255)+","+(255&t)+")"},getUniqueID:function(){return bf++}};function _f(c,u,p,e,n){function d(t,e){var n=c.getBoundingClientRect(),i=new Ze;return i.set((t-n.left)/n.width*2-1,(e-n.top)/n.height*-2+1),i}var f=null,m=null,v=null,g=null,y=120,x=13,b=new Qe,w=new Ze,o=!1,_=null,a=!1,i=!0,s=new Ze;this.cancelHighlight=function(){g.material.color.setHex(13421772),g.material.needsUpdate=!0,n()};function M(t){0==t.button&&(o=!0,s.set(t.clientX,t.clientY),e._currentSelectMeasureID=_)}this.documentMouseMove=function(t){if(o){var e=f.style.left,n=f.style.top;e=e.replace("px",""),n=n.replace("px",""),e=parseInt(e),n=parseInt(n);var i=t.clientX-s.x,r=t.clientY-s.y;(1<Math.abs(i)||1<Math.abs(r))&&(e+=i,n+=r,w.x+=i,w.y+=r,f.style.left=e+"px",f.style.top=n+"px",s.set(t.clientX,t.clientY),a=!0)}},this.cancelMove=function(){o=!1,e._currentSelectMeasureID=0,a=!1};function S(t){i?i=!1:(a||(e.cancelMeasureLabel(),e._currentHighlightID=_,g.material.color.setHex(16711680),g.material.needsUpdate=!0,n()),o=!1,e._currentSelectMeasureID=0,a=!1)}this.getUUID=function(){return _},this.createVertice=function(t){var e=new Ns;e.size=8,e.sizeAttenuation=!1,e.depthTest=!1;var n=new sr,i=new Float32Array([0,0,0]);n.addAttribute("position",new qi(i,3)),(v=new Fs(n,e)).position.copy(t),p.add(v),b.copy(t)},this.createText=function(t,e){if(null==f&&!g&&v){e=function(t){return(t=wf.defaultValue(t,{})).opacity=wf.defaultValue(t.opacity,.8),t.fontSize=wf.defaultValue(t.fontSize,13),t.width=wf.defaultValue(t.width,150),t.background=wf.defaultValue(t.background,15658734),t.textColor=wf.defaultValue(t.textColor,0),t.borderColor=wf.defaultValue(t.borderColor,11184810),t}(e),b.project(u),w.x=t.x,w.y=t.y;var n=d(t.x,t.y);b.x=n.x,b.y=n.y,b.unproject(u);var i=new gf,r=[],o=new Jn;o.setHex(13421772);var a=[];r.push(b.x),r.push(b.y),r.push(b.z),a.push(o.r,o.g,o.b),r.push(v.position.x),r.push(v.position.y),r.push(v.position.z),a.push(o.r,o.g,o.b),i.setPositions(r),i.setColors(a);var s=new mf({color:16777215,linewidth:1,vertexColors:It,dashed:!1});s.resolution.set(800,800),(g=new xf(i,s)).computeLineDistances(),g.scale.set(1,1,1),p.add(g),y=e.width,(f=document.createElement("div")).style.zIndex="999",f.style.opacity=e.opacity.toString(),f.style.position="absolute",m=document.createElement("a"),f.appendChild(m),m.style.fontSize=e.fontSize+"px",x=e.fontSize,m.style.width=y+"px",m.style.display="block",m.style.wordWrap="break-word",m.style.height="auto",m.style.textAlign="left",m.style.textDecoration="none",m.style.msUserSelect="none",m.style.userSelect="none",m.style.webkitUserSelect="none",m.style.background=wf.hex2CSSRGB(e.background),m.style.color=wf.hex2CSSRGB(e.textColor),m.style.padding="5px 10px",m.style.borderRadius="8px",m.style.border="2px solid",m.style.cursor="default",m.style.borderColor=wf.hex2CSSRGB(e.borderColor),m.href="javascript:void(0)";var h="坐标:</br>&nbsp;x:"+v.position.x.toFixed(4)+"</br>&nbsp;y:"+v.position.y.toFixed(4)+"</br>&nbsp;z:"+v.position.z.toFixed(4);m.innerHTML=h;var l=wf.getTextWidth(x,h);l<y&&(m.style.width=l+"px"),c.parentNode.appendChild(f),f.style.visibility="hidden",f.style.left=t.x-.5*f.clientWidth+"px",f.style.top=t.y-10-.5*f.clientHeight+"px",f.style.visibility="visible",f.addEventListener("mousedown",M,!1),f.addEventListener("mouseup",S,!1),_=wf.getUniqueID()}},this.render=function(){if(v){b.x=v.position.x,b.y=v.position.y,b.z=v.position.z,b.project(u);var t=d(w.x,w.y);b.x=t.x,b.y=t.y,b.unproject(u);var e=[];e.push(b.x),e.push(b.y),e.push(b.z),e.push(v.position.x),e.push(v.position.y),e.push(v.position.z),g.geometry.editPosition(e)}},this.resize=function(t,e){g&&g.material.resolution.set(t,e)},this.dispose=function(){!g&&v&&(p.remove(v),v=null)}}function Mf(p,d,f,e,n){function m(t,e){var n=p.getBoundingClientRect(),i=new Ze;return i.set((t-n.left)/n.width*2-1,(e-n.top)/n.height*-2+1),i}var v=null,g=null,y=null,x=null,b=null,w=null,_=120,M=13,S=new Qe,T=new Qe,E=new Ze,o=!1,A=null,a=!1,i=!0,s=new Ze;this.cancelHighlight=function(){b.material.color.setHex(13421772),b.material.needsUpdate=!0,w.material.color.setHex(13421772),w.material.needsUpdate=!0,n()};function C(t){0==t.button&&(o=!0,s.set(t.clientX,t.clientY),e._currentSelectMeasureID=A)}this.documentMouseMove=function(t){if(o){var e=v.style.left,n=v.style.top;e=e.replace("px",""),n=n.replace("px",""),e=parseInt(e),n=parseInt(n);var i=t.clientX-s.x,r=t.clientY-s.y;(1<Math.abs(i)||1<Math.abs(r))&&(e+=i,n+=r,E.x+=i,E.y+=r,v.style.left=e+"px",v.style.top=n+"px",s.set(t.clientX,t.clientY),a=!0)}},this.cancelMove=function(){o=!1,e._currentSelectMeasureID=0,a=!1};function L(t){i?i=!1:(a||(e.cancelMeasureLabel(),e._currentHighlightID=A,b.material.color.setHex(16711680),b.material.needsUpdate=!0,w.material.color.setHex(16711680),w.material.needsUpdate=!0,n()),o=!1,e._currentSelectMeasureID=0,a=!1)}this.getUUID=function(){return A},this.createFirstVertice=function(t){if(!y){var e=new Ns;e.size=8,e.sizeAttenuation=!1,e.depthTest=!1;var n=new sr,i=new Float32Array([0,0,0]);n.addAttribute("position",new qi(i,3)),(y=new Fs(n,e)).position.copy(t),f.add(y)}},this.createSecondVertice=function(t){if(y&&!x){var e=new Ns;e.size=8,e.sizeAttenuation=!1,e.depthTest=!1;var n=new sr,i=new Float32Array([0,0,0]);n.addAttribute("position",new qi(i,3)),(x=new Fs(n,e)).position.copy(t),f.add(x),S.set(.5*(t.x+y.position.x),.5*(t.y+y.position.y),.5*(t.z+y.position.z)),T.copy(S)}},this.createText=function(t,e){if(null==v&&!b&&y&&x){e=function(t){return(t=wf.defaultValue(t,{})).opacity=wf.defaultValue(t.opacity,.8),t.fontSize=wf.defaultValue(t.fontSize,13),t.width=wf.defaultValue(t.width,150),t.background=wf.defaultValue(t.background,15658734),t.textColor=wf.defaultValue(t.textColor,0),t.borderColor=wf.defaultValue(t.borderColor,11184810),t}(e),S.project(d),E.x=t.x,E.y=t.y;var n=m(t.x,t.y);S.x=n.x,S.y=n.y,S.unproject(d);var i=new sr,r=new qi(new Float32Array([S.x,S.y,S.z,T.x,T.y,T.z]),3);i.addAttribute("position",r);var o=new zs({depthTest:!1});o.linewidth=4,o.color.setHex(13421772),b=new Is(i,o),f.add(b);var a=new sr,s=new qi(new Float32Array([y.position.x,y.position.y,y.position.z,x.position.x,x.position.y,x.position.z]),3);a.addAttribute("position",s);var h=new zs({depthTest:!1});h.linewidth=4,h.color.setHex(13421772),w=new Is(a,h),f.add(w),_=e.width,(v=document.createElement("div")).style.zIndex="999",v.style.opacity=e.opacity.toString(),v.style.position="absolute",g=document.createElement("a"),v.appendChild(g),g.style.fontSize=e.fontSize+"px",M=e.fontSize,g.style.width=_+"px",g.style.display="block",g.style.wordWrap="break-word",g.style.height="auto",g.style.textAlign="left",g.style.textDecoration="none",g.style.msUserSelect="none",g.style.userSelect="none",g.style.webkitUserSelect="none",g.style.background=wf.hex2CSSRGB(e.background),g.style.color=wf.hex2CSSRGB(e.textColor),g.style.padding="5px 10px",g.style.borderRadius="10px",g.style.border="2px solid",g.style.cursor="default",g.style.borderColor=wf.hex2CSSRGB(e.borderColor),g.href="javascript:void(0)";var l=new Qe;l.subVectors(y.position,x.position);var c="两点距离:</br>&nbsp;"+l.length();l=null,g.innerHTML=c;var u=wf.getTextWidth(M,c,!0);u<_&&(g.style.width=u+"px"),p.parentNode.appendChild(v),v.style.visibility="hidden",v.style.left=t.x-.5*v.clientWidth+"px",v.style.top=t.y-10-.5*v.clientHeight+"px",v.style.visibility="visible",v.addEventListener("mousedown",C,!1),v.addEventListener("mouseup",L,!1),A=wf.getUniqueID()}},this.render=function(){S.x=b.geometry.attributes.position.getX(1),S.y=b.geometry.attributes.position.getY(1),S.z=b.geometry.attributes.position.getZ(1),S.project(d);var t=m(E.x,E.y);S.x=t.x,S.y=t.y,S.unproject(d),b.geometry.attributes.position.setXYZ(0,S.x,S.y,S.z),b.geometry.attributes.position.needsUpdate=!0},this.dispose=function(){b||(y&&(f.remove(y),y=null),x&&(f.remove(x),x=null))}}function Sf(a,s,h,l,c,u){var p=uf.None,d=0,f=null,m=null;this.setType=function(t){this.dispose(),p=t,d=0},this.onLButtonDown=function(t,e){if(!t)return-1;if(p==uf.Coordinate){if(0==d)return(f=f||new _f(a,s,l,u,h)).createVertice(t),t=null,h(),d++,-2;if(1==d){var n=!1,i=null;return f&&(f.createText(e),i=f.getUUID(),c.set(i,f),e=f=null,h(),n=!0),d=0,n?(n=null,i):0}}else if(p==uf.Point2PointDistance){if(0==d)return(m=m||new Mf(a,s,l,u,h)).createFirstVertice(t),t=null,h(),d++,0;if(1==d)return m?(m.createSecondVertice(t),t=null,h(),d++,-2):0;if(2==d){var r=!1,o=null;return m&&(m.createText(e),o=m.getUUID(),c.set(o,m),e=m=null,h(),r=!0),d=0,r?(r=null,o):0}}return-1},this.dispose=function(){f&&(f.dispose(),f=null),m&&(m.dispose(),m=null)}}function Tf(o,h,l,t){var c=this;this.mainLight=t;var u=0,r=1,a=3,p=u,d=new Qe(1,0,0),s=new Qe(0,0,1),f=.5*Math.PI,m=new Qe,v=new Qe,g=new Qe,y=0,x=new Qe,b=0,n=1,w=0,_=1,M=2,S=4,T=0,E=1,A=2,C=4,L=b,P=w,R=T,O=new Array(new Ze,new Ze),k=new Ze,z=2,e=null,i=null,I=null,D=null,B=new rp;this.cameraRightDeltaAngle=2*Math.PI/(1.5*o.clientWidth),this.cameraUpDeltaAngle=2*Math.PI/(2*o.clientHeight);var N=null,F=null,U=!1,j=null,V=null,G=320,H=20,W=new Qe,q=0,X=0,Y=new Qe,Z=0,J=0,K=0,Q=new Qe,$=[],tt=65280,et=[],nt=null,it=null,rt=null,ot=new Map;this._currentSelectMeasureID=0;function at(t,e,n,i){e&&-1!=$.indexOf(t)||(e||vt(!1,!1),$.push(t),t.traverse(function(t){t instanceof io&&(t.material.oriemiss=t.material.color.getHex(),t.material.color.setHex(tt),t.material.oriemiss_alpha=t.material.opacity,t.material.oriemiss_trans=t.material.transparent,t.material.transparent=!1,t.material.opacity=1,t.material.lights=!1,t.material.needsUpdate=!0)}),i&&Lt(t.name),n&&bt())}function st(t,e,n,i){e&&-1!=et.indexOf(t)||t instanceof io&&(e||gt(!1),et.push(t),t.material.oriemiss=t.material.color.getHex(),t.material.color.setHex(tt),t.material.oriemiss_alpha=t.material.opacity,t.material.oriemiss_trans=t.material.transparent,t.material.transparent=!1,t.material.opacity=1,t.material.lights=!1,t.material.needsUpdate=!0,i&&Pt(t.uuid),n&&bt())}var ht=this._currentHighlightID=0,lt=null,ct=null,ut=null,pt=new iu,dt=!1,ft=null,mt=null,vt=function(t,e){if(0<$.length){for(var n=0;n!=$.length;++n){$[n].traverse(function(t){t instanceof io&&t.material.oriemiss&&(t.material.color.setHex(t.material.oriemiss),delete t.material.oriemiss,t.material.transparent=t.material.oriemiss_trans,t.material.opacity=t.material.oriemiss_alpha,delete t.material.oriemiss_trans,delete t.material.oriemiss_alpha,t.material.lights=!0,t.material.needsUpdate=!0)})}t&&bt(),$=[],e&&Lt("")}},gt=function(t,e){if(0<et.length){for(var n=0;n!=et.length;++n){var i=et[n];void 0!==i.material.oriemiss&&(i.material.color.setHex(i.material.oriemiss),delete i.material.oriemiss,i.material.transparent=i.material.oriemiss_trans,i.material.opacity=i.material.oriemiss_alpha,delete i.material.oriemiss_trans,delete i.material.oriemiss_alpha,i.material.lights=!0,i.material.needsUpdate=!0)}t&&bt(),et=[]}};this.highlightObjectByInterface=function(t,e){if(t instanceof io){if(e&&-1!=et.indexOf(t))return;vt(!1,!1),st(t,e,!1,!1)}else{if(e&&-1!=$.indexOf(t))return;gt(!1),at(t,e,!1,!1)}},this.unhighlightAllObjectByInterface=function(){gt(),vt()},this.setRootScene=function(t){N=t},this.setRootMeasures=function(t){F=t},this.setIsolationCallBack=function(t){mt=t};function yt(t){return mt(t)}function xt(t,e){var n=o.getBoundingClientRect(),i=new Ze;return i.set((t-n.left)/n.width*2-1,(e-n.top)/n.height*-2+1),i}this.setRotateCenter=function(t){Q.copy(m),m.copy(t)},this.setRotateCenterByValues=function(t,e,n){Q.copy(m),m.set(t,e,n)},this.getCameraTarget=function(){return v},this.setCameraTarget=function(t){v.copy(t),g.subVectors(v,h.position),y=g.length(),g.normalize()},this.setCameraTargetByValues=function(t,e,n){v.set(t,e,n),g.subVectors(v,h.position),y=g.length(),g.normalize()},this.getCameraDirect=function(){return g},this.getCameraDirectLength=function(){return y},this.setRender=function(t){e=t};var bt=function(){null!=e&&e()};this.setAnimation=function(t){i=t};function wt(t){t||pt.stop(),i&&i(t)}this.setSelectCallBack=function(t,e){"0"==t?I=e:"1"==t&&(D=e)};function _t(){if(!it){var t=new Bi,e=new Qe(0,0,0);t.vertices.push(e),t.colors.push(new Jn(16711680));var n=new Ns({size:7,vertexColors:It,depthTest:!1,sizeAttenuation:!1});(it=new Fs(t,n)).visible=!1,l.add(it),n=t=null,document.addEventListener("mousemove",Rt,!1)}}function Mt(){it&&(l.remove(it),nt=it=null,document.removeEventListener("mousemove",Rt,!1))}this.documentMouseMove=function(t){if(c._currentSelectMeasureID){var e=ot.get(c._currentSelectMeasureID);e&&(t.preventDefault(),e.documentMouseMove(t),bt())}},this.documentMouseUp=function(t){if(c._currentSelectMeasureID){var e=ot.get(c._currentSelectMeasureID);e&&(t.preventDefault(),e.cancelMove(),c._currentSelectMeasureID=0)}},document.addEventListener("mousemove",this.documentMouseMove,!1),document.addEventListener("mouseup",this.documentMouseUp,!1),this.cancelMeasureLabel=function(){if(c._currentHighlightID){var t=ot.get(c._currentHighlightID);t&&(t.cancelHighlight(),c._currentHighlightID=0)}},this.startMeasure=function(t){p==r&&this.endSelectVertice(),rt=rt||new Sf(o,h,e,F,ot,this),_t(),p=a,rt.setType(t)},this.endMeasure=function(){p==a&&(rt.dispose(),ht=0,rt=null,p=u,Mt(),bt())},this.updateMeasures=function(){var t=!0,e=!1,n=void 0;try{for(var i,r=ot.values()[Symbol.iterator]();!(t=(i=r.next()).done);t=!0){i.value.render()}}catch(t){e=!0,n=t}finally{try{!t&&r.return&&r.return()}finally{if(e)throw n}}},this.resizeMeasures=function(t,e){var n=!0,i=!1,r=void 0;try{for(var o,a=ot.values()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;s.resize(t,e),s.render()}}catch(t){i=!0,r=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw r}}},this.startSelectVertice=function(t){p!=r&&(this.endMeasure(),"function"==typeof t&&(nt=t,_t(),p=r))},this.endSelectVertice=function(){p==r&&(p=u,Mt())};function St(t,e){var n=new Je,i=new Je,r=new Je,o=new Qe(m.x,m.y,m.z);o.multiplyScalar(-1),i.makeTranslation(o.x,o.y,o.z),n.makeRotationAxis(t,e),r.multiplyMatrices(n,i),i.makeTranslation(-o.x,-o.y,-o.z),r.multiplyMatrices(i,r);var a=h.position,s=h.up;a.applyMatrix4(r),s.applyMatrix4(n),v.applyMatrix4(r),m.applyMatrix4(r),h.position.copy(a),h.up.copy(s),h.lookAt(v),c.setCameraTarget(v)}function Tt(t){switch(t.preventDefault(),O[0].set(t.clientX,t.clientY),O[1].set(t.clientX,t.clientY),t.button){case 0:if(p==r){if(null!=nt&&it.visible){var e={x:it.position.x,y:it.position.y,z:it.position.z};nt(e)}}else p==a?rt&&(ht=it.visible?rt.onLButtonDown(it.position.clone(),O[0].clone()):rt.onLButtonDown(void 0,O[0].clone())):(L==b&&(document.addEventListener("mouseup",Ot,!1),p==u&&document.addEventListener("mousemove",Rt,!1)),L=n,_!=(P&_)&&(P=_));break;case 1:L==b&&(document.addEventListener("mouseup",Ot,!1),p==u&&document.addEventListener("mousemove",Rt,!1)),L=n,M!=(P&M)&&(P=M);break;case 2:L==b&&(document.addEventListener("mouseup",Ot,!1),p==u&&document.addEventListener("mousemove",Rt,!1)),L=n,S!=(P&S)&&(P=S)}c.cancelMeasureLabel()}function Et(t){t.preventDefault()}function At(){Date.now()-V>=G&&(clearInterval(j),j=void 0,U=!1)}function Ct(t){if(t.preventDefault(),t.stopPropagation(),!U){var e=xt(t.clientX,t.clientY);B.setFromCamera(e,h);var n=new Qe(v.x,v.y,v.z);if(null!=N){var i=B.intersectObject(N,!0);if(0<i.length){n.copy(i[0].point),m.copy(n);var r=new Qe(n.x,n.y,n.z);r.project(h);var o=new Qe(v.x,v.y,v.z);o.project(h),o.z=r.z,o.unproject(h),c.setCameraTarget(o)}}var a=function(t){for(var e=0,n=1;n<=t;++n)e+=n;return e}(H);W.subVectors(n,v),X=W.length(),q=X/a,W.normalize(),Y.subVectors(n,h.position);var s=Y.length();Z=s/a,Y.normalize(),J=H}!function(t){var e=1,n=1,i=new Qe,r=new Qe;t.deltaY<0?H<J?(i.copy(Y),r.copy(W),e=Z*J,n=q*J,h.position.addScaledVector(i,e),v.addScaledVector(r,n),h.lookAt(v),c.setCameraTarget(v),c.setRotateCenter(m),J-=K,K--):1<J&&J<=H?(i.copy(Y),r.copy(W),(e=Z*J)<=1?(e=1,i.copy(Y),r.copy(Y)):n=q*J,h.position.addScaledVector(i,e),v.addScaledVector(r,n),h.lookAt(v),c.setCameraTarget(v),c.setRotateCenter(m),J--):J<=1&&(i.copy(Y),r.copy(Y),(e=Z)<=1?(e=1,i.copy(Y),r.copy(Y)):n=Z,h.position.addScaledVector(i,e),v.addScaledVector(r,n),h.lookAt(v),c.setCameraTarget(v),c.setRotateCenter(v),J--):0<t.deltaY&&(H<=J?(J+=++K,i.copy(Y),i.multiplyScalar(-1),r.copy(W),r.multiplyScalar(-1),e=Z*J,n=q*J,h.position.addScaledVector(i,e),v.addScaledVector(r,n),h.lookAt(v),c.setCameraTarget(v),c.setRotateCenter(m)):1<=J&&J<H?(i.copy(Y),i.multiplyScalar(-1),r.copy(W),r.multiplyScalar(-1),e=Z*J,n=q*J,h.position.addScaledVector(i,e),v.addScaledVector(r,n),h.lookAt(v),c.setCameraTarget(v),c.setRotateCenter(m),J++):J<1&&(i.copy(Y),i.multiplyScalar(-1),r.copy(i),n=e=Z,h.position.addScaledVector(i,e),v.addScaledVector(r,n),h.lookAt(v),c.setCameraTarget(v),c.setRotateCenter(v),J++)),r=i=null}(t),U||(j=setInterval(At,G),U=!0),V=Date.now(),bt(),bt()}var Lt=function(t){null!=I&&I(t)},Pt=function(t){null!=D&&D(t)},Rt=function(t){if(t.preventDefault(),k.set(t.clientX,t.clientY),R!=T||z<k.distanceTo(O[1])){var e=P&S;if((P&_)==_)R=E;else if((P&M)==M)R=A,function(){var t=y;t*=Math.tan(h.fov/2*Math.PI/180);var e=new Qe;e.subVectors(k,O[1]),O[1].copy(k);var n=new Qe,i=new Qe,r=new Qe;i.setFromMatrixColumn(h.matrix,0),i.multiplyScalar(-2*e.x*t/o.clientHeight),r.setFromMatrixColumn(h.matrix,1),r.multiplyScalar(2*e.y*t/o.clientHeight),n.add(i),n.add(r),v.add(n),h.position.add(n),h.lookAt(v),c.setCameraTarget(v)}(),bt(),bt();else if(e==S)R=C,function(){g.subVectors(v,h.position),y=g.length(),g.normalize(),x.crossVectors(g,h.up),x.normalize();var t=new Qe;t.subVectors(k,O[1]),O[1].copy(k);var e=-1*t.x*c.cameraRightDeltaAngle,n=-1*t.y*c.cameraUpDeltaAngle;St(x,n),h.up.angleTo(s)>f&&(e*=-1),St(s,e)}(),bt(),bt();else if((p==r||p==a)&&-2!=ht){var n=xt(t.clientX,t.clientY);if(B.setFromCamera(n,h),null!=N){var i=B.intersectObject(N,!0);0<i.length?i[0].object instanceof Fs?1!=i.length&&(it.visible=!0,it.position.copy(i[1].point),bt()):(it.visible=!0,it.position.copy(i[0].point),bt()):1==it.visible&&(it.visible=!1,bt())}}}},Ot=function t(e){e.preventDefault();var n=P&_,i=P&M,r=P&S;if(n==_){if(P&=~_,R!=E){var o=xt(e.clientX,e.clientY);if(B.setFromCamera(o,h),null!=N){var a=B.intersectObject(N,!0);if(0<a.length){var s=function t(e,n){if(!(n>=e.length)){var i=e[n].object;if("isSphere"in i)yt(i.uuid)&&(i=t(e,n+1));else{var r=function(t){for(var e=t;"Scene"!=e.type&&"Object3D"!=e.type;)e=e.parent;return e}(i);i=yt(r.name)?t(e,n+1):r}return i}}(a,0);s&&("isSphere"in s?(vt(!0,!0),st(s,!1,!0,!0)):(gt(!0),at(s,!1,!0,!0)),s=null)}else vt(!0,!0),gt(!0)}}}else i==M?P&=~M:r==S&&(P&=~S);P==w&&(L=b,document.removeEventListener("mouseup",t,!1),p==u&&document.removeEventListener("mousemove",Rt,!1)),R=T,r=i=n=null};o.addEventListener("mousedown",Tt,!1),o.addEventListener("contextmenu",Et,!1),o.addEventListener("wheel",Ct,!1);function kt(t){ft&&ft.keydown(t)}function zt(t){ft&&ft.keyup(t)}this.update=function(){var t=pt.getDelta();ct&&ct.update(t),ft&&ft.update(t)},this.startThirdPersonRoam=function(){(dt||(window.addEventListener("keydown",kt,!1),window.addEventListener("keyup",zt,!1)),dt=!0,lt)?(wt(!0),ft&&ft.start()):(new Td).load("model/thirdpersonmodel.glb",function(t){if(t&&void 0!==t&&t.scene&&void 0!==t.scene){if(lt=t.scene,t.animations&&t.animations.length){ct=new $u(lt),ut=t.animations;for(var e=0;e!=ut.length;++e)ct.clipAction(ut[e]).play()}t=null;var n=new Nn;n.setFromObject(lt);var i=new Qe;n.getCenter(i);var r=new Je,o=new Je,a=new Je;o.makeTranslation(-i.x,-i.y,-i.z),a.makeRotationAxis(d,Ye.degToRad(90)),r.multiplyMatrices(a,o),o.makeTranslation(i.x,i.y,i.z);var s=new Je;s.makeTranslation(0,0,1.5),o.multiplyMatrices(o,s),r.multiplyMatrices(o,r),lt.applyMatrix(r),lt&&(l.add(lt),ft||(ft=new of(lt,h)).start()),wt(!0)}},function(t){},function(t){})},this.endThirdPersonRoam=function(){dt&&(window.removeEventListener("keydown",kt,!1),window.removeEventListener("keyup",zt,!1)),dt=!1},this.reset=function(){this.endSelectVertice(),this.endThirdPersonRoam()},this.dispose=function(){reset(),o.removeEventListener("mousedown",Tt,!1),o.removeEventListener("contextmenu",Et,!1),o.removeEventListener("wheel",Ct,!1),document.removeEventListener("mousemove",this.documentMouseMove,!1),document.removeEventListener("mouseup",this.documentMouseUp,!1),U=!1,it=nt=et=tt=$=Q=K=J=Z=Y=X=q=W=H=G=V=j=N=B=D=I=e=z=k=O=x=y=g=v=m=f=s=null},this.onsize=function(t,e){this.cameraRightDeltaAngle=2*Math.PI/(1.5*o.clientWidth),this.cameraUpDeltaAngle=2*Math.PI/(2*o.clientHeight),this.resizeMeasures(t,e)}}function Ef(r,t,e){var o=null,a=null,s=new Qe,h=new Qe,l=null,c=null,n=new Je;n.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse);var i=new Gn;i.setFromMatrix(n);function u(){h.copy(s),h.project(t),h.x=(h.x+1)/2*r.offsetWidth,h.y=(1-h.y)/2*r.offsetHeight}e=e;this.create=function(t,e,n,i){null==o&&null==a&&(o=document.createElement("div"),(a=document.createElement("img")).className="oas_imgl",l=.5*n,c=i,s.copy(t),u(),o.style.position="absolute",o.appendChild(a),o.style.zIndex="3",a.src=e,o.style.left=h.x-l+"px",o.style.top=h.y-i+"px",a.width=n,a.height=i,r.appendChild(o))},this.edit=function(t,e,n){null!=o&&null!=a&&(a.src=t,e&&(a.width=e),n&&(a.height=n))},this.render=function(){n.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),i.setFromMatrix(n),i.containsPoint(s)?o.style.visibility="visible":o.style.visibility="hidden",u(),o.style.left=h.x-l+"px",o.style.top=h.y-c+"px"},this.dispose=function(){o.removeChild(a),r.removeChild(o),n=i=c=l=s=h=a=o=null},this.onClick=function(t){a.onclick=function(){void 0!==e&&t(e)}}}function Af(r,t,e){var o=null,a=null,s=null,h=120,l=new Qe,c=new Qe,n=new Je;n.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse);function u(){c.copy(l),c.project(t),c.x=(c.x+1)/2*r.offsetWidth,c.y=(1-c.y)/2*r.offsetHeight}var i=new Gn,p=13;this.create=function(t,e,n){if(null==o){n=function(t){return(t=wf.defaultValue(t,{})).opacity=wf.defaultValue(t.opacity,.8),t.fontSize=wf.defaultValue(t.fontSize,13),t.width=wf.defaultValue(t.width,150),t.background=wf.defaultValue(t.background,15658734),t.textColor=wf.defaultValue(t.textColor,0),t.borderColor=wf.defaultValue(t.borderColor,11184810),t}(n),l.copy(t),u(),h=n.width,(o=document.createElement("div")).style.zIndex="3",o.style.opacity=n.opacity.toString(),o.style.position="absolute",a=document.createElement("a"),o.appendChild(a),a.style.fontSize=n.fontSize+"px",p=n.fontSize,a.style.width=h+"px",a.style.display="block",a.style.height="auto",a.style.textAlign="center",a.style.textDecoration="none",a.style.msUserSelect="none",a.style.userSelect="none",a.style.webkitUserSelect="none",a.style.background=wf.hex2CSSRGB(n.background),a.style.color=wf.hex2CSSRGB(n.textColor),a.style.padding="5px 10px",a.style.borderRadius="10px",a.style.border="2px solid",a.style.borderColor=wf.hex2CSSRGB(n.borderColor),a.href="javascript:void(0)",o.style.left=c.x-.5*o.clientWidth+"px",o.style.top=c.y-10-.5*o.clientHeight+"px",a.innerHTML=e,s=document.createElement("div"),o.appendChild(s),s.style.position="relative",s.style.width="0",s.style.height="0",s.style.borderTop="10px solid "+a.style.borderColor,s.style.borderLeft="6px solid transparent",s.style.borderRight="6px solid transparent",s.style.left="50%",s.style.marginLeft="-6px",s.style.top="0px",r.appendChild(o);var i=wf.getTextWidth(p,e);i<h&&(a.style.width=i+"px"),this.render()}},this.edit=function(t,e){if((e=wf.defaultValue(e,{})).opacity&&(o.style.opacity=e.opacity.toString()),e.fontSize&&(a.style.fontSize=e.fontSize+"px",p=e.fontSize),e.width&&(h=e.width,a.style.width=h+"px"),e.background&&(a.style.background=wf.hex2CSSRGB(e.background)),e.textColor&&(a.style.color=wf.hex2CSSRGB(e.textColor)),e.borderColor&&(a.style.borderColor=wf.hex2CSSRGB(e.borderColor),s.style.borderTop="10px solid "+a.style.borderColor),null!=o){a.innerHTML=t;var n=wf.getTextWidth(p,t);a.style.width=n<h?n+"px":h+"px",this.render()}},this.render=function(){n.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),i.setFromMatrix(n),i.containsPoint(l)?o.style.visibility="visible":o.style.visibility="hidden",u(),o.style.left=c.x-.5*o.clientWidth+"px",o.style.top=c.y-o.offsetHeight+"px"},this.dispose=function(){o.removeChild(a),o.removeChild(s),r.removeChild(o),n=i=c=l=o=null},this.onClick=function(t){a.onclick=function(){void 0!==e&&t(e)}}}function Cf(t){var K=this;this.View=t;var Q=new Qe(1,0,0),$=new Qe(-1,0,0),tt=new Qe(0,1,0),et=new Qe(0,-1,0),nt=new Qe(0,0,1),W=new Qe(0,0,-1),it=new Qe(0,-.5,0),rt=new Qe(0,.5,0),ot=new Qe(-.5,0,0),at=new Qe(.5,0,0),st=new Qe(0,0,.5),ht=new Qe(0,0,-.5),q=new Qe(0,-.5,.5),X=new Qe(0,-.5,-.5),Y=new Qe(0,.5,.5),Z=new Qe(0,.5,-.5),J=new Qe(-.5,0,.5),lt=new Qe(-.5,0,-.5),ct=new Qe(.5,0,-.5),ut=new Qe(.5,0,.5),pt=new Qe(-.5,-.5,0),dt=new Qe(.5,-.5,0),ft=new Qe(.5,.5,0),mt=new Qe(-.5,.5,0),P=new Qe(.5,-.5,.5),R=new Qe(.5,-.5,-.5),O=new Qe(-.5,-.5,.5),k=new Qe(-.5,-.5,-.5),z=new Qe(.5,.5,.5),I=new Qe(.5,.5,-.5),D=new Qe(-.5,.5,.5),B=new Qe(-.5,.5,-.5),n=new Qe(0,0,-.6),vt=new Qe(1.15,0,-.59),gt=new Qe(0,-1.15,-.59),yt=new Qe(-1.15,0,-.59),xt=new Qe(0,1.15,-.59),bt=new al({color:5592405,flatShading:!0}),o=new zs({color:5592405,linewidth:2}),wt=.5*Math.PI;this.frontMesh=null,this.backMesh=null,this.leftMesh=null,this.rightMesh=null,this.topMesh=null,this.bottomMesh=null,this.frontTextMesh=null,this.backTextMesh=null,this.leftTextMesh=null,this.rightTextMesh=null,this.topTextMesh=null,this.bottomTextMesh=null,this.eastTextMesh=null,this.eastPlaneMesh=null,this.southTextMesh=null,this.southPlaneMesh=null,this.westTextMesh=null,this.westPlaneMesh=null,this.northTextMesh=null,this.northPlaneMesh=null,this.ftMesh=null,this.btMesh=null,this.fbMesh=null,this.bbMesh=null,this.tlMesh=null,this.lbMesh=null,this.rtMesh=null,this.rbMesh=null,this.flMesh=null,this.frMesh=null,this.brMesh=null,this.blMesh=null,this.ftrMesh=null,this.fbrMesh=null,this.ftlMesh=null,this.fblMesh=null,this.btrMesh=null,this.bbrMesh=null,this.btlMesh=null,this.bblMesh=null,this.bottomCavhollowCircleMesh=null,this.curSelectMesh=null,this.selectColorRed=30/255,this.selectColorGreen=144/255,this.selectColorBlue=1,this.lastSelectColorRed=150/255,this.lastSelectColorGreen=this.lastSelectColorRed,this.lastSelectColorBlue=this.lastSelectColorRed,this.webglRender=new ws({alpha:!0,antialias:!0}),this.webglRender.setClearColor(16777215,0),this.rendererWidth=128,this.webglRender.setSize(this.rendererWidth,this.rendererWidth),this.scene=new Ss,this.camera=new Ua(45,this.rendererWidth/this.rendererWidth,.01,1e3),this.camera.up.set(0,0,1),this.camera.lookAt(new Qe),this.scene.add(this.camera),this.lightTargetObject=new Ci,this.globalLight=new dc(16777215,1),this.globalLight.position.set(1,1,1).normalize(),this.globalLight.intensity=.7,this.globalLight.target=this.lightTargetObject,this.scene.add(this.globalLight),this.ambientLight=new fc(8900346,.5),this.scene.add(this.ambientLight),this.axis=null,this.axisRenderContainer=document.createElement("div"),this.axisRenderContainer.id="oasviewcube",this.axisRenderContainer.style.position="absolute",this.axisRenderContainer.style.zIndex="2",this.axisRenderContainer.style.left=this.View.DivViewer.offsetWidth-this.rendererWidth+"px",this.axisRenderContainer.style.top="0px",this.axisRenderContainer.style.right="0px",this.axisRenderContainer.width=this.rendererWidth,this.axisRenderContainer.height=this.rendererWidth,this.View.DivViewer.appendChild(this.axisRenderContainer),this.axisRenderContainer.appendChild(this.webglRender.domElement),this.m_bStopRender=!1,this.material=new al({color:16777215,transparent:!0}),this.material.opacity=.7,this.material.side=Tt,this.fontLoader=new zc,this.fontLoader.load("/webgl/helvetiker_bold.typeface.json",function(t){K.font=t,K.init()}),this.rayCaster=new rp,this.onContextMenu=function(t){t.preventDefault()},this.onMouseDown=function(t){t.preventDefault(),null!=K.curSelectMesh&&(K.curSelectMesh==K.bottomCavhollowCircleMesh||(K.curSelectMesh==K.frontMesh?K.View.lookTo(cf.Front,!0):K.curSelectMesh==K.backMesh?K.View.lookTo(cf.Back,!0):K.curSelectMesh==K.leftMesh?K.View.lookTo(cf.Left,!0):K.curSelectMesh==K.rightMesh?K.View.lookTo(cf.Right,!0):K.curSelectMesh==K.topMesh?K.View.lookTo(cf.Top,!0):K.curSelectMesh==K.bottomMesh?K.View.lookTo(cf.Bottom,!0):K.curSelectMesh==K.ftMesh?K.View.lookTo(cf.FrontTop,!0):K.curSelectMesh==K.btMesh?K.View.lookTo(cf.BackTop,!0):K.curSelectMesh==K.fbMesh?K.View.lookTo(cf.FrontBottom,!0):K.curSelectMesh==K.bbMesh?K.View.lookTo(cf.BackBottom,!0):K.curSelectMesh==K.tlMesh?K.View.lookTo(cf.LeftTop,!0):K.curSelectMesh==K.lbMesh?K.View.lookTo(cf.LeftBottom,!0):K.curSelectMesh==K.rtMesh?K.View.lookTo(cf.RightTop,!0):K.curSelectMesh==K.rbMesh?K.View.lookTo(cf.RightBottom,!0):K.curSelectMesh==K.flMesh?K.View.lookTo(cf.FrontLeft,!0):K.curSelectMesh==K.frMesh?K.View.lookTo(cf.FrontRight,!0):K.curSelectMesh==K.brMesh?K.View.lookTo(cf.RightBack,!0):K.curSelectMesh==K.blMesh?K.View.lookTo(cf.BackLeft,!0):K.curSelectMesh==K.ftrMesh?K.View.lookTo(cf.FrontRightTop,!0):K.curSelectMesh==K.fbrMesh?K.View.lookTo(cf.FrontRightBottom,!0):K.curSelectMesh==K.ftlMesh?K.View.lookTo(cf.FrontLeftTop,!0):K.curSelectMesh==K.fblMesh?K.View.lookTo(cf.FrontLeftBottom,!0):K.curSelectMesh==K.btrMesh?K.View.lookTo(cf.BackRightTop,!0):K.curSelectMesh==K.bbrMesh?K.View.lookTo(cf.BackRightBottom,!0):K.curSelectMesh==K.btlMesh?K.View.lookTo(cf.BackLeftTop,!0):K.curSelectMesh==K.bblMesh?K.View.lookTo(cf.BackLeftBottom,!0):K.curSelectMesh==K.eastTextMesh?K.View.lookTo(cf.East,!0):K.curSelectMesh==K.southTextMesh?K.View.lookTo(cf.South,!0):K.curSelectMesh==K.westTextMesh?K.View.lookTo(cf.West,!0):K.curSelectMesh==K.northTextMesh&&K.View.lookTo(cf.North,!0)))},this.onMouseMove=function(t){t.preventDefault();var e=K.axisRenderContainer.getBoundingClientRect(),n=t.clientX,i=t.clientY,r=new Ze;r.set((n-e.left)/e.width*2-1,(i-e.top)/e.height*-2+1),K.rayCaster.setFromCamera(r,K.camera);var o=K.rayCaster.intersectObject(K.axis,!0),a=0,s=o.length;if(0<s){for(var h=o[a];"LineSegments"==h.object.type&&a!=s-1;)h=o[++a];if("LineSegments"!=h.object.type){var l=h.object;l==K.frontTextMesh?l=K.frontMesh:l==K.backTextMesh?l=K.backMesh:l==K.leftTextMesh?l=K.leftMesh:l==K.rightTextMesh?l=K.rightMesh:l==K.topTextMesh?l=K.topMesh:l==K.bottomTextMesh?l=K.bottomMesh:l==K.eastPlaneMesh?l=K.eastTextMesh:l==K.southPlaneMesh?l=K.southTextMesh:l==K.westPlaneMesh?l=K.westTextMesh:l==K.northPlaneMesh&&(l=K.northTextMesh),K.curSelectMesh!=l&&(null!=K.curSelectMesh&&(K.curSelectMesh.material.color.setRGB(K.lastSelectColorRed,K.lastSelectColorGreen,K.lastSelectColorBlue),K.curSelectMesh=null),K.lastSelectColorRed=l.material.color.r,K.lastSelectColorGreen=l.material.color.g,K.lastSelectColorBlue=l.material.color.b,K.curSelectMesh=l,K.curSelectMesh.material.color.setRGB(K.selectColorRed,K.selectColorGreen,K.selectColorBlue)),K.render()}else null!=K.curSelectMesh&&(K.curSelectMesh.material.color.setRGB(K.lastSelectColorRed,K.lastSelectColorGreen,K.lastSelectColorBlue),K.curSelectMesh=null,K.render())}else null!=K.curSelectMesh&&(K.curSelectMesh.material.color.setRGB(K.lastSelectColorRed,K.lastSelectColorGreen,K.lastSelectColorBlue),K.curSelectMesh=null,K.render())},this.config={textConfig:{fontSize:.25,fontHeight:0,curveSegments:4}},this.init=function(){null==K.axis&&(K.axis=new Na,K.axis.name="bim_axis_root",K.scene.add(K.axis)),function(){var t=new Float32Array([-.4,-.4,0,.4,-.4,0,.4,.4,0,-.4,.4,0]),e=new Float32Array([0,-1,0,0,-1,0,0,-1,0,0,-1,0]),n=new Float32Array([0,0,1,0,1,1,0,1]),i=new sr;i.setIndex([0,1,2,0,2,3]),i.addAttribute("position",new qi(t,3)),i.addAttribute("normal",new qi(e,3)),i.computeVertexNormals(),i.addAttribute("uv",new qi(n,2));var r=new al;r.copy(K.material),K.frontMesh=new io(i,r);var o=new Na,a=new Je;a.makeRotationAxis(Q,wt),a.setPosition(it),o.add(K.frontMesh),o.applyMatrix(a);var s=new al;s.copy(K.material),K.backMesh=new io(i,s);var h=new Na,l=new Je;l.makeRotationAxis($,wt),l.setPosition(rt),h.add(K.backMesh),h.applyMatrix(l);var c=new al;c.copy(K.material),K.leftMesh=new io(i,c);var u=new Na,p=new Je;p.makeRotationAxis(et,wt),p.setPosition(ot),u.add(K.leftMesh),u.applyMatrix(p);var d=new al;d.copy(K.material),K.rightMesh=new io(i,d);var f=new Na,m=new Je;m.makeRotationAxis(tt,wt),m.setPosition(at),f.add(K.rightMesh),f.applyMatrix(m);var v=new al;v.copy(K.material),K.topMesh=new io(i,v);var g=new Na,y=new Je;y.setPosition(st),g.add(K.topMesh),g.applyMatrix(y);var x=new al;x.copy(K.material),K.bottomMesh=new io(i,x);var b=new Na,w=new Je;w.setPosition(ht),b.add(K.bottomMesh),b.applyMatrix(w),K.axis.add(o),K.axis.add(h),K.axis.add(u),K.axis.add(f),K.axis.add(g),K.axis.add(b)}(),function(){var t=new Float32Array([-.4,.1,0,.4,.1,0,-.4,0,0,.4,0,0,-.4,0,-.1,.4,0,-.1]),e=new Float32Array([0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0]),n=new sr;n.setIndex([0,2,3,0,3,1,2,4,5,2,5,3]),n.addAttribute("position",new qi(t,3)),n.addAttribute("normal",new qi(e,3)),n.computeVertexNormals();var i=new al;i.copy(K.material),K.ftMesh=new io(n,i);var r=new Na,o=new Je;o.setPosition(q),r.add(K.ftMesh),r.applyMatrix(o);var a=new al;a.copy(K.material),K.btMesh=new io(n,a);var s=new Na,h=new Je;h.makeRotationAxis($,wt),h.setPosition(Y),s.add(K.btMesh),s.applyMatrix(h);var l=new al;l.copy(K.material),K.fbMesh=new io(n,l);var c=new Na,u=new Je;u.makeRotationAxis(Q,wt),u.setPosition(X),c.add(K.fbMesh),c.applyMatrix(u);var p=new al;p.copy(K.material),K.bbMesh=new io(n,p);var d=new Na,f=new Je;f.makeRotationAxis($,Math.PI),f.setPosition(Z),d.add(K.bbMesh),d.applyMatrix(f);var m=new al;m.copy(K.material),K.tlMesh=new io(n,m);var v=new Na,g=new Je;g.makeRotationAxis(W,wt),g.setPosition(J),v.add(K.tlMesh),v.applyMatrix(g);var y=new al;y.copy(K.material),K.lbMesh=new io(n,y);var x=new Na,b=new Je;b.makeRotationAxis(W,wt);var w=new Je;w.makeRotationAxis(et,wt),b.premultiply(w),b.setPosition(lt),x.add(K.lbMesh),x.applyMatrix(b),w=null;var _=new al;_.copy(K.material),K.rtMesh=new io(n,_);var M=new Na,S=new Je;S.makeRotationAxis(nt,wt),S.setPosition(ut),M.add(K.rtMesh),M.applyMatrix(S);var T=new al;T.copy(K.material),K.rbMesh=new io(n,T);var E=new Na,A=new Je;A.makeRotationAxis(nt,wt);var C=new Je;C.makeRotationAxis(tt,wt),A.premultiply(C),A.setPosition(ct),E.add(K.rbMesh),E.applyMatrix(A),C=null;var L=new al;L.copy(K.material),K.flMesh=new io(n,L);var P=new Na,R=new Je;R.makeRotationAxis(W,wt);var O=new Je;O.makeRotationAxis(Q,wt),R.premultiply(O),R.setPosition(pt),P.add(K.flMesh),P.applyMatrix(R),O=null;var k=new al;k.copy(K.material),K.frMesh=new io(n,k);var z=new Na,I=new Je;I.makeRotationAxis(nt,wt);var D=new Je;D.makeRotationAxis(Q,wt),I.premultiply(D),I.setPosition(dt),z.add(K.frMesh),z.applyMatrix(I),D=null;var B=new al;B.copy(K.material),K.brMesh=new io(n,B);var N=new Na,F=new Je;F.makeRotationAxis(nt,wt);var U=new Je;U.makeRotationAxis($,wt),F.premultiply(U),F.setPosition(ft),N.add(K.brMesh),N.applyMatrix(F),U=null;var j=new al;j.copy(K.material),K.blMesh=new io(n,j);var V=new Na,G=new Je;G.makeRotationAxis(W,wt);var H=new Je;H.makeRotationAxis($,wt),G.premultiply(H),G.setPosition(mt),V.add(K.blMesh),V.applyMatrix(G),H=null,K.axis.add(r),K.axis.add(s),K.axis.add(c),K.axis.add(d),K.axis.add(v),K.axis.add(x),K.axis.add(M),K.axis.add(E),K.axis.add(P),K.axis.add(z),K.axis.add(N),K.axis.add(V)}(),function(){var t=new Float32Array([0,0,0,-.1,0,0,-.1,0,-.1,0,0,-.1,0,.1,0,0,.1,-.1,-.1,.1,0]),e=new Float32Array([0,0,1,0,0,1,0,-1,0,0,-1,0,0,0,1,1,0,0,0,0,1]),n=new sr;n.setIndex([0,1,2,0,2,3,0,3,5,0,5,4,6,1,0,6,0,4]),n.addAttribute("position",new qi(t,3)),n.addAttribute("normal",new qi(e,3)),n.computeVertexNormals();var i=new al;i.copy(K.material),K.ftrMesh=new io(n,i);var r=new Na,o=new Je;o.setPosition(P),r.add(K.ftrMesh),r.applyMatrix(o);var a=new al;a.copy(K.material),K.fbrMesh=new io(n,a);var s=new Na,h=new Je;h.makeRotationAxis(Q,Math.PI);var l=new Je;l.makeRotationAxis(W,wt),h.premultiply(l),h.setPosition(R),s.add(K.fbrMesh),s.applyMatrix(h),l=null;var c=new al;c.copy(K.material),K.ftlMesh=new io(n,c);var u=new Na,p=new Je;p.makeRotationAxis(W,wt),p.setPosition(O),u.add(K.ftlMesh),u.applyMatrix(p);var d=new al;d.copy(K.material),K.fblMesh=new io(n,d);var f=new Na,m=new Je;m.makeRotationAxis(Q,Math.PI);var v=new Je;v.makeRotationAxis(W,Math.PI),m.premultiply(v),m.setPosition(k),f.add(K.fblMesh),f.applyMatrix(m),v=null;var g=new al;g.copy(K.material),K.btrMesh=new io(n,g);var y=new Na,x=new Je;x.makeRotationAxis(nt,wt),x.setPosition(z),y.add(K.btrMesh),y.applyMatrix(x);var b=new al;b.copy(K.material),K.bbrMesh=new io(n,b);var w=new Na,_=new Je;_.makeRotationAxis(Q,Math.PI),_.setPosition(I),w.add(K.bbrMesh),w.applyMatrix(_);var M=new al;M.copy(K.material),K.btlMesh=new io(n,M);var S=new Na,T=new Je;T.makeRotationAxis(nt,Math.PI),T.setPosition(D),S.add(K.btlMesh),S.applyMatrix(T);var E=new al;E.copy(K.material),K.bblMesh=new io(n,E);var A=new Na,C=new Je;C.makeRotationAxis(Q,Math.PI);var L=new Je;L.makeRotationAxis(nt,wt),C.premultiply(L),C.setPosition(B),A.add(K.bblMesh),A.applyMatrix(C),L=null,K.axis.add(r),K.axis.add(s),K.axis.add(u),K.axis.add(f),K.axis.add(y),K.axis.add(w),K.axis.add(S),K.axis.add(A)}(),function(){var t=new Float32Array([.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,.5,-.5,-.5,.5,-.5,-.5,-.5,-.5,.5,-.5,-.5]),e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new sr;n.setIndex(new Ni(e,1)),n.addAttribute("position",new qi(t,3));var i=new Ds(n,o),r=new Na;r.add(i),K.axis.add(r),n=i=r=null}(),function(){var t=new no({color:14540253});t.side=Tt,t.opacity=.7,t.transparent=!0,K.bottomCavhollowCircleMesh=new io(new jh(1.03,1.27,30,1,0,2*Math.PI),t);var e=new Na;K.axis.add(e),e.add(K.bottomCavhollowCircleMesh),e.position.copy(n)}(),function(){var t=new Nh("Front",{font:K.font,size:K.config.textConfig.fontSize,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});t.computeBoundingBox(),t.computeVertexNormals(),K.frontTextMesh=new io(t,bt);var e=-.5*(t.boundingBox.max.x-t.boundingBox.min.x),n=-.5*(t.boundingBox.max.y-t.boundingBox.min.y)+.06;K.frontTextMesh.position.x=e,K.frontTextMesh.position.y=n;var i=new Na,r=new Je;r.makeRotationAxis(Q,wt);var o=(new Qe).copy(it);o.y-=.001,r.setPosition(o),i.add(K.frontTextMesh),i.applyMatrix(r);var a=new Nh("Back",{font:K.font,size:K.config.textConfig.fontSize,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});a.computeBoundingBox(),a.computeVertexNormals(),K.backTextMesh=new io(a,bt),e=-.5*(a.boundingBox.max.x-a.boundingBox.min.x),n=-.5*(a.boundingBox.max.y-a.boundingBox.min.y)+.06,K.backTextMesh.position.x=e,K.backTextMesh.position.y=n;var s=new Na,h=new Je;h.makeRotationAxis(nt,Math.PI);var l=new Je;l.makeRotationAxis($,wt),h.premultiply(l);var c=(new Qe).copy(rt);c.y+=.001,h.setPosition(c),s.add(K.backTextMesh),s.applyMatrix(h);var u=new Nh("Left",{font:K.font,size:K.config.textConfig.fontSize,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});u.computeBoundingBox(),u.computeVertexNormals(),K.leftTextMesh=new io(u,bt),e=-.5*(u.boundingBox.max.x-u.boundingBox.min.x),n=-.5*(u.boundingBox.max.y-u.boundingBox.min.y)+.06,K.leftTextMesh.position.x=e,K.leftTextMesh.position.y=n;var p=new Na,d=new Je;d.makeRotationAxis(nt,-wt);var f=new Je;f.makeRotationAxis(et,wt),d.premultiply(f);var m=(new Qe).copy(ot);m.x-=.001,d.setPosition(m),p.add(K.leftTextMesh),p.applyMatrix(d);var v=new Nh("Right",{font:K.font,size:K.config.textConfig.fontSize,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});v.computeBoundingBox(),v.computeVertexNormals(),K.rightTextMesh=new io(v,bt),e=-.5*(v.boundingBox.max.x-v.boundingBox.min.x),n=-.5*(v.boundingBox.max.y-v.boundingBox.min.y)+.06,K.rightTextMesh.position.x=e,K.rightTextMesh.position.y=n;var g=new Na,y=new Je;y.makeRotationAxis(nt,wt);var x=new Je;x.makeRotationAxis(tt,wt),y.premultiply(x);var b=(new Qe).copy(at);b.x+=.001,y.setPosition(b),g.add(K.rightTextMesh),g.applyMatrix(y);var w=new Nh("Top",{font:K.font,size:K.config.textConfig.fontSize,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});w.computeBoundingBox(),w.computeVertexNormals(),K.topTextMesh=new io(w,bt),e=-.5*(w.boundingBox.max.x-w.boundingBox.min.x),n=-.5*(w.boundingBox.max.y-w.boundingBox.min.y)+.06,K.topTextMesh.position.x=e,K.topTextMesh.position.y=n;var _=new Na,M=new Je,S=(new Qe).copy(st);S.z+=.001,M.setPosition(S),_.add(K.topTextMesh),_.applyMatrix(M);var T=new Nh("Bottom",{font:K.font,size:K.config.textConfig.fontSize-.05,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});T.computeBoundingBox(),T.computeVertexNormals(),K.bottomTextMesh=new io(T,bt),e=-.5*(T.boundingBox.max.x-T.boundingBox.min.x),n=-.5*(T.boundingBox.max.y-T.boundingBox.min.y)+.06,K.bottomTextMesh.position.x=e,K.bottomTextMesh.position.y=n;var E=new Na,A=new Je;A.makeRotationAxis(Q,Math.PI);var C=(new Qe).copy(ht);C.z-=.001,A.setPosition(C),E.add(K.bottomTextMesh),E.applyMatrix(A);var L=new al({color:5592405,flatShading:!0}),P=new Nh("east",{font:K.font,size:K.config.textConfig.fontSize+.05,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});P.computeBoundingBox(),P.computeVertexNormals(),K.eastTextMesh=new io(P,L);var R=Math.abs(P.boundingBox.max.x-P.boundingBox.min.x),O=Math.abs(P.boundingBox.max.y-P.boundingBox.min.y);e=-.5*(P.boundingBox.max.x-P.boundingBox.min.x),n=-.5*(P.boundingBox.max.y-P.boundingBox.min.y),K.eastTextMesh.position.x=e,K.eastTextMesh.position.y=n;var k=new rl({color:16777215,transparent:!0});k.opacity=0,k.side=Tt,K.eastPlaneMesh=new io(new ur(R,O,1,1),k);var z=new Na,I=new Je;I.makeRotationAxis(nt,-wt),I.setPosition(vt),z.add(K.eastTextMesh),z.add(K.eastPlaneMesh),z.applyMatrix(I);var D=new al({color:5592405,flatShading:!0}),B=new Nh("south",{font:K.font,size:K.config.textConfig.fontSize+.05,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});B.computeBoundingBox(),B.computeVertexNormals(),K.southTextMesh=new io(B,D),R=Math.abs(B.boundingBox.max.x-B.boundingBox.min.x),O=Math.abs(B.boundingBox.max.y-B.boundingBox.min.y),e=-.5*(B.boundingBox.max.x-B.boundingBox.min.x),n=-.5*(B.boundingBox.max.y-B.boundingBox.min.y),K.southTextMesh.position.x=e,K.southTextMesh.position.y=n;var N=new rl({color:16777215,transparent:!0});N.opacity=0,N.side=Tt,K.southPlaneMesh=new io(new ur(R,O,1,1),N);var F=new Na,U=new Je;U.makeRotationAxis(nt,Math.PI),U.setPosition(gt),F.add(K.southTextMesh),F.add(K.southPlaneMesh),F.applyMatrix(U);var j=new al({color:5592405,flatShading:!0}),V=new Nh("west",{font:K.font,size:K.config.textConfig.fontSize+.05,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});V.computeBoundingBox(),V.computeVertexNormals(),K.westTextMesh=new io(V,j),R=Math.abs(V.boundingBox.max.x-V.boundingBox.min.x),O=Math.abs(V.boundingBox.max.y-V.boundingBox.min.y),e=-.5*(V.boundingBox.max.x-V.boundingBox.min.x),n=-.5*(V.boundingBox.max.y-V.boundingBox.min.y),K.westTextMesh.position.x=e,K.westTextMesh.position.y=n;var G=new rl({color:16777215,transparent:!0});G.opacity=0,G.side=Tt,K.westPlaneMesh=new io(new ur(R,O,1,1),G);var H=new Na,W=new Je;W.makeRotationAxis(nt,wt),W.setPosition(yt),H.add(K.westTextMesh),H.add(K.westPlaneMesh),H.applyMatrix(W);var q=new al({color:5592405,flatShading:!0}),X=new Nh("north",{font:K.font,size:K.config.textConfig.fontSize+.05,height:K.config.textConfig.fontHeight,curveSegments:K.config.textConfig.curveSegments});X.computeBoundingBox(),X.computeVertexNormals(),K.northTextMesh=new io(X,q),R=Math.abs(X.boundingBox.max.x-X.boundingBox.min.x),O=Math.abs(X.boundingBox.max.y-X.boundingBox.min.y),e=-.5*(X.boundingBox.max.x-X.boundingBox.min.x),n=-.5*(X.boundingBox.max.y-X.boundingBox.min.y),K.northTextMesh.position.x=e,K.northTextMesh.position.y=n;var Y=new rl({color:16777215,transparent:!0});Y.opacity=0,Y.side=Tt,K.northPlaneMesh=new io(new ur(R,O,1,1),Y);var Z=new Na,J=new Je;J.setPosition(xt),Z.add(K.northTextMesh),Z.add(K.northPlaneMesh),Z.applyMatrix(J),K.axis.add(i),K.axis.add(s),K.axis.add(p),K.axis.add(g),K.axis.add(_),K.axis.add(E),K.axis.add(z),K.axis.add(F),K.axis.add(H),K.axis.add(Z),K.render()}(),K.axisRenderContainer.addEventListener("contextmenu",K.onContextMenu,!1),K.axisRenderContainer.addEventListener("mousedown",K.onMouseDown,!1),K.axisRenderContainer.addEventListener("mousemove",K.onMouseMove,!1)}}function Lf(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}function Pf(t,e){Lf.call(this),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}function Rf(){Lf.call(this),this.needsSwap=!1}function Of(t,e){Lf.call(this),this.textureID=void 0!==e?e:"tDiffuse",t instanceof $r?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=Yn.clone(t.uniforms),this.material=new $r({defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.camera=new uc(-1,1,1,-1,0,1),this.scene=new Ss,this.quad=new io(new ur(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)}Cf.prototype={dispose:function(){this.m_bStopRender=!0,this.axisRenderContainer.removeEventListener("contextmenu",this.onContextMenu,!1),this.axisRenderContainer.removeEventListener("mousedown",this.onMouseDown,!1),this.axisRenderContainer.removeEventListener("mousemove",this.onMouseMove,!1),this.onContextMenu=null,this.onMouseDown=null,this.onMouseMove=null,this.font=null,this.curSelectMesh=null,this.material=null,this.fontLoader=null,this.axis=null,this.webglRender.dispose(),this.camera=null,this.ambientLight=null,this.globalLight=null,this.lightTargetObject=null,this.axis=null,this.scene=null},reset:function(){},render:function(){if(1!=this.m_bStopRender){var t=this.View._PCamera.position.clone(),e=this.View.getCameraTarget().clone(),n=new Qe;n.subVectors(t,e),n.normalize(),this.camera.position.set(4*n.x,4*n.y,4*n.z);var i=new Qe(5*n.x,5*n.y,5*n.z);this.camera.up=this.View._PCamera.up.clone(),this.globalLight.position.copy(i),this.camera.lookAt(this.scene.position),this.webglRender.render(this.scene,this.camera),t=e=n=null}},onsize:function(t,e,n,i){this.axisRenderContainer.style.left=n-this.rendererWidth+"px",this.axisRenderContainer.style.bottom=i-this.rendererWidth+"px",this.camera.aspect=this.axisRenderContainer.offsetWidth/this.axisRenderContainer.offsetHeight,this.camera.updateProjectionMatrix(),this.webglRender.setSize(this.axisRenderContainer.offsetWidth,this.axisRenderContainer.offsetHeight)},setVisible:function(t){this.scene.visible=t}},Object.assign(Lf.prototype,{setSize:function(t,e){},render:function(t,e,n,i,r){console.error("OASISPass: .render() must be implemented in derived pass.")}}),Pf.prototype=Object.assign(Object.create(Lf.prototype),{constructor:Pf,render:function(t,e,n,i,r){var o,a,s=t.context,h=t.state;h.buffers.color.setMask(!1),h.buffers.depth.setMask(!1),h.buffers.color.setLocked(!0),h.buffers.depth.setLocked(!0),a=this.inverse?(o=0,1):(o=1,0),h.buffers.stencil.setTest(!0),h.buffers.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),h.buffers.stencil.setFunc(s.ALWAYS,o,4294967295),h.buffers.stencil.setClear(a),t.render(this.scene,this.camera,n,this.clear),t.render(this.scene,this.camera,e,this.clear),h.buffers.color.setLocked(!1),h.buffers.depth.setLocked(!1),h.buffers.stencil.setFunc(s.EQUAL,1,4294967295),h.buffers.stencil.setOp(s.KEEP,s.KEEP,s.KEEP)}}),Rf.prototype=Object.create(Lf.prototype),Object.assign(Rf.prototype,{render:function(t,e,n,i,r){t.state.buffers.stencil.setTest(!1)}}),Of.prototype=Object.assign(Object.create(Lf.prototype),{constructor:Of,render:function(t,e,n,i,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.quad.material=this.material,this.renderToScreen?t.render(this.scene,this.camera):t.render(this.scene,this.camera,e,this.clear)}});var kf={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};function zf(t,e){if(this.renderer=t,void 0===e){var n={minFilter:Bt,magFilter:Bt,format:te,stencilBuffer:!1},i=t.getDrawingBufferSize();(e=new In(i.width,i.height,n)).texture.name="EffectComposer.rt1"}this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.passes=[],void 0===kf&&console.error("OASISEffectComposer relies on OASISCopyShader"),this.copyPass=new Of(kf)}function If(t,e,n,i,r){Lf.call(this),this.scene=t,this.camera=e,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=void 0!==r?r:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1}Object.assign(zf.prototype,{swapBuffers:function(){var t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t},addPass:function(t){this.passes.push(t);var e=this.renderer.getDrawingBufferSize();t.setSize(e.width,e.height)},insertPass:function(t,e){this.passes.splice(e,0,t)},render:function(t){var e,n,i=!1,r=this.passes.length;for(n=0;n<r;n++)if(!1!==(e=this.passes[n]).enabled){if(e.render(this.renderer,this.writeBuffer,this.readBuffer,t,i),e.needsSwap){if(i){var o=this.renderer.context;o.stencilFunc(o.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),o.stencilFunc(o.EQUAL,1,4294967295)}this.swapBuffers()}e instanceof Pf?i=!0:e instanceof Rf&&(i=!1)}},reset:function(t){if(void 0===t){var e=this.renderer.getDrawingBufferSize();(t=this.renderTarget1.clone()).setSize(e.width,e.height)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(t,e){this.renderTarget1.setSize(t,e),this.renderTarget2.setSize(t,e);for(var n=0;n<this.passes.length;n++)this.passes[n].setSize(t,e)}}),If.prototype=Object.assign(Object.create(Lf.prototype),{constructor:If,render:function(t,e,n,i,r){var o,a,s=t.autoClear;t.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(o=t.getClearColor().getHex(),a=t.getClearAlpha(),t.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&t.clearDepth(),t.render(this.scene,this.camera,this.renderToScreen?null:n,this.clear),this.clearColor&&t.setClearColor(o,a),this.scene.overrideMaterial=null,t.autoClear=s}});var Df={uniforms:{tDiffuse:{value:null},resolution:{value:new Ze(1/1024,1/512)}},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","#define FXAA_REDUCE_MIN (1.0/128.0)","#define FXAA_REDUCE_MUL (1.0/8.0)","#define FXAA_SPAN_MAX 8.0","void main() {","vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;","vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;","vec4 rgbaM = texture2D( tDiffuse, gl_FragCoord.xy * resolution );","vec3 rgbM = rgbaM.xyz;","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float lumaNW = dot( rgbNW, luma );","float lumaNE = dot( rgbNE, luma );","float lumaSW = dot( rgbSW, luma );","float lumaSE = dot( rgbSE, luma );","float lumaM = dot( rgbM, luma );","float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );","float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );","vec2 dir;","dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));","dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));","float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );","float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );","dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),","max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),","dir * rcpDirMin)) * resolution;","vec4 rgbA = (1.0/2.0) * (","texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (1.0/3.0 - 0.5)) +","texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (2.0/3.0 - 0.5)));","vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (","texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (0.0/3.0 - 0.5)) +","texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (3.0/3.0 - 0.5)));","float lumaB = dot(rgbB, vec4(luma, 0.0));","if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {","gl_FragColor = rgbA;","} else {","gl_FragColor = rgbB;","}","}"].join("\n")};function Bf(){var n=[];this.add=function(t){-1==n.indexOf(t)&&n.push(t)},this.remove=function(t){var e=n.indexOf(t);-1!=e&&n.splice(e,1)},this.clear=function(){n=[]},this.isHave=function(t){return-1!=n.indexOf(t)}}function Nf(){var e=this;this.config={ambientLightConfig:{color:13421772,intensity:.95},mainLightConfig:{color:7829367,intensity:.75},front:new Qe(0,-1,0),right:new Qe(1,0,0),top:new Qe(0,0,1)},this._PCamera=new Ua(60,1,.1,1e4),this._PCamera.name="PCamera",this._PCamera.position.set(100,-100,100),this._PCamera.lookAt(new Qe);this.OCamera=new uc(-50,50,100,-100,1,10),this.OCamera.position.z=10,this.OScene=new Ss,this.webglRender=new ws({alpha:!0}),this.webglRender.autoClear=!1,this.webglRender.autoUpdateScene=!1,this.webglRender.setPixelRatio(window.devicePixelRatio),this.webglRender.setClearColor(0,0),this.DivViewer=document.createElement("div"),this.DivViewer.id="oasviewer",this.DivViewer.appendChild(this.webglRender.domElement),this.DivViewer.style.width="100%",this.DivViewer.style.height="100%",this.ambientLight=new fc(this.config.ambientLightConfig.color,this.config.ambientLightConfig.intensity),this.scene=new Ss,this.scene.name="scenes",this.scene.add(this.ambientLight),this.mainLight=new cc(this.config.mainLightConfig.color,this.config.mainLightConfig.intensity),this.scene.add(this.mainLight),this.sceneBox=new Nn,this.sceneBox.min.set(-1,-1,-1),this.sceneBox.max.set(1,1,1),this.rootMeasures=new Ci,this.rootMeasures.name="rootmeasures",this.scene.add(this.rootMeasures),this.root=null,this.rootEx=null,this.humenModel=null,this.rootSprites=null,this.loadManager=new Ll,this.imageLabelsMap={},this.textLabelsMap={},this.globleXYCutPlane=null,this.globleXZCutPlane=null,this.globleYZCutPlane=null,this.globleCutPlaneArray=[],this.webglRender.clippingPlanes=this.globleCutPlaneArray,this.webglRender.enableLocalClipping=!1,this.viewCube=new Cf(this),this.viewCube.setVisible(!0),this.effectComposer=new zf(this.webglRender),this.renderPass=new If(this.scene,this._PCamera),this.effectComposer.addPass(this.renderPass),this.effectFXAA=new Of(Df),this.effectFXAA.uniforms.resolution.value.set(1/this.DivViewer.offsetWidth,1/this.DivViewer.offsetHeight),this.effectFXAA.renderToScreen=!0,this.effectComposer.addPass(this.effectFXAA),this.mainControl=new Tf(this.webglRender.domElement,this._PCamera,this.scene,this.mainLight),this.mainControl.setRender(function(){e.render()}),this.mainControl.setAnimation(function(t){e.setAnimateCamera(t)}),this.mainControl.setSelectCallBack(0,function(t){e.modelSelectEvent.id=t,e.dispatchEvent(e.modelSelectEvent)}),this.mainControl.setSelectCallBack(1,function(t){e.sphereSelectEvent.id=t,e.dispatchEvent(e.sphereSelectEvent)}),this.mainControl.setIsolationCallBack(function(t){return e._isolations.isHave(t)}),this.mainControl.setRootMeasures(this.rootMeasures),this.loadedFiles=[],this.isThirdPersionRoam=!1,this._isolations=new Bf,this.editBackground(0,"#F8F8FF","#87CEFA"),this.modelSelectEvent={type:"ModelSelectEvent",id:""},this.modelLoadEvent={type:"LoadModelEvent",statusText:""},this.imgLabelClickEvent={type:"ImageLabelClickEvent",id:""},this.textLabelClickEvent={type:"TextLabelClickEvent",id:""},this.sphereSelectEvent={type:"SphereSelectEvent",id:""},this.OnLoadProgress=function(t){if(t.lengthComputeable){var e=t.loaded/t.total*100;console.log(Math.round(e,2)+"% downloaded")}},this.OnError=function(t){console.error(t)},this.getCameraTarget=function(){return this.mainControl.getCameraTarget()},this._requestAFID=null,this._startAnimateCamera=function(t){requestAnimationFrame(e._startAnimateCamera),e.isThirdPersionRoam?e.mainControl.update():Up(t),e.webglRender.render(e.scene,e._PCamera)},this.setAnimateCamera=function(t){t?null==this._requestAFID&&(this._requestAFID=requestAnimationFrame(this._startAnimateCamera)):null!=this._requestAFID&&(cancelAnimationFrame(this._requestAFID),this._requestAFID=null)},this.playAnimate=function(t,e){if(!this.isThirdPersionRoam){var n=this;this.setAnimateCamera(!0);var i=new dd(t);i.to(e,500),i.delay(200),i.easing(Vp.Sinusoidal.Out),i.interpolation(ld.Linear),i.repeat(0),i.on("update",function(t){n._PCamera.up.set(t.upx,t.upy,t.upz),n._PCamera.position.set(t.px,t.py,t.pz);var e=new Qe(t.tx,t.ty,t.tz);n.mainControl.setCameraTarget(e),n._PCamera.lookAt(e),n.viewCube.render(e)}),i.on("complete",function(){n.isThirdPersionRoam||n.setAnimateCamera(!1),n.render(),i.stop()}),i.start()}},this.lookTo(cf.FrontRightTop,!1),this.initRoot=function(){null==this.root&&(this.root=new Ci,this.root.name="roots",this.scene.add(this.root))},this.initRootEx=function(){null==this.rootEx&&(this.initRoot(),this.rootEx=new Ci,this.rootEx.name="rootsEx",this.root.add(this.rootEx))},this.initSprites=function(){null==this.rootSprites&&(this.rootSprites=new Ci,this.rootSprites.name="rootSprites",this.OScene.add(this.rootSprites))},this.addChildInRootEx=function(t){this.initRootEx(),this.rootEx.add(t),this.render()},this.findObjectMaxZCoordinate=function(t){var s=new Qe(0,0,-1e7);if(t.traverse(function(t){if(t.geometry){var e=t.geometry;if(e.isGeometry)for(var n=0;n!=e.vertices.length;++n){var i=new Qe;i.copy(e.vertices[n]),i.applyMatrix4(t.matrixWorld),i.z>s.z&&s.copy(i),i=null}else if(e.isBufferGeometry&&"position"in e.attributes)for(n=0;n!=e.attributes.position.count;++n){var r=e.attributes.position.getX(n),o=e.attributes.position.getY(n),a=e.attributes.position.getZ(n);a>s.z&&s.set(r,o,a)}}}),-1e7!=s.z)return s},this.findObjectMaxZCoordinateCloseToCenter=function(t){var e=new Nn;e.setFromObject(t);var o=new Qe;e.getCenter(o);var a=new Qe(0,0,-1e7);if(t.traverse(function(t){if(t instanceof io&&t.geometry){var e=t.geometry;if(e instanceof Bi)for(var n=0;n!=e.vertices.length;++n){var i=new Qe;i.copy(e.vertices[n]),i.applyMatrix4(t.matrixWorld),i.z>a.z?a.copy(i):i.z==a.z&&i.distanceTo(o)<a.distanceTo(o)&&a.copy(i)}else if(e instanceof sr&&"position"in e.attributes)for(n=0;n!=e.attributes.position.count;++n){var r=new Qe;if(r.x=e.attributes.position.getX(n),r.y=e.attributes.position.getY(n),r.z=e.attributes.position.getZ(n),r.z>a.z)a.copy(r);else if(r.z==a.z){r.distanceTo(o)<a.distanceTo(o)&&a.copy(r)}}}}),-1e7!=a.z)return a},this.findSphereMaxZCoordinate=function(t){var e=t.position,n=t.geometry.boundingSphere.radius;return new Qe(e.x,e.y,e.z+n)},this.pixelWidthComvertWnd=function(t,e){var n=this.webglRender.domElement.getBoundingClientRect(),i=new Ze;return i.set(2*t/n.width,2*e/n.height),i},this.createTextLabel=function(t,e,n,i,r){this.initSprites();var o=document.createElement("canvas"),a=o.getContext("2d").wrapText(i,r,1,1),s=new kn(o);s.minFilter=Bt,s.needsUpdate=!0;var h=new Cs(new As({map:s,sizeAttenuation:!1}));h.center.set(.5,.5),h.scale.set(a._width,a._height,1),h.position.set(300,10,1),this.rootSprites.add(h),this.render()}}Ci.DefaultUp=new Qe(0,0,1),Ci.prototype.newdelete=function(){if(this.hasOwnProperty("geometry")&&(this.geometry.dispose(),this.geometry=null),this.hasOwnProperty("material")){var t=this.material;if(t.hasOwnProperty("materials")){var e=t.materials;for(var n in e)e.hasOwnProperty(n)&&(e[n].dispose(),e[n]=null)}else t.dispose(),t=null}this.hasOwnProperty("texture")&&(this.texture.dispose(),this.texture=null),this.hasOwnProperty("program")&&(this.program.destroy(),this.program=null);for(var i=this.children,r=0,o=i.length;r<o;r++)i[r].newdelete(),i[r]=null;i=null,this.children=[]},CanvasRenderingContext2D.prototype.wrapText=function(t,e,n,i,r){if("string"==typeof t&&"number"==typeof n&&"number"==typeof i){void 0===r&&(r=200),void 0===e&&(e={});var o=e.hasOwnProperty("fontSize")?e.fontSize:25;this.font=o+"px sans-serif",this.textBaseline="top",this.textAlign="left";for(var a=t.split(""),s=a.length,h=wf.getOneTextHeight(o),l=n,c=n+10,u=i+10,p=0,d="",f=[],m=[],v=0;v!=s;){d+=a[v++],this.measureText(d).width>r&&(d=d.substr(0,d.length-1),f.push(d),m.push(u),d="",v--,p+=u+=h+2)}if(0!=d.length&&(f.push(d),m.push(u),p+=i+10,p+=h),0!=f.length){var g=r;1==f.length&&(g=this.measureText(f[0]).width),g+=20;var y=!e.hasOwnProperty("edge")||e.edge,x=e.hasOwnProperty("edgeSize")?e.edgeSize:2,b=e.hasOwnProperty("edgeColor")?e.edgeColor:{r:0,g:0,b:0,a:1};y&&(g+=x+x,p+=x+x),this.canvas.width=g,this.canvas.height=p;var w=!e.hasOwnProperty("background")||e.background,_=e.hasOwnProperty("backgroundColor")?e.backgroundColor:{r:165,g:165,b:165,a:1},M=e.hasOwnProperty("textColor")?e.textColor:{r:0,g:0,b:0,a:1};this.lineWidth=x,this.font=o+"px sans-serif",this.textBaseline="top",this.textAlign="left";this.beginPath(),this.moveTo(l+6,i),this.lineTo(l+g-6-x,i),this.quadraticCurveTo(l+g-x,i,l+g-x,i+6),this.lineTo(l+g-x,i+p-6-x),this.quadraticCurveTo(l+g-x,i+p-x,l+g-6,i+p-x),this.lineTo(l+6,i+p-x),this.quadraticCurveTo(l,i+p-x,l,i+p-6-x),this.lineTo(l,i+6),this.quadraticCurveTo(l,i,l+6,i),this.closePath(),this.fillStyle="rgba("+_.r+","+_.g+","+_.b+","+_.a+")",w&&this.fill(),this.strokeStyle="rgba("+b.r+","+b.g+","+b.b+","+b.a+")",y&&this.stroke(),this.fillStyle="rgba("+M.r+","+M.g+","+M.b+","+M.a+")";for(var S=0;S!=f.length;++S)this.fillText(f[S],c,m[S]);return{_width:g,_height:p}}}},Nf.prototype=Object.assign(Object.create(n.prototype),{test:function(){var t=new Cs(new As({map:(new Il).load("sprite0.jpg"),sizeAttenuation:!1}));t.position.set(0,0,0);var e=t.position.distanceTo(this._PCamera.position)/1e3;t.scale.set(e,e,1),this.scene.add(t),this.render()},reset:function(){this.removeAllImageLabel(),this.rootMeasures.newdelete(),null!=this.root&&(this.scene.remove(this.root),null!=this.rootEx&&(this.rootEx.newdelete(),this.root.remove(this.rootEx),this.rootEx=null),this.loadedFiles=[],this.root.newdelete(),this.root=null,this.mainControl.reset(),this.viewCube.reset(),this.effectComposer.reset(),this.webglRender.dispose(),this.removeAllImageLabel(),this.sceneBox.min.set(-1,-1,-1),this.sceneBox.max.set(1,1,1),this.render())},render:function(){this.mainLight.position.copy(this._PCamera.position),this.viewCube.render(this.mainControl.getCameraTarget()),this.effectComposer.render(),this.mainControl.updateMeasures();for(var t=Object.values(this.imageLabelsMap),e=0;e!=t.length;++e)t[e].render();t=[];for(var n=Object.values(this.textLabelsMap),i=0;i!=n.length;++i)n[i].render();n=[],this.webglRender.clearDepth(),this.webglRender.render(this.OScene,this.OCamera)},zoomScene:function(t,e){var n=this;if(e=e||wf.defaultValue(e,1.23),null!=this.root)if(void 0===t||""==t){console.log("zoom all scene --\x3e");var i=new Nn;i.setFromObject(n.root),n.sceneBox.copy(i);var r=new Qe;i.getCenter(r);var o=new Qe;o.copy(n.mainControl.getCameraDirect()),n.mainControl.setRotateCenter(r);var a=new Qe;a.subVectors(i.max,i.min),o.multiplyScalar(a.length()*e);var s=new Qe;s.subVectors(r,o),n._PCamera.position.copy(s),n._PCamera.position.x=s.x,n._PCamera.position.y=s.y,n._PCamera.position.z=s.z,n.mainControl.setCameraTarget(r),n._PCamera.up.set(0,0,1),n._PCamera.lookAt(r),n.render(),console.log("zoom all scene --<")}else{var h=n.root.getObjectByName(t);if(void 0===h&&null!=n.rootEx&&(h=n.rootEx.getObjectByProperty("uuid",t)),void 0===h)return;var l={upx:n._PCamera.up.x,upy:n._PCamera.up.y,upz:n._PCamera.up.z,px:n._PCamera.position.x,py:n._PCamera.position.y,pz:n._PCamera.position.z,tx:n.mainControl.getCameraTarget().x,ty:n.mainControl.getCameraTarget().y,tz:n.mainControl.getCameraTarget().z},c=new Nn;c.setFromObject(h);var u=new Qe;c.getCenter(u),n.mainControl.setRotateCenter(u);var p=new Qe;p.copy(n.mainControl.getCameraDirect());var d=new Qe;d.subVectors(c.max,c.min),p.multiplyScalar(d.length()*e);var f=new Qe;f.subVectors(u,p);var m=new Qe;m.copy(n._PCamera.position);var v=new Qe;v.subVectors(f,m);var g=new Qe;g.copy(n.mainControl.getCameraTarget()),g.add(v),n.mainControl.setCameraTarget(g);var y={upx:0,upy:0,upz:1,px:f.x,py:f.y,pz:f.z,tx:g.x,ty:g.y,tz:g.z};n.playAnimate(l,y)}},highlightModel:function(t,e){var n=!1;if(1===(e=wf.defaultValue(e,0))&&(n=!0),null!=this.root)if(Array.isArray(t)){n||this.mainControl.unhighlightAllObjectByInterface();for(var i=0;i!=t.length;++i){var r=this.root.getObjectByName(t[i]);if(void 0===r&&null!=this.rootEx&&(r=this.rootEx.getObjectByProperty("uuid",t[i])),void 0===r)return;this.mainControl.highlightObjectByInterface(r,!0)}this.render()}else{var o=this.root.getObjectByName(t);if(void 0===o&&null!=this.rootEx&&(o=this.rootEx.getObjectByProperty("uuid",t)),void 0===o)return;this.mainControl.highlightObjectByInterface(o,n),this.render()}},addModels:function(t){var r=this;if("files"in t&&Array.isArray(t.files)){var o=t.files.length,a=0;t.files.forEach(function(t){var e=t,n=e;if(-1==r.loadedFiles.indexOf(n)&&"string"==typeof n){var i=e.split(".").pop().toLowerCase();if("ogdw"==i||"glb"==i||"ogd"==i)new Td(r.loadManager).load(n,function(t){t.scene.name=n,r.loadedFiles.push(n),r.initRoot(),r.mainControl.setRootScene(r.root),r.root.add(t.scene),1!=++a&&a!=o||r.zoomScene(),a==o&&(r.modelLoadEvent.statusText="模型加载完成",r.dispatchEvent(r.modelLoadEvent)),t=null},function(){},function(){++a==o&&(r.modelLoadEvent.statusText="模型加载完成",r.dispatchEvent(r.modelLoadEvent)),r.render(),object=null})}})}},addModelByUrl:function(r){if("string"==typeof r&&"json"==r.split(".").pop().toLowerCase()){var t=new XMLHttpRequest;t.open("GET",r,!0),t.addEventListener("load",function(t){var e=this.response,n=wf.convertUint8ArrayToString(new Uint8Array(e)),i=(JSON.parse(n),r.lastIndexOf("/"));-1!=i&&r.slice(0,i+1)},!1),t.addEventListener("progress",function(t){},!1),t.addEventListener("error",function(t){},!1),t.addEventListener("abort",function(t){},!1),t.responseType="arraybuffer",t.overrideMimeType&&t.overrideMimeType("text/plain"),t.send(null)}},removeModels:function(t){var r=this;if(r.mainControl.unhighlightAllObjectByInterface(),"files"in t&&Array.isArray(t.files)){t.files.length;t.files.forEach(function(t){var e=t,n=r.loadedFiles.indexOf(e);if(-1!=n&&r.loadedFiles.splice(n,1),"string"==typeof e&&null!=r.root){var i=r.root.getObjectByName(e);null!=i&&(i.parent.remove(i),i.newdelete(),i=null,r.render())}})}r.webglRender.dispose()},editColor:function(t,e){if(null!=this.root){var n=function(t){"oriemiss"in t.material?(null==t.material.oricolor&&(t.material.oricolor=t.material.oriemiss),t.material.oriemiss=e):(null==t.material.oricolor&&(t.material.oricolor=t.material.color.getHex()),t.material.color.setHex(e)),t.material.needsUpdate=!0};if(""===t)this.root.traverse(function(t){t instanceof io&&n(t)});else{var i=this.root.getObjectByName(t);i&&i.traverse(function(t){t instanceof io&&n(t)})}}this.render()},restoreColor:function(t){if(null!=this.root){var e=function(t){"oricolor"in t.material&&("oriemiss"in t.material?t.material.oriemiss=t.material.oricolor:t.material.color.setHex(t.material.oricolor)),"orialpha"in t.material&&(t.material.needsUpdate=!0)};if(""===t)this.root.traverse(function(t){t instanceof io&&e(t)});else{var n=this.root.getObjectByName(t);n&&n.traverse(function(t){t instanceof io&&e(t)})}}this.render()},editAlpha:function(t,e){if(null!=this.root){var n=function(t){t.material.oriemiss_alpha?("orialpha"in t.material||(t.material.orialpha=t.material.oriemiss_alpha),"oritransparent"in t.material||(t.material.oritransparent=t.material.oriemiss_trans),t.material.oriemiss_alpha=1-e,t.material.oriemiss_trans=!0):("orialpha"in t.material||(t.material.orialpha=t.material.opacity),"oritransparent"in t.material||(t.material.oritransparent=t.material.transparent),t.material.opacity=1-e,t.material.transparent=!0),t.material.needsUpdate=!0};if(""===t)this.root.traverse(function(t){t instanceof io&&n(t)});else{var i=this.root.getObjectByName(t);i&&i.traverse(function(t){t instanceof io&&n(t)})}}this.render()},restoreAlpha:function(t){if(null!=this.root){var e=function(t){"orialpha"in t.material&&("oriemiss_alpha"in t.material?(t.material.oriemiss_alpha=t.material.orialpha,t.material.oriemiss_trans=t.material.oritransparent):(t.material.opacity=t.material.orialpha,t.material.transparent=t.material.oritransparent)),"orialpha"in t.material&&(t.material.needsUpdate=!0)};if(""===t)this.root.traverse(function(t){t instanceof io&&e(t)});else{var n=this.root.getObjectByName(t);n&&n.traverse(function(t){t instanceof io&&e(t)})}}this.render()},editVisibility:function(t,e){if(null!=this.root){var n=this.root.getObjectByName(t);n&&n instanceof Ci&&(n.visible=e)}this.render()},addImageLabel:function(t,e,n,i){var r=this;if(t in this.imageLabelsMap)this.imageLabelsMap[t].edit(e,n,i);else if(null!=this.root){if(a=(a=this.root.getObjectByName(t))||this.rootEx.getObjectByProperty("uuid",t)){a.updateMatrixWorld(!0);var o=void 0;if(o="isSphere"in a?r.findSphereMaxZCoordinate(a):r.findObjectMaxZCoordinateCloseToCenter(a))if(void 0!==o&&-1e7!=o.z)(s=new Ef(r.DivViewer,r._PCamera,t)).create(o,e,n,i),s.onClick(function(t){r.imgLabelClickEvent.id=t,r.dispatchEvent(r.imgLabelClickEvent)}),r.imageLabelsMap[t]=s}}else if(this.rootEx){var a;if(a=this.rootEx.getObjectByProperty("uuid",t)){a.updateMatrixWorld(!0);var s;o=void 0;if(o="isSphere"in a?r.findSphereMaxZCoordinate(a):r.findObjectMaxZCoordinateCloseToCenter(a))if(void 0!==o&&-1e7!=o.z)(s=new Ef(r.DivViewer,r._PCamera,t)).create(o,e,n,i),s.onClick(function(t){r.imgLabelClickEvent.id=t,r.dispatchEvent(r.imgLabelClickEvent)}),r.imageLabelsMap[t]=s}}},editImageLabel:function(t,e,n,i){t in this.imageLabelsMap&&this.imageLabelsMap[t].edit(e,n,i)},removeImageLabel:function(t){t in this.imageLabelsMap&&(this.imageLabelsMap[t].dispose(),this.imageLabelsMap[t]=null,delete this.imageLabelsMap[t])},removeAllImageLabel:function(){for(var t=Object.values(this.imageLabelsMap),e=0;e!=t.length;++e)t[e].dispose(),t[e]=null;t=[],this.imageLabelsMap={}},addTextLabel:function(t,e,n){var i=this;if(t in this.textLabelsMap)this.textLabelsMap[t].edit(e,n);else if(this.root){if(a=(a=this.root.getObjectByName(t))||this.rootEx.getObjectByProperty("uuid",t)){a.updateMatrixWorld(!0);var r=void 0;if((r="isSphere"in a?i.findSphereMaxZCoordinate(a):i.findObjectMaxZCoordinateCloseToCenter(a))&&void 0!==r&&-1e7!=r.z){var o=new Af(i.DivViewer,i._PCamera,t);o.create(r,e,n),o.onClick(function(t){i.textLabelClickEvent.id=t,i.dispatchEvent(i.textLabelClickEvent)}),i.textLabelsMap[t]=o}}}else if(this.rootEx){var a;if(a=this.rootEx.getObjectByProperty("uuid",t)){a.updateMatrixWorld(!0);r=void 0;if((r="isSphere"in a?i.findSphereMaxZCoordinate(a):i.findObjectMaxZCoordinateCloseToCenter(a))&&void 0!==r&&-1e7!=r.z){var s=new Af(i.DivViewer,i._PCamera,t);s.create(r,e,n),s.onClick(function(t){i.textLabelClickEvent.id=t,i.dispatchEvent(i.textLabelClickEvent)}),i.textLabelsMap[t]=s}}}},editTextLabel:function(t,e,n){t in this.textLabelsMap&&this.textLabelsMap[t].edit(e,n)},removeTextLabel:function(t){t in this.textLabelsMap&&(this.textLabelsMap[t].dispose(),this.textLabelsMap[t]=null,delete this.textLabelsMap[t])},removeAllTextLabel:function(){for(var t=Object.values(this.textLabelsMap),e=0;e!=t.length;++e)t[e].dispose(),t[e]=null;t=[],this.textLabelsMap={}},lookTo:function(t,e){if(void 0!==t&&null!=t||(t=cf.FrontRightTop),e=wf.defaultValue(e,!0),void 0!==t){var n=new Qe;this.sceneBox.getCenter(n);var i=new Qe;i.subVectors(this.sceneBox.max,this.sceneBox.min);var r=new Qe;r.copy(this.config.front),r.multiplyScalar(1.23*i.length());var o=r.length(),a=this.mainControl.getCameraTarget(),s={upx:this._PCamera.up.x,upy:this._PCamera.up.y,upz:this._PCamera.up.z,px:this._PCamera.position.x,py:this._PCamera.position.y,pz:this._PCamera.position.z,tx:a.x,ty:a.y,tz:a.z},h={};switch(t){case cf.Front:h.px=n.x+o*this.config.front.x,h.py=n.y+o*this.config.front.y,h.pz=n.z+o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.Back:h.px=n.x-o*this.config.front.x,h.py=n.y-o*this.config.front.y,h.pz=n.z-o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.Left:h.px=n.x-o*this.config.right.x,h.py=n.y-o*this.config.right.y,h.pz=n.z-o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.Right:h.px=n.x+o*this.config.right.x,h.py=n.y+o*this.config.right.y,h.pz=n.z+o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.Top:h.px=n.x+o*this.config.top.x,h.py=n.y+o*this.config.top.y,h.pz=n.z+o*this.config.top.z,h.upx=this.config.front.x,h.upy=-this.config.front.y,h.upz=this.config.front.z;break;case cf.Bottom:h.px=n.x-o*this.config.top.x,h.py=n.y-o*this.config.top.y,h.pz=n.z-o*this.config.top.z,h.upx=this.config.front.x,h.upy=this.config.front.y,h.upz=this.config.front.z;break;case cf.FrontTop:h.px=n.x+o*this.config.front.x+o*this.config.top.x,h.py=n.y+o*this.config.front.y+o*this.config.top.y,h.pz=n.z+o*this.config.front.z+o*this.config.top.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.FrontRight:h.px=n.x+o*this.config.front.x+o*this.config.right.x,h.py=n.y+o*this.config.front.y+o*this.config.right.y,h.pz=n.z+o*this.config.front.z+o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.FrontLeft:h.px=n.x-o*this.config.front.x-o*this.config.right.x,h.py=n.y+o*this.config.front.y+o*this.config.right.y,h.pz=n.z+o*this.config.front.z+o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.FrontBottom:h.px=n.x+o*this.config.front.x+o*this.config.top.x,h.py=n.y+o*this.config.front.y+o*this.config.top.y,h.pz=n.z-o*this.config.front.z-o*this.config.top.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.RightBack:h.px=n.x+o*this.config.front.x+o*this.config.right.x,h.py=n.y-o*this.config.front.y-o*this.config.right.y,h.pz=n.z+o*this.config.front.z+o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.RightBottom:h.px=n.x+o*this.config.top.x+o*this.config.right.x,h.py=n.y-o*this.config.top.y-o*this.config.right.y,h.pz=n.z-o*this.config.top.z-o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.RightTop:h.px=n.x+o*this.config.top.x+o*this.config.right.x,h.py=n.y+o*this.config.top.y+o*this.config.right.y,h.pz=n.z+o*this.config.top.z+o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.BackLeft:h.px=n.x-o*this.config.front.x-o*this.config.right.x,h.py=n.y-o*this.config.front.y-o*this.config.right.y,h.pz=n.z+o*this.config.front.z+o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.BackTop:h.px=n.x+o*this.config.front.x+o*this.config.top.x,h.py=n.y-o*this.config.front.y-o*this.config.top.y,h.pz=n.z+o*this.config.front.z+o*this.config.top.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.BackBottom:h.px=n.x+o*this.config.front.x+o*this.config.top.x,h.py=n.y-o*this.config.front.y-o*this.config.top.y,h.pz=n.z-o*this.config.front.z-o*this.config.top.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.LeftBottom:h.px=n.x-o*this.config.top.x-o*this.config.right.x,h.py=n.y+o*this.config.top.y+o*this.config.right.y,h.pz=n.z-o*this.config.top.z-o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.LeftTop:h.px=n.x-o*this.config.top.x-o*this.config.right.x,h.py=n.y+o*this.config.top.y+o*this.config.right.y,h.pz=n.z+o*this.config.top.z+o*this.config.right.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.FrontRightTop:h.px=n.x+o*this.config.top.x+o*this.config.right.x+o*this.config.front.x,h.py=n.y+o*this.config.top.y+o*this.config.right.y+o*this.config.front.y,h.pz=n.z+o*this.config.top.z+o*this.config.right.z+o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.FrontRightBottom:h.px=n.x+o*this.config.top.x+o*this.config.right.x+o*this.config.front.x,h.py=n.y+o*this.config.top.y+o*this.config.right.y+o*this.config.front.y,h.pz=n.z-o*this.config.top.z-o*this.config.right.z-o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.FrontLeftTop:h.px=n.x-o*this.config.top.x-o*this.config.right.x-o*this.config.front.x,h.py=n.y+o*this.config.top.y+o*this.config.right.y+o*this.config.front.y,h.pz=n.z+o*this.config.top.z+o*this.config.right.z+o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.FrontLeftBottom:h.px=n.x-o*this.config.top.x-o*this.config.right.x-o*this.config.front.x,h.py=n.y+o*this.config.top.y+o*this.config.right.y+o*this.config.front.y,h.pz=n.z-o*this.config.top.z-o*this.config.right.z-o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.BackRightTop:h.px=n.x+o*this.config.top.x+o*this.config.right.x+o*this.config.front.x,h.py=n.y-o*this.config.top.y-o*this.config.right.y-o*this.config.front.y,h.pz=n.z+o*this.config.top.z+o*this.config.right.z+o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.BackRightBottom:h.px=n.x+o*this.config.top.x+o*this.config.right.x+o*this.config.front.x,h.py=n.y-o*this.config.top.y-o*this.config.right.y-o*this.config.front.y,h.pz=n.z-o*this.config.top.z-o*this.config.right.z-o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.BackLeftTop:h.px=n.x-o*this.config.top.x-o*this.config.right.x-o*this.config.front.x,h.py=n.y-o*this.config.top.y-o*this.config.right.y-o*this.config.front.y,h.pz=n.z+o*this.config.top.z+o*this.config.right.z+o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.BackLeftBottom:h.px=n.x-o*this.config.top.x-o*this.config.right.x-o*this.config.front.x,h.py=n.y-o*this.config.top.y-o*this.config.right.y-o*this.config.front.y,h.pz=n.z-o*this.config.top.z-o*this.config.right.z-o*this.config.front.z,h.upx=this.config.top.x,h.upy=this.config.top.y,h.upz=this.config.top.z;break;case cf.East:h.px=n.x+o*this.config.top.x,h.py=n.y+o*this.config.top.y,h.pz=n.z+o*this.config.top.z,h.upx=this.config.right.x,h.upy=this.config.right.y,h.upz=this.config.right.z;break;case cf.South:h.px=n.x+o*this.config.top.x,h.py=n.y+o*this.config.top.y,h.pz=n.z+o*this.config.top.z,h.upx=this.config.front.x,h.upy=this.config.front.y,h.upz=this.config.front.z;break;case cf.West:h.px=n.x+o*this.config.top.x,h.py=n.y+o*this.config.top.y,h.pz=n.z+o*this.config.top.z,h.upx=-this.config.right.x,h.upy=this.config.right.y,h.upz=this.config.right.z;break;case cf.North:h.px=n.x+o*this.config.top.x,h.py=n.y+o*this.config.top.y,h.pz=n.z+o*this.config.top.z,h.upx=this.config.front.x,h.upy=-this.config.front.y,h.upz=this.config.front.z}if(h.tx=n.x,h.ty=n.y,h.tz=n.z,e)this.playAnimate(s,h);else{this._PCamera.up.set(h.upx,h.upy,h.upz),this._PCamera.position.set(h.px,h.py,h.pz);var l=new Qe(h.tx,h.ty,h.tz);this.mainControl.setCameraTarget(l),this._PCamera.lookAt(l),this.viewCube.render(l)}}},setCuttingPlane:function(t,e){switch(e<0?e=0:100<e&&(e=100),t){case pf:if(null==this.root)return;null==this.sceneBox&&(this.sceneBox=new Nn,this.sceneBox.setFromObject(this.root));var n=(this.sceneBox.max.z+1-this.sceneBox.min.z)/100;if(null==this.globleXYCutPlane){var i=this.sceneBox.min.z+n;this.globleXYCutPlane=new Vn(new Qe(0,0,1),-1*i),this.globleCutPlaneArray.push(this.globleXYCutPlane)}else this.globleXYCutPlane.constant=-1*(this.sceneBox.min.z+n*e);break;case df:if(null==this.root)return;null==this.sceneBox&&(this.sceneBox=new Nn,this.sceneBox.setFromObject(this.root));var r=(this.sceneBox.max.y+1-this.sceneBox.min.y)/100;if(null==this.globleXZCutPlane){i=this.sceneBox.min.y+r;this.globleXZCutPlane=new Vn(new Qe(0,1,0),-1*i),this.globleCutPlaneArray.push(this.globleXZCutPlane)}else this.globleXZCutPlane.constant=-1*(this.sceneBox.min.y+r*e);break;case ff:if(null==this.root)return;null==this.sceneBox&&(this.sceneBox=new Nn,this.sceneBox.setFromObject(this.root));var o=(this.sceneBox.max.x+1-this.sceneBox.min.x)/100;if(null==this.globleYZCutPlane){i=this.sceneBox.min.x+o;this.globleYZCutPlane=new Vn(new Qe(1,0,0),-1*i),this.globleCutPlaneArray.push(this.globleYZCutPlane)}else this.globleYZCutPlane.constant=-1*(this.sceneBox.min.x+o*e)}this.render()},removeCuttingPlane:function(t){var e=-1;switch(t){case pf:if(null==this.globleXYCutPlane)return;e=this.globleCutPlaneArray.indexOf(this.globleXYCutPlane);break;case df:if(null==this.globleXZCutPlane)return;e=this.globleCutPlaneArray.indexOf(this.globleXZCutPlane);break;case ff:if(null==this.globleYZCutPlane)return;e=this.globleCutPlaneArray.indexOf(this.globleYZCutPlane)}-1!=e&&(this.globleCutPlaneArray.splice(e,1),this.render())},onsize:function(t,e){var n=this;if(void 0===t){var i=n.DivViewer.offsetWidth,r=n.DivViewer.offsetHeight;n._PCamera.aspect=i/r,n._PCamera.updateProjectionMatrix(),n.OCamera.left=.5*-i,n.OCamera.right=.5*i,n.OCamera.top=.5*r,n.OCamera.bottom=.5*-r,n.OCamera.updateProjectionMatrix(),n.webglRender.setSize(i,r),n.mainControl.onsize(i,r),this.effectComposer.setSize(i,r),this.effectFXAA.uniforms.resolution.value.set(1/i,1/r),n.viewCube.onsize(n.DivViewer.offsetLeft,n.DivViewer.offsetTop,i,r),n.render()}else n.DivViewer.width=t,n.DivViewer.height=e,n._PCamera.aspect=n.DivViewer.offsetWidth/n.DivViewer.offsetHeight,n._PCamera.updateProjectionMatrix(),n.OCamera.left=.5*-t,n.OCamera.right=.5*t,n.OCamera.top=.5*e,n.OCamera.bottom=.5*-e,n.OCamera.updateProjectionMatrix(),n.webglRender.setSize(n.DivViewer.offsetWidth,n.DivViewer.offsetHeight),n.mainControl.onsize(n.DivViewer.offsetWidth,n.DivViewer.offsetHeight),this.effectComposer.setSize(t,e),this.effectFXAA.uniforms.resolution.value.set(1/t,1/e),n.viewCube.onsize(n.DivViewer.offsetLeft,n.DivViewer.offsetTop,n.DivViewer.offsetWidth,n.DivViewer.offsetHeight),n.render()},editBackground:function(t,e,n){switch(t){case 0:this.DivViewer.style.background=e,this.DivViewer.style.background="-moz-linear-gradient(top,"+e+" 0%,"+n+" 100%)",this.DivViewer.style.background="-webkit-linear-gradient(top,"+e+" 0%,"+n+" 100%)",this.DivViewer.style.background="linear-gradient(to bottom,"+e+" 0%,"+n+" 100%)";break;case 1:this.DivViewer.style.background=e,this.DivViewer.style.background="-moz-linear-gradient(left,"+e+" 0%,"+n+" 100%)",this.DivViewer.style.background="-webkit-linear-gradient(left,"+e+" 0%,"+n+" 100%)",this.DivViewer.style.background="linear-gradient(to right,"+e+" 0%,"+n+" 100%)"}},startMeasure:function(t){t&&"number"==typeof t&&this.mainControl.startMeasure(t)},endMeasure:function(){this.mainControl.endMeasure()},startSelectVertice:function(t){this.mainControl.startSelectVertice(t)},endSelectVertice:function(){this.mainControl.endSelectVertice()},createSphere:function(t,e,n){if("x"in t&&"y"in t&&"z"in t){var i=e;"string"==typeof e&&(i=parseFloat(e)),e<1e-5&&(e=1e-5);var r=new Qe;"string"==typeof t.x?r.x=parseFloat(t.x):r.x=t.x,"string"==typeof t.y?r.y=parseFloat(t.y):r.y=t.y,"string"==typeof t.z?r.z=parseFloat(t.z):r.z=t.z;var o=new io(new Uh(i,32,32),new ll({color:n}));return o.position.set(r.x,r.y,r.z),o.isSphere=!0,this.addChildInRootEx(o),o.uuid}return""},removeSphere:function(t){var i=this,r=this;if(null!=this.rootEx&&"ids"in t&&Array.isArray(t.ids)){t.ids.length;t.ids.forEach(function(t){var e=t;if("string"==typeof e){var n=i.rootEx.getObjectByProperty("uuid",e);null!=n&&(r.removeImageLabel(e),r.removeTextLabel(e),n.parent.remove(n),n.newdelete(),n=null,r.render())}})}},editSphereColor:function(t,e){null!=this.rootEx&&this.rootEx.getObjectByProperty("uuid",t).traverse(function(t){t instanceof io&&(null==t.material.oricolor&&(t.material.oricolor=new Jn,t.material.oricolor.copy(t.material.color)),t.material.oriemiss?t.material.oriemiss=e:t.material.color.setHex(e),t.material.needsUpdate=!0)});this.render()},normalExplodeModel:function(a,s){if(this.root){(s="number"!=typeof s?.5:wf.defaultValue(s,.5))<0?s=0:1<s&&(s=1);var h=new Qe;if(this.root.hasOwnProperty("o_c"))h.copy(this.root.o_c);else{var t=new Nn;t.setFromObject(this.root),t.getCenter(h),this.root.o_c=h.clone()}this.root.traverse(function(t){if(t instanceof io)if(a){var e=new Qe;if(t.hasOwnProperty("o_c"))e.copy(t.o_c);else{var n=new Nn;n.setFromObject(t),n.getCenter(e),t.o_c=e.clone()}var i=new Qe;i.subVectors(e,h);var r=i.length();i.normalize();var o=h.clone();o.add(i.multiplyScalar(3*r*s)),t.position.copy(o)}else t.position.set(0,0,0)}),this.render()}},setThirdPersonRoaming:function(t){void 0!==t&&"boolean"==typeof t&&1==(this.isThirdPersionRoam=t)&&this.mainControl.startThirdPersonRoam()},setAxisVisible:function(t){this.viewCube.setVisible(t),this.render()},setModelIsolation:function(t,e){e&&1==e?this._isolations.add(t):0==e&&this._isolations.remove(t)},isIsolation:function(t){return this._isolations.isHave(t)},getCamera:function(){var t=this.getCameraTarget();return JSON.stringify({pX:this._PCamera.position.x,pY:this._PCamera.position.y,pZ:this._PCamera.position.z,tX:t.x,tY:t.y,tZ:t.z,uX:this._PCamera.up.x,uY:this._PCamera.up.y,uZ:this._PCamera.up.z})},setCamera:function(t){if("string"==typeof t){var e=JSON.parse(t),n=void 0,i=void 0,r=void 0,o=void 0,a=void 0,s=void 0,h=void 0,l=void 0,c=void 0;c="string"==typeof e.pX?(n=parseFloat(e.pX),i=parseFloat(e.pY),r=parseFloat(e.pZ),o=parseFloat(e.tX),a=parseFloat(e.tY),s=parseFloat(e.tZ),h=parseFloat(e.uX),l=parseFloat(e.uY),parseFloat(e.uZ)):(n=e.pX,i=e.pY,r=e.pZ,o=e.tX,a=e.tY,s=e.tZ,h=e.uX,l=e.uY,e.uZ);var u=new Qe(o,a,s);this._PCamera.position.set(n,i,r),this._PCamera.up.set(h,l,c),this.mainControl.setCameraTarget(u),this._PCamera.lookAt(u),this.render()}},setSmallFeatureCulling:function(t){"number"==typeof t&&this.webglRender.setDynamiceValue(t)}}),t.OASView=Nf,t.ViewType=cf,Object.defineProperty(t,"__esModule",{value:!0})});