UNPKG

polygonjs-engine

Version:

node-based webgl 3D engine https://polygonjs.com

2 lines 1.96 MB
/*! For license information please see all.js.LICENSE.txt */ window.POLY=function(t){function e(e){for(var n,r,s=e[0],o=e[1],a=0,l=[];a<s.length;a++)r=s[a],Object.prototype.hasOwnProperty.call(i,r)&&i[r]&&l.push(i[r][0]),i[r]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n]);for(c&&c(e);l.length;)l.shift()()}var n={},i={all:0};function r(e){if(n[e])return n[e].exports;var i=n[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.e=function(t){var e=[],n=i[t];if(0!==n)if(n)e.push(n[2]);else{var s=new Promise((function(e,r){n=i[t]=[e,r]}));e.push(n[2]=s);var o,a=document.createElement("script");a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.src=function(t){return r.p+""+({}[t]||t)+".js"}(t);var c=new Error;o=function(e){a.onerror=a.onload=null,clearTimeout(l);var n=i[t];if(0!==n){if(n){var r=e&&("load"===e.type?"missing":e.type),s=e&&e.target&&e.target.src;c.message="Loading chunk "+t+" failed.\n("+r+": "+s+")",c.name="ChunkLoadError",c.type=r,c.request=s,n[1](c)}i[t]=void 0}};var l=setTimeout((function(){o({type:"timeout",target:a})}),12e4);a.onerror=a.onload=o,document.head.appendChild(a)}return Promise.all(e)},r.m=t,r.c=n,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="https://unpkg.com/polygonjs-engine@1.1.50/dist/",r.oe=function(t){throw console.error(t),t};var s=window.webpackJsonpPOLY=window.webpackJsonpPOLY||[],o=s.push.bind(s);s.push=e,s=s.slice();for(var a=0;a<s.length;a++)e(s[a]);var c=o;return r(r.s=205)}([function(t,e,n){"use strict";n.d(e,"hb",(function(){return i})),n.d(e,"Tc",(function(){return r})),n.d(e,"u",(function(){return s})),n.d(e,"s",(function(){return o})),n.d(e,"t",(function(){return a})),n.d(e,"k",(function(){return c})),n.d(e,"Fb",(function(){return l})),n.d(e,"Gb",(function(){return u})),n.d(e,"gd",(function(){return h})),n.d(e,"H",(function(){return _})),n.d(e,"i",(function(){return d})),n.d(e,"z",(function(){return p})),n.d(e,"F",(function(){return m})),n.d(e,"ub",(function(){return f})),n.d(e,"xb",(function(){return g})),n.d(e,"e",(function(){return v})),n.d(e,"Sc",(function(){return y})),n.d(e,"mb",(function(){return x})),n.d(e,"v",(function(){return b})),n.d(e,"b",(function(){return w})),n.d(e,"Rc",(function(){return T})),n.d(e,"xc",(function(){return A})),n.d(e,"jb",(function(){return E})),n.d(e,"ib",(function(){return S})),n.d(e,"jd",(function(){return M})),n.d(e,"Ab",(function(){return N})),n.d(e,"Pc",(function(){return O})),n.d(e,"Eb",(function(){return L})),n.d(e,"Nc",(function(){return C})),n.d(e,"Db",(function(){return P})),n.d(e,"A",(function(){return R})),n.d(e,"Bb",(function(){return I})),n.d(e,"B",(function(){return F})),n.d(e,"Cb",(function(){return D})),n.d(e,"Oc",(function(){return z})),n.d(e,"tb",(function(){return k})),n.d(e,"g",(function(){return U})),n.d(e,"S",(function(){return B})),n.d(e,"T",(function(){return G})),n.d(e,"C",(function(){return j})),n.d(e,"L",(function(){return V})),n.d(e,"K",(function(){return H})),n.d(e,"yb",(function(){return q})),n.d(e,"nb",(function(){return X})),n.d(e,"lb",(function(){return W})),n.d(e,"c",(function(){return Y})),n.d(e,"vb",(function(){return $})),n.d(e,"ab",(function(){return Q})),n.d(e,"vc",(function(){return J})),n.d(e,"m",(function(){return Z})),n.d(e,"a",(function(){return K})),n.d(e,"w",(function(){return tt})),n.d(e,"Yc",(function(){return et})),n.d(e,"o",(function(){return nt})),n.d(e,"p",(function(){return it})),n.d(e,"D",(function(){return rt})),n.d(e,"E",(function(){return st})),n.d(e,"q",(function(){return ot})),n.d(e,"r",(function(){return at})),n.d(e,"wc",(function(){return ct})),n.d(e,"n",(function(){return lt})),n.d(e,"kb",(function(){return ut})),n.d(e,"ob",(function(){return ht})),n.d(e,"sb",(function(){return _t})),n.d(e,"qb",(function(){return dt})),n.d(e,"rb",(function(){return pt})),n.d(e,"pb",(function(){return mt})),n.d(e,"V",(function(){return ft})),n.d(e,"Z",(function(){return gt})),n.d(e,"X",(function(){return vt})),n.d(e,"Y",(function(){return yt})),n.d(e,"W",(function(){return xt})),n.d(e,"Zc",(function(){return bt})),n.d(e,"l",(function(){return wt})),n.d(e,"Mc",(function(){return Tt})),n.d(e,"fd",(function(){return At})),n.d(e,"N",(function(){return Et})),n.d(e,"bd",(function(){return St})),n.d(e,"G",(function(){return Mt})),n.d(e,"M",(function(){return Nt})),n.d(e,"cd",(function(){return Ot})),n.d(e,"dd",(function(){return Lt})),n.d(e,"ed",(function(){return Ct})),n.d(e,"ad",(function(){return Pt})),n.d(e,"f",(function(){return Rt})),n.d(e,"ic",(function(){return It})),n.d(e,"Ib",(function(){return Ft})),n.d(e,"gb",(function(){return Dt})),n.d(e,"fb",(function(){return zt})),n.d(e,"hc",(function(){return kt})),n.d(e,"x",(function(){return Ut})),n.d(e,"y",(function(){return Bt})),n.d(e,"tc",(function(){return Gt})),n.d(e,"uc",(function(){return jt})),n.d(e,"rc",(function(){return Vt})),n.d(e,"sc",(function(){return Ht})),n.d(e,"jc",(function(){return qt})),n.d(e,"Jb",(function(){return Xt})),n.d(e,"qc",(function(){return Wt})),n.d(e,"cc",(function(){return Yt})),n.d(e,"dc",(function(){return $t})),n.d(e,"ec",(function(){return Qt})),n.d(e,"pc",(function(){return Jt})),n.d(e,"oc",(function(){return Zt})),n.d(e,"bc",(function(){return Kt})),n.d(e,"ac",(function(){return te})),n.d(e,"mc",(function(){return ee})),n.d(e,"nc",(function(){return ne})),n.d(e,"Zb",(function(){return ie})),n.d(e,"Qb",(function(){return re})),n.d(e,"Rb",(function(){return se})),n.d(e,"Sb",(function(){return oe})),n.d(e,"Tb",(function(){return ae})),n.d(e,"Ub",(function(){return ce})),n.d(e,"Vb",(function(){return le})),n.d(e,"Wb",(function(){return ue})),n.d(e,"Xb",(function(){return he})),n.d(e,"Lb",(function(){return _e})),n.d(e,"Mb",(function(){return de})),n.d(e,"Nb",(function(){return pe})),n.d(e,"Kb",(function(){return me})),n.d(e,"Ob",(function(){return fe})),n.d(e,"Pb",(function(){return ge})),n.d(e,"Yb",(function(){return ve})),n.d(e,"Ec",(function(){return ye})),n.d(e,"Fc",(function(){return xe})),n.d(e,"Gc",(function(){return be})),n.d(e,"Hc",(function(){return we})),n.d(e,"Ic",(function(){return Te})),n.d(e,"Jc",(function(){return Ae})),n.d(e,"Kc",(function(){return Ee})),n.d(e,"Lc",(function(){return Se})),n.d(e,"zc",(function(){return Me})),n.d(e,"Ac",(function(){return Ne})),n.d(e,"Bc",(function(){return Oe})),n.d(e,"yc",(function(){return Le})),n.d(e,"Cc",(function(){return Ce})),n.d(e,"Dc",(function(){return Pe})),n.d(e,"cb",(function(){return Re})),n.d(e,"eb",(function(){return Ie})),n.d(e,"db",(function(){return Fe})),n.d(e,"O",(function(){return De})),n.d(e,"P",(function(){return ze})),n.d(e,"Q",(function(){return ke})),n.d(e,"id",(function(){return Ue})),n.d(e,"kd",(function(){return Be})),n.d(e,"hd",(function(){return Ge})),n.d(e,"wb",(function(){return je})),n.d(e,"d",(function(){return Ve})),n.d(e,"Xc",(function(){return He})),n.d(e,"Wc",(function(){return qe})),n.d(e,"Vc",(function(){return Xe})),n.d(e,"U",(function(){return We})),n.d(e,"ld",(function(){return Ye})),n.d(e,"J",(function(){return $e})),n.d(e,"gc",(function(){return Qe})),n.d(e,"bb",(function(){return Je})),n.d(e,"lc",(function(){return Ze})),n.d(e,"kc",(function(){return Ke})),n.d(e,"fc",(function(){return tn})),n.d(e,"j",(function(){return en})),n.d(e,"Hb",(function(){return nn})),n.d(e,"Uc",(function(){return rn})),n.d(e,"zb",(function(){return sn})),n.d(e,"R",(function(){return on})),n.d(e,"h",(function(){return an})),n.d(e,"Qc",(function(){return cn})),n.d(e,"I",(function(){return ln}));const i={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},r={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},s=0,o=1,a=2,c=0,l=1,u=2,h=3,_=0,d=1,p=2,m=1,f=0,g=1,v=2,y=3,x=4,b=5,w=100,T=101,A=102,E=103,S=104,M=200,N=201,O=202,L=203,C=204,P=205,R=206,I=207,F=208,D=209,z=210,k=0,U=1,B=2,G=3,j=4,V=5,H=6,q=7,X=0,W=1,Y=2,$=0,Q=1,J=2,Z=3,K=4,tt=5,et=300,nt=301,it=302,rt=303,st=304,ot=306,at=307,ct=1e3,lt=1001,ut=1002,ht=1003,_t=1004,dt=1004,pt=1005,mt=1005,ft=1006,gt=1007,vt=1007,yt=1008,xt=1008,bt=1009,wt=1010,Tt=1011,At=1012,Et=1013,St=1014,Mt=1015,Nt=1016,Ot=1017,Lt=1018,Ct=1019,Pt=1020,Rt=1021,It=1022,Ft=1023,Dt=1024,zt=1025,kt=Ft,Ut=1026,Bt=1027,Gt=1028,jt=1029,Vt=1030,Ht=1031,qt=1032,Xt=1033,Wt=33776,Yt=33777,$t=33778,Qt=33779,Jt=35840,Zt=35841,Kt=35842,te=35843,ee=36196,ne=37492,ie=37496,re=37808,se=37809,oe=37810,ae=37811,ce=37812,le=37813,ue=37814,he=37815,_e=37816,de=37817,pe=37818,me=37819,fe=37820,ge=37821,ve=36492,ye=37840,xe=37841,be=37842,we=37843,Te=37844,Ae=37845,Ee=37846,Se=37847,Me=37848,Ne=37849,Oe=37850,Le=37851,Ce=37852,Pe=37853,Re=2200,Ie=2201,Fe=2202,De=2300,ze=2301,ke=2302,Ue=2400,Be=2401,Ge=2402,je=2500,Ve=2501,He=0,qe=1,Xe=2,We=3e3,Ye=3001,$e=3007,Qe=3002,Je=3003,Ze=3004,Ke=3005,tn=3006,en=3200,nn=3201,rn=0,sn=1,on=7680,an=519,cn=35044,ln="300 es"},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(7),r=n(15);class s{constructor(t=0,e=0,n=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(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(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(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(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(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(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(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(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(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(a.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(a.setFromAxisAngle(t,e))}applyMatrix3(t){const 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}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=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])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,o=t.z,a=t.w,c=a*e+s*i-o*n,l=a*n+o*e-r*i,u=a*i+r*n-s*e,h=-r*e-s*n-o*i;return this.x=c*a+h*-r+l*-o-u*-s,this.y=l*a+h*-s+u*-r-c*-o,this.z=u*a+h*-o+c*-s-l*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const 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(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(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(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(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(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(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(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(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(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=i*a-r*o,this.y=r*s-n*a,this.z=n*o-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return o.copy(this).projectOnVector(t),this.sub(o)}reflect(t){return this.sub(o.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(i.a.clamp(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const 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(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const 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(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const o=new s,a=new r.a},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class i{constructor(t=0,e=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(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(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(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(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(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(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const 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(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(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(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(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(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return y})),n.d(e,"e",(function(){return g})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return m})),n.d(e,"a",(function(){return u}));var i=n(11),r=n(1),s=n(2),o=n(4),a=n(0);const c=new r.a,l=new s.a;function u(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=a.Qc,this.updateRange={offset:0,count:-1},this.version=0}function h(t,e,n){u.call(this,new Int8Array(t),e,n)}function _(t,e,n){u.call(this,new Uint8Array(t),e,n)}function d(t,e,n){u.call(this,new Uint8ClampedArray(t),e,n)}function p(t,e,n){u.call(this,new Int16Array(t),e,n)}function m(t,e,n){u.call(this,new Uint16Array(t),e,n)}function f(t,e,n){u.call(this,new Int32Array(t),e,n)}function g(t,e,n){u.call(this,new Uint32Array(t),e,n)}function v(t,e,n){u.call(this,new Uint16Array(t),e,n)}function y(t,e,n){u.call(this,new Float32Array(t),e,n)}function x(t,e,n){u.call(this,new Float64Array(t),e,n)}Object.defineProperty(u.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(u.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let 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){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),r=new o.a),e[n++]=r.r,e[n++]=r.g,e[n++]=r.b}return this},copyVector2sArray:function(t){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),r=new s.a),e[n++]=r.x,e[n++]=r.y}return this},copyVector3sArray:function(t){const e=this.array;let n=0;for(let i=0,s=t.length;i<s;i++){let s=t[i];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),s=new r.a),e[n++]=s.x,e[n++]=s.y,e[n++]=s.z}return this},copyVector4sArray:function(t){const e=this.array;let n=0;for(let r=0,s=t.length;r<s;r++){let s=t[r];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),s=new i.a),e[n++]=s.x,e[n++]=s.y,e[n++]=s.z,e[n++]=s.w}return this},applyMatrix3:function(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)l.fromBufferAttribute(this,e),l.applyMatrix3(t),this.setXY(e,l.x,l.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)c.fromBufferAttribute(this,e),c.applyMatrix3(t),this.setXYZ(e,c.x,c.y,c.z);return this},applyMatrix4:function(t){for(let e=0,n=this.count;e<n;e++)c.x=this.getX(e),c.y=this.getY(e),c.z=this.getZ(e),c.applyMatrix4(t),this.setXYZ(e,c.x,c.y,c.z);return this},applyNormalMatrix:function(t){for(let e=0,n=this.count;e<n;e++)c.x=this.getX(e),c.y=this.getY(e),c.z=this.getZ(e),c.applyNormalMatrix(t),this.setXYZ(e,c.x,c.y,c.z);return this},transformDirection:function(t){for(let e=0,n=this.count;e<n;e++)c.x=this.getX(e),c.y=this.getY(e),c.z=this.getZ(e),c.transformDirection(t),this.setXYZ(e,c.x,c.y,c.z);return this},set:function(t,e=0){return 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)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),h.prototype=Object.create(u.prototype),h.prototype.constructor=h,_.prototype=Object.create(u.prototype),_.prototype.constructor=_,d.prototype=Object.create(u.prototype),d.prototype.constructor=d,p.prototype=Object.create(u.prototype),p.prototype.constructor=p,m.prototype=Object.create(u.prototype),m.prototype.constructor=m,f.prototype=Object.create(u.prototype),f.prototype.constructor=f,g.prototype=Object.create(u.prototype),g.prototype.constructor=g,v.prototype=Object.create(u.prototype),v.prototype.constructor=v,v.prototype.isFloat16BufferAttribute=!0,y.prototype=Object.create(u.prototype),y.prototype.constructor=y,x.prototype=Object.create(u.prototype),x.prototype.constructor=x},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(7);const r={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},s={h:0,s:0,l:0},o={h:0,s:0,l:0};function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function c(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function l(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class u{constructor(t,e,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(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(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=i.a.euclideanModulo(t,1),e=i.a.clamp(e,0,1),n=i.a.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=a(r,i,t+1/3),this.g=a(r,i,t),this.b=a(r,i,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){let t;const i=n[1],r=n[2];switch(i){case"rgb":case"rgba":if(t=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const n=parseFloat(t[1])/360,i=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(n,i,r)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=r[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=c(t.r),this.g=c(t.g),this.b=c(t.b),this}copyLinearToSRGB(t){return this.r=l(t.r),this.g=l(t.g),this.b=l(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,n=this.g,i=this.b,r=Math.max(e,n,i),s=Math.min(e,n,i);let o,a;const c=(s+r)/2;if(s===r)o=0,a=0;else{const t=r-s;switch(a=c<=.5?t/(r+s):t/(2-r-s),r){case e:o=(n-i)/t+(n<i?6:0);break;case n:o=(i-e)/t+2;break;case i:o=(e-n)/t+4}o/=6}return t.h=o,t.s=a,t.l=c,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,n){return this.getHSL(s),s.h+=t,s.s+=e,s.l+=n,this.setHSL(s.h,s.s,s.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(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(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(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(t,e){this.getHSL(s),t.getHSL(o);const n=i.a.lerp(s.h,o.h,e),r=i.a.lerp(s.s,o.s,e),a=i.a.lerp(s.l,o.l,e);return this.setHSL(n,r,a),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}u.NAMES=r,u.prototype.r=1,u.prototype.g=1,u.prototype.b=1},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var i=n(1),r=n(29),s=n(24),o=n(3),a=n(31),c=n(2);class l{constructor(){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}computeGroups(t){const e=[];let n,i,r;const s=t.faces;for(i=0;i<s.length;i++){const t=s[i];t.materialIndex!==r&&(r=t.materialIndex,void 0!==n&&(n.count=3*i-n.start,e.push(n)),n={start:3*i,materialIndex:r})}void 0!==n&&(n.count=3*i-n.start,e.push(n)),this.groups=e}fromGeometry(t){const e=t.faces,n=t.vertices,i=t.faceVertexUvs,r=i[0]&&i[0].length>0,s=i[1]&&i[1].length>0,o=t.morphTargets,a=o.length;let l;if(a>0){l=[];for(let t=0;t<a;t++)l[t]={name:o[t].name,data:[]};this.morphTargets.position=l}const u=t.morphNormals,h=u.length;let _;if(h>0){_=[];for(let t=0;t<h;t++)_[t]={name:u[t].name,data:[]};this.morphTargets.normal=_}const d=t.skinIndices,p=t.skinWeights,m=d.length===n.length,f=p.length===n.length;n.length>0&&0===e.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let t=0;t<e.length;t++){const g=e[t];this.vertices.push(n[g.a],n[g.b],n[g.c]);const v=g.vertexNormals;if(3===v.length)this.normals.push(v[0],v[1],v[2]);else{const t=g.normal;this.normals.push(t,t,t)}const y=g.vertexColors;if(3===y.length)this.colors.push(y[0],y[1],y[2]);else{const t=g.color;this.colors.push(t,t,t)}if(!0===r){const e=i[0][t];void 0!==e?this.uvs.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",t),this.uvs.push(new c.a,new c.a,new c.a))}if(!0===s){const e=i[1][t];void 0!==e?this.uvs2.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",t),this.uvs2.push(new c.a,new c.a,new c.a))}for(let t=0;t<a;t++){const e=o[t].vertices;l[t].data.push(e[g.a],e[g.b],e[g.c])}for(let e=0;e<h;e++){const n=u[e].vertexNormals[t];_[e].data.push(n.a,n.b,n.c)}m&&this.skinIndices.push(d[g.a],d[g.b],d[g.c]),f&&this.skinWeights.push(p[g.a],p[g.b],p[g.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}}var u=n(12),h=n(10),_=n(17),d=n(7),p=n(40);let m=1;const f=new h.a,g=new u.a,v=new i.a,y=new r.a,x=new r.a,b=new i.a;function w(){Object.defineProperty(this,"id",{value:m+=2}),this.uuid=d.a.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}w.prototype=Object.assign(Object.create(s.a.prototype),{constructor:w,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){return Array.isArray(t)?this.index=new(Object(p.a)(t)>65535?o.e:o.d)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new _.a).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return f.makeRotationX(t),this.applyMatrix4(f),this},rotateY:function(t){return f.makeRotationY(t),this.applyMatrix4(f),this},rotateZ:function(t){return f.makeRotationZ(t),this.applyMatrix4(f),this},translate:function(t,e,n){return f.makeTranslation(t,e,n),this.applyMatrix4(f),this},scale:function(t,e,n){return f.makeScale(t,e,n),this.applyMatrix4(f),this},lookAt:function(t){return g.lookAt(t),g.updateMatrix(),this.applyMatrix4(g.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(v).negate(),this.translate(v.x,v.y,v.z),this},setFromObject:function(t){const e=t.geometry;if(t.isPoints||t.isLine){const t=new o.b(3*e.vertices.length,3),n=new o.b(3*e.colors.length,3);if(this.setAttribute("position",t.copyVector3sArray(e.vertices)),this.setAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){const t=new o.b(e.lineDistances.length,1);this.setAttribute("lineDistance",t.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){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new o.b(e,3)),this},updateFromObject:function(t){let e=t.geometry;if(t.isMesh){let t=e.__directGeometry;if(!0===e.elementsNeedUpdate&&(t=void 0,e.elementsNeedUpdate=!1),void 0===t)return this.fromGeometry(e);t.verticesNeedUpdate=e.verticesNeedUpdate,t.normalsNeedUpdate=e.normalsNeedUpdate,t.colorsNeedUpdate=e.colorsNeedUpdate,t.uvsNeedUpdate=e.uvsNeedUpdate,t.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=t}if(!0===e.verticesNeedUpdate){const t=this.attributes.position;void 0!==t&&(t.copyVector3sArray(e.vertices),t.needsUpdate=!0),e.verticesNeedUpdate=!1}if(!0===e.normalsNeedUpdate){const t=this.attributes.normal;void 0!==t&&(t.copyVector3sArray(e.normals),t.needsUpdate=!0),e.normalsNeedUpdate=!1}if(!0===e.colorsNeedUpdate){const t=this.attributes.color;void 0!==t&&(t.copyColorsArray(e.colors),t.needsUpdate=!0),e.colorsNeedUpdate=!1}if(e.uvsNeedUpdate){const t=this.attributes.uv;void 0!==t&&(t.copyVector2sArray(e.uvs),t.needsUpdate=!0),e.uvsNeedUpdate=!1}if(e.lineDistancesNeedUpdate){const t=this.attributes.lineDistance;void 0!==t&&(t.copyArray(e.lineDistances),t.needsUpdate=!0),e.lineDistancesNeedUpdate=!1}return e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new l).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){const e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new o.a(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){const e=new Float32Array(3*t.normals.length);this.setAttribute("normal",new o.a(e,3).copyVector3sArray(t.normals))}if(t.colors.length>0){const e=new Float32Array(3*t.colors.length);this.setAttribute("color",new o.a(e,3).copyColorsArray(t.colors))}if(t.uvs.length>0){const e=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new o.a(e,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){const e=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new o.a(e,2).copyVector2sArray(t.uvs2))}this.groups=t.groups;for(const e in t.morphTargets){const n=[],i=t.morphTargets[e];for(let t=0,e=i.length;t<e;t++){const e=i[t],r=new o.b(3*e.data.length,3);r.name=e.name,n.push(r.copyVector3sArray(e.data))}this.morphAttributes[e]=n}if(t.skinIndices.length>0){const e=new o.b(4*t.skinIndices.length,4);this.setAttribute("skinIndex",e.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){const e=new o.b(4*t.skinWeights.length,4);this.setAttribute("skinWeight",e.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 r.a);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new i.a(-1/0,-1/0,-1/0),new i.a(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];y.setFromBufferAttribute(n),this.morphTargetsRelative?(b.addVectors(this.boundingBox.min,y.min),this.boundingBox.expandByPoint(b),b.addVectors(this.boundingBox.max,y.max),this.boundingBox.expandByPoint(b)):(this.boundingBox.expandByPoint(y.min),this.boundingBox.expandByPoint(y.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new a.a);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new i.a,1/0);if(t){const n=this.boundingSphere.center;if(y.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];x.setFromBufferAttribute(n),this.morphTargetsRelative?(b.addVectors(y.min,x.min),y.expandByPoint(b),b.addVectors(y.max,x.max),y.expandByPoint(b)):(y.expandByPoint(x.min),y.expandByPoint(x.max))}y.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)b.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(b));if(e)for(let r=0,s=e.length;r<s;r++){const s=e[r],o=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++)b.fromBufferAttribute(s,e),o&&(v.fromBufferAttribute(t,e),b.add(v)),i=Math.max(i,n.distanceToSquared(b))}this.boundingSphere.radius=Math.sqrt(i),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(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new o.a(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const r=new i.a,s=new i.a,a=new i.a,c=new i.a,l=new i.a,u=new i.a,h=new i.a,_=new i.a;if(t)for(let i=0,o=t.count;i<o;i+=3){const o=t.getX(i+0),d=t.getX(i+1),p=t.getX(i+2);r.fromBufferAttribute(e,o),s.fromBufferAttribute(e,d),a.fromBufferAttribute(e,p),h.subVectors(a,s),_.subVectors(r,s),h.cross(_),c.fromBufferAttribute(n,o),l.fromBufferAttribute(n,d),u.fromBufferAttribute(n,p),c.add(h),l.add(h),u.add(h),n.setXYZ(o,c.x,c.y,c.z),n.setXYZ(d,l.x,l.y,l.z),n.setXYZ(p,u.x,u.y,u.z)}else for(let t=0,i=e.count;t<i;t+=3)r.fromBufferAttribute(e,t+0),s.fromBufferAttribute(e,t+1),a.fromBufferAttribute(e,t+2),h.subVectors(a,s),_.subVectors(r,s),h.cross(_),n.setXYZ(t+0,h.x,h.y,h.z),n.setXYZ(t+1,h.x,h.y,h.z),n.setXYZ(t+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}},merge:function(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const i in n){if(void 0===t.attributes[i])continue;const r=n[i].array,s=t.attributes[i],o=s.array,a=s.itemSize*e,c=Math.min(o.length,r.length-a);for(let t=0,e=a;t<c;t++,e++)r[e]=o[t]}return this},normalizeNormals:function(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)b.fromBufferAttribute(t,e),b.normalize(),t.setXYZ(e,b.x,b.y,b.z)},toNonIndexed:function(){function t(t,e){const n=t.array,i=t.itemSize,r=t.normalized,s=new n.constructor(e.length*i);let a=0,c=0;for(let t=0,r=e.length;t<r;t++){a=e[t]*i;for(let t=0;t<i;t++)s[c++]=n[a++]}return new o.a(s,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;const e=new w,n=this.index.array,i=this.attributes;for(const r in i){const s=t(i[r],n);e.setAttribute(r,s)}const r=this.morphAttributes;for(const i in r){const s=[],o=r[i];for(let e=0,i=o.length;e<i;e++){const i=t(o[e],n);s.push(i)}e.morphAttributes[i]=s}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let t=0,n=s.length;t<n;t++){const n=s[t];e.addGroup(n.start,n.count,n.materialIndex)}return e},toJSON:function(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e],r=i.toJSON(t.data);""!==i.name&&(r.name=i.name),t.data.attributes[e]=r}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e<i;e++){const i=n[e],r=i.toJSON(t.data);""!==i.name&&(r.name=i.name),s.push(r)}s.length>0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t},clone:function(){return(new w).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;t<r;t++)n.push(i[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}})},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(9),r=n(8);function s(t){i.a.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",this.fragmentShader="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\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,this.glslVersion=null,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}s.prototype=Object.create(i.a.prototype),s.prototype.constructor=s,s.prototype.isShaderMaterial=!0,s.prototype.copy=function(t){return i.a.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Object(r.b)(t.uniforms)