soonspacejs 2.5.11 → 2.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +4 -4
- package/package.json +2 -2
- package/types/Interface/base.d.ts +17 -7
- package/types/Library/BaseMesh.d.ts +2 -3
- package/types/Library/BaseObject3D.d.ts +11 -14
- package/types/Library/Model.d.ts +2 -9
- package/types/Library/Poi.d.ts +3 -8
- package/dist/index.js +0 -38
- package/types/encrypt.d.ts +0 -8
package/dist/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SoonSpace={})}(this,(function(e){"use strict";var t="soonspacejs",n="2.5.11";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2010-2022 Three.js Authors
|
|
5
|
-
* SPDX-License-Identifier: MIT
|
|
6
|
-
*/const i="142",s={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},r={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},a=100,o=103,l=104,c=204,h=205,d=300,u=301,p=302,m=303,f=304,g=306,y=1e3,b=1001,v=1002,x=1003,w=1004,S=1005,M=1006,L=1007,C=1008,G=1008,T=1009,R=1010,A=1011,X=1012,I=1013,_=1014,z=1015,E=1016,W=1017,Z=1018,P=1020,N=1021,V=1022,H=1023,D=1024,k=1025,B=1026,F=1027,U=1028,O=1029,Y=1030,K=1031,j=1033,J=33776,Q=33777,q=33778,$=33779,ee=35840,te=35841,ne=35842,ie=35843,se=36196,re=37492,ae=37496,oe=37808,le=37809,ce=37810,he=37811,de=37812,ue=37813,pe=37814,me=37815,fe=37816,ge=37817,ye=37818,be=37819,ve=37820,xe=37821,we=36492,Se=2200,Me=2201,Le=2202,Ce=2300,Ge=2301,Te=2302,Re=2400,Ae=2401,Xe=2402,Ie=2500,_e=2501,ze=3e3,Ee=3001,We=3200,Ze=3201,Pe="srgb",Ne="srgb-linear",Ve=7680,He=35044,De="300 es",ke=1035;class Be{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,i=n.length;t<i;t++)n[t].call(this,e);e.target=null}}}const Fe=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Ue=1234567;const Oe=Math.PI/180,Ye=180/Math.PI;function Ke(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Fe[255&e]+Fe[e>>8&255]+Fe[e>>16&255]+Fe[e>>24&255]+"-"+Fe[255&t]+Fe[t>>8&255]+"-"+Fe[t>>16&15|64]+Fe[t>>24&255]+"-"+Fe[63&n|128]+Fe[n>>8&255]+"-"+Fe[n>>16&255]+Fe[n>>24&255]+Fe[255&i]+Fe[i>>8&255]+Fe[i>>16&255]+Fe[i>>24&255]).toLowerCase()}function je(e,t,n){return Math.max(t,Math.min(n,e))}function Je(e,t){return(e%t+t)%t}function Qe(e,t,n){return(1-n)*e+n*t}function qe(e){return 0==(e&e-1)&&0!==e}function $e(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function et(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var tt=Object.freeze({__proto__:null,DEG2RAD:Oe,RAD2DEG:Ye,generateUUID:Ke,clamp:je,euclideanModulo:Je,mapLinear:function(e,t,n,i,s){return i+(e-t)*(s-i)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:Qe,damp:function(e,t,n,i){return Qe(e,t,1-Math.exp(-n*i))},pingpong:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t-Math.abs(Je(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(Ue=e);let t=Ue+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*Oe},radToDeg:function(e){return e*Ye},isPowerOfTwo:qe,ceilPowerOfTwo:$e,floorPowerOfTwo:et,setQuaternionFromProperEuler:function(e,t,n,i,s){const r=Math.cos,a=Math.sin,o=r(n/2),l=a(n/2),c=r((t+i)/2),h=a((t+i)/2),d=r((t-i)/2),u=a((t-i)/2),p=r((i-t)/2),m=a((i-t)/2);switch(s){case"XYX":e.set(o*h,l*d,l*u,o*c);break;case"YZY":e.set(l*u,o*h,l*d,o*c);break;case"ZXZ":e.set(l*d,l*u,o*h,o*c);break;case"XZX":e.set(o*h,l*m,l*p,o*c);break;case"YXY":e.set(l*p,o*h,l*m,o*c);break;case"ZYZ":e.set(l*m,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}},normalize:function(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}},denormalize:function(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}});class nt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;nt.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,r=this.y-e.y;return this.x=s*n-r*i+e.x,this.y=s*i+r*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class it{constructor(){it.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,r,a,o,l){const c=this.elements;return c[0]=e,c[1]=i,c[2]=a,c[3]=t,c[4]=s,c[5]=o,c[6]=n,c[7]=r,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,r=n[0],a=n[3],o=n[6],l=n[1],c=n[4],h=n[7],d=n[2],u=n[5],p=n[8],m=i[0],f=i[3],g=i[6],y=i[1],b=i[4],v=i[7],x=i[2],w=i[5],S=i[8];return s[0]=r*m+a*y+o*x,s[3]=r*f+a*b+o*w,s[6]=r*g+a*v+o*S,s[1]=l*m+c*y+h*x,s[4]=l*f+c*b+h*w,s[7]=l*g+c*v+h*S,s[2]=d*m+u*y+p*x,s[5]=d*f+u*b+p*w,s[8]=d*g+u*v+p*S,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],a=e[5],o=e[6],l=e[7],c=e[8];return t*r*c-t*a*l-n*s*c+n*a*o+i*s*l-i*r*o}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],a=e[5],o=e[6],l=e[7],c=e[8],h=c*r-a*l,d=a*o-c*s,u=l*s-r*o,p=t*h+n*d+i*u;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return e[0]=h*m,e[1]=(i*l-c*n)*m,e[2]=(a*n-i*r)*m,e[3]=d*m,e[4]=(c*t-i*o)*m,e[5]=(i*s-a*t)*m,e[6]=u*m,e[7]=(n*o-l*t)*m,e[8]=(r*t-n*s)*m,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,r,a){const o=Math.cos(s),l=Math.sin(s);return this.set(n*o,n*l,-n*(o*r+l*a)+r+e,-i*l,i*o,-i*(-l*r+o*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),i=this.elements,s=i[0],r=i[3],a=i[6],o=i[1],l=i[4],c=i[7];return i[0]=t*s+n*o,i[3]=t*r+n*l,i[6]=t*a+n*c,i[1]=-n*s+t*o,i[4]=-n*r+t*l,i[7]=-n*a+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}function st(e){for(let t=e.length-1;t>=0;--t)if(e[t]>65535)return!0;return!1}const rt={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function at(e,t){return new rt[e](t)}function ot(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function lt(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function ct(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}const ht={[Pe]:{[Ne]:lt},[Ne]:{[Pe]:ct}},dt={legacyMode:!0,get workingColorSpace(){return Ne},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,n){if(this.legacyMode||t===n||!t||!n)return e;if(ht[t]&&void 0!==ht[t][n]){const i=ht[t][n];return e.r=i(e.r),e.g=i(e.g),e.b=i(e.b),e}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}},ut={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},pt={r:0,g:0,b:0},mt={h:0,s:0,l:0},ft={h:0,s:0,l:0};function gt(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function yt(e,t){return t.r=e.r,t.g=e.g,t.b=e.b,t}class bt{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pe;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,dt.toWorkingColorSpace(this,t),this}setRGB(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ne;return this.r=e,this.g=t,this.b=n,dt.toWorkingColorSpace(this,i),this}setHSL(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ne;if(e=Je(e,1),t=je(t,0,1),n=je(n,0,1),0===t)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+t):n+t-n*t,s=2*n-i;this.r=gt(s,i,e+1/3),this.g=gt(s,i,e),this.b=gt(s,i,e-1/3)}return dt.toWorkingColorSpace(this,i),this}setStyle(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pe;function i(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const s=t[1],r=t[2];switch(s){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,dt.toWorkingColorSpace(this,n),i(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,dt.toWorkingColorSpace(this,n),i(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const t=parseFloat(e[1])/360,s=parseInt(e[2],10)/100,r=parseInt(e[3],10)/100;return i(e[4]),this.setHSL(t,s,r,n)}}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=t[1],i=e.length;if(3===i)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,dt.toWorkingColorSpace(this,n),this;if(6===i)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,dt.toWorkingColorSpace(this,n),this}return e&&e.length>0?this.setColorName(e,n):this}setColorName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pe;const n=ut[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=lt(e.r),this.g=lt(e.g),this.b=lt(e.b),this}copyLinearToSRGB(e){return this.r=ct(e.r),this.g=ct(e.g),this.b=ct(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe;return dt.fromWorkingColorSpace(yt(this,pt),e),je(255*pt.r,0,255)<<16^je(255*pt.g,0,255)<<8^je(255*pt.b,0,255)<<0}getHexString(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe;return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne;dt.fromWorkingColorSpace(yt(this,pt),t);const n=pt.r,i=pt.g,s=pt.b,r=Math.max(n,i,s),a=Math.min(n,i,s);let o,l;const c=(a+r)/2;if(a===r)o=0,l=0;else{const e=r-a;switch(l=c<=.5?e/(r+a):e/(2-r-a),r){case n:o=(i-s)/e+(i<s?6:0);break;case i:o=(s-n)/e+2;break;case s:o=(n-i)/e+4}o/=6}return e.h=o,e.s=l,e.l=c,e}getRGB(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ne;return dt.fromWorkingColorSpace(yt(this,pt),t),e.r=pt.r,e.g=pt.g,e.b=pt.b,e}getStyle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pe;return dt.fromWorkingColorSpace(yt(this,pt),e),e!==Pe?`color(${e} ${pt.r} ${pt.g} ${pt.b})`:`rgb(${255*pt.r|0},${255*pt.g|0},${255*pt.b|0})`}offsetHSL(e,t,n){return this.getHSL(mt),mt.h+=e,mt.s+=t,mt.l+=n,this.setHSL(mt.h,mt.s,mt.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(mt),e.getHSL(ft);const n=Qe(mt.h,ft.h,t),i=Qe(mt.s,ft.s,t),s=Qe(mt.l,ft.l,t);return this.setHSL(n,i,s),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let vt;bt.NAMES=ut;class xt{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===vt&&(vt=ot("canvas")),vt.width=e.width,vt.height=e.height;const n=vt.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=vt}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=ot("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let e=0;e<s.length;e++)s[e]=255*lt(s[e]/255);return n.putImageData(i,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*lt(t[e]/255)):t[e]=lt(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class wt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.isSource=!0,this.uuid=Ke(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(null!==i){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t<n;t++)i[t].isDataTexture?e.push(St(i[t].image)):e.push(St(i[t]))}else e=St(i);n.url=e}return t||(e.images[this.uuid]=n),n}}function St(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?xt.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Mt=0;class Lt extends Be{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lt.DEFAULT_IMAGE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt.DEFAULT_MAPPING,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:b,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:M,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:C,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:H,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:T,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:ze;super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Mt++}),this.uuid=Ke(),this.name="",this.source=new wt(e),this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=r,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new nt(0,0),this.repeat=new nt(1,1),this.center=new nt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new it,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==d)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case y:e.x=e.x-Math.floor(e.x);break;case b:e.x=e.x<0?0:1;break;case v:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case y:e.y=e.y-Math.floor(e.y);break;case b:e.y=e.y<0?0:1;break;case v:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}}Lt.DEFAULT_IMAGE=null,Lt.DEFAULT_MAPPING=d;class Ct{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;Ct.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i+r[12]*s,this.y=r[1]*t+r[5]*n+r[9]*i+r[13]*s,this.z=r[2]*t+r[6]*n+r[10]*i+r[14]*s,this.w=r[3]*t+r[7]*n+r[11]*i+r[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const r=.01,a=.1,o=e.elements,l=o[0],c=o[4],h=o[8],d=o[1],u=o[5],p=o[9],m=o[2],f=o[6],g=o[10];if(Math.abs(c-d)<r&&Math.abs(h-m)<r&&Math.abs(p-f)<r){if(Math.abs(c+d)<a&&Math.abs(h+m)<a&&Math.abs(p+f)<a&&Math.abs(l+u+g-3)<a)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(u+1)/2,y=(g+1)/2,b=(c+d)/4,v=(h+m)/4,x=(p+f)/4;return e>o&&e>y?e<r?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(e),i=b/n,s=v/n):o>y?o<r?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(o),n=b/i,s=x/i):y<r?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(y),n=v/s,i=x/s),this.set(n,i,s,t),this}let y=Math.sqrt((f-p)*(f-p)+(h-m)*(h-m)+(d-c)*(d-c));return Math.abs(y)<.001&&(y=1),this.x=(f-p)/y,this.y=(h-m)/y,this.z=(d-c)/y,this.w=Math.acos((l+u+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Gt extends Be{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ct(0,0,e,t),this.scissorTest=!1,this.viewport=new Ct(0,0,e,t);const i={width:e,height:t,depth:1};this.texture=new Lt(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:M,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null,this.samples=void 0!==n.samples?n.samples:0}setSize(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new wt(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Tt extends Lt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=x,this.minFilter=x,this.wrapR=b,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Rt extends Gt{constructor(e,t,n){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Tt(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class At extends Lt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=x,this.minFilter=x,this.wrapR=b,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Xt extends Gt{constructor(e,t,n){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new At(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class It extends Gt{constructor(e,t,n){super(e,t,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),this.isWebGLMultipleRenderTargets=!0;const i=this.texture;this.texture=[];for(let e=0;e<n;e++)this.texture[e]=i.clone(),this.texture[e].isRenderTargetTexture=!0}setSize(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,s=this.texture.length;i<s;i++)this.texture[i].image.width=e,this.texture[i].image.height=t,this.texture[i].image.depth=n;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone(),this.texture[t].isRenderTargetTexture=!0;return this}}class _t{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerp(e,t,n,i){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,i)}static slerpFlat(e,t,n,i,s,r,a){let o=n[i+0],l=n[i+1],c=n[i+2],h=n[i+3];const d=s[r+0],u=s[r+1],p=s[r+2],m=s[r+3];if(0===a)return e[t+0]=o,e[t+1]=l,e[t+2]=c,void(e[t+3]=h);if(1===a)return e[t+0]=d,e[t+1]=u,e[t+2]=p,void(e[t+3]=m);if(h!==m||o!==d||l!==u||c!==p){let e=1-a;const t=o*d+l*u+c*p+h*m,n=t>=0?1:-1,i=1-t*t;if(i>Number.EPSILON){const s=Math.sqrt(i),r=Math.atan2(s,t*n);e=Math.sin(e*r)/s,a=Math.sin(a*r)/s}const s=a*n;if(o=o*e+d*s,l=l*e+u*s,c=c*e+p*s,h=h*e+m*s,e===1-a){const e=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=e,l*=e,c*=e,h*=e}}e[t]=o,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,r){const a=n[i],o=n[i+1],l=n[i+2],c=n[i+3],h=s[r],d=s[r+1],u=s[r+2],p=s[r+3];return e[t]=a*p+c*h+o*u-l*d,e[t+1]=o*p+c*d+l*h-a*u,e[t+2]=l*p+c*u+a*d-o*h,e[t+3]=c*p-a*h-o*d-l*u,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,i=e._y,s=e._z,r=e._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(i/2),h=a(s/2),d=o(n/2),u=o(i/2),p=o(s/2);switch(r){case"XYZ":this._x=d*c*h+l*u*p,this._y=l*u*h-d*c*p,this._z=l*c*p+d*u*h,this._w=l*c*h-d*u*p;break;case"YXZ":this._x=d*c*h+l*u*p,this._y=l*u*h-d*c*p,this._z=l*c*p-d*u*h,this._w=l*c*h+d*u*p;break;case"ZXY":this._x=d*c*h-l*u*p,this._y=l*u*h+d*c*p,this._z=l*c*p+d*u*h,this._w=l*c*h-d*u*p;break;case"ZYX":this._x=d*c*h-l*u*p,this._y=l*u*h+d*c*p,this._z=l*c*p-d*u*h,this._w=l*c*h+d*u*p;break;case"YZX":this._x=d*c*h+l*u*p,this._y=l*u*h+d*c*p,this._z=l*c*p-d*u*h,this._w=l*c*h-d*u*p;break;case"XZY":this._x=d*c*h-l*u*p,this._y=l*u*h-d*c*p,this._z=l*c*p+d*u*h,this._w=l*c*h+d*u*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],r=t[1],a=t[5],o=t[9],l=t[2],c=t[6],h=t[10],d=n+a+h;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-o)*e,this._y=(s-l)*e,this._z=(r-i)*e}else if(n>a&&n>h){const e=2*Math.sqrt(1+n-a-h);this._w=(c-o)/e,this._x=.25*e,this._y=(i+r)/e,this._z=(s+l)/e}else if(a>h){const e=2*Math.sqrt(1+a-n-h);this._w=(s-l)/e,this._x=(i+r)/e,this._y=.25*e,this._z=(o+c)/e}else{const e=2*Math.sqrt(1+h-n-a);this._w=(r-i)/e,this._x=(s+l)/e,this._y=(o+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(je(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,r=e._w,a=t._x,o=t._y,l=t._z,c=t._w;return this._x=n*c+r*a+i*l-s*o,this._y=i*c+r*o+s*a-n*l,this._z=s*c+r*l+n*o-i*a,this._w=r*c-n*a-i*o-s*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,i=this._y,s=this._z,r=this._w;let a=r*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=r,this._x=n,this._y=i,this._z=s,this;const o=1-a*a;if(o<=Number.EPSILON){const e=1-t;return this._w=e*r+t*this._w,this._x=e*n+t*this._x,this._y=e*i+t*this._y,this._z=e*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=r*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=s*h+this._z*d,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),n*Math.sin(s),n*Math.cos(s),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class zt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;zt.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Wt.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Wt.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,r=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*r,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*r,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*r,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,r=e.y,a=e.z,o=e.w,l=o*t+r*i-a*n,c=o*n+a*t-s*i,h=o*i+s*n-r*t,d=-s*t-r*n-a*i;return this.x=l*o+d*-s+c*-a-h*-r,this.y=c*o+d*-r+h*-s-l*-a,this.z=h*o+d*-a+l*-r-c*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,r=t.x,a=t.y,o=t.z;return this.x=i*o-s*a,this.y=s*r-n*o,this.z=n*a-i*r,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Et.copy(this).projectOnVector(e),this.sub(Et)}reflect(e){return this.sub(Et.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(je(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Et=new zt,Wt=new _t;class Zt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt(1/0,1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt(-1/0,-1/0,-1/0);this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,i=1/0,s=-1/0,r=-1/0,a=-1/0;for(let o=0,l=e.length;o<l;o+=3){const l=e[o],c=e[o+1],h=e[o+2];l<t&&(t=l),c<n&&(n=c),h<i&&(i=h),l>s&&(s=l),c>r&&(r=c),h>a&&(a=h)}return this.min.set(t,n,i),this.max.set(s,r,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,i=1/0,s=-1/0,r=-1/0,a=-1/0;for(let o=0,l=e.count;o<l;o++){const l=e.getX(o),c=e.getY(o),h=e.getZ(o);l<t&&(t=l),c<n&&(n=c),h<i&&(i=h),l>s&&(s=l),c>r&&(r=c),h>a&&(a=h)}return this.min.set(t,n,i),this.max.set(s,r,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Nt.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n)if(t&&null!=n.attributes&&void 0!==n.attributes.position){const t=n.attributes.position;for(let n=0,i=t.count;n<i;n++)Nt.fromBufferAttribute(t,n).applyMatrix4(e.matrixWorld),this.expandByPoint(Nt)}else null===n.boundingBox&&n.computeBoundingBox(),Vt.copy(n.boundingBox),Vt.applyMatrix4(e.matrixWorld),this.union(Vt);const i=e.children;for(let e=0,n=i.length;e<n;e++)this.expandByObject(i[e],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Nt),Nt.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ot),Yt.subVectors(this.max,Ot),Ht.subVectors(e.a,Ot),Dt.subVectors(e.b,Ot),kt.subVectors(e.c,Ot),Bt.subVectors(Dt,Ht),Ft.subVectors(kt,Dt),Ut.subVectors(Ht,kt);let t=[0,-Bt.z,Bt.y,0,-Ft.z,Ft.y,0,-Ut.z,Ut.y,Bt.z,0,-Bt.x,Ft.z,0,-Ft.x,Ut.z,0,-Ut.x,-Bt.y,Bt.x,0,-Ft.y,Ft.x,0,-Ut.y,Ut.x,0];return!!Jt(t,Ht,Dt,kt,Yt)&&(t=[1,0,0,0,1,0,0,0,1],!!Jt(t,Ht,Dt,kt,Yt)&&(Kt.crossVectors(Bt,Ft),t=[Kt.x,Kt.y,Kt.z],Jt(t,Ht,Dt,kt,Yt)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Nt.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Nt).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Pt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Pt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Pt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Pt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Pt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Pt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Pt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Pt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Pt)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Pt=[new zt,new zt,new zt,new zt,new zt,new zt,new zt,new zt],Nt=new zt,Vt=new Zt,Ht=new zt,Dt=new zt,kt=new zt,Bt=new zt,Ft=new zt,Ut=new zt,Ot=new zt,Yt=new zt,Kt=new zt,jt=new zt;function Jt(e,t,n,i,s){for(let r=0,a=e.length-3;r<=a;r+=3){jt.fromArray(e,r);const a=s.x*Math.abs(jt.x)+s.y*Math.abs(jt.y)+s.z*Math.abs(jt.z),o=t.dot(jt),l=n.dot(jt),c=i.dot(jt);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const Qt=new Zt,qt=new zt,$t=new zt,en=new zt;class tn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Qt.setFromPoints(e).getCenter(n);let i=0;for(let t=0,s=e.length;t<s;t++)i=Math.max(i,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){en.subVectors(e,this.center);const t=en.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.add(en.multiplyScalar(n/e)),this.radius+=n}return this}union(e){return!0===this.center.equals(e.center)?$t.set(0,0,1).multiplyScalar(e.radius):$t.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(qt.copy(e.center).add($t)),this.expandByPoint(qt.copy(e.center).sub($t)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const nn=new zt,sn=new zt,rn=new zt,an=new zt,on=new zt,ln=new zt,cn=new zt;class hn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt(0,0,-1);this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,nn)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=nn.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(nn.copy(this.direction).multiplyScalar(t).add(this.origin),nn.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){sn.copy(e).add(t).multiplyScalar(.5),rn.copy(t).sub(e).normalize(),an.copy(this.origin).sub(sn);const s=.5*e.distanceTo(t),r=-this.direction.dot(rn),a=an.dot(this.direction),o=-an.dot(rn),l=an.lengthSq(),c=Math.abs(1-r*r);let h,d,u,p;if(c>0)if(h=r*o-a,d=r*a-o,p=s*c,h>=0)if(d>=-p)if(d<=p){const e=1/c;h*=e,d*=e,u=h*(h+r*d+2*a)+d*(r*h+d+2*o)+l}else d=s,h=Math.max(0,-(r*d+a)),u=-h*h+d*(d+2*o)+l;else d=-s,h=Math.max(0,-(r*d+a)),u=-h*h+d*(d+2*o)+l;else d<=-p?(h=Math.max(0,-(-r*s+a)),d=h>0?-s:Math.min(Math.max(-s,-o),s),u=-h*h+d*(d+2*o)+l):d<=p?(h=0,d=Math.min(Math.max(-s,-o),s),u=d*(d+2*o)+l):(h=Math.max(0,-(r*s+a)),d=h>0?s:Math.min(Math.max(-s,-o),s),u=-h*h+d*(d+2*o)+l);else d=r>0?-s:s,h=Math.max(0,-(r*d+a)),u=-h*h+d*(d+2*o)+l;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(rn).multiplyScalar(d).add(sn),u}intersectSphere(e,t){nn.subVectors(e.center,this.origin);const n=nn.dot(this.direction),i=nn.dot(nn)-n*n,s=e.radius*e.radius;if(i>s)return null;const r=Math.sqrt(s-i),a=n-r,o=n+r;return a<0&&o<0?null:a<0?this.at(o,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,r,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,i=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,i=(e.min.x-d.x)*l),c>=0?(s=(e.min.y-d.y)*c,r=(e.max.y-d.y)*c):(s=(e.max.y-d.y)*c,r=(e.min.y-d.y)*c),n>r||s>i?null:((s>n||n!=n)&&(n=s),(r<i||i!=i)&&(i=r),h>=0?(a=(e.min.z-d.z)*h,o=(e.max.z-d.z)*h):(a=(e.max.z-d.z)*h,o=(e.min.z-d.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o<i||i!=i)&&(i=o),i<0?null:this.at(n>=0?n:i,t)))}intersectsBox(e){return null!==this.intersectBox(e,nn)}intersectTriangle(e,t,n,i,s){on.subVectors(t,e),ln.subVectors(n,e),cn.crossVectors(on,ln);let r,a=this.direction.dot(cn);if(a>0){if(i)return null;r=1}else{if(!(a<0))return null;r=-1,a=-a}an.subVectors(this.origin,e);const o=r*this.direction.dot(ln.crossVectors(an,ln));if(o<0)return null;const l=r*this.direction.dot(on.cross(an));if(l<0)return null;if(o+l>a)return null;const c=-r*an.dot(cn);return c<0?null:this.at(c/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class dn{constructor(){dn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,i,s,r,a,o,l,c,h,d,u,p,m,f){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=r,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=d,g[3]=u,g[7]=p,g[11]=m,g[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new dn).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/un.setFromMatrixColumn(e,0).length(),s=1/un.setFromMatrixColumn(e,1).length(),r=1/un.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*r,t[9]=n[9]*r,t[10]=n[10]*r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,i=e.y,s=e.z,r=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(s),h=Math.sin(s);if("XYZ"===e.order){const e=r*c,n=r*h,i=a*c,s=a*h;t[0]=o*c,t[4]=-o*h,t[8]=l,t[1]=n+i*l,t[5]=e-s*l,t[9]=-a*o,t[2]=s-e*l,t[6]=i+n*l,t[10]=r*o}else if("YXZ"===e.order){const e=o*c,n=o*h,i=l*c,s=l*h;t[0]=e+s*a,t[4]=i*a-n,t[8]=r*l,t[1]=r*h,t[5]=r*c,t[9]=-a,t[2]=n*a-i,t[6]=s+e*a,t[10]=r*o}else if("ZXY"===e.order){const e=o*c,n=o*h,i=l*c,s=l*h;t[0]=e-s*a,t[4]=-r*h,t[8]=i+n*a,t[1]=n+i*a,t[5]=r*c,t[9]=s-e*a,t[2]=-r*l,t[6]=a,t[10]=r*o}else if("ZYX"===e.order){const e=r*c,n=r*h,i=a*c,s=a*h;t[0]=o*c,t[4]=i*l-n,t[8]=e*l+s,t[1]=o*h,t[5]=s*l+e,t[9]=n*l-i,t[2]=-l,t[6]=a*o,t[10]=r*o}else if("YZX"===e.order){const e=r*o,n=r*l,i=a*o,s=a*l;t[0]=o*c,t[4]=s-e*h,t[8]=i*h+n,t[1]=h,t[5]=r*c,t[9]=-a*c,t[2]=-l*c,t[6]=n*h+i,t[10]=e-s*h}else if("XZY"===e.order){const e=r*o,n=r*l,i=a*o,s=a*l;t[0]=o*c,t[4]=-h,t[8]=l*c,t[1]=e*h+s,t[5]=r*c,t[9]=n*h-i,t[2]=i*h-n,t[6]=a*c,t[10]=s*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(mn,e,fn)}lookAt(e,t,n){const i=this.elements;return bn.subVectors(e,t),0===bn.lengthSq()&&(bn.z=1),bn.normalize(),gn.crossVectors(n,bn),0===gn.lengthSq()&&(1===Math.abs(n.z)?bn.x+=1e-4:bn.z+=1e-4,bn.normalize(),gn.crossVectors(n,bn)),gn.normalize(),yn.crossVectors(bn,gn),i[0]=gn.x,i[4]=yn.x,i[8]=bn.x,i[1]=gn.y,i[5]=yn.y,i[9]=bn.y,i[2]=gn.z,i[6]=yn.z,i[10]=bn.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,r=n[0],a=n[4],o=n[8],l=n[12],c=n[1],h=n[5],d=n[9],u=n[13],p=n[2],m=n[6],f=n[10],g=n[14],y=n[3],b=n[7],v=n[11],x=n[15],w=i[0],S=i[4],M=i[8],L=i[12],C=i[1],G=i[5],T=i[9],R=i[13],A=i[2],X=i[6],I=i[10],_=i[14],z=i[3],E=i[7],W=i[11],Z=i[15];return s[0]=r*w+a*C+o*A+l*z,s[4]=r*S+a*G+o*X+l*E,s[8]=r*M+a*T+o*I+l*W,s[12]=r*L+a*R+o*_+l*Z,s[1]=c*w+h*C+d*A+u*z,s[5]=c*S+h*G+d*X+u*E,s[9]=c*M+h*T+d*I+u*W,s[13]=c*L+h*R+d*_+u*Z,s[2]=p*w+m*C+f*A+g*z,s[6]=p*S+m*G+f*X+g*E,s[10]=p*M+m*T+f*I+g*W,s[14]=p*L+m*R+f*_+g*Z,s[3]=y*w+b*C+v*A+x*z,s[7]=y*S+b*G+v*X+x*E,s[11]=y*M+b*T+v*I+x*W,s[15]=y*L+b*R+v*_+x*Z,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],r=e[1],a=e[5],o=e[9],l=e[13],c=e[2],h=e[6],d=e[10],u=e[14];return e[3]*(+s*o*h-i*l*h-s*a*d+n*l*d+i*a*u-n*o*u)+e[7]*(+t*o*u-t*l*d+s*r*d-i*r*u+i*l*c-s*o*c)+e[11]*(+t*l*h-t*a*u-s*r*h+n*r*u+s*a*c-n*l*c)+e[15]*(-i*a*c-t*o*h+t*a*d+i*r*h-n*r*d+n*o*c)}transpose(){const e=this.elements;let t;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(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],r=e[4],a=e[5],o=e[6],l=e[7],c=e[8],h=e[9],d=e[10],u=e[11],p=e[12],m=e[13],f=e[14],g=e[15],y=h*f*l-m*d*l+m*o*u-a*f*u-h*o*g+a*d*g,b=p*d*l-c*f*l-p*o*u+r*f*u+c*o*g-r*d*g,v=c*m*l-p*h*l+p*a*u-r*m*u-c*a*g+r*h*g,x=p*h*o-c*m*o-p*a*d+r*m*d+c*a*f-r*h*f,w=t*y+n*b+i*v+s*x;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const S=1/w;return e[0]=y*S,e[1]=(m*d*s-h*f*s-m*i*u+n*f*u+h*i*g-n*d*g)*S,e[2]=(a*f*s-m*o*s+m*i*l-n*f*l-a*i*g+n*o*g)*S,e[3]=(h*o*s-a*d*s-h*i*l+n*d*l+a*i*u-n*o*u)*S,e[4]=b*S,e[5]=(c*f*s-p*d*s+p*i*u-t*f*u-c*i*g+t*d*g)*S,e[6]=(p*o*s-r*f*s-p*i*l+t*f*l+r*i*g-t*o*g)*S,e[7]=(r*d*s-c*o*s+c*i*l-t*d*l-r*i*u+t*o*u)*S,e[8]=v*S,e[9]=(p*h*s-c*m*s-p*n*u+t*m*u+c*n*g-t*h*g)*S,e[10]=(r*m*s-p*a*s+p*n*l-t*m*l-r*n*g+t*a*g)*S,e[11]=(c*a*s-r*h*s-c*n*l+t*h*l+r*n*u-t*a*u)*S,e[12]=x*S,e[13]=(c*m*i-p*h*i+p*n*d-t*m*d-c*n*f+t*h*f)*S,e[14]=(p*a*i-r*m*i-p*n*o+t*m*o+r*n*f-t*a*f)*S,e[15]=(r*h*i-c*a*i+c*n*o-t*h*o-r*n*d+t*a*d)*S,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,r=e.x,a=e.y,o=e.z,l=s*r,c=s*a;return this.set(l*r+n,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+n,c*o-i*r,0,l*o-i*a,c*o+i*r,s*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,r){return this.set(1,n,s,0,e,1,r,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,r=t._y,a=t._z,o=t._w,l=s+s,c=r+r,h=a+a,d=s*l,u=s*c,p=s*h,m=r*c,f=r*h,g=a*h,y=o*l,b=o*c,v=o*h,x=n.x,w=n.y,S=n.z;return i[0]=(1-(m+g))*x,i[1]=(u+v)*x,i[2]=(p-b)*x,i[3]=0,i[4]=(u-v)*w,i[5]=(1-(d+g))*w,i[6]=(f+y)*w,i[7]=0,i[8]=(p+b)*S,i[9]=(f-y)*S,i[10]=(1-(d+m))*S,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=un.set(i[0],i[1],i[2]).length();const r=un.set(i[4],i[5],i[6]).length(),a=un.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],pn.copy(this);const o=1/s,l=1/r,c=1/a;return pn.elements[0]*=o,pn.elements[1]*=o,pn.elements[2]*=o,pn.elements[4]*=l,pn.elements[5]*=l,pn.elements[6]*=l,pn.elements[8]*=c,pn.elements[9]*=c,pn.elements[10]*=c,t.setFromRotationMatrix(pn),n.x=s,n.y=r,n.z=a,this}makePerspective(e,t,n,i,s,r){void 0===r&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,o=2*s/(t-e),l=2*s/(n-i),c=(t+e)/(t-e),h=(n+i)/(n-i),d=-(r+s)/(r-s),u=-2*r*s/(r-s);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=d,a[14]=u,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,i,s,r){const a=this.elements,o=1/(t-e),l=1/(n-i),c=1/(r-s),h=(t+e)*o,d=(n+i)*l,u=(r+s)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-d,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-u,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const un=new zt,pn=new dn,mn=new zt(0,0,0),fn=new zt(1,1,1),gn=new zt,yn=new zt,bn=new zt,vn=new dn,xn=new _t;class wn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wn.DefaultOrder;this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=e.elements,s=i[0],r=i[4],a=i[8],o=i[1],l=i[5],c=i[9],h=i[2],d=i[6],u=i[10];switch(t){case"XYZ":this._y=Math.asin(je(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,u),this._z=Math.atan2(-r,s)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-je(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,u),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(je(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,u),this._z=Math.atan2(-r,l)):(this._y=0,this._z=Math.atan2(o,s));break;case"ZYX":this._y=Math.asin(-je(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,u),this._z=Math.atan2(o,s)):(this._x=0,this._z=Math.atan2(-r,l));break;case"YZX":this._z=Math.asin(je(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,u));break;case"XZY":this._z=Math.asin(-je(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-c,u),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return vn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(vn,t,n)}setFromVector3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}reorder(e){return xn.setFromEuler(this),this.setFromQuaternion(xn,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}toVector3(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")}}wn.DefaultOrder="XYZ",wn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Sn{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let Mn=0;const Ln=new zt,Cn=new _t,Gn=new dn,Tn=new zt,Rn=new zt,An=new zt,Xn=new _t,In=new zt(1,0,0),_n=new zt(0,1,0),zn=new zt(0,0,1),En={type:"added"},Wn={type:"removed"};class Zn extends Be{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Mn++}),this.uuid=Ke(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Zn.DefaultUp.clone();const e=new zt,t=new wn,n=new _t,i=new zt(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new dn},normalMatrix:{value:new it}}),this.matrix=new dn,this.matrixWorld=new dn,this.matrixAutoUpdate=Zn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Sn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Cn.setFromAxisAngle(e,t),this.quaternion.multiply(Cn),this}rotateOnWorldAxis(e,t){return Cn.setFromAxisAngle(e,t),this.quaternion.premultiply(Cn),this}rotateX(e){return this.rotateOnAxis(In,e)}rotateY(e){return this.rotateOnAxis(_n,e)}rotateZ(e){return this.rotateOnAxis(zn,e)}translateOnAxis(e,t){return Ln.copy(e).applyQuaternion(this.quaternion),this.position.add(Ln.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(In,e)}translateY(e){return this.translateOnAxis(_n,e)}translateZ(e){return this.translateOnAxis(zn,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Gn.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?Tn.copy(e):Tn.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Rn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Gn.lookAt(Rn,Tn,this.up):Gn.lookAt(Tn,Rn,this.up),this.quaternion.setFromRotationMatrix(Gn),i&&(Gn.extractRotation(i.matrixWorld),Cn.setFromRotationMatrix(Gn),this.quaternion.premultiply(Cn.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(En)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Wn)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(Wn)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),Gn.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Gn.multiply(e.parent.matrixWorld)),e.applyMatrix4(Gn),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Rn,e,An),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Rn,Xn,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&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===t){const e=this.children;for(let t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const i={};function s(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.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.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(i.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const i=n[t];s(e.shapes,i)}else s(e.shapes,n)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,i=this.material.length;n<i;n++)t.push(s(e.materials,this.material[n]));i.material=t}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let t=0;t<this.children.length;t++)i.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];i.animations.push(s(e.animations,n))}}if(t){const t=r(e.geometries),i=r(e.materials),s=r(e.textures),a=r(e.images),o=r(e.shapes),l=r(e.skeletons),c=r(e.animations),h=r(e.nodes);t.length>0&&(n.geometries=t),i.length>0&&(n.materials=i),s.length>0&&(n.textures=s),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=i,n;function r(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}Zn.DefaultUp=new zt(0,1,0),Zn.DefaultMatrixAutoUpdate=!0;const Pn=new zt,Nn=new zt,Vn=new zt,Hn=new zt,Dn=new zt,kn=new zt,Bn=new zt,Fn=new zt,Un=new zt,On=new zt;class Yn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new zt;this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Pn.subVectors(e,t),i.cross(Pn);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Pn.subVectors(i,t),Nn.subVectors(n,t),Vn.subVectors(e,t);const r=Pn.dot(Pn),a=Pn.dot(Nn),o=Pn.dot(Vn),l=Nn.dot(Nn),c=Nn.dot(Vn),h=r*l-a*a;if(0===h)return s.set(-2,-1,-1);const d=1/h,u=(l*o-a*c)*d,p=(r*c-a*o)*d;return s.set(1-u-p,p,u)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,Hn),Hn.x>=0&&Hn.y>=0&&Hn.x+Hn.y<=1}static getUV(e,t,n,i,s,r,a,o){return this.getBarycoord(e,t,n,i,Hn),o.set(0,0),o.addScaledVector(s,Hn.x),o.addScaledVector(r,Hn.y),o.addScaledVector(a,Hn.z),o}static isFrontFacing(e,t,n,i){return Pn.subVectors(n,t),Nn.subVectors(e,t),Pn.cross(Nn).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Pn.subVectors(this.c,this.b),Nn.subVectors(this.a,this.b),.5*Pn.cross(Nn).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Yn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Yn.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return Yn.getUV(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return Yn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Yn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let r,a;Dn.subVectors(i,n),kn.subVectors(s,n),Fn.subVectors(e,n);const o=Dn.dot(Fn),l=kn.dot(Fn);if(o<=0&&l<=0)return t.copy(n);Un.subVectors(e,i);const c=Dn.dot(Un),h=kn.dot(Un);if(c>=0&&h<=c)return t.copy(i);const d=o*h-c*l;if(d<=0&&o>=0&&c<=0)return r=o/(o-c),t.copy(n).addScaledVector(Dn,r);On.subVectors(e,s);const u=Dn.dot(On),p=kn.dot(On);if(p>=0&&u<=p)return t.copy(s);const m=u*l-o*p;if(m<=0&&l>=0&&p<=0)return a=l/(l-p),t.copy(n).addScaledVector(kn,a);const f=c*p-u*h;if(f<=0&&h-c>=0&&u-p>=0)return Bn.subVectors(s,i),a=(h-c)/(h-c+(u-p)),t.copy(i).addScaledVector(Bn,a);const g=1/(f+m+d);return r=m*g,a=d*g,t.copy(n).addScaledVector(Dn,r).addScaledVector(kn,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Kn=0;class jn extends Be{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Kn++}),this.uuid=Ke(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=c,this.blendDst=h,this.blendEquation=a,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ve,this.stencilZFail=Ve,this.stencilZPass=Ve,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if("shading"===t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;continue}const i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(e){const t=[];for(const n in e){const i=e[n];delete i.metadata,t.push(i)}return t}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),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=i(e.textures),s=i(e.images);t.length>0&&(n.textures=t),s.length>0&&(n.images=s)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let i=0;i!==e;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class Jn extends jn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new bt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Qn=new zt,qn=new nt;class $n{constructor(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=He,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let n=0;for(let i=0,s=e.length;i<s;i++){let s=e[i];void 0===s&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),s=new bt),t[n++]=s.r,t[n++]=s.g,t[n++]=s.b}return this}copyVector2sArray(e){const t=this.array;let n=0;for(let i=0,s=e.length;i<s;i++){let s=e[i];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),s=new nt),t[n++]=s.x,t[n++]=s.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let i=0,s=e.length;i<s;i++){let s=e[i];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),s=new zt),t[n++]=s.x,t[n++]=s.y,t[n++]=s.z}return this}copyVector4sArray(e){const t=this.array;let n=0;for(let i=0,s=e.length;i<s;i++){let s=e[i];void 0===s&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),s=new Ct),t[n++]=s.x,t[n++]=s.y,t[n++]=s.z,t[n++]=s.w}return this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)qn.fromBufferAttribute(this,t),qn.applyMatrix3(e),this.setXY(t,qn.x,qn.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Qn.fromBufferAttribute(this,t),Qn.applyMatrix3(e),this.setXYZ(t,Qn.x,Qn.y,Qn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Qn.fromBufferAttribute(this,t),Qn.applyMatrix4(e),this.setXYZ(t,Qn.x,Qn.y,Qn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Qn.fromBufferAttribute(this,t),Qn.applyNormalMatrix(e),this.setXYZ(t,Qn.x,Qn.y,Qn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Qn.fromBufferAttribute(this,t),Qn.transformDirection(e),this.setXYZ(t,Qn.x,Qn.y,Qn.z);return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==He&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}class ei extends $n{constructor(e,t,n){super(new Int8Array(e),t,n)}}class ti extends $n{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class ni extends $n{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class ii extends $n{constructor(e,t,n){super(new Int16Array(e),t,n)}}class si extends $n{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class ri extends $n{constructor(e,t,n){super(new Int32Array(e),t,n)}}class ai extends $n{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class oi extends $n{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}}class li extends $n{constructor(e,t,n){super(new Float32Array(e),t,n)}}class ci extends $n{constructor(e,t,n){super(new Float64Array(e),t,n)}}let hi=0;const di=new dn,ui=new Zn,pi=new zt,mi=new Zt,fi=new Zt,gi=new zt;class yi extends Be{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:hi++}),this.uuid=Ke(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(st(e)?ai:si)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new it).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return di.makeRotationFromQuaternion(e),this.applyMatrix4(di),this}rotateX(e){return di.makeRotationX(e),this.applyMatrix4(di),this}rotateY(e){return di.makeRotationY(e),this.applyMatrix4(di),this}rotateZ(e){return di.makeRotationZ(e),this.applyMatrix4(di),this}translate(e,t,n){return di.makeTranslation(e,t,n),this.applyMatrix4(di),this}scale(e,t,n){return di.makeScale(e,t,n),this.applyMatrix4(di),this}lookAt(e){return ui.lookAt(e),ui.updateMatrix(),this.applyMatrix4(ui.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(pi).negate(),this.translate(pi.x,pi.y,pi.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new li(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Zt);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new zt(-1/0,-1/0,-1/0),new zt(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];mi.setFromBufferAttribute(n),this.morphTargetsRelative?(gi.addVectors(this.boundingBox.min,mi.min),this.boundingBox.expandByPoint(gi),gi.addVectors(this.boundingBox.max,mi.max),this.boundingBox.expandByPoint(gi)):(this.boundingBox.expandByPoint(mi.min),this.boundingBox.expandByPoint(mi.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new tn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new zt,1/0);if(e){const n=this.boundingSphere.center;if(mi.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];fi.setFromBufferAttribute(n),this.morphTargetsRelative?(gi.addVectors(mi.min,fi.min),mi.expandByPoint(gi),gi.addVectors(mi.max,fi.max),mi.expandByPoint(gi)):(mi.expandByPoint(fi.min),mi.expandByPoint(fi.max))}mi.getCenter(n);let i=0;for(let t=0,s=e.count;t<s;t++)gi.fromBufferAttribute(e,t),i=Math.max(i,n.distanceToSquared(gi));if(t)for(let s=0,r=t.length;s<r;s++){const r=t[s],a=this.morphTargetsRelative;for(let t=0,s=r.count;t<s;t++)gi.fromBufferAttribute(r,t),a&&(pi.fromBufferAttribute(e,t),gi.add(pi)),i=Math.max(i,n.distanceToSquared(gi))}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)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,i=t.position.array,s=t.normal.array,r=t.uv.array,a=i.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new $n(new Float32Array(4*a),4));const o=this.getAttribute("tangent").array,l=[],c=[];for(let e=0;e<a;e++)l[e]=new zt,c[e]=new zt;const h=new zt,d=new zt,u=new zt,p=new nt,m=new nt,f=new nt,g=new zt,y=new zt;function b(e,t,n){h.fromArray(i,3*e),d.fromArray(i,3*t),u.fromArray(i,3*n),p.fromArray(r,2*e),m.fromArray(r,2*t),f.fromArray(r,2*n),d.sub(h),u.sub(h),m.sub(p),f.sub(p);const s=1/(m.x*f.y-f.x*m.y);isFinite(s)&&(g.copy(d).multiplyScalar(f.y).addScaledVector(u,-m.y).multiplyScalar(s),y.copy(u).multiplyScalar(m.x).addScaledVector(d,-f.x).multiplyScalar(s),l[e].add(g),l[t].add(g),l[n].add(g),c[e].add(y),c[t].add(y),c[n].add(y))}let v=this.groups;0===v.length&&(v=[{start:0,count:n.length}]);for(let e=0,t=v.length;e<t;++e){const t=v[e],i=t.start;for(let e=i,s=i+t.count;e<s;e+=3)b(n[e+0],n[e+1],n[e+2])}const x=new zt,w=new zt,S=new zt,M=new zt;function L(e){S.fromArray(s,3*e),M.copy(S);const t=l[e];x.copy(t),x.sub(S.multiplyScalar(S.dot(t))).normalize(),w.crossVectors(M,t);const n=w.dot(c[e])<0?-1:1;o[4*e]=x.x,o[4*e+1]=x.y,o[4*e+2]=x.z,o[4*e+3]=n}for(let e=0,t=v.length;e<t;++e){const t=v[e],i=t.start;for(let e=i,s=i+t.count;e<s;e+=3)L(n[e+0]),L(n[e+1]),L(n[e+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new $n(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const i=new zt,s=new zt,r=new zt,a=new zt,o=new zt,l=new zt,c=new zt,h=new zt;if(e)for(let d=0,u=e.count;d<u;d+=3){const u=e.getX(d+0),p=e.getX(d+1),m=e.getX(d+2);i.fromBufferAttribute(t,u),s.fromBufferAttribute(t,p),r.fromBufferAttribute(t,m),c.subVectors(r,s),h.subVectors(i,s),c.cross(h),a.fromBufferAttribute(n,u),o.fromBufferAttribute(n,p),l.fromBufferAttribute(n,m),a.add(c),o.add(c),l.add(c),n.setXYZ(u,a.x,a.y,a.z),n.setXYZ(p,o.x,o.y,o.z),n.setXYZ(m,l.x,l.y,l.z)}else for(let e=0,a=t.count;e<a;e+=3)i.fromBufferAttribute(t,e+0),s.fromBufferAttribute(t,e+1),r.fromBufferAttribute(t,e+2),c.subVectors(r,s),h.subVectors(i,s),c.cross(h),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const i in n){if(void 0===e.attributes[i])continue;const s=n[i].array,r=e.attributes[i],a=r.array,o=r.itemSize*t,l=Math.min(a.length,s.length-o);for(let e=0,t=o;e<l;e++,t++)s[t]=a[e]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)gi.fromBufferAttribute(e,t),gi.normalize(),e.setXYZ(t,gi.x,gi.y,gi.z)}toNonIndexed(){function e(e,t){const n=e.array,i=e.itemSize,s=e.normalized,r=new n.constructor(t.length*i);let a=0,o=0;for(let s=0,l=t.length;s<l;s++){a=e.isInterleavedBufferAttribute?t[s]*e.data.stride+e.offset:t[s]*i;for(let e=0;e<i;e++)r[o++]=n[a++]}return new $n(r,i,s)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new yi,n=this.index.array,i=this.attributes;for(const s in i){const r=e(i[s],n);t.setAttribute(s,r)}const s=this.morphAttributes;for(const i in s){const r=[],a=s[i];for(let t=0,i=a.length;t<i;t++){const i=e(a[t],n);r.push(i)}t.morphAttributes[i]=r}t.morphTargetsRelative=this.morphTargetsRelative;const r=this.groups;for(let e=0,n=r.length;e<n;e++){const n=r[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const i=n[t];e.data.attributes[t]=i.toJSON(e.data)}const i={};let s=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],r=[];for(let t=0,i=n.length;t<i;t++){const i=n[t];r.push(i.toJSON(e.data))}r.length>0&&(i[t]=r,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(e.data.groups=JSON.parse(JSON.stringify(r)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const i=e.attributes;for(const e in i){const n=i[e];this.setAttribute(e,n.clone(t))}const s=e.morphAttributes;for(const e in s){const n=[],i=s[e];for(let e=0,s=i.length;e<s;e++)n.push(i[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const r=e.groups;for(let e=0,t=r.length;e<t;e++){const t=r[e];this.addGroup(t.start,t.count,t.materialIndex)}const a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}const bi=new dn,vi=new hn,xi=new tn,wi=new zt,Si=new zt,Mi=new zt,Li=new zt,Ci=new zt,Gi=new zt,Ti=new zt,Ri=new zt,Ai=new zt,Xi=new nt,Ii=new nt,_i=new nt,zi=new zt,Ei=new zt;class Wi extends Zn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new yi,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Jn;super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),xi.copy(n.boundingSphere),xi.applyMatrix4(s),!1===e.ray.intersectsSphere(xi))return;if(bi.copy(s).invert(),vi.copy(e.ray).applyMatrix4(bi),null!==n.boundingBox&&!1===vi.intersectsBox(n.boundingBox))return;let r;const a=n.index,o=n.attributes.position,l=n.morphAttributes.position,c=n.morphTargetsRelative,h=n.attributes.uv,d=n.attributes.uv2,u=n.groups,p=n.drawRange;if(null!==a)if(Array.isArray(i))for(let n=0,s=u.length;n<s;n++){const s=u[n],m=i[s.materialIndex];for(let n=Math.max(s.start,p.start),i=Math.min(a.count,Math.min(s.start+s.count,p.start+p.count));n<i;n+=3){const i=a.getX(n),u=a.getX(n+1),p=a.getX(n+2);r=Zi(this,m,e,vi,o,l,c,h,d,i,u,p),r&&(r.faceIndex=Math.floor(n/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{for(let n=Math.max(0,p.start),s=Math.min(a.count,p.start+p.count);n<s;n+=3){const s=a.getX(n),u=a.getX(n+1),p=a.getX(n+2);r=Zi(this,i,e,vi,o,l,c,h,d,s,u,p),r&&(r.faceIndex=Math.floor(n/3),t.push(r))}}else if(void 0!==o)if(Array.isArray(i))for(let n=0,s=u.length;n<s;n++){const s=u[n],a=i[s.materialIndex];for(let n=Math.max(s.start,p.start),i=Math.min(o.count,Math.min(s.start+s.count,p.start+p.count));n<i;n+=3){r=Zi(this,a,e,vi,o,l,c,h,d,n,n+1,n+2),r&&(r.faceIndex=Math.floor(n/3),r.face.materialIndex=s.materialIndex,t.push(r))}}else{for(let n=Math.max(0,p.start),s=Math.min(o.count,p.start+p.count);n<s;n+=3){r=Zi(this,i,e,vi,o,l,c,h,d,n,n+1,n+2),r&&(r.faceIndex=Math.floor(n/3),t.push(r))}}}}function Zi(e,t,n,i,s,r,a,o,l,c,h,d){wi.fromBufferAttribute(s,c),Si.fromBufferAttribute(s,h),Mi.fromBufferAttribute(s,d);const u=e.morphTargetInfluences;if(r&&u){Ti.set(0,0,0),Ri.set(0,0,0),Ai.set(0,0,0);for(let e=0,t=r.length;e<t;e++){const t=u[e],n=r[e];0!==t&&(Li.fromBufferAttribute(n,c),Ci.fromBufferAttribute(n,h),Gi.fromBufferAttribute(n,d),a?(Ti.addScaledVector(Li,t),Ri.addScaledVector(Ci,t),Ai.addScaledVector(Gi,t)):(Ti.addScaledVector(Li.sub(wi),t),Ri.addScaledVector(Ci.sub(Si),t),Ai.addScaledVector(Gi.sub(Mi),t)))}wi.add(Ti),Si.add(Ri),Mi.add(Ai)}e.isSkinnedMesh&&(e.boneTransform(c,wi),e.boneTransform(h,Si),e.boneTransform(d,Mi));const p=function(e,t,n,i,s,r,a,o){let l;if(l=1===t.side?i.intersectTriangle(a,r,s,!0,o):i.intersectTriangle(s,r,a,2!==t.side,o),null===l)return null;Ei.copy(o),Ei.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(Ei);return c<n.near||c>n.far?null:{distance:c,point:Ei.clone(),object:e}}(e,t,n,i,wi,Si,Mi,zi);if(p){o&&(Xi.fromBufferAttribute(o,c),Ii.fromBufferAttribute(o,h),_i.fromBufferAttribute(o,d),p.uv=Yn.getUV(zi,wi,Si,Mi,Xi,Ii,_i,new nt)),l&&(Xi.fromBufferAttribute(l,c),Ii.fromBufferAttribute(l,h),_i.fromBufferAttribute(l,d),p.uv2=Yn.getUV(zi,wi,Si,Mi,Xi,Ii,_i,new nt));const e={a:c,b:h,c:d,normal:new zt,materialIndex:0};Yn.getNormal(wi,Si,Mi,e.normal),p.face=e}return p}class Pi extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:r};const a=this;i=Math.floor(i),s=Math.floor(s),r=Math.floor(r);const o=[],l=[],c=[],h=[];let d=0,u=0;function p(e,t,n,i,s,r,p,m,f,g,y){const b=r/f,v=p/g,x=r/2,w=p/2,S=m/2,M=f+1,L=g+1;let C=0,G=0;const T=new zt;for(let r=0;r<L;r++){const a=r*v-w;for(let o=0;o<M;o++){const d=o*b-x;T[e]=d*i,T[t]=a*s,T[n]=S,l.push(T.x,T.y,T.z),T[e]=0,T[t]=0,T[n]=m>0?1:-1,c.push(T.x,T.y,T.z),h.push(o/f),h.push(1-r/g),C+=1}}for(let e=0;e<g;e++)for(let t=0;t<f;t++){const n=d+t+M*e,i=d+t+M*(e+1),s=d+(t+1)+M*(e+1),r=d+(t+1)+M*e;o.push(n,i,r),o.push(i,s,r),G+=6}a.addGroup(u,G,y),u+=G,d+=C}p("z","y","x",-1,-1,n,t,e,r,s,0),p("z","y","x",1,-1,n,t,-e,r,s,1),p("x","z","y",1,1,e,n,t,i,r,2),p("x","z","y",1,-1,e,n,-t,i,r,3),p("x","y","z",1,-1,e,t,n,i,s,4),p("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(o),this.setAttribute("position",new li(l,3)),this.setAttribute("normal",new li(c,3)),this.setAttribute("uv",new li(h,2))}static fromJSON(e){return new Pi(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ni(e){const t={};for(const n in e){t[n]={};for(const i in e[n]){const s=e[n][i];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?t[n][i]=s.clone():Array.isArray(s)?t[n][i]=s.slice():t[n][i]=s}}return t}function Vi(e){const t={};for(let n=0;n<e.length;n++){const i=Ni(e[n]);for(const e in i)t[e]=i[e]}return t}const Hi={clone:Ni,merge:Vi};class Di extends jn{constructor(e){super(),this.isShaderMaterial=!0,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.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ni(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class ki extends Zn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new dn,this.projectionMatrix=new dn,this.projectionMatrixInverse=new dn}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}class Bi extends ki{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Ye*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*Oe*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Ye*Math.atan(Math.tan(.5*Oe*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,r){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*Oe*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const r=this.view;if(null!==this.view&&this.view.enabled){const e=r.fullWidth,a=r.fullHeight;s+=r.offsetX*i/e,t-=r.offsetY*n/a,i*=r.width/e,n*=r.height/a}const a=this.filmOffset;0!==a&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Fi=90;class Ui extends Zn{constructor(e,t,n){if(super(),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const i=new Bi(Fi,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new zt(1,0,0)),this.add(i);const s=new Bi(Fi,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new zt(-1,0,0)),this.add(s);const r=new Bi(Fi,1,e,t);r.layers=this.layers,r.up.set(0,0,1),r.lookAt(new zt(0,1,0)),this.add(r);const a=new Bi(Fi,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new zt(0,-1,0)),this.add(a);const o=new Bi(Fi,1,e,t);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new zt(0,0,1)),this.add(o);const l=new Bi(Fi,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new zt(0,0,-1)),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[i,s,r,a,o,l]=this.children,c=e.getRenderTarget(),h=e.toneMapping,d=e.xr.enabled;e.toneMapping=0,e.xr.enabled=!1;const u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,r),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,o),n.texture.generateMipmaps=u,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(c),e.toneMapping=h,e.xr.enabled=d,n.texture.needsPMREMUpdate=!0}}class Oi extends Lt{constructor(e,t,n,i,s,r,a,o,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:u,n,i,s,r,a,o,l,c),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Yi extends Gt{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new Oi(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:M}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new Pi(5,5,5),s=new Di({name:"CubemapFromEquirect",uniforms:Ni(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});s.uniforms.tEquirect.value=t;const r=new Wi(i,s),a=t.minFilter;t.minFilter===C&&(t.minFilter=M);return new Ui(1,10,this).update(e,r),t.minFilter=a,r.geometry.dispose(),r.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let s=0;s<6;s++)e.setRenderTarget(this,s),e.clear(t,n,i);e.setRenderTarget(s)}}const Ki=new zt,ji=new zt,Ji=new it;class Qi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt(1,0,0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=Ki.subVectors(n,t).cross(ji.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(Ki),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(n).multiplyScalar(s).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Ji.getNormalMatrix(e),i=this.coplanarPoint(Ki).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const qi=new tn,$i=new zt;class es{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Qi,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Qi,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Qi,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Qi,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Qi,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new Qi;this.planes=[e,t,n,i,s,r]}set(e,t,n,i,s,r){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(r),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,i=n[0],s=n[1],r=n[2],a=n[3],o=n[4],l=n[5],c=n[6],h=n[7],d=n[8],u=n[9],p=n[10],m=n[11],f=n[12],g=n[13],y=n[14],b=n[15];return t[0].setComponents(a-i,h-o,m-d,b-f).normalize(),t[1].setComponents(a+i,h+o,m+d,b+f).normalize(),t[2].setComponents(a+s,h+l,m+u,b+g).normalize(),t[3].setComponents(a-s,h-l,m-u,b-g).normalize(),t[4].setComponents(a-r,h-c,m-p,b-y).normalize(),t[5].setComponents(a+r,h+c,m+p,b+y).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),qi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(qi)}intersectsSprite(e){return qi.center.set(0,0,0),qi.radius=.7071067811865476,qi.applyMatrix4(e.matrixWorld),this.intersectsSphere(qi)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)<i)return!1}return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if($i.x=i.normal.x>0?e.max.x:e.min.x,$i.y=i.normal.y>0?e.max.y:e.min.y,$i.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint($i)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function ts(){let e=null,t=!1,n=null,i=null;function s(t,r){n(t,r),i=e.requestAnimationFrame(s)}return{start:function(){!0!==t&&null!==n&&(i=e.requestAnimationFrame(s),t=!0)},stop:function(){e.cancelAnimationFrame(i),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function ns(e,t){const n=t.isWebGL2,i=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),i.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=i.get(t);n&&(e.deleteBuffer(n.buffer),i.delete(t))},update:function(t,s){if(t.isGLBufferAttribute){const e=i.get(t);return void((!e||e.version<t.version)&&i.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const r=i.get(t);void 0===r?i.set(t,function(t,i){const s=t.array,r=t.usage,a=e.createBuffer();let o;if(e.bindBuffer(i,a),e.bufferData(i,s,r),t.onUploadCallback(),s instanceof Float32Array)o=5126;else if(s instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");o=5131}else o=5123;else if(s instanceof Int16Array)o=5122;else if(s instanceof Uint32Array)o=5125;else if(s instanceof Int32Array)o=5124;else if(s instanceof Int8Array)o=5120;else if(s instanceof Uint8Array)o=5121;else{if(!(s instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+s);o=5121}return{buffer:a,type:o,bytesPerElement:s.BYTES_PER_ELEMENT,version:t.version}}(t,s)):r.version<t.version&&(!function(t,i,s){const r=i.array,a=i.updateRange;e.bindBuffer(s,t),-1===a.count?e.bufferSubData(s,0,r):(n?e.bufferSubData(s,a.offset*r.BYTES_PER_ELEMENT,r,a.offset,a.count):e.bufferSubData(s,a.offset*r.BYTES_PER_ELEMENT,r.subarray(a.offset,a.offset+a.count)),a.count=-1)}(r.buffer,t,s),r.version=t.version)}}}class is extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,r=t/2,a=Math.floor(n),o=Math.floor(i),l=a+1,c=o+1,h=e/a,d=t/o,u=[],p=[],m=[],f=[];for(let e=0;e<c;e++){const t=e*d-r;for(let n=0;n<l;n++){const i=n*h-s;p.push(i,-t,0),m.push(0,0,1),f.push(n/a),f.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<a;t++){const n=t+l*e,i=t+l*(e+1),s=t+1+l*(e+1),r=t+1+l*e;u.push(n,i,r),u.push(i,s,r)}this.setIndex(u),this.setAttribute("position",new li(p,3)),this.setAttribute("normal",new li(m,3)),this.setAttribute("uv",new li(f,2))}static fromJSON(e){return new is(e.width,e.height,e.widthSegments,e.heightSegments)}}const ss={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_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_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\nvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = mix(F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence);\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#endif\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}\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_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",iridescence_fragment:"#ifdef USE_IRIDESCENCE\nconst mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n);\nvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n}\nvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n}\nfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n}\nvec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( -pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[0] ) * exp( -4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 srgb = XYZ_TO_REC709 * xyz;\n return srgb;\n}\nvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float R21 = R12;\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[0] < iridescenceIOR ) phi23[0] = PI;\n if ( baseIOR[1] < iridescenceIOR ) phi23[1] = PI;\n if ( baseIOR[2] < iridescenceIOR ) phi23[2] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\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 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\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}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.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 vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, 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_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, 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 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\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.roughness;\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#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\nfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\nif ( material.iridescenceThickness == 0.0 ) {\n\tmaterial.iridescence = 0.0;\n} else {\n\tmaterial.iridescence = saturate( material.iridescence );\n}\nif ( material.iridescence > 0.0 ) {\n\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#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 * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\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}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_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}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",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 <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",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}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\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}",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}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",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\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\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 <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\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\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_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_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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 <normal_vertex>\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}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\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}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\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#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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 <normal_vertex>\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}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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 <normal_vertex>\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#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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 <normal_vertex>\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}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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 <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\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}",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 <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\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\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\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 <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},rs={common:{diffuse:{value:new bt(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new it},uv2Transform:{value:new it},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},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 nt(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 bt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new bt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new it}},sprite:{diffuse:{value:new bt(16777215)},opacity:{value:1},center:{value:new nt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new it}}},as={basic:{uniforms:Vi([rs.common,rs.specularmap,rs.envmap,rs.aomap,rs.lightmap,rs.fog]),vertexShader:ss.meshbasic_vert,fragmentShader:ss.meshbasic_frag},lambert:{uniforms:Vi([rs.common,rs.specularmap,rs.envmap,rs.aomap,rs.lightmap,rs.emissivemap,rs.fog,rs.lights,{emissive:{value:new bt(0)}}]),vertexShader:ss.meshlambert_vert,fragmentShader:ss.meshlambert_frag},phong:{uniforms:Vi([rs.common,rs.specularmap,rs.envmap,rs.aomap,rs.lightmap,rs.emissivemap,rs.bumpmap,rs.normalmap,rs.displacementmap,rs.fog,rs.lights,{emissive:{value:new bt(0)},specular:{value:new bt(1118481)},shininess:{value:30}}]),vertexShader:ss.meshphong_vert,fragmentShader:ss.meshphong_frag},standard:{uniforms:Vi([rs.common,rs.envmap,rs.aomap,rs.lightmap,rs.emissivemap,rs.bumpmap,rs.normalmap,rs.displacementmap,rs.roughnessmap,rs.metalnessmap,rs.fog,rs.lights,{emissive:{value:new bt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ss.meshphysical_vert,fragmentShader:ss.meshphysical_frag},toon:{uniforms:Vi([rs.common,rs.aomap,rs.lightmap,rs.emissivemap,rs.bumpmap,rs.normalmap,rs.displacementmap,rs.gradientmap,rs.fog,rs.lights,{emissive:{value:new bt(0)}}]),vertexShader:ss.meshtoon_vert,fragmentShader:ss.meshtoon_frag},matcap:{uniforms:Vi([rs.common,rs.bumpmap,rs.normalmap,rs.displacementmap,rs.fog,{matcap:{value:null}}]),vertexShader:ss.meshmatcap_vert,fragmentShader:ss.meshmatcap_frag},points:{uniforms:Vi([rs.points,rs.fog]),vertexShader:ss.points_vert,fragmentShader:ss.points_frag},dashed:{uniforms:Vi([rs.common,rs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ss.linedashed_vert,fragmentShader:ss.linedashed_frag},depth:{uniforms:Vi([rs.common,rs.displacementmap]),vertexShader:ss.depth_vert,fragmentShader:ss.depth_frag},normal:{uniforms:Vi([rs.common,rs.bumpmap,rs.normalmap,rs.displacementmap,{opacity:{value:1}}]),vertexShader:ss.meshnormal_vert,fragmentShader:ss.meshnormal_frag},sprite:{uniforms:Vi([rs.sprite,rs.fog]),vertexShader:ss.sprite_vert,fragmentShader:ss.sprite_frag},background:{uniforms:{uvTransform:{value:new it},t2D:{value:null}},vertexShader:ss.background_vert,fragmentShader:ss.background_frag},cube:{uniforms:Vi([rs.envmap,{opacity:{value:1}}]),vertexShader:ss.cube_vert,fragmentShader:ss.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ss.equirect_vert,fragmentShader:ss.equirect_frag},distanceRGBA:{uniforms:Vi([rs.common,rs.displacementmap,{referencePosition:{value:new zt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ss.distanceRGBA_vert,fragmentShader:ss.distanceRGBA_frag},shadow:{uniforms:Vi([rs.lights,rs.fog,{color:{value:new bt(0)},opacity:{value:1}}]),vertexShader:ss.shadow_vert,fragmentShader:ss.shadow_frag}};function os(e,t,n,i,s,r){const a=new bt(0);let o,l,c=!0===s?0:1,h=null,d=0,u=null;function p(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,r)}return{getClearColor:function(){return a},setClearColor:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;a.set(e),c=t,p(a,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,p(a,c)},render:function(n,s){let r=!1,m=!0===s.isScene?s.background:null;m&&m.isTexture&&(m=t.get(m));const f=e.xr,y=f.getSession&&f.getSession();y&&"additive"===y.environmentBlendMode&&(m=null),null===m?p(a,c):m&&m.isColor&&(p(m,1),r=!0),(e.autoClear||r)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.mapping===g)?(void 0===l&&(l=new Wi(new Pi(1,1,1),new Di({name:"BackgroundCubeMaterial",uniforms:Ni(as.cube.uniforms),vertexShader:as.cube.vertexShader,fragmentShader:as.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),l.material.uniforms.envMap.value=m,l.material.uniforms.flipEnvMap.value=m.isCubeTexture&&!1===m.isRenderTargetTexture?-1:1,h===m&&d===m.version&&u===e.toneMapping||(l.material.needsUpdate=!0,h=m,d=m.version,u=e.toneMapping),l.layers.enableAll(),n.unshift(l,l.geometry,l.material,0,0,null)):m&&m.isTexture&&(void 0===o&&(o=new Wi(new is(2,2),new Di({name:"BackgroundMaterial",uniforms:Ni(as.background.uniforms),vertexShader:as.background.vertexShader,fragmentShader:as.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(o)),o.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),h===m&&d===m.version&&u===e.toneMapping||(o.material.needsUpdate=!0,h=m,d=m.version,u=e.toneMapping),o.layers.enableAll(),n.unshift(o,o.geometry,o.material,0,0,null))}}}function ls(e,t,n,i){const s=e.getParameter(34921),r=i.isWebGL2?null:t.get("OES_vertex_array_object"),a=i.isWebGL2||null!==r,o={},l=p(null);let c=l,h=!1;function d(t){return i.isWebGL2?e.bindVertexArray(t):r.bindVertexArrayOES(t)}function u(t){return i.isWebGL2?e.deleteVertexArray(t):r.deleteVertexArrayOES(t)}function p(e){const t=[],n=[],i=[];for(let e=0;e<s;e++)t[e]=0,n[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:i,object:e,attributes:{},index:null}}function m(){const e=c.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function f(e){g(e,0)}function g(n,s){const r=c.newAttributes,a=c.enabledAttributes,o=c.attributeDivisors;if(r[n]=1,0===a[n]&&(e.enableVertexAttribArray(n),a[n]=1),o[n]!==s){(i.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,s),o[n]=s}}function y(){const t=c.newAttributes,n=c.enabledAttributes;for(let i=0,s=n.length;i<s;i++)n[i]!==t[i]&&(e.disableVertexAttribArray(i),n[i]=0)}function b(t,n,s,r,a,o){!0!==i.isWebGL2||5124!==s&&5125!==s?e.vertexAttribPointer(t,n,s,r,a,o):e.vertexAttribIPointer(t,n,s,a,o)}function v(){x(),h=!0,c!==l&&(c=l,d(c.object))}function x(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(s,l,u,v,x){let w=!1;if(a){const t=function(t,n,s){const a=!0===s.wireframe;let l=o[t.id];void 0===l&&(l={},o[t.id]=l);let c=l[n.id];void 0===c&&(c={},l[n.id]=c);let h=c[a];void 0===h&&(h=p(i.isWebGL2?e.createVertexArray():r.createVertexArrayOES()),c[a]=h);return h}(v,u,l);c!==t&&(c=t,d(c.object)),w=function(e,t,n,i){const s=c.attributes,r=t.attributes;let a=0;const o=n.getAttributes();for(const t in o){if(o[t].location>=0){const n=s[t];let i=r[t];if(void 0===i&&("instanceMatrix"===t&&e.instanceMatrix&&(i=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(i=e.instanceColor)),void 0===n)return!0;if(n.attribute!==i)return!0;if(i&&n.data!==i.data)return!0;a++}}return c.attributesNum!==a||c.index!==i}(s,v,u,x),w&&function(e,t,n,i){const s={},r=t.attributes;let a=0;const o=n.getAttributes();for(const t in o){if(o[t].location>=0){let n=r[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));const i={};i.attribute=n,n&&n.data&&(i.data=n.data),s[t]=i,a++}}c.attributes=s,c.attributesNum=a,c.index=i}(s,v,u,x)}else{const e=!0===l.wireframe;c.geometry===v.id&&c.program===u.id&&c.wireframe===e||(c.geometry=v.id,c.program=u.id,c.wireframe=e,w=!0)}null!==x&&n.update(x,34963),(w||h)&&(h=!1,function(s,r,a,o){if(!1===i.isWebGL2&&(s.isInstancedMesh||o.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;m();const l=o.attributes,c=a.getAttributes(),h=r.defaultAttributeValues;for(const t in c){const i=c[t];if(i.location>=0){let r=l[t];if(void 0===r&&("instanceMatrix"===t&&s.instanceMatrix&&(r=s.instanceMatrix),"instanceColor"===t&&s.instanceColor&&(r=s.instanceColor)),void 0!==r){const t=r.normalized,a=r.itemSize,l=n.get(r);if(void 0===l)continue;const c=l.buffer,h=l.type,d=l.bytesPerElement;if(r.isInterleavedBufferAttribute){const n=r.data,l=n.stride,u=r.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)g(i.location+e,n.meshPerAttribute);!0!==s.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let e=0;e<i.locationSize;e++)f(i.location+e);e.bindBuffer(34962,c);for(let e=0;e<i.locationSize;e++)b(i.location+e,a/i.locationSize,h,t,l*d,(u+a/i.locationSize*e)*d)}else{if(r.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)g(i.location+e,r.meshPerAttribute);!0!==s.isInstancedMesh&&void 0===o._maxInstanceCount&&(o._maxInstanceCount=r.meshPerAttribute*r.count)}else for(let e=0;e<i.locationSize;e++)f(i.location+e);e.bindBuffer(34962,c);for(let e=0;e<i.locationSize;e++)b(i.location+e,a/i.locationSize,h,t,a*d,a/i.locationSize*e*d)}}else if(void 0!==h){const n=h[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(i.location,n);break;case 3:e.vertexAttrib3fv(i.location,n);break;case 4:e.vertexAttrib4fv(i.location,n);break;default:e.vertexAttrib1fv(i.location,n)}}}}y()}(s,l,u,v),null!==x&&e.bindBuffer(34963,n.get(x).buffer))},reset:v,resetDefaultState:x,dispose:function(){v();for(const e in o){const t=o[e];for(const e in t){const n=t[e];for(const e in n)u(n[e].object),delete n[e];delete t[e]}delete o[e]}},releaseStatesOfGeometry:function(e){if(void 0===o[e.id])return;const t=o[e.id];for(const e in t){const n=t[e];for(const e in n)u(n[e].object),delete n[e];delete t[e]}delete o[e.id]},releaseStatesOfProgram:function(e){for(const t in o){const n=o[t];if(void 0===n[e.id])continue;const i=n[e.id];for(const e in i)u(i[e].object),delete i[e];delete n[e.id]}},initAttributes:m,enableAttribute:f,disableUnusedAttributes:y}}function cs(e,t,n,i){const s=i.isWebGL2;let r;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r,1)},this.renderInstances=function(i,a,o){if(0===o)return;let l,c;if(s)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](r,i,a,o),n.update(a,r,o)}}function hs(e,t,n){let i;function s(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const r="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const o=s(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=r||t.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=e.getParameter(34930),d=e.getParameter(35660),u=e.getParameter(3379),p=e.getParameter(34076),m=e.getParameter(34921),f=e.getParameter(36347),g=e.getParameter(36348),y=e.getParameter(36349),b=d>0,v=r||t.has("OES_texture_float");return{isWebGL2:r,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:s,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:d,maxTextureSize:u,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:y,vertexTextures:b,floatFragmentTextures:v,floatVertexTextures:b&&v,maxSamples:r?e.getParameter(36183):0}}function ds(e){const t=this;let n=null,i=0,s=!1,r=!1;const a=new Qi,o=new it,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function h(e,n,i,s){const r=null!==e?e.length:0;let c=null;if(0!==r){if(c=l.value,!0!==s||null===c){const t=i+4*r,s=n.matrixWorldInverse;o.getNormalMatrix(s),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=i;t!==r;++t,n+=4)a.copy(e[t]).applyMatrix4(s,o),a.normal.toArray(c,n),c[n+3]=a.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=r,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,r){const a=0!==e.length||t||0!==i||s;return s=t,n=h(e,r,0),i=e.length,a},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1,c()},this.setState=function(t,a,o){const d=t.clippingPlanes,u=t.clipIntersection,p=t.clipShadows,m=e.get(t);if(!s||null===d||0===d.length||r&&!p)r?h(null):c();else{const e=r?0:i,t=4*e;let s=m.clippingState||null;l.value=s,s=h(d,a,t,o);for(let e=0;e!==t;++e)s[e]=n[e];m.clippingState=s,this.numIntersection=u?this.numPlanes:0,this.numPlanes+=e}}}function us(e){let t=new WeakMap;function n(e,t){return t===m?e.mapping=u:t===f&&(e.mapping=p),e}function i(e){const n=e.target;n.removeEventListener("dispose",i);const s=t.get(n);void 0!==s&&(t.delete(n),s.dispose())}return{get:function(s){if(s&&s.isTexture&&!1===s.isRenderTargetTexture){const r=s.mapping;if(r===m||r===f){if(t.has(s)){return n(t.get(s).texture,s.mapping)}{const r=s.image;if(r&&r.height>0){const a=new Yi(r.height/2);return a.fromEquirectangularTexture(e,s),t.set(s,a),s.addEventListener("dispose",i),n(a.texture,s.mapping)}return null}}}return s},dispose:function(){t=new WeakMap}}}as.physical={uniforms:Vi([as.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new nt(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new bt(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new nt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new bt(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new bt(1,1,1)},specularColorMap:{value:null}}]),vertexShader:ss.meshphysical_vert,fragmentShader:ss.meshphysical_frag};class ps extends ki{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=r,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,r){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,r=n+e,a=i+t,o=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=e*this.view.offsetX,r=s+e*this.view.width,a-=t*this.view.offsetY,o=a-t*this.view.height}this.projectionMatrix.makeOrthographic(s,r,a,o,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}const ms=[.125,.215,.35,.446,.526,.582],fs=20,gs=new ps,ys=new bt;let bs=null;const vs=(1+Math.sqrt(5))/2,xs=1/vs,ws=[new zt(1,1,1),new zt(-1,1,1),new zt(1,1,-1),new zt(-1,1,-1),new zt(0,vs,xs),new zt(0,vs,-xs),new zt(xs,0,vs),new zt(-xs,0,vs),new zt(vs,xs,0),new zt(-vs,xs,0)];class Ss{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;bs=this._renderer.getRenderTarget(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}fromCubemap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Gs(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Cs(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(bs),e.scissorTest=!1,Ls(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===u||e.mapping===p?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),bs=this._renderer.getRenderTarget();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:M,minFilter:M,generateMipmaps:!1,type:E,format:H,encoding:ze,depthBuffer:!1},i=Ms(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Ms(e,t,n);const{_lodMax:i}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],i=[];let s=e;const r=e-4+1+ms.length;for(let a=0;a<r;a++){const r=Math.pow(2,s);n.push(r);let o=1/r;a>e-4?o=ms[a-e+4-1]:0===a&&(o=0),i.push(o);const l=1/(r-2),c=-l,h=1+l,d=[c,c,h,c,h,h,c,c,h,h,c,h],u=6,p=6,m=3,f=2,g=1,y=new Float32Array(m*p*u),b=new Float32Array(f*p*u),v=new Float32Array(g*p*u);for(let e=0;e<u;e++){const t=e%3*2/3-1,n=e>2?0:-1,i=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];y.set(i,m*p*e),b.set(d,f*p*e);const s=[e,e,e,e,e,e];v.set(s,g*p*e)}const x=new yi;x.setAttribute("position",new $n(y,m)),x.setAttribute("uv",new $n(b,f)),x.setAttribute("faceIndex",new $n(v,g)),t.push(x),s>4&&s--}return{lodPlanes:t,sizeLods:n,sigmas:i}}(i)),this._blurMaterial=function(e,t,n){const i=new Float32Array(fs),s=new zt(0,1,0);return new Di({name:"SphericalGaussianBlur",defines:{n:fs,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:Ts(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}(i,e,t)}return i}_compileMaterial(e){const t=new Wi(this._lodPlanes[0],e);this._renderer.compile(t,gs)}_sceneToCubeUV(e,t,n,i){const s=new Bi(90,1,t,n),r=[1,-1,1,1,1,1],a=[1,1,1,-1,-1,-1],o=this._renderer,l=o.autoClear,c=o.toneMapping;o.getClearColor(ys),o.toneMapping=0,o.autoClear=!1;const h=new Jn({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),d=new Wi(new Pi,h);let u=!1;const p=e.background;p?p.isColor&&(h.color.copy(p),e.background=null,u=!0):(h.color.copy(ys),u=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(s.up.set(0,r[t],0),s.lookAt(a[t],0,0)):1===n?(s.up.set(0,0,r[t]),s.lookAt(0,a[t],0)):(s.up.set(0,r[t],0),s.lookAt(0,0,a[t]));const l=this._cubeSize;Ls(i,n*l,t>2?l:0,l,l),o.setRenderTarget(i),u&&o.render(d,s),o.render(e,s)}d.geometry.dispose(),d.material.dispose(),o.toneMapping=c,o.autoClear=l,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===u||e.mapping===p;i?(null===this._cubemapMaterial&&(this._cubemapMaterial=Gs()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Cs());const s=i?this._cubemapMaterial:this._equirectMaterial,r=new Wi(this._lodPlanes[0],s);s.uniforms.envMap.value=e;const a=this._cubeSize;Ls(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(r,gs)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;t<this._lodPlanes.length;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),i=ws[(t-1)%ws.length];this._blur(e,t-1,t,n,i)}t.autoClear=n}_blur(e,t,n,i,s){const r=this._pingPongRenderTarget;this._halfBlur(e,r,t,n,i,"latitudinal",s),this._halfBlur(r,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,r,a){const o=this._renderer,l=this._blurMaterial;"latitudinal"!==r&&"longitudinal"!==r&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new Wi(this._lodPlanes[i],l),h=l.uniforms,d=this._sizeLods[n]-1,u=isFinite(s)?Math.PI/(2*d):2*Math.PI/39,p=s/u,m=isFinite(s)?1+Math.floor(3*p):fs;m>fs&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to 20`);const f=[];let g=0;for(let e=0;e<fs;++e){const t=e/p,n=Math.exp(-t*t/2);f.push(n),0===e?g+=n:e<m&&(g+=2*n)}for(let e=0;e<f.length;e++)f[e]=f[e]/g;h.envMap.value=e.texture,h.samples.value=m,h.weights.value=f,h.latitudinal.value="latitudinal"===r,a&&(h.poleAxis.value=a);const{_lodMax:y}=this;h.dTheta.value=u,h.mipInt.value=y-n;const b=this._sizeLods[i];Ls(t,3*b*(i>y-4?i-y+4:0),4*(this._cubeSize-b),3*b,2*b),o.setRenderTarget(t),o.render(c,gs)}}function Ms(e,t,n){const i=new Gt(e,t,n);return i.texture.mapping=g,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Ls(e,t,n,i,s){e.viewport.set(t,n,i,s),e.scissor.set(t,n,i,s)}function Cs(){return new Di({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Ts(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Gs(){return new Di({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Ts(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Ts(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Rs(e){let t=new WeakMap,n=null;function i(e){const n=e.target;n.removeEventListener("dispose",i);const s=t.get(n);void 0!==s&&(t.delete(n),s.dispose())}return{get:function(s){if(s&&s.isTexture){const r=s.mapping,a=r===m||r===f,o=r===u||r===p;if(a||o){if(s.isRenderTargetTexture&&!0===s.needsPMREMUpdate){s.needsPMREMUpdate=!1;let i=t.get(s);return null===n&&(n=new Ss(e)),i=a?n.fromEquirectangular(s,i):n.fromCubemap(s,i),t.set(s,i),i.texture}if(t.has(s))return t.get(s).texture;{const r=s.image;if(a&&r&&r.height>0||o&&r&&function(e){let t=0;const n=6;for(let i=0;i<n;i++)void 0!==e[i]&&t++;return t===n}(r)){null===n&&(n=new Ss(e));const r=a?n.fromEquirectangular(s):n.fromCubemap(s);return t.set(s,r),s.addEventListener("dispose",i),r.texture}return null}}}return s},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function As(e){const t={};function n(n){if(void 0!==t[n])return t[n];let i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Xs(e,t,n,i){const s={},r=new WeakMap;function a(e){const o=e.target;null!==o.index&&t.remove(o.index);for(const e in o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",a),delete s[o.id];const l=r.get(o);l&&(t.remove(l),r.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){const n=[],i=e.index,s=e.attributes.position;let a=0;if(null!==i){const e=i.array;a=i.version;for(let t=0,i=e.length;t<i;t+=3){const i=e[t+0],s=e[t+1],r=e[t+2];n.push(i,s,s,r,r,i)}}else{const e=s.array;a=s.version;for(let t=0,i=e.length/3-1;t<i;t+=3){const e=t+0,i=t+1,s=t+2;n.push(e,i,i,s,s,e)}}const o=new(st(n)?ai:si)(n,1);o.version=a;const l=r.get(e);l&&t.remove(l),r.set(e,o)}return{get:function(e,t){return!0===s[t.id]||(t.addEventListener("dispose",a),s[t.id]=!0,n.memory.geometries++),t},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const i=e.morphAttributes;for(const e in i){const n=i[e];for(let e=0,i=n.length;e<i;e++)t.update(n[e],34962)}},getWireframeAttribute:function(e){const t=r.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return r.get(e)}}}function Is(e,t,n,i){const s=i.isWebGL2;let r,a,o;this.setMode=function(e){r=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,i){e.drawElements(r,i,a,t*o),n.update(i,r,1)},this.renderInstances=function(i,l,c){if(0===c)return;let h,d;if(s)h=e,d="drawElementsInstanced";else if(h=t.get("ANGLE_instanced_arrays"),d="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[d](r,l,a,i*o,c),n.update(l,r,c)}}function _s(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,i){switch(t.calls++,n){case 4:t.triangles+=i*(e/3);break;case 1:t.lines+=i*(e/2);break;case 3:t.lines+=i*(e-1);break;case 2:t.lines+=i*e;break;case 0:t.points+=i*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function zs(e,t){return e[0]-t[0]}function Es(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Ws(e,t){let n=1;const i=t.isInterleavedBufferAttribute?t.data.array:t.array;i instanceof Int8Array?n=127:i instanceof Uint8Array?n=255:i instanceof Uint16Array?n=65535:i instanceof Int16Array?n=32767:i instanceof Int32Array?n=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",i),e.divideScalar(n)}function Zs(e,t,n){const i={},s=new Float32Array(8),r=new WeakMap,a=new Ct,o=[];for(let e=0;e<8;e++)o[e]=[e,0];return{update:function(l,c,h,d){const u=l.morphTargetInfluences;if(!0===t.isWebGL2){const i=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,s=void 0!==i?i.length:0;let o=r.get(c);if(void 0===o||o.count!==s){void 0!==o&&o.texture.dispose();const e=void 0!==c.morphAttributes.position,n=void 0!==c.morphAttributes.normal,i=void 0!==c.morphAttributes.color,l=c.morphAttributes.position||[],h=c.morphAttributes.normal||[],d=c.morphAttributes.color||[];let u=0;!0===e&&(u=1),!0===n&&(u=2),!0===i&&(u=3);let p=c.attributes.position.count*u,m=1;p>t.maxTextureSize&&(m=Math.ceil(p/t.maxTextureSize),p=t.maxTextureSize);const f=new Float32Array(p*m*4*s),g=new Tt(f,p,m,s);g.type=z,g.needsUpdate=!0;const y=4*u;for(let t=0;t<s;t++){const s=l[t],r=h[t],o=d[t],c=p*m*4*t;for(let t=0;t<s.count;t++){const l=t*y;!0===e&&(a.fromBufferAttribute(s,t),!0===s.normalized&&Ws(a,s),f[c+l+0]=a.x,f[c+l+1]=a.y,f[c+l+2]=a.z,f[c+l+3]=0),!0===n&&(a.fromBufferAttribute(r,t),!0===r.normalized&&Ws(a,r),f[c+l+4]=a.x,f[c+l+5]=a.y,f[c+l+6]=a.z,f[c+l+7]=0),!0===i&&(a.fromBufferAttribute(o,t),!0===o.normalized&&Ws(a,o),f[c+l+8]=a.x,f[c+l+9]=a.y,f[c+l+10]=a.z,f[c+l+11]=4===o.itemSize?a.w:1)}}o={count:s,texture:g,size:new nt(p,m)},r.set(c,o),c.addEventListener("dispose",(function e(){g.dispose(),r.delete(c),c.removeEventListener("dispose",e)}))}let l=0;for(let e=0;e<u.length;e++)l+=u[e];const h=c.morphTargetsRelative?1:1-l;d.getUniforms().setValue(e,"morphTargetBaseInfluence",h),d.getUniforms().setValue(e,"morphTargetInfluences",u),d.getUniforms().setValue(e,"morphTargetsTexture",o.texture,n),d.getUniforms().setValue(e,"morphTargetsTextureSize",o.size)}else{const t=void 0===u?0:u.length;let n=i[c.id];if(void 0===n||n.length!==t){n=[];for(let e=0;e<t;e++)n[e]=[e,0];i[c.id]=n}for(let e=0;e<t;e++){const t=n[e];t[0]=e,t[1]=u[e]}n.sort(Es);for(let e=0;e<8;e++)e<t&&n[e][1]?(o[e][0]=n[e][0],o[e][1]=n[e][1]):(o[e][0]=Number.MAX_SAFE_INTEGER,o[e][1]=0);o.sort(zs);const r=c.morphAttributes.position,a=c.morphAttributes.normal;let l=0;for(let e=0;e<8;e++){const t=o[e],n=t[0],i=t[1];n!==Number.MAX_SAFE_INTEGER&&i?(r&&c.getAttribute("morphTarget"+e)!==r[n]&&c.setAttribute("morphTarget"+e,r[n]),a&&c.getAttribute("morphNormal"+e)!==a[n]&&c.setAttribute("morphNormal"+e,a[n]),s[e]=i,l+=i):(r&&!0===c.hasAttribute("morphTarget"+e)&&c.deleteAttribute("morphTarget"+e),a&&!0===c.hasAttribute("morphNormal"+e)&&c.deleteAttribute("morphNormal"+e),s[e]=0)}const h=c.morphTargetsRelative?1:1-l;d.getUniforms().setValue(e,"morphTargetBaseInfluence",h),d.getUniforms().setValue(e,"morphTargetInfluences",s)}}}}function Ps(e,t,n,i){let s=new WeakMap;function r(e){const t=e.target;t.removeEventListener("dispose",r),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(e){const a=i.render.frame,o=e.geometry,l=t.get(e,o);return s.get(l)!==a&&(t.update(l),s.set(l,a)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",r)&&e.addEventListener("dispose",r),n.update(e.instanceMatrix,34962),null!==e.instanceColor&&n.update(e.instanceColor,34962)),l},dispose:function(){s=new WeakMap}}}const Ns=new Lt,Vs=new Tt,Hs=new At,Ds=new Oi,ks=[],Bs=[],Fs=new Float32Array(16),Us=new Float32Array(9),Os=new Float32Array(4);function Ys(e,t,n){const i=e[0];if(i<=0||i>0)return e;const s=t*n;let r=ks[s];if(void 0===r&&(r=new Float32Array(s),ks[s]=r),0!==t){i.toArray(r,0);for(let i=1,s=0;i!==t;++i)s+=n,e[i].toArray(r,s)}return r}function Ks(e,t){if(e.length!==t.length)return!1;for(let n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function js(e,t){for(let n=0,i=t.length;n<i;n++)e[n]=t[n]}function Js(e,t){let n=Bs[t];void 0===n&&(n=new Int32Array(t),Bs[t]=n);for(let i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function Qs(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function qs(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Ks(n,t))return;e.uniform2fv(this.addr,t),js(n,t)}}function $s(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Ks(n,t))return;e.uniform3fv(this.addr,t),js(n,t)}}function er(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Ks(n,t))return;e.uniform4fv(this.addr,t),js(n,t)}}function tr(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Ks(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),js(n,t)}else{if(Ks(n,i))return;Os.set(i),e.uniformMatrix2fv(this.addr,!1,Os),js(n,i)}}function nr(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Ks(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),js(n,t)}else{if(Ks(n,i))return;Us.set(i),e.uniformMatrix3fv(this.addr,!1,Us),js(n,i)}}function ir(e,t){const n=this.cache,i=t.elements;if(void 0===i){if(Ks(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),js(n,t)}else{if(Ks(n,i))return;Fs.set(i),e.uniformMatrix4fv(this.addr,!1,Fs),js(n,i)}}function sr(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function rr(e,t){const n=this.cache;Ks(n,t)||(e.uniform2iv(this.addr,t),js(n,t))}function ar(e,t){const n=this.cache;Ks(n,t)||(e.uniform3iv(this.addr,t),js(n,t))}function or(e,t){const n=this.cache;Ks(n,t)||(e.uniform4iv(this.addr,t),js(n,t))}function lr(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function cr(e,t){const n=this.cache;Ks(n,t)||(e.uniform2uiv(this.addr,t),js(n,t))}function hr(e,t){const n=this.cache;Ks(n,t)||(e.uniform3uiv(this.addr,t),js(n,t))}function dr(e,t){const n=this.cache;Ks(n,t)||(e.uniform4uiv(this.addr,t),js(n,t))}function ur(e,t,n){const i=this.cache,s=n.allocateTextureUnit();i[0]!==s&&(e.uniform1i(this.addr,s),i[0]=s),n.setTexture2D(t||Ns,s)}function pr(e,t,n){const i=this.cache,s=n.allocateTextureUnit();i[0]!==s&&(e.uniform1i(this.addr,s),i[0]=s),n.setTexture3D(t||Hs,s)}function mr(e,t,n){const i=this.cache,s=n.allocateTextureUnit();i[0]!==s&&(e.uniform1i(this.addr,s),i[0]=s),n.setTextureCube(t||Ds,s)}function fr(e,t,n){const i=this.cache,s=n.allocateTextureUnit();i[0]!==s&&(e.uniform1i(this.addr,s),i[0]=s),n.setTexture2DArray(t||Vs,s)}function gr(e,t){e.uniform1fv(this.addr,t)}function yr(e,t){const n=Ys(t,this.size,2);e.uniform2fv(this.addr,n)}function br(e,t){const n=Ys(t,this.size,3);e.uniform3fv(this.addr,n)}function vr(e,t){const n=Ys(t,this.size,4);e.uniform4fv(this.addr,n)}function xr(e,t){const n=Ys(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function wr(e,t){const n=Ys(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Sr(e,t){const n=Ys(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Mr(e,t){e.uniform1iv(this.addr,t)}function Lr(e,t){e.uniform2iv(this.addr,t)}function Cr(e,t){e.uniform3iv(this.addr,t)}function Gr(e,t){e.uniform4iv(this.addr,t)}function Tr(e,t){e.uniform1uiv(this.addr,t)}function Rr(e,t){e.uniform2uiv(this.addr,t)}function Ar(e,t){e.uniform3uiv(this.addr,t)}function Xr(e,t){e.uniform4uiv(this.addr,t)}function Ir(e,t,n){const i=t.length,s=Js(n,i);e.uniform1iv(this.addr,s);for(let e=0;e!==i;++e)n.setTexture2D(t[e]||Ns,s[e])}function _r(e,t,n){const i=t.length,s=Js(n,i);e.uniform1iv(this.addr,s);for(let e=0;e!==i;++e)n.setTexture3D(t[e]||Hs,s[e])}function zr(e,t,n){const i=t.length,s=Js(n,i);e.uniform1iv(this.addr,s);for(let e=0;e!==i;++e)n.setTextureCube(t[e]||Ds,s[e])}function Er(e,t,n){const i=t.length,s=Js(n,i);e.uniform1iv(this.addr,s);for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||Vs,s[e])}class Wr{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Qs;case 35664:return qs;case 35665:return $s;case 35666:return er;case 35674:return tr;case 35675:return nr;case 35676:return ir;case 5124:case 35670:return sr;case 35667:case 35671:return rr;case 35668:case 35672:return ar;case 35669:case 35673:return or;case 5125:return lr;case 36294:return cr;case 36295:return hr;case 36296:return dr;case 35678:case 36198:case 36298:case 36306:case 35682:return ur;case 35679:case 36299:case 36307:return pr;case 35680:case 36300:case 36308:case 36293:return mr;case 36289:case 36303:case 36311:case 36292:return fr}}(t.type)}}class Zr{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return gr;case 35664:return yr;case 35665:return br;case 35666:return vr;case 35674:return xr;case 35675:return wr;case 35676:return Sr;case 5124:case 35670:return Mr;case 35667:case 35671:return Lr;case 35668:case 35672:return Cr;case 35669:case 35673:return Gr;case 5125:return Tr;case 36294:return Rr;case 36295:return Ar;case 36296:return Xr;case 35678:case 36198:case 36298:case 36306:case 35682:return Ir;case 35679:case 36299:case 36307:return _r;case 35680:case 36300:case 36308:case 36293:return zr;case 36289:case 36303:case 36311:case 36292:return Er}}(t.type)}}class Pr{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,r=i.length;s!==r;++s){const r=i[s];r.setValue(e,t[r.id],n)}}}const Nr=/(\w+)(\])?(\[|\.)?/g;function Vr(e,t){e.seq.push(t),e.map[t.id]=t}function Hr(e,t,n){const i=e.name,s=i.length;for(Nr.lastIndex=0;;){const r=Nr.exec(i),a=Nr.lastIndex;let o=r[1];const l="]"===r[2],c=r[3];if(l&&(o|=0),void 0===c||"["===c&&a+2===s){Vr(n,void 0===c?new Wr(o,e,t):new Zr(o,e,t));break}{let e=n.map[o];void 0===e&&(e=new Pr(o),Vr(n,e)),n=e}}}class Dr{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,35718);for(let i=0;i<n;++i){const n=e.getActiveUniform(t,i);Hr(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,i){const s=this.map[t];void 0!==s&&s.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];void 0!==i&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let s=0,r=t.length;s!==r;++s){const r=t[s],a=n[r.id];!1!==a.needsUpdate&&r.setValue(e,a.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const s=e[i];s.id in t&&n.push(s)}return n}}function kr(e,t,n){const i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}let Br=0;function Fr(e,t,n){const i=e.getShaderParameter(t,35713),s=e.getShaderInfoLog(t).trim();if(i&&""===s)return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const i=parseInt(r[1]);return n.toUpperCase()+"\n\n"+s+"\n\n"+function(e,t){const n=e.split("\n"),i=[],s=Math.max(t-6,0),r=Math.min(t+6,n.length);for(let e=s;e<r;e++){const s=e+1;i.push(`${s===t?">":" "} ${s}: ${n[e]}`)}return i.join("\n")}(e.getShaderSource(t),i)}return s}function Ur(e,t){const n=function(e){switch(e){case ze:return["Linear","( value )"];case Ee:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Or(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Yr(e){return""!==e}function Kr(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function jr(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const Jr=/^[ \t]*#include +<([\w\d./]+)>/gm;function Qr(e){return e.replace(Jr,qr)}function qr(e,t){const n=ss[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Qr(n)}const $r=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ea=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ta(e){return e.replace(ea,ia).replace($r,na)}function na(e,t,n,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ia(e,t,n,i)}function ia(e,t,n,i){let s="";for(let e=parseInt(t);e<parseInt(n);e++)s+=i.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return s}function sa(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function ra(e,t,n,i){const s=e.getContext(),r=n.defines;let a=n.vertexShader,o=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case u:case p:t="ENVMAP_TYPE_CUBE";break;case g:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),h=function(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case p:t="ENVMAP_MODE_REFRACTION"}return t}(n),d=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),m=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,i=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}(n),f=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Yr).join("\n")}(n),y=function(e){const t=[];for(const n in e){const i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(r),b=s.createProgram();let v,x,w=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(v=[y].filter(Yr).join("\n"),v.length>0&&(v+="\n"),x=[f,y].filter(Yr).join("\n"),x.length>0&&(x+="\n")):(v=[sa(n),"#define SHADER_NAME "+n.shaderName,y,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\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(Yr).join("\n"),x=[f,sa(n),"#define SHADER_NAME "+n.shaderName,y,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?ss.tonemapping_pars_fragment:"",0!==n.toneMapping?Or("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",ss.encodings_pars_fragment,Ur("linearToOutputTexel",n.outputEncoding),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Yr).join("\n")),a=Qr(a),a=Kr(a,n),a=jr(a,n),o=Qr(o),o=Kr(o,n),o=jr(o,n),a=ta(a),o=ta(o),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(w="#version 300 es\n",v=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,x=["#define varying in",n.glslVersion===De?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===De?"":"#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"+x);const S=w+x+o,M=kr(s,35633,w+v+a),L=kr(s,35632,S);if(s.attachShader(b,M),s.attachShader(b,L),void 0!==n.index0AttributeName?s.bindAttribLocation(b,0,n.index0AttributeName):!0===n.morphTargets&&s.bindAttribLocation(b,0,"position"),s.linkProgram(b),e.debug.checkShaderErrors){const e=s.getProgramInfoLog(b).trim(),t=s.getShaderInfoLog(M).trim(),n=s.getShaderInfoLog(L).trim();let i=!0,r=!0;if(!1===s.getProgramParameter(b,35714)){i=!1;const t=Fr(s,M,"vertex"),n=Fr(s,L,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(b,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==t&&""!==n||(r=!1);r&&(this.diagnostics={runnable:i,programLog:e,vertexShader:{log:t,prefix:v},fragmentShader:{log:n,prefix:x}})}let C,G;return s.deleteShader(M),s.deleteShader(L),this.getUniforms=function(){return void 0===C&&(C=new Dr(s,b)),C},this.getAttributes=function(){return void 0===G&&(G=function(e,t){const n={},i=e.getProgramParameter(t,35721);for(let s=0;s<i;s++){const i=e.getActiveAttrib(t,s),r=i.name;let a=1;35674===i.type&&(a=2),35675===i.type&&(a=3),35676===i.type&&(a=4),n[r]={type:i.type,location:e.getAttribLocation(t,r),locationSize:a}}return n}(s,b)),G},this.destroy=function(){i.releaseStatesOfProgram(this),s.deleteProgram(b),this.program=void 0},this.name=n.shaderName,this.id=Br++,this.cacheKey=t,this.usedTimes=1,this.program=b,this.vertexShader=M,this.fragmentShader=L,this}let aa=0;class oa{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),r=this._getShaderCacheForMaterial(e);return!1===r.has(i)&&(r.add(i),i.usedTimes++),!1===r.has(s)&&(r.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;return!1===t.has(e)&&t.set(e,new Set),t.get(e)}_getShaderStage(e){const t=this.shaderCache;if(!1===t.has(e)){const n=new la(e);t.set(e,n)}return t.get(e)}}class la{constructor(e){this.id=aa++,this.code=e,this.usedTimes=0}}function ca(e,t,n,i,s,r,a){const o=new Sn,l=new oa,c=[],h=s.isWebGL2,d=s.logarithmicDepthBuffer,u=s.vertexTextures;let p=s.precision;const m={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};return{getParameters:function(r,o,c,f,y){const b=f.fog,v=y.geometry,x=r.isMeshStandardMaterial?f.environment:null,w=(r.isMeshStandardMaterial?n:t).get(r.envMap||x),S=w&&w.mapping===g?w.image.height:null,M=m[r.type];null!==r.precision&&(p=s.getMaxPrecision(r.precision),p!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",p,"instead."));const L=v.morphAttributes.position||v.morphAttributes.normal||v.morphAttributes.color,C=void 0!==L?L.length:0;let G,T,R,A,X=0;if(void 0!==v.morphAttributes.position&&(X=1),void 0!==v.morphAttributes.normal&&(X=2),void 0!==v.morphAttributes.color&&(X=3),M){const e=as[M];G=e.vertexShader,T=e.fragmentShader}else G=r.vertexShader,T=r.fragmentShader,l.update(r),R=l.getVertexShaderID(r),A=l.getFragmentShaderID(r);const I=e.getRenderTarget(),_=r.alphaTest>0,z=r.clearcoat>0,E=r.iridescence>0;return{isWebGL2:h,shaderID:M,shaderName:r.type,vertexShader:G,fragmentShader:T,defines:r.defines,customVertexShaderID:R,customFragmentShaderID:A,isRawShaderMaterial:!0===r.isRawShaderMaterial,glslVersion:r.glslVersion,precision:p,instancing:!0===y.isInstancedMesh,instancingColor:!0===y.isInstancedMesh&&null!==y.instanceColor,supportsVertexTextures:u,outputEncoding:null===I?e.outputEncoding:!0===I.isXRRenderTarget?I.texture.encoding:ze,map:!!r.map,matcap:!!r.matcap,envMap:!!w,envMapMode:w&&w.mapping,envMapCubeUVHeight:S,lightMap:!!r.lightMap,aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:1===r.normalMapType,tangentSpaceNormalMap:0===r.normalMapType,decodeVideoTexture:!!r.map&&!0===r.map.isVideoTexture&&r.map.encoding===Ee,clearcoat:z,clearcoatMap:z&&!!r.clearcoatMap,clearcoatRoughnessMap:z&&!!r.clearcoatRoughnessMap,clearcoatNormalMap:z&&!!r.clearcoatNormalMap,iridescence:E,iridescenceMap:E&&!!r.iridescenceMap,iridescenceThicknessMap:E&&!!r.iridescenceThicknessMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,specularIntensityMap:!!r.specularIntensityMap,specularColorMap:!!r.specularColorMap,opaque:!1===r.transparent&&1===r.blending,alphaMap:!!r.alphaMap,alphaTest:_,gradientMap:!!r.gradientMap,sheen:r.sheen>0,sheenColorMap:!!r.sheenColorMap,sheenRoughnessMap:!!r.sheenRoughnessMap,transmission:r.transmission>0,transmissionMap:!!r.transmissionMap,thicknessMap:!!r.thicknessMap,combine:r.combine,vertexTangents:!!r.normalMap&&!!v.attributes.tangent,vertexColors:r.vertexColors,vertexAlphas:!0===r.vertexColors&&!!v.attributes.color&&4===v.attributes.color.itemSize,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatMap||r.clearcoatRoughnessMap||r.clearcoatNormalMap||r.iridescenceMap||r.iridescenceThicknessMap||r.displacementMap||r.transmissionMap||r.thicknessMap||r.specularIntensityMap||r.specularColorMap||r.sheenColorMap||r.sheenRoughnessMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||r.iridescenceMap||r.iridescenceThicknessMap||r.transmission>0||r.transmissionMap||r.thicknessMap||r.specularIntensityMap||r.specularColorMap||r.sheen>0||r.sheenColorMap||r.sheenRoughnessMap||!r.displacementMap),fog:!!b,useFog:!0===r.fog,fogExp2:b&&b.isFogExp2,flatShading:!!r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:d,skinning:!0===y.isSkinnedMesh,morphTargets:void 0!==v.morphAttributes.position,morphNormals:void 0!==v.morphAttributes.normal,morphColors:void 0!==v.morphAttributes.color,morphTargetsCount:C,morphTextureStride:X,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:r.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,doubleSided:2===r.side,flipSided:1===r.side,useDepthPacking:!!r.depthPacking,depthPacking:r.depthPacking||0,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||i.has("EXT_shader_texture_lod"),customProgramCacheKey:r.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputEncoding),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.combine),e.push(t.vertexUvs),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){o.disableAll(),t.isWebGL2&&o.enable(0);t.supportsVertexTextures&&o.enable(1);t.instancing&&o.enable(2);t.instancingColor&&o.enable(3);t.map&&o.enable(4);t.matcap&&o.enable(5);t.envMap&&o.enable(6);t.lightMap&&o.enable(7);t.aoMap&&o.enable(8);t.emissiveMap&&o.enable(9);t.bumpMap&&o.enable(10);t.normalMap&&o.enable(11);t.objectSpaceNormalMap&&o.enable(12);t.tangentSpaceNormalMap&&o.enable(13);t.clearcoat&&o.enable(14);t.clearcoatMap&&o.enable(15);t.clearcoatRoughnessMap&&o.enable(16);t.clearcoatNormalMap&&o.enable(17);t.iridescence&&o.enable(18);t.iridescenceMap&&o.enable(19);t.iridescenceThicknessMap&&o.enable(20);t.displacementMap&&o.enable(21);t.specularMap&&o.enable(22);t.roughnessMap&&o.enable(23);t.metalnessMap&&o.enable(24);t.gradientMap&&o.enable(25);t.alphaMap&&o.enable(26);t.alphaTest&&o.enable(27);t.vertexColors&&o.enable(28);t.vertexAlphas&&o.enable(29);t.vertexUvs&&o.enable(30);t.vertexTangents&&o.enable(31);t.uvsVertexOnly&&o.enable(32);t.fog&&o.enable(33);e.push(o.mask),o.disableAll(),t.useFog&&o.enable(0);t.flatShading&&o.enable(1);t.logarithmicDepthBuffer&&o.enable(2);t.skinning&&o.enable(3);t.morphTargets&&o.enable(4);t.morphNormals&&o.enable(5);t.morphColors&&o.enable(6);t.premultipliedAlpha&&o.enable(7);t.shadowMapEnabled&&o.enable(8);t.physicallyCorrectLights&&o.enable(9);t.doubleSided&&o.enable(10);t.flipSided&&o.enable(11);t.useDepthPacking&&o.enable(12);t.dithering&&o.enable(13);t.specularIntensityMap&&o.enable(14);t.specularColorMap&&o.enable(15);t.transmission&&o.enable(16);t.transmissionMap&&o.enable(17);t.thicknessMap&&o.enable(18);t.sheen&&o.enable(19);t.sheenColorMap&&o.enable(20);t.sheenRoughnessMap&&o.enable(21);t.decodeVideoTexture&&o.enable(22);t.opaque&&o.enable(23);e.push(o.mask)}(n,t),n.push(e.outputEncoding)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=m[e.type];let n;if(t){const e=as[t];n=Hi.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let i;for(let e=0,t=c.length;e<t;e++){const t=c[e];if(t.cacheKey===n){i=t,++i.usedTimes;break}}return void 0===i&&(i=new ra(e,n,t,r),c.push(i)),i},releaseProgram:function(e){if(0==--e.usedTimes){const t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function ha(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function da(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function ua(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function pa(){const e=[];let t=0;const n=[],i=[],s=[];function r(n,i,s,r,a,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:i,material:s,groupOrder:r,renderOrder:n.renderOrder,z:a,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=i,l.material=s,l.groupOrder=r,l.renderOrder=n.renderOrder,l.z=a,l.group=o),t++,l}return{opaque:n,transmissive:i,transparent:s,init:function(){t=0,n.length=0,i.length=0,s.length=0},push:function(e,t,a,o,l,c){const h=r(e,t,a,o,l,c);a.transmission>0?i.push(h):!0===a.transparent?s.push(h):n.push(h)},unshift:function(e,t,a,o,l,c){const h=r(e,t,a,o,l,c);a.transmission>0?i.unshift(h):!0===a.transparent?s.unshift(h):n.unshift(h)},finish:function(){for(let n=t,i=e.length;n<i;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||da),i.length>1&&i.sort(t||ua),s.length>1&&s.sort(t||ua)}}}function ma(){let e=new WeakMap;return{get:function(t,n){let i;return!1===e.has(t)?(i=new pa,e.set(t,[i])):n>=e.get(t).length?(i=new pa,e.get(t).push(i)):i=e.get(t)[n],i},dispose:function(){e=new WeakMap}}}function fa(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new zt,color:new bt};break;case"SpotLight":n={position:new zt,direction:new zt,color:new bt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new zt,color:new bt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new zt,skyColor:new bt,groundColor:new bt};break;case"RectAreaLight":n={color:new bt,position:new zt,halfWidth:new zt,halfHeight:new zt}}return e[t.id]=n,n}}}let ga=0;function ya(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function ba(e,t){const n=new fa,i=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new nt,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),s={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)s.probe.push(new zt);const r=new zt,a=new dn,o=new dn;return{setup:function(r,a){let o=0,l=0,c=0;for(let e=0;e<9;e++)s.probe[e].set(0,0,0);let h=0,d=0,u=0,p=0,m=0,f=0,g=0,y=0;r.sort(ya);const b=!0!==a?Math.PI:1;for(let e=0,t=r.length;e<t;e++){const t=r[e],a=t.color,v=t.intensity,x=t.distance,w=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)o+=a.r*v*b,l+=a.g*v*b,c+=a.b*v*b;else if(t.isLightProbe)for(let e=0;e<9;e++)s.probe[e].addScaledVector(t.sh.coefficients[e],v);else if(t.isDirectionalLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*b),t.castShadow){const e=t.shadow,n=i.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,s.directionalShadow[h]=n,s.directionalShadowMap[h]=w,s.directionalShadowMatrix[h]=t.shadow.matrix,f++}s.directional[h]=e,h++}else if(t.isSpotLight){const e=n.get(t);if(e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(a).multiplyScalar(v*b),e.distance=x,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,t.castShadow){const e=t.shadow,n=i.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,s.spotShadow[u]=n,s.spotShadowMap[u]=w,s.spotShadowMatrix[u]=t.shadow.matrix,y++}s.spot[u]=e,u++}else if(t.isRectAreaLight){const e=n.get(t);e.color.copy(a).multiplyScalar(v),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),s.rectArea[p]=e,p++}else if(t.isPointLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*b),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,n=i.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,n.shadowCameraNear=e.camera.near,n.shadowCameraFar=e.camera.far,s.pointShadow[d]=n,s.pointShadowMap[d]=w,s.pointShadowMatrix[d]=t.shadow.matrix,g++}s.point[d]=e,d++}else if(t.isHemisphereLight){const e=n.get(t);e.skyColor.copy(t.color).multiplyScalar(v*b),e.groundColor.copy(t.groundColor).multiplyScalar(v*b),s.hemi[m]=e,m++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(s.rectAreaLTC1=rs.LTC_FLOAT_1,s.rectAreaLTC2=rs.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(s.rectAreaLTC1=rs.LTC_HALF_1,s.rectAreaLTC2=rs.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),s.ambient[0]=o,s.ambient[1]=l,s.ambient[2]=c;const v=s.hash;v.directionalLength===h&&v.pointLength===d&&v.spotLength===u&&v.rectAreaLength===p&&v.hemiLength===m&&v.numDirectionalShadows===f&&v.numPointShadows===g&&v.numSpotShadows===y||(s.directional.length=h,s.spot.length=u,s.rectArea.length=p,s.point.length=d,s.hemi.length=m,s.directionalShadow.length=f,s.directionalShadowMap.length=f,s.pointShadow.length=g,s.pointShadowMap.length=g,s.spotShadow.length=y,s.spotShadowMap.length=y,s.directionalShadowMatrix.length=f,s.pointShadowMatrix.length=g,s.spotShadowMatrix.length=y,v.directionalLength=h,v.pointLength=d,v.spotLength=u,v.rectAreaLength=p,v.hemiLength=m,v.numDirectionalShadows=f,v.numPointShadows=g,v.numSpotShadows=y,s.version=ga++)},setupView:function(e,t){let n=0,i=0,l=0,c=0,h=0;const d=t.matrixWorldInverse;for(let t=0,u=e.length;t<u;t++){const u=e[t];if(u.isDirectionalLight){const e=s.directional[n];e.direction.setFromMatrixPosition(u.matrixWorld),r.setFromMatrixPosition(u.target.matrixWorld),e.direction.sub(r),e.direction.transformDirection(d),n++}else if(u.isSpotLight){const e=s.spot[l];e.position.setFromMatrixPosition(u.matrixWorld),e.position.applyMatrix4(d),e.direction.setFromMatrixPosition(u.matrixWorld),r.setFromMatrixPosition(u.target.matrixWorld),e.direction.sub(r),e.direction.transformDirection(d),l++}else if(u.isRectAreaLight){const e=s.rectArea[c];e.position.setFromMatrixPosition(u.matrixWorld),e.position.applyMatrix4(d),o.identity(),a.copy(u.matrixWorld),a.premultiply(d),o.extractRotation(a),e.halfWidth.set(.5*u.width,0,0),e.halfHeight.set(0,.5*u.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),c++}else if(u.isPointLight){const e=s.point[i];e.position.setFromMatrixPosition(u.matrixWorld),e.position.applyMatrix4(d),i++}else if(u.isHemisphereLight){const e=s.hemi[h];e.direction.setFromMatrixPosition(u.matrixWorld),e.direction.transformDirection(d),h++}}},state:s}}function va(e,t){const n=new ba(e,t),i=[],s=[];return{init:function(){i.length=0,s.length=0},state:{lightsArray:i,shadowsArray:s,lights:n},setupLights:function(e){n.setup(i,e)},setupLightsView:function(e){n.setupView(i,e)},pushLight:function(e){i.push(e)},pushShadow:function(e){s.push(e)}}}function xa(e,t){let n=new WeakMap;return{get:function(i){let s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!1===n.has(i)?(s=new va(e,t),n.set(i,[s])):r>=n.get(i).length?(s=new va(e,t),n.get(i).push(s)):s=n.get(i)[r],s},dispose:function(){n=new WeakMap}}}class wa extends jn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=We,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Sa extends jn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new zt,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Ma(e,t,n){let i=new es;const s=new nt,r=new nt,a=new Ct,o=new wa({depthPacking:Ze}),l=new Sa,c={},h=n.maxTextureSize,d={0:1,1:0,2:2},u=new Di({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new nt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=u.clone();p.defines.HORIZONTAL_PASS=1;const m=new yi;m.setAttribute("position",new $n(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const f=new Wi(m,u),g=this;function y(n,i){const r=t.update(f);u.defines.VSM_SAMPLES!==n.blurSamples&&(u.defines.VSM_SAMPLES=n.blurSamples,p.defines.VSM_SAMPLES=n.blurSamples,u.needsUpdate=!0,p.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new Gt(s.x,s.y)),u.uniforms.shadow_pass.value=n.map.texture,u.uniforms.resolution.value=n.mapSize,u.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,u,f,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,p,f,null)}function b(t,n,i,s,r,a){let h=null;const u=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(h=void 0!==u?u:!0===i.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const e=h.uuid,t=n.uuid;let i=c[e];void 0===i&&(i={},c[e]=i);let s=i[t];void 0===s&&(s=h.clone(),i[t]=s),h=s}return h.visible=n.visible,h.wireframe=n.wireframe,h.side=3===a?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:d[n.side],h.alphaMap=n.alphaMap,h.alphaTest=n.alphaTest,h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.displacementMap=n.displacementMap,h.displacementScale=n.displacementScale,h.displacementBias=n.displacementBias,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,!0===i.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(i.matrixWorld),h.nearDistance=s,h.farDistance=r),h}function v(n,s,r,a,o){if(!1===n.visible)return;if(n.layers.test(s.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,n.matrixWorld);const i=t.update(n),s=n.material;if(Array.isArray(s)){const t=i.groups;for(let l=0,c=t.length;l<c;l++){const c=t[l],h=s[c.materialIndex];if(h&&h.visible){const t=b(n,h,a,r.near,r.far,o);e.renderBufferDirect(r,null,i,t,n,c)}}}else if(s.visible){const t=b(n,s,a,r.near,r.far,o);e.renderBufferDirect(r,null,i,t,n,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)v(l[e],s,r,a,o)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,n,o){if(!1===g.enabled)return;if(!1===g.autoUpdate&&!1===g.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),u=e.state;u.setBlending(0),u.buffers.color.setClear(1,1,1,1),u.buffers.depth.setTest(!0),u.setScissorTest(!1);for(let l=0,c=t.length;l<c;l++){const c=t[l],d=c.shadow;if(void 0===d){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===d.autoUpdate&&!1===d.needsUpdate)continue;s.copy(d.mapSize);const p=d.getFrameExtents();if(s.multiply(p),r.copy(d.mapSize),(s.x>h||s.y>h)&&(s.x>h&&(r.x=Math.floor(h/p.x),s.x=r.x*p.x,d.mapSize.x=r.x),s.y>h&&(r.y=Math.floor(h/p.y),s.y=r.y*p.y,d.mapSize.y=r.y)),null===d.map){const e=3!==this.type?{minFilter:x,magFilter:x}:{};d.map=new Gt(s.x,s.y,e),d.map.texture.name=c.name+".shadowMap",d.camera.updateProjectionMatrix()}e.setRenderTarget(d.map),e.clear();const m=d.getViewportCount();for(let e=0;e<m;e++){const t=d.getViewport(e);a.set(r.x*t.x,r.y*t.y,r.x*t.z,r.y*t.w),u.viewport(a),d.updateMatrices(c,e),i=d.getFrustum(),v(n,o,d.camera,c,this.type)}!0!==d.isPointLightShadow&&3===this.type&&y(d,o),d.needsUpdate=!1}g.needsUpdate=!1,e.setRenderTarget(l,c,d)}}function La(e,t,n){const i=n.isWebGL2;const s=new function(){let t=!1;const n=new Ct;let i=null;const s=new Ct(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,r,a,o){!0===o&&(t*=a,i*=a,r*=a),n.set(t,i,r,a),!1===s.equals(n)&&(e.clearColor(t,i,r,a),s.copy(n))},reset:function(){t=!1,i=null,s.set(-1,0,0,0)}}},r=new function(){let t=!1,n=null,i=null,s=null;return{setTest:function(e){e?D(2929):k(2929)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);i=t}},setLocked:function(e){t=e},setClear:function(t){s!==t&&(e.clearDepth(t),s=t)},reset:function(){t=!1,n=null,i=null,s=null}}},o=new function(){let t=!1,n=null,i=null,s=null,r=null,a=null,o=null,l=null,c=null;return{setTest:function(e){t||(e?D(2960):k(2960))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,a){i===t&&s===n&&r===a||(e.stencilFunc(t,n,a),i=t,s=n,r=a)},setOp:function(t,n,i){a===t&&o===n&&l===i||(e.stencilOp(t,n,i),a=t,o=n,l=i)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,i=null,s=null,r=null,a=null,o=null,l=null,c=null}}};let l={},d={},u=new WeakMap,p=[],m=null,f=!1,g=null,y=null,b=null,v=null,x=null,w=null,S=null,M=!1,L=null,C=null,G=null,T=null,R=null;const A=e.getParameter(35661);let X=!1,I=0;const _=e.getParameter(7938);-1!==_.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(_)[1]),X=I>=1):-1!==_.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(_)[1]),X=I>=2);let z=null,E={};const W=e.getParameter(3088),Z=e.getParameter(2978),P=(new Ct).fromArray(W),N=(new Ct).fromArray(Z);function V(t,n,i){const s=new Uint8Array(4),r=e.createTexture();e.bindTexture(t,r),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;t<i;t++)e.texImage2D(n+t,0,6408,1,1,0,6408,5121,s);return r}const H={};function D(t){!0!==l[t]&&(e.enable(t),l[t]=!0)}function k(t){!1!==l[t]&&(e.disable(t),l[t]=!1)}H[3553]=V(3553,3553,1),H[34067]=V(34067,34069,6),s.setClear(0,0,0,1),r.setClear(1),o.setClear(0),D(2929),r.setFunc(3),O(!1),Y(1),D(2884),U(0);const B={[a]:32774,101:32778,102:32779};if(i)B[103]=32775,B[104]=32776;else{const e=t.get("EXT_blend_minmax");null!==e&&(B[103]=e.MIN_EXT,B[104]=e.MAX_EXT)}const F={200:0,201:1,202:768,[c]:770,210:776,208:774,206:772,203:769,[h]:771,209:775,207:773};function U(t,n,i,s,r,o,l,c){if(0!==t){if(!1===f&&(D(3042),f=!0),5===t)r=r||n,o=o||i,l=l||s,n===y&&r===x||(e.blendEquationSeparate(B[n],B[r]),y=n,x=r),i===b&&s===v&&o===w&&l===S||(e.blendFuncSeparate(F[i],F[s],F[o],F[l]),b=i,v=s,w=o,S=l),g=t,M=null;else if(t!==g||c!==M){if(y===a&&x===a||(e.blendEquation(32774),y=a,x=a),c)switch(t){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,769,0,1);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFuncSeparate(0,769,0,1);break;case 4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}b=null,v=null,w=null,S=null,g=t,M=c}}else!0===f&&(k(3042),f=!1)}function O(t){L!==t&&(t?e.frontFace(2304):e.frontFace(2305),L=t)}function Y(t){0!==t?(D(2884),t!==C&&(1===t?e.cullFace(1029):2===t?e.cullFace(1028):e.cullFace(1032))):k(2884),C=t}function K(t,n,i){t?(D(32823),T===n&&R===i||(e.polygonOffset(n,i),T=n,R=i)):k(32823)}function j(t){void 0===t&&(t=33984+A-1),z!==t&&(e.activeTexture(t),z=t)}return{buffers:{color:s,depth:r,stencil:o},enable:D,disable:k,bindFramebuffer:function(t,n){return d[t]!==n&&(e.bindFramebuffer(t,n),d[t]=n,i&&(36009===t&&(d[36160]=n),36160===t&&(d[36009]=n)),!0)},drawBuffers:function(i,s){let r=p,a=!1;if(i)if(r=u.get(s),void 0===r&&(r=[],u.set(s,r)),i.isWebGLMultipleRenderTargets){const e=i.texture;if(r.length!==e.length||36064!==r[0]){for(let t=0,n=e.length;t<n;t++)r[t]=36064+t;r.length=e.length,a=!0}}else 36064!==r[0]&&(r[0]=36064,a=!0);else 1029!==r[0]&&(r[0]=1029,a=!0);a&&(n.isWebGL2?e.drawBuffers(r):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(r))},useProgram:function(t){return m!==t&&(e.useProgram(t),m=t,!0)},setBlending:U,setMaterial:function(e,t){2===e.side?k(2884):D(2884);let n=1===e.side;t&&(n=!n),O(n),1===e.blending&&!1===e.transparent?U(0):U(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),r.setFunc(e.depthFunc),r.setTest(e.depthTest),r.setMask(e.depthWrite),s.setMask(e.colorWrite);const i=e.stencilWrite;o.setTest(i),i&&(o.setMask(e.stencilWriteMask),o.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),o.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),K(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?D(32926):k(32926)},setFlipSided:O,setCullFace:Y,setLineWidth:function(t){t!==G&&(X&&e.lineWidth(t),G=t)},setPolygonOffset:K,setScissorTest:function(e){e?D(3089):k(3089)},activeTexture:j,bindTexture:function(t,n){null===z&&j();let i=E[z];void 0===i&&(i={type:void 0,texture:void 0},E[z]=i),i.type===t&&i.texture===n||(e.bindTexture(t,n||H[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=E[z];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===P.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),P.copy(t))},viewport:function(t){!1===N.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),N.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===i&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),l={},z=null,E={},d={},u=new WeakMap,p=[],m=null,f=!1,g=null,y=null,b=null,v=null,x=null,w=null,S=null,M=!1,L=null,C=null,G=null,T=null,R=null,P.set(0,0,e.canvas.width,e.canvas.height),N.set(0,0,e.canvas.width,e.canvas.height),s.reset(),r.reset(),o.reset()}}}function Ca(e,t,n,i,s,r,a){const o=s.isWebGL2,l=s.maxTextures,c=s.maxCubemapSize,h=s.maxTextureSize,d=s.maxSamples,u=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,p=/OculusBrowser/g.test(navigator.userAgent),m=new WeakMap;let f;const g=new WeakMap;let G=!1;try{G="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function R(e,t){return G?new OffscreenCanvas(e,t):ot("canvas")}function A(e,t,n,i){let s=1;if((e.width>i||e.height>i)&&(s=i/Math.max(e.width,e.height)),s<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const i=t?et:Math.floor,r=i(s*e.width),a=i(s*e.height);void 0===f&&(f=R(r,a));const o=n?R(r,a):f;o.width=r,o.height=a;return o.getContext("2d").drawImage(e,0,0,r,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+r+"x"+a+")."),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function I(e){return qe(e.width)&&qe(e.height)}function W(e,t){return e.generateMipmaps&&t&&e.minFilter!==x&&e.minFilter!==M}function Z(t){e.generateMipmap(t)}function N(n,i,s,r){let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!1===o)return i;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=i;return 6403===i&&(5126===s&&(l=33326),5131===s&&(l=33325),5121===s&&(l=33321)),33319===i&&(5126===s&&(l=33328),5131===s&&(l=33327),5121===s&&(l=33323)),6408===i&&(5126===s&&(l=34836),5131===s&&(l=34842),5121===s&&(l=r===Ee&&!1===a?35907:32856),32819===s&&(l=32854),32820===s&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||t.get("EXT_color_buffer_float"),l}function V(e,t,n){return!0===W(e,n)||e.isFramebufferTexture&&e.minFilter!==x&&e.minFilter!==M?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function D(e){return e===x||e===w||e===S?9728:9729}function k(e){const t=e.target;t.removeEventListener("dispose",k),function(e){const t=i.get(e);if(void 0===t.__webglInit)return;const n=e.source,s=g.get(n);if(s){const i=s[t.__cacheKey];i.usedTimes--,0===i.usedTimes&&O(e),0===Object.keys(s).length&&g.delete(n)}i.remove(e)}(t),t.isVideoTexture&&m.delete(t)}function U(t){const n=t.target;n.removeEventListener("dispose",U),function(t){const n=t.texture,s=i.get(t),r=i.get(n);void 0!==r.__webglTexture&&(e.deleteTexture(r.__webglTexture),a.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(s.__webglFramebuffer[t]),s.__webglDepthbuffer&&e.deleteRenderbuffer(s.__webglDepthbuffer[t]);else{if(e.deleteFramebuffer(s.__webglFramebuffer),s.__webglDepthbuffer&&e.deleteRenderbuffer(s.__webglDepthbuffer),s.__webglMultisampledFramebuffer&&e.deleteFramebuffer(s.__webglMultisampledFramebuffer),s.__webglColorRenderbuffer)for(let t=0;t<s.__webglColorRenderbuffer.length;t++)s.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(s.__webglColorRenderbuffer[t]);s.__webglDepthRenderbuffer&&e.deleteRenderbuffer(s.__webglDepthRenderbuffer)}if(t.isWebGLMultipleRenderTargets)for(let t=0,s=n.length;t<s;t++){const s=i.get(n[t]);s.__webglTexture&&(e.deleteTexture(s.__webglTexture),a.memory.textures--),i.remove(n[t])}i.remove(n),i.remove(t)}(n)}function O(t){const n=i.get(t);e.deleteTexture(n.__webglTexture);const s=t.source;delete g.get(s)[n.__cacheKey],a.memory.textures--}let Y=0;function K(e,t){const s=i.get(e);if(e.isVideoTexture&&function(e){const t=a.render.frame;m.get(e)!==t&&(m.set(e,t),e.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&s.__version!==e.version){const n=e.image;if(null===n)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==n.complete)return void $(s,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,s.__webglTexture)}const j={[y]:10497,[b]:33071,[v]:33648},J={[x]:9728,[w]:9984,[S]:9986,[M]:9729,[L]:9985,[C]:9987};function Q(n,r,a){if(a?(e.texParameteri(n,10242,j[r.wrapS]),e.texParameteri(n,10243,j[r.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,j[r.wrapR]),e.texParameteri(n,10240,J[r.magFilter]),e.texParameteri(n,10241,J[r.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),r.wrapS===b&&r.wrapT===b||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,D(r.magFilter)),e.texParameteri(n,10241,D(r.minFilter)),r.minFilter!==x&&r.minFilter!==M&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const a=t.get("EXT_texture_filter_anisotropic");if(r.type===z&&!1===t.has("OES_texture_float_linear"))return;if(!1===o&&r.type===E&&!1===t.has("OES_texture_half_float_linear"))return;(r.anisotropy>1||i.get(r).__currentAnisotropy)&&(e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(r.anisotropy,s.getMaxAnisotropy())),i.get(r).__currentAnisotropy=r.anisotropy)}}function q(t,n){let i=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",k));const s=n.source;let r=g.get(s);void 0===r&&(r={},g.set(s,r));const o=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.encoding),t.join()}(n);if(o!==t.__cacheKey){void 0===r[o]&&(r[o]={texture:e.createTexture(),usedTimes:0},a.memory.textures++,i=!0),r[o].usedTimes++;const s=r[t.__cacheKey];void 0!==s&&(r[t.__cacheKey].usedTimes--,0===s.usedTimes&&O(n)),t.__cacheKey=o,t.__webglTexture=r[o].texture}return i}function $(t,i,s){let a=3553;i.isDataArrayTexture&&(a=35866),i.isData3DTexture&&(a=32879);const l=q(t,i),c=i.source;if(n.activeTexture(33984+s),n.bindTexture(a,t.__webglTexture),c.version!==c.__currentVersion||!0===l){e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment),e.pixelStorei(37443,0);const t=function(e){return!o&&(e.wrapS!==b||e.wrapT!==b||e.minFilter!==x&&e.minFilter!==M)}(i)&&!1===I(i.image);let s=A(i.image,t,!1,h);s=re(i,s);const d=I(s)||o,u=r.convert(i.format,i.encoding);let p,m=r.convert(i.type),f=N(i.internalFormat,u,m,i.encoding,i.isVideoTexture);Q(a,i,d);const g=i.mipmaps,y=o&&!0!==i.isVideoTexture,v=void 0===c.__currentVersion||!0===l,w=V(i,s,d);if(i.isDepthTexture)f=6402,o?f=i.type===z?36012:i.type===_?33190:i.type===P?35056:33189:i.type===z&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===B&&6402===f&&i.type!==X&&i.type!==_&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=_,m=r.convert(i.type)),i.format===F&&6402===f&&(f=34041,i.type!==P&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=P,m=r.convert(i.type))),v&&(y?n.texStorage2D(3553,1,f,s.width,s.height):n.texImage2D(3553,0,f,s.width,s.height,0,u,m,null));else if(i.isDataTexture)if(g.length>0&&d){y&&v&&n.texStorage2D(3553,w,f,g[0].width,g[0].height);for(let e=0,t=g.length;e<t;e++)p=g[e],y?n.texSubImage2D(3553,e,0,0,p.width,p.height,u,m,p.data):n.texImage2D(3553,e,f,p.width,p.height,0,u,m,p.data);i.generateMipmaps=!1}else y?(v&&n.texStorage2D(3553,w,f,s.width,s.height),n.texSubImage2D(3553,0,0,0,s.width,s.height,u,m,s.data)):n.texImage2D(3553,0,f,s.width,s.height,0,u,m,s.data);else if(i.isCompressedTexture){y&&v&&n.texStorage2D(3553,w,f,g[0].width,g[0].height);for(let e=0,t=g.length;e<t;e++)p=g[e],i.format!==H?null!==u?y?n.compressedTexSubImage2D(3553,e,0,0,p.width,p.height,u,p.data):n.compressedTexImage2D(3553,e,f,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):y?n.texSubImage2D(3553,e,0,0,p.width,p.height,u,m,p.data):n.texImage2D(3553,e,f,p.width,p.height,0,u,m,p.data)}else if(i.isDataArrayTexture)y?(v&&n.texStorage3D(35866,w,f,s.width,s.height,s.depth),n.texSubImage3D(35866,0,0,0,0,s.width,s.height,s.depth,u,m,s.data)):n.texImage3D(35866,0,f,s.width,s.height,s.depth,0,u,m,s.data);else if(i.isData3DTexture)y?(v&&n.texStorage3D(32879,w,f,s.width,s.height,s.depth),n.texSubImage3D(32879,0,0,0,0,s.width,s.height,s.depth,u,m,s.data)):n.texImage3D(32879,0,f,s.width,s.height,s.depth,0,u,m,s.data);else if(i.isFramebufferTexture){if(v)if(y)n.texStorage2D(3553,w,f,s.width,s.height);else{let e=s.width,t=s.height;for(let i=0;i<w;i++)n.texImage2D(3553,i,f,e,t,0,u,m,null),e>>=1,t>>=1}}else if(g.length>0&&d){y&&v&&n.texStorage2D(3553,w,f,g[0].width,g[0].height);for(let e=0,t=g.length;e<t;e++)p=g[e],y?n.texSubImage2D(3553,e,0,0,u,m,p):n.texImage2D(3553,e,f,u,m,p);i.generateMipmaps=!1}else y?(v&&n.texStorage2D(3553,w,f,s.width,s.height),n.texSubImage2D(3553,0,0,0,u,m,s)):n.texImage2D(3553,0,f,u,m,s);W(i,d)&&Z(a),c.__currentVersion=c.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}function ee(t,s,a,o,l){const c=r.convert(a.format,a.encoding),h=r.convert(a.type),d=N(a.internalFormat,c,h,a.encoding);i.get(s).__hasExternalTextures||(32879===l||35866===l?n.texImage3D(l,0,d,s.width,s.height,s.depth,0,c,h,null):n.texImage2D(l,0,d,s.width,s.height,0,c,h,null)),n.bindFramebuffer(36160,t),se(s)?u.framebufferTexture2DMultisampleEXT(36160,o,l,i.get(a).__webglTexture,0,ie(s)):e.framebufferTexture2D(36160,o,l,i.get(a).__webglTexture,0),n.bindFramebuffer(36160,null)}function te(t,n,i){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){let s=33189;if(i||se(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(t.type===z?s=36012:t.type===_&&(s=33190));const i=ie(n);se(n)?u.renderbufferStorageMultisampleEXT(36161,i,s,n.width,n.height):e.renderbufferStorageMultisample(36161,i,s,n.width,n.height)}else e.renderbufferStorage(36161,s,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){const s=ie(n);i&&!1===se(n)?e.renderbufferStorageMultisample(36161,s,35056,n.width,n.height):se(n)?u.renderbufferStorageMultisampleEXT(36161,s,35056,n.width,n.height):e.renderbufferStorage(36161,34041,n.width,n.height),e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let s=0;s<t.length;s++){const a=t[s],o=r.convert(a.format,a.encoding),l=r.convert(a.type),c=N(a.internalFormat,o,l,a.encoding),h=ie(n);i&&!1===se(n)?e.renderbufferStorageMultisample(36161,h,c,n.width,n.height):se(n)?u.renderbufferStorageMultisampleEXT(36161,h,c,n.width,n.height):e.renderbufferStorage(36161,c,n.width,n.height)}}e.bindRenderbuffer(36161,null)}function ne(t){const s=i.get(t),r=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!s.__autoAllocateDepthBuffer){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,s){if(s&&s.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,t),!s.depthTexture||!s.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(s.depthTexture).__webglTexture&&s.depthTexture.image.width===s.width&&s.depthTexture.image.height===s.height||(s.depthTexture.image.width=s.width,s.depthTexture.image.height=s.height,s.depthTexture.needsUpdate=!0),K(s.depthTexture,0);const r=i.get(s.depthTexture).__webglTexture,a=ie(s);if(s.depthTexture.format===B)se(s)?u.framebufferTexture2DMultisampleEXT(36160,36096,3553,r,0,a):e.framebufferTexture2D(36160,36096,3553,r,0);else{if(s.depthTexture.format!==F)throw new Error("Unknown depthTexture format");se(s)?u.framebufferTexture2DMultisampleEXT(36160,33306,3553,r,0,a):e.framebufferTexture2D(36160,33306,3553,r,0)}}(s.__webglFramebuffer,t)}else if(r){s.__webglDepthbuffer=[];for(let i=0;i<6;i++)n.bindFramebuffer(36160,s.__webglFramebuffer[i]),s.__webglDepthbuffer[i]=e.createRenderbuffer(),te(s.__webglDepthbuffer[i],t,!1)}else n.bindFramebuffer(36160,s.__webglFramebuffer),s.__webglDepthbuffer=e.createRenderbuffer(),te(s.__webglDepthbuffer,t,!1);n.bindFramebuffer(36160,null)}function ie(e){return Math.min(d,e.samples)}function se(e){const n=i.get(e);return o&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function re(e,n){const i=e.encoding,s=e.format,r=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||e.format===ke||i!==ze&&(i===Ee?!1===o?!0===t.has("EXT_sRGB")&&s===H?(e.format=ke,e.minFilter=M,e.generateMipmaps=!1):n=xt.sRGBToLinear(n):s===H&&r===T||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",i)),n}this.allocateTextureUnit=function(){const e=Y;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),Y+=1,e},this.resetTextureUnits=function(){Y=0},this.setTexture2D=K,this.setTexture2DArray=function(e,t){const s=i.get(e);e.version>0&&s.__version!==e.version?$(s,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,s.__webglTexture))},this.setTexture3D=function(e,t){const s=i.get(e);e.version>0&&s.__version!==e.version?$(s,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,s.__webglTexture))},this.setTextureCube=function(t,s){const a=i.get(t);t.version>0&&a.__version!==t.version?function(t,i,s){if(6!==i.image.length)return;const a=q(t,i),l=i.source;if(n.activeTexture(33984+s),n.bindTexture(34067,t.__webglTexture),l.version!==l.__currentVersion||!0===a){e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment),e.pixelStorei(37443,0);const t=i.isCompressedTexture||i.image[0].isCompressedTexture,s=i.image[0]&&i.image[0].isDataTexture,h=[];for(let e=0;e<6;e++)h[e]=t||s?s?i.image[e].image:i.image[e]:A(i.image[e],!1,!0,c),h[e]=re(i,h[e]);const d=h[0],u=I(d)||o,p=r.convert(i.format,i.encoding),m=r.convert(i.type),f=N(i.internalFormat,p,m,i.encoding),g=o&&!0!==i.isVideoTexture,y=void 0===l.__currentVersion||!0===a;let b,v=V(i,d,u);if(Q(34067,i,u),t){g&&y&&n.texStorage2D(34067,v,f,d.width,d.height);for(let e=0;e<6;e++){b=h[e].mipmaps;for(let t=0;t<b.length;t++){const s=b[t];i.format!==H?null!==p?g?n.compressedTexSubImage2D(34069+e,t,0,0,s.width,s.height,p,s.data):n.compressedTexImage2D(34069+e,t,f,s.width,s.height,0,s.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g?n.texSubImage2D(34069+e,t,0,0,s.width,s.height,p,m,s.data):n.texImage2D(34069+e,t,f,s.width,s.height,0,p,m,s.data)}}}else{b=i.mipmaps,g&&y&&(b.length>0&&v++,n.texStorage2D(34067,v,f,h[0].width,h[0].height));for(let e=0;e<6;e++)if(s){g?n.texSubImage2D(34069+e,0,0,0,h[e].width,h[e].height,p,m,h[e].data):n.texImage2D(34069+e,0,f,h[e].width,h[e].height,0,p,m,h[e].data);for(let t=0;t<b.length;t++){const i=b[t].image[e].image;g?n.texSubImage2D(34069+e,t+1,0,0,i.width,i.height,p,m,i.data):n.texImage2D(34069+e,t+1,f,i.width,i.height,0,p,m,i.data)}}else{g?n.texSubImage2D(34069+e,0,0,0,p,m,h[e]):n.texImage2D(34069+e,0,f,p,m,h[e]);for(let t=0;t<b.length;t++){const i=b[t];g?n.texSubImage2D(34069+e,t+1,0,0,p,m,i.image[e]):n.texImage2D(34069+e,t+1,f,p,m,i.image[e])}}}W(i,u)&&Z(34067),l.__currentVersion=l.version,i.onUpdate&&i.onUpdate(i)}t.__version=i.version}(a,t,s):(n.activeTexture(33984+s),n.bindTexture(34067,a.__webglTexture))},this.rebindTextures=function(e,t,n){const s=i.get(e);void 0!==t&&ee(s.__webglFramebuffer,e,e.texture,36064,3553),void 0!==n&&ne(e)},this.setupRenderTarget=function(t){const l=t.texture,c=i.get(t),h=i.get(l);t.addEventListener("dispose",U),!0!==t.isWebGLMultipleRenderTargets&&(void 0===h.__webglTexture&&(h.__webglTexture=e.createTexture()),h.__version=l.version,a.memory.textures++);const d=!0===t.isWebGLCubeRenderTarget,u=!0===t.isWebGLMultipleRenderTargets,p=I(t)||o;if(d){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else{if(c.__webglFramebuffer=e.createFramebuffer(),u)if(s.drawBuffers){const n=t.texture;for(let t=0,s=n.length;t<s;t++){const s=i.get(n[t]);void 0===s.__webglTexture&&(s.__webglTexture=e.createTexture(),a.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(o&&t.samples>0&&!1===se(t)){const i=u?l:[l];c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=[],n.bindFramebuffer(36160,c.__webglMultisampledFramebuffer);for(let n=0;n<i.length;n++){const s=i[n];c.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(36161,c.__webglColorRenderbuffer[n]);const a=r.convert(s.format,s.encoding),o=r.convert(s.type),l=N(s.internalFormat,a,o,s.encoding),h=ie(t);e.renderbufferStorageMultisample(36161,h,l,t.width,t.height),e.framebufferRenderbuffer(36160,36064+n,36161,c.__webglColorRenderbuffer[n])}e.bindRenderbuffer(36161,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),te(c.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(36160,null)}}if(d){n.bindTexture(34067,h.__webglTexture),Q(34067,l,p);for(let e=0;e<6;e++)ee(c.__webglFramebuffer[e],t,l,36064,34069+e);W(l,p)&&Z(34067),n.unbindTexture()}else if(u){const e=t.texture;for(let s=0,r=e.length;s<r;s++){const r=e[s],a=i.get(r);n.bindTexture(3553,a.__webglTexture),Q(3553,r,p),ee(c.__webglFramebuffer,t,r,36064+s,3553),W(r,p)&&Z(3553)}n.unbindTexture()}else{let e=3553;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(o?e=t.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(e,h.__webglTexture),Q(e,l,p),ee(c.__webglFramebuffer,t,l,36064,e),W(l,p)&&Z(e),n.unbindTexture()}t.depthBuffer&&ne(t)},this.updateRenderTargetMipmap=function(e){const t=I(e)||o,s=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let r=0,a=s.length;r<a;r++){const a=s[r];if(W(a,t)){const t=e.isWebGLCubeRenderTarget?34067:3553,s=i.get(a).__webglTexture;n.bindTexture(t,s),Z(t),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(o&&t.samples>0&&!1===se(t)){const s=t.isWebGLMultipleRenderTargets?t.texture:[t.texture],r=t.width,a=t.height;let o=16384;const l=[],c=t.stencilBuffer?33306:36096,h=i.get(t),d=!0===t.isWebGLMultipleRenderTargets;if(d)for(let t=0;t<s.length;t++)n.bindFramebuffer(36160,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064+t,36161,null),n.bindFramebuffer(36160,h.__webglFramebuffer),e.framebufferTexture2D(36009,36064+t,3553,null,0);n.bindFramebuffer(36008,h.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,h.__webglFramebuffer);for(let n=0;n<s.length;n++){l.push(36064+n),t.depthBuffer&&l.push(c);const u=void 0!==h.__ignoreDepthValues&&h.__ignoreDepthValues;if(!1===u&&(t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024)),d&&e.framebufferRenderbuffer(36008,36064,36161,h.__webglColorRenderbuffer[n]),!0===u&&(e.invalidateFramebuffer(36008,[c]),e.invalidateFramebuffer(36009,[c])),d){const t=i.get(s[n]).__webglTexture;e.framebufferTexture2D(36009,36064,3553,t,0)}e.blitFramebuffer(0,0,r,a,0,0,r,a,o,9728),p&&e.invalidateFramebuffer(36008,l)}if(n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,null),d)for(let t=0;t<s.length;t++){n.bindFramebuffer(36160,h.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064+t,36161,h.__webglColorRenderbuffer[t]);const r=i.get(s[t]).__webglTexture;n.bindFramebuffer(36160,h.__webglFramebuffer),e.framebufferTexture2D(36009,36064+t,3553,r,0)}n.bindFramebuffer(36009,h.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=ne,this.setupFrameBufferTexture=ee,this.useMultisampledRTT=se}function Ga(e,t,n){const i=n.isWebGL2;return{convert:function(n){let s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(n===T)return 5121;if(n===W)return 32819;if(n===Z)return 32820;if(n===R)return 5120;if(n===A)return 5122;if(n===X)return 5123;if(n===I)return 5124;if(n===_)return 5125;if(n===z)return 5126;if(n===E)return i?5131:(s=t.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(n===N)return 6406;if(n===H)return 6408;if(n===D)return 6409;if(n===k)return 6410;if(n===B)return 6402;if(n===F)return 34041;if(n===U)return 6403;if(n===V)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(n===ke)return s=t.get("EXT_sRGB"),null!==s?s.SRGB_ALPHA_EXT:null;if(n===O)return 36244;if(n===Y)return 33319;if(n===K)return 33320;if(n===j)return 36249;if(n===J||n===Q||n===q||n===$)if(r===Ee){if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(n===J)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Q)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===q)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===$)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=t.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(n===J)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Q)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===q)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===$)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===ee||n===te||n===ne||n===ie){if(s=t.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(n===ee)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===te)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===ne)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===ie)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===se)return s=t.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===re||n===ae){if(s=t.get("WEBGL_compressed_texture_etc"),null===s)return null;if(n===re)return r===Ee?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===ae)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(n===oe||n===le||n===ce||n===he||n===de||n===ue||n===pe||n===me||n===fe||n===ge||n===ye||n===be||n===ve||n===xe){if(s=t.get("WEBGL_compressed_texture_astc"),null===s)return null;if(n===oe)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===le)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===ce)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===he)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===de)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===ue)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===pe)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===me)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===fe)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===ge)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===ye)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===be)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===ve)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===xe)return r===Ee?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===we){if(s=t.get("EXT_texture_compression_bptc"),null===s)return null;if(n===we)return r===Ee?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}return n===P?i?34042:(s=t.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0!==e[n]?e[n]:null}}}class Ta extends Bi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isArrayCamera=!0,this.cameras=e}}class Ra extends Zn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Aa={type:"move"};class Xa{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Ra,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Ra,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new zt,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new zt),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Ra,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new zt,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new zt),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,r=null;const a=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){r=!0;for(const i of e.hand.values()){const e=t.getJointPose(i,n);if(void 0===l.joints[i.jointName]){const e=new Ra;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[i.jointName]=e,l.add(e)}const s=l.joints[i.jointName];null!==e&&(s.matrix.fromArray(e.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.jointRadius=e.radius),s.visible=null!==e}const i=l.joints["index-finger-tip"],s=l.joints["thumb-tip"],a=i.position.distanceTo(s.position),o=.02,c=.005;l.inputState.pinching&&a>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),null!==s&&(o.matrix.fromArray(s.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),s.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(s.linearVelocity)):o.hasLinearVelocity=!1,s.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(s.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(i=t.getPose(e.targetRaySpace,n),null===i&&null!==s&&(i=s),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(Aa)))}return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==s),null!==l&&(l.visible=null!==r),this}}class Ia extends Lt{constructor(e,t,n,i,s,r,a,o,l,c){if((c=void 0!==c?c:B)!==B&&c!==F)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===B&&(n=_),void 0===n&&c===F&&(n=P),super(null,i,s,r,a,o,c,n,l),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=void 0!==a?a:x,this.minFilter=void 0!==o?o:x,this.flipY=!1,this.generateMipmaps=!1}}class _a extends Be{constructor(e,t){super();const n=this;let i=null,s=1,r=null,a="local-floor",o=null,l=null,c=null,h=null,d=null,u=null;const p=t.getContextAttributes();let m=null,f=null;const g=[],y=[],b=new Bi;b.layers.enable(1),b.viewport=new Ct;const v=new Bi;v.layers.enable(2),v.viewport=new Ct;const x=[b,v],w=new Ta;w.layers.enable(1),w.layers.enable(2);let S=null,M=null;function L(e){const t=y.indexOf(e.inputSource);if(-1===t)return;const n=g[t];void 0!==n&&n.dispatchEvent({type:e.type,data:e.inputSource})}function C(){i.removeEventListener("select",L),i.removeEventListener("selectstart",L),i.removeEventListener("selectend",L),i.removeEventListener("squeeze",L),i.removeEventListener("squeezestart",L),i.removeEventListener("squeezeend",L),i.removeEventListener("end",C),i.removeEventListener("inputsourceschange",G);for(let e=0;e<g.length;e++){const t=y[e];null!==t&&(y[e]=null,g[e].disconnect(t))}S=null,M=null,e.setRenderTarget(m),d=null,h=null,c=null,i=null,f=null,z.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function G(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],i=y.indexOf(n);i>=0&&(y[i]=null,g[i].dispatchEvent({type:"disconnected",data:n}))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let i=y.indexOf(n);if(-1===i){for(let e=0;e<g.length;e++){if(e>=y.length){y.push(n),i=e;break}if(null===y[e]){y[e]=n,i=e;break}}if(-1===i)break}const s=g[i];s&&s.dispatchEvent({type:"connected",data:n})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=g[e];return void 0===t&&(t=new Xa,g[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=g[e];return void 0===t&&(t=new Xa,g[e]=t),t.getGripSpace()},this.getHand=function(e){let t=g[e];return void 0===t&&(t=new Xa,g[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){s=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){a=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o||r},this.setReferenceSpace=function(e){o=e},this.getBaseLayer=function(){return null!==h?h:d},this.getBinding=function(){return c},this.getFrame=function(){return u},this.getSession=function(){return i},this.setSession=async function(l){if(i=l,null!==i){if(m=e.getRenderTarget(),i.addEventListener("select",L),i.addEventListener("selectstart",L),i.addEventListener("selectend",L),i.addEventListener("squeeze",L),i.addEventListener("squeezestart",L),i.addEventListener("squeezeend",L),i.addEventListener("end",C),i.addEventListener("inputsourceschange",G),!0!==p.xrCompatible&&await t.makeXRCompatible(),void 0===i.renderState.layers||!1===e.capabilities.isWebGL2){const n={antialias:void 0!==i.renderState.layers||p.antialias,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:s};d=new XRWebGLLayer(i,t,n),i.updateRenderState({baseLayer:d}),f=new Gt(d.framebufferWidth,d.framebufferHeight,{format:H,type:T,encoding:e.outputEncoding})}else{let n=null,r=null,a=null;p.depth&&(a=p.stencil?35056:33190,n=p.stencil?F:B,r=p.stencil?P:_);const o={colorFormat:32856,depthFormat:a,scaleFactor:s};c=new XRWebGLBinding(i,t),h=c.createProjectionLayer(o),i.updateRenderState({layers:[h]}),f=new Gt(h.textureWidth,h.textureHeight,{format:H,type:T,depthTexture:new Ia(h.textureWidth,h.textureHeight,r,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:p.stencil,encoding:e.outputEncoding,samples:p.antialias?4:0});e.properties.get(f).__ignoreDepthValues=h.ignoreDepthValues}f.isXRRenderTarget=!0,this.setFoveation(1),o=null,r=await i.requestReferenceSpace(a),z.setContext(i),z.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const R=new zt,A=new zt;function X(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===i)return;w.near=v.near=b.near=e.near,w.far=v.far=b.far=e.far,S===w.near&&M===w.far||(i.updateRenderState({depthNear:w.near,depthFar:w.far}),S=w.near,M=w.far);const t=e.parent,n=w.cameras;X(w,t);for(let e=0;e<n.length;e++)X(n[e],t);w.matrixWorld.decompose(w.position,w.quaternion,w.scale),e.position.copy(w.position),e.quaternion.copy(w.quaternion),e.scale.copy(w.scale),e.matrix.copy(w.matrix),e.matrixWorld.copy(w.matrixWorld);const s=e.children;for(let e=0,t=s.length;e<t;e++)s[e].updateMatrixWorld(!0);2===n.length?function(e,t,n){R.setFromMatrixPosition(t.matrixWorld),A.setFromMatrixPosition(n.matrixWorld);const i=R.distanceTo(A),s=t.projectionMatrix.elements,r=n.projectionMatrix.elements,a=s[14]/(s[10]-1),o=s[14]/(s[10]+1),l=(s[9]+1)/s[5],c=(s[9]-1)/s[5],h=(s[8]-1)/s[0],d=(r[8]+1)/r[0],u=a*h,p=a*d,m=i/(-h+d),f=m*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(f),e.translateZ(m),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=a+m,y=o+m,b=u-f,v=p+(i-f),x=l*o/y*g,w=c*o/y*g;e.projectionMatrix.makePerspective(b,v,x,w,g,y)}(w,b,v):w.projectionMatrix.copy(b.projectionMatrix)},this.getCamera=function(){return w},this.getFoveation=function(){return null!==h?h.fixedFoveation:null!==d?d.fixedFoveation:void 0},this.setFoveation=function(e){null!==h&&(h.fixedFoveation=e),null!==d&&void 0!==d.fixedFoveation&&(d.fixedFoveation=e)};let I=null;const z=new ts;z.setAnimationLoop((function(t,n){if(l=n.getViewerPose(o||r),u=n,null!==l){const t=l.views;null!==d&&(e.setRenderTargetFramebuffer(f,d.framebuffer),e.setRenderTarget(f));let n=!1;t.length!==w.cameras.length&&(w.cameras.length=0,n=!0);for(let i=0;i<t.length;i++){const s=t[i];let r=null;if(null!==d)r=d.getViewport(s);else{const t=c.getViewSubImage(h,s);r=t.viewport,0===i&&(e.setRenderTargetTextures(f,t.colorTexture,h.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(f))}let a=x[i];void 0===a&&(a=new Bi,a.layers.enable(i),a.viewport=new Ct,x[i]=a),a.matrix.fromArray(s.transform.matrix),a.projectionMatrix.fromArray(s.projectionMatrix),a.viewport.set(r.x,r.y,r.width,r.height),0===i&&w.matrix.copy(a.matrix),!0===n&&w.cameras.push(a)}}for(let e=0;e<g.length;e++){const t=y[e],i=g[e];null!==t&&void 0!==i&&i.update(t,n,o||r)}I&&I(t,n),u=null})),this.setAnimationLoop=function(e){I=e},this.dispose=function(){}}}function za(e,t){function n(n,i){n.opacity.value=i.opacity,i.color&&n.diffuse.value.copy(i.color),i.emissive&&n.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(n.map.value=i.map),i.alphaMap&&(n.alphaMap.value=i.alphaMap),i.bumpMap&&(n.bumpMap.value=i.bumpMap,n.bumpScale.value=i.bumpScale,1===i.side&&(n.bumpScale.value*=-1)),i.displacementMap&&(n.displacementMap.value=i.displacementMap,n.displacementScale.value=i.displacementScale,n.displacementBias.value=i.displacementBias),i.emissiveMap&&(n.emissiveMap.value=i.emissiveMap),i.normalMap&&(n.normalMap.value=i.normalMap,n.normalScale.value.copy(i.normalScale),1===i.side&&n.normalScale.value.negate()),i.specularMap&&(n.specularMap.value=i.specularMap),i.alphaTest>0&&(n.alphaTest.value=i.alphaTest);const s=t.get(i).envMap;if(s&&(n.envMap.value=s,n.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,n.reflectivity.value=i.reflectivity,n.ior.value=i.ior,n.refractionRatio.value=i.refractionRatio),i.lightMap){n.lightMap.value=i.lightMap;const t=!0!==e.physicallyCorrectLights?Math.PI:1;n.lightMapIntensity.value=i.lightMapIntensity*t}let r,a;i.aoMap&&(n.aoMap.value=i.aoMap,n.aoMapIntensity.value=i.aoMapIntensity),i.map?r=i.map:i.specularMap?r=i.specularMap:i.displacementMap?r=i.displacementMap:i.normalMap?r=i.normalMap:i.bumpMap?r=i.bumpMap:i.roughnessMap?r=i.roughnessMap:i.metalnessMap?r=i.metalnessMap:i.alphaMap?r=i.alphaMap:i.emissiveMap?r=i.emissiveMap:i.clearcoatMap?r=i.clearcoatMap:i.clearcoatNormalMap?r=i.clearcoatNormalMap:i.clearcoatRoughnessMap?r=i.clearcoatRoughnessMap:i.iridescenceMap?r=i.iridescenceMap:i.iridescenceThicknessMap?r=i.iridescenceThicknessMap:i.specularIntensityMap?r=i.specularIntensityMap:i.specularColorMap?r=i.specularColorMap:i.transmissionMap?r=i.transmissionMap:i.thicknessMap?r=i.thicknessMap:i.sheenColorMap?r=i.sheenColorMap:i.sheenRoughnessMap&&(r=i.sheenRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),n.uvTransform.value.copy(r.matrix)),i.aoMap?a=i.aoMap:i.lightMap&&(a=i.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),n.uv2Transform.value.copy(a.matrix))}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,i,s,r,a){i.isMeshBasicMaterial||i.isMeshLambertMaterial?n(e,i):i.isMeshToonMaterial?(n(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(n(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(n(e,i),function(e,n){e.roughness.value=n.roughness,e.metalness.value=n.metalness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap);n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap);t.get(n).envMap&&(e.envMapIntensity.value=n.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,1===t.side&&e.clearcoatNormalScale.value.negate()));t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap);t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap)}(e,i,a)):i.isMeshMatcapMaterial?(n(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?n(e,i):i.isMeshDistanceMaterial?(n(e,i),function(e,t){e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,i)):i.isMeshNormalMaterial?n(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,n,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*i,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest);let s;t.map?s=t.map:t.alphaMap&&(s=t.alphaMap);void 0!==s&&(!0===s.matrixAutoUpdate&&s.updateMatrix(),e.uvTransform.value.copy(s.matrix))}(e,i,s,r):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest);let n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function Ea(){const e=ot("canvas");return e.style.display="block",e}function Wa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isWebGLRenderer=!0;const t=void 0!==e.canvas?e.canvas:Ea(),n=void 0!==e.context?e.context:null,i=void 0===e.depth||e.depth,s=void 0===e.stencil||e.stencil,r=void 0!==e.antialias&&e.antialias,a=void 0===e.premultipliedAlpha||e.premultipliedAlpha,o=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;let h;h=null!==n?n.getContextAttributes().alpha:void 0!==e.alpha&&e.alpha;let d=null,u=null;const p=[],m=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=ze,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,Object.defineProperties(this,{gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}});const f=this;let g=!1,y=0,b=0,v=null,x=-1,w=null;const S=new Ct,M=new Ct;let L=null,G=t.width,R=t.height,A=1,X=null,I=null;const _=new Ct(0,0,G,R),W=new Ct(0,0,G,R);let Z=!1;const P=new es;let N=!1,V=!1,D=null;const k=new dn,B=new nt,F=new zt,U={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function O(){return null===v?A:1}let Y,K,j,J,Q,q,$,ee,te,ne,ie,se,re,ae,oe,le,ce,he,de,ue,pe,me,fe,ge=n;function ye(e,n){for(let i=0;i<e.length;i++){const s=e[i],r=t.getContext(s,n);if(null!==r)return r}return null}try{const e={alpha:!0,depth:i,stencil:s,antialias:r,premultipliedAlpha:a,preserveDrawingBuffer:o,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r142"),t.addEventListener("webglcontextlost",xe,!1),t.addEventListener("webglcontextrestored",we,!1),t.addEventListener("webglcontextcreationerror",Se,!1),null===ge){const t=["webgl2","webgl","experimental-webgl"];if(!0===f.isWebGL1Renderer&&t.shift(),ge=ye(t,e),null===ge)throw ye(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===ge.getShaderPrecisionFormat&&(ge.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function be(){Y=new As(ge),K=new hs(ge,Y,e),Y.init(K),me=new Ga(ge,Y,K),j=new La(ge,Y,K),J=new _s,Q=new ha,q=new Ca(ge,Y,j,Q,K,me,J),$=new us(f),ee=new Rs(f),te=new ns(ge,K),fe=new ls(ge,Y,te,K),ne=new Xs(ge,te,J,fe),ie=new Ps(ge,ne,te,J),de=new Zs(ge,K,q),le=new ds(Q),se=new ca(f,$,ee,Y,K,fe,le),re=new za(f,Q),ae=new ma,oe=new xa(Y,K),he=new os(f,$,j,ie,h,a),ce=new Ma(f,ie,K),ue=new cs(ge,Y,J,K),pe=new Is(ge,Y,J,K),J.programs=se.programs,f.capabilities=K,f.extensions=Y,f.properties=Q,f.renderLists=ae,f.shadowMap=ce,f.state=j,f.info=J}be();const ve=new _a(f,ge);function xe(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),g=!0}function we(){console.log("THREE.WebGLRenderer: Context Restored."),g=!1;const e=J.autoReset,t=ce.enabled,n=ce.autoUpdate,i=ce.needsUpdate,s=ce.type;be(),J.autoReset=e,ce.enabled=t,ce.autoUpdate=n,ce.needsUpdate=i,ce.type=s}function Se(e){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",e.statusMessage)}function Me(e){const t=e.target;t.removeEventListener("dispose",Me),Le(t)}function Le(e){Ce(e),Q.remove(e)}function Ce(e){const t=Q.get(e).programs;void 0!==t&&(t.forEach((function(e){se.releaseProgram(e)})),e.isShaderMaterial&&se.releaseShaderCache(e))}this.xr=ve,this.getContext=function(){return ge},this.getContextAttributes=function(){return ge.getContextAttributes()},this.forceContextLoss=function(){const e=Y.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=Y.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return A},this.setPixelRatio=function(e){void 0!==e&&(A=e,this.setSize(G,R,!1))},this.getSize=function(e){return e.set(G,R)},this.setSize=function(e,n,i){ve.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(G=e,R=n,t.width=Math.floor(e*A),t.height=Math.floor(n*A),!1!==i&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(G*A,R*A).floor()},this.setDrawingBufferSize=function(e,n,i){G=e,R=n,A=i,t.width=Math.floor(e*i),t.height=Math.floor(n*i),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(S)},this.getViewport=function(e){return e.copy(_)},this.setViewport=function(e,t,n,i){e.isVector4?_.set(e.x,e.y,e.z,e.w):_.set(e,t,n,i),j.viewport(S.copy(_).multiplyScalar(A).floor())},this.getScissor=function(e){return e.copy(W)},this.setScissor=function(e,t,n,i){e.isVector4?W.set(e.x,e.y,e.z,e.w):W.set(e,t,n,i),j.scissor(M.copy(W).multiplyScalar(A).floor())},this.getScissorTest=function(){return Z},this.setScissorTest=function(e){j.setScissorTest(Z=e)},this.setOpaqueSort=function(e){X=e},this.setTransparentSort=function(e){I=e},this.getClearColor=function(e){return e.copy(he.getClearColor())},this.setClearColor=function(){he.setClearColor.apply(he,arguments)},this.getClearAlpha=function(){return he.getClearAlpha()},this.setClearAlpha=function(){he.setClearAlpha.apply(he,arguments)},this.clear=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=0;e&&(i|=16384),t&&(i|=256),n&&(i|=1024),ge.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(){t.removeEventListener("webglcontextlost",xe,!1),t.removeEventListener("webglcontextrestored",we,!1),t.removeEventListener("webglcontextcreationerror",Se,!1),ae.dispose(),oe.dispose(),Q.dispose(),$.dispose(),ee.dispose(),ie.dispose(),fe.dispose(),se.dispose(),ve.dispose(),ve.removeEventListener("sessionstart",Re),ve.removeEventListener("sessionend",Ae),D&&(D.dispose(),D=null),Xe.stop()},this.renderBufferDirect=function(e,t,n,i,s,r){null===t&&(t=U);const a=s.isMesh&&s.matrixWorld.determinant()<0,o=Ve(e,t,n,i,s);j.setMaterial(i,a);let l=n.index;const c=n.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let h,d=1;!0===i.wireframe&&(l=ne.getWireframeAttribute(n),d=2),fe.setup(s,i,o,n,l);let u=ue;null!==l&&(h=te.get(l),u=pe,u.setIndex(h));const p=null!==l?l.count:c.count,m=n.drawRange.start*d,f=n.drawRange.count*d,g=null!==r?r.start*d:0,y=null!==r?r.count*d:1/0,b=Math.max(m,g),v=Math.min(p,m+f,g+y)-1,x=Math.max(0,v-b+1);if(0!==x){if(s.isMesh)!0===i.wireframe?(j.setLineWidth(i.wireframeLinewidth*O()),u.setMode(1)):u.setMode(4);else if(s.isLine){let e=i.linewidth;void 0===e&&(e=1),j.setLineWidth(e*O()),s.isLineSegments?u.setMode(1):s.isLineLoop?u.setMode(2):u.setMode(3)}else s.isPoints?u.setMode(0):s.isSprite&&u.setMode(4);if(s.isInstancedMesh)u.renderInstances(b,x,s.count);else if(n.isInstancedBufferGeometry){const e=Math.min(n.instanceCount,n._maxInstanceCount);u.renderInstances(b,x,e)}else u.render(b,x)}},this.compile=function(e,t){u=oe.get(e),u.init(),m.push(u),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(u.pushLight(e),e.castShadow&&u.pushShadow(e))})),u.setupLights(f.physicallyCorrectLights),e.traverse((function(t){const n=t.material;if(n)if(Array.isArray(n))for(let i=0;i<n.length;i++){Pe(n[i],e,t)}else Pe(n,e,t)})),m.pop(),u=null};let Ge=null;function Te(e){Ge&&Ge(e)}function Re(){Xe.stop()}function Ae(){Xe.start()}const Xe=new ts;function Ie(e,t,n,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)u.pushLight(e),e.castShadow&&u.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||P.intersectsSprite(e)){i&&F.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);const t=ie.update(e),s=e.material;s.visible&&d.push(e,t,s,n,F.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==J.render.frame&&(e.skeleton.update(),e.skeleton.frame=J.render.frame),!e.frustumCulled||P.intersectsObject(e))){i&&F.setFromMatrixPosition(e.matrixWorld).applyMatrix4(k);const t=ie.update(e),s=e.material;if(Array.isArray(s)){const i=t.groups;for(let r=0,a=i.length;r<a;r++){const a=i[r],o=s[a.materialIndex];o&&o.visible&&d.push(e,t,o,n,F.z,a)}}else s.visible&&d.push(e,t,s,n,F.z,null)}const s=e.children;for(let e=0,r=s.length;e<r;e++)Ie(s[e],t,n,i)}function _e(e,t,n,i){const s=e.opaque,r=e.transmissive,a=e.transparent;u.setupLightsView(n),r.length>0&&Ee(s,t,n),i&&j.viewport(S.copy(i)),s.length>0&&We(s,t,n),r.length>0&&We(r,t,n),a.length>0&&We(a,t,n),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1)}function Ee(e,t,n){const i=K.isWebGL2;null===D&&(D=new Gt(1,1,{generateMipmaps:!0,type:Y.has("EXT_color_buffer_half_float")?E:T,minFilter:C,samples:i&&!0===r?4:0})),f.getDrawingBufferSize(B),i?D.setSize(B.x,B.y):D.setSize(et(B.x),et(B.y));const s=f.getRenderTarget();f.setRenderTarget(D),f.clear();const a=f.toneMapping;f.toneMapping=0,We(e,t,n),f.toneMapping=a,q.updateMultisampleRenderTarget(D),q.updateRenderTargetMipmap(D),f.setRenderTarget(s)}function We(e,t,n){const i=!0===t.isScene?t.overrideMaterial:null;for(let s=0,r=e.length;s<r;s++){const r=e[s],a=r.object,o=r.geometry,l=null===i?r.material:i,c=r.group;a.layers.test(n.layers)&&Ze(a,t,n,o,l,c)}}function Ze(e,t,n,i,s,r){e.onBeforeRender(f,t,n,i,s,r),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),s.onBeforeRender(f,t,n,i,e,r),!0===s.transparent&&2===s.side?(s.side=1,s.needsUpdate=!0,f.renderBufferDirect(n,t,i,s,e,r),s.side=0,s.needsUpdate=!0,f.renderBufferDirect(n,t,i,s,e,r),s.side=2):f.renderBufferDirect(n,t,i,s,e,r),e.onAfterRender(f,t,n,i,s,r)}function Pe(e,t,n){!0!==t.isScene&&(t=U);const i=Q.get(e),s=u.state.lights,r=u.state.shadowsArray,a=s.state.version,o=se.getParameters(e,s.state,r,t,n),l=se.getProgramCacheKey(o);let c=i.programs;i.environment=e.isMeshStandardMaterial?t.environment:null,i.fog=t.fog,i.envMap=(e.isMeshStandardMaterial?ee:$).get(e.envMap||i.environment),void 0===c&&(e.addEventListener("dispose",Me),c=new Map,i.programs=c);let h=c.get(l);if(void 0!==h){if(i.currentProgram===h&&i.lightsStateVersion===a)return Ne(e,o),h}else o.uniforms=se.getUniforms(e),e.onBuild(n,o,f),e.onBeforeCompile(o,f),h=se.acquireProgram(o,l),c.set(l,h),i.uniforms=o.uniforms;const d=i.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(d.clippingPlanes=le.uniform),Ne(e,o),i.needsLights=De(e),i.lightsStateVersion=a,i.needsLights&&(d.ambientLightColor.value=s.state.ambient,d.lightProbe.value=s.state.probe,d.directionalLights.value=s.state.directional,d.directionalLightShadows.value=s.state.directionalShadow,d.spotLights.value=s.state.spot,d.spotLightShadows.value=s.state.spotShadow,d.rectAreaLights.value=s.state.rectArea,d.ltc_1.value=s.state.rectAreaLTC1,d.ltc_2.value=s.state.rectAreaLTC2,d.pointLights.value=s.state.point,d.pointLightShadows.value=s.state.pointShadow,d.hemisphereLights.value=s.state.hemi,d.directionalShadowMap.value=s.state.directionalShadowMap,d.directionalShadowMatrix.value=s.state.directionalShadowMatrix,d.spotShadowMap.value=s.state.spotShadowMap,d.spotShadowMatrix.value=s.state.spotShadowMatrix,d.pointShadowMap.value=s.state.pointShadowMap,d.pointShadowMatrix.value=s.state.pointShadowMatrix);const p=h.getUniforms(),m=Dr.seqWithValue(p.seq,d);return i.currentProgram=h,i.uniformsList=m,h}function Ne(e,t){const n=Q.get(e);n.outputEncoding=t.outputEncoding,n.instancing=t.instancing,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}function Ve(e,t,n,i,s){!0!==t.isScene&&(t=U),q.resetTextureUnits();const r=t.fog,a=i.isMeshStandardMaterial?t.environment:null,o=null===v?f.outputEncoding:!0===v.isXRRenderTarget?v.texture.encoding:ze,l=(i.isMeshStandardMaterial?ee:$).get(i.envMap||a),c=!0===i.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,h=!!i.normalMap&&!!n.attributes.tangent,d=!!n.morphAttributes.position,p=!!n.morphAttributes.normal,m=!!n.morphAttributes.color,g=i.toneMapped?f.toneMapping:0,y=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,b=void 0!==y?y.length:0,S=Q.get(i),M=u.state.lights;if(!0===N&&(!0===V||e!==w)){const t=e===w&&i.id===x;le.setState(i,e,t)}let L=!1;i.version===S.__version?S.needsLights&&S.lightsStateVersion!==M.state.version||S.outputEncoding!==o||s.isInstancedMesh&&!1===S.instancing?L=!0:s.isInstancedMesh||!0!==S.instancing?s.isSkinnedMesh&&!1===S.skinning?L=!0:s.isSkinnedMesh||!0!==S.skinning?S.envMap!==l||!0===i.fog&&S.fog!==r?L=!0:void 0===S.numClippingPlanes||S.numClippingPlanes===le.numPlanes&&S.numIntersection===le.numIntersection?(S.vertexAlphas!==c||S.vertexTangents!==h||S.morphTargets!==d||S.morphNormals!==p||S.morphColors!==m||S.toneMapping!==g||!0===K.isWebGL2&&S.morphTargetsCount!==b)&&(L=!0):L=!0:L=!0:L=!0:(L=!0,S.__version=i.version);let C=S.currentProgram;!0===L&&(C=Pe(i,t,s));let G=!1,T=!1,X=!1;const I=C.getUniforms(),_=S.uniforms;if(j.useProgram(C.program)&&(G=!0,T=!0,X=!0),i.id!==x&&(x=i.id,T=!0),G||w!==e){if(I.setValue(ge,"projectionMatrix",e.projectionMatrix),K.logarithmicDepthBuffer&&I.setValue(ge,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),w!==e&&(w=e,T=!0,X=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const t=I.map.cameraPosition;void 0!==t&&t.setValue(ge,F.setFromMatrixPosition(e.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&I.setValue(ge,"isOrthographic",!0===e.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||s.isSkinnedMesh)&&I.setValue(ge,"viewMatrix",e.matrixWorldInverse)}if(s.isSkinnedMesh){I.setOptional(ge,s,"bindMatrix"),I.setOptional(ge,s,"bindMatrixInverse");const e=s.skeleton;e&&(K.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),I.setValue(ge,"boneTexture",e.boneTexture,q),I.setValue(ge,"boneTextureSize",e.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const z=n.morphAttributes;return(void 0!==z.position||void 0!==z.normal||void 0!==z.color&&!0===K.isWebGL2)&&de.update(s,n,i,C),(T||S.receiveShadow!==s.receiveShadow)&&(S.receiveShadow=s.receiveShadow,I.setValue(ge,"receiveShadow",s.receiveShadow)),T&&(I.setValue(ge,"toneMappingExposure",f.toneMappingExposure),S.needsLights&&He(_,X),r&&!0===i.fog&&re.refreshFogUniforms(_,r),re.refreshMaterialUniforms(_,i,A,R,D),Dr.upload(ge,S.uniformsList,_,q)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Dr.upload(ge,S.uniformsList,_,q),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&I.setValue(ge,"center",s.center),I.setValue(ge,"modelViewMatrix",s.modelViewMatrix),I.setValue(ge,"normalMatrix",s.normalMatrix),I.setValue(ge,"modelMatrix",s.matrixWorld),C}function He(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function De(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}Xe.setAnimationLoop(Te),"undefined"!=typeof self&&Xe.setContext(self),this.setAnimationLoop=function(e){Ge=e,ve.setAnimationLoop(e),null===e?Xe.stop():Xe.start()},ve.addEventListener("sessionstart",Re),ve.addEventListener("sessionend",Ae),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===g)return;!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===ve.enabled&&!0===ve.isPresenting&&(!0===ve.cameraAutoUpdate&&ve.updateCamera(t),t=ve.getCamera()),!0===e.isScene&&e.onBeforeRender(f,e,t,v),u=oe.get(e,m.length),u.init(),m.push(u),k.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),P.setFromProjectionMatrix(k),V=this.localClippingEnabled,N=le.init(this.clippingPlanes,V,t),d=ae.get(e,p.length),d.init(),p.push(d),Ie(e,t,0,f.sortObjects),d.finish(),!0===f.sortObjects&&d.sort(X,I),!0===N&&le.beginShadows();const n=u.state.shadowsArray;if(ce.render(n,e,t),!0===N&&le.endShadows(),!0===this.info.autoReset&&this.info.reset(),he.render(d,e),u.setupLights(f.physicallyCorrectLights),t.isArrayCamera){const n=t.cameras;for(let t=0,i=n.length;t<i;t++){const i=n[t];_e(d,e,i,i.viewport)}}else _e(d,e,t);null!==v&&(q.updateMultisampleRenderTarget(v),q.updateRenderTargetMipmap(v)),!0===e.isScene&&e.onAfterRender(f,e,t),fe.resetDefaultState(),x=-1,w=null,m.pop(),u=m.length>0?m[m.length-1]:null,p.pop(),d=p.length>0?p[p.length-1]:null},this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return v},this.setRenderTargetTextures=function(e,t,n){Q.get(e.texture).__webglTexture=t,Q.get(e.depthTexture).__webglTexture=n;const i=Q.get(e);i.__hasExternalTextures=!0,i.__hasExternalTextures&&(i.__autoAllocateDepthBuffer=void 0===n,i.__autoAllocateDepthBuffer||!0===Y.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),i.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(e,t){const n=Q.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;v=e,y=t,b=n;let i=!0;if(e){const t=Q.get(e);void 0!==t.__useDefaultFramebuffer?(j.bindFramebuffer(36160,null),i=!1):void 0===t.__webglFramebuffer?q.setupRenderTarget(e):t.__hasExternalTextures&&q.rebindTextures(e,Q.get(e.texture).__webglTexture,Q.get(e.depthTexture).__webglTexture)}let s=null,r=!1,a=!1;if(e){const n=e.texture;(n.isData3DTexture||n.isDataArrayTexture)&&(a=!0);const i=Q.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(s=i[t],r=!0):s=K.isWebGL2&&e.samples>0&&!1===q.useMultisampledRTT(e)?Q.get(e).__webglMultisampledFramebuffer:i,S.copy(e.viewport),M.copy(e.scissor),L=e.scissorTest}else S.copy(_).multiplyScalar(A).floor(),M.copy(W).multiplyScalar(A).floor(),L=Z;const o=j.bindFramebuffer(36160,s);if(o&&K.drawBuffers&&i&&j.drawBuffers(e,s),j.viewport(S),j.scissor(M),j.setScissorTest(L),r){const i=Q.get(e.texture);ge.framebufferTexture2D(36160,36064,34069+t,i.__webglTexture,n)}else if(a){const i=Q.get(e.texture),s=t||0;ge.framebufferTextureLayer(36160,36064,i.__webglTexture,n||0,s)}x=-1},this.readRenderTargetPixels=function(e,t,n,i,s,r,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=Q.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){j.bindFramebuffer(36160,o);try{const a=e.texture,o=a.format,l=a.type;if(o!==H&&me.convert(o)!==ge.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===E&&(Y.has("EXT_color_buffer_half_float")||K.isWebGL2&&Y.has("EXT_color_buffer_float"));if(!(l===T||me.convert(l)===ge.getParameter(35738)||l===z&&(K.isWebGL2||Y.has("OES_texture_float")||Y.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-i&&n>=0&&n<=e.height-s&&ge.readPixels(t,n,i,s,me.convert(o),me.convert(l),r)}finally{const e=null!==v?Q.get(v).__webglFramebuffer:null;j.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=Math.pow(2,-n),s=Math.floor(t.image.width*i),r=Math.floor(t.image.height*i);q.setTexture2D(t,0),ge.copyTexSubImage2D(3553,n,0,0,e.x,e.y,s,r),j.unbindTexture()},this.copyTextureToTexture=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=t.image.width,r=t.image.height,a=me.convert(n.format),o=me.convert(n.type);q.setTexture2D(n,0),ge.pixelStorei(37440,n.flipY),ge.pixelStorei(37441,n.premultiplyAlpha),ge.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ge.texSubImage2D(3553,i,e.x,e.y,s,r,a,o,t.image.data):t.isCompressedTexture?ge.compressedTexSubImage2D(3553,i,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):ge.texSubImage2D(3553,i,e.x,e.y,a,o,t.image),0===i&&n.generateMipmaps&&ge.generateMipmap(3553),j.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(f.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const r=e.max.x-e.min.x+1,a=e.max.y-e.min.y+1,o=e.max.z-e.min.z+1,l=me.convert(i.format),c=me.convert(i.type);let h;if(i.isData3DTexture)q.setTexture3D(i,0),h=32879;else{if(!i.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");q.setTexture2DArray(i,0),h=35866}ge.pixelStorei(37440,i.flipY),ge.pixelStorei(37441,i.premultiplyAlpha),ge.pixelStorei(3317,i.unpackAlignment);const d=ge.getParameter(3314),u=ge.getParameter(32878),p=ge.getParameter(3316),m=ge.getParameter(3315),g=ge.getParameter(32877),y=n.isCompressedTexture?n.mipmaps[0]:n.image;ge.pixelStorei(3314,y.width),ge.pixelStorei(32878,y.height),ge.pixelStorei(3316,e.min.x),ge.pixelStorei(3315,e.min.y),ge.pixelStorei(32877,e.min.z),n.isDataTexture||n.isData3DTexture?ge.texSubImage3D(h,s,t.x,t.y,t.z,r,a,o,l,c,y.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ge.compressedTexSubImage3D(h,s,t.x,t.y,t.z,r,a,o,l,y.data)):ge.texSubImage3D(h,s,t.x,t.y,t.z,r,a,o,l,c,y),ge.pixelStorei(3314,d),ge.pixelStorei(32878,u),ge.pixelStorei(3316,p),ge.pixelStorei(3315,m),ge.pixelStorei(32877,g),0===s&&i.generateMipmaps&&ge.generateMipmap(h),j.unbindTexture()},this.initTexture=function(e){e.isCubeTexture?q.setTextureCube(e,0):e.isData3DTexture?q.setTexture3D(e,0):e.isDataArrayTexture?q.setTexture2DArray(e,0):q.setTexture2D(e,0),j.unbindTexture()},this.resetState=function(){y=0,b=0,v=null,j.reset(),fe.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class Za extends Wa{}Za.prototype.isWebGL1Renderer=!0;class Pa{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25e-5;this.isFogExp2=!0,this.name="",this.color=new bt(e),this.density=t}clone(){return new Pa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Na{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;this.isFog=!0,this.name="",this.color=new bt(e),this.near=t,this.far=n}clone(){return new Na(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class Va extends Zn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}class Ha{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=He,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ke()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[n+i];return this}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ke()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ke()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Da=new zt;class ka{constructor(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Da.fromBufferAttribute(this,t),Da.applyMatrix4(e),this.setXYZ(t,Da.x,Da.y,Da.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Da.fromBufferAttribute(this,t),Da.applyNormalMatrix(e),this.setXYZ(t,Da.x,Da.y,Da.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Da.fromBufferAttribute(this,t),Da.transformDirection(e),this.setXYZ(t,Da.x,Da.y,Da.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new $n(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new ka(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Ba extends jn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new bt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let Fa;const Ua=new zt,Oa=new zt,Ya=new zt,Ka=new nt,ja=new nt,Ja=new dn,Qa=new zt,qa=new zt,$a=new zt,eo=new nt,to=new nt,no=new nt;class io extends Zn{constructor(e){if(super(),this.isSprite=!0,this.type="Sprite",void 0===Fa){Fa=new yi;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new Ha(e,5);Fa.setIndex([0,1,2,0,2,3]),Fa.setAttribute("position",new ka(t,3,0,!1)),Fa.setAttribute("uv",new ka(t,2,3,!1))}this.geometry=Fa,this.material=void 0!==e?e:new Ba,this.center=new nt(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Oa.setFromMatrixScale(this.matrixWorld),Ja.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),Ya.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Oa.multiplyScalar(-Ya.z);const n=this.material.rotation;let i,s;0!==n&&(s=Math.cos(n),i=Math.sin(n));const r=this.center;so(Qa.set(-.5,-.5,0),Ya,r,Oa,i,s),so(qa.set(.5,-.5,0),Ya,r,Oa,i,s),so($a.set(.5,.5,0),Ya,r,Oa,i,s),eo.set(0,0),to.set(1,0),no.set(1,1);let a=e.ray.intersectTriangle(Qa,qa,$a,!1,Ua);if(null===a&&(so(qa.set(-.5,.5,0),Ya,r,Oa,i,s),to.set(0,1),a=e.ray.intersectTriangle(Qa,$a,qa,!1,Ua),null===a))return;const o=e.ray.origin.distanceTo(Ua);o<e.near||o>e.far||t.push({distance:o,point:Ua.clone(),uv:Yn.getUV(Ua,Qa,qa,$a,eo,to,no,new nt),face:null,object:this})}copy(e,t){return super.copy(e,t),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function so(e,t,n,i,s,r){Ka.subVectors(e,n).addScalar(.5).multiply(i),void 0!==s?(ja.x=r*Ka.x-s*Ka.y,ja.y=s*Ka.x+r*Ka.y):ja.copy(Ka),e.copy(t),e.x+=ja.x,e.y+=ja.y,e.applyMatrix4(Ja)}const ro=new zt,ao=new zt;class oo extends Zn{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let e=0,n=t.length;e<n;e++){const n=t[e];this.addLevel(n.object.clone(),n.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;t=Math.abs(t);const n=this.levels;let i;for(i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){ro.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(ro);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){ro.setFromMatrixPosition(e.matrixWorld),ao.setFromMatrixPosition(this.matrixWorld);const n=ro.distanceTo(ao)/e.zoom;let i,s;for(t[0].object.visible=!0,i=1,s=t.length;i<s&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(this._currentLevel=i-1;i<s;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let e=0,i=n.length;e<i;e++){const i=n[e];t.object.levels.push({object:i.object.uuid,distance:i.distance})}return t}}const lo=new zt,co=new Ct,ho=new Ct,uo=new zt,po=new dn;class mo extends Wi{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new dn,this.bindMatrixInverse=new dn}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ct,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const i=1/e.manhattanLength();i!==1/0?e.multiplyScalar(i):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,i=this.geometry;co.fromBufferAttribute(i.attributes.skinIndex,e),ho.fromBufferAttribute(i.attributes.skinWeight,e),lo.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const i=ho.getComponent(e);if(0!==i){const s=co.getComponent(e);po.multiplyMatrices(n.bones[s].matrixWorld,n.boneInverses[s]),t.addScaledVector(uo.copy(lo).applyMatrix4(po),i)}}return t.applyMatrix4(this.bindMatrixInverse)}}class fo extends Zn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class go extends Lt{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(null,arguments.length>5?arguments[5]:void 0,arguments.length>6?arguments[6]:void 0,arguments.length>7?arguments[7]:void 0,arguments.length>8&&void 0!==arguments[8]?arguments[8]:x,arguments.length>9&&void 0!==arguments[9]?arguments[9]:x,arguments.length>3?arguments[3]:void 0,arguments.length>4?arguments[4]:void 0,arguments.length>10?arguments[10]:void 0,arguments.length>11?arguments[11]:void 0),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const yo=new dn,bo=new dn;class vo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.uuid=Ke(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new dn)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new dn;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let i=0,s=e.length;i<s;i++){const s=e[i]?e[i].matrixWorld:bo;yo.multiplyMatrices(s,t[i]),yo.toArray(n,16*i)}null!==i&&(i.needsUpdate=!0)}clone(){return new vo(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=$e(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new go(t,e,e,H,z);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const i=e.bones[n];let s=t[i];void 0===s&&(console.warn("THREE.Skeleton: No bone found with UUID:",i),s=new fo),this.bones.push(s),this.boneInverses.push((new dn).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const s=t[i];e.bones.push(s.uuid);const r=n[i];e.boneInverses.push(r.toArray())}return e}}class xo extends $n{constructor(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const wo=new dn,So=new dn,Mo=[],Lo=new Wi;class Co extends Wi{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new xo(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Lo.geometry=this.geometry,Lo.material=this.material,void 0!==Lo.material)for(let s=0;s<i;s++){this.getMatrixAt(s,wo),So.multiplyMatrices(n,wo),Lo.matrixWorld=So,Lo.raycast(e,Mo);for(let e=0,n=Mo.length;e<n;e++){const n=Mo[e];n.instanceId=s,n.object=this,t.push(n)}Mo.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new xo(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}class Go extends jn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new bt(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const To=new zt,Ro=new zt,Ao=new dn,Xo=new hn,Io=new tn;class _o extends Zn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new yi,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Go;super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,i=t.count;e<i;e++)To.fromBufferAttribute(t,e-1),Ro.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=To.distanceTo(Ro);e.setAttribute("lineDistance",new li(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,r=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Io.copy(n.boundingSphere),Io.applyMatrix4(i),Io.radius+=s,!1===e.ray.intersectsSphere(Io))return;Ao.copy(i).invert(),Xo.copy(e.ray).applyMatrix4(Ao);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=new zt,c=new zt,h=new zt,d=new zt,u=this.isLineSegments?2:1,p=n.index,m=n.attributes.position;if(null!==p){for(let n=Math.max(0,r.start),i=Math.min(p.count,r.start+r.count)-1;n<i;n+=u){const i=p.getX(n),s=p.getX(n+1);l.fromBufferAttribute(m,i),c.fromBufferAttribute(m,s);if(Xo.distanceSqToSegment(l,c,d,h)>o)continue;d.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(d);r<e.near||r>e.far||t.push({distance:r,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,r.start),i=Math.min(m.count,r.start+r.count)-1;n<i;n+=u){l.fromBufferAttribute(m,n),c.fromBufferAttribute(m,n+1);if(Xo.distanceSqToSegment(l,c,d,h)>o)continue;d.applyMatrix4(this.matrixWorld);const i=e.ray.origin.distanceTo(d);i<e.near||i>e.far||t.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}const zo=new zt,Eo=new zt;class Wo extends _o{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,i=t.count;e<i;e+=2)zo.fromBufferAttribute(t,e),Eo.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+zo.distanceTo(Eo);e.setAttribute("lineDistance",new li(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Zo extends _o{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Po extends jn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new bt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const No=new dn,Vo=new hn,Ho=new tn,Do=new zt;class ko extends Zn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new yi,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Po;super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,r=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Ho.copy(n.boundingSphere),Ho.applyMatrix4(i),Ho.radius+=s,!1===e.ray.intersectsSphere(Ho))return;No.copy(i).invert(),Vo.copy(e.ray).applyMatrix4(No);const a=s/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=n.index,c=n.attributes.position;if(null!==l){for(let n=Math.max(0,r.start),s=Math.min(l.count,r.start+r.count);n<s;n++){const s=l.getX(n);Do.fromBufferAttribute(c,s),Bo(Do,s,o,i,e,t,this)}}else{for(let n=Math.max(0,r.start),s=Math.min(c.count,r.start+r.count);n<s;n++)Do.fromBufferAttribute(c,n),Bo(Do,n,o,i,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function Bo(e,t,n,i,s,r,a){const o=Vo.distanceSqToPoint(e);if(o<n){const n=new zt;Vo.closestPointToPoint(e,n),n.applyMatrix4(i);const l=s.ray.origin.distanceTo(n);if(l<s.near||l>s.far)return;r.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,object:a})}}class Fo extends Lt{constructor(e,t,n,i,s,r,a,o,l){super(e,t,n,i,s,r,a,o,l),this.isVideoTexture=!0,this.minFilter=void 0!==r?r:M,this.magFilter=void 0!==s?s:M,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class Uo extends Lt{constructor(e,t,n){super({width:e,height:t}),this.isFramebufferTexture=!0,this.format=n,this.magFilter=x,this.minFilter=x,this.generateMipmaps=!1,this.needsUpdate=!0}}class Oo extends Lt{constructor(e,t,n,i,s,r,a,o,l,c,h,d){super(null,r,a,o,l,c,i,s,h,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Yo extends Lt{constructor(e,t,n,i,s,r,a,o,l){super(e,t,n,i,s,r,a,o,l),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Ko{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.arcLengthDivisions;if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),s=0;t.push(0);for(let r=1;r<=e;r++)n=this.getPoint(r/e),s+=n.distanceTo(i),t.push(s),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const s=n.length;let r;r=t||e*n[s-1];let a,o=0,l=s-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-r,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===r)return i/(s-1);const c=n[i];return(i+(r-c)/(n[i+1]-c))/(s-1)}getTangent(e,t){const n=1e-4;let i=e-n,s=e+n;i<0&&(i=0),s>1&&(s=1);const r=this.getPoint(i),a=this.getPoint(s),o=t||(r.isVector2?new nt:new zt);return o.copy(a).sub(r).normalize(),o}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new zt,i=[],s=[],r=[],a=new zt,o=new dn;for(let t=0;t<=e;t++){const n=t/e;i[t]=this.getTangentAt(n,new zt)}s[0]=new zt,r[0]=new zt;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),d=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),d<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),r[0].crossVectors(i[0],s[0]);for(let t=1;t<=e;t++){if(s[t]=s[t-1].clone(),r[t]=r[t-1].clone(),a.crossVectors(i[t-1],i[t]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(je(i[t-1].dot(i[t]),-1,1));s[t].applyMatrix4(o.makeRotationAxis(a,e))}r[t].crossVectors(i[t],s[t])}if(!0===t){let t=Math.acos(je(s[0].dot(s[e]),-1,1));t/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(t=-t);for(let n=1;n<=e;n++)s[n].applyMatrix4(o.makeRotationAxis(i[n],t*n)),r[n].crossVectors(i[n],s[n])}return{tangents:i,normals:s,binormals:r}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class jo extends Ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=r,this.aClockwise=a,this.aRotation=o}getPoint(e,t){const n=t||new nt,i=2*Math.PI;let s=this.aEndAngle-this.aStartAngle;const r=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=i;for(;s>i;)s-=i;s<Number.EPSILON&&(s=r?0:i),!0!==this.aClockwise||r||(s===i?s=-i:s-=i);const a=this.aStartAngle+e*s;let o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=o-this.aX,i=l-this.aY;o=n*e-i*t+this.aX,l=n*t+i*e+this.aY}return n.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class Jo extends jo{constructor(e,t,n,i,s,r){super(e,t,n,n,i,s,r),this.isArcCurve=!0,this.type="ArcCurve"}}function Qo(){let e=0,t=0,n=0,i=0;function s(s,r,a,o){e=s,t=a,n=-3*s+3*r-2*a-o,i=2*s-2*r+a+o}return{initCatmullRom:function(e,t,n,i,r){s(t,n,r*(n-e),r*(i-t))},initNonuniformCatmullRom:function(e,t,n,i,r,a,o){let l=(t-e)/r-(n-e)/(r+a)+(n-t)/a,c=(n-t)/a-(i-t)/(a+o)+(i-n)/o;l*=a,c*=a,s(t,n,l,c)},calc:function(s){const r=s*s;return e+t*s+n*r+i*(r*s)}}}const qo=new zt,$o=new Qo,el=new Qo,tl=new Qo;class nl extends Ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt,n=this.points,i=n.length,s=(i-(this.closed?0:1))*e;let r,a,o=Math.floor(s),l=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/i)+1)*i:0===l&&o===i-1&&(o=i-2,l=1),this.closed||o>0?r=n[(o-1)%i]:(qo.subVectors(n[0],n[1]).add(n[0]),r=qo);const c=n[o%i],h=n[(o+1)%i];if(this.closed||o+2<i?a=n[(o+2)%i]:(qo.subVectors(n[i-1],n[i-2]).add(n[i-1]),a=qo),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(r.distanceToSquared(c),e),n=Math.pow(c.distanceToSquared(h),e),i=Math.pow(h.distanceToSquared(a),e);n<1e-4&&(n=1),t<1e-4&&(t=n),i<1e-4&&(i=n),$o.initNonuniformCatmullRom(r.x,c.x,h.x,a.x,t,n,i),el.initNonuniformCatmullRom(r.y,c.y,h.y,a.y,t,n,i),tl.initNonuniformCatmullRom(r.z,c.z,h.z,a.z,t,n,i)}else"catmullrom"===this.curveType&&($o.initCatmullRom(r.x,c.x,h.x,a.x,this.tension),el.initCatmullRom(r.y,c.y,h.y,a.y,this.tension),tl.initCatmullRom(r.z,c.z,h.z,a.z,this.tension));return t.set($o.calc(l),el.calc(l),tl.calc(l)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new zt).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function il(e,t,n,i,s){const r=.5*(i-t),a=.5*(s-n),o=e*e;return(2*n-2*i+r+a)*(e*o)+(-3*n+3*i-2*r-a)*o+r*e+n}function sl(e,t,n,i){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,i)}function rl(e,t,n,i,s){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,i)+function(e,t){return e*e*e*t}(e,s)}class al extends Ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nt,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new nt,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new nt;super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nt,n=this.v0,i=this.v1,s=this.v2,r=this.v3;return t.set(rl(e,n.x,i.x,s.x,r.x),rl(e,n.y,i.y,s.y,r.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class ol extends Ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new zt,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new zt;super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt,n=this.v0,i=this.v1,s=this.v2,r=this.v3;return t.set(rl(e,n.x,i.x,s.x,r.x),rl(e,n.y,i.y,s.y,r.y),rl(e,n.z,i.z,s.z,r.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class ll extends Ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nt;super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nt;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new nt;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class cl extends Ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt;super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt;return 1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class hl extends Ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nt,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new nt;super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nt,n=this.v0,i=this.v1,s=this.v2;return t.set(sl(e,n.x,i.x,s.x),sl(e,n.y,i.y,s.y)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class dl extends Ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new zt;super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt,n=this.v0,i=this.v1,s=this.v2;return t.set(sl(e,n.x,i.x,s.x),sl(e,n.y,i.y,s.y),sl(e,n.z,i.z,s.z)),t}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ul extends Ko{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nt,n=this.points,i=(n.length-1)*e,s=Math.floor(i),r=i-s,a=n[0===s?s:s-1],o=n[s],l=n[s>n.length-2?n.length-1:s+1],c=n[s>n.length-3?n.length-1:s+2];return t.set(il(r,a.x,o.x,l.x,c.x),il(r,a.y,o.y,l.y,c.y)),t}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new nt).fromArray(n))}return this}}var pl=Object.freeze({__proto__:null,ArcCurve:Jo,CatmullRomCurve3:nl,CubicBezierCurve:al,CubicBezierCurve3:ol,EllipseCurve:jo,LineCurve:ll,LineCurve3:cl,QuadraticBezierCurve:hl,QuadraticBezierCurve3:dl,SplineCurve:ul});class ml extends Ko{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ll(t,e))}getPoint(e,t){const n=e*this.getLength(),i=this.getCurveLengths();let s=0;for(;s<i.length;){if(i[s]>=n){const e=i[s]-n,r=this.curves[s],a=r.getLength(),o=0===a?0:1-e/a;return r.getPointAt(o,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40;const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12;const t=[];let n;for(let i=0,s=this.curves;i<s.length;i++){const r=s[i],a=r.isEllipseCurve?2*e:r.isLineCurve||r.isLineCurve3?1:r.isSplineCurve?e*r.points.length:e,o=r.getPoints(a);for(let e=0;e<o.length;e++){const i=o[e];n&&n.equals(i)||(t.push(i),n=i)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new pl[n.type]).fromJSON(n))}return this}}class fl extends ml{constructor(e){super(),this.type="Path",this.currentPoint=new nt,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new ll(this.currentPoint.clone(),new nt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,i){const s=new hl(this.currentPoint.clone(),new nt(e,t),new nt(n,i));return this.curves.push(s),this.currentPoint.set(n,i),this}bezierCurveTo(e,t,n,i,s,r){const a=new al(this.currentPoint.clone(),new nt(e,t),new nt(n,i),new nt(s,r));return this.curves.push(a),this.currentPoint.set(s,r),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new ul(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,i,s,r){const a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+a,t+o,n,i,s,r),this}absarc(e,t,n,i,s,r){return this.absellipse(e,t,n,n,i,s,r),this}ellipse(e,t,n,i,s,r,a,o){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,i,s,r,a,o),this}absellipse(e,t,n,i,s,r,a,o){const l=new jo(e,t,n,i,s,r,a,o);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class gl extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[new nt(0,.5),new nt(.5,0),new nt(0,-.5)],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=je(i,0,2*Math.PI);const s=[],r=[],a=[],o=[],l=[],c=1/t,h=new zt,d=new nt,u=new zt,p=new zt,m=new zt;let f=0,g=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:f=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,u.x=1*g,u.y=-f,u.z=0*g,m.copy(u),u.normalize(),o.push(u.x,u.y,u.z);break;case e.length-1:o.push(m.x,m.y,m.z);break;default:f=e[t+1].x-e[t].x,g=e[t+1].y-e[t].y,u.x=1*g,u.y=-f,u.z=0*g,p.copy(u),u.x+=m.x,u.y+=m.y,u.z+=m.z,u.normalize(),o.push(u.x,u.y,u.z),m.copy(p)}for(let s=0;s<=t;s++){const u=n+s*c*i,p=Math.sin(u),m=Math.cos(u);for(let n=0;n<=e.length-1;n++){h.x=e[n].x*p,h.y=e[n].y,h.z=e[n].x*m,r.push(h.x,h.y,h.z),d.x=s/t,d.y=n/(e.length-1),a.push(d.x,d.y);const i=o[3*n+0]*p,c=o[3*n+1],u=o[3*n+0]*m;l.push(i,c,u)}}for(let n=0;n<t;n++)for(let t=0;t<e.length-1;t++){const i=t+n*e.length,r=i,a=i+e.length,o=i+e.length+1,l=i+1;s.push(r,a,l),s.push(o,l,a)}this.setIndex(s),this.setAttribute("position",new li(r,3)),this.setAttribute("uv",new li(a,2)),this.setAttribute("normal",new li(l,3))}static fromJSON(e){return new gl(e.points,e.segments,e.phiStart,e.phiLength)}}class yl extends gl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;const s=new fl;s.absarc(0,-t/2,e,1.5*Math.PI,0),s.absarc(0,t/2,e,0,.5*Math.PI),super(s.getPoints(n),i),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:i}}static fromJSON(e){return new yl(e.radius,e.length,e.capSegments,e.radialSegments)}}class bl extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},t=Math.max(3,t);const s=[],r=[],a=[],o=[],l=new zt,c=new nt;r.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let s=0,h=3;s<=t;s++,h+=3){const d=n+s/t*i;l.x=e*Math.cos(d),l.y=e*Math.sin(d),r.push(l.x,l.y,l.z),a.push(0,0,1),c.x=(r[h]/e+1)/2,c.y=(r[h+1]/e+1)/2,o.push(c.x,c.y)}for(let e=1;e<=t;e++)s.push(e,e+1,0);this.setIndex(s),this.setAttribute("position",new li(r,3)),this.setAttribute("normal",new li(a,3)),this.setAttribute("uv",new li(o,2))}static fromJSON(e){return new bl(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class vl extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:s,openEnded:r,thetaStart:a,thetaLength:o};const l=this;i=Math.floor(i),s=Math.floor(s);const c=[],h=[],d=[],u=[];let p=0;const m=[],f=n/2;let g=0;function y(n){const s=p,r=new nt,m=new zt;let y=0;const b=!0===n?e:t,v=!0===n?1:-1;for(let e=1;e<=i;e++)h.push(0,f*v,0),d.push(0,v,0),u.push(.5,.5),p++;const x=p;for(let e=0;e<=i;e++){const t=e/i*o+a,n=Math.cos(t),s=Math.sin(t);m.x=b*s,m.y=f*v,m.z=b*n,h.push(m.x,m.y,m.z),d.push(0,v,0),r.x=.5*n+.5,r.y=.5*s*v+.5,u.push(r.x,r.y),p++}for(let e=0;e<i;e++){const t=s+e,i=x+e;!0===n?c.push(i,i+1,t):c.push(i+1,i,t),y+=3}l.addGroup(g,y,!0===n?1:2),g+=y}!function(){const r=new zt,y=new zt;let b=0;const v=(t-e)/n;for(let l=0;l<=s;l++){const c=[],g=l/s,b=g*(t-e)+e;for(let e=0;e<=i;e++){const t=e/i,s=t*o+a,l=Math.sin(s),m=Math.cos(s);y.x=b*l,y.y=-g*n+f,y.z=b*m,h.push(y.x,y.y,y.z),r.set(l,v,m).normalize(),d.push(r.x,r.y,r.z),u.push(t,1-g),c.push(p++)}m.push(c)}for(let e=0;e<i;e++)for(let t=0;t<s;t++){const n=m[t][e],i=m[t+1][e],s=m[t+1][e+1],r=m[t][e+1];c.push(n,i,r),c.push(i,s,r),b+=6}l.addGroup(g,b,0),g+=b}(),!1===r&&(e>0&&y(!0),t>0&&y(!1)),this.setIndex(c),this.setAttribute("position",new li(h,3)),this.setAttribute("normal",new li(d,3)),this.setAttribute("uv",new li(u,2))}static fromJSON(e){return new vl(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class xl extends vl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;super(0,e,t,n,i,s,r,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:s,thetaStart:r,thetaLength:a}}static fromJSON(e){return new xl(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class wl extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i};const s=[],r=[];function a(e,t,n,i){const s=i+1,r=[];for(let i=0;i<=s;i++){r[i]=[];const a=e.clone().lerp(n,i/s),o=t.clone().lerp(n,i/s),l=s-i;for(let e=0;e<=l;e++)r[i][e]=0===e&&i===s?a:a.clone().lerp(o,e/l)}for(let e=0;e<s;e++)for(let t=0;t<2*(s-e)-1;t++){const n=Math.floor(t/2);t%2==0?(o(r[e][n+1]),o(r[e+1][n]),o(r[e][n])):(o(r[e][n+1]),o(r[e+1][n+1]),o(r[e+1][n]))}}function o(e){s.push(e.x,e.y,e.z)}function l(t,n){const i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function c(e,t,n,i){i<0&&1===e.x&&(r[t]=e.x-1),0===n.x&&0===n.z&&(r[t]=i/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}function d(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){const n=new zt,i=new zt,s=new zt;for(let r=0;r<t.length;r+=3)l(t[r+0],n),l(t[r+1],i),l(t[r+2],s),a(n,i,s,e)}(i),function(e){const t=new zt;for(let n=0;n<s.length;n+=3)t.x=s[n+0],t.y=s[n+1],t.z=s[n+2],t.normalize().multiplyScalar(e),s[n+0]=t.x,s[n+1]=t.y,s[n+2]=t.z}(n),function(){const e=new zt;for(let t=0;t<s.length;t+=3){e.x=s[t+0],e.y=s[t+1],e.z=s[t+2];const n=h(e)/2/Math.PI+.5,i=d(e)/Math.PI+.5;r.push(n,1-i)}(function(){const e=new zt,t=new zt,n=new zt,i=new zt,a=new nt,o=new nt,l=new nt;for(let d=0,u=0;d<s.length;d+=9,u+=6){e.set(s[d+0],s[d+1],s[d+2]),t.set(s[d+3],s[d+4],s[d+5]),n.set(s[d+6],s[d+7],s[d+8]),a.set(r[u+0],r[u+1]),o.set(r[u+2],r[u+3]),l.set(r[u+4],r[u+5]),i.copy(e).add(t).add(n).divideScalar(3);const p=h(i);c(a,u+0,e,p),c(o,u+2,t,p),c(l,u+4,n,p)}})(),function(){for(let e=0;e<r.length;e+=6){const t=r[e+0],n=r[e+2],i=r[e+4],s=Math.max(t,n,i),a=Math.min(t,n,i);s>.9&&a<.1&&(t<.2&&(r[e+0]+=1),n<.2&&(r[e+2]+=1),i<.2&&(r[e+4]+=1))}}()}(),this.setAttribute("position",new li(s,3)),this.setAttribute("normal",new li(s.slice(),3)),this.setAttribute("uv",new li(r,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new wl(e.vertices,e.indices,e.radius,e.details)}}class Sl extends wl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-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],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Sl(e.radius,e.detail)}}const Ml=new zt,Ll=new zt,Cl=new zt,Gl=new Yn;class Tl extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,i=Math.pow(10,n),s=Math.cos(Oe*t),r=e.getIndex(),a=e.getAttribute("position"),o=r?r.count:a.count,l=[0,0,0],c=["a","b","c"],h=new Array(3),d={},u=[];for(let e=0;e<o;e+=3){r?(l[0]=r.getX(e),l[1]=r.getX(e+1),l[2]=r.getX(e+2)):(l[0]=e,l[1]=e+1,l[2]=e+2);const{a:t,b:n,c:o}=Gl;if(t.fromBufferAttribute(a,l[0]),n.fromBufferAttribute(a,l[1]),o.fromBufferAttribute(a,l[2]),Gl.getNormal(Cl),h[0]=`${Math.round(t.x*i)},${Math.round(t.y*i)},${Math.round(t.z*i)}`,h[1]=`${Math.round(n.x*i)},${Math.round(n.y*i)},${Math.round(n.z*i)}`,h[2]=`${Math.round(o.x*i)},${Math.round(o.y*i)},${Math.round(o.z*i)}`,h[0]!==h[1]&&h[1]!==h[2]&&h[2]!==h[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=h[e],i=h[t],r=Gl[c[e]],a=Gl[c[t]],o=`${n}_${i}`,p=`${i}_${n}`;p in d&&d[p]?(Cl.dot(d[p].normal)<=s&&(u.push(r.x,r.y,r.z),u.push(a.x,a.y,a.z)),d[p]=null):o in d||(d[o]={index0:l[e],index1:l[t],normal:Cl.clone()})}}for(const e in d)if(d[e]){const{index0:t,index1:n}=d[e];Ml.fromBufferAttribute(a,t),Ll.fromBufferAttribute(a,n),u.push(Ml.x,Ml.y,Ml.z),u.push(Ll.x,Ll.y,Ll.z)}this.setAttribute("position",new li(u,3))}}}class Rl extends fl{constructor(e){super(e),this.uuid=Ke(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new fl).fromJSON(n))}return this}}const Al=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;const i=t&&t.length,s=i?t[0]*n:e.length;let r=Xl(e,0,s,n,!0);const a=[];if(!r||r.next===r.prev)return a;let o,l,c,h,d,u,p;if(i&&(r=Pl(e,t,r,n)),e.length>80*n){o=c=e[0],l=h=e[1];for(let t=n;t<s;t+=n)d=e[t],u=e[t+1],d<o&&(o=d),u<l&&(l=u),d>c&&(c=d),u>h&&(h=u);p=Math.max(c-o,h-l),p=0!==p?1/p:0}return _l(r,a,n,o,l,p),a};function Xl(e,t,n,i,s){let r,a;if(s===function(e,t,n,i){let s=0;for(let r=t,a=n-i;r<n;r+=i)s+=(e[a]-e[r])*(e[r+1]+e[a+1]),a=r;return s}(e,t,n,i)>0)for(r=t;r<n;r+=i)a=ql(r,e[r],e[r+1],a);else for(r=n-i;r>=t;r-=i)a=ql(r,e[r],e[r+1],a);return a&&Ol(a,a.next)&&($l(a),a=a.next),a}function Il(e,t){if(!e)return e;t||(t=e);let n,i=e;do{if(n=!1,i.steiner||!Ol(i,i.next)&&0!==Ul(i.prev,i,i.next))i=i.next;else{if($l(i),i=t=i.prev,i===i.next)break;n=!0}}while(n||i!==t);return t}function _l(e,t,n,i,s,r,a){if(!e)return;!a&&r&&function(e,t,n,i){let s=e;do{null===s.z&&(s.z=Dl(s.x,s.y,t,n,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==e);s.prevZ.nextZ=null,s.prevZ=null,function(e){let t,n,i,s,r,a,o,l,c=1;do{for(n=e,e=null,r=null,a=0;n;){for(a++,i=n,o=0,t=0;t<c&&(o++,i=i.nextZ,i);t++);for(l=c;o>0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(s=n,n=n.nextZ,o--):(s=i,i=i.nextZ,l--),r?r.nextZ=s:e=s,s.prevZ=r,r=s;n=i}r.nextZ=null,c*=2}while(a>1)}(s)}(e,i,s,r);let o,l,c=e;for(;e.prev!==e.next;)if(o=e.prev,l=e.next,r?El(e,i,s,r):zl(e))t.push(o.i/n),t.push(e.i/n),t.push(l.i/n),$l(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?_l(e=Wl(Il(e),t,n),t,n,i,s,r,2):2===a&&Zl(e,t,n,i,s,r):_l(Il(e),t,n,i,s,r,1);break}}function zl(e){const t=e.prev,n=e,i=e.next;if(Ul(t,n,i)>=0)return!1;let s=e.next.next;for(;s!==e.prev;){if(Bl(t.x,t.y,n.x,n.y,i.x,i.y,s.x,s.y)&&Ul(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function El(e,t,n,i){const s=e.prev,r=e,a=e.next;if(Ul(s,r,a)>=0)return!1;const o=s.x<r.x?s.x<a.x?s.x:a.x:r.x<a.x?r.x:a.x,l=s.y<r.y?s.y<a.y?s.y:a.y:r.y<a.y?r.y:a.y,c=s.x>r.x?s.x>a.x?s.x:a.x:r.x>a.x?r.x:a.x,h=s.y>r.y?s.y>a.y?s.y:a.y:r.y>a.y?r.y:a.y,d=Dl(o,l,t,n,i),u=Dl(c,h,t,n,i);let p=e.prevZ,m=e.nextZ;for(;p&&p.z>=d&&m&&m.z<=u;){if(p!==e.prev&&p!==e.next&&Bl(s.x,s.y,r.x,r.y,a.x,a.y,p.x,p.y)&&Ul(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,m!==e.prev&&m!==e.next&&Bl(s.x,s.y,r.x,r.y,a.x,a.y,m.x,m.y)&&Ul(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&Bl(s.x,s.y,r.x,r.y,a.x,a.y,p.x,p.y)&&Ul(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=u;){if(m!==e.prev&&m!==e.next&&Bl(s.x,s.y,r.x,r.y,a.x,a.y,m.x,m.y)&&Ul(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Wl(e,t,n){let i=e;do{const s=i.prev,r=i.next.next;!Ol(s,r)&&Yl(s,i,i.next,r)&&Jl(s,r)&&Jl(r,s)&&(t.push(s.i/n),t.push(i.i/n),t.push(r.i/n),$l(i),$l(i.next),i=e=r),i=i.next}while(i!==e);return Il(i)}function Zl(e,t,n,i,s,r){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Fl(a,e)){let o=Ql(a,e);return a=Il(a,a.next),o=Il(o,o.next),_l(a,t,n,i,s,r),void _l(o,t,n,i,s,r)}e=e.next}a=a.next}while(a!==e)}function Pl(e,t,n,i){const s=[];let r,a,o,l,c;for(r=0,a=t.length;r<a;r++)o=t[r]*i,l=r<a-1?t[r+1]*i:e.length,c=Xl(e,o,l,i,!1),c===c.next&&(c.steiner=!0),s.push(kl(c));for(s.sort(Nl),r=0;r<s.length;r++)Vl(s[r],n),n=Il(n,n.next);return n}function Nl(e,t){return e.x-t.x}function Vl(e,t){if(t=function(e,t){let n=t;const i=e.x,s=e.y;let r,a=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){const e=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=i&&e>a){if(a=e,e===i){if(s===n.y)return n;if(s===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===a)return r;const o=r,l=r.x,c=r.y;let h,d=1/0;n=r;do{i>=n.x&&n.x>=l&&i!==n.x&&Bl(s<c?i:a,s,l,c,s<c?a:i,s,n.x,n.y)&&(h=Math.abs(s-n.y)/(i-n.x),Jl(n,e)&&(h<d||h===d&&(n.x>r.x||n.x===r.x&&Hl(r,n)))&&(r=n,d=h)),n=n.next}while(n!==o);return r}(e,t)){const n=Ql(t,e);Il(t,t.next),Il(n,n.next)}}function Hl(e,t){return Ul(e.prev,e,t.prev)<0&&Ul(t.next,e,e.next)<0}function Dl(e,t,n,i,s){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function kl(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Bl(e,t,n,i,s,r,a,o){return(s-a)*(t-o)-(e-a)*(r-o)>=0&&(e-a)*(i-o)-(n-a)*(t-o)>=0&&(n-a)*(r-o)-(s-a)*(i-o)>=0}function Fl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Yl(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Jl(e,t)&&Jl(t,e)&&function(e,t){let n=e,i=!1;const s=(e.x+t.x)/2,r=(e.y+t.y)/2;do{n.y>r!=n.next.y>r&&n.next.y!==n.y&&s<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(Ul(e.prev,e,t.prev)||Ul(e,t.prev,t))||Ol(e,t)&&Ul(e.prev,e,e.next)>0&&Ul(t.prev,t,t.next)>0)}function Ul(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Ol(e,t){return e.x===t.x&&e.y===t.y}function Yl(e,t,n,i){const s=jl(Ul(e,t,n)),r=jl(Ul(e,t,i)),a=jl(Ul(n,i,e)),o=jl(Ul(n,i,t));return s!==r&&a!==o||(!(0!==s||!Kl(e,n,t))||(!(0!==r||!Kl(e,i,t))||(!(0!==a||!Kl(n,e,i))||!(0!==o||!Kl(n,t,i)))))}function Kl(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function jl(e){return e>0?1:e<0?-1:0}function Jl(e,t){return Ul(e.prev,e,e.next)<0?Ul(e,t,e.next)>=0&&Ul(e,e.prev,t)>=0:Ul(e,t,e.prev)<0||Ul(e,e.next,t)<0}function Ql(e,t){const n=new ec(e.i,e.x,e.y),i=new ec(t.i,t.x,t.y),s=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=s,s.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function ql(e,t,n,i){const s=new ec(e,t,n);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function $l(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ec(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class tc{static area(e){const t=e.length;let n=0;for(let i=t-1,s=0;s<t;i=s++)n+=e[i].x*e[s].y-e[s].x*e[i].y;return.5*n}static isClockWise(e){return tc.area(e)<0}static triangulateShape(e,t){const n=[],i=[],s=[];nc(e),ic(n,e);let r=e.length;t.forEach(nc);for(let e=0;e<t.length;e++)i.push(r),r+=t[e].length,ic(n,t[e]);const a=Al(n,i);for(let e=0;e<a.length;e+=3)s.push(a.slice(e,e+3));return s}}function nc(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function ic(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class sc extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rl([new nt(.5,.5),new nt(-.5,.5),new nt(-.5,-.5),new nt(.5,-.5)]),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,i=[],s=[];for(let t=0,n=e.length;t<n;t++){r(e[t])}function r(e){const r=[],a=void 0!==t.curveSegments?t.curveSegments:12,o=void 0!==t.steps?t.steps:1;let l=void 0!==t.depth?t.depth:1,c=void 0===t.bevelEnabled||t.bevelEnabled,h=void 0!==t.bevelThickness?t.bevelThickness:.2,d=void 0!==t.bevelSize?t.bevelSize:h-.1,u=void 0!==t.bevelOffset?t.bevelOffset:0,p=void 0!==t.bevelSegments?t.bevelSegments:3;const m=t.extrudePath,f=void 0!==t.UVGenerator?t.UVGenerator:rc;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=t.amount);let g,y,b,v,x,w=!1;m&&(g=m.getSpacedPoints(o),w=!0,c=!1,y=m.computeFrenetFrames(o,!1),b=new zt,v=new zt,x=new zt),c||(p=0,h=0,d=0,u=0);const S=e.extractPoints(a);let M=S.shape;const L=S.holes;if(!tc.isClockWise(M)){M=M.reverse();for(let e=0,t=L.length;e<t;e++){const t=L[e];tc.isClockWise(t)&&(L[e]=t.reverse())}}const C=tc.triangulateShape(M,L),G=M;for(let e=0,t=L.length;e<t;e++){const t=L[e];M=M.concat(t)}function T(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}const R=M.length,A=C.length;function X(e,t,n){let i,s,r;const a=e.x-t.x,o=e.y-t.y,l=n.x-e.x,c=n.y-e.y,h=a*a+o*o,d=a*c-o*l;if(Math.abs(d)>Number.EPSILON){const d=Math.sqrt(h),u=Math.sqrt(l*l+c*c),p=t.x-o/d,m=t.y+a/d,f=((n.x-c/u-p)*c-(n.y+l/u-m)*l)/(a*c-o*l);i=p+a*f-e.x,s=m+o*f-e.y;const g=i*i+s*s;if(g<=2)return new nt(i,s);r=Math.sqrt(g/2)}else{let e=!1;a>Number.EPSILON?l>Number.EPSILON&&(e=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(c)&&(e=!0),e?(i=-o,s=a,r=Math.sqrt(h)):(i=a,s=o,r=Math.sqrt(h/2))}return new nt(i/r,s/r)}const I=[];for(let e=0,t=G.length,n=t-1,i=e+1;e<t;e++,n++,i++)n===t&&(n=0),i===t&&(i=0),I[e]=X(G[e],G[n],G[i]);const _=[];let z,E=I.concat();for(let e=0,t=L.length;e<t;e++){const t=L[e];z=[];for(let e=0,n=t.length,i=n-1,s=e+1;e<n;e++,i++,s++)i===n&&(i=0),s===n&&(s=0),z[e]=X(t[e],t[i],t[s]);_.push(z),E=E.concat(z)}for(let e=0;e<p;e++){const t=e/p,n=h*Math.cos(t*Math.PI/2),i=d*Math.sin(t*Math.PI/2)+u;for(let e=0,t=G.length;e<t;e++){const t=T(G[e],I[e],i);P(t.x,t.y,-n)}for(let e=0,t=L.length;e<t;e++){const t=L[e];z=_[e];for(let e=0,s=t.length;e<s;e++){const s=T(t[e],z[e],i);P(s.x,s.y,-n)}}}const W=d+u;for(let e=0;e<R;e++){const t=c?T(M[e],E[e],W):M[e];w?(v.copy(y.normals[0]).multiplyScalar(t.x),b.copy(y.binormals[0]).multiplyScalar(t.y),x.copy(g[0]).add(v).add(b),P(x.x,x.y,x.z)):P(t.x,t.y,0)}for(let e=1;e<=o;e++)for(let t=0;t<R;t++){const n=c?T(M[t],E[t],W):M[t];w?(v.copy(y.normals[e]).multiplyScalar(n.x),b.copy(y.binormals[e]).multiplyScalar(n.y),x.copy(g[e]).add(v).add(b),P(x.x,x.y,x.z)):P(n.x,n.y,l/o*e)}for(let e=p-1;e>=0;e--){const t=e/p,n=h*Math.cos(t*Math.PI/2),i=d*Math.sin(t*Math.PI/2)+u;for(let e=0,t=G.length;e<t;e++){const t=T(G[e],I[e],i);P(t.x,t.y,l+n)}for(let e=0,t=L.length;e<t;e++){const t=L[e];z=_[e];for(let e=0,s=t.length;e<s;e++){const s=T(t[e],z[e],i);w?P(s.x,s.y+g[o-1].y,g[o-1].x+n):P(s.x,s.y,l+n)}}}function Z(e,t){let n=e.length;for(;--n>=0;){const i=n;let s=n-1;s<0&&(s=e.length-1);for(let e=0,n=o+2*p;e<n;e++){const n=R*e,r=R*(e+1);V(t+i+n,t+s+n,t+s+r,t+i+r)}}}function P(e,t,n){r.push(e),r.push(t),r.push(n)}function N(e,t,s){H(e),H(t),H(s);const r=i.length/3,a=f.generateTopUV(n,i,r-3,r-2,r-1);D(a[0]),D(a[1]),D(a[2])}function V(e,t,s,r){H(e),H(t),H(r),H(t),H(s),H(r);const a=i.length/3,o=f.generateSideWallUV(n,i,a-6,a-3,a-2,a-1);D(o[0]),D(o[1]),D(o[3]),D(o[1]),D(o[2]),D(o[3])}function H(e){i.push(r[3*e+0]),i.push(r[3*e+1]),i.push(r[3*e+2])}function D(e){s.push(e.x),s.push(e.y)}!function(){const e=i.length/3;if(c){let e=0,t=R*e;for(let e=0;e<A;e++){const n=C[e];N(n[2]+t,n[1]+t,n[0]+t)}e=o+2*p,t=R*e;for(let e=0;e<A;e++){const n=C[e];N(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<A;e++){const t=C[e];N(t[2],t[1],t[0])}for(let e=0;e<A;e++){const t=C[e];N(t[0]+R*o,t[1]+R*o,t[2]+R*o)}}n.addGroup(e,i.length/3-e,0)}(),function(){const e=i.length/3;let t=0;Z(G,t),t+=G.length;for(let e=0,n=L.length;e<n;e++){const n=L[e];Z(n,t),t+=n.length}n.addGroup(e,i.length/3-e,1)}()}this.setAttribute("position",new li(i,3)),this.setAttribute("uv",new li(s,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,i=e.length;t<i;t++){const i=e[t];n.shapes.push(i.uuid)}else n.shapes.push(e.uuid);n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let i=0,s=e.shapes.length;i<s;i++){const s=t[e.shapes[i]];n.push(s)}const i=e.options.extrudePath;return void 0!==i&&(e.options.extrudePath=(new pl[i.type]).fromJSON(i)),new sc(n,e.options)}}const rc={generateTopUV:function(e,t,n,i,s){const r=t[3*n],a=t[3*n+1],o=t[3*i],l=t[3*i+1],c=t[3*s],h=t[3*s+1];return[new nt(r,a),new nt(o,l),new nt(c,h)]},generateSideWallUV:function(e,t,n,i,s,r){const a=t[3*n],o=t[3*n+1],l=t[3*n+2],c=t[3*i],h=t[3*i+1],d=t[3*i+2],u=t[3*s],p=t[3*s+1],m=t[3*s+2],f=t[3*r],g=t[3*r+1],y=t[3*r+2];return Math.abs(o-h)<Math.abs(a-c)?[new nt(a,1-l),new nt(c,1-d),new nt(u,1-m),new nt(f,1-y)]:[new nt(o,1-l),new nt(h,1-d),new nt(p,1-m),new nt(g,1-y)]}};class ac extends wl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=(1+Math.sqrt(5))/2;super([-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],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ac(e.radius,e.detail)}}class oc extends wl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new oc(e.radius,e.detail)}}class lc extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:s,thetaLength:r},n=Math.max(3,n),i=Math.max(1,i);const a=[],o=[],l=[],c=[];let h=e;const d=(t-e)/i,u=new zt,p=new nt;for(let e=0;e<=i;e++){for(let e=0;e<=n;e++){const i=s+e/n*r;u.x=h*Math.cos(i),u.y=h*Math.sin(i),o.push(u.x,u.y,u.z),l.push(0,0,1),p.x=(u.x/t+1)/2,p.y=(u.y/t+1)/2,c.push(p.x,p.y)}h+=d}for(let e=0;e<i;e++){const t=e*(n+1);for(let e=0;e<n;e++){const i=e+t,s=i,r=i+n+1,o=i+n+2,l=i+1;a.push(s,r,l),a.push(r,o,l)}}this.setIndex(a),this.setAttribute("position",new li(o,3)),this.setAttribute("normal",new li(l,3)),this.setAttribute("uv",new li(c,2))}static fromJSON(e){return new lc(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class cc extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Rl([new nt(0,.5),new nt(-.5,-.5),new nt(.5,-.5)]),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],i=[],s=[],r=[];let a=0,o=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(a,o,t),a+=o,o=0;function l(e){const a=i.length/3,l=e.extractPoints(t);let c=l.shape;const h=l.holes;!1===tc.isClockWise(c)&&(c=c.reverse());for(let e=0,t=h.length;e<t;e++){const t=h[e];!0===tc.isClockWise(t)&&(h[e]=t.reverse())}const d=tc.triangulateShape(c,h);for(let e=0,t=h.length;e<t;e++){const t=h[e];c=c.concat(t)}for(let e=0,t=c.length;e<t;e++){const t=c[e];i.push(t.x,t.y,0),s.push(0,0,1),r.push(t.x,t.y)}for(let e=0,t=d.length;e<t;e++){const t=d[e],i=t[0]+a,s=t[1]+a,r=t[2]+a;n.push(i,s,r),o+=3}}this.setIndex(n),this.setAttribute("position",new li(i,3)),this.setAttribute("normal",new li(s,3)),this.setAttribute("uv",new li(r,2))}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,i=e.length;n<i;n++){const i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let i=0,s=e.shapes.length;i<s;i++){const s=t[e.shapes[i]];n.push(s)}return new cc(n,e.curveSegments)}}class hc extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:s,thetaStart:r,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const o=Math.min(r+a,Math.PI);let l=0;const c=[],h=new zt,d=new zt,u=[],p=[],m=[],f=[];for(let u=0;u<=n;u++){const g=[],y=u/n;let b=0;0==u&&0==r?b=.5/t:u==n&&o==Math.PI&&(b=-.5/t);for(let n=0;n<=t;n++){const o=n/t;h.x=-e*Math.cos(i+o*s)*Math.sin(r+y*a),h.y=e*Math.cos(r+y*a),h.z=e*Math.sin(i+o*s)*Math.sin(r+y*a),p.push(h.x,h.y,h.z),d.copy(h).normalize(),m.push(d.x,d.y,d.z),f.push(o+b,1-y),g.push(l++)}c.push(g)}for(let e=0;e<n;e++)for(let i=0;i<t;i++){const t=c[e][i+1],s=c[e][i],a=c[e+1][i],l=c[e+1][i+1];(0!==e||r>0)&&u.push(t,s,l),(e!==n-1||o<Math.PI)&&u.push(s,a,l)}this.setIndex(u),this.setAttribute("position",new li(p,3)),this.setAttribute("normal",new li(m,3)),this.setAttribute("uv",new li(f,2))}static fromJSON(e){return new hc(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class dc extends wl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new dc(e.radius,e.detail)}}class uc extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:s},n=Math.floor(n),i=Math.floor(i);const r=[],a=[],o=[],l=[],c=new zt,h=new zt,d=new zt;for(let r=0;r<=n;r++)for(let u=0;u<=i;u++){const p=u/i*s,m=r/n*Math.PI*2;h.x=(e+t*Math.cos(m))*Math.cos(p),h.y=(e+t*Math.cos(m))*Math.sin(p),h.z=t*Math.sin(m),a.push(h.x,h.y,h.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),d.subVectors(h,c).normalize(),o.push(d.x,d.y,d.z),l.push(u/i),l.push(r/n)}for(let e=1;e<=n;e++)for(let t=1;t<=i;t++){const n=(i+1)*e+t-1,s=(i+1)*(e-1)+t-1,a=(i+1)*(e-1)+t,o=(i+1)*e+t;r.push(n,s,o),r.push(s,a,o)}this.setIndex(r),this.setAttribute("position",new li(a,3)),this.setAttribute("normal",new li(o,3)),this.setAttribute("uv",new li(l,2))}static fromJSON(e){return new uc(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class pc extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:s,q:r},n=Math.floor(n),i=Math.floor(i);const a=[],o=[],l=[],c=[],h=new zt,d=new zt,u=new zt,p=new zt,m=new zt,f=new zt,g=new zt;for(let a=0;a<=n;++a){const b=a/n*s*Math.PI*2;y(b,s,r,e,u),y(b+.01,s,r,e,p),f.subVectors(p,u),g.addVectors(p,u),m.crossVectors(f,g),g.crossVectors(m,f),m.normalize(),g.normalize();for(let e=0;e<=i;++e){const s=e/i*Math.PI*2,r=-t*Math.cos(s),p=t*Math.sin(s);h.x=u.x+(r*g.x+p*m.x),h.y=u.y+(r*g.y+p*m.y),h.z=u.z+(r*g.z+p*m.z),o.push(h.x,h.y,h.z),d.subVectors(h,u).normalize(),l.push(d.x,d.y,d.z),c.push(a/n),c.push(e/i)}}for(let e=1;e<=n;e++)for(let t=1;t<=i;t++){const n=(i+1)*(e-1)+(t-1),s=(i+1)*e+(t-1),r=(i+1)*e+t,o=(i+1)*(e-1)+t;a.push(n,s,o),a.push(s,r,o)}function y(e,t,n,i,s){const r=Math.cos(e),a=Math.sin(e),o=n/t*e,l=Math.cos(o);s.x=i*(2+l)*.5*r,s.y=i*(2+l)*a*.5,s.z=i*Math.sin(o)*.5}this.setIndex(a),this.setAttribute("position",new li(o,3)),this.setAttribute("normal",new li(l,3)),this.setAttribute("uv",new li(c,2))}static fromJSON(e){return new pc(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class mc extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new dl(new zt(-1,-1,0),new zt(-1,1,0),new zt(1,1,0)),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:s};const r=e.computeFrenetFrames(t,s);this.tangents=r.tangents,this.normals=r.normals,this.binormals=r.binormals;const a=new zt,o=new zt,l=new nt;let c=new zt;const h=[],d=[],u=[],p=[];function m(s){c=e.getPointAt(s/t,c);const l=r.normals[s],u=r.binormals[s];for(let e=0;e<=i;e++){const t=e/i*Math.PI*2,s=Math.sin(t),r=-Math.cos(t);o.x=r*l.x+s*u.x,o.y=r*l.y+s*u.y,o.z=r*l.z+s*u.z,o.normalize(),d.push(o.x,o.y,o.z),a.x=c.x+n*o.x,a.y=c.y+n*o.y,a.z=c.z+n*o.z,h.push(a.x,a.y,a.z)}}!function(){for(let e=0;e<t;e++)m(e);m(!1===s?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=i;n++)l.x=e/t,l.y=n/i,u.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=i;t++){const n=(i+1)*(e-1)+(t-1),s=(i+1)*e+(t-1),r=(i+1)*e+t,a=(i+1)*(e-1)+t;p.push(n,s,a),p.push(s,r,a)}}()}(),this.setIndex(p),this.setAttribute("position",new li(h,3)),this.setAttribute("normal",new li(d,3)),this.setAttribute("uv",new li(u,2))}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new mc((new pl[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class fc extends yi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,i=new zt,s=new zt;if(null!==e.index){const r=e.attributes.position,a=e.index;let o=e.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){const l=o[e],c=l.start;for(let e=c,o=c+l.count;e<o;e+=3)for(let o=0;o<3;o++){const l=a.getX(e+o),c=a.getX(e+(o+1)%3);i.fromBufferAttribute(r,l),s.fromBufferAttribute(r,c),!0===gc(i,s,n)&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}}else{const r=e.attributes.position;for(let e=0,a=r.count/3;e<a;e++)for(let a=0;a<3;a++){const o=3*e+a,l=3*e+(a+1)%3;i.fromBufferAttribute(r,o),s.fromBufferAttribute(r,l),!0===gc(i,s,n)&&(t.push(i.x,i.y,i.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new li(t,3))}}}function gc(e,t,n){const i=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,s=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(i)&&!0!==n.has(s)&&(n.add(i),n.add(s),!0)}var yc=Object.freeze({__proto__:null,BoxGeometry:Pi,BoxBufferGeometry:Pi,CapsuleGeometry:yl,CapsuleBufferGeometry:yl,CircleGeometry:bl,CircleBufferGeometry:bl,ConeGeometry:xl,ConeBufferGeometry:xl,CylinderGeometry:vl,CylinderBufferGeometry:vl,DodecahedronGeometry:Sl,DodecahedronBufferGeometry:Sl,EdgesGeometry:Tl,ExtrudeGeometry:sc,ExtrudeBufferGeometry:sc,IcosahedronGeometry:ac,IcosahedronBufferGeometry:ac,LatheGeometry:gl,LatheBufferGeometry:gl,OctahedronGeometry:oc,OctahedronBufferGeometry:oc,PlaneGeometry:is,PlaneBufferGeometry:is,PolyhedronGeometry:wl,PolyhedronBufferGeometry:wl,RingGeometry:lc,RingBufferGeometry:lc,ShapeGeometry:cc,ShapeBufferGeometry:cc,SphereGeometry:hc,SphereBufferGeometry:hc,TetrahedronGeometry:dc,TetrahedronBufferGeometry:dc,TorusGeometry:uc,TorusBufferGeometry:uc,TorusKnotGeometry:pc,TorusKnotBufferGeometry:pc,TubeGeometry:mc,TubeBufferGeometry:mc,WireframeGeometry:fc});class bc extends jn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new bt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class vc extends Di{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class xc extends jn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new bt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new nt(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.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class wc extends xc{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new nt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return je(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new bt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new bt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new bt(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._iridescence=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class Sc extends jn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new bt(16777215),this.specular=new bt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Mc extends jn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new bt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class Lc extends jn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class Cc extends jn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new bt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new bt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class Gc extends jn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new bt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new nt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Tc extends Go{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}const Rc={arraySlice:function(e,t,n){return Rc.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){const t=e.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){const i=e.length,s=new e.constructor(i);for(let r=0,a=0;a!==i;++r){const i=n[r]*t;for(let n=0;n!==t;++n)s[a++]=e[i+n]}return s},flattenJSON:function(e,t,n,i){let s=1,r=e[0];for(;void 0!==r&&void 0===r[i];)r=e[s++];if(void 0===r)return;let a=r[i];if(void 0!==a)if(Array.isArray(a))do{a=r[i],void 0!==a&&(t.push(r.time),n.push.apply(n,a)),r=e[s++]}while(void 0!==r);else if(void 0!==a.toArray)do{a=r[i],void 0!==a&&(t.push(r.time),a.toArray(n,n.length)),r=e[s++]}while(void 0!==r);else do{a=r[i],void 0!==a&&(t.push(r.time),n.push(a)),r=e[s++]}while(void 0!==r)},subclip:function(e,t,n,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:30;const r=e.clone();r.name=t;const a=[];for(let e=0;e<r.tracks.length;++e){const t=r.tracks[e],o=t.getValueSize(),l=[],c=[];for(let e=0;e<t.times.length;++e){const r=t.times[e]*s;if(!(r<n||r>=i)){l.push(t.times[e]);for(let n=0;n<o;++n)c.push(t.values[e*o+n])}}0!==l.length&&(t.times=Rc.convertArray(l,t.times.constructor),t.values=Rc.convertArray(c,t.values.constructor),a.push(t))}r.tracks=a;let o=1/0;for(let e=0;e<r.tracks.length;++e)o>r.tracks[e].times[0]&&(o=r.tracks[e].times[0]);for(let e=0;e<r.tracks.length;++e)r.tracks[e].shift(-1*o);return r.resetDuration(),r},makeClipAdditive:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;i<=0&&(i=30);const s=n.tracks.length,r=t/i;for(let t=0;t<s;++t){const i=n.tracks[t],s=i.ValueTypeName;if("bool"===s||"string"===s)continue;const a=e.tracks.find((function(e){return e.name===i.name&&e.ValueTypeName===s}));if(void 0===a)continue;let o=0;const l=i.getValueSize();i.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(o=l/3);let c=0;const h=a.getValueSize();a.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=h/3);const d=i.times.length-1;let u;if(r<=i.times[0]){const e=o,t=l-o;u=Rc.arraySlice(i.values,e,t)}else if(r>=i.times[d]){const e=d*l+o,t=e+l-o;u=Rc.arraySlice(i.values,e,t)}else{const e=i.createInterpolant(),t=o,n=l-o;e.evaluate(r),u=Rc.arraySlice(e.resultBuffer,t,n)}if("quaternion"===s){(new _t).fromArray(u).normalize().conjugate().toArray(u)}const p=a.times.length;for(let e=0;e<p;++e){const t=e*h+c;if("quaternion"===s)_t.multiplyQuaternionsFlat(a.values,t,u,0,a.values,t);else{const e=h-2*c;for(let n=0;n<e;++n)a.values[t+n]-=u[n]}}}return e.blendMode=_e,e}};class Ac{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],s=t[n-1];e:{t:{let r;n:{i:if(!(e<i)){for(let r=n+2;;){if(void 0===i){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===r)break;if(s=i,i=t[++n],e<i)break t}r=t.length;break n}if(e>=s)break e;{const a=t[1];e<a&&(n=2,s=a);for(let r=n-2;;){if(void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(n===r)break;if(i=s,s=t[--n-1],e>=s)break t}r=n,n=0}}for(;n<r;){const i=n+r>>>1;e<t[i]?r=i:n=i+1}if(i=t[n],s=t[n-1],void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===i)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let e=0;e!==i;++e)t[e]=n[s+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Xc extends Ac{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Re,endingEnd:Re}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,r=e+1,a=i[s],o=i[r];if(void 0===a)switch(this.getSettings_().endingStart){case Ae:s=e,a=2*t-n;break;case Xe:s=i.length-2,a=t+i[s]-i[s+1];break;default:s=e,a=n}if(void 0===o)switch(this.getSettings_().endingEnd){case Ae:r=e,o=2*n-t;break;case Xe:r=1,o=n+i[1]-i[0];break;default:r=e-1,o=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-a),this._weightNext=l/(o-n),this._offsetPrev=s*c,this._offsetNext=r*c}interpolate_(e,t,n,i){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,c=this._offsetPrev,h=this._offsetNext,d=this._weightPrev,u=this._weightNext,p=(n-t)/(i-t),m=p*p,f=m*p,g=-d*f+2*d*m-d*p,y=(1+d)*f+(-1.5-2*d)*m+(-.5+d)*p+1,b=(-1-u)*f+(1.5+u)*m+.5*p,v=u*f-u*m;for(let e=0;e!==a;++e)s[e]=g*r[c+e]+y*r[l+e]+b*r[o+e]+v*r[h+e];return s}}class Ic extends Ac{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=e*a,l=o-a,c=(n-t)/(i-t),h=1-c;for(let e=0;e!==a;++e)s[e]=r[l+e]*h+r[o+e]*c;return s}}class _c extends Ac{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class zc{constructor(e,t,n,i){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Rc.convertArray(t,this.TimeBufferType),this.values=Rc.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Rc.convertArray(e.times,Array),values:Rc.convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new _c(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Ic(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Xc(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Ce:t=this.InterpolantFactoryMethodDiscrete;break;case Ge:t=this.InterpolantFactoryMethodLinear;break;case Te:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ce;case this.InterpolantFactoryMethodLinear:return Ge;case this.InterpolantFactoryMethodSmooth:return Te}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let s=0,r=i-1;for(;s!==i&&n[s]<e;)++s;for(;-1!==r&&n[r]>t;)--r;if(++r,0!==s||r!==i){s>=r&&(r=Math.max(r,1),s=r-1);const e=this.getValueSize();this.times=Rc.arraySlice(n,s,r),this.values=Rc.arraySlice(this.values,s*e,r*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;0===s&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let t=0;t!==s;t++){const i=n[t];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,i),e=!1;break}if(null!==r&&r>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,i,r),e=!1;break}r=i}if(void 0!==i&&Rc.isTypedArray(i))for(let t=0,n=i.length;t!==n;++t){const n=i[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=Rc.arraySlice(this.times),t=Rc.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Te,s=e.length-1;let r=1;for(let a=1;a<s;++a){let s=!1;const o=e[a];if(o!==e[a+1]&&(1!==a||o!==e[0]))if(i)s=!0;else{const e=a*n,i=e-n,r=e+n;for(let a=0;a!==n;++a){const n=t[e+a];if(n!==t[i+a]||n!==t[r+a]){s=!0;break}}}if(s){if(a!==r){e[r]=e[a];const i=a*n,s=r*n;for(let e=0;e!==n;++e)t[s+e]=t[i+e]}++r}}if(s>0){e[r]=e[s];for(let e=s*n,i=r*n,a=0;a!==n;++a)t[i+a]=t[e+a];++r}return r!==e.length?(this.times=Rc.arraySlice(e,0,r),this.values=Rc.arraySlice(t,0,r*n)):(this.times=e,this.values=t),this}clone(){const e=Rc.arraySlice(this.times,0),t=Rc.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}zc.prototype.TimeBufferType=Float32Array,zc.prototype.ValueBufferType=Float32Array,zc.prototype.DefaultInterpolation=Ge;class Ec extends zc{}Ec.prototype.ValueTypeName="bool",Ec.prototype.ValueBufferType=Array,Ec.prototype.DefaultInterpolation=Ce,Ec.prototype.InterpolantFactoryMethodLinear=void 0,Ec.prototype.InterpolantFactoryMethodSmooth=void 0;class Wc extends zc{}Wc.prototype.ValueTypeName="color";class Zc extends zc{}Zc.prototype.ValueTypeName="number";class Pc extends Ac{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=(n-t)/(i-t);let l=e*a;for(let e=l+a;l!==e;l+=4)_t.slerpFlat(s,0,r,l-a,r,l,o);return s}}class Nc extends zc{InterpolantFactoryMethodLinear(e){return new Pc(this.times,this.values,this.getValueSize(),e)}}Nc.prototype.ValueTypeName="quaternion",Nc.prototype.DefaultInterpolation=Ge,Nc.prototype.InterpolantFactoryMethodSmooth=void 0;class Vc extends zc{}Vc.prototype.ValueTypeName="string",Vc.prototype.ValueBufferType=Array,Vc.prototype.DefaultInterpolation=Ce,Vc.prototype.InterpolantFactoryMethodLinear=void 0,Vc.prototype.InterpolantFactoryMethodSmooth=void 0;class Hc extends zc{}Hc.prototype.ValueTypeName="vector";class Dc{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ie;this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ke(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let e=0,s=n.length;e!==s;++e)t.push(kc(n[e]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,i=n.length;e!==i;++e)t.push(zc.toJSON(n[e]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,r=[];for(let e=0;e<s;e++){let a=[],o=[];a.push((e+s-1)%s,e,(e+1)%s),o.push(0,1,0);const l=Rc.getKeyframeOrder(a);a=Rc.sortedArray(a,1,l),o=Rc.sortedArray(o,1,l),i||0!==a[0]||(a.push(s),o.push(o[0])),r.push(new Zc(".morphTargetInfluences["+t[e].name+"]",a,o).scale(1/n))}return new this(e,-1,r)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},s=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.name.match(s);if(r&&r.length>1){const e=r[1];let t=i[e];t||(i[e]=t=[]),t.push(n)}}const r=[];for(const e in i)r.push(this.CreateFromMorphTargetSequence(e,i[e],t,n));return r}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,i,s){if(0!==n.length){const r=[],a=[];Rc.flattenJSON(n,r,a,i),0!==r.length&&s.push(new e(t,r,a))}},i=[],s=e.name||"default",r=e.fps||30,a=e.blendMode;let o=e.length||-1;const l=e.hierarchy||[];for(let e=0;e<l.length;e++){const s=l[e].keys;if(s&&0!==s.length)if(s[0].morphTargets){const e={};let t;for(t=0;t<s.length;t++)if(s[t].morphTargets)for(let n=0;n<s[t].morphTargets.length;n++)e[s[t].morphTargets[n]]=-1;for(const n in e){const e=[],r=[];for(let i=0;i!==s[t].morphTargets.length;++i){const i=s[t];e.push(i.time),r.push(i.morphTarget===n?1:0)}i.push(new Zc(".morphTargetInfluence["+n+"]",e,r))}o=e.length*r}else{const r=".bones["+t[e].name+"]";n(Hc,r+".position",s,"pos",i),n(Nc,r+".quaternion",s,"rot",i),n(Hc,r+".scale",s,"scl",i)}}if(0===i.length)return null;return new this(s,o,i,a)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function kc(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Zc;case"vector":case"vector2":case"vector3":case"vector4":return Hc;case"color":return Wc;case"quaternion":return Nc;case"bool":case"boolean":return Ec;case"string":return Vc}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];Rc.flattenJSON(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Bc={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class Fc{constructor(e,t,n){const i=this;let s,r=!1,a=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===r&&void 0!==i.onStart&&i.onStart(e,a,o),r=!0},this.itemEnd=function(e){a++,void 0!==i.onProgress&&i.onProgress(e,a,o),a===o&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],i=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return i}return null}}}const Uc=new Fc;class Oc{constructor(e){this.manager=void 0!==e?e:Uc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(i,s){n.load(e,i,t,s)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const Yc={};class Kc extends Oc{constructor(e){super(e)}load(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const s=Bc.get(e);if(void 0!==s)return this.manager.itemStart(e),setTimeout((()=>{t&&t(s),this.manager.itemEnd(e)}),0),s;if(void 0!==Yc[e])return void Yc[e].push({onLoad:t,onProgress:n,onError:i});Yc[e]=[],Yc[e].push({onLoad:t,onProgress:n,onError:i});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,o=this.responseType;fetch(r).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=Yc[e],i=t.body.getReader(),s=t.headers.get("Content-Length"),r=s?parseInt(s):0,a=0!==r;let o=0;const l=new ReadableStream({start(e){!function t(){i.read().then((i=>{let{done:s,value:l}=i;if(s)e.close();else{o+=l.byteLength;const i=new ProgressEvent("progress",{lengthComputable:a,loaded:o,total:r});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(i)}e.enqueue(l),t()}}))}()}});return new Response(l)}throw Error(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`)})).then((e=>{switch(o){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,a)));case"json":return e.json();default:if(void 0===a)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(a),n=t&&t[1]?t[1].toLowerCase():void 0,i=new TextDecoder(n);return e.arrayBuffer().then((e=>i.decode(e)))}}})).then((t=>{Bc.add(e,t);const n=Yc[e];delete Yc[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];i.onLoad&&i.onLoad(t)}})).catch((t=>{const n=Yc[e];if(void 0===n)throw this.manager.itemError(e),t;delete Yc[e];for(let e=0,i=n.length;e<i;e++){const i=n[e];i.onError&&i.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class jc extends Oc{constructor(e){super(e)}load(e,t,n,i){const s=this,r=new Kc(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,(function(n){try{t(s.parse(JSON.parse(n)))}catch(t){i?i(t):console.error(t),s.manager.itemError(e)}}),n,i)}parse(e){const t=[];for(let n=0;n<e.length;n++){const i=Dc.parse(e[n]);t.push(i)}return t}}class Jc extends Oc{constructor(e){super(e)}load(e,t,n,i){const s=this,r=[],a=new Oo,o=new Kc(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(s.withCredentials);let l=0;function c(c){o.load(e[c],(function(e){const n=s.parse(e,!0);r[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(a.minFilter=M),a.image=r,a.format=n.format,a.needsUpdate=!0,t&&t(a))}),n,i)}if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)c(t);else o.load(e,(function(e){const n=s.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){r[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)r[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),r[t].format=n.format,r[t].width=n.width,r[t].height=n.height}a.image=r}else a.image.width=n.width,a.image.height=n.height,a.mipmaps=n.mipmaps;1===n.mipmapCount&&(a.minFilter=M),a.format=n.format,a.needsUpdate=!0,t&&t(a)}),n,i);return a}}class Qc extends Oc{constructor(e){super(e)}load(e,t,n,i){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,r=Bc.get(e);if(void 0!==r)return s.manager.itemStart(e),setTimeout((function(){t&&t(r),s.manager.itemEnd(e)}),0),r;const a=ot("img");function o(){c(),Bc.add(e,this),t&&t(this),s.manager.itemEnd(e)}function l(t){c(),i&&i(t),s.manager.itemError(e),s.manager.itemEnd(e)}function c(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(e),a.src=e,a}}class qc extends Oc{constructor(e){super(e)}load(e,t,n,i){const s=new Oi,r=new Qc(this.manager);r.setCrossOrigin(this.crossOrigin),r.setPath(this.path);let a=0;function o(n){r.load(e[n],(function(e){s.images[n]=e,a++,6===a&&(s.needsUpdate=!0,t&&t(s))}),void 0,i)}for(let t=0;t<e.length;++t)o(t);return s}}class $c extends Oc{constructor(e){super(e)}load(e,t,n,i){const s=this,r=new go,a=new Kc(this.manager);return a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setPath(this.path),a.setWithCredentials(s.withCredentials),a.load(e,(function(e){const n=s.parse(e);n&&(void 0!==n.image?r.image=n.image:void 0!==n.data&&(r.image.width=n.width,r.image.height=n.height,r.image.data=n.data),r.wrapS=void 0!==n.wrapS?n.wrapS:b,r.wrapT=void 0!==n.wrapT?n.wrapT:b,r.magFilter=void 0!==n.magFilter?n.magFilter:M,r.minFilter=void 0!==n.minFilter?n.minFilter:M,r.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.encoding&&(r.encoding=n.encoding),void 0!==n.flipY&&(r.flipY=n.flipY),void 0!==n.format&&(r.format=n.format),void 0!==n.type&&(r.type=n.type),void 0!==n.mipmaps&&(r.mipmaps=n.mipmaps,r.minFilter=C),1===n.mipmapCount&&(r.minFilter=M),void 0!==n.generateMipmaps&&(r.generateMipmaps=n.generateMipmaps),r.needsUpdate=!0,t&&t(r,n))}),n,i),r}}class eh extends Oc{constructor(e){super(e)}load(e,t,n,i){const s=new Lt,r=new Qc(this.manager);return r.setCrossOrigin(this.crossOrigin),r.setPath(this.path),r.load(e,(function(e){s.image=e,s.needsUpdate=!0,void 0!==t&&t(s)}),n,i),s}}class th extends Zn{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;super(),this.isLight=!0,this.type="Light",this.color=new bt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}class nh extends th{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Zn.DefaultUp),this.updateMatrix(),this.groundColor=new bt(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const ih=new dn,sh=new zt,rh=new zt;class ah{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new nt(512,512),this.map=null,this.mapPass=null,this.matrix=new dn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new es,this._frameExtents=new nt(1,1),this._viewportCount=1,this._viewports=[new Ct(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;sh.setFromMatrixPosition(e.matrixWorld),t.position.copy(sh),rh.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(rh),t.updateMatrixWorld(),ih.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ih),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class oh extends ah{constructor(){super(new Bi(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=2*Ye*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;n===t.fov&&i===t.aspect&&s===t.far||(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class lh extends th{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Zn.DefaultUp),this.updateMatrix(),this.target=new Zn,this.distance=n,this.angle=i,this.penumbra=s,this.decay=r,this.shadow=new oh}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const ch=new dn,hh=new zt,dh=new zt;class uh extends ah{constructor(){super(new Bi(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new nt(4,2),this._viewportCount=6,this._viewports=[new Ct(2,1,1,1),new Ct(0,1,1,1),new Ct(3,1,1,1),new Ct(1,1,1,1),new Ct(3,0,1,1),new Ct(1,0,1,1)],this._cubeDirections=[new zt(1,0,0),new zt(-1,0,0),new zt(0,0,1),new zt(0,0,-1),new zt(0,1,0),new zt(0,-1,0)],this._cubeUps=[new zt(0,1,0),new zt(0,1,0),new zt(0,1,0),new zt(0,1,0),new zt(0,0,1),new zt(0,0,-1)]}updateMatrices(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),hh.setFromMatrixPosition(e.matrixWorld),n.position.copy(hh),dh.copy(n.position),dh.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(dh),n.updateMatrixWorld(),i.makeTranslation(-hh.x,-hh.y,-hh.z),ch.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ch)}}class ph extends th{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new uh}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class mh extends ah{constructor(){super(new ps(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class fh extends th{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Zn.DefaultUp),this.updateMatrix(),this.target=new Zn,this.shadow=new mh}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class gh extends th{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class yh extends th{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=i}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class bh{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new zt)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,i=e.y,s=e.z,r=this.coefficients;return t.copy(r[0]).multiplyScalar(.282095),t.addScaledVector(r[1],.488603*i),t.addScaledVector(r[2],.488603*s),t.addScaledVector(r[3],.488603*n),t.addScaledVector(r[4],n*i*1.092548),t.addScaledVector(r[5],i*s*1.092548),t.addScaledVector(r[6],.315392*(3*s*s-1)),t.addScaledVector(r[7],n*s*1.092548),t.addScaledVector(r[8],.546274*(n*n-i*i)),t}getIrradianceAt(e,t){const n=e.x,i=e.y,s=e.z,r=this.coefficients;return t.copy(r[0]).multiplyScalar(.886227),t.addScaledVector(r[1],1.023328*i),t.addScaledVector(r[2],1.023328*s),t.addScaledVector(r[3],1.023328*n),t.addScaledVector(r[4],.858086*n*i),t.addScaledVector(r[5],.858086*i*s),t.addScaledVector(r[6],.743125*s*s-.247708),t.addScaledVector(r[7],.858086*n*s),t.addScaledVector(r[8],.429043*(n*n-i*i)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(e,t+3*i);return this}toArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(e,t+3*i);return e}static getBasisAt(e,t){const n=e.x,i=e.y,s=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*s,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*n*s,t[8]=.546274*(n*n-i*i)}}class vh extends th{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bh;super(void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class xh extends Oc{constructor(e){super(e),this.textures={}}load(e,t,n,i){const s=this,r=new Kc(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(e,(function(n){try{t(s.parse(JSON.parse(n)))}catch(t){i?i(t):console.error(t),s.manager.itemError(e)}}),n,i)}parse(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const i=xh.createMaterialFromType(e.type);if(void 0!==e.uuid&&(i.uuid=e.uuid),void 0!==e.name&&(i.name=e.name),void 0!==e.color&&void 0!==i.color&&i.color.setHex(e.color),void 0!==e.roughness&&(i.roughness=e.roughness),void 0!==e.metalness&&(i.metalness=e.metalness),void 0!==e.sheen&&(i.sheen=e.sheen),void 0!==e.sheenColor&&(i.sheenColor=(new bt).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(i.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==i.emissive&&i.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==i.specular&&i.specular.setHex(e.specular),void 0!==e.specularIntensity&&(i.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==i.specularColor&&i.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(i.shininess=e.shininess),void 0!==e.clearcoat&&(i.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(i.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.iridescence&&(i.iridescence=e.iridescence),void 0!==e.iridescenceIOR&&(i.iridescenceIOR=e.iridescenceIOR),void 0!==e.iridescenceThicknessRange&&(i.iridescenceThicknessRange=e.iridescenceThicknessRange),void 0!==e.transmission&&(i.transmission=e.transmission),void 0!==e.thickness&&(i.thickness=e.thickness),void 0!==e.attenuationDistance&&(i.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==i.attenuationColor&&i.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(i.fog=e.fog),void 0!==e.flatShading&&(i.flatShading=e.flatShading),void 0!==e.blending&&(i.blending=e.blending),void 0!==e.combine&&(i.combine=e.combine),void 0!==e.side&&(i.side=e.side),void 0!==e.shadowSide&&(i.shadowSide=e.shadowSide),void 0!==e.opacity&&(i.opacity=e.opacity),void 0!==e.transparent&&(i.transparent=e.transparent),void 0!==e.alphaTest&&(i.alphaTest=e.alphaTest),void 0!==e.depthTest&&(i.depthTest=e.depthTest),void 0!==e.depthWrite&&(i.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(i.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(i.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(i.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(i.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(i.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(i.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(i.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(i.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(i.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(i.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(i.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(i.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(i.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(i.rotation=e.rotation),1!==e.linewidth&&(i.linewidth=e.linewidth),void 0!==e.dashSize&&(i.dashSize=e.dashSize),void 0!==e.gapSize&&(i.gapSize=e.gapSize),void 0!==e.scale&&(i.scale=e.scale),void 0!==e.polygonOffset&&(i.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(i.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(i.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(i.dithering=e.dithering),void 0!==e.alphaToCoverage&&(i.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(i.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.toneMapped&&(i.toneMapped=e.toneMapped),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?i.vertexColors=e.vertexColors>0:i.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const s=e.uniforms[t];switch(i.uniforms[t]={},s.type){case"t":i.uniforms[t].value=n(s.value);break;case"c":i.uniforms[t].value=(new bt).setHex(s.value);break;case"v2":i.uniforms[t].value=(new nt).fromArray(s.value);break;case"v3":i.uniforms[t].value=(new zt).fromArray(s.value);break;case"v4":i.uniforms[t].value=(new Ct).fromArray(s.value);break;case"m3":i.uniforms[t].value=(new it).fromArray(s.value);break;case"m4":i.uniforms[t].value=(new dn).fromArray(s.value);break;default:i.uniforms[t].value=s.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)i.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(i.flatShading=1===e.shading),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=n(e.map)),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),i.normalScale=(new nt).fromArray(t)}return void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(i.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(i.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(i.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=(new nt).fromArray(e.clearcoatNormalScale)),void 0!==e.iridescenceMap&&(i.iridescenceMap=n(e.iridescenceMap)),void 0!==e.iridescenceThicknessMap&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),void 0!==e.transmissionMap&&(i.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(i.thicknessMap=n(e.thicknessMap)),void 0!==e.sheenColorMap&&(i.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){return new{ShadowMaterial:bc,SpriteMaterial:Ba,RawShaderMaterial:vc,ShaderMaterial:Di,PointsMaterial:Po,MeshPhysicalMaterial:wc,MeshStandardMaterial:xc,MeshPhongMaterial:Sc,MeshToonMaterial:Mc,MeshNormalMaterial:Lc,MeshLambertMaterial:Cc,MeshDepthMaterial:wa,MeshDistanceMaterial:Sa,MeshBasicMaterial:Jn,MeshMatcapMaterial:Gc,LineDashedMaterial:Tc,LineBasicMaterial:Go,Material:jn}[e]}}class wh{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class Sh extends yi{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class Mh extends Oc{constructor(e){super(e)}load(e,t,n,i){const s=this,r=new Kc(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(e,(function(n){try{t(s.parse(JSON.parse(n)))}catch(t){i?i(t):console.error(t),s.manager.itemError(e)}}),n,i)}parse(e){const t={},n={};function i(e,i){if(void 0!==t[i])return t[i];const s=e.interleavedBuffers[i],r=function(e,t){if(void 0!==n[t])return n[t];const i=e.arrayBuffers[t],s=new Uint32Array(i).buffer;return n[t]=s,s}(e,s.buffer),a=at(s.type,r),o=new Ha(a,s.stride);return o.uuid=s.uuid,t[i]=o,o}const s=e.isInstancedBufferGeometry?new Sh:new yi,r=e.data.index;if(void 0!==r){const e=at(r.type,r.array);s.setIndex(new $n(e,1))}const a=e.data.attributes;for(const t in a){const n=a[t];let r;if(n.isInterleavedBufferAttribute){const t=i(e.data,n.data);r=new ka(t,n.itemSize,n.offset,n.normalized)}else{const e=at(n.type,n.array);r=new(n.isInstancedBufferAttribute?xo:$n)(e,n.itemSize,n.normalized)}void 0!==n.name&&(r.name=n.name),void 0!==n.usage&&r.setUsage(n.usage),void 0!==n.updateRange&&(r.updateRange.offset=n.updateRange.offset,r.updateRange.count=n.updateRange.count),s.setAttribute(t,r)}const o=e.data.morphAttributes;if(o)for(const t in o){const n=o[t],r=[];for(let t=0,s=n.length;t<s;t++){const s=n[t];let a;if(s.isInterleavedBufferAttribute){const t=i(e.data,s.data);a=new ka(t,s.itemSize,s.offset,s.normalized)}else{const e=at(s.type,s.array);a=new $n(e,s.itemSize,s.normalized)}void 0!==s.name&&(a.name=s.name),r.push(a)}s.morphAttributes[t]=r}e.data.morphTargetsRelative&&(s.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){const t=l[e];s.addGroup(t.start,t.count,t.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new zt;void 0!==c.center&&e.fromArray(c.center),s.boundingSphere=new tn(e,c.radius)}return e.name&&(s.name=e.name),e.userData&&(s.userData=e.userData),s}}class Lh extends Oc{constructor(e){super(e)}load(e,t,n,i){const s=this,r=""===this.path?wh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const a=new Kc(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){let r=null;try{r=JSON.parse(n)}catch(t){return void 0!==i&&i(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}const a=r.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?s.parse(r,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,i)}async loadAsync(e,t){const n=""===this.path?wh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const i=new Kc(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials);const s=await i.loadAsync(e,t),r=JSON.parse(s),a=r.metadata;if(void 0===a||void 0===a.type||"geometry"===a.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(r)}parse(e,t){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,i),r=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),a=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,a),l=this.parseObject(e.object,s,o,a,n),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),void 0!==t){let e=!1;for(const t in r)if(r[t].data instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,n),s=await this.parseImagesAsync(e.images),r=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,r),o=this.parseObject(e.object,i,a,r,t),l=this.parseSkeletons(e.skeletons,o);return this.bindSkeletons(o,l),o}parseShapes(e){const t={};if(void 0!==e)for(let n=0,i=e.length;n<i;n++){const i=(new Rl).fromJSON(e[n]);t[i.uuid]=i}return t}parseSkeletons(e,t){const n={},i={};if(t.traverse((function(e){e.isBone&&(i[e.uuid]=e)})),void 0!==e)for(let t=0,s=e.length;t<s;t++){const s=(new vo).fromJSON(e[t],i);n[s.uuid]=s}return n}parseGeometries(e,t){const n={};if(void 0!==e){const i=new Mh;for(let s=0,r=e.length;s<r;s++){let r;const a=e[s];switch(a.type){case"BufferGeometry":case"InstancedBufferGeometry":r=i.parse(a);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:a.type in yc?r=yc[a.type].fromJSON(a,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${a.type}"`)}r.uuid=a.uuid,void 0!==a.name&&(r.name=a.name),!0===r.isBufferGeometry&&void 0!==a.userData&&(r.userData=a.userData),n[a.uuid]=r}}return n}parseMaterials(e,t){const n={},i={};if(void 0!==e){const s=new xh;s.setTextures(t);for(let t=0,r=e.length;t<r;t++){const r=e[t];if("MultiMaterial"===r.type){const e=[];for(let t=0;t<r.materials.length;t++){const i=r.materials[t];void 0===n[i.uuid]&&(n[i.uuid]=s.parse(i)),e.push(n[i.uuid])}i[r.uuid]=e}else void 0===n[r.uuid]&&(n[r.uuid]=s.parse(r)),i[r.uuid]=n[r.uuid]}}return i}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const i=e[n],s=Dc.parse(i);t[s.uuid]=s}return t}parseImages(e,t){const n=this,i={};let s;function r(e){if("string"==typeof e){const t=e;return function(e){return n.manager.itemStart(e),s.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:at(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new Fc(t);s=new Qc(n),s.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){const n=e[t],s=n.url;if(Array.isArray(s)){const e=[];for(let t=0,n=s.length;t<n;t++){const n=r(s[t]);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new go(n.data,n.width,n.height)))}i[n.uuid]=new wt(e)}else{const e=r(n.url);i[n.uuid]=new wt(e)}}}return i}async parseImagesAsync(e){const t=this,n={};let i;async function s(e){if("string"==typeof e){const n=e,s=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await i.loadAsync(s)}return e.data?{data:at(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){i=new Qc(this.manager),i.setCrossOrigin(this.crossOrigin);for(let t=0,i=e.length;t<i;t++){const i=e[t],r=i.url;if(Array.isArray(r)){const e=[];for(let t=0,n=r.length;t<n;t++){const n=r[t],i=await s(n);null!==i&&(i instanceof HTMLImageElement?e.push(i):e.push(new go(i.data,i.width,i.height)))}n[i.uuid]=new wt(e)}else{const e=await s(i.url);n[i.uuid]=new wt(e)}}}return n}parseTextures(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const i={};if(void 0!==e)for(let s=0,r=e.length;s<r;s++){const r=e[s];void 0===r.image&&console.warn('THREE.ObjectLoader: No "image" specified for',r.uuid),void 0===t[r.image]&&console.warn("THREE.ObjectLoader: Undefined image",r.image);const a=t[r.image],o=a.data;let l;Array.isArray(o)?(l=new Oi,6===o.length&&(l.needsUpdate=!0)):(l=o&&o.data?new go:new Lt,o&&(l.needsUpdate=!0)),l.source=a,l.uuid=r.uuid,void 0!==r.name&&(l.name=r.name),void 0!==r.mapping&&(l.mapping=n(r.mapping,Ch)),void 0!==r.offset&&l.offset.fromArray(r.offset),void 0!==r.repeat&&l.repeat.fromArray(r.repeat),void 0!==r.center&&l.center.fromArray(r.center),void 0!==r.rotation&&(l.rotation=r.rotation),void 0!==r.wrap&&(l.wrapS=n(r.wrap[0],Gh),l.wrapT=n(r.wrap[1],Gh)),void 0!==r.format&&(l.format=r.format),void 0!==r.type&&(l.type=r.type),void 0!==r.encoding&&(l.encoding=r.encoding),void 0!==r.minFilter&&(l.minFilter=n(r.minFilter,Th)),void 0!==r.magFilter&&(l.magFilter=n(r.magFilter,Th)),void 0!==r.anisotropy&&(l.anisotropy=r.anisotropy),void 0!==r.flipY&&(l.flipY=r.flipY),void 0!==r.premultiplyAlpha&&(l.premultiplyAlpha=r.premultiplyAlpha),void 0!==r.unpackAlignment&&(l.unpackAlignment=r.unpackAlignment),void 0!==r.userData&&(l.userData=r.userData),i[r.uuid]=l}return i}parseObject(e,t,n,i,s){let r,a,o;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let i=0,s=e.length;i<s;i++){const s=e[i];void 0===n[s]&&console.warn("THREE.ObjectLoader: Undefined material",s),t.push(n[s])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}function h(e){return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),i[e]}switch(e.type){case"Scene":r=new Va,void 0!==e.background&&(Number.isInteger(e.background)?r.background=new bt(e.background):r.background=h(e.background)),void 0!==e.environment&&(r.environment=h(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new Na(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new Pa(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new Bi(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new ps(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new gh(e.color,e.intensity);break;case"DirectionalLight":r=new fh(e.color,e.intensity);break;case"PointLight":r=new ph(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new yh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new lh(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new nh(e.color,e.groundColor,e.intensity);break;case"LightProbe":r=(new vh).fromJSON(e);break;case"SkinnedMesh":a=l(e.geometry),o=c(e.material),r=new mo(a,o),void 0!==e.bindMode&&(r.bindMode=e.bindMode),void 0!==e.bindMatrix&&r.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(r.skeleton=e.skeleton);break;case"Mesh":a=l(e.geometry),o=c(e.material),r=new Wi(a,o);break;case"InstancedMesh":a=l(e.geometry),o=c(e.material);const t=e.count,n=e.instanceMatrix,i=e.instanceColor;r=new Co(a,o,t),r.instanceMatrix=new xo(new Float32Array(n.array),16),void 0!==i&&(r.instanceColor=new xo(new Float32Array(i.array),i.itemSize));break;case"LOD":r=new oo;break;case"Line":r=new _o(l(e.geometry),c(e.material));break;case"LineLoop":r=new Zo(l(e.geometry),c(e.material));break;case"LineSegments":r=new Wo(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":r=new ko(l(e.geometry),c(e.material));break;case"Sprite":r=new io(c(e.material));break;case"Group":r=new Ra;break;case"Bone":r=new fo;break;default:r=new Zn}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(r.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.frustumCulled&&(r.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(r.renderOrder=e.renderOrder),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.layers&&(r.layers.mask=e.layers),void 0!==e.children){const a=e.children;for(let e=0;e<a.length;e++)r.add(this.parseObject(a[e],t,n,i,s))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];r.animations.push(s[n])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(r.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],i=r.getObjectByProperty("uuid",n.object);void 0!==i&&r.addLevel(i,n.distance)}}return r}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const Ch={UVMapping:d,CubeReflectionMapping:u,CubeRefractionMapping:p,EquirectangularReflectionMapping:m,EquirectangularRefractionMapping:f,CubeUVReflectionMapping:g},Gh={RepeatWrapping:y,ClampToEdgeWrapping:b,MirroredRepeatWrapping:v},Th={NearestFilter:x,NearestMipmapNearestFilter:w,NearestMipmapLinearFilter:S,LinearFilter:M,LinearMipmapNearestFilter:L,LinearMipmapLinearFilter:C};class Rh extends Oc{constructor(e){super(e),this.isImageBitmapLoader=!0,"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,r=Bc.get(e);if(void 0!==r)return s.manager.itemStart(e),setTimeout((function(){t&&t(r),s.manager.itemEnd(e)}),0),r;const a={};a.credentials="anonymous"===this.crossOrigin?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(s.options,{colorSpaceConversion:"none"}))})).then((function(n){Bc.add(e,n),t&&t(n),s.manager.itemEnd(e)})).catch((function(t){i&&i(t),s.manager.itemError(e),s.manager.itemEnd(e)})),s.manager.itemStart(e)}}let Ah;const Xh={getContext:function(){return void 0===Ah&&(Ah=new(window.AudioContext||window.webkitAudioContext)),Ah},setContext:function(e){Ah=e}};class Ih extends Oc{constructor(e){super(e)}load(e,t,n,i){const s=this,r=new Kc(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,(function(n){try{const e=n.slice(0);Xh.getContext().decodeAudioData(e,(function(e){t(e)}))}catch(t){i?i(t):console.error(t),s.manager.itemError(e)}}),n,i)}}class _h extends vh{constructor(e,t){super(void 0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1),this.isHemisphereLightProbe=!0;const n=(new bt).set(e),i=(new bt).set(t),s=new zt(n.r,n.g,n.b),r=new zt(i.r,i.g,i.b),a=Math.sqrt(Math.PI),o=a*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(r).multiplyScalar(a),this.sh.coefficients[1].copy(s).sub(r).multiplyScalar(o)}}class zh extends vh{constructor(e){super(void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),this.isAmbientLightProbe=!0;const t=(new bt).set(e);this.sh.coefficients[0].set(t.r,t.g,t.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const Eh=new dn,Wh=new dn,Zh=new dn;class Ph{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Bi,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Bi,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Zh.copy(e.projectionMatrix);const n=t.eyeSep/2,i=n*t.near/t.focus,s=t.near*Math.tan(Oe*t.fov*.5)/t.zoom;let r,a;Wh.elements[12]=-n,Eh.elements[12]=n,r=-s*t.aspect+i,a=s*t.aspect+i,Zh.elements[0]=2*t.near/(a-r),Zh.elements[8]=(a+r)/(a-r),this.cameraL.projectionMatrix.copy(Zh),r=-s*t.aspect-i,a=s*t.aspect-i,Zh.elements[0]=2*t.near/(a-r),Zh.elements[8]=(a+r)/(a-r),this.cameraR.projectionMatrix.copy(Zh)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Wh),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Eh)}}class Nh{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Vh(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Vh();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Vh(){return("undefined"==typeof performance?Date:performance).now()}const Hh=new zt,Dh=new _t,kh=new zt,Bh=new zt;class Fh extends Zn{constructor(){super(),this.type="AudioListener",this.context=Xh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Nh}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Hh,Dh,kh),Bh.set(0,0,-1).applyQuaternion(Dh),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Hh.x,e),t.positionY.linearRampToValueAtTime(Hh.y,e),t.positionZ.linearRampToValueAtTime(Hh.z,e),t.forwardX.linearRampToValueAtTime(Bh.x,e),t.forwardY.linearRampToValueAtTime(Bh.y,e),t.forwardZ.linearRampToValueAtTime(Bh.z,e),t.upX.linearRampToValueAtTime(n.x,e),t.upY.linearRampToValueAtTime(n.y,e),t.upZ.linearRampToValueAtTime(n.z,e)}else t.setPosition(Hh.x,Hh.y,Hh.z),t.setOrientation(Bh.x,Bh.y,Bh.z,n.x,n.y,n.z)}}class Uh extends Zn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const Oh=new zt,Yh=new _t,Kh=new zt,jh=new zt;class Jh extends Uh{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(Oh,Yh,Kh),jh.set(0,0,1).applyQuaternion(Yh);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Oh.x,e),t.positionY.linearRampToValueAtTime(Oh.y,e),t.positionZ.linearRampToValueAtTime(Oh.z,e),t.orientationX.linearRampToValueAtTime(jh.x,e),t.orientationY.linearRampToValueAtTime(jh.y,e),t.orientationZ.linearRampToValueAtTime(jh.z,e)}else t.setPosition(Oh.x,Oh.y,Oh.z),t.setOrientation(jh.x,jh.y,jh.z)}}class Qh{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2048;this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class qh{constructor(e,t,n){let i,s,r;switch(this.binding=e,this.valueSize=n,t){case"quaternion":i=this._slerp,s=this._slerpAdditive,r=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":i=this._select,s=this._select,r=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:i=this._lerp,s=this._lerpAdditive,r=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=s,this._setIdentity=r,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,i=this.valueSize,s=e*i+i;let r=this.cumulativeWeight;if(0===r){for(let e=0;e!==i;++e)n[s+e]=n[e];r=t}else{r+=t;const e=t/r;this._mixBufferRegion(n,s,0,e,i)}this.cumulativeWeight=r}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,i=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,i=e*t+t,s=this.cumulativeWeight,r=this.cumulativeWeightAdditive,a=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const e=t*this._origIndex;this._mixBufferRegion(n,i,e,1-s,t)}r>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let e=t,s=t+t;e!==s;++e)if(n[e]!==n[e+t]){a.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let e=n,s=i;e!==s;++e)t[e]=t[i+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,i,s){if(i>=.5)for(let i=0;i!==s;++i)e[t+i]=e[n+i]}_slerp(e,t,n,i){_t.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){const r=this._workIndex*s;_t.multiplyQuaternionsFlat(e,r,e,t,e,n),_t.slerpFlat(e,t,e,t,e,r,i)}_lerp(e,t,n,i,s){const r=1-i;for(let a=0;a!==s;++a){const s=t+a;e[s]=e[s]*r+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let r=0;r!==s;++r){const s=t+r;e[s]=e[s]+e[n+r]*i}}}const $h="\\[\\]\\.:\\/",ed=new RegExp("[\\[\\]\\.:\\/]","g"),td="[^\\[\\]\\.:\\/]",nd="[^"+$h.replace("\\.","")+"]",id=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",td)+/(WCOD+)?/.source.replace("WCOD",nd)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",td)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",td)+"$"),sd=["material","materials","bones"];class rd{constructor(e,t,n){this.path=t,this.parsedPath=n||rd.parseTrackName(t),this.node=rd.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new rd.Composite(e,t,n):new rd(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(ed,"")}static parseTrackName(e){const t=id.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const e=n.nodeName.substring(i+1);-1!==sd.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let i=0;i<e.length;i++){const s=e[i];if(s.name===t||s.uuid===t)return s;const r=n(s.children);if(r)return r}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=rd.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let i=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===i){i=t;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==i){if(void 0===e[i])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[i]}}const r=e[i];if(void 0===r){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",e)}let a=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?a=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==s){if("morphTargetInfluences"===i){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[s]&&(s=e.morphTargetDictionary[s])}o=this.BindingType.ArrayElement,this.resolvedProperty=r,this.propertyIndex=s}else void 0!==r.fromArray&&void 0!==r.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(o=this.BindingType.EntireArray,this.resolvedProperty=r):this.propertyName=i;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}rd.Composite=class{constructor(e,t,n){const i=n||rd.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},rd.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},rd.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},rd.prototype.GetterByBindingType=[rd.prototype._getValue_direct,rd.prototype._getValue_array,rd.prototype._getValue_arrayElement,rd.prototype._getValue_toArray],rd.prototype.SetterByBindingTypeAndVersioning=[[rd.prototype._setValue_direct,rd.prototype._setValue_direct_setNeedsUpdate,rd.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[rd.prototype._setValue_array,rd.prototype._setValue_array_setNeedsUpdate,rd.prototype._setValue_array_setMatrixWorldNeedsUpdate],[rd.prototype._setValue_arrayElement,rd.prototype._setValue_arrayElement_setNeedsUpdate,rd.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[rd.prototype._setValue_fromArray,rd.prototype._setValue_fromArray_setNeedsUpdate,rd.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class ad{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Ke(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,s=this._bindings,r=s.length;let a,o=e.length,l=this.nCachedObjects_;for(let c=0,h=arguments.length;c!==h;++c){const h=arguments[c],d=h.uuid;let u=t[d];if(void 0===u){u=o++,t[d]=u,e.push(h);for(let e=0,t=r;e!==t;++e)s[e].push(new rd(h,n[e],i[e]))}else if(u<l){a=e[u];const o=--l,c=e[o];t[c.uuid]=u,e[u]=c,t[d]=o,e[o]=h;for(let e=0,t=r;e!==t;++e){const t=s[e],r=t[o];let a=t[u];t[u]=r,void 0===a&&(a=new rd(h,n[e],i[e])),t[o]=a}}else e[u]!==a&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_;for(let r=0,a=arguments.length;r!==a;++r){const a=arguments[r],o=a.uuid,l=t[o];if(void 0!==l&&l>=s){const r=s++,c=e[r];t[c.uuid]=l,e[l]=c,t[o]=r,e[r]=a;for(let e=0,t=i;e!==t;++e){const t=n[e],i=t[r],s=t[l];t[l]=i,t[r]=s}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,r=e.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=t[o];if(void 0!==l)if(delete t[o],l<s){const a=--s,o=e[a],c=--r,h=e[c];t[o.uuid]=l,e[l]=o,t[h.uuid]=a,e[a]=h,e.pop();for(let e=0,t=i;e!==t;++e){const t=n[e],i=t[a],s=t[c];t[l]=i,t[a]=s,t.pop()}}else{const s=--r,a=e[s];s>0&&(t[a.uuid]=l),e[l]=a,e.pop();for(let e=0,t=i;e!==t;++e){const t=n[e];t[l]=t[s],t.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const s=this._bindings;if(void 0!==i)return s[i];const r=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);i=s.length,n[e]=i,r.push(e),a.push(t),s.push(h);for(let n=c,i=o.length;n!==i;++n){const i=o[n];h[n]=new rd(i,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const i=this._paths,s=this._parsedPaths,r=this._bindings,a=r.length-1,o=r[a];t[e[a]]=n,r[n]=o,r.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}}class od{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.blendMode;this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const s=t.tracks,r=s.length,a=new Array(r),o={endingStart:Re,endingEnd:Re};for(let e=0;e!==r;++e){const t=s[e].createInterpolant(null);a[e]=t,t.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Me,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,i=e._clip.duration,s=i/n,r=n/i;e.warp(1,s,t),this.warp(r,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,s=i.time,r=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=s,o[1]=s+n,l[0]=e/r,l[1]=t/r,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled)return void this._updateWeight(e);const s=this._startTime;if(null!==s){const i=(e-s)*n;if(i<0||0===n)return;this._startTime=null,t=n*i}t*=this._updateTimeScale(e);const r=this._updateTime(t),a=this._updateWeight(e);if(a>0){const e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case _e:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(r),t[n].accumulateAdditive(a);break;case Ie:default:for(let n=0,s=e.length;n!==s;++n)e[n].evaluate(r),t[n].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,s=this._loopCount;const r=n===Le;if(0===e)return-1===s?i:r&&1==(1&s)?t-i:i;if(n===Se){-1===s&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else{if(!(i<0)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===s&&(e>=0?(s=0,this._setEndings(!0,0===this.repetitions,r)):this._setEndings(0===this.repetitions,!0,r)),i>=t||i<0){const n=Math.floor(i/t);i-=t*n,s+=Math.abs(n);const a=this.repetitions-s;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===a){const t=e<0;this._setEndings(t,!t,r)}else this._setEndings(!1,!1,r);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(r&&1==(1&s))return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=Ae,i.endingEnd=Ae):(i.endingStart=e?this.zeroSlopeAtStart?Ae:Re:Xe,i.endingEnd=t?this.zeroSlopeAtEnd?Ae:Re:Xe)}_scheduleFading(e,t,n){const i=this._mixer,s=i.time;let r=this._weightInterpolant;null===r&&(r=i._lendControlInterpolant(),this._weightInterpolant=r);const a=r.parameterPositions,o=r.sampleValues;return a[0]=s,o[0]=t,a[1]=s+e,o[1]=n,this}}const ld=new Float32Array(1);class cd extends Be{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,r=e._propertyBindings,a=e._interpolants,o=n.uuid,l=this._bindingsByRootAndName;let c=l[o];void 0===c&&(c={},l[o]=c);for(let e=0;e!==s;++e){const s=i[e],l=s.name;let h=c[l];if(void 0!==h)++h.referenceCount,r[e]=h;else{if(h=r[e],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,o,l));continue}const i=t&&t._propertyBindings[e].binding.parsedPath;h=new qh(rd.create(n,l,i),s.ValueTypeName,s.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,o,l),r[e]=h}a[e].resultBuffer=h.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,n){const i=this._actions,s=this._actionsByClip;let r=s[t];if(void 0===r)r={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=r;else{const t=r.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=i.length,i.push(e),r.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,r=this._actionsByClip,a=r[s],o=a.knownActions,l=o[o.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,o[c]=l,o.pop(),e._byClipCacheIndex=null;delete a.actionByRoot[(e._localRoot||this._root).uuid],0===o.length&&delete r[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_addInactiveBinding(e,t,n){const i=this._bindingsByRootAndName,s=this._bindings;let r=i[t];void 0===r&&(r={},i[t]=r),r[n]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,i=n.rootNode.uuid,s=n.path,r=this._bindingsByRootAndName,a=r[i],o=t[t.length-1],l=e._cacheIndex;o._cacheIndex=l,t[l]=o,t.pop(),delete a[s],0===Object.keys(a).length&&delete r[i]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,s=t[i];e._cacheIndex=i,t[i]=e,s._cacheIndex=n,t[n]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new Ic(new Float32Array(2),new Float32Array(2),1,ld),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,s=t[i];e.__cacheIndex=i,t[i]=e,s.__cacheIndex=n,t[n]=s}clipAction(e,t,n){const i=t||this._root,s=i.uuid;let r="string"==typeof e?Dc.findByName(i,e):e;const a=null!==r?r.uuid:e,o=this._actionsByClip[a];let l=null;if(void 0===n&&(n=null!==r?r.blendMode:Ie),void 0!==o){const e=o.actionByRoot[s];if(void 0!==e&&e.blendMode===n)return e;l=o.knownActions[0],null===r&&(r=l._clip)}if(null===r)return null;const c=new od(this,r,t,n);return this._bindAction(c,l),this._addInactiveAction(c,a,s),c}existingAction(e,t){const n=t||this._root,i=n.uuid,s="string"==typeof e?Dc.findByName(n,e):e,r=s?s.uuid:e,a=this._actionsByClip[r];return void 0!==a&&a.actionByRoot[i]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),r=this._accuIndex^=1;for(let a=0;a!==n;++a){t[a]._update(i,e,s,r)}const a=this._bindings,o=this._nActiveBindings;for(let e=0;e!==o;++e)a[e].apply(r);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,i=this._actionsByClip,s=i[n];if(void 0!==s){const e=s.knownActions;for(let n=0,i=e.length;n!==i;++n){const i=e[n];this._deactivateAction(i);const s=i._cacheIndex,r=t[t.length-1];i._cacheIndex=null,i._byClipCacheIndex=null,r._cacheIndex=s,t[s]=r,t.pop(),this._removeInactiveBindingsForAction(i)}delete i[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const e in n){const i=n[e].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}const i=this._bindingsByRootAndName[t];if(void 0!==i)for(const e in i){const t=i[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class hd{constructor(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new hd(void 0===this.value.clone?this.value:this.value.clone())}}class dd extends Ha{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class ud{constructor(e,t,n,i,s){this.isGLBufferAttribute=!0,this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=i,this.count=s,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}class pd{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;this.ray=new hn(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Sn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return fd(e,this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1]),t.sort(md),t}intersectObjects(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let i=0,s=e.length;i<s;i++)fd(e[i],this,n,t);return n.sort(md),n}}function md(e,t){return e.distance-t.distance}function fd(e,t,n,i){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===i){const i=e.children;for(let e=0,s=i.length;e<s;e++)fd(i[e],t,n,!0)}}class gd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(je(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class yd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}}const bd=new nt;class vd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nt(1/0,1/0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nt(-1/0,-1/0);this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=bd.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return bd.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const xd=new zt,wd=new zt;class Sd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt;this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){xd.subVectors(e,this.start),wd.subVectors(this.end,this.start);const n=wd.dot(wd);let i=wd.dot(xd)/n;return t&&(i=je(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const Md=new zt;class Ld extends Zn{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new yi,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];for(let e=0,t=1,n=32;e<n;e++,t++){const s=e/n*Math.PI*2,r=t/n*Math.PI*2;i.push(Math.cos(s),Math.sin(s),1,Math.cos(r),Math.sin(r),1)}n.setAttribute("position",new li(i,3));const s=new Go({fog:!1,toneMapped:!1});this.cone=new Wo(n,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Md.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Md),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Cd=new zt,Gd=new dn,Td=new dn;class Rd extends Wo{constructor(e){const t=Ad(e),n=new yi,i=[],s=[],r=new bt(0,0,1),a=new bt(0,1,0);for(let e=0;e<t.length;e++){const n=t[e];n.parent&&n.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),s.push(r.r,r.g,r.b),s.push(a.r,a.g,a.b))}n.setAttribute("position",new li(i,3)),n.setAttribute("color",new li(s,3));super(n,new Go({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,i=n.getAttribute("position");Td.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e<t.length;e++){const s=t[e];s.parent&&s.parent.isBone&&(Gd.multiplyMatrices(Td,s.matrixWorld),Cd.setFromMatrixPosition(Gd),i.setXYZ(n,Cd.x,Cd.y,Cd.z),Gd.multiplyMatrices(Td,s.parent.matrixWorld),Cd.setFromMatrixPosition(Gd),i.setXYZ(n+1,Cd.x,Cd.y,Cd.z),n+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function Ad(e){const t=[];!0===e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push.apply(t,Ad(e.children[n]));return t}class Xd extends Wi{constructor(e,t,n){super(new hc(t,4,2),new Jn({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const Id=new zt,_d=new bt,zd=new bt;class Ed extends Zn{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const i=new oc(t);i.rotateY(.5*Math.PI),this.material=new Jn({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const s=i.getAttribute("position"),r=new Float32Array(3*s.count);i.setAttribute("color",new $n(r,3)),this.add(new Wi(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");_d.copy(this.light.color),zd.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const i=e<n/2?_d:zd;t.setXYZ(e,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(Id.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Wd extends Wo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4473924,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8947848;n=new bt(n),i=new bt(i);const s=t/2,r=e/t,a=e/2,o=[],l=[];for(let e=0,c=0,h=-a;e<=t;e++,h+=r){o.push(-a,0,h,a,0,h),o.push(h,0,-a,h,0,a);const t=e===s?n:i;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new yi;c.setAttribute("position",new li(o,3)),c.setAttribute("color",new li(l,3));super(c,new Go({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class Zd extends Wo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:64,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4473924,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8947848;s=new bt(s),r=new bt(r);const a=[],o=[];for(let n=0;n<=t;n++){const i=n/t*(2*Math.PI),l=Math.sin(i)*e,c=Math.cos(i)*e;a.push(0,0,0),a.push(l,0,c);const h=1&n?s:r;o.push(h.r,h.g,h.b),o.push(h.r,h.g,h.b)}for(let t=0;t<=n;t++){const l=1&t?s:r,c=e-e/n*t;for(let e=0;e<i;e++){let t=e/i*(2*Math.PI),n=Math.sin(t)*c,s=Math.cos(t)*c;a.push(n,0,s),o.push(l.r,l.g,l.b),t=(e+1)/i*(2*Math.PI),n=Math.sin(t)*c,s=Math.cos(t)*c,a.push(n,0,s),o.push(l.r,l.g,l.b)}}const l=new yi;l.setAttribute("position",new li(a,3)),l.setAttribute("color",new li(o,3));super(l,new Go({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const Pd=new zt,Nd=new zt,Vd=new zt;class Hd extends Zn{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);let i=new yi;i.setAttribute("position",new li([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new Go({fog:!1,toneMapped:!1});this.lightPlane=new _o(i,s),this.add(this.lightPlane),i=new yi,i.setAttribute("position",new li([0,0,0,0,0,1],3)),this.targetLine=new _o(i,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Pd.setFromMatrixPosition(this.light.matrixWorld),Nd.setFromMatrixPosition(this.light.target.matrixWorld),Vd.subVectors(Nd,Pd),this.lightPlane.lookAt(Nd),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(Nd),this.targetLine.scale.z=Vd.length()}}const Dd=new zt,kd=new ki;class Bd extends Wo{constructor(e){const t=new yi,n=new Go({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],s=[],r={};function a(e,t){o(e),o(t)}function o(e){i.push(0,0,0),s.push(0,0,0),void 0===r[e]&&(r[e]=[]),r[e].push(i.length/3-1)}a("n1","n2"),a("n2","n4"),a("n4","n3"),a("n3","n1"),a("f1","f2"),a("f2","f4"),a("f4","f3"),a("f3","f1"),a("n1","f1"),a("n2","f2"),a("n3","f3"),a("n4","f4"),a("p","n1"),a("p","n2"),a("p","n3"),a("p","n4"),a("u1","u2"),a("u2","u3"),a("u3","u1"),a("c","t"),a("p","c"),a("cn1","cn2"),a("cn3","cn4"),a("cf1","cf2"),a("cf3","cf4"),t.setAttribute("position",new li(i,3)),t.setAttribute("color",new li(s,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=r,this.update();const l=new bt(16755200),c=new bt(16711680),h=new bt(43775),d=new bt(16777215),u=new bt(3355443);this.setColors(l,c,h,d,u)}setColors(e,t,n,i,s){const r=this.geometry.getAttribute("color");r.setXYZ(0,e.r,e.g,e.b),r.setXYZ(1,e.r,e.g,e.b),r.setXYZ(2,e.r,e.g,e.b),r.setXYZ(3,e.r,e.g,e.b),r.setXYZ(4,e.r,e.g,e.b),r.setXYZ(5,e.r,e.g,e.b),r.setXYZ(6,e.r,e.g,e.b),r.setXYZ(7,e.r,e.g,e.b),r.setXYZ(8,e.r,e.g,e.b),r.setXYZ(9,e.r,e.g,e.b),r.setXYZ(10,e.r,e.g,e.b),r.setXYZ(11,e.r,e.g,e.b),r.setXYZ(12,e.r,e.g,e.b),r.setXYZ(13,e.r,e.g,e.b),r.setXYZ(14,e.r,e.g,e.b),r.setXYZ(15,e.r,e.g,e.b),r.setXYZ(16,e.r,e.g,e.b),r.setXYZ(17,e.r,e.g,e.b),r.setXYZ(18,e.r,e.g,e.b),r.setXYZ(19,e.r,e.g,e.b),r.setXYZ(20,e.r,e.g,e.b),r.setXYZ(21,e.r,e.g,e.b),r.setXYZ(22,e.r,e.g,e.b),r.setXYZ(23,e.r,e.g,e.b),r.setXYZ(24,t.r,t.g,t.b),r.setXYZ(25,t.r,t.g,t.b),r.setXYZ(26,t.r,t.g,t.b),r.setXYZ(27,t.r,t.g,t.b),r.setXYZ(28,t.r,t.g,t.b),r.setXYZ(29,t.r,t.g,t.b),r.setXYZ(30,t.r,t.g,t.b),r.setXYZ(31,t.r,t.g,t.b),r.setXYZ(32,n.r,n.g,n.b),r.setXYZ(33,n.r,n.g,n.b),r.setXYZ(34,n.r,n.g,n.b),r.setXYZ(35,n.r,n.g,n.b),r.setXYZ(36,n.r,n.g,n.b),r.setXYZ(37,n.r,n.g,n.b),r.setXYZ(38,i.r,i.g,i.b),r.setXYZ(39,i.r,i.g,i.b),r.setXYZ(40,s.r,s.g,s.b),r.setXYZ(41,s.r,s.g,s.b),r.setXYZ(42,s.r,s.g,s.b),r.setXYZ(43,s.r,s.g,s.b),r.setXYZ(44,s.r,s.g,s.b),r.setXYZ(45,s.r,s.g,s.b),r.setXYZ(46,s.r,s.g,s.b),r.setXYZ(47,s.r,s.g,s.b),r.setXYZ(48,s.r,s.g,s.b),r.setXYZ(49,s.r,s.g,s.b),r.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap;kd.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Fd("c",t,e,kd,0,0,-1),Fd("t",t,e,kd,0,0,1),Fd("n1",t,e,kd,-1,-1,-1),Fd("n2",t,e,kd,1,-1,-1),Fd("n3",t,e,kd,-1,1,-1),Fd("n4",t,e,kd,1,1,-1),Fd("f1",t,e,kd,-1,-1,1),Fd("f2",t,e,kd,1,-1,1),Fd("f3",t,e,kd,-1,1,1),Fd("f4",t,e,kd,1,1,1),Fd("u1",t,e,kd,.7,1.1,-1),Fd("u2",t,e,kd,-.7,1.1,-1),Fd("u3",t,e,kd,0,2,-1),Fd("cf1",t,e,kd,-1,0,1),Fd("cf2",t,e,kd,1,0,1),Fd("cf3",t,e,kd,0,-1,1),Fd("cf4",t,e,kd,0,1,1),Fd("cn1",t,e,kd,-1,0,-1),Fd("cn2",t,e,kd,1,0,-1),Fd("cn3",t,e,kd,0,-1,-1),Fd("cn4",t,e,kd,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Fd(e,t,n,i,s,r,a){Dd.set(s,r,a).unproject(i);const o=t[e];if(void 0!==o){const e=n.getAttribute("position");for(let t=0,n=o.length;t<n;t++)e.setXYZ(o[t],Dd.x,Dd.y,Dd.z)}}const Ud=new Zt;class Od extends Wo{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;const 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),s=new yi;s.setIndex(new $n(n,1)),s.setAttribute("position",new $n(i,3)),super(s,new Go({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Ud.setFromObject(this.object),Ud.isEmpty())return;const t=Ud.min,n=Ud.max,i=this.geometry.attributes.position,s=i.array;s[0]=n.x,s[1]=n.y,s[2]=n.z,s[3]=t.x,s[4]=n.y,s[5]=n.z,s[6]=t.x,s[7]=t.y,s[8]=n.z,s[9]=n.x,s[10]=t.y,s[11]=n.z,s[12]=n.x,s[13]=n.y,s[14]=t.z,s[15]=t.x,s[16]=n.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=n.x,s[22]=t.y,s[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}}class Yd extends Wo{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;const 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 yi;i.setIndex(new $n(n,1)),i.setAttribute("position",new li([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new Go({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class Kd extends _o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16776960,i=new yi;i.setAttribute("position",new li([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),super(i,new Go({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new yi;s.setAttribute("position",new li([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new Wi(s,new Jn({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?1:0,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const jd=new zt;let Jd,Qd;class qd extends Zn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new zt(0,0,1),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt(0,0,0),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16776960,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.2*n,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:.2*s;super(),this.type="ArrowHelper",void 0===Jd&&(Jd=new yi,Jd.setAttribute("position",new li([0,0,0,0,1,0],3)),Qd=new vl(0,.5,1,5,1),Qd.translate(0,-.5,0)),this.position.copy(t),this.line=new _o(Jd,new Go({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Wi(Qd,new Jn({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,s,r)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{jd.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(jd,t)}}setLength(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.2*e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.2*t;this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}}class $d extends Wo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new yi;n.setAttribute("position",new li(t,3)),n.setAttribute("color",new li([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(n,new Go({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const i=new bt,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(n),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class eu{constructor(){this.type="ShapePath",this.color=new bt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new fl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,s,r){return this.currentPath.bezierCurveTo(e,t,n,i,s,r),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(e){const t=[];for(let n=0,i=e.length;n<i;n++){const i=e[n],s=new Rl;s.curves=i.curves,t.push(s)}return t}function i(e,t){const n=t.length;let i=!1;for(let s=n-1,r=0;r<n;s=r++){let n=t[s],a=t[r],o=a.x-n.x,l=a.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[r],o=-o,a=t[s],l=-l),e.y<n.y||e.y>a.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;i=!i}}else{if(e.y!==n.y)continue;if(a.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=a.x)return!0}}return i}const s=tc.isClockWise,r=this.subPaths;if(0===r.length)return[];if(!0===t)return n(r);let a,o,l;const c=[];if(1===r.length)return o=r[0],l=new Rl,l.curves=o.curves,c.push(l),c;let h=!s(r[0].getPoints());h=e?!h:h;const d=[],u=[];let p,m,f=[],g=0;u[g]=void 0,f[g]=[];for(let t=0,n=r.length;t<n;t++)o=r[t],p=o.getPoints(),a=s(p),a=e?!a:a,a?(!h&&u[g]&&g++,u[g]={s:new Rl,p:p},u[g].s.curves=o.curves,h&&g++,f[g]=[]):f[g].push({h:o,p:p[0]});if(!u[0])return n(r);if(u.length>1){let e=!1,t=0;for(let e=0,t=u.length;e<t;e++)d[e]=[];for(let n=0,s=u.length;n<s;n++){const s=f[n];for(let r=0;r<s.length;r++){const a=s[r];let o=!0;for(let s=0;s<u.length;s++)i(a.p,u[s].p)&&(n!==s&&t++,o?(o=!1,d[s].push(a)):e=!0);o&&d[n].push(a)}}t>0&&!1===e&&(f=d)}for(let e=0,t=u.length;e<t;e++){l=u[e].s,c.push(l),m=f[e];for(let e=0,t=m.length;e<t;e++)l.holes.push(m[e].h)}return c}}const{floatView:tu,uint32View:nu,baseTable:iu,shiftTable:su,mantissaTable:ru,exponentTable:au,offsetTable:ou}=lu();function lu(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),i=new Uint32Array(512),s=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(i[e]=0,i[256|e]=32768,s[e]=24,s[256|e]=24):t<-14?(i[e]=1024>>-t-14,i[256|e]=1024>>-t-14|32768,s[e]=-t-1,s[256|e]=-t-1):t<=15?(i[e]=t+15<<10,i[256|e]=t+15<<10|32768,s[e]=13,s[256|e]=13):t<128?(i[e]=31744,i[256|e]=64512,s[e]=24,s[256|e]=24):(i[e]=31744,i[256|e]=64512,s[e]=13,s[256|e]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;0==(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,r[e]=t|n}for(let e=1024;e<2048;++e)r[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)a[e]=e<<23;a[31]=1199570944,a[32]=2147483648;for(let e=33;e<63;++e)a[e]=2147483648+(e-32<<23);a[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:n,baseTable:i,shiftTable:s,mantissaTable:r,exponentTable:a,offsetTable:o}}var cu=Object.freeze({__proto__:null,toHalfFloat:function(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=je(e,-65504,65504),tu[0]=e;const t=nu[0],n=t>>23&511;return iu[n]+((8388607&t)>>su[n])},fromHalfFloat:function(e){const t=e>>10;return nu[0]=ru[ou[t]+(1023&e)]+au[t],tu[0]}});class hu extends yi{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}}class du extends yi{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}}function uu(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")}function pu(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")}function mu(){console.error("THREE.ImmediateRenderObject has been removed.")}class fu extends Gt{constructor(e,t,n){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,n),this.samples=4}}class gu extends Tt{constructor(e,t,n,i){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,n,i)}}class yu extends At{constructor(e,t,n,i){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,n,i)}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:i}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=i);var bu=Object.freeze({__proto__:null,ACESFilmicToneMapping:4,AddEquation:a,AddOperation:2,AdditiveAnimationBlendMode:_e,AdditiveBlending:2,AlphaFormat:N,AlwaysDepth:1,AlwaysStencilFunc:519,AmbientLight:gh,AmbientLightProbe:zh,AnimationClip:Dc,AnimationLoader:jc,AnimationMixer:cd,AnimationObjectGroup:ad,AnimationUtils:Rc,ArcCurve:Jo,ArrayCamera:Ta,ArrowHelper:qd,Audio:Uh,AudioAnalyser:Qh,AudioContext:Xh,AudioListener:Fh,AudioLoader:Ih,AxesHelper:$d,BackSide:1,BasicDepthPacking:We,BasicShadowMap:0,Bone:fo,BooleanKeyframeTrack:Ec,Box2:vd,Box3:Zt,Box3Helper:Yd,BoxBufferGeometry:Pi,BoxGeometry:Pi,BoxHelper:Od,BufferAttribute:$n,BufferGeometry:yi,BufferGeometryLoader:Mh,ByteType:R,Cache:Bc,Camera:ki,CameraHelper:Bd,CanvasTexture:Yo,CapsuleBufferGeometry:yl,CapsuleGeometry:yl,CatmullRomCurve3:nl,CineonToneMapping:3,CircleBufferGeometry:bl,CircleGeometry:bl,ClampToEdgeWrapping:b,Clock:Nh,Color:bt,ColorKeyframeTrack:Wc,ColorManagement:dt,CompressedTexture:Oo,CompressedTextureLoader:Jc,ConeBufferGeometry:xl,ConeGeometry:xl,CubeCamera:Ui,CubeReflectionMapping:u,CubeRefractionMapping:p,CubeTexture:Oi,CubeTextureLoader:qc,CubeUVReflectionMapping:g,CubicBezierCurve:al,CubicBezierCurve3:ol,CubicInterpolant:Xc,CullFaceBack:1,CullFaceFront:2,CullFaceFrontBack:3,CullFaceNone:0,Curve:Ko,CurvePath:ml,CustomBlending:5,CustomToneMapping:5,CylinderBufferGeometry:vl,CylinderGeometry:vl,Cylindrical:yd,Data3DTexture:At,DataArrayTexture:Tt,DataTexture:go,DataTexture2DArray:gu,DataTexture3D:yu,DataTextureLoader:$c,DataUtils:cu,DecrementStencilOp:7683,DecrementWrapStencilOp:34056,DefaultLoadingManager:Uc,DepthFormat:B,DepthStencilFormat:F,DepthTexture:Ia,DirectionalLight:fh,DirectionalLightHelper:Hd,DiscreteInterpolant:_c,DodecahedronBufferGeometry:Sl,DodecahedronGeometry:Sl,DoubleSide:2,DstAlphaFactor:206,DstColorFactor:208,DynamicCopyUsage:35050,DynamicDrawUsage:35048,DynamicReadUsage:35049,EdgesGeometry:Tl,EllipseCurve:jo,EqualDepth:4,EqualStencilFunc:514,EquirectangularReflectionMapping:m,EquirectangularRefractionMapping:f,Euler:wn,EventDispatcher:Be,ExtrudeBufferGeometry:sc,ExtrudeGeometry:sc,FileLoader:Kc,FlatShading:1,Float16BufferAttribute:oi,Float32BufferAttribute:li,Float64BufferAttribute:ci,FloatType:z,Fog:Na,FogExp2:Pa,Font:pu,FontLoader:uu,FramebufferTexture:Uo,FrontSide:0,Frustum:es,GLBufferAttribute:ud,GLSL1:"100",GLSL3:De,GreaterDepth:6,GreaterEqualDepth:5,GreaterEqualStencilFunc:518,GreaterStencilFunc:516,GridHelper:Wd,Group:Ra,HalfFloatType:E,HemisphereLight:nh,HemisphereLightHelper:Ed,HemisphereLightProbe:_h,IcosahedronBufferGeometry:ac,IcosahedronGeometry:ac,ImageBitmapLoader:Rh,ImageLoader:Qc,ImageUtils:xt,ImmediateRenderObject:mu,IncrementStencilOp:7682,IncrementWrapStencilOp:34055,InstancedBufferAttribute:xo,InstancedBufferGeometry:Sh,InstancedInterleavedBuffer:dd,InstancedMesh:Co,Int16BufferAttribute:ii,Int32BufferAttribute:ri,Int8BufferAttribute:ei,IntType:I,InterleavedBuffer:Ha,InterleavedBufferAttribute:ka,Interpolant:Ac,InterpolateDiscrete:Ce,InterpolateLinear:Ge,InterpolateSmooth:Te,InvertStencilOp:5386,KeepStencilOp:Ve,KeyframeTrack:zc,LOD:oo,LatheBufferGeometry:gl,LatheGeometry:gl,Layers:Sn,LessDepth:2,LessEqualDepth:3,LessEqualStencilFunc:515,LessStencilFunc:513,Light:th,LightProbe:vh,Line:_o,Line3:Sd,LineBasicMaterial:Go,LineCurve:ll,LineCurve3:cl,LineDashedMaterial:Tc,LineLoop:Zo,LineSegments:Wo,LinearEncoding:ze,LinearFilter:M,LinearInterpolant:Ic,LinearMipMapLinearFilter:G,LinearMipMapNearestFilter:1007,LinearMipmapLinearFilter:C,LinearMipmapNearestFilter:L,LinearSRGBColorSpace:Ne,LinearToneMapping:1,Loader:Oc,LoaderUtils:wh,LoadingManager:Fc,LoopOnce:Se,LoopPingPong:Le,LoopRepeat:Me,LuminanceAlphaFormat:k,LuminanceFormat:D,MOUSE:s,Material:jn,MaterialLoader:xh,MathUtils:tt,Matrix3:it,Matrix4:dn,MaxEquation:l,Mesh:Wi,MeshBasicMaterial:Jn,MeshDepthMaterial:wa,MeshDistanceMaterial:Sa,MeshLambertMaterial:Cc,MeshMatcapMaterial:Gc,MeshNormalMaterial:Lc,MeshPhongMaterial:Sc,MeshPhysicalMaterial:wc,MeshStandardMaterial:xc,MeshToonMaterial:Mc,MinEquation:o,MirroredRepeatWrapping:v,MixOperation:1,MultiplyBlending:4,MultiplyOperation:0,NearestFilter:x,NearestMipMapLinearFilter:1005,NearestMipMapNearestFilter:1004,NearestMipmapLinearFilter:S,NearestMipmapNearestFilter:w,NeverDepth:0,NeverStencilFunc:512,NoBlending:0,NoColorSpace:"",NoToneMapping:0,NormalAnimationBlendMode:Ie,NormalBlending:1,NotEqualDepth:7,NotEqualStencilFunc:517,NumberKeyframeTrack:Zc,Object3D:Zn,ObjectLoader:Lh,ObjectSpaceNormalMap:1,OctahedronBufferGeometry:oc,OctahedronGeometry:oc,OneFactor:201,OneMinusDstAlphaFactor:207,OneMinusDstColorFactor:209,OneMinusSrcAlphaFactor:h,OneMinusSrcColorFactor:203,OrthographicCamera:ps,PCFShadowMap:1,PCFSoftShadowMap:2,PMREMGenerator:Ss,ParametricGeometry:hu,Path:fl,PerspectiveCamera:Bi,Plane:Qi,PlaneBufferGeometry:is,PlaneGeometry:is,PlaneHelper:Kd,PointLight:ph,PointLightHelper:Xd,Points:ko,PointsMaterial:Po,PolarGridHelper:Zd,PolyhedronBufferGeometry:wl,PolyhedronGeometry:wl,PositionalAudio:Jh,PropertyBinding:rd,PropertyMixer:qh,QuadraticBezierCurve:hl,QuadraticBezierCurve3:dl,Quaternion:_t,QuaternionKeyframeTrack:Nc,QuaternionLinearInterpolant:Pc,REVISION:i,RGBADepthPacking:Ze,RGBAFormat:H,RGBAIntegerFormat:j,RGBA_ASTC_10x10_Format:be,RGBA_ASTC_10x5_Format:fe,RGBA_ASTC_10x6_Format:ge,RGBA_ASTC_10x8_Format:ye,RGBA_ASTC_12x10_Format:ve,RGBA_ASTC_12x12_Format:xe,RGBA_ASTC_4x4_Format:oe,RGBA_ASTC_5x4_Format:le,RGBA_ASTC_5x5_Format:ce,RGBA_ASTC_6x5_Format:he,RGBA_ASTC_6x6_Format:de,RGBA_ASTC_8x5_Format:ue,RGBA_ASTC_8x6_Format:pe,RGBA_ASTC_8x8_Format:me,RGBA_BPTC_Format:we,RGBA_ETC2_EAC_Format:ae,RGBA_PVRTC_2BPPV1_Format:ie,RGBA_PVRTC_4BPPV1_Format:ne,RGBA_S3TC_DXT1_Format:Q,RGBA_S3TC_DXT3_Format:q,RGBA_S3TC_DXT5_Format:$,RGBFormat:V,RGB_ETC1_Format:se,RGB_ETC2_Format:re,RGB_PVRTC_2BPPV1_Format:te,RGB_PVRTC_4BPPV1_Format:ee,RGB_S3TC_DXT1_Format:J,RGFormat:Y,RGIntegerFormat:K,RawShaderMaterial:vc,Ray:hn,Raycaster:pd,RectAreaLight:yh,RedFormat:U,RedIntegerFormat:O,ReinhardToneMapping:2,RepeatWrapping:y,ReplaceStencilOp:7681,ReverseSubtractEquation:102,RingBufferGeometry:lc,RingGeometry:lc,SRGBColorSpace:Pe,Scene:Va,ShaderChunk:ss,ShaderLib:as,ShaderMaterial:Di,ShadowMaterial:bc,Shape:Rl,ShapeBufferGeometry:cc,ShapeGeometry:cc,ShapePath:eu,ShapeUtils:tc,ShortType:A,Skeleton:vo,SkeletonHelper:Rd,SkinnedMesh:mo,SmoothShading:2,Source:wt,Sphere:tn,SphereBufferGeometry:hc,SphereGeometry:hc,Spherical:gd,SphericalHarmonics3:bh,SplineCurve:ul,SpotLight:lh,SpotLightHelper:Ld,Sprite:io,SpriteMaterial:Ba,SrcAlphaFactor:c,SrcAlphaSaturateFactor:210,SrcColorFactor:202,StaticCopyUsage:35046,StaticDrawUsage:He,StaticReadUsage:35045,StereoCamera:Ph,StreamCopyUsage:35042,StreamDrawUsage:35040,StreamReadUsage:35041,StringKeyframeTrack:Vc,SubtractEquation:101,SubtractiveBlending:3,TOUCH:r,TangentSpaceNormalMap:0,TetrahedronBufferGeometry:dc,TetrahedronGeometry:dc,TextGeometry:du,Texture:Lt,TextureLoader:eh,TorusBufferGeometry:uc,TorusGeometry:uc,TorusKnotBufferGeometry:pc,TorusKnotGeometry:pc,Triangle:Yn,TriangleFanDrawMode:2,TriangleStripDrawMode:1,TrianglesDrawMode:0,TubeBufferGeometry:mc,TubeGeometry:mc,UVMapping:d,Uint16BufferAttribute:si,Uint32BufferAttribute:ai,Uint8BufferAttribute:ti,Uint8ClampedBufferAttribute:ni,Uniform:hd,UniformsLib:rs,UniformsUtils:Hi,UnsignedByteType:T,UnsignedInt248Type:P,UnsignedIntType:_,UnsignedShort4444Type:W,UnsignedShort5551Type:Z,UnsignedShortType:X,VSMShadowMap:3,Vector2:nt,Vector3:zt,Vector4:Ct,VectorKeyframeTrack:Hc,VideoTexture:Fo,WebGL1Renderer:Za,WebGL3DRenderTarget:Xt,WebGLArrayRenderTarget:Rt,WebGLCubeRenderTarget:Yi,WebGLMultipleRenderTargets:It,WebGLMultisampleRenderTarget:fu,WebGLRenderTarget:Gt,WebGLRenderer:Wa,WebGLUtils:Ga,WireframeGeometry:fc,WrapAroundEnding:Xe,ZeroCurvatureEnding:Re,ZeroFactor:200,ZeroSlopeEnding:Ae,ZeroStencilOp:0,_SRGBAFormat:ke,sRGBEncoding:Ee});const vu=new pd,xu=new zt,wu=new zt,Su=new _t,Mu={X:new zt(1,0,0),Y:new zt(0,1,0),Z:new zt(0,0,1)},Lu={type:"change"},Cu={type:"mouseDown"},Gu={type:"mouseUp",mode:null},Tu={type:"objectChange"};class Ru extends Zn{constructor(e,t){super(),void 0===t&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const n=new ju;this._gizmo=n,this.add(n);const i=new Ju;this._plane=i,this.add(i);const s=this;function r(e,t){let r=t;Object.defineProperty(s,e,{get:function(){return void 0!==r?r:t},set:function(t){r!==t&&(r=t,i[e]=t,n[e]=t,s.dispatchEvent({type:e+"-changed",value:t}),s.dispatchEvent(Lu))}}),s[e]=t,i[e]=t,n[e]=t}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const a=new zt,o=new zt,l=new _t,c=new _t,h=new zt,d=new _t,u=new zt,p=new zt,m=new zt,f=new zt;r("worldPosition",a),r("worldPositionStart",o),r("worldQuaternion",l),r("worldQuaternionStart",c),r("cameraPosition",h),r("cameraQuaternion",d),r("pointStart",u),r("pointEnd",p),r("rotationAxis",m),r("rotationAngle",0),r("eye",f),this._offset=new zt,this._startNorm=new zt,this._endNorm=new zt,this._cameraScale=new zt,this._parentPosition=new zt,this._parentQuaternion=new _t,this._parentQuaternionInv=new _t,this._parentScale=new zt,this._worldScaleStart=new zt,this._worldQuaternionInv=new _t,this._worldScale=new zt,this._positionStart=new zt,this._quaternionStart=new _t,this._scaleStart=new zt,this._getPointer=Au.bind(this),this._onPointerDown=Iu.bind(this),this._onPointerHover=Xu.bind(this),this._onPointerMove=_u.bind(this),this._onPointerUp=zu.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye):this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(void 0===this.object||!0===this.dragging)return;vu.setFromCamera(e,this.camera);const t=Eu(this._gizmo.picker[this.mode],vu);this.axis=t?t.object.name:null}pointerDown(e){if(void 0!==this.object&&!0!==this.dragging&&0===e.button&&null!==this.axis){vu.setFromCamera(e,this.camera);const t=Eu(this._plane,vu,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Cu.mode=this.mode,this.dispatchEvent(Cu)}}pointerMove(e){const t=this.axis,n=this.mode,i=this.object;let s=this.space;if("scale"===n?s="local":"E"!==t&&"XYZE"!==t&&"XYZ"!==t||(s="world"),void 0===i||null===t||!1===this.dragging||-1!==e.button)return;vu.setFromCamera(e,this.camera);const r=Eu(this._plane,vu,!0);if(r){if(this.pointEnd.copy(r.point).sub(this.worldPositionStart),"translate"===n)this._offset.copy(this.pointEnd).sub(this.pointStart),"local"===s&&"XYZ"!==t&&this._offset.applyQuaternion(this._worldQuaternionInv),-1===t.indexOf("X")&&(this._offset.x=0),-1===t.indexOf("Y")&&(this._offset.y=0),-1===t.indexOf("Z")&&(this._offset.z=0),"local"===s&&"XYZ"!==t?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&("local"===s&&(i.position.applyQuaternion(Su.copy(this._quaternionStart).invert()),-1!==t.search("X")&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),"world"===s&&(i.parent&&i.position.add(xu.setFromMatrixPosition(i.parent.matrixWorld)),-1!==t.search("X")&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(xu.setFromMatrixPosition(i.parent.matrixWorld))));else if("scale"===n){if(-1!==t.search("XYZ")){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),wu.set(e,e,e)}else xu.copy(this.pointStart),wu.copy(this.pointEnd),xu.applyQuaternion(this._worldQuaternionInv),wu.applyQuaternion(this._worldQuaternionInv),wu.divide(xu),-1===t.search("X")&&(wu.x=1),-1===t.search("Y")&&(wu.y=1),-1===t.search("Z")&&(wu.z=1);i.scale.copy(this._scaleStart).multiply(wu),this.scaleSnap&&(-1!==t.search("X")&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Y")&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Z")&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===n){this._offset.copy(this.pointEnd).sub(this.pointStart);const e=20/this.worldPosition.distanceTo(xu.setFromMatrixPosition(this.camera.matrixWorld));"E"===t?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1):"XYZE"===t?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(xu.copy(this.rotationAxis).cross(this.eye))*e):"X"!==t&&"Y"!==t&&"Z"!==t||(this.rotationAxis.copy(Mu[t]),xu.copy(Mu[t]),"local"===s&&xu.applyQuaternion(this.worldQuaternion),this.rotationAngle=this._offset.dot(xu.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===s&&"E"!==t&&"XYZE"!==t?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Su.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Su.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Lu),this.dispatchEvent(Tu)}}pointerUp(e){0===e.button&&(this.dragging&&null!==this.axis&&(Gu.mode=this.mode,this.dispatchEvent(Gu)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()}))}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Lu),this.dispatchEvent(Tu),this.pointStart.copy(this.pointEnd))}getRaycaster(){return vu}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}update(){console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}}function Au(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{const t=this.domElement.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*2-1,y:-(e.clientY-t.top)/t.height*2+1,button:e.button}}}function Xu(e){if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(e))}}function Iu(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function _u(e){this.enabled&&this.pointerMove(this._getPointer(e))}function zu(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(e)))}function Eu(e,t,n){const i=t.intersectObject(e,!0);for(let e=0;e<i.length;e++)if(i[e].object.visible||n)return i[e];return!1}const Wu=new wn,Zu=new zt(0,1,0),Pu=new zt(0,0,0),Nu=new dn,Vu=new _t,Hu=new _t,Du=new zt,ku=new dn,Bu=new zt(1,0,0),Fu=new zt(0,1,0),Uu=new zt(0,0,1),Ou=new zt,Yu=new zt,Ku=new zt;class ju extends Zn{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new Jn({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new Go({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=e.clone();n.opacity=.15;const i=t.clone();i.opacity=.5;const s=e.clone();s.color.setHex(16711680);const r=e.clone();r.color.setHex(65280);const a=e.clone();a.color.setHex(255);const o=e.clone();o.color.setHex(16711680),o.opacity=.5;const l=e.clone();l.color.setHex(65280),l.opacity=.5;const c=e.clone();c.color.setHex(255),c.opacity=.5;const h=e.clone();h.opacity=.25;const d=e.clone();d.color.setHex(16776960),d.opacity=.25;e.clone().color.setHex(16776960);const u=e.clone();u.color.setHex(7895160);const p=new vl(0,.04,.1,12);p.translate(0,.05,0);const m=new Pi(.08,.08,.08);m.translate(0,.04,0);const f=new yi;f.setAttribute("position",new li([0,0,0,1,0,0],3));const g=new vl(.0075,.0075,.5,3);function y(e,t){const n=new uc(e,.0075,3,64,t*Math.PI*2);return n.rotateY(Math.PI/2),n.rotateX(Math.PI/2),n}g.translate(0,.25,0);const b={X:[[new Wi(p,s),[.5,0,0],[0,0,-Math.PI/2]],[new Wi(p,s),[-.5,0,0],[0,0,Math.PI/2]],[new Wi(g,s),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new Wi(p,r),[0,.5,0]],[new Wi(p,r),[0,-.5,0],[Math.PI,0,0]],[new Wi(g,r)]],Z:[[new Wi(p,a),[0,0,.5],[Math.PI/2,0,0]],[new Wi(p,a),[0,0,-.5],[-Math.PI/2,0,0]],[new Wi(g,a),null,[Math.PI/2,0,0]]],XYZ:[[new Wi(new oc(.1,0),h.clone()),[0,0,0]]],XY:[[new Wi(new Pi(.15,.15,.01),c.clone()),[.15,.15,0]]],YZ:[[new Wi(new Pi(.15,.15,.01),o.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Wi(new Pi(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},v={X:[[new Wi(new vl(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new Wi(new vl(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new Wi(new vl(.2,0,.6,4),n),[0,.3,0]],[new Wi(new vl(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new Wi(new vl(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new Wi(new vl(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new Wi(new oc(.2,0),n)]],XY:[[new Wi(new Pi(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new Wi(new Pi(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Wi(new Pi(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]]},x={START:[[new Wi(new oc(.01,2),i),null,null,null,"helper"]],END:[[new Wi(new oc(.01,2),i),null,null,null,"helper"]],DELTA:[[new _o(function(){const e=new yi;return e.setAttribute("position",new li([0,0,0,1,1,1],3)),e}(),i),null,null,null,"helper"]],X:[[new _o(f,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new _o(f,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new _o(f,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},w={XYZE:[[new Wi(y(.5,1),u),null,[0,Math.PI/2,0]]],X:[[new Wi(y(.5,.5),s)]],Y:[[new Wi(y(.5,.5),r),null,[0,0,-Math.PI/2]]],Z:[[new Wi(y(.5,.5),a),null,[0,Math.PI/2,0]]],E:[[new Wi(y(.75,1),d),null,[0,Math.PI/2,0]]]},S={AXIS:[[new _o(f,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},M={XYZE:[[new Wi(new hc(.25,10,8),n)]],X:[[new Wi(new uc(.5,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new Wi(new uc(.5,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new Wi(new uc(.5,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new Wi(new uc(.75,.1,2,24),n)]]},L={X:[[new Wi(m,s),[.5,0,0],[0,0,-Math.PI/2]],[new Wi(g,s),[0,0,0],[0,0,-Math.PI/2]],[new Wi(m,s),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new Wi(m,r),[0,.5,0]],[new Wi(g,r)],[new Wi(m,r),[0,-.5,0],[0,0,Math.PI]]],Z:[[new Wi(m,a),[0,0,.5],[Math.PI/2,0,0]],[new Wi(g,a),[0,0,0],[Math.PI/2,0,0]],[new Wi(m,a),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new Wi(new Pi(.15,.15,.01),c),[.15,.15,0]]],YZ:[[new Wi(new Pi(.15,.15,.01),o),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Wi(new Pi(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new Wi(new Pi(.1,.1,.1),h.clone())]]},C={X:[[new Wi(new vl(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new Wi(new vl(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new Wi(new vl(.2,0,.6,4),n),[0,.3,0]],[new Wi(new vl(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new Wi(new vl(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new Wi(new vl(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new Wi(new Pi(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new Wi(new Pi(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Wi(new Pi(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new Wi(new Pi(.2,.2,.2),n),[0,0,0]]]},G={X:[[new _o(f,i.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new _o(f,i.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new _o(f,i.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function T(e){const t=new Zn;for(const n in e)for(let i=e[n].length;i--;){const s=e[n][i][0].clone(),r=e[n][i][1],a=e[n][i][2],o=e[n][i][3],l=e[n][i][4];s.name=n,s.tag=l,r&&s.position.set(r[0],r[1],r[2]),a&&s.rotation.set(a[0],a[1],a[2]),o&&s.scale.set(o[0],o[1],o[2]),s.updateMatrix();const c=s.geometry.clone();c.applyMatrix4(s.matrix),s.geometry=c,s.renderOrder=1/0,s.position.set(0,0,0),s.rotation.set(0,0,0),s.scale.set(1,1,1),t.add(s)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=T(b)),this.add(this.gizmo.rotate=T(w)),this.add(this.gizmo.scale=T(L)),this.add(this.picker.translate=T(v)),this.add(this.picker.rotate=T(M)),this.add(this.picker.scale=T(C)),this.add(this.helper.translate=T(x)),this.add(this.helper.rotate=T(S)),this.add(this.helper.scale=T(G)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t="local"===("scale"===this.mode?"local":this.space)?this.worldQuaternion:Hu;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){const i=n[e];let s;if(i.visible=!0,i.rotation.set(0,0,0),i.position.copy(this.worldPosition),s=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),i.scale.set(1,1,1).multiplyScalar(s*this.size/4),"helper"!==i.tag){if(i.quaternion.copy(t),"translate"===this.mode||"scale"===this.mode){const e=.99,n=.2;"X"===i.name&&Math.abs(Zu.copy(Bu).applyQuaternion(t).dot(this.eye))>e&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),"Y"===i.name&&Math.abs(Zu.copy(Fu).applyQuaternion(t).dot(this.eye))>e&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),"Z"===i.name&&Math.abs(Zu.copy(Uu).applyQuaternion(t).dot(this.eye))>e&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),"XY"===i.name&&Math.abs(Zu.copy(Uu).applyQuaternion(t).dot(this.eye))<n&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),"YZ"===i.name&&Math.abs(Zu.copy(Bu).applyQuaternion(t).dot(this.eye))<n&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1),"XZ"===i.name&&Math.abs(Zu.copy(Fu).applyQuaternion(t).dot(this.eye))<n&&(i.scale.set(1e-10,1e-10,1e-10),i.visible=!1)}else"rotate"===this.mode&&(Vu.copy(t),Zu.copy(this.eye).applyQuaternion(Su.copy(t).invert()),-1!==i.name.search("E")&&i.quaternion.setFromRotationMatrix(Nu.lookAt(this.eye,Pu,Fu)),"X"===i.name&&(Su.setFromAxisAngle(Bu,Math.atan2(-Zu.y,Zu.z)),Su.multiplyQuaternions(Vu,Su),i.quaternion.copy(Su)),"Y"===i.name&&(Su.setFromAxisAngle(Fu,Math.atan2(Zu.x,Zu.z)),Su.multiplyQuaternions(Vu,Su),i.quaternion.copy(Su)),"Z"===i.name&&(Su.setFromAxisAngle(Uu,Math.atan2(Zu.y,Zu.x)),Su.multiplyQuaternions(Vu,Su),i.quaternion.copy(Su)));i.visible=i.visible&&(-1===i.name.indexOf("X")||this.showX),i.visible=i.visible&&(-1===i.name.indexOf("Y")||this.showY),i.visible=i.visible&&(-1===i.name.indexOf("Z")||this.showZ),i.visible=i.visible&&(-1===i.name.indexOf("E")||this.showX&&this.showY&&this.showZ),i.material._color=i.material._color||i.material.color.clone(),i.material._opacity=i.material._opacity||i.material.opacity,i.material.color.copy(i.material._color),i.material.opacity=i.material._opacity,this.enabled&&this.axis&&(i.name===this.axis||this.axis.split("").some((function(e){return i.name===e})))&&(i.material.color.setHex(16776960),i.material.opacity=1)}else i.visible=!1,"AXIS"===i.name?(i.position.copy(this.worldPositionStart),i.visible=!!this.axis,"X"===this.axis&&(Su.setFromEuler(Wu.set(0,0,0)),i.quaternion.copy(t).multiply(Su),Math.abs(Zu.copy(Bu).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),"Y"===this.axis&&(Su.setFromEuler(Wu.set(0,0,Math.PI/2)),i.quaternion.copy(t).multiply(Su),Math.abs(Zu.copy(Fu).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),"Z"===this.axis&&(Su.setFromEuler(Wu.set(0,Math.PI/2,0)),i.quaternion.copy(t).multiply(Su),Math.abs(Zu.copy(Uu).applyQuaternion(t).dot(this.eye))>.9&&(i.visible=!1)),"XYZE"===this.axis&&(Su.setFromEuler(Wu.set(0,Math.PI/2,0)),Zu.copy(this.rotationAxis),i.quaternion.setFromRotationMatrix(Nu.lookAt(Pu,Zu,Fu)),i.quaternion.multiply(Su),i.visible=this.dragging),"E"===this.axis&&(i.visible=!1)):"START"===i.name?(i.position.copy(this.worldPositionStart),i.visible=this.dragging):"END"===i.name?(i.position.copy(this.worldPosition),i.visible=this.dragging):"DELTA"===i.name?(i.position.copy(this.worldPositionStart),i.quaternion.copy(this.worldQuaternionStart),xu.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),xu.applyQuaternion(this.worldQuaternionStart.clone().invert()),i.scale.copy(xu),i.visible=this.dragging):(i.quaternion.copy(t),this.dragging?i.position.copy(this.worldPositionStart):i.position.copy(this.worldPosition),this.axis&&(i.visible=-1!==this.axis.search(i.name)))}super.updateMatrixWorld(e)}}class Ju extends Wi{constructor(){super(new is(1e5,1e5,2,2),new Jn({visible:!1,wireframe:!0,side:2,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(t="local"),Ou.copy(Bu).applyQuaternion("local"===t?this.worldQuaternion:Hu),Yu.copy(Fu).applyQuaternion("local"===t?this.worldQuaternion:Hu),Ku.copy(Uu).applyQuaternion("local"===t?this.worldQuaternion:Hu),Zu.copy(Yu),this.mode){case"translate":case"scale":switch(this.axis){case"X":Zu.copy(this.eye).cross(Ou),Du.copy(Ou).cross(Zu);break;case"Y":Zu.copy(this.eye).cross(Yu),Du.copy(Yu).cross(Zu);break;case"Z":Zu.copy(this.eye).cross(Ku),Du.copy(Ku).cross(Zu);break;case"XY":Du.copy(Ku);break;case"YZ":Du.copy(Ou);break;case"XZ":Zu.copy(Ku),Du.copy(Yu);break;case"XYZ":case"E":Du.set(0,0,0)}break;case"rotate":default:Du.set(0,0,0)}0===Du.length()?this.quaternion.copy(this.cameraQuaternion):(ku.lookAt(xu.set(0,0,0),Du,Zu),this.quaternion.setFromRotationMatrix(ku)),super.updateMatrixWorld(e)}}var Qu,qu={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-qu.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*qu.Bounce.In(2*e):.5*qu.Bounce.Out(2*e-1)+.5}}},$u="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},ep=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},e.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},e.prototype.update=function(e,t){void 0===e&&(e=$u()),void 0===t&&(t=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var s=this._tweens[n[i]],r=!t;s&&!1===s.update(e,r)&&!t&&delete this._tweens[n[i]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),tp={Linear:function(e,t){var n=e.length-1,i=n*t,s=Math.floor(i),r=tp.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[s],e[s+1>n?n:s+1],i-s)},Bezier:function(e,t){for(var n=0,i=e.length-1,s=Math.pow,r=tp.Utils.Bernstein,a=0;a<=i;a++)n+=s(1-t,i-a)*s(t,a)*e[a]*r(i,a);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,s=Math.floor(i),r=tp.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(s=Math.floor(i=n*(1+t))),r(e[(s-1+n)%n],e[s],e[(s+1)%n],e[(s+2)%n],i-s)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[s?s-1:0],e[s],e[n<s+1?n:s+1],e[n<s+2?n:s+2],i-s)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=tp.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(Qu=[1],function(e){var t=1;if(Qu[e])return Qu[e];for(var n=e;n>1;n--)t*=n;return Qu[e]=t,t}),CatmullRom:function(e,t,n,i,s){var r=.5*(n-e),a=.5*(i-t),o=s*s;return(2*t-2*n+r+a)*(s*o)+(-3*t+3*n-2*r-a)*o+r*s+t}}},np=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),ip=new ep,sp=function(){function e(e,t){void 0===t&&(t=ip),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=qu.Linear.None,this._interpolationFunction=tp.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=np.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},e.prototype.duration=function(e){return this._duration=e,this},e.prototype.start=function(e){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var t in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(t),this._valuesStart[t]=this._valuesStartRepeat[t];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==e?"string"==typeof e?$u()+parseFloat(e):e:$u(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(e,t,n,i){for(var s in n){var r=e[s],a=Array.isArray(r),o=a?"array":typeof r,l=!a&&Array.isArray(n[s]);if("undefined"!==o&&"function"!==o){if(l){var c=n[s];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,r)),n[s]=[r].concat(c)}if("object"!==o&&!a||!r||l)void 0===t[s]&&(t[s]=r),a||(t[s]*=1),i[s]=l?n[s].slice().reverse():t[s]||0;else{for(var h in t[s]=a?[]:{},r)t[s][h]=r[h];i[s]=a?[]:{},this._setupProperties(r,t[s],n[s],i[s])}}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=$u()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this)),this},e.prototype.resume=function(e){return void 0===e&&(e=$u()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return this._group=e,this},e.prototype.delay=function(e){return this._delayTime=e,this},e.prototype.repeat=function(e){return this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return this._yoyo=e,this},e.prototype.easing=function(e){return this._easingFunction=e,this},e.prototype.interpolation=function(e){return this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(e,t){if(void 0===e&&(e=$u()),void 0===t&&(t=!0),this._isPaused)return!0;var n,i,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>s)return!1;t&&this.start(e)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),i=(e-this._startTime)/this._duration,i=0===this._duration||i>1?1:i;var r=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,r),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(this._repeat>0){for(n in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,o=this._chainedTweens.length;a<o;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,t,n,i){for(var s in n)if(void 0!==t[s]){var r=t[s]||0,a=n[s],o=Array.isArray(e[s]),l=Array.isArray(a);!o&&l?e[s]=this._interpolationFunction(a,i):"object"==typeof a&&a?this._updateProperties(e[s],r,a,i):"number"==typeof(a=this._handleRelativeValue(r,a))&&(e[s]=r+(a-r)*i)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],n=this._valuesEnd[e];this._valuesStartRepeat[e]="string"==typeof n?this._valuesStartRepeat[e]+parseFloat(n):this._valuesEnd[e],this._valuesEnd[e]=t},e}(),rp=np.nextId,ap=ip,op=ap.getAll.bind(ap),lp=ap.removeAll.bind(ap),cp=ap.add.bind(ap),hp=ap.remove.bind(ap),dp=ap.update.bind(ap),up={Easing:qu,Group:ep,Interpolation:tp,now:$u,Sequence:np,nextId:rp,Tween:sp,VERSION:"18.6.4",getAll:op,removeAll:lp,add:cp,remove:hp,update:dp};const pp="[soonspacejs]: ",mp="In soonspacejs: ",fp=(e,t)=>{let n="";for(const e in t)n+=`${e}: ${t[e]};`;console.log(`%c${e}`,n)},gp=e=>{console.warn(mp+e)};function yp(e){return e instanceof zt?e:new zt(e.x,e.y,e.z)}function bp(e){return e instanceof wn?e:new wn(e.x,e.y,e.z)}function vp(e){return new Zt(new zt(0,0,0),new zt(500,500,500)).setFromObject(e)}function xp(e,t,n){const i=n.clone();return Math.abs(t[e]-n[e])>Math.PI&&(t[e]>n[e]?i[e]+=2*Math.PI:i[e]-=2*Math.PI),i}function wp(e,t){const n=xp("x",e,t),i=xp("y",e,t),s=xp("z",e,t);return new wn(n.x,i.y,s.z,t.order)}function Sp(e){return Math.PI/180*e}function Mp(e,t=!0){return t?{position:e.getWorldPosition(new zt),rotation:(new wn).setFromQuaternion(e.getWorldQuaternion(new _t)),scale:e.getWorldScale(new zt)}:{position:e.position.clone(),rotation:e.rotation.clone(),scale:e.scale.clone()}}function Lp(e,t,n=!0){const i=Mp(t,n);e.position.copy(i.position),e.rotation.copy(i.rotation),e.scale.copy(i.scale)}function Cp(e){return!!e.visible&&(!e.parent||Cp(e.parent))}class Gp{constructor(){this.min=null,this.roots=[],this.nodes=[]}shift(){const e=this.min;if(null==e||this.roots.length<1)return this.min=null,e;this.remove(e),this.roots.length>50&&this.consolidate();let t=1/0;const n=this.roots.length;for(let e=0;e<n;e++){const n=this.roots[e],i=this.getDistance(n);i<t&&(t=i,this.min=n)}return e}consolidate(){const e=[[],[],[],[],[],[],[]],t=e.length-1,n=this.roots.length;for(let i=0;i<n;i++){const n=this.roots[i],s=this.nodes[n].depth;s<t&&e[s].push(n)}for(let n=0;n<=t;n++)for(;e[n].length>1;){const i=e[n].shift(),s=e[n].shift(),r=n+1;let a=-1;this.nodes[i].distance<this.nodes[s].distance?(this.nodes[i].depth=r,this.nodes[i].children.push(s),this.nodes[s].parent=i,r<=t&&e[r].push(i),a=this.roots.indexOf(s)):(this.nodes[s].depth=r,this.nodes[s].children.push(i),this.nodes[i].parent=s,r<=t&&e[r].push(s),a=this.roots.indexOf(i)),a>-1&&this.roots.splice(a,1)}}add(e,t){this.nodes[e]={nodeIndex:e,distance:t,depth:0,parent:null,children:[]},(!this.min||t<this.nodes[this.min].distance)&&(this.min=e),this.roots.push(e)}update(e,t){this.remove(e),this.add(e,t)}remove(e){if(!this.nodes[e])return;const t=this.nodes[e].children.length;if(t>0)for(let n=0;n<t;n++){const t=this.nodes[e].children[n];this.nodes[t].parent=this.nodes[e].parent,null==this.nodes[t].parent&&this.roots.push(t)}let n=this.nodes[e].parent;if(null==n){const t=this.roots.indexOf(e);t>-1&&this.roots.splice(t,1)}else for(;n;)this.nodes[n].depth--,n=this.nodes[n].parent}getDistance(e){return this.nodes[e]?this.nodes[e].distance:1/0}}function Tp(e,t=["px.jpg","nx.jpg","py.jpg","ny.jpg","pz.jpg","nz.jpg"]){return new Promise((n=>{(new qc).setPath(e).load(t,(e=>{e.format=H,n(e)}))}))}function Rp(e){if(!e)return null;const{colors:t,stops:n,size:i=1024}=e,s=document.createElement("canvas"),r=s.getContext("2d");if(!r)return null;s.width=16,s.height=i;const a=r.createLinearGradient(0,0,0,i),o=new bt,l=t.map((e=>o.set(e).getStyle()));for(let e=0,t=l.length-1;e<=t;e++)a.addColorStop(n?n[e]:e/t,l[e]);r.fillStyle=a,r.fillRect(0,0,16,i);const c=new Lt(s);return c.needsUpdate=!0,c}const Ap=e=>{const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)};function Xp(e){return Array.isArray(e)?function(e){return e.map((e=>Xp(e)))}(e):"object"==typeof e&&null!==e?function(e){if(Object.getPrototypeOf(e)===Object.prototype){const t={};for(const n in e)t[n]=Xp(e[n]);return t}return e}(e):e}const Ip=e=>Xm(e.material)?e.material.map((e=>e.clone())):e.material.clone();
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation.
|
|
9
|
-
|
|
10
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
-
purpose with or without fee is hereby granted.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
***************************************************************************** */var _p=function(e,t){return(_p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var zp=function(){return(zp=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};function Ep(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}function Wp(e,t,n,i){return new(n||(n=Promise))((function(s,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function o(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,o)}l((i=i.apply(e,t||[])).next())}))}var Zp=Object.create?function(e,t,n,i){void 0===i&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]};function Pp(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Np(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,s,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){s={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}function Vp(e){return this instanceof Vp?(this.v=e,this):new Vp(e)}var Hp=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};var Dp=Object.freeze({__proto__:null,__extends:function(e,t){function n(){this.constructor=e}_p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return zp},__rest:Ep,__decorate:function(e,t,n,i){var s,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(a=(r<3?s(a):r>3?s(t,n,a):s(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a},__param:function(e,t){return function(n,i){t(n,i,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:Wp,__generator:function(e,t){var n,i,s,r,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function o(r){return function(o){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(s=2&r[0]?i.return:r[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;switch(i=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(s=a.trys,(s=s.length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){a.label=r[1];break}if(6===r[0]&&a.label<s[1]){a.label=s[1],s=r;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(r);break}s[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,o])}}},__createBinding:Zp,__exportStar:function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||Zp(t,e,n)},__values:Pp,__read:Np,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Np(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),s=0;for(t=0;t<n;t++)for(var r=arguments[t],a=0,o=r.length;a<o;a++,s++)i[s]=r[a];return i},__await:Vp,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,s=n.apply(e,t||[]),r=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(e){s[e]&&(i[e]=function(t){return new Promise((function(n,i){r.push([e,t,n,i])>1||o(e,t)}))})}function o(e,t){try{(n=s[e](t)).value instanceof Vp?Promise.resolve(n.value.v).then(l,c):h(r[0][2],n)}catch(e){h(r[0][3],e)}var n}function l(e){o("next",e)}function c(e){o("throw",e)}function h(e,t){e(t),r.shift(),r.length&&o(r[0][0],r[0][1])}},__asyncDelegator:function(e){var t,n;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,s){t[i]=e[i]?function(t){return(n=!n)?{value:Vp(e[i](t)),done:"return"===i}:s?s(t):t}:s}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Pp(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,s){(function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)})(i,s,(t=e[n](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&Zp(t,e,n);return Hp(t,e),t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}});const kp=e=>Wp(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if(200===t.status)return t;throw new Error(`Failed to fetch file: ${e}`)})),Bp=e=>{"function"==typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e)};class Fp{constructor(){this.pluginCallbacks=[],this.register((function(e){return new vm(e)})),this.register((function(e){return new xm(e)})),this.register((function(e){return new wm(e)})),this.register((function(e){return new Lm(e)})),this.register((function(e){return new Cm(e)})),this.register((function(e){return new Sm(e)})),this.register((function(e){return new Mm(e)}))}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){"object"==typeof n&&(console.warn("THREE.GLTFExporter: parse() expects options as the fourth argument now."),i=n);const s=new bm,r=[];for(let e=0,t=this.pluginCallbacks.length;e<t;e++)r.push(this.pluginCallbacks[e](s));s.setPlugins(r),s.write(e,t,i).catch(n)}parseAsync(e,t){const n=this;return new Promise((function(i,s){n.parse(e,i,s,t)}))}}const Up=0,Op=1,Yp=2,Kp=3,jp=4,Jp=5121,Qp=5123,qp=5126,$p=5125,em=34962,tm=34963,nm=9728,im=9729,sm=9984,rm=9985,am=9986,om=9987,lm=33071,cm=33648,hm=10497,dm={};dm[1003]=nm,dm[1004]=sm,dm[1005]=am,dm[1006]=im,dm[1007]=rm,dm[1008]=om,dm[1001]=lm,dm[1e3]=hm,dm[1002]=cm;const um={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"};function pm(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))}function mm(e){return 4*Math.ceil(e/4)}function fm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=mm(e.byteLength);if(n!==e.byteLength){const i=new Uint8Array(n);if(i.set(new Uint8Array(e)),0!==t)for(let s=e.byteLength;s<n;s++)i[s]=t;return i.buffer}return e}function gm(){return"undefined"==typeof document&&"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas")}function ym(e,t){if(void 0!==e.toBlob)return new Promise((n=>e.toBlob(n,t)));let n;return"image/jpeg"===t?n=.92:"image/webp"===t&&(n=.8),e.convertToBlob({type:t,quality:n})}class bm{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,n){this.options=Object.assign({},{binary:!1,trs:!1,onlyVisible:!0,truncateDrawRange:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const i=this,s=i.buffers,r=i.json;n=i.options;const a=i.extensionsUsed,o=new Blob(s,{type:"application/octet-stream"}),l=Object.keys(a);if(l.length>0&&(r.extensionsUsed=l),r.buffers&&r.buffers.length>0&&(r.buffers[0].byteLength=o.size),!0===n.binary){const e=new FileReader;e.readAsArrayBuffer(o),e.onloadend=function(){const n=fm(e.result),i=new DataView(new ArrayBuffer(8));i.setUint32(0,n.byteLength,!0),i.setUint32(4,5130562,!0);const s=fm((a=JSON.stringify(r),(new TextEncoder).encode(a).buffer),32);var a;const o=new DataView(new ArrayBuffer(8));o.setUint32(0,s.byteLength,!0),o.setUint32(4,1313821514,!0);const l=new ArrayBuffer(12),c=new DataView(l);c.setUint32(0,1179937895,!0),c.setUint32(4,2,!0);const h=12+o.byteLength+s.byteLength+i.byteLength+n.byteLength;c.setUint32(8,h,!0);const d=new Blob([l,o,s,i,n],{type:"application/octet-stream"}),u=new FileReader;u.readAsArrayBuffer(d),u.onloadend=function(){t(u.result)}}}else if(r.buffers&&r.buffers.length>0){const e=new FileReader;e.readAsDataURL(o),e.onloadend=function(){const n=e.result;r.buffers[0].uri=n,t(r)}}else t(r)}serializeUserData(e,t){if(0===Object.keys(e.userData).length)return;const n=this.options,i=this.extensionsUsed;try{const s=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&s.gltfExtensions){void 0===t.extensions&&(t.extensions={});for(const e in s.gltfExtensions)t.extensions[e]=s.gltfExtensions[e],i[e]=!0;delete s.gltfExtensions}Object.keys(s).length>0&&(t.extras=s)}catch(t){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+t.message)}}getUID(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!1===this.uids.has(e)){const t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const t=new zt;for(let n=0,i=e.count;n<i;n++)if(Math.abs(t.fromBufferAttribute(e,n).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);const n=e.clone(),i=new zt;for(let e=0,t=n.count;e<t;e++)i.fromBufferAttribute(n,e),0===i.x&&0===i.y&&0===i.z?i.setX(1):i.normalize(),n.setXYZ(e,i.x,i.y,i.z);return t.attributesNormalized.set(e,n),n}applyTextureTransform(e,t){let n=!1;const i={};0===t.offset.x&&0===t.offset.y||(i.offset=t.offset.toArray(),n=!0),0!==t.rotation&&(i.rotation=t.rotation,n=!0),1===t.repeat.x&&1===t.repeat.y||(i.scale=t.repeat.toArray(),n=!0),n&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=i,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,t){if(e===t)return e;function n(e){return e.encoding===Ee?function(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}:function(e){return e}}console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures.");const i=null==e?void 0:e.image,s=null==t?void 0:t.image,r=Math.max((null==i?void 0:i.width)||0,(null==s?void 0:s.width)||0),a=Math.max((null==i?void 0:i.height)||0,(null==s?void 0:s.height)||0),o=gm();o.width=r,o.height=a;const l=o.getContext("2d");l.fillStyle="#00ffff",l.fillRect(0,0,r,a);const c=l.getImageData(0,0,r,a);if(i){l.drawImage(i,0,0,r,a);const t=n(e),s=l.getImageData(0,0,r,a).data;for(let e=2;e<s.length;e+=4)c.data[e]=256*t(s[e]/256)}if(s){l.drawImage(s,0,0,r,a);const e=n(t),i=l.getImageData(0,0,r,a).data;for(let t=1;t<i.length;t+=4)c.data[t]=256*e(i[t]/256)}l.putImageData(c,0,0);const h=(e||t).clone();return h.source=new wt(o),h.encoding=ze,h}processBuffer(e){const t=this.json,n=this.buffers;return t.buffers||(t.buffers=[{byteLength:0}]),n.push(e),0}processBufferView(e,t,n,i,s){const r=this.json;let a;r.bufferViews||(r.bufferViews=[]),a=t===Jp?1:t===Qp?2:4;const o=mm(i*e.itemSize*a),l=new DataView(new ArrayBuffer(o));let c=0;for(let s=n;s<n+i;s++)for(let n=0;n<e.itemSize;n++){let i;e.itemSize>4?i=e.array[s*e.itemSize+n]:0===n?i=e.getX(s):1===n?i=e.getY(s):2===n?i=e.getZ(s):3===n&&(i=e.getW(s)),t===qp?l.setFloat32(c,i,!0):t===$p?l.setUint32(c,i,!0):t===Qp?l.setUint16(c,i,!0):t===Jp&&l.setUint8(c,i),c+=a}const h={buffer:this.processBuffer(l.buffer),byteOffset:this.byteOffset,byteLength:o};void 0!==s&&(h.target=s),s===em&&(h.byteStride=e.itemSize*a),this.byteOffset+=o,r.bufferViews.push(h);return{id:r.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const t=this,n=t.json;return n.bufferViews||(n.bufferViews=[]),new Promise((function(i){const s=new FileReader;s.readAsArrayBuffer(e),s.onloadend=function(){const e=fm(s.result),r={buffer:t.processBuffer(e),byteOffset:t.byteOffset,byteLength:e.byteLength};t.byteOffset+=e.byteLength,i(n.bufferViews.push(r)-1)}}))}processAccessor(e,t,n,i){const s=this.options,r=this.json;let a;if(e.array.constructor===Float32Array)a=qp;else if(e.array.constructor===Uint32Array)a=$p;else if(e.array.constructor===Uint16Array)a=Qp;else{if(e.array.constructor!==Uint8Array)throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type.");a=Jp}if(void 0===n&&(n=0),void 0===i&&(i=e.count),s.truncateDrawRange&&void 0!==t&&null===t.index){const s=n+i,r=t.drawRange.count===1/0?e.count:t.drawRange.start+t.drawRange.count;n=Math.max(n,t.drawRange.start),(i=Math.min(s,r)-n)<0&&(i=0)}if(0===i)return null;const o=function(e,t,n){const i={min:new Array(e.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(e.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let s=t;s<t+n;s++)for(let t=0;t<e.itemSize;t++){let n;e.itemSize>4?n=e.array[s*e.itemSize+t]:0===t?n=e.getX(s):1===t?n=e.getY(s):2===t?n=e.getZ(s):3===t&&(n=e.getW(s)),i.min[t]=Math.min(i.min[t],n),i.max[t]=Math.max(i.max[t],n)}return i}(e,n,i);let l;void 0!==t&&(l=e===t.index?tm:em);const c=this.processBufferView(e,a,n,i,l),h={bufferView:c.id,byteOffset:c.byteOffset,componentType:a,count:i,max:o.max,min:o.min,type:{1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",16:"MAT4"}[e.itemSize]};return!0===e.normalized&&(h.normalized=!0),r.accessors||(r.accessors=[]),r.accessors.push(h)-1}processImage(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";const s=this,r=s.cache,a=s.json,o=s.options,l=s.pending;r.images.has(e)||r.images.set(e,{});const c=r.images.get(e),h=i+":flipY/"+n.toString();if(void 0!==c[h])return c[h];a.images||(a.images=[]);const d={mimeType:i},u=gm();u.width=Math.min(e.width,o.maxTextureSize),u.height=Math.min(e.height,o.maxTextureSize);const p=u.getContext("2d");if(!0===n&&(p.translate(0,u.height),p.scale(1,-1)),void 0!==e.data){t!==H&&console.error("GLTFExporter: Only RGBAFormat is supported."),(e.width>o.maxTextureSize||e.height>o.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const n=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;t<n.length;t+=4)n[t+0]=e.data[t+0],n[t+1]=e.data[t+1],n[t+2]=e.data[t+2],n[t+3]=e.data[t+3];p.putImageData(new ImageData(n,e.width,e.height),0,0)}else p.drawImage(e,0,0,u.width,u.height);!0===o.binary?l.push(ym(u,i).then((e=>s.processBufferViewImage(e))).then((e=>{d.bufferView=e}))):void 0!==u.toDataURL?d.uri=u.toDataURL(i):l.push(ym(u,i).then((e=>(new FileReader).readAsDataURL(e))).then((e=>{d.uri=e})));const m=a.images.push(d)-1;return c[h]=m,m}processSampler(e){const t=this.json;t.samplers||(t.samplers=[]);const n={magFilter:dm[e.magFilter],minFilter:dm[e.minFilter],wrapS:dm[e.wrapS],wrapT:dm[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){const t=this.cache,n=this.json;if(t.textures.has(e))return t.textures.get(e);n.textures||(n.textures=[]);let i=e.userData.mimeType;"image/webp"===i&&(i="image/png");const s={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,i)};e.name&&(s.name=e.name),this._invokeAll((function(t){t.writeTexture&&t.writeTexture(e,s)}));const r=n.textures.push(s)-1;return t.textures.set(e,r),r}processMaterial(e){const t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;n.materials||(n.materials=[]);const i={pbrMetallicRoughness:{}};!0!==e.isMeshStandardMaterial&&!0!==e.isMeshBasicMaterial&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const s=e.color.toArray().concat([e.opacity]);if(pm(s,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=s),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),n={index:this.processTexture(t)};this.applyTextureTransform(n,t),i.pbrMetallicRoughness.metallicRoughnessTexture=n}if(e.map){const t={index:this.processTexture(e.map)};this.applyTextureTransform(t,e.map),i.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){const t=e.emissive.clone().multiplyScalar(e.emissiveIntensity),n=Math.max(t.r,t.g,t.b);if(n>1&&(t.multiplyScalar(1/n),console.warn("THREE.GLTFExporter: Some emissive components exceed 1; emissive has been limited")),n>0&&(i.emissiveFactor=t.toArray()),e.emissiveMap){const t={index:this.processTexture(e.emissiveMap)};this.applyTextureTransform(t,e.emissiveMap),i.emissiveTexture=t}}if(e.normalMap){const t={index:this.processTexture(e.normalMap)};e.normalScale&&1!==e.normalScale.x&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),i.normalTexture=t}if(e.aoMap){const t={index:this.processTexture(e.aoMap),texCoord:1};1!==e.aoMapIntensity&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),i.occlusionTexture=t}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),2===e.side&&(i.doubleSided=!0),""!==e.name&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll((function(t){t.writeMaterial&&t.writeMaterial(e,i)}));const r=n.materials.push(i)-1;return t.materials.set(e,r),r}processMesh(e){const t=this.cache,n=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,n=e.material.length;t<n;t++)i.push(e.material[t].uuid);else i.push(e.material.uuid);const s=i.join(":");if(t.meshes.has(s))return t.meshes.get(s);const r=e.geometry;let a;if(a=e.isLineSegments?Op:e.isLineLoop?Yp:e.isLine?Kp:e.isPoints?Up:e.material.wireframe?Op:jp,!0!==r.isBufferGeometry)throw new Error("THREE.GLTFExporter: Geometry is not of type THREE.BufferGeometry.");const o={},l={},c=[],h=[],d={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},u=r.getAttribute("normal");void 0===u||this.isNormalizedNormalAttribute(u)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),r.setAttribute("normal",this.createNormalizedNormalAttribute(u)));let p=null;for(let e in r.attributes){if("morph"===e.slice(0,5))continue;const n=r.attributes[e];e=d[e]||e.toUpperCase();if(/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e="_"+e),t.attributes.has(this.getUID(n))){l[e]=t.attributes.get(this.getUID(n));continue}p=null;const i=n.array;"JOINTS_0"!==e||i instanceof Uint16Array||i instanceof Uint8Array||(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),p=new $n(new Uint16Array(i),n.itemSize,n.normalized));const s=this.processAccessor(p||n,r);null!==s&&(l[e]=s,t.attributes.set(this.getUID(n),s))}if(void 0!==u&&r.setAttribute("normal",u),0===Object.keys(l).length)return null;if(void 0!==e.morphTargetInfluences&&e.morphTargetInfluences.length>0){const n=[],i=[],s={};if(void 0!==e.morphTargetDictionary)for(const t in e.morphTargetDictionary)s[e.morphTargetDictionary[t]]=t;for(let a=0;a<e.morphTargetInfluences.length;++a){const o={};let l=!1;for(const e in r.morphAttributes){if("position"!==e&&"normal"!==e){l||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),l=!0);continue}const n=r.morphAttributes[e][a],i=e.toUpperCase(),s=r.attributes[e];if(t.attributes.has(this.getUID(n,!0))){o[i]=t.attributes.get(this.getUID(n,!0));continue}const c=n.clone();if(!r.morphTargetsRelative)for(let e=0,t=n.count;e<t;e++)c.setXYZ(e,n.getX(e)-s.getX(e),n.getY(e)-s.getY(e),n.getZ(e)-s.getZ(e));o[i]=this.processAccessor(c,r),t.attributes.set(this.getUID(s,!0),o[i])}h.push(o),n.push(e.morphTargetInfluences[a]),void 0!==e.morphTargetDictionary&&i.push(s[a])}o.weights=n,i.length>0&&(o.extras={},o.extras.targetNames=i)}const m=Array.isArray(e.material);if(m&&0===r.groups.length)return null;const f=m?e.material:[e.material],g=m?r.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,n=g.length;e<n;e++){const n={mode:a,attributes:l};if(this.serializeUserData(r,n),h.length>0&&(n.targets=h),null!==r.index){let i=this.getUID(r.index);void 0===g[e].start&&void 0===g[e].count||(i+=":"+g[e].start+":"+g[e].count),t.attributes.has(i)?n.indices=t.attributes.get(i):(n.indices=this.processAccessor(r.index,r,g[e].start,g[e].count),t.attributes.set(i,n.indices)),null===n.indices&&delete n.indices}const i=this.processMaterial(f[g[e].materialIndex]);null!==i&&(n.material=i),c.push(n)}o.primitives=c,n.meshes||(n.meshes=[]),this._invokeAll((function(t){t.writeMesh&&t.writeMesh(e,o)}));const y=n.meshes.push(o)-1;return t.meshes.set(s,y),y}processCamera(e){const t=this.json;t.cameras||(t.cameras=[]);const n=e.isOrthographicCamera,i={type:n?"orthographic":"perspective"};return n?i.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:tt.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(i.name=e.type),t.cameras.push(i)-1}processAnimation(e,t){const n=this.json,i=this.nodeMap;n.animations||(n.animations=[]);const s=(e=Fp.Utils.mergeMorphTargetTracks(e.clone(),t)).tracks,r=[],a=[];for(let e=0;e<s.length;++e){const n=s[e],o=rd.parseTrackName(n.name);let l=rd.findNode(t,o.nodeName);const c=um[o.propertyName];if("bones"===o.objectName&&(l=!0===l.isSkinnedMesh?l.skeleton.getBoneByName(o.objectIndex):void 0),!l||!c)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',n.name),null;const h=1;let d,u=n.values.length/n.times.length;c===um.morphTargetInfluences&&(u/=l.morphTargetInfluences.length),!0===n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline?(d="CUBICSPLINE",u/=3):d=n.getInterpolation()===Ce?"STEP":"LINEAR",a.push({input:this.processAccessor(new $n(n.times,h)),output:this.processAccessor(new $n(n.values,u)),interpolation:d}),r.push({sampler:a.length-1,target:{node:i.get(l),path:c}})}return n.animations.push({name:e.name||"clip_"+n.animations.length,samplers:a,channels:r}),n.animations.length-1}processSkin(e){const t=this.json,n=this.nodeMap,i=t.nodes[n.get(e)],s=e.skeleton;if(void 0===s)return null;const r=e.skeleton.bones[0];if(void 0===r)return null;const a=[],o=new Float32Array(16*s.bones.length),l=new dn;for(let t=0;t<s.bones.length;++t)a.push(n.get(s.bones[t])),l.copy(s.boneInverses[t]),l.multiply(e.bindMatrix).toArray(o,16*t);void 0===t.skins&&(t.skins=[]),t.skins.push({inverseBindMatrices:this.processAccessor(new $n(o,16)),joints:a,skeleton:n.get(r)});return i.skin=t.skins.length-1}processNode(e){const t=this.json,n=this.options,i=this.nodeMap;t.nodes||(t.nodes=[]);const s={};if(n.trs){const t=e.quaternion.toArray(),n=e.position.toArray(),i=e.scale.toArray();pm(t,[0,0,0,1])||(s.rotation=t),pm(n,[0,0,0])||(s.translation=n),pm(i,[1,1,1])||(s.scale=i)}else e.matrixAutoUpdate&&e.updateMatrix(),!1===pm(e.matrix.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])&&(s.matrix=e.matrix.elements);if(""!==e.name&&(s.name=String(e.name)),this.serializeUserData(e,s),e.isMesh||e.isLine||e.isPoints){const t=this.processMesh(e);null!==t&&(s.mesh=t)}else e.isCamera&&(s.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){const t=[];for(let i=0,s=e.children.length;i<s;i++){const s=e.children[i];if(s.visible||!1===n.onlyVisible){const e=this.processNode(s);null!==e&&t.push(e)}}t.length>0&&(s.children=t)}this._invokeAll((function(t){t.writeNode&&t.writeNode(e,s)}));const r=t.nodes.push(s)-1;return i.set(e,r),r}processScene(e){const t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);const i={};""!==e.name&&(i.name=e.name),t.scenes.push(i);const s=[];for(let t=0,i=e.children.length;t<i;t++){const i=e.children[t];if(i.visible||!1===n.onlyVisible){const e=this.processNode(i);null!==e&&s.push(e)}}s.length>0&&(i.nodes=s),this.serializeUserData(e,i)}processObjects(e){const t=new Va;t.name="AuxScene";for(let n=0;n<e.length;n++)t.children.push(e[n]);this.processScene(t)}processInput(e){const t=this.options;e=e instanceof Array?e:[e],this._invokeAll((function(t){t.beforeParse&&t.beforeParse(e)}));const n=[];for(let t=0;t<e.length;t++)e[t]instanceof Va?this.processScene(e[t]):n.push(e[t]);n.length>0&&this.processObjects(n);for(let e=0;e<this.skins.length;++e)this.processSkin(this.skins[e]);for(let n=0;n<t.animations.length;++n)this.processAnimation(t.animations[n],e[0]);this._invokeAll((function(t){t.afterParse&&t.afterParse(e)}))}_invokeAll(e){for(let t=0,n=this.plugins.length;t<n;t++)e(this.plugins[t])}}class vm{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,t){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight)return void console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);const n=this.writer,i=n.json,s=n.extensionsUsed,r={};e.name&&(r.name=e.name),r.color=e.color.toArray(),r.intensity=e.intensity,e.isDirectionalLight?r.type="directional":e.isPointLight?(r.type="point",e.distance>0&&(r.range=e.distance)):e.isSpotLight&&(r.type="spot",e.distance>0&&(r.range=e.distance),r.spot={},r.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,r.spot.outerConeAngle=e.angle),void 0!==e.decay&&2!==e.decay&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),!e.target||e.target.parent===e&&0===e.target.position.x&&0===e.target.position.y&&-1===e.target.position.z||console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),s[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},s[this.name]=!0);const a=i.extensions[this.name].lights;a.push(r),t.extensions=t.extensions||{},t.extensions[this.name]={light:a.length-1}}}class xm{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}}class wm{constructor(e){this.writer=e,this.name="KHR_materials_pbrSpecularGlossiness"}writeMaterial(e,t){if(!e.isGLTFSpecularGlossinessMaterial)return;const n=this.writer,i=n.extensionsUsed,s={};t.pbrMetallicRoughness.baseColorFactor&&(s.diffuseFactor=t.pbrMetallicRoughness.baseColorFactor);const r=[1,1,1];if(e.specular.toArray(r,0),s.specularFactor=r,s.glossinessFactor=e.glossiness,t.pbrMetallicRoughness.baseColorTexture&&(s.diffuseTexture=t.pbrMetallicRoughness.baseColorTexture),e.specularMap){const t={index:n.processTexture(e.specularMap)};n.applyTextureTransform(t,e.specularMap),s.specularGlossinessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Sm{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;const n=this.writer,i=n.extensionsUsed,s={};if(s.clearcoatFactor=e.clearcoat,e.clearcoatMap){const t={index:n.processTexture(e.clearcoatMap)};n.applyTextureTransform(t,e.clearcoatMap),s.clearcoatTexture=t}if(s.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){const t={index:n.processTexture(e.clearcoatRoughnessMap)};n.applyTextureTransform(t,e.clearcoatRoughnessMap),s.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){const t={index:n.processTexture(e.clearcoatNormalMap)};n.applyTextureTransform(t,e.clearcoatNormalMap),s.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Mm{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial)return;const n=this.writer,i=n.extensionsUsed,s={};if(s.iridescenceFactor=e.iridescence,e.iridescenceMap){const t={index:n.processTexture(e.iridescenceMap)};n.applyTextureTransform(t,e.iridescenceMap),s.iridescenceTexture=t}if(s.iridescenceIor=e.iridescenceIOR,s.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],s.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){const t={index:n.processTexture(e.iridescenceThicknessMap)};n.applyTextureTransform(t,e.iridescenceThicknessMap),s.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Lm{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const n=this.writer,i=n.extensionsUsed,s={};if(s.transmissionFactor=e.transmission,e.transmissionMap){const t={index:n.processTexture(e.transmissionMap)};n.applyTextureTransform(t,e.transmissionMap),s.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}class Cm{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||0===e.transmission)return;const n=this.writer,i=n.extensionsUsed,s={};if(s.thicknessFactor=e.thickness,e.thicknessMap){const t={index:n.processTexture(e.thicknessMap)};n.applyTextureTransform(t,e.thicknessMap),s.thicknessTexture=t}s.attenuationDistance=e.attenuationDistance,s.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=s,i[this.name]=!0}}Fp.Utils={insertKeyframe:function(e,t){const n=.001,i=e.getValueSize(),s=new e.TimeBufferType(e.times.length+1),r=new e.ValueBufferType(e.values.length+i),a=e.createInterpolant(new e.ValueBufferType(i));let o;if(0===e.times.length){s[0]=t;for(let e=0;e<i;e++)r[e]=0;o=0}else if(t<e.times[0]){if(Math.abs(e.times[0]-t)<n)return 0;s[0]=t,s.set(e.times,1),r.set(a.evaluate(t),0),r.set(e.values,i),o=0}else if(t>e.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<n)return e.times.length-1;s[s.length-1]=t,s.set(e.times,0),r.set(e.values,0),r.set(a.evaluate(t),e.values.length),o=s.length-1}else for(let l=0;l<e.times.length;l++){if(Math.abs(e.times[l]-t)<n)return l;if(e.times[l]<t&&e.times[l+1]>t){s.set(e.times.slice(0,l+1),0),s[l+1]=t,s.set(e.times.slice(l+1),l+2),r.set(e.values.slice(0,(l+1)*i),0),r.set(a.evaluate(t),(l+1)*i),r.set(e.values.slice((l+1)*i),(l+2)*i),o=l+1;break}}return e.times=s,e.values=r,o},mergeMorphTargetTracks:function(e,t){const n=[],i={},s=e.tracks;for(let e=0;e<s.length;++e){let r=s[e];const a=rd.parseTrackName(r.name),o=rd.findNode(t,a.nodeName);if("morphTargetInfluences"!==a.propertyName||void 0===a.propertyIndex){n.push(r);continue}if(r.createInterpolant!==r.InterpolantFactoryMethodDiscrete&&r.createInterpolant!==r.InterpolantFactoryMethodLinear){if(r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),r=r.clone(),r.setInterpolation(Ge)}const l=o.morphTargetInfluences.length,c=o.morphTargetDictionary[a.propertyIndex];if(void 0===c)throw new Error("THREE.GLTFExporter: Morph target name not found: "+a.propertyIndex);let h;if(void 0===i[o.uuid]){h=r.clone();const e=new h.ValueBufferType(l*h.times.length);for(let t=0;t<h.times.length;t++)e[t*l+c]=h.values[t];h.name=(a.nodeName||"")+".morphTargetInfluences",h.values=e,i[o.uuid]=h,n.push(h);continue}const d=r.createInterpolant(new r.ValueBufferType(1));h=i[o.uuid];for(let e=0;e<h.times.length;e++)h.values[e*l+c]=d.evaluate(h.times[e]);for(let e=0;e<r.times.length;e++){const t=this.insertKeyframe(h,r.times[e]);h.values[t*l+c]=r.values[e]}}return e.tracks=n,e}};const Gm=Object.prototype.hasOwnProperty,Tm=e=>"String"===zm(e),Rm=e=>"Boolean"===zm(e),Am=e=>"Number"===zm(e),Xm=Array.isArray,Im=e=>"Object"===zm(e),_m=e=>"Function"===zm(e),zm=e=>Object.prototype.toString.call(e).slice(8,-1),Em=(e,t,n)=>String.fromCodePoint(...new Uint8Array(e,t,n)),Wm=()=>pp+Math.random().toString(36).substring(7).split("").join("_");var Zm=Object.freeze({__proto__:null,hasOwn:(e,t)=>Gm.call(e,t),isString:Tm,isBoolean:Rm,isNumber:Am,isNull:e=>"Null"===zm(e),isUndefined:e=>"Undefined"===zm(e),isSymbol:e=>"Symbol"===zm(e),isDate:e=>"Date"===zm(e),isArray:Xm,isObject:Im,isFunction:_m,isPromise:e=>"Promise"===zm(e),getValueType:zm,sleep:e=>new Promise((t=>setTimeout((()=>t()),e))),getAsciiString:Em,randomString:Wm,exportGltf:function(e,t={}){return new Promise(((n,i)=>{(new Fp).parse(e,(e=>n(e)),(e=>i(e)),t)}))},log:fp,warn:gp,error:e=>{console.error(mp+e)},IVector3ToVector3:yp,IVector3ToEuler:bp,getBoundingBox:vp,rotationAxisFix:xp,rotationAFix:wp,deg2Euler:Sp,euler2Deg:function(e){return e/(Math.PI/180)},getSpaceAttributeFromObject:Mp,syncSpaceAttributeToObject:Lp,isObjectVisible:Cp,MinHeap:Gp,getCubeTexture:Tp,gradientTexture:Rp,parseFilePath:Ap,cloneDeep:Xp,cloneMaterials:Ip,fetchFile:kp,idleTask:Bp});const Pm={"Linear.None":qu.Linear.None,"Quadratic.In":qu.Quadratic.In,"Quadratic.Out":qu.Quadratic.Out,"Quadratic.InOut":qu.Quadratic.InOut,"Cubic.In":qu.Cubic.In,"Cubic.Out":qu.Cubic.Out,"Cubic.InOut":qu.Cubic.InOut,"Quartic.In":qu.Quartic.In,"Quartic.Out":qu.Quartic.Out,"Quartic.InOut":qu.Quartic.InOut,"Quintic.In":qu.Quintic.In,"Quintic.Out":qu.Quintic.Out,"Quintic.InOut":qu.Quintic.InOut,"Sinusoidal.In":qu.Sinusoidal.In,"Sinusoidal.Out":qu.Sinusoidal.Out,"Sinusoidal.InOut":qu.Sinusoidal.InOut,"Exponential.In":qu.Exponential.In,"Exponential.Out":qu.Exponential.Out,"Exponential.InOut":qu.Exponential.InOut,"Circular.In":qu.Circular.In,"Circular.Out":qu.Circular.Out,"Circular.InOut":qu.Circular.InOut,"Elastic.In":qu.Elastic.In,"Elastic.Out":qu.Elastic.Out,"Elastic.InOut":qu.Elastic.InOut,"Back.In":qu.Back.In,"Back.Out":qu.Back.Out,"Back.InOut":qu.Back.InOut,"Bounce.In":qu.Bounce.In,"Bounce.Out":qu.Bounce.Out,"Bounce.InOut":qu.Bounce.InOut};function Nm(e,t,n={},i,s){return new Promise((r=>{const{duration:a=1e3,delay:o=0,repeat:l=!1,mode:c="Linear.None",yoyo:h=!1}=n,d=Pm[c],u=new sp(e).to(t,a).easing(d).delay(o).onUpdate((n=>{e instanceof wn&&t instanceof wn&&n instanceof wn&&(n.order=t.order),null==i||i(n,u)})).onComplete((()=>{u.stop(),r()}));Am(l)?u.repeat(l):Rm(l)&&l&&u.repeat(1/0),u.yoyo(h),u.start(),u.onStart((()=>{null==s||s(u)}))}))}const Vm=1.25,Hm=65535,Dm=Math.pow(2,-24);class km{constructor(){}}function Bm(e,t,n){return n.min.x=t[e],n.min.y=t[e+1],n.min.z=t[e+2],n.max.x=t[e+3],n.max.y=t[e+4],n.max.z=t[e+5],n}function Fm(e){let t=-1,n=-1/0;for(let i=0;i<3;i++){const s=e[i+3]-e[i];s>n&&(n=s,t=i)}return t}function Um(e,t){t.set(e)}function Om(e,t,n){let i,s;for(let r=0;r<3;r++){const a=r+3;i=e[r],s=t[r],n[r]=i<s?i:s,i=e[a],s=t[a],n[a]=i>s?i:s}}function Ym(e,t,n){for(let i=0;i<3;i++){const s=t[e+2*i],r=t[e+2*i+1],a=s-r,o=s+r;a<n[i]&&(n[i]=a),o>n[i+3]&&(n[i+3]=o)}}function Km(e){const t=e[3]-e[0],n=e[4]-e[1],i=e[5]-e[2];return 2*(t*n+n*i+i*t)}function jm(e,t,n,i){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,r=1/0,a=1/0,o=1/0,l=-1/0,c=-1/0,h=-1/0,d=1/0,u=1/0,p=1/0,m=-1/0,f=-1/0,g=-1/0;const y=null!==s;for(let i=6*t,s=6*(t+n);i<s;i+=6){const t=e[i+0],n=e[i+1],s=t-n,b=t+n;s<r&&(r=s),b>l&&(l=b),y&&t<d&&(d=t),y&&t>m&&(m=t);const v=e[i+2],x=e[i+3],w=v-x,S=v+x;w<a&&(a=w),S>c&&(c=S),y&&v<u&&(u=v),y&&v>f&&(f=v);const M=e[i+4],L=e[i+5],C=M-L,G=M+L;C<o&&(o=C),G>h&&(h=G),y&&M<p&&(p=M),y&&M>g&&(g=M)}i[0]=r,i[1]=a,i[2]=o,i[3]=l,i[4]=c,i[5]=h,y&&(s[0]=d,s[1]=u,s[2]=p,s[3]=m,s[4]=f,s[5]=g)}function Jm(e,t,n,i,s){let r=n,a=n+i-1;const o=s.pos,l=2*s.axis;for(;;){for(;r<=a&&t[6*r+l]<o;)r++;for(;r<=a&&t[6*a+l]>=o;)a--;if(!(r<a))return r;for(let n=0;n<3;n++){let i=e[3*r+n];e[3*r+n]=e[3*a+n],e[3*a+n]=i;let s=t[6*r+2*n+0];t[6*r+2*n+0]=t[6*a+2*n+0],t[6*a+2*n+0]=s;let o=t[6*r+2*n+1];t[6*r+2*n+1]=t[6*a+2*n+1],t[6*a+2*n+1]=o}r++,a--}}const Qm=32,qm=(e,t)=>e.candidate-t.candidate,$m=new Array(Qm).fill().map((()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0}))),ef=new Float32Array(6);function tf(e,t,n,i,s,r){let a=-1,o=0;if(0===r)a=Fm(t),-1!==a&&(o=(t[a]+t[a+3])/2);else if(1===r)a=Fm(e),-1!==a&&(o=function(e,t,n,i){let s=0;for(let r=t,a=t+n;r<a;r++)s+=e[6*r+2*i];return s/n}(n,i,s,a));else if(2===r){const r=Km(e);let l=Vm*s;const c=6*i,h=6*(i+s);for(let e=0;e<3;e++){const i=t[e],d=(t[e+3]-i)/Qm;if(s<8){const t=[...$m];t.length=s;let i=0;for(let s=c;s<h;s+=6,i++){const r=t[i];r.candidate=n[s+2*e],r.count=0;const{bounds:a,leftCacheBounds:o,rightCacheBounds:l}=r;for(let e=0;e<3;e++)l[e]=1/0,l[e+3]=-1/0,o[e]=1/0,o[e+3]=-1/0,a[e]=1/0,a[e+3]=-1/0;Ym(s,n,a)}t.sort(qm);let d=s;for(let e=0;e<d;e++){const n=t[e];for(;e+1<d&&t[e+1].candidate===n.candidate;)t.splice(e+1,1),d--}for(let i=c;i<h;i+=6){const s=n[i+2*e];for(let e=0;e<d;e++){const r=t[e];s>=r.candidate?Ym(i,n,r.rightCacheBounds):(Ym(i,n,r.leftCacheBounds),r.count++)}}for(let n=0;n<d;n++){const i=t[n],c=i.count,h=s-i.count,d=i.leftCacheBounds,u=i.rightCacheBounds;let p=0;0!==c&&(p=Km(d)/r);let m=0;0!==h&&(m=Km(u)/r);const f=1+Vm*(p*c+m*h);f<l&&(a=e,l=f,o=i.candidate)}}else{for(let e=0;e<Qm;e++){const t=$m[e];t.count=0,t.candidate=i+d+e*d;const n=t.bounds;for(let e=0;e<3;e++)n[e]=1/0,n[e+3]=-1/0}for(let t=c;t<h;t+=6){let s=~~((n[t+2*e]-i)/d);s>=Qm&&(s=31);const r=$m[s];r.count++,Ym(t,n,r.bounds)}const t=$m[31];Um(t.bounds,t.rightCacheBounds);for(let e=30;e>=0;e--){const t=$m[e],n=$m[e+1];Om(t.bounds,n.rightCacheBounds,t.rightCacheBounds)}let u=0;for(let t=0;t<31;t++){const n=$m[t],i=n.count,c=n.bounds,h=$m[t+1].rightCacheBounds;0!==i&&(0===u?Um(c,ef):Om(c,ef,ef)),u+=i;let d=0,p=0;0!==u&&(d=Km(ef)/r);const m=s-u;0!==m&&(p=Km(h)/r);const f=1+Vm*(d*u+p*m);f<l&&(a=e,l=f,o=n.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${r} used.`);return{axis:a,pos:o}}function nf(e,t){function n(e){u&&u(e/p)}function i(t,s,u){let p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!m&&f>=l&&(m=!0,c&&(console.warn(`MeshBVH: Max depth of ${l} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),u<=h||f>=l)return n(s+u),t.offset=s,t.count=u,t;const g=tf(t.boundingData,p,a,s,u,d);if(-1===g.axis)return n(s+u),t.offset=s,t.count=u,t;const y=Jm(o,a,s,u,g);if(y===s||y===s+u)n(s+u),t.offset=s,t.count=u;else{t.splitAxis=g.axis;const e=new km,n=s,o=y-s;t.left=e,e.boundingData=new Float32Array(6),jm(a,n,o,e.boundingData,r),i(e,n,o,r,f+1);const l=new km,c=y,h=u-o;t.right=l,l.boundingData=new Float32Array(6),jm(a,c,h,l.boundingData,r),i(l,c,h,r,f+1)}return t}!function(e,t){if(!e.index){const n=e.attributes.position.count,i=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;let s;s=n>65535?new Uint32Array(new i(4*n)):new Uint16Array(new i(2*n)),e.setIndex(new $n(s,1));for(let e=0;e<n;e++)s[e]=e}}(e,t);const s=new Float32Array(6),r=new Float32Array(6),a=function(e,t){const n=e.attributes.position,i=n.array,s=e.index.array,r=s.length/3,a=new Float32Array(6*r),o=n.offset||0;let l=3;n.isInterleavedBufferAttribute&&(l=n.data.stride);for(let e=0;e<r;e++){const n=3*e,r=6*e,c=s[n+0]*l+o,h=s[n+1]*l+o,d=s[n+2]*l+o;for(let e=0;e<3;e++){const n=i[c+e],s=i[h+e],o=i[d+e];let l=n;s<l&&(l=s),o<l&&(l=o);let u=n;s>u&&(u=s),o>u&&(u=o);const p=(u-l)/2,m=2*e;a[r+m+0]=l+p,a[r+m+1]=p+(Math.abs(l)+p)*Dm,l<t[e]&&(t[e]=l),u>t[e+3]&&(t[e+3]=u)}}return a}(e,s),o=e.index.array,l=t.maxDepth,c=t.verbose,h=t.maxLeafTris,d=t.strategy,u=t.onProgress,p=e.index.count/3;let m=!1;const f=[],g=function(e){if(!e.groups||!e.groups.length)return[{offset:0,count:e.index.count/3}];const t=[],n=new Set;for(const t of e.groups)n.add(t.start),n.add(t.start+t.count);const i=Array.from(n.values()).sort(((e,t)=>e-t));for(let e=0;e<i.length-1;e++){const n=i[e],s=i[e+1];t.push({offset:n/3,count:(s-n)/3})}return t}(e);if(1===g.length){const e=g[0],t=new km;t.boundingData=s,function(e,t,n,i){let s=1/0,r=1/0,a=1/0,o=-1/0,l=-1/0,c=-1/0;for(let i=6*t,h=6*(t+n);i<h;i+=6){const t=e[i+0];t<s&&(s=t),t>o&&(o=t);const n=e[i+2];n<r&&(r=n),n>l&&(l=n);const h=e[i+4];h<a&&(a=h),h>c&&(c=h)}i[0]=s,i[1]=r,i[2]=a,i[3]=o,i[4]=l,i[5]=c}(a,e.offset,e.count,r),i(t,e.offset,e.count,r),f.push(t)}else for(let e of g){const t=new km;t.boundingData=new Float32Array(6),jm(a,e.offset,e.count,t.boundingData,r),i(t,e.offset,e.count,r),f.push(t)}return f}class sf{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,i=-1/0;for(let s=0,r=e.length;s<r;s++){const r=e[s][t];n=r<n?r:n,i=r>i?r:i}this.min=n,this.max=i}setFromPoints(e,t){let n=1/0,i=-1/0;for(let s=0,r=t.length;s<r;s++){const r=t[s],a=e.dot(r);n=a<n?a:n,i=a>i?a:i}this.min=n,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}sf.prototype.setFromBox=function(){const e=new zt;return function(t,n){const i=n.min,s=n.max;let r=1/0,a=-1/0;for(let n=0;n<=1;n++)for(let o=0;o<=1;o++)for(let l=0;l<=1;l++){e.x=i.x*n+s.x*(1-n),e.y=i.y*o+s.y*(1-o),e.z=i.z*l+s.z*(1-l);const c=t.dot(e);r=Math.min(c,r),a=Math.max(c,a)}this.min=r,this.max=a}}(),function(){const e=new sf}();const rf=function(){const e=new zt,t=new zt,n=new zt;return function(i,s,r){const a=i.start,o=e,l=s.start,c=t;n.subVectors(a,l),e.subVectors(i.end,i.start),t.subVectors(s.end,s.start);const h=n.dot(c),d=c.dot(o),u=c.dot(c),p=n.dot(o),m=o.dot(o)*u-d*d;let f,g;f=0!==m?(h*d-p*u)/m:0,g=(h+f*d)/u,r.x=f,r.y=g}}(),af=function(){const e=new nt,t=new zt,n=new zt;return function(i,s,r,a){rf(i,s,e);let o=e.x,l=e.y;if(o>=0&&o<=1&&l>=0&&l<=1)return i.at(o,r),void s.at(l,a);if(o>=0&&o<=1)return l<0?s.at(0,a):s.at(1,a),void i.closestPointToPoint(a,!0,r);if(l>=0&&l<=1)return o<0?i.at(0,r):i.at(1,r),void s.closestPointToPoint(r,!0,a);{let e,c;e=o<0?i.start:i.end,c=l<0?s.start:s.end;const h=t,d=n;return i.closestPointToPoint(c,!0,t),s.closestPointToPoint(e,!0,n),h.distanceToSquared(c)<=d.distanceToSquared(e)?(r.copy(h),void a.copy(c)):(r.copy(e),void a.copy(d))}}}(),of=function(){const e=new zt,t=new zt,n=new Qi,i=new Sd;return function(s,r){const{radius:a,center:o}=s,{a:l,b:c,c:h}=r;i.start=l,i.end=c;if(i.closestPointToPoint(o,!0,e).distanceTo(o)<=a)return!0;i.start=l,i.end=h;if(i.closestPointToPoint(o,!0,e).distanceTo(o)<=a)return!0;i.start=c,i.end=h;if(i.closestPointToPoint(o,!0,e).distanceTo(o)<=a)return!0;const d=r.getPlane(n);if(Math.abs(d.distanceToPoint(o))<=a){const e=d.projectPoint(o,t);if(r.containsPoint(e))return!0}return!1}}();function lf(e){return Math.abs(e)<1e-15}class cf extends Yn{constructor(){super(...arguments),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map((()=>new zt)),this.satBounds=new Array(4).fill().map((()=>new sf)),this.points=[this.a,this.b,this.c],this.sphere=new tn,this.plane=new Qi,this.needsUpdate=!0}intersectsSphere(e){return of(e,this)}update(){const e=this.a,t=this.b,n=this.c,i=this.points,s=this.satAxes,r=this.satBounds,a=s[0],o=r[0];this.getNormal(a),o.setFromPoints(a,i);const l=s[1],c=r[1];l.subVectors(e,t),c.setFromPoints(l,i);const h=s[2],d=r[2];h.subVectors(t,n),d.setFromPoints(h,i);const u=s[3],p=r[3];u.subVectors(n,e),p.setFromPoints(u,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(a,e),this.needsUpdate=!1}}cf.prototype.closestPointToSegment=function(){const e=new zt,t=new zt,n=new Sd;return function(i){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const{start:a,end:o}=i,l=this.points;let c,h=1/0;for(let a=0;a<3;a++){const o=(a+1)%3;n.start.copy(l[a]),n.end.copy(l[o]),af(n,i,e,t),c=e.distanceToSquared(t),c<h&&(h=c,s&&s.copy(e),r&&r.copy(t))}return this.closestPointToPoint(a,e),c=a.distanceToSquared(e),c<h&&(h=c,s&&s.copy(e),r&&r.copy(a)),this.closestPointToPoint(o,e),c=o.distanceToSquared(e),c<h&&(h=c,s&&s.copy(e),r&&r.copy(o)),Math.sqrt(h)}}(),cf.prototype.intersectsTriangle=function(){const e=new cf,t=new Array(3),n=new Array(3),i=new sf,s=new sf,r=new zt,a=new zt,o=new zt,l=new zt,c=new Sd,h=new Sd,d=new Sd;return function(u){let p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.needsUpdate&&this.update(),u.isExtendedTriangle?u.needsUpdate&&u.update():(e.copy(u),e.update(),u=e);const m=this.plane,f=u.plane;if(Math.abs(m.normal.dot(f.normal))>1-1e-10){const e=this.satBounds,a=this.satAxes;n[0]=u.a,n[1]=u.b,n[2]=u.c;for(let t=0;t<4;t++){const s=e[t],r=a[t];if(i.setFromPoints(r,n),s.isSeparated(i))return!1}const o=u.satBounds,l=u.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let e=0;e<4;e++){const n=o[e],s=l[e];if(i.setFromPoints(s,t),n.isSeparated(i))return!1}for(let e=0;e<4;e++){const o=a[e];for(let e=0;e<4;e++){const a=l[e];if(r.crossVectors(o,a),i.setFromPoints(r,t),s.setFromPoints(r,n),i.isSeparated(s))return!1}}return p&&(console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),p.start.set(0,0,0),p.end.set(0,0,0)),!0}{const e=this.points;let t=!1,n=0;for(let i=0;i<3;i++){const s=e[i],r=e[(i+1)%3];c.start.copy(s),c.end.copy(r),c.delta(a);const o=t?h.start:h.end,l=lf(f.distanceToPoint(s));if(lf(f.normal.dot(a))&&l){h.copy(c),n=2;break}if((f.intersectLine(c,o)||l)&&!lf(o.distanceTo(r))){if(n++,t)break;t=!0}}if(1===n&&this.containsPoint(h.end))return p&&(p.start.copy(h.end),p.end.copy(h.end)),!0;if(2!==n)return!1;const i=u.points;let s=!1,r=0;for(let e=0;e<3;e++){const t=i[e],n=i[(e+1)%3];c.start.copy(t),c.end.copy(n),c.delta(o);const a=s?d.start:d.end,l=lf(m.distanceToPoint(t));if(lf(m.normal.dot(o))&&l){d.copy(c),r=2;break}if((m.intersectLine(c,a)||l)&&!lf(a.distanceTo(n))){if(r++,s)break;s=!0}}if(1===r&&this.containsPoint(d.end))return p&&(p.start.copy(d.end),p.end.copy(d.end)),!0;if(2!==r)return!1;if(h.delta(a),d.delta(o),a.dot(o)<0){let e=d.start;d.start=d.end,d.end=e}const g=h.start.dot(a),y=h.end.dot(a),b=d.start.dot(a),v=d.end.dot(a),x=y<b,w=g<v;return(g===v||b===y||x!==w)&&(p&&(l.subVectors(h.start,d.start),l.dot(a)>0?p.start.copy(h.start):p.start.copy(d.start),l.subVectors(h.end,d.end),l.dot(a)<0?p.end.copy(h.end):p.end.copy(d.end)),!0)}}}(),cf.prototype.distanceToPoint=function(){const e=new zt;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),cf.prototype.distanceToTriangle=function(){const e=new zt,t=new zt,n=["a","b","c"],i=new Sd,s=new Sd;return function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=a||o?i:null;if(this.intersectsTriangle(r,l))return(a||o)&&(a&&l.getCenter(a),o&&l.getCenter(o)),0;let c=1/0;for(let t=0;t<3;t++){let i;const s=n[t],l=r[s];this.closestPointToPoint(l,e),i=l.distanceToSquared(e),i<c&&(c=i,a&&a.copy(e),o&&o.copy(l));const h=this[s];r.closestPointToPoint(h,e),i=h.distanceToSquared(e),i<c&&(c=i,a&&a.copy(h),o&&o.copy(e))}for(let l=0;l<3;l++){const h=n[l],d=n[(l+1)%3];i.set(this[h],this[d]);for(let l=0;l<3;l++){const h=n[l],d=n[(l+1)%3];s.set(r[h],r[d]),af(i,s,e,t);const u=e.distanceToSquared(t);u<c&&(c=u,a&&a.copy(e),o&&o.copy(t))}}return Math.sqrt(c)}}();class hf extends Zt{constructor(){super(...arguments),this.isOrientedBox=!0,this.matrix=new dn,this.invMatrix=new dn,this.points=new Array(8).fill().map((()=>new zt)),this.satAxes=new Array(3).fill().map((()=>new zt)),this.satBounds=new Array(3).fill().map((()=>new sf)),this.alignedSatBounds=new Array(3).fill().map((()=>new sf)),this.needsUpdate=!1}set(e,t,n){super.set(e,t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){super.copy(e),this.matrix.copy(e.matrix),this.needsUpdate=!0}}hf.prototype.update=function(){const e=this.matrix,t=this.min,n=this.max,i=this.points;for(let s=0;s<=1;s++)for(let r=0;r<=1;r++)for(let a=0;a<=1;a++){const o=i[1*s|2*r|4*a];o.x=s?n.x:t.x,o.y=r?n.y:t.y,o.z=a?n.z:t.z,o.applyMatrix4(e)}const s=this.satBounds,r=this.satAxes,a=i[0];for(let e=0;e<3;e++){const t=r[e],n=s[e],o=i[1<<e];t.subVectors(a,o),n.setFromPoints(t,i)}const o=this.alignedSatBounds;o[0].setFromPointsField(i,"x"),o[1].setFromPointsField(i,"y"),o[2].setFromPointsField(i,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1},hf.prototype.intersectsBox=function(){const e=new sf;return function(t){this.needsUpdate&&this.update();const n=t.min,i=t.max,s=this.satBounds,r=this.satAxes,a=this.alignedSatBounds;if(e.min=n.x,e.max=i.x,a[0].isSeparated(e))return!1;if(e.min=n.y,e.max=i.y,a[1].isSeparated(e))return!1;if(e.min=n.z,e.max=i.z,a[2].isSeparated(e))return!1;for(let n=0;n<3;n++){const i=r[n],a=s[n];if(e.setFromBox(i,t),a.isSeparated(e))return!1}return!0}}(),hf.prototype.intersectsTriangle=function(){const e=new cf,t=new Array(3),n=new sf,i=new sf,s=new zt;return function(r){this.needsUpdate&&this.update(),r.isExtendedTriangle?r.needsUpdate&&r.update():(e.copy(r),e.update(),r=e);const a=this.satBounds,o=this.satAxes;t[0]=r.a,t[1]=r.b,t[2]=r.c;for(let e=0;e<3;e++){const i=a[e],s=o[e];if(n.setFromPoints(s,t),i.isSeparated(n))return!1}const l=r.satBounds,c=r.satAxes,h=this.points;for(let e=0;e<3;e++){const t=l[e],i=c[e];if(n.setFromPoints(i,h),t.isSeparated(n))return!1}for(let e=0;e<3;e++){const r=o[e];for(let e=0;e<4;e++){const a=c[e];if(s.crossVectors(r,a),n.setFromPoints(s,t),i.setFromPoints(s,h),n.isSeparated(i))return!1}}return!0}}(),hf.prototype.closestPointToPoint=function(e,t){return this.needsUpdate&&this.update(),t.copy(e).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),t},hf.prototype.distanceToPoint=function(){const e=new zt;return function(t){return this.closestPointToPoint(t,e),t.distanceTo(e)}}(),hf.prototype.distanceToBox=function(){const e=["x","y","z"],t=new Array(12).fill().map((()=>new Sd)),n=new Array(12).fill().map((()=>new Sd)),i=new zt,s=new zt;return function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(this.needsUpdate&&this.update(),this.intersectsBox(r))return(o||l)&&(r.getCenter(s),this.closestPointToPoint(s,i),r.closestPointToPoint(i,s),o&&o.copy(i),l&&l.copy(s)),0;const c=a*a,h=r.min,d=r.max,u=this.points;let p=1/0;for(let e=0;e<8;e++){const t=u[e];s.copy(t).clamp(h,d);const n=t.distanceToSquared(s);if(n<p&&(p=n,o&&o.copy(t),l&&l.copy(s),n<c))return Math.sqrt(n)}let m=0;for(let i=0;i<3;i++)for(let s=0;s<=1;s++)for(let r=0;r<=1;r++){const a=(i+1)%3,o=(i+2)%3,l=1<<i|s<<a|r<<o,c=u[s<<a|r<<o],p=u[l];t[m].set(c,p);const f=e[i],g=e[a],y=e[o],b=n[m],v=b.start,x=b.end;v[f]=h[f],v[g]=s?h[g]:d[g],v[y]=r?h[y]:d[g],x[f]=d[f],x[g]=s?h[g]:d[g],x[y]=r?h[y]:d[g],m++}for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)for(let n=0;n<=1;n++){s.x=e?d.x:h.x,s.y=t?d.y:h.y,s.z=n?d.z:h.z,this.closestPointToPoint(s,i);const r=s.distanceToSquared(i);if(r<p&&(p=r,o&&o.copy(i),l&&l.copy(s),r<c))return Math.sqrt(r)}for(let e=0;e<12;e++){const r=t[e];for(let e=0;e<12;e++){const t=n[e];af(r,t,i,s);const a=i.distanceToSquared(s);if(a<p&&(p=a,o&&o.copy(i),l&&l.copy(s),a<c))return Math.sqrt(a)}}return Math.sqrt(p)}}();const df=new zt,uf=new zt,pf=new zt,mf=new nt,ff=new nt,gf=new nt,yf=new zt;function bf(e,t,n,i,s){const r=3*i,a=e.index.getX(r),o=e.index.getX(r+1),l=e.index.getX(r+2),c=function(e,t,n,i,s,r,a){df.fromBufferAttribute(t,i),uf.fromBufferAttribute(t,s),pf.fromBufferAttribute(t,r);const o=function(e,t,n,i,s,r){let a;return a=1===r?e.intersectTriangle(i,n,t,!0,s):e.intersectTriangle(t,n,i,2!==r,s),null===a?null:{distance:e.origin.distanceTo(s),point:s.clone()}}(e,df,uf,pf,yf,a);if(o){n&&(mf.fromBufferAttribute(n,i),ff.fromBufferAttribute(n,s),gf.fromBufferAttribute(n,r),o.uv=Yn.getUV(yf,df,uf,pf,mf,ff,gf,new nt));const e={a:i,b:s,c:r,normal:new zt,materialIndex:0};Yn.getNormal(df,uf,pf,e.normal),o.face=e,o.faceIndex=i}return o}(n,e.attributes.position,e.attributes.uv,a,o,l,t);return c?(c.faceIndex=i,s&&s.push(c),c):null}function vf(e,t,n){return null===e?null:(e.point.applyMatrix4(t.matrixWorld),e.distance=e.point.distanceTo(n.ray.origin),e.object=t,e.distance<n.near||e.distance>n.far?null:e)}function xf(e,t,n,i){const s=e.a,r=e.b,a=e.c;let o=t,l=t+1,c=t+2;n&&(o=n.getX(t),l=n.getX(t+1),c=n.getX(t+2)),s.x=i.getX(o),s.y=i.getY(o),s.z=i.getZ(o),r.x=i.getX(l),r.y=i.getY(l),r.z=i.getZ(l),a.x=i.getX(c),a.y=i.getY(c),a.z=i.getZ(c)}function wf(e,t,n,i,s,r,a){const o=n.index,l=n.attributes.position;for(let n=e,c=t+e;n<c;n++)if(xf(a,3*n,o,l),a.needsUpdate=!0,i(a,n,s,r))return!0;return!1}class Sf{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return 0===e.length?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}function Mf(e,t){return 65535===t[e+15]}function Lf(e,t){return t[e+6]}function Cf(e,t){return t[e+14]}function Gf(e){return e+8}function Tf(e,t){return t[e+6]}const Rf=new Zt,Af=new zt,Xf=["x","y","z"];function If(e,t,n,i,s){let r=2*e,a=Nf,o=Vf,l=Hf;if(Mf(r,o)){!function(e,t,n,i,s,r){for(let a=i,o=i+s;a<o;a++)bf(e,t,n,a,r)}(t,n,i,Lf(e,l),Cf(r,o),s)}else{const r=Gf(e);Wf(r,a,i,Af)&&If(r,t,n,i,s);const o=Tf(e,l);Wf(o,a,i,Af)&&If(o,t,n,i,s)}}function _f(e,t,n,i){let s=2*e,r=Nf,a=Vf,o=Hf;if(Mf(s,a)){return function(e,t,n,i,s){let r=1/0,a=null;for(let o=i,l=i+s;o<l;o++){const i=bf(e,t,n,o);i&&i.distance<r&&(a=i,r=i.distance)}return a}(t,n,i,Lf(e,o),Cf(s,a))}{const s=function(e,t){return t[e+7]}(e,o),a=Xf[s],l=i.direction[a]>=0;let c,h;l?(c=Gf(e),h=Tf(e,o)):(c=Tf(e,o),h=Gf(e));const d=Wf(c,r,i,Af)?_f(c,t,n,i):null;if(d){const e=d.point[a];if(l?e<=r[h+s]:e>=r[h+s+3])return d}const u=Wf(h,r,i,Af)?_f(h,t,n,i):null;return d&&u?d.distance<=u.distance?d:u:d||u||null}}const zf=function(){let e,t;const n=[],i=new Sf((()=>new Zt));return function(){e=i.getPrimitive(),t=i.getPrimitive(),n.push(e,t);const r=s(...arguments);i.releasePrimitive(e),i.releasePrimitive(t),n.pop(),n.pop();const a=n.length;return a>0&&(t=n[a-1],e=n[a-2]),r};function s(n,i,r,a){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;function h(e){let t=2*e,n=Vf,i=Hf;for(;!Mf(t,n);)t=2*(e=Gf(e));return Lf(e,i)}function d(e){let t=2*e,n=Vf,i=Hf;for(;!Mf(t,n);)t=2*(e=Tf(e,i));return Lf(e,i)+Cf(t,n)}let u=2*n,p=Nf,m=Vf,f=Hf;const g=Mf(u,m);if(g){const t=Lf(n,f),i=Cf(u,m);return Bm(n,p,e),a(t,i,!1,c,l+n,e)}{const u=Gf(n),g=Tf(n,f);let y,b,v,x,w=u,S=g;if(o&&(v=e,x=t,Bm(w,p,v),Bm(S,p,x),y=o(v),b=o(x),b<y)){w=g,S=u;const e=y;y=b,b=e,v=x}v||(v=e,Bm(w,p,v));const M=r(v,Mf(2*w,m),y,c+1,l+w);let L;if(2===M){const e=h(w);L=a(e,d(w)-e,!0,c+1,l+w,v)}else L=M&&s(w,i,r,a,o,l,c+1);if(L)return!0;x=t,Bm(S,p,x);const C=r(x,Mf(2*S,m),b,c+1,l+S);let G;if(2===C){const e=h(S);G=a(e,d(S)-e,!0,c+1,l+S,x)}else G=C&&s(S,i,r,a,o,l,c+1);return!!G}}}(),Ef=function(){const e=new cf,t=new cf,n=new dn,i=new hf,s=new hf;return function r(a,o,l,c){let h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,d=2*a,u=Nf,p=Vf,m=Hf;null===h&&(l.boundingBox||l.computeBoundingBox(),i.set(l.boundingBox.min,l.boundingBox.max,c),h=i);const f=Mf(d,p);if(!f){const e=a+8,t=m[a+6];Bm(e,u,Rf);if(h.intersectsBox(Rf)&&r(e,o,l,c,h))return!0;Bm(t,u,Rf);return!!(h.intersectsBox(Rf)&&r(t,o,l,c,h))}{const i=o,r=i.index,h=i.attributes.position,f=l.index,g=l.attributes.position,y=Lf(a,m),b=Cf(d,p);if(n.copy(c).invert(),l.boundsTree){Bm(a,u,s),s.matrix.copy(n),s.needsUpdate=!0;return l.boundsTree.shapecast({intersectsBounds:e=>s.intersectsBox(e),intersectsTriangle:e=>{e.a.applyMatrix4(c),e.b.applyMatrix4(c),e.c.applyMatrix4(c),e.needsUpdate=!0;for(let n=3*y,i=3*(b+y);n<i;n+=3)if(xf(t,n,r,h),t.needsUpdate=!0,e.intersectsTriangle(t))return!0;return!1}})}for(let i=3*y,s=b+3*y;i<s;i+=3){xf(e,i,r,h),e.a.applyMatrix4(n),e.b.applyMatrix4(n),e.c.applyMatrix4(n),e.needsUpdate=!0;for(let n=0,i=f.count;n<i;n+=3)if(xf(t,n,f,g),t.needsUpdate=!0,e.intersectsTriangle(t))return!0}}}}();function Wf(e,t,n,i){return Bm(e,t,Rf),n.intersectBox(Rf,i)}const Zf=[];let Pf,Nf,Vf,Hf;function Df(e){Pf&&Zf.push(Pf),Pf=e,Nf=new Float32Array(e),Vf=new Uint16Array(e),Hf=new Uint32Array(e)}function kf(){Pf=null,Nf=null,Vf=null,Hf=null,Zf.length&&Df(Zf.pop())}const Bf=Symbol("skip tree generation"),Ff=new Zt,Uf=new Zt,Of=new dn,Yf=new hf,Kf=new hf,jf=new zt,Jf=new zt,Qf=new zt,qf=new zt,$f=new zt,eg=new Zt,tg=new Sf((()=>new cf));class ng{static serialize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.isBufferGeometry)return console.warn("MeshBVH.serialize: The arguments for the function have changed. See documentation for new signature."),ng.serialize(arguments[0],{cloneBuffers:void 0===arguments[2]||arguments[2]});t={cloneBuffers:!0,...t};const n=e.geometry,i=e._roots,s=n.getIndex();let r;return r=t.cloneBuffers?{roots:i.map((e=>e.slice())),index:s.array.slice()}:{roots:i,index:s.array},r}static deserialize(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("boolean"==typeof n)return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),ng.deserialize(arguments[0],arguments[1],{setIndex:void 0===arguments[2]||arguments[2]});n={setIndex:!0,...n};const{index:i,roots:s}=e,r=new ng(t,{...n,[Bf]:!0});if(r._roots=s,n.setIndex){const n=t.getIndex();if(null===n){const n=new $n(e.index,1,!1);t.setIndex(n)}else n.array!==i&&(n.array.set(i),n.needsUpdate=!0)}return r}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.isBufferGeometry)throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.");if(t=Object.assign({strategy:0,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,[Bf]:!1},t),t.useSharedArrayBuffer&&"undefined"==typeof SharedArrayBuffer)throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,t[Bf]||(this._roots=function(e,t){const n=nf(e,t);let i,s,r;const a=[],o=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let e=0;e<n.length;e++){const t=n[e],h=new o(32*l(t));i=new Float32Array(h),s=new Uint32Array(h),r=new Uint16Array(h),c(0,t),a.push(h)}return a;function l(e){return e.count?1:1+l(e.left)+l(e.right)}function c(e,t){const n=e/4,a=e/2,o=!!t.count,l=t.boundingData;for(let e=0;e<6;e++)i[n+e]=l[e];if(o){const i=t.offset,o=t.count;return s[n+6]=i,r[a+14]=o,r[a+15]=Hm,e+32}{const i=t.left,r=t.right,a=t.splitAxis;let o;if(o=c(e+32,i),o/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return s[n+6]=o/4,o=c(o,r),s[n+7]=a,o}}}(e,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Zt))),this.geometry=e}refit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&Array.isArray(e)&&(e=new Set(e));const t=this.geometry,n=t.index.array,i=t.attributes.position,s=i.array,r=i.offset||0;let a,o,l,c,h=3;i.isInterleavedBufferAttribute&&(h=i.data.stride);let d=0;const u=this._roots;for(let e=0,t=u.length;e<t;e++)a=u[e],o=new Uint32Array(a),l=new Uint16Array(a),c=new Float32Array(a),p(0,d),d+=a.byteLength;function p(t,i){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const d=2*t,u=l[d+15]===Hm;if(u){const e=o[t+6];let i=1/0,a=1/0,u=1/0,p=-1/0,m=-1/0,f=-1/0;for(let t=3*e,o=3*(e+l[d+14]);t<o;t++){const e=n[t]*h+r,o=s[e+0],l=s[e+1],c=s[e+2];o<i&&(i=o),o>p&&(p=o),l<a&&(a=l),l>m&&(m=l),c<u&&(u=c),c>f&&(f=c)}return(c[t+0]!==i||c[t+1]!==a||c[t+2]!==u||c[t+3]!==p||c[t+4]!==m||c[t+5]!==f)&&(c[t+0]=i,c[t+1]=a,c[t+2]=u,c[t+3]=p,c[t+4]=m,c[t+5]=f,!0)}{const n=t+8,s=o[t+6],r=n+i,l=s+i;let h=a,d=!1,u=!1;e?h||(d=e.has(r),u=e.has(l),h=!d&&!u):(d=!0,u=!0);const m=h||u;let f=!1;(h||d)&&(f=p(n,i,h));let g=!1;m&&(g=p(s,i,h));const y=f||g;if(y)for(let e=0;e<3;e++){const i=n+e,r=s+e,a=c[i],o=c[i+3],l=c[r],h=c[r+3];c[t+e]=a<l?a:l,c[t+e+3]=o>h?o:h}return y}}}traverse(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this._roots[t],i=new Uint32Array(n),s=new Uint16Array(n);!function t(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const o=2*r,l=s[o+15]===Hm;if(l){const t=i[r+6],c=s[o+14];e(a,l,new Float32Array(n,4*r,6),t,c)}else{const s=r+8,o=i[r+6],c=i[r+7];e(a,l,new Float32Array(n,4*r,6),c)||(t(s,a+1),t(o,a+1))}}(0)}raycast(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this._roots,i=this.geometry,s=[],r=t.isMaterial,a=Array.isArray(t),o=i.groups,l=r?t.side:t;for(let r=0,c=n.length;r<c;r++){const c=a?t[o[r].materialIndex].side:l,h=s.length;if(Df(n[r]),If(0,i,c,e,s),kf(),a){const e=o[r].materialIndex;for(let t=h,n=s.length;t<n;t++)s[t].face.materialIndex=e}}return s}raycastFirst(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=this._roots,i=this.geometry,s=t.isMaterial,r=Array.isArray(t);let a=null;const o=i.groups,l=s?t.side:t;for(let s=0,c=n.length;s<c;s++){const c=r?t[o[s].materialIndex].side:l;Df(n[s]);const h=_f(0,i,c,e);kf(),null!=h&&(null==a||h.distance<a.distance)&&(a=h,r&&(h.face.materialIndex=o[s].materialIndex))}return a}intersectsGeometry(e,t){const n=this.geometry;let i=!1;for(const s of this._roots)if(Df(s),i=Ef(0,n,e,t),kf(),i)break;return i}shapecast(e,t,n){const i=this.geometry;if(e instanceof Function){if(t){const e=t;t=(t,n,i,s)=>{const r=3*n;return e(t,r,r+1,r+2,i,s)}}e={boundsTraverseOrder:n,intersectsBounds:e,intersectsTriangle:t,intersectsRange:null},console.warn("MeshBVH: Shapecast function signature has changed and now takes an object of callbacks as a second argument. See docs for new signature.")}const s=tg.getPrimitive();let{boundsTraverseOrder:r,intersectsBounds:a,intersectsRange:o,intersectsTriangle:l}=e;if(o&&l){const e=o;o=(t,n,r,a,o)=>!!e(t,n,r,a,o)||wf(t,n,i,l,r,a,s)}else o||(o=l?(e,t,n,r)=>wf(e,t,i,l,n,r,s):(e,t,n)=>n);let c=!1,h=0;for(const e of this._roots){if(Df(e),c=zf(0,i,a,o,r,h),kf(),c)break;h+=e.byteLength}return tg.releasePrimitive(s),c}bvhcast(e,t,n){let{intersectsRanges:i,intersectsTriangles:s}=n;const r=this.geometry.index,a=this.geometry.attributes.position,o=e.geometry.index,l=e.geometry.attributes.position;Of.copy(t).invert();const c=tg.getPrimitive(),h=tg.getPrimitive();if(s){function d(e,n,i,d,u,p,m,f){for(let g=i,y=i+d;g<y;g++){xf(h,3*g,o,l),h.a.applyMatrix4(t),h.b.applyMatrix4(t),h.c.applyMatrix4(t),h.needsUpdate=!0;for(let t=e,i=e+n;t<i;t++)if(xf(c,3*t,r,a),c.needsUpdate=!0,s(c,h,t,g,u,p,m,f))return!0}return!1}if(i){const e=i;i=function(t,n,i,s,r,a,o,l){return!!e(t,n,i,s,r,a,o,l)||d(t,n,i,s,r,a,o,l)}}else i=d}e.getBoundingBox(Uf),Uf.applyMatrix4(t);const u=this.shapecast({intersectsBounds:e=>Uf.intersectsBox(e),intersectsRange:(t,n,s,r,a,o)=>(Ff.copy(o),Ff.applyMatrix4(Of),e.shapecast({intersectsBounds:e=>Ff.intersectsBox(e),intersectsRange:(e,s,o,l,c)=>i(t,n,e,s,r,a,l,c)}))});return tg.releasePrimitive(c),tg.releasePrimitive(h),u}intersectsBox(e,t){return Yf.set(e.min,e.max,t),Yf.needsUpdate=!0,this.shapecast({intersectsBounds:e=>Yf.intersectsBox(e),intersectsTriangle:e=>Yf.intersectsTriangle(e)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0;e.boundingBox||e.computeBoundingBox(),Yf.set(e.boundingBox.min,e.boundingBox.max,t),Yf.needsUpdate=!0;const a=this.geometry,o=a.attributes.position,l=a.index,c=e.attributes.position,h=e.index,d=tg.getPrimitive(),u=tg.getPrimitive();let p=Jf,m=Qf,f=null,g=null;i&&(f=qf,g=$f);let y=1/0,b=null,v=null;return Of.copy(t).invert(),Kf.matrix.copy(Of),this.shapecast({boundsTraverseOrder:e=>Yf.distanceToBox(e),intersectsBounds:(e,t,n)=>n<y&&n<r&&(t&&(Kf.min.copy(e.min),Kf.max.copy(e.max),Kf.needsUpdate=!0),!0),intersectsRange:(n,i)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:e=>Kf.distanceToBox(e),intersectsBounds:(e,t,n)=>n<y&&n<r,intersectsRange:(e,r)=>{for(let a=3*e,x=3*(e+r);a<x;a+=3){xf(u,a,h,c),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let e=3*n,t=3*(n+i);e<t;e+=3){xf(d,e,l,o),d.needsUpdate=!0;const t=d.distanceToTriangle(u,p,f);if(t<y&&(m.copy(p),g&&g.copy(f),y=t,b=e/3,v=a/3),t<s)return!0}}}});for(let e=0,r=h?h.count:c.count;e<r;e+=3){xf(u,e,h,c),u.a.applyMatrix4(t),u.b.applyMatrix4(t),u.c.applyMatrix4(t),u.needsUpdate=!0;for(let t=3*n,r=3*(n+i);t<r;t+=3){xf(d,t,l,o),d.needsUpdate=!0;const n=d.distanceToTriangle(u,p,f);if(n<y&&(m.copy(p),g&&g.copy(f),y=n,b=t/3,v=e/3),n<s)return!0}}}}),tg.releasePrimitive(d),tg.releasePrimitive(u),y===1/0?null:(n.point?n.point.copy(m):n.point=m.clone(),n.distance=y,n.faceIndex=b,i&&(i.point?i.point.copy(g):i.point=g.clone(),i.point.applyMatrix4(Of),m.applyMatrix4(Of),i.distance=m.sub(i.point).length(),i.faceIndex=v),n)}closestPointToPoint(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;const s=n*n,r=i*i;let a=1/0,o=null;if(this.shapecast({boundsTraverseOrder:t=>(jf.copy(e).clamp(t.min,t.max),jf.distanceToSquared(e)),intersectsBounds:(e,t,n)=>n<a&&n<r,intersectsTriangle:(t,n)=>{t.closestPointToPoint(e,jf);const i=e.distanceToSquared(jf);return i<a&&(Jf.copy(jf),a=i,o=n),i<s}}),a===1/0)return null;const l=Math.sqrt(a);return t.point?t.point.copy(Jf):t.point=Jf.clone(),t.distance=l,t.faceIndex=o,t}getBoundingBox(e){e.makeEmpty();return this._roots.forEach((t=>{Bm(0,new Float32Array(t),eg),e.union(eg)})),e}}const ig=ng.prototype.raycast;ng.prototype.raycast=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t[0].isMesh){console.warn('MeshBVH: The function signature and results frame for "raycast" has changed. See docs for new signature.');const[e,n,i,s]=t;return ig.call(this,i,e.material).forEach((t=>{(t=vf(t,e,n))&&s.push(t)})),s}return ig.apply(this,t)};const sg=ng.prototype.raycastFirst;ng.prototype.raycastFirst=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t[0].isMesh){console.warn('MeshBVH: The function signature and results frame for "raycastFirst" has changed. See docs for new signature.');const[e,n,i]=t;return vf(sg.call(this,i,e.material),e,n)}return sg.apply(this,t)};const rg=ng.prototype.closestPointToPoint;ng.prototype.closestPointToPoint=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t[0].isMesh){console.warn('MeshBVH: The function signature and results frame for "closestPointToPoint" has changed. See docs for new signature.'),t.unshift();const e=t[1],n={};return t[1]=n,rg.apply(this,t),e&&e.copy(n.point),n.distance}return rg.apply(this,t)};const ag=ng.prototype.closestPointToGeometry;ng.prototype.closestPointToGeometry=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t[2],s=t[3];if(i&&i.isVector3||s&&s.isVector3){console.warn('MeshBVH: The function signature and results frame for "closestPointToGeometry" has changed. See docs for new signature.');const e={},n={},r=t[1];return t[2]=e,t[3]=n,ag.apply(this,t),i&&i.copy(e.point),s&&s.copy(n.point).applyMatrix4(r),e.distance}return ag.apply(this,t)};const og=ng.prototype.refit;ng.prototype.refit=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const i=t[0],s=t[1];if(s&&(s instanceof Set||Array.isArray(s))){console.warn('MeshBVH: The function signature for "refit" has changed. See docs for new signature.');const e=new Set;s.forEach((t=>e.add(t))),i&&i.forEach((t=>e.add(t))),og.call(this,e)}else og.apply(this,t)},["intersectsGeometry","shapecast","intersectsBox","intersectsSphere"].forEach((e=>{const t=ng.prototype[e];ng.prototype[e]=function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return(null===i[0]||i[0].isMesh)&&(i.shift(),console.warn(`MeshBVH: The function signature for "${e}" has changed and no longer takes Mesh. See docs for new signature.`)),t.apply(this,i)}}));const lg=new hn,cg=new dn,hg=Wi.prototype.raycast;class dg extends Va{constructor(){super();const e=new Pi;e.deleteAttribute("uv");const t=new xc({side:1}),n=new xc,i=new ph(16777215,5,28,2);i.position.set(.418,16.199,.3),this.add(i);const s=new Wi(e,t);s.position.set(-.757,13.219,.717),s.scale.set(31.713,28.305,28.591),this.add(s);const r=new Wi(e,n);r.position.set(-10.906,2.009,1.846),r.rotation.set(0,-.195,0),r.scale.set(2.328,7.905,4.651),this.add(r);const a=new Wi(e,n);a.position.set(-5.607,-.754,-.758),a.rotation.set(0,.994,0),a.scale.set(1.97,1.534,3.955),this.add(a);const o=new Wi(e,n);o.position.set(6.167,.857,7.803),o.rotation.set(0,.561,0),o.scale.set(3.927,6.285,3.687),this.add(o);const l=new Wi(e,n);l.position.set(-2.017,.018,6.124),l.rotation.set(0,.333,0),l.scale.set(2.002,4.566,2.064),this.add(l);const c=new Wi(e,n);c.position.set(2.291,-.756,-2.621),c.rotation.set(0,-.286,0),c.scale.set(1.546,1.552,1.496),this.add(c);const h=new Wi(e,n);h.position.set(-2.193,-.369,-5.547),h.rotation.set(0,.516,0),h.scale.set(3.875,3.487,2.986),this.add(h);const d=new Wi(e,ug(50));d.position.set(-16.116,14.37,8.208),d.scale.set(.1,2.428,2.739),this.add(d);const u=new Wi(e,ug(50));u.position.set(-16.109,18.021,-8.207),u.scale.set(.1,2.425,2.751),this.add(u);const p=new Wi(e,ug(17));p.position.set(14.904,12.198,-1.832),p.scale.set(.15,4.265,6.331),this.add(p);const m=new Wi(e,ug(43));m.position.set(-.462,8.89,14.52),m.scale.set(4.38,5.441,.088),this.add(m);const f=new Wi(e,ug(20));f.position.set(3.235,11.486,-12.541),f.scale.set(2.5,2,.1),this.add(f);const g=new Wi(e,ug(100));g.position.set(0,20,0),g.scale.set(1,.1,1),this.add(g)}}function ug(e){const t=new Jn;return t.color.setScalar(e),t}var pg=function(){var e=0,t=document.createElement("div");function n(e){return t.appendChild(e.dom),e}function i(n){for(var i=0;i<t.children.length;i++)t.children[i].style.display=i===n?"block":"none";e=n}t.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",(function(n){n.preventDefault(),i(++e%t.children.length)}),!1);var s=(performance||Date).now(),r=s,a=0,o=n(new pg.Panel("FPS","#0ff","#002")),l=n(new pg.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=n(new pg.Panel("MB","#f08","#201"));return i(0),{REVISION:16,dom:t,addPanel:n,showPanel:i,begin:function(){s=(performance||Date).now()},end:function(){a++;var e=(performance||Date).now();if(l.update(e-s,200),e>=r+1e3&&(o.update(1e3*a/(e-r),100),r=e,a=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){s=this.end()},domElement:t,setMode:i}};pg.Panel=function(e,t,n){var i=1/0,s=0,r=Math.round,a=r(window.devicePixelRatio||1),o=80*a,l=48*a,c=3*a,h=2*a,d=3*a,u=15*a,p=74*a,m=30*a,f=document.createElement("canvas");f.width=o,f.height=l,f.style.cssText="width:80px;height:48px";var g=f.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=n,g.fillRect(0,0,o,l),g.fillStyle=t,g.fillText(e,c,h),g.fillRect(d,u,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,u,p,m),{dom:f,update:function(l,y){i=Math.min(i,l),s=Math.max(s,l),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,o,u),g.fillStyle=t,g.fillText(r(l)+" "+e+" ("+r(i)+"-"+r(s)+")",c,h),g.drawImage(f,d+a,u,p-a,m,d,u,p-a,m),g.fillRect(d+p-a,u,a,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-a,u,a,r((1-l/y)*m))}}};var mg=pg;class fg extends Wi{constructor(){const e=fg.SkyShader,t=new Di({name:"SkyShader",fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:Hi.clone(e.uniforms),side:1,depthWrite:!1});super(new Pi(1,1,1),t),this.isSky=!0}}function gg(e){const t=e.data.array.constructor,n=e.count,i=e.itemSize,s=e.normalized,r=new t(n*i);let a;a=e.isInstancedInterleavedBufferAttribute?new xo(r,i,s,e.meshPerAttribute):new $n(r,i,s);for(let t=0;t<n;t++)a.setX(t,e.getX(t)),i>=2&&a.setY(t,e.getY(t)),i>=3&&a.setZ(t,e.getZ(t)),i>=4&&a.setW(t,e.getW(t));return a}fg.SkyShader={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new zt},up:{value:new zt(0,1,0)}},vertexShader:"\n\t\tuniform vec3 sunPosition;\n\t\tuniform float rayleigh;\n\t\tuniform float turbidity;\n\t\tuniform float mieCoefficient;\n\t\tuniform vec3 up;\n\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\t// constants for atmospheric scattering\n\t\tconst float e = 2.71828182845904523536028747135266249775724709369995957;\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\t// wavelength of used primaries, according to preetham\n\t\tconst vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n\t\t// this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function:\n\t\t// (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n\t\tconst vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n\t\t// mie stuff\n\t\t// K coefficient for the primaries\n\t\tconst float v = 4.0;\n\t\tconst vec3 K = vec3( 0.686, 0.678, 0.666 );\n\t\t// MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n\t\tconst vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n\t\t// earth shadow hack\n\t\t// cutoffAngle = pi / 1.95;\n\t\tconst float cutoffAngle = 1.6110731556870734;\n\t\tconst float steepness = 1.5;\n\t\tconst float EE = 1000.0;\n\n\t\tfloat sunIntensity( float zenithAngleCos ) {\n\t\t\tzenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n\t\t\treturn EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n\t\t}\n\n\t\tvec3 totalMie( float T ) {\n\t\t\tfloat c = ( 0.2 * T ) * 10E-18;\n\t\t\treturn 0.434 * c * MieConst;\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n\t\t\tvSunDirection = normalize( sunPosition );\n\n\t\t\tvSunE = sunIntensity( dot( vSunDirection, up ) );\n\n\t\t\tvSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n\t\t\tfloat rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n\t\t\t// extinction (absorbtion + out scattering)\n\t\t\t// rayleigh coefficients\n\t\t\tvBetaR = totalRayleigh * rayleighCoefficient;\n\n\t\t\t// mie coefficients\n\t\t\tvBetaM = totalMie( turbidity ) * mieCoefficient;\n\n\t\t}",fragmentShader:"\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\tuniform float mieDirectionalG;\n\t\tuniform vec3 up;\n\n\t\tconst vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );\n\n\t\t// constants for atmospheric scattering\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\tconst float n = 1.0003; // refractive index of air\n\t\tconst float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n\t\t// optical length at zenith for molecules\n\t\tconst float rayleighZenithLength = 8.4E3;\n\t\tconst float mieZenithLength = 1.25E3;\n\t\t// 66 arc seconds -> degrees, and the cosine of that\n\t\tconst float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n\t\t// 3.0 / ( 16.0 * pi )\n\t\tconst float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n\t\t// 1.0 / ( 4.0 * pi )\n\t\tconst float ONE_OVER_FOURPI = 0.07957747154594767;\n\n\t\tfloat rayleighPhase( float cosTheta ) {\n\t\t\treturn THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n\t\t}\n\n\t\tfloat hgPhase( float cosTheta, float g ) {\n\t\t\tfloat g2 = pow( g, 2.0 );\n\t\t\tfloat inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n\t\t\treturn ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec3 direction = normalize( vWorldPosition - cameraPos );\n\n\t\t\t// optical length\n\t\t\t// cutoff angle at 90 to avoid singularity in next formula.\n\t\t\tfloat zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n\t\t\tfloat inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n\t\t\tfloat sR = rayleighZenithLength * inverse;\n\t\t\tfloat sM = mieZenithLength * inverse;\n\n\t\t\t// combined extinction factor\n\t\t\tvec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n\t\t\t// in scattering\n\t\t\tfloat cosTheta = dot( direction, vSunDirection );\n\n\t\t\tfloat rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n\t\t\tvec3 betaRTheta = vBetaR * rPhase;\n\n\t\t\tfloat mPhase = hgPhase( cosTheta, mieDirectionalG );\n\t\t\tvec3 betaMTheta = vBetaM * mPhase;\n\n\t\t\tvec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n\t\t\tLin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n\t\t\t// nightsky\n\t\t\tfloat theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]\n\t\t\tfloat phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]\n\t\t\tvec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n\t\t\tvec3 L0 = vec3( 0.1 ) * Fex;\n\n\t\t\t// composition + solar disc\n\t\t\tfloat sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n\t\t\tL0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n\t\t\tvec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n\t\t\tvec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n\t\t\tgl_FragColor = vec4( retColor, 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\n\t\t}"};class yg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:t,msg:n,transfer:i}=this.queue.shift();this.workersResolve[e]=t,this.workers[e].postMessage(n,i)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise((n=>{const i=this._getIdleWorker();-1!==i?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=n,this.workers[i].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})}))}dispose(){this.workers.forEach((e=>e.terminate())),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}function bg(e,t,n){var i=void 0===t?null:t,s=function(e,t){var n=atob(e);if(t){for(var i=new Uint8Array(n.length),s=0,r=n.length;s<r;++s)i[s]=n.charCodeAt(s);return String.fromCharCode.apply(null,new Uint16Array(i.buffer))}return n}(e,void 0!==n&&n),r=s.indexOf("\n",10)+1,a=s.substring(r)+(i?"//# sourceMappingURL="+i:""),o=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(o)}var vg,xg,wg,Sg,Mg=(vg="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Ci8qKgoJICogQGxpY2Vuc2UKCSAqIENvcHlyaWdodCAyMDEwLTIwMjIgVGhyZWUuanMgQXV0aG9ycwoJICogU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVAoJICovY29uc3QgdD0xMDAxLGU9InNyZ2IiLHM9InNyZ2ItbGluZWFyIjtjbGFzcyBpe2FkZEV2ZW50TGlzdGVuZXIodCxlKXt2b2lkIDA9PT10aGlzLl9saXN0ZW5lcnMmJih0aGlzLl9saXN0ZW5lcnM9e30pO2NvbnN0IHM9dGhpcy5fbGlzdGVuZXJzO3ZvaWQgMD09PXNbdF0mJihzW3RdPVtdKSwtMT09PXNbdF0uaW5kZXhPZihlKSYmc1t0XS5wdXNoKGUpfWhhc0V2ZW50TGlzdGVuZXIodCxlKXtpZih2b2lkIDA9PT10aGlzLl9saXN0ZW5lcnMpcmV0dXJuITE7Y29uc3Qgcz10aGlzLl9saXN0ZW5lcnM7cmV0dXJuIHZvaWQgMCE9PXNbdF0mJi0xIT09c1t0XS5pbmRleE9mKGUpfXJlbW92ZUV2ZW50TGlzdGVuZXIodCxlKXtpZih2b2lkIDA9PT10aGlzLl9saXN0ZW5lcnMpcmV0dXJuO2NvbnN0IHM9dGhpcy5fbGlzdGVuZXJzW3RdO2lmKHZvaWQgMCE9PXMpe2NvbnN0IHQ9cy5pbmRleE9mKGUpOy0xIT09dCYmcy5zcGxpY2UodCwxKX19ZGlz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hLCBiICkgaW5zdGVhZC4iKSx0aGlzLnN1YlZlY3RvcnModCxlKSk6KHRoaXMueC09dC54LHRoaXMueS09dC55LHRoaXMpfXN1YlNjYWxhcih0KXtyZXR1cm4gdGhpcy54LT10LHRoaXMueS09dCx0aGlzfXN1YlZlY3RvcnModCxlKXtyZXR1cm4gdGhpcy54PXQueC1lLngsdGhpcy55PXQueS1lLnksdGhpc31tdWx0aXBseSh0KXtyZXR1cm4gdGhpcy54Kj10LngsdGhpcy55Kj10LnksdGhpc31tdWx0aXBseVNjYWxhcih0KXtyZXR1cm4gdGhpcy54Kj10LHRoaXMueSo9dCx0aGlzfWRpdmlkZSh0KXtyZXR1cm4gdGhpcy54Lz10LngsdGhpcy55Lz10LnksdGhpc31kaXZpZGVTY2FsYXIodCl7cmV0dXJuIHRoaXMubXVsdGlwbHlTY2FsYXIoMS90KX1hcHBseU1hdHJpeDModCl7Y29uc3QgZT10aGlzLngscz10aGlzLnksaT10LmVsZW1lbnRzO3JldHVybiB0aGlzLng9aVswXSplK2lbM10qcytpWzZdLHRoaXMueT1pWzFdKmUraVs0XSpzK2lbN10sdGhpc31taW4odCl7cmV0dXJuIHRoaXMueD1NYXRoLm1pbih0aGlzLngsdC54KSx0aGlzLnk9TWF0aC5taW4odGhpcy55LHQueSksdGhpc31tYXgodCl7cmV0dXJuIHRoaXMueD1NYXRoLm1heCh0aGlzLngsdC54KSx0aGlzLnk9TWF0aC5tYXgodGhpcy55LHQueSksdGhpc31jbGFtcCh0LGUpe3JldHVybiB0aGlzLng9TWF0aC5tYXgodC54LE1hdGgubWluKGUueCx0aGlzLngpKSx0aGlzLnk9TWF0aC5tYXgodC55LE1hdGgubWluKGUueSx0aGlzLnkpKSx0aGlzfWNsYW1wU2NhbGFyKHQsZSl7cmV0dXJuIHRoaXMueD1NYXRoLm1heCh0LE1hdGgubWluKGUsdGhpcy54KSksdGhpcy55PU1hdGgubWF4KHQsTWF0aC5taW4oZSx0aGlzLnkpKSx0aGlzfWNsY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nkrPXQsdGhpcy56Kz10LHRoaXMudys9dCx0aGlzfWFkZFZlY3RvcnModCxlKXtyZXR1cm4gdGhpcy54PXQueCtlLngsdGhpcy55PXQueStlLnksdGhpcy56PXQueitlLnosdGhpcy53PXQudytlLncsdGhpc31hZGRTY2FsZWRWZWN0b3IodCxlKXtyZXR1cm4gdGhpcy54Kz10LngqZSx0aGlzLnkrPXQueSplLHRoaXMueis9dC56KmUsdGhpcy53Kz10LncqZSx0aGlzfXN1Yih0LGUpe3JldHVybiB2b2lkIDAhPT1lPyhjb25zb2xlLndhcm4oIlRIUkVFLlZlY3RvcjQ6IC5zdWIoKSBub3cgb25seSBhY2NlcHRzIG9uZSBhcmd1bWVudC4gVXNlIC5zdWJWZWN0b3JzKCBhLCBiICkgaW5zdGVhZC4iKSx0aGlzLnN1YlZlY3RvcnModCxlKSk6KHRoaXMueC09dC54LHRoaXMueS09dC55LHRoaXMuei09dC56LHRoaXMudy09dC53LHRoaXMpfXN1YlNjYWxhcih0KXtyZXR1cm4gdGhpcy54LT10LHRoaXMueS09dCx0aGlzLnotPXQsdGhpcy53LT10LHRoaXN9c3ViVmVjdG9ycyh0LGUpe3JldHVybiB0aGlzLng9dC54LWUueCx0aGlzLnk9dC55LWUueSx0aGlzLno9dC56LWUueix0aGlzLnc9dC53LWUudyx0aGlzfW11bHRpcGx5KHQpe3JldHVybiB0aGlzLngqPXQueCx0aGlzLnkqPXQueSx0aGlzLnoqPXQueix0aGlzLncqPXQudyx0aGlzfW11bHRpcGx5U2NhbGFyKHQpe3JldHVybiB0aGlzLngqPXQsdGhpcy55Kj10LHRoaXMueio9dCx0aGlzLncqPXQsdGhpc31hcHBseU1hdHJpeDQodCl7Y29uc3QgZT10aGlzLngscz10aGlzLnksaT10aGlzLnoscj10aGlzLncsbj10LmVsZW1lbnRzO3JldHVybiB0aGlzLng9blswXSplK25bNF0qcytuWzhdKmkrblsxMl0qcix0aGlzLnk9blsxXSplK25bNV0qcytuWzldKmkrblsxM10qcix0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c9LXRoaXMudyx0aGlzfWRvdCh0KXtyZXR1cm4gdGhpcy54KnQueCt0aGlzLnkqdC55K3RoaXMueip0LnordGhpcy53KnQud31sZW5ndGhTcSgpe3JldHVybiB0aGlzLngqdGhpcy54K3RoaXMueSp0aGlzLnkrdGhpcy56KnRoaXMueit0aGlzLncqdGhpcy53fWxlbmd0aCgpe3JldHVybiBNYXRoLnNxcnQodGhpcy54KnRoaXMueCt0aGlzLnkqdGhpcy55K3RoaXMueip0aGlzLnordGhpcy53KnRoaXMudyl9bWFuaGF0dGFuTGVuZ3RoKCl7cmV0dXJuIE1hdGguYWJzKHRoaXMueCkrTWF0aC5hYnModGhpcy55KStNYXRoLmFicyh0aGlzLnopK01hdGguYWJzKHRoaXMudyl9bm9ybWFsaXplKCl7cmV0dXJuIHRoaXMuZGl2aWRlU2NhbGFyKHRoaXMubGVuZ3RoKCl8fDEpfXNldExlbmd0aCh0KXtyZXR1cm4gdGhpcy5ub3JtYWxpemUoKS5tdWx0aXBseVNjYWxhcih0KX1sZXJwKHQsZSl7cmV0dXJuIHRoaXMueCs9KHQueC10aGlzLngpKmUsdGhpcy55Kz0odC55LXRoaXMueSkqZSx0aGlzLnorPSh0LnotdGhpcy56KSplLHRoaXMudys9KHQudy10aGlzLncpKmUsdGhpc31sZXJwVmVjdG9ycyh0LGUscyl7cmV0dXJuIHRoaXMueD10LngrKGUueC10LngpKnMsdGhpcy55PXQueSsoZS55LXQueSkqcyx0aGlzLno9dC56KyhlLnotdC56KSpzLHRoaXMudz10LncrKGUudy10LncpKnMsdGhpc31lcXVhbHModCl7cmV0dXJuIHQueD09PXRoaXMueCYmdC55PT09dGhpcy55JiZ0Lno9PT10aGlzLnomJnQudz09PXRoaXMud31mcm9tQXJyYXkodCl7bGV0IGU9YXJndW1lbnRzLmxlbmd0aD4xJiZ2b2lkIDAhPT1hcmd1bWVudHNbMV0/YXJndW1lbnRzWzFdOjA7cmV0dXJuIHRoaXMueD10W2VdLHRoaXMueT10W2UrMV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aGlzLngscz10aGlzLnksaT10aGlzLnoscj10LmVsZW1lbnRzLG49MS8oclszXSplK3JbN10qcytyWzExXSppK3JbMTVdKTtyZXR1cm4gdGhpcy54PShyWzBdKmUrcls0XSpzK3JbOF0qaStyWzEyXSkqbix0aGlzLnk9KHJbMV0qZStyWzVdKnMrcls5XSppK3JbMTNdKSpuLHRoaXMuej0oclsyXSplK3JbNl0qcytyWzEwXSppK3JbMTRdKSpuLHRoaXN9YXBwbHlRdWF0ZXJuaW9uKHQpe2NvbnN0IGU9dGhpcy54LHM9dGhpcy55LGk9dGhpcy56LHI9dC54LG49dC55LG89dC56LGE9dC53LGg9YSplK24qaS1vKnMsbD1hKnMrbyplLXIqaSxjPWEqaStyKnMtbiplLHU9LXIqZS1uKnMtbyppO3JldHVybiB0aGlzLng9aCphK3UqLXIrbCotby1jKi1uLHRoaXMueT1sKmErdSotbitjKi1yLWgqLW8sdGhpcy56PWMqYSt1Ki1vK2gqLW4tbCotcix0aGlzfXByb2plY3QodCl7cmV0dXJuIHRoaXMuYXBwbHlNYXRyaXg0KHQubWF0cml4V29ybGRJbnZlcnNlKS5hcHBseU1hdHJpeDQodC5wcm9qZWN0aW9uTWF0cml4KX11bnByb2plY3QodCl7cmV0dXJuIHRoaXMuYXBwbHlNYXRyaXg0KHQucHJvamVjdGlvbk1hdHJpeEludmVyc2UpLmFwcGx5TWF0cml4NCh0Lm1hdHJpeFdvcmxkKX10cmFuc2Zvcm1EaXJlY3Rpb24odCl7Y29uc3QgZT10aGlzLngscz10aGlzLnksaT10aGlzLnoscj10LmVsZW1lbnRzO3JldHVybiB0aGlzLng9clswXSplK3JbNF0qcytyWzhdKmksdGhpcy55PXJbMV0qZStyWzVdKnMrcls5XSppLHRoaXMuej1yWzJdKmUrcls2XSpzK3JbMTBdKmksdGhpcy5ub3JtYWxpemUoKX1kaXZpZGUodCl7cmV0dXJuIHRoaXMueC89dC54LHRoaXMueS89dC55LHRoaXMuei89dC56LHRoaXN9ZGl2aWRlU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b2dyZXNzOnR9KSxlPXMpfSksci5ncm91cHMpe2NvbnN0IHQ9ci5ncm91cHM7Zm9yKGNvbnN0IGUgaW4gdCl7Y29uc3Qgcz10W2VdO24uYWRkR3JvdXAocy5zdGFydCxzLmNvdW50LHMubWF0ZXJpYWxJbmRleCl9fWNvbnN0IG89bmV3IGdzKG4sciksYT1ncy5zZXJpYWxpemUobyx7Y2xvbmVCdWZmZXJzOiExfSk7cG9zdE1lc3NhZ2Uoe2Vycm9yOm51bGwsc2VyaWFsaXplZDphLHBvc2l0aW9uOmkscHJvZ3Jlc3M6MX0sW2kuYnVmZmVyLC4uLmEucm9vdHNdKX1jYXRjaCh0KXtwb3N0TWVzc2FnZSh7ZXJyb3I6dCxzZXJpYWxpemVkOm51bGwscG9zaXRpb246bnVsbCxwcm9ncmVzczoxfSl9fX0oKTsKCg==",xg=null,wg=!1,function(e){return Sg=Sg||bg(vg,xg,wg),new Worker(Sg,e)});const Lg=new class{constructor(){this.workerPool=new yg(4),this.workerPool.setWorkerCreator((()=>{const e=new Mg;return e.addEventListener("error",(e=>{throw e.message?new Error(`GenerateMeshBVHWorker: Could not create Web Worker with error "${e.message}"`):new Error("GenerateMeshBVHWorker: Could not create Web Worker.")})),e}))}generate(e,t={}){const{workerPool:n}=this;return new Promise(((i,s)=>{!function(e){const t=e.attributes,n=e.morphTargets,i=new Map;for(const e in t){const n=t[e];n.isInterleavedBufferAttribute&&(i.has(n)||i.set(n,gg(n)),t[e]=i.get(n))}for(const e in n){const t=n[e];t.isInterleavedBufferAttribute&&(i.has(t)||i.set(t,gg(t)),n[e]=i.get(t))}}(e);const r=e.index?e.index.array:null,a=e.attributes.position.array;n.postMessage({index:r,position:a,options:Object.assign(Object.assign({},t),{onProgress:null,includedProgressCallback:Boolean(t.onProgress),groups:[...e.groups]})}).then((n=>{const{data:r}=n;if(r)if(r.error)s(new Error(r.error));else if(r.serialized){const{serialized:n,position:s}=r,a=ng.deserialize(n,e,{setIndex:!1}),o=Object.assign({setBoundingBox:!1},t);if(e.attributes.position instanceof ka?e.attributes.position.data.array=s:e.attributes.position.array=s,e.index)e.index.array=n.index;else{const t=new $n(n.index,1,!1);e.setIndex(t)}o.setBoundingBox&&(e.boundingBox=a.getBoundingBox(new Zt)),i(a)}else t.onProgress&&t.onProgress(r.progress)}))}))}dispose(){this.workerPool.dispose()}terminate(){console.warn('GenerateMeshBVHWorker: "terminate" is deprecated. Use "dispose" instead.'),this.dispose()}};var Cg=function(){function e(t,n){if(void 0===n&&(n=null),this.nonEmpty=!1,t||n){if(!t)throw new Error("Parameter head cannot be null.");this.head=t,this.tail=n||e.NIL,this.nonEmpty=!0}else{if(e.NIL)throw new Error("Parameters head and tail are null. Use the NIL element instead.");this.nonEmpty=!1}}return Object.defineProperty(e.prototype,"length",{get:function(){if(!this.nonEmpty)return 0;if(this.tail===e.NIL)return 1;for(var t=0,n=this;n.nonEmpty;)++t,n=n.tail;return t},enumerable:!0,configurable:!0}),e.prototype.prepend=function(t){return new e(t,this)},e.prototype.append=function(t){if(!t)return this;if(!this.nonEmpty)return new e(t);if(this.tail===e.NIL)return new e(t).prepend(this.head);for(var n=new e(this.head),i=n,s=this.tail;s.nonEmpty;)i=i.tail=new e(s.head),s=s.tail;return i.tail=new e(t),n},e.prototype.insertWithPriority=function(t){if(!this.nonEmpty)return new e(t);var n=t.priority;if(n>this.head.priority)return this.prepend(t);for(var i=new e(this.head),s=i,r=this.tail;r.nonEmpty;){if(n>r.head.priority)return s.tail=r.prepend(t),i;s=s.tail=new e(r.head),r=r.tail}return s.tail=new e(t),i},e.prototype.filterNot=function(t){if(!this.nonEmpty||null==t)return this;if(t===this.head.listener)return this.tail;for(var n=new e(this.head),i=n,s=this.tail;s.nonEmpty;){if(s.head.listener===t)return i.tail=s.tail,n;i=i.tail=new e(s.head),s=s.tail}return this},e.prototype.contains=function(e){if(!this.nonEmpty)return!1;for(var t=this;t.nonEmpty;){if(t.head.listener===e)return!0;t=t.tail}return!1},e.prototype.find=function(e){if(!this.nonEmpty)return null;for(var t=this;t.nonEmpty;){if(t.head.listener===e)return t.head;t=t.tail}return null},e.prototype.toString=function(){for(var e="",t=this;t.nonEmpty;)e+=t.head+" -> ",t=t.tail;return"[List "+(e+="NIL")+"]"},e.NIL=new e(null,null),e}(),Gg=Object.defineProperty({SlotList:Cg},"__esModule",{value:!0}),Tg=function(){function e(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=0),this._enabled=!0,this._once=!1,this._priority=0,this._listener=e,this._once=n,this._signal=t,this._priority=i,this.verifyListener(e)}return e.prototype.execute0=function(){this._enabled&&(this._once&&this.remove(),this._params&&this._params.length?this._listener.apply(null,this._params):this._listener())},e.prototype.execute1=function(e){this._enabled&&(this._once&&this.remove(),this._params&&this._params.length?this._listener.apply(null,[e].concat(this._params)):this._listener(e))},e.prototype.execute=function(e){if(this._enabled){this._once&&this.remove(),this._params&&this._params.length&&(e=e.concat(this._params));var t=e.length;0===t?this._listener():1===t?this._listener(e[0]):2===t?this._listener(e[0],e[1]):3===t?this._listener(e[0],e[1],e[2]):this._listener.apply(null,e)}},Object.defineProperty(e.prototype,"listener",{get:function(){return this._listener},set:function(e){if(null==e)throw new Error("Given listener is null.\nDid you want to set enabled to false instead?");this.verifyListener(e),this._listener=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"once",{get:function(){return this._once},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"priority",{get:function(){return this._priority},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"[Slot listener: "+this._listener+", once: "+this._once+", priority: "+this._priority+", enabled: "+this._enabled+"]"},Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){this._enabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"params",{get:function(){return this._params},set:function(e){this._params=e},enumerable:!0,configurable:!0}),e.prototype.remove=function(){this._signal.remove(this._listener)},e.prototype.verifyListener=function(e){if(null==e)throw new Error("Given listener is null.");if(null==this._signal)throw new Error("Internal signal reference has not been set yet.")},e}(),Rg=Object.defineProperty({Slot:Tg},"__esModule",{value:!0}),Ag=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.slots=Gg.SlotList.NIL,this.valueClasses=1===e.length&&e[0]instanceof Array?e[0]:e}return Object.defineProperty(e.prototype,"valueClasses",{get:function(){return this._valueClasses},set:function(e){this._valueClasses=e?e.slice():[];for(var t=this._valueClasses.length;t--;)if(!(this._valueClasses[t]instanceof Object))throw new Error("Invalid valueClasses argument: item at index "+t+" should be a Class but was:<"+this._valueClasses[t]+">."+this._valueClasses[t])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numListeners",{get:function(){return this.slots.length},enumerable:!0,configurable:!0}),e.prototype.addOnce=function(e){return this.registerListener(e,!0)},e.prototype.remove=function(e){var t=this.slots.find(e);return t?(this.slots=this.slots.filterNot(e),t):null},e.prototype.removeAll=function(){this.slots=Gg.SlotList.NIL},e.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._valueClasses.length,i=e.length;if(i<n)throw new Error("Incorrect number of arguments. Expected at least "+n+" but received "+i+".");for(var s=0;s<n;s++)if(!(null===e[s]||e[s]instanceof this._valueClasses[s]||e[s].constructor===this._valueClasses[s]))throw new Error("Value object <"+e[s]+"> is not an instance of <"+this._valueClasses[s]+">.");var r=this.slots;if(r.nonEmpty)for(;r.nonEmpty;)r.head.execute(e),r=r.tail},e.prototype.registerListener=function(e,t){if(void 0===t&&(t=!1),this.registrationPossible(e,t)){var n=new Rg.Slot(e,this,t);return this.slots=this.slots.prepend(n),n}return this.slots.find(e)},e.prototype.registrationPossible=function(e,t){if(!this.slots.nonEmpty)return!0;var n=this.slots.find(e);if(!n)return!0;if(n.once!==t)throw new Error("You cannot addOnce() then add() the same listener without removing the relationship first.");return!1},e}(),Xg=Object.defineProperty({OnceSignal:Ag},"__esModule",{value:!0}),Ig="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function _g(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})})),t}function zg(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}var Eg=_g(Dp),Wg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Eg.__extends(t,e),t.prototype.add=function(e){return this.registerListener(e)},t}(Xg.OnceSignal),Zg=Object.defineProperty({Signal:Wg},"__esModule",{value:!0}),Pg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Eg.__extends(t,e),t.prototype.addWithPriority=function(e,t){return void 0===t&&(t=0),this.registerListenerWithPriority(e,!1,t)},t.prototype.addOnceWithPriority=function(e,t){return void 0===t&&(t=0),this.registerListenerWithPriority(e,!0,t)},t.prototype.registerListener=function(e,t){return void 0===t&&(t=!1),this.registerListenerWithPriority(e,t)},t.prototype.registerListenerWithPriority=function(e,t,n){if(void 0===n&&(n=0),this.registrationPossible(e,t)){var i=new Rg.Slot(e,this,t,n);return this.slots=this.slots.insertWithPriority(i),i}return this.slots.find(e)},t}(Zg.Signal),Ng=Object.defineProperty({PrioritySignal:Pg},"__esModule",{value:!0}),Vg=function(e){function t(t){void 0===t&&(t=null);for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var s=this;return n=1===n.length&&n[0]instanceof Array?n[0]:n,(s=e.call(this,n)||this)._target=t,s}return Eg.__extends(t,e),Object.defineProperty(t.prototype,"target",{get:function(){return this._target},set:function(e){e!==this._target&&(this.removeAll(),this._target=e)},enumerable:!0,configurable:!0}),t.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._valueClasses.length,i=e.length;if(i<n)throw new Error("Incorrect number of arguments. Expected at least "+n+" but received "+i+".");for(var s=0;s<n;s++)if(null!==e[s]&&e[s].constructor!==this._valueClasses[s])throw new Error("Value object <"+e[s]+"> is not an instance of <"+this._valueClasses[s]+">.");var r=e[0];r&&(r.target&&(r=r.clone(),e[0]=r),r.target=this.target,r.currentTarget=this.target,r.signal=this);for(var a=this.slots;a.nonEmpty;)a.head.execute(e),a=a.tail;if(r&&r.bubbles)for(var o=this.target;o&&o.hasOwnProperty("parent")&&(null===(o=o.parent).onEventBubbled||(r.currentTarget=o,o.onEventBubbled(r))););},t}(Ng.PrioritySignal),Hg=Object.defineProperty({DeluxeSignal:Vg},"__esModule",{value:!0}),Dg=function(){function e(e){void 0===e&&(e=!1),this._bubbles=e}return Object.defineProperty(e.prototype,"signal",{get:function(){return this._signal},set:function(e){this._signal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},set:function(e){this._target=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTarget",{get:function(){return this._currentTarget},set:function(e){this._currentTarget=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bubbles",{get:function(){return this._bubbles},set:function(e){this._bubbles=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e(this._bubbles)},e}(),kg=Object.defineProperty({GenericEvent:Dg},"__esModule",{value:!0}),Bg=Symbol("IOnceSignal"),Fg=Object.defineProperty({IOnceSignal:Bg},"__esModule",{value:!0}),Ug=Symbol("IPrioritySignal"),Og=Object.defineProperty({IPrioritySignal:Ug},"__esModule",{value:!0}),Yg=Symbol("ISignal"),Kg=Object.defineProperty({ISignal:Yg},"__esModule",{value:!0}),jg=Symbol("ISlot"),Jg=Object.defineProperty({ISlot:jg},"__esModule",{value:!0}),Qg=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.valueClasses=1===e.length&&e[0]instanceof Array?e[0]:e}return Object.defineProperty(e.prototype,"valueClasses",{get:function(){return this._valueClasses},set:function(e){this._valueClasses=e?e.slice():[];for(var t=this._valueClasses.length;t--;)if("function"!=typeof this._valueClasses[t])throw new Error("Invalid valueClasses argument: item at index "+t+" should be a Class but was:<"+this._valueClasses[t]+"'>."+this._valueClasses[t])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numListeners",{get:function(){return this.slot?1:0},enumerable:!0,configurable:!0}),e.prototype.add=function(e){return this.registerListener(e)},e.prototype.addOnce=function(e){return this.registerListener(e,!0)},e.prototype.remove=function(e){if(this.slot&&this.slot.listener===e){var t=this.slot;return this.slot=null,t}return null},e.prototype.removeAll=function(){this.slot&&this.slot.remove()},e.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._valueClasses.length,i=e.length;if(i<n)throw new Error("Incorrect number of arguments. Expected at least "+n+" but received "+i+".");for(var s=0;s<n;s++)if(!(null===e[s]||e[s]instanceof this._valueClasses[s]||e[s].constructor===this._valueClasses[s]))throw new Error("Value object <"+e[s]+"> is not an instance of <"+this._valueClasses[s]+">.");this.slot&&this.slot.execute(e)},e.prototype.registerListener=function(e,t){if(void 0===t&&(t=!1),this.slot)throw new Error("You cannot add or addOnce with a listener already added, remove the current listener first.");return this.slot=new Rg.Slot(e,this,t)},e}(),qg=Object.defineProperty({MonoSignal:Qg},"__esModule",{value:!0}),$g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Eg.__extends(t,e),t.prototype.addOnce=function(t){var n=e.prototype.addOnce.call(this,t);return this.isDispatched&&(n.execute(this.valueObjects),n.remove()),n},t.prototype.dispatch=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(this.isDispatched)throw new Error("You cannot dispatch() a Promise more than once");this.isDispatched=!0,this.valueObjects=t,e.prototype.dispatch.apply(this,t)},t}(Xg.OnceSignal),ey=Object.defineProperty({Promise:$g},"__esModule",{value:!0});Hg.DeluxeSignal,kg.GenericEvent,Fg.IOnceSignal,Og.IPrioritySignal,Kg.ISignal,Jg.ISlot,qg.MonoSignal,Xg.OnceSignal,Ng.PrioritySignal,ey.Promise;var ty=Zg.Signal;Rg.Slot,Gg.SlotList;const ny=new Va;ny.name="Scene";class iy{constructor(e,t){this.signals=e,this.viewportState=t,this.scene=ny.clone(),this.scene.castShadow=!0,this.scene.receiveShadow=!0,this.selectedObjects={edge:[],stroke:[],opacity:[],highlight:[],emissive:[]},this.intersectsList={meshOfModelList:[],poiIconList:[],otherObjList:[],getAll:function(){return[...this.meshOfModelList,...this.poiIconList,...this.otherObjList]}}}addObject(e,t){if(this.viewportState.isDisposed)return this.removeObject(e),void console.warn("Scene is disposed");t?t.add(e):this.scene.add(e),this._triggerObjectAdded(e),this.signals.objectAdded.dispatch(e)}removeObject(e){function t(e){var t;(e instanceof Jn||e instanceof xc||e instanceof Sc)&&((t=e.map)&&t.isTexture&&t.dispose()),e.dispose()}e.traverse((e=>{if("Mesh"===e.type){const n=e;n.geometry.dispose(),n.geometry.disposeBoundsTree(),Xm(n.material)?n.material.forEach((e=>t(e))):n.material&&t(n.material)}e instanceof dv&&e.element.remove();const{meshOfModelList:n,poiIconList:i,otherObjList:s}=this.intersectsList,r=n.findIndex((t=>t.uuid===e.uuid)),a=i.findIndex((t=>t.uuid===e.uuid)),o=s.findIndex((t=>t.uuid===e.uuid));r>-1&&this.intersectsList.meshOfModelList.splice(r,1),a>-1&&this.intersectsList.poiIconList.splice(a,1),o>-1&&this.intersectsList.otherObjList.splice(o,1)})),e.removeFromParent(),this.signals.objectRemoved.dispatch(e)}openSceneFog(e={}){const{color:t=13426943,near:n=500,far:i=5e4}=e;this.scene.fog=new Na(t,n,i),this.signals.sceneChanged.dispatch()}closeSceneFog(){this.scene.fog=null,this.signals.sceneChanged.dispatch()}edgeShow(e,t){const n=[],i=e=>{-1===this.selectedObjects.edge.findIndex((t=>t.uuid===e.uuid))&&n.push(e)};return Xm(e)?e.forEach((e=>i(e))):Im(e)&&i(e),this.selectedObjects.edge=[...this.selectedObjects.edge,...n],this.signals.outlineChange.dispatch({objects:this.selectedObjects.edge,options:t}),Promise.resolve()}unEdgeShow(e){e||(e=[...this.selectedObjects.edge]);const t=e=>{const t=this.selectedObjects.edge.findIndex((t=>t.uuid===e.uuid));return-1===t||(this.selectedObjects.edge.splice(t,1),this.signals.outlineChange.dispatch({objects:this.selectedObjects.edge})),Promise.resolve()};return Xm(e)?Promise.all(e.map((e=>t(e)))):Im(e)?t(e):Promise.resolve()}strokeShow(e,t={}){const{isOpacityShow:n=!0,color:i=4647927,opacity:s=.2,edgeColor:r=61183,edgeOpacity:a=1}=t,o=e=>{if(-1!==this.selectedObjects.stroke.findIndex((t=>t.uuid===e.uuid)))return Promise.resolve();if(e.userData.strokeGroup)return Promise.resolve();const t=new cv({id:e.uuid});return e.traverse((n=>{if(n instanceof Wi){const i=new Tl(n.geometry,89),s=new Wo(i,new Go({color:r,transparent:!0,opacity:a}));Lp(s,n),e.attach(s),t.add(s)}})),e.userData.strokeGroup=t,this.addObject(t,e),this.selectedObjects.stroke.push(e),Promise.resolve()};return n&&this.opacityShow(e,{color:i,opacity:s}),Xm(e)?Promise.all(e.map((e=>o(e)))):Im(e)?o(e):Promise.resolve()}unStrokeShow(e){e||(e=[...this.selectedObjects.stroke]);const t=e=>{if(!e.userData.strokeGroup)return Promise.resolve();this.removeObject(e.userData.strokeGroup),Reflect.deleteProperty(e.userData,"strokeGroup");const t=this.selectedObjects.stroke.findIndex((t=>t.uuid===e.uuid));return-1===t||(this.selectedObjects.stroke.splice(t,1),this.signals.geometryChanged.dispatch(),this.unOpacityShow(e)),Promise.resolve()};return Xm(e)?Promise.all(e.map((e=>t(e)))):Im(e)?t(e):Promise.resolve()}opacityShow(e,t={}){const{color:n="#fff",opacity:i=.8}=t;function s(e){const t=Reflect.construct(e.constructor,[{transparent:!0,color:n,opacity:i}]);return e.dispose(),t}const r=e=>(-1!==this.selectedObjects.opacity.findIndex((t=>t.uuid===e.uuid))||(e.traverse((e=>{if(e instanceof Wi){if(e.userData.material)return;e.userData.material=e.material,e.material=Ip(e),Xm(e.material)?e.material.forEach(((t,n)=>{e.material[n]=s(t)})):e.material instanceof jn&&(e.material=s(e.material))}})),this.signals.materialChanged.dispatch(),this.selectedObjects.opacity.push(e)),Promise.resolve());return Xm(e)?Promise.all(e.map((e=>r(e)))):Im(e)?r(e):Promise.resolve()}unOpacityShow(e){e||(e=[...this.selectedObjects.opacity]);const t=e=>new Promise((t=>{const n=this.selectedObjects.opacity.findIndex((t=>t.uuid===e.uuid));-1===n&&t(),this.selectedObjects.opacity.splice(n,1),e.traverse((e=>{if(e instanceof Wi){if(!e.userData.material)return;e.material=e.userData.material,Reflect.deleteProperty(e.userData,"material")}})),this.signals.materialChanged.dispatch(),t()}));return Xm(e)?Promise.all(e.map((e=>t(e)))):Im(e)?t(e):Promise.resolve()}highlightShow(e,t={}){const{color:n="red",opacity:i=1}=t;function s(e){e instanceof xc&&(e.color=new bt(n),e.opacity=i,e.transparent=i<1)}const r=e=>(-1!==this.selectedObjects.highlight.findIndex((t=>t.uuid===e.uuid))||(e.traverse((e=>{if(e instanceof Wi){if(e.userData.material)return;e.userData.material=e.material,e.material=Ip(e),Xm(e.material)?e.material.forEach((e=>s(e))):e.material instanceof jn&&s(e.material)}})),this.signals.materialChanged.dispatch(),this.selectedObjects.highlight.push(e)),Promise.resolve());return Xm(e)?Promise.all(e.map((e=>r(e)))):Im(e)?r(e):Promise.resolve()}unHighlightShow(e){e||(e=[...this.selectedObjects.highlight]);const t=e=>new Promise((t=>{const n=this.selectedObjects.highlight.findIndex((t=>t.uuid===e.uuid));-1===n&&t(),this.selectedObjects.highlight.splice(n,1),e.traverse((e=>{if(e instanceof Wi){if(!e.userData.material)return;e.material=e.userData.material,Reflect.deleteProperty(e.userData,"material")}})),this.signals.materialChanged.dispatch(),t()}));return Xm(e)?Promise.all(e.map((e=>t(e)))):Im(e)?t(e):Promise.resolve()}emissiveShow(e,t={}){const{color:n="red",opacity:i=.3,maxOpacity:s=1,minOpacity:r=0,duration:a=1e3}=t;function o(e){e instanceof xc&&(e.emissive.set(n),e.emissiveIntensity=i,Nm({emissiveIntensity:s},{emissiveIntensity:r},{duration:a,repeat:!0},(t=>e.emissiveIntensity=t.emissiveIntensity),(t=>e.userData.animation=t)))}const l=e=>(-1!==this.selectedObjects.emissive.findIndex((t=>t.uuid===e.uuid))||(e.traverse((e=>{if(e instanceof Wi){if(e.userData.material)return;e.userData.material=e.material,e.material=Ip(e),Xm(e.material)?e.material.forEach((e=>o(e))):e.material instanceof jn&&o(e.material)}})),this.selectedObjects.emissive.push(e),this.signals.materialChanged.dispatch()),Promise.resolve());return Xm(e)?Promise.all(e.map((e=>l(e)))):Im(e)?l(e):Promise.resolve()}unEmissiveShow(e){function t(e){e.userData.animation&&up.remove(e.userData.animation)}e||(e=[...this.selectedObjects.emissive]);const n=e=>new Promise((n=>{const i=this.selectedObjects.emissive.findIndex((t=>t.uuid===e.uuid));-1===i&&n(),this.selectedObjects.emissive.splice(i,1),e.traverse((e=>{if(e instanceof Wi){if(!e.userData.material)return;Xm(e.material)?e.material.forEach((e=>t(e))):e.material instanceof jn&&t(e.material),e.material=e.userData.material,Reflect.deleteProperty(e.userData,"material")}})),this.signals.materialChanged.dispatch(),n()}));return Xm(e)?Promise.all(e.map((e=>n(e)))):Im(e)?n(e):Promise.resolve()}_triggerObjectAdded(e){if(e instanceof ov)if("Model"===e.stype||"Canvas3D"===e.stype)e.traverse((e=>{if(e instanceof Wi){-1===this.intersectsList.meshOfModelList.findIndex((t=>t.uuid===e.uuid))&&this.intersectsList.meshOfModelList.push(e)}}));else if("Poi"===e.stype){-1===this.intersectsList.poiIconList.findIndex((t=>t.uuid===e.icon.uuid))&&this.intersectsList.poiIconList.push(e.icon)}else if("BaseMesh"===e.stype){-1===this.intersectsList.otherObjList.findIndex((t=>t.uuid===e.uuid))&&this.intersectsList.otherObjList.push(e)}else"Group"===e.stype&&e.children.forEach((e=>this._triggerObjectAdded(e)));else if(e instanceof av){-1===this.intersectsList.otherObjList.findIndex((t=>t.uuid===e.uuid))&&this.intersectsList.otherObjList.push(e)}else"Object3D"===e.type&&e.traverse((e=>{if(e instanceof Wi){-1===this.intersectsList.otherObjList.findIndex((t=>t.uuid===e.uuid))&&this.intersectsList.otherObjList.push(e)}}))}}class sy extends Zn{constructor(e){super(),this.element=e,this.element.style.position="absolute",this.addEventListener("removed",(()=>{this.traverse((function(e){e instanceof sy&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}}let ry,ay;const oy=new zt,ly=new dn,cy=new dn,hy={objects:new WeakMap};function dy(){const e=new zt,t=new zt;return function(n,i){return e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(i.matrixWorld),e.distanceToSquared(t)}}function uy(e){const t=function(e){const t=[];return e.traverse((function(e){e instanceof sy&&t.push(e)})),t}(e).sort((function(e,t){return hy.objects.get(e).distanceToCameraSquared-hy.objects.get(t).distanceToCameraSquared})),n=t.length;for(let e=0,i=t.length;e<i;e++)t[e].element.style.zIndex=""+(n-e)}class py{constructor(e){e||(e=document.createElement("div")),e.style.overflow="hidden",this.domElement=e}setSize(e,t){ry=e/2,ay=t/2,this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"}renderObject(e,t,n){if(e instanceof sy){oy.setFromMatrixPosition(e.matrixWorld),oy.applyMatrix4(cy);const t=e.element,i="translate(-50%,-100%) translate("+(oy.x*ry+ry)+"px,"+(-oy.y*ay+ay)+"px)";t.style.transform=i,t.style.display=e.visible&&oy.z>=-1&&oy.z<=1?e.userData.elDisplay||"":"none";const s={distanceToCameraSquared:dy()(n,e)};hy.objects.set(e,s),t.parentNode!==this.domElement&&this.domElement.appendChild(t)}for(let i=0,s=e.children.length;i<s;i++)this.renderObject(e.children[i],t,n)}render(e,t){!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),ly.copy(t.matrixWorldInverse),cy.multiplyMatrices(t.projectionMatrix,ly),this.renderObject(e,e,t),uy(e)}}class my extends Zn{constructor(e){super(),this.element=e,this.element.style.position="absolute",this.addEventListener("removed",(()=>{this.traverse((function(e){e instanceof my&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}}let fy,gy,yy,by;function vy(e){return Math.abs(e)<1e-10?0:e}function xy(e){const t=e.elements;return"matrix3d("+vy(t[0])+","+vy(-t[1])+","+vy(t[2])+","+vy(t[3])+","+vy(t[4])+","+vy(-t[5])+","+vy(t[6])+","+vy(t[7])+","+vy(t[8])+","+vy(-t[9])+","+vy(t[10])+","+vy(t[11])+","+vy(t[12])+","+vy(-t[13])+","+vy(t[14])+","+vy(t[15])+")"}class wy{constructor(e,t){this.cache={camera:{fov:0,style:""},objects:new WeakMap},e||(e=document.createElement("div")),e.style.overflow="hidden",e.style.pointerEvents="auto",this.domElement=e,t||(t=document.createElement("div")),t.style.transformStyle="preserve-3d",t.style.pointerEvents="auto",t.style.position="absolute",t.style.top="0",e.appendChild(t),this.cameraElement=t}setSize(e,t){fy=e/2,gy=t/2,this.domElement.style.width=e+"px",this.domElement.style.height=t+"px",this.cameraElement.style.width=e+"px",this.cameraElement.style.height=t+"px"}renderObject(e,t,n,i){if(e instanceof my){const t=function(e,t){const n=e.elements;return"translateX(-50%)matrix3d("+vy(n[0])+","+vy(n[1])+","+vy(n[2])+","+vy(n[3])+","+vy(-n[4])+","+vy(-n[5])+","+vy(-n[6])+","+vy(-n[7])+","+vy(n[8])+","+vy(n[9])+","+vy(n[10])+","+vy(n[11])+","+vy(n[12])+","+vy(n[13])+","+vy(n[14])+","+vy(n[15])+")"}(e.matrixWorld),n=e.element;n.style.transform=t;const i={style:t,distanceToCameraSquared:0};this.cache.objects.set(e,i),n.parentNode!==this.cameraElement&&this.cameraElement.appendChild(n)}for(let s=0,r=e.children.length;s<r;s++)this.renderObject(e.children[s],t,n,i)}render(e,t){const n=t.projectionMatrix.elements[5]*gy;this.cache.camera.fov!==n&&(this.domElement.style.perspective=t instanceof Bi?n+"px":"",this.cache.camera.fov=n),!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld();let i="";if(t instanceof ps){i+="scale("+n+")translateX("+vy(-(t.right+t.left)/2)+"px)"+xy(t.matrixWorldInverse)}else i+="translateZ("+n+"px)"+xy(t.matrixWorldInverse);const s=i+"translate("+fy+"px,"+gy+"px)";this.cameraElement.style.transform=s,this.cache.camera.style=s,this.renderObject(e,e,t,i)}}class Sy extends Zn{constructor(e){super(),this.element=e,this.element.style.position="absolute",this.addEventListener("removed",(()=>{this.traverse((function(e){e instanceof Sy&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}}function My(e){return Math.abs(e)<1e-10?0:e}function Ly(e){const t=e.elements;return"matrix3d("+My(t[0])+","+My(-t[1])+","+My(t[2])+","+My(t[3])+","+My(t[4])+","+My(-t[5])+","+My(t[6])+","+My(t[7])+","+My(t[8])+","+My(-t[9])+","+My(t[10])+","+My(t[11])+","+My(t[12])+","+My(-t[13])+","+My(t[14])+","+My(t[15])+")"}class Cy{constructor(e,t){this.cache={camera:{fov:0,style:""},objects:new WeakMap},e||(e=document.createElement("div")),e.style.overflow="hidden",e.style.pointerEvents="auto",this.domElement=e,t||(t=document.createElement("div")),t.style.transformStyle="preserve-3d",t.style.pointerEvents="auto",t.style.position="absolute",t.style.top="0",e.appendChild(t),this.cameraElement=t}setSize(e,t){yy=e/2,by=t/2,this.domElement.style.width=e+"px",this.domElement.style.height=t+"px",this.cameraElement.style.width=e+"px",this.cameraElement.style.height=t+"px"}renderObject(e,t,n,i){if(e instanceof Sy){const t=n.quaternion.clone();t.x=-n.quaternion.x,t.z=-n.quaternion.z;const i=function(e,t){const n=e.elements;return"translateX(-50%)matrix3d("+My(n[0])+","+My(-n[1])+","+My(n[2])+","+My(n[3])+","+My(n[4])+","+My(-n[5])+","+My(n[6])+","+My(n[7])+","+My(n[8])+","+My(-n[9])+","+My(n[10])+","+My(n[11])+","+My(n[12])+","+My(n[13])+","+My(n[14])+","+My(n[15])+")"}((new dn).compose(e.parent.getWorldPosition(new zt(0,0,0)),t,e.parent.scale)),s=e.element;s.style.transform=i;const r={style:i,distanceToCameraSquared:0};this.cache.objects.set(e,r),s.parentNode!==this.cameraElement&&this.cameraElement.appendChild(s)}for(let s=0,r=e.children.length;s<r;s++)this.renderObject(e.children[s],t,n,i)}render(e,t){const n=t.projectionMatrix.elements[5]*by;this.cache.camera.fov!==n&&(this.domElement.style.perspective=t instanceof Bi?n+"px":"",this.cache.camera.fov=n),!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld();let i="";if(t instanceof ps){i+="scale("+n+")translateX("+My(-(t.right+t.left)/2)+"px)"+Ly(t.matrixWorldInverse)}else i+="translateZ("+n+"px)"+Ly(t.matrixWorldInverse);const s=i+"translate("+yy+"px,"+by+"px)";this.cameraElement.style.transform=s,this.cache.camera.style=s,this.renderObject(e,e,t,i)}}class Gy{constructor(e){this.options=e,this.internalOptions={enableRenderCss2D:!1,enableRenderCss2DHalf:!1,enableRenderCss3D:!1},this.container=this._initContainer(),this.renderer=this._initRenderer(),this.rendererCSS2D=this._initRenderCSS2D(),this.rendererCSS3D=this._initRenderCSS3D(),this.rendererCSS2DHalf=this._initRenderCSS2DHalf(),this.interactiveContainer=this._initInteractiveContainer()}setInternalState(e,t){this.internalOptions[e]=t}getWidth(){return this.renderer.domElement.width}getHeight(){return this.renderer.domElement.height}getMouseRelativeConRatio(e){const t=this.container.getBoundingClientRect();return[(e.offsetX-t.left)/t.width,(e.offsetY-t.top)/t.height]}getMousePoint(e){const t=new nt(0,0);return t.fromArray(this.getMouseRelativeConRatio(e)),t}_initContainer(){const e=document.createElement("div");return e.style.position="relative",e.style.width="100%",e.style.height="100%",e}_initRenderer(){const{background:e={},logarithmicDepthBuffer:t}=this.options,{color:n,alpha:i}=e,s=new Wa({alpha:i,logarithmicDepthBuffer:t,preserveDrawingBuffer:!0,antialias:!1,stencil:!1,depth:!1,powerPreference:"high-performance"}),r=i?0:1,{offsetWidth:a,offsetHeight:o}=this.container;return s.setSize(a,o),s.setClearColor(n||0,r),s.setPixelRatio(self.devicePixelRatio),s.autoClear=!1,s.localClippingEnabled=!0,s.sortObjects=!0,s.shadowMap.enabled=!0,this.container.appendChild(s.domElement),s}_initRenderCSS2D(){const e=new py;return e.domElement.id="ssp_view_2DPoi",e.domElement.style.position="absolute",e.domElement.style.top="0",e.domElement.style.width="100%",e.domElement.style.height="100%",e.setSize(this.container.offsetWidth,this.container.offsetHeight),this.container.appendChild(e.domElement),e}_initRenderCSS3D(){const e=new wy;return e.domElement.id="ssp_view_3DPoi",e.domElement.style.position="absolute",e.domElement.style.top="0",e.domElement.style.width="100%",e.domElement.style.height="100%",e.setSize(this.container.offsetWidth,this.container.offsetHeight),this.container.appendChild(e.domElement),e}_initRenderCSS2DHalf(){const e=new Cy(this.rendererCSS3D.domElement,this.rendererCSS3D.cameraElement);return e.setSize(this.container.offsetWidth,this.container.offsetHeight),e}_initInteractiveContainer(){const e=document.createElement("div");return e.id="ssp_view_interactive",e.style.position="absolute",e.style.top="0",e.style.width="100%",e.style.height="100%",e.style.userSelect="none",this.container.appendChild(e),e}}const Ty=new dn,Ry=(e,t)=>{const n=Ty.clone(),i=Ty.clone(),s=Ty.clone();n.makeRotationY(e),i.makeRotationX(t);const r=new wn;return s.multiplyMatrices(n,i),r.setFromRotationMatrix(s),r},Ay=Ry(-Math.PI/2,-Math.PI/4),Xy=Ry(Math.PI/2,-Math.PI/4),Iy=Ry(-Math.PI/4,-Math.PI/4),_y=Ry(Math.PI/4,-Math.PI/4),zy=Ry(1.25*Math.PI,-Math.PI/4),Ey=Ry(.75*Math.PI,-Math.PI/4),Wy={LEFT:new wn(0,-Math.PI/2,0),RIGHT:new wn(0,Math.PI/2,0),FRONT:new wn(0,0,0),BACK:new wn(0,Math.PI,0),TOP:new wn(-Math.PI/2,0,0),BOTTOM:new wn(Math.PI/2,0,0),FRONTTOP:new wn(-Math.PI/4,0,0),BACKTOP:new wn(Math.PI/4,Math.PI,0),LEFTTOP:new wn(Ay.x,Ay.y,Ay.z),RIGHTTOP:new wn(Xy.x,Xy.y,Xy.z),LEFTFRONTTOP:new wn(Iy.x,Iy.y,Iy.z),RIGHTFRONTTOP:new wn(_y.x,_y.y,_y.z),LEFTBACKTOP:new wn(zy.x,zy.y,zy.z),RIGHTBACKTOP:new wn(Ey.x,Ey.y,Ey.z)},Zy=e=>Am(e)?e:e.includes("%")?.01*Number(e.split("%")[0]):isNaN(+e)?0:Number(e),Py=new zt,Ny=new wn,Vy=new Bi(50,1,.1,5e5);Vy.position.set(500,1e3,500),Vy.lookAt(Py.set(0,0,0)),Vy.name="Camera";class Hy{constructor(e){this.viewport=e,this.mainCamera=Vy.clone(),this.mainCamera.name="freeCamera",this.currentCamera=this.mainCamera,this.cameras={}}createCamera(e){const t=Vy.clone();return t.name=e,this.cameras[e]=t,t}removeCamera(e){return"fullFreeCamera"!==e&&(delete this.cameras[e],!0)}setCurrentCamera(e){this.currentCamera=this.viewport.camera=e,this.viewport.signals.cameraObjectChange.dispatch()}getMainCamera(){return this.mainCamera}getCameraViewpoint(){if("free"===this.viewport.controls.options.type)return{position:this.currentCamera.position.clone(),rotation:{x:this.currentCamera.rotation.x,y:this.currentCamera.rotation.y,z:this.currentCamera.rotation.z}};{const e=this.viewport.controls.currentControls;return{position:this.currentCamera.position.clone(),target:e.target.clone()}}}setCameraViewpoint(e){if("free"===this.viewport.controls.options.type&&Im(e)){const{position:t,rotation:n}=e;this.currentCamera.position.set(t.x,t.y,t.z),this.currentCamera.rotation.set(n.x,n.y,n.z)}else if(Im(e)){const{position:t,target:n}=e,i=this.viewport.controls.currentControls;this.currentCamera.position.set(t.x,t.y,t.z),i.target.set(n.x,n.y,n.z)}this.viewport.signals.cameraChange.dispatch(this.currentCamera.position.clone())}moveTo(e,t){return Nm(this.currentCamera.position,e,t,(e=>this.viewport.signals.cameraChange.dispatch(e)))}rotateTo(e,t){const n=this.currentCamera.quaternion.clone(),i=(new _t).setFromEuler(e);return Nm({t:0},{t:1},t,(({t:e})=>{this.currentCamera.quaternion.slerpQuaternions(n,i,e)}))}flyTo(e,t="frontTop",n){return Wp(this,void 0,void 0,(function*(){if(Tm(t)){const e=t.toLocaleUpperCase();"CURRENT"===e?Ny.copy(this.currentCamera.rotation):Wy[e]&&Ny.copy(Wy[e])}else t instanceof wn?Ny.copy(t):Im(t)&&Ny.set(t.x,t.y,t.z);Ny.copy(wp(this.currentCamera.rotation,Ny.clone())),yield Promise.all([this.moveTo(e,n),this.rotateTo(Ny,n)])}))}flyToBoundingBox(e,t="frontTop",n){return Wp(this,void 0,void 0,(function*(){if(e.isEmpty())return void gp("target box is empty");const i=this.viewport.controls.options.type,s=new zt;if(Tm(t)){if("CURRENT"===t.toLocaleUpperCase())s.copy(this.getMovePosByBBox(e));else{const n=Wy[t.toLocaleUpperCase()],i=this.getObjectLabelPos(e,n);s.copy(i)}}else{"orbit"===i&&gp("orbit 控制器不支持 Rotation 类型 的 rotation 参数");const n=bp(t),r=this.getObjectLabelPos(e,n);s.copy(r)}if("orbit"===i){const n=e.getCenter(Py),i=this.viewport.controls.currentControls;i.target.copy(n);const r=new dn;r.lookAt(s,n,i.object.up),t=Ny.setFromRotationMatrix(r)}yield this.flyTo(s,t,n)}))}flyToObj(e,t="frontTop",n={}){if(e instanceof gv||e instanceof dv){const{padding:i=50}=n,s=Zy(i);return this.flyToBoundingBox(e.getBoundingBox(s),t,n)}{const{padding:i="30%"}=n,s=vp(e),r=s.getSize(Py);let a=0;if(Tm(i)){const e=Math.max(r.x,r.y,r.z);a=Zy(i)*e}else a=i;let o=a,l=a;if(a<0){const e=Math.min(r.x,r.z),t=r.y-1;o=Math.abs(a)>e?-e:a,l=Math.abs(o)>t?-t:o}return 0!==i&&(s.max.add(Py.set(o/2,l/2,o/2)),s.min.sub(Py.set(o/2,l/2,o/2))),s.isEmpty()&&(Py.setFromMatrixPosition(e.matrixWorld),s.setFromCenterAndSize(Py,new zt(0,0,0))),this.flyToBoundingBox(s,t,n)}}surroundOnTarget(e,t={}){const{speed:n=1,angle:i=360,onStart:s}=t,r=yp(e),a=r.clone().setY(this.currentCamera.position.y).distanceTo(this.currentCamera.position),o=Math.abs(i);return Nm({angle:0},{angle:Math.PI/180*o},{duration:o/360*5e3/n},(e=>{const t=i>0?e.angle:2*Math.PI-e.angle;if(this.currentCamera.position.x=Math.sin(t)*a+r.x,this.currentCamera.position.z=Math.cos(t)*a+r.z,"orbit"===this.viewport.controls.options.type){const e=this.viewport.controls.currentControls;e.target.copy(r),e.update()}else this.currentCamera.lookAt(r)}),s)}surroundOnObject(e,t={}){const n=(new Zt).setFromObject(e).getCenter(Py);return this.surroundOnTarget(n,t)}getMovePosByBBox(e){const t=this.currentCamera.position,n=e.getCenter(Py);(new zt).subVectors(n,t).normalize();let i=new tn;i=e.getBoundingSphere(i);const s=this.currentCamera.fov/2*Math.PI/180,r=Math.sin(s),a=i.radius/r,o=new zt;this.currentCamera.getWorldDirection(o);const l=o.clone();return l.multiplyScalar(-a),n.clone().add(l)}getObjectLabelPos(e,t="frontTop",n={}){if(e instanceof ov&&(e=(new Zt).setFromObject(e)),e.isEmpty())return gp("target box is empty"),new zt;const{extendScale:i=1.6,mode:s="scene"}=n;if("scene"===s){const n=e.getCenter(Py),s=e.max.clone().sub(e.min),r=Math.max(s.x,s.y,s.z),a=n.clone(),o=e=>{const t=(i-.5)*Math.abs(r),n=Math.max(t,this.viewport.camera.near);a.add(e.multiplyScalar(n))};let l;return l=Tm(t)?Wy[t.toLocaleUpperCase()]:bp(t),o(Py.set(0,0,1).applyEuler(l)),a}return"screen"===s?e.getCenter(Py).clone():new zt}}
|
|
21
|
-
/**
|
|
22
|
-
* postprocessing v6.28.3 build Thu Jul 14 2022
|
|
23
|
-
* https://github.com/pmndrs/postprocessing
|
|
24
|
-
* Copyright 2015-2022 Raoul van Rüschen
|
|
25
|
-
* @license Zlib
|
|
26
|
-
*/function Dy(e,t){let n="texel";if(null!==e){const s=Number.parseInt(i);if(!(t&&s>=133&&135!==s&&e.format===H&&e.type===T&&e.encoding===Ee))switch(e.encoding){case Ee:n="sRGBToLinear(texel)";break;case ze:n="texel";break;default:throw new Error(`Unsupported encoding: ${e.encoding}`)}}return n}function ky(e,t,n){return e*(t-n)-t}function By(e,t,n){return Math.min(Math.max((e+t)/(t-n),0),1)}var Fy={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},Uy={DEPTH:0,LUMA:1,COLOR:2},Oy={NONE:0,DEPTH:1,CONVOLUTION:2},Yy={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},Ky={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},jy={DISABLED:0,DEPTH:1,CUSTOM:2},Jy={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3},Qy=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],qy=class extends Di{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ct;super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new hd(null),texelSize:new hd(new Ct),scale:new hd(1),kernel:new hd(0)},blending:0,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;\n#include <encodings_fragment>\n}",vertexShader:"uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.setTexelSize(e.x,e.y),this.kernelSize=Ky.MEDIUM}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.inputBuffer=e}get kernelSequence(){return Qy[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(e){this.uniforms.scale.value=e}getScale(){return this.uniforms.scale.value}setScale(e){this.uniforms.scale.value=e}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(e){this.uniforms.kernel.value=e}setKernel(e){this.kernel=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t,.5*e,.5*t)}setSize(e,t){const n=1/e,i=1/t;this.uniforms.texelSize.value.set(n,i,.5*n,.5*i)}},$y=class extends Di{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new hd(null),opacity:new hd(1)},blending:0,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <dithering_pars_fragment>\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel;\n#include <encodings_fragment>\n#include <dithering_fragment>\n}",vertexShader:"varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}getOpacity(e){return this.uniforms.opacity.value}setOpacity(e){this.uniforms.opacity.value=e}},eb=class extends Di{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;super({name:"DepthComparisonMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new hd(null),cameraNear:new hd(.3),cameraFar:new hd(1e3)},blending:0,depthWrite:!1,depthTest:!1,fragmentShader:"#include <packing>\n#include <clipping_planes_pars_fragment>\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform float cameraNear;uniform float cameraFar;varying float vViewZ;varying vec4 vProjTexCoord;void main(){\n#include <clipping_planes_fragment>\nvec2 projTexCoord=(vProjTexCoord.xy/vProjTexCoord.w)*0.5+0.5;projTexCoord=clamp(projTexCoord,0.002,0.998);\n#if DEPTH_PACKING == 3201\nfloat fragCoordZ=unpackRGBAToDepth(texture2D(depthBuffer,projTexCoord));\n#else\nfloat fragCoordZ=texture2D(depthBuffer,projTexCoord).r;\n#endif\n#ifdef PERSPECTIVE_CAMERA\nfloat viewZ=perspectiveDepthToViewZ(fragCoordZ,cameraNear,cameraFar);\n#else\nfloat viewZ=orthographicDepthToViewZ(fragCoordZ,cameraNear,cameraFar);\n#endif\nfloat depthTest=(-vViewZ>-viewZ)?1.0:0.0;gl_FragColor.rg=vec2(0.0,depthTest);}",vertexShader:"#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZ;varying vec4 vProjTexCoord;void main(){\n#include <skinbase_vertex>\n#include <begin_vertex>\n#include <morphtarget_vertex>\n#include <skinning_vertex>\n#include <project_vertex>\nvViewZ=mvPosition.z;vProjTexCoord=gl_Position;\n#include <clipping_planes_vertex>\n}"}),this.toneMapped=!1,this.depthBuffer=e,this.depthPacking=Ze,this.adoptCameraSettings(t)}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ze;this.depthBuffer=e,this.depthPacking=t}adoptCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof Bi?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},tb=class extends Di{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new hd(null),normalBuffer:new hd(null),texelSize:new hd(new nt)},blending:0,depthWrite:!1,depthTest:!1,fragmentShader:"#include <packing>\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\n#ifdef DOWNSAMPLE_NORMALS\nuniform lowp sampler2D normalBuffer;\n#endif\nvarying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])/4.0;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]<maxDistance){remaining[j++]=i;}else{rejected[k++]=i;}}for(;j<3;++j){remaining[j]=rejected[--k];}vec3 s=vec3(samples[remaining[0]],samples[remaining[1]],samples[remaining[2]]);c=(s.x+s.y+s.z)/3.0;distances[0]=abs(c-s.x);distances[1]=abs(c-s.y);distances[2]=abs(c-s.z);float minDistance=min(distances[0],min(distances[1],distances[2]));for(i=0;i<3;++i){if(distances[i]==minDistance){break;}}return remaining[i];}void main(){float d[4];d[0]=readDepth(vUv0);d[1]=readDepth(vUv1);d[2]=readDepth(vUv2);d[3]=readDepth(vUv3);int index=findBestDepth(d);\n#ifdef DOWNSAMPLE_NORMALS\nvec2 uvs[4];uvs[0]=vUv0;uvs[1]=vUv1;uvs[2]=vUv2;uvs[3]=vUv3;vec3 n=texture2D(normalBuffer,uvs[index]).rgb;\n#else\nvec3 n=vec3(0.0);\n#endif\ngl_FragColor=vec4(n,d[index]);}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;this.depthBuffer=e,this.depthPacking=t}set normalBuffer(e){this.uniforms.normalBuffer.value=e,null!==e?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(e){this.normalBuffer=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},nb=class extends Di{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uy.COLOR;super({name:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new hd(null),depthBuffer:new hd(null),predicationBuffer:new hd(null),texelSize:new hd(e)},blending:0,depthWrite:!1,depthTest:!1,fragmentShader:"varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\n#if EDGE_DETECTION_MODE == 1\n#include <common>\n#endif\n#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);}\n#elif PREDICATION_MODE == 2\nuniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);}\n#endif\n#if PREDICATION_MODE != 0\nvec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);}\n#endif\n#if EDGE_DETECTION_MODE != 0\nuniform sampler2D inputBuffer;\n#endif\nvoid main(){\n#if EDGE_DETECTION_MODE == 0\nconst vec2 threshold=vec2(DEPTH_THRESHOLD);\n#elif PREDICATION_MODE != 0\nvec2 threshold=calculatePredicatedThreshold();\n#else\nconst vec2 threshold=vec2(EDGE_THRESHOLD);\n#endif\n#if EDGE_DETECTION_MODE == 0\nvec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 1\nfloat l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 2\nvec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#endif\n}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\nvoid main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0);\n#if EDGE_DETECTION_MODE != 0\nvUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0);\n#endif\ngl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.edgeDetectionMode=t}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;this.depthBuffer=e,this.depthPacking=t}get edgeDetectionMode(){return Number(this.defines.EDGE_DETECTION_MODE)}set edgeDetectionMode(e){this.defines.EDGE_DETECTION_MODE=e.toFixed(0),this.needsUpdate=!0}getEdgeDetectionMode(){return this.edgeDetectionMode}setEdgeDetectionMode(e){this.edgeDetectionMode=e}get localContrastAdaptationFactor(){return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR)}set localContrastAdaptationFactor(e){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=e.toFixed("6"),this.needsUpdate=!0}getLocalContrastAdaptationFactor(){return this.localContrastAdaptationFactor}setLocalContrastAdaptationFactor(e){this.localContrastAdaptationFactor=e}get edgeDetectionThreshold(){return Number(this.defines.EDGE_THRESHOLD)}set edgeDetectionThreshold(e){this.defines.EDGE_THRESHOLD=e.toFixed("6"),this.defines.DEPTH_THRESHOLD=(.1*e).toFixed("6"),this.needsUpdate=!0}getEdgeDetectionThreshold(){return this.edgeDetectionThreshold}setEdgeDetectionThreshold(e){this.edgeDetectionThreshold=e}get predicationMode(){return Number(this.defines.PREDICATION_MODE)}set predicationMode(e){this.defines.PREDICATION_MODE=e.toFixed(0),this.needsUpdate=!0}getPredicationMode(){return this.predicationMode}setPredicationMode(e){this.predicationMode=e}set predicationBuffer(e){this.uniforms.predicationBuffer.value=e}setPredicationBuffer(e){this.uniforms.predicationBuffer.value=e}get predicationThreshold(){return Number(this.defines.PREDICATION_THRESHOLD)}set predicationThreshold(e){this.defines.PREDICATION_THRESHOLD=e.toFixed("6"),this.needsUpdate=!0}getPredicationThreshold(){return this.predicationThreshold}setPredicationThreshold(e){this.predicationThreshold=e}get predicationScale(){return Number(this.defines.PREDICATION_SCALE)}set predicationScale(e){this.defines.PREDICATION_SCALE=e.toFixed("6"),this.needsUpdate=!0}getPredicationScale(){return this.predicationScale}setPredicationScale(e){this.predicationScale=e}get predicationStrength(){return Number(this.defines.PREDICATION_STRENGTH)}set predicationStrength(e){this.defines.PREDICATION_STRENGTH=e.toFixed("6"),this.needsUpdate=!0}getPredicationStrength(){return this.predicationStrength}setPredicationStrength(e){this.predicationStrength=e}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},ib=class extends Di{constructor(e,t,n,s){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];super({name:"EffectMaterial",defines:{THREE_REVISION:i.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new hd(null),depthBuffer:new hd(null),resolution:new hd(new nt),texelSize:new hd(new nt),cameraNear:new hd(.3),cameraFar:new hd(1e3),aspect:new hd(1),time:new hd(0)},blending:0,depthWrite:!1,depthTest:!1,dithering:r}),this.toneMapped=!1,e&&this.setShaderParts(e),t&&this.setDefines(t),n&&this.setUniforms(n),this.adoptCameraSettings(s)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;this.depthBuffer=e,this.depthPacking=t}setShaderData(e){this.setShaderParts(e.shaderParts),this.setDefines(e.defines),this.setUniforms(e.uniforms),this.setExtensions(e.extensions)}setShaderParts(e){var t,n,i,s,r;return this.fragmentShader="#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#define packFloatToRGBA(v) packDepthToRGBA(v)\n#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;\n#if THREE_REVISION >= 137\nvec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNear,cameraFar);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNear,cameraFar);\n#endif\n}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0;\n#ifdef ENCODE_OUTPUT\n#include <encodings_fragment>\n#endif\n#include <dithering_fragment>\n}".replace(Yy.FRAGMENT_HEAD,null!=(t=e.get(Yy.FRAGMENT_HEAD))?t:"").replace(Yy.FRAGMENT_MAIN_UV,null!=(n=e.get(Yy.FRAGMENT_MAIN_UV))?n:"").replace(Yy.FRAGMENT_MAIN_IMAGE,null!=(i=e.get(Yy.FRAGMENT_MAIN_IMAGE))?i:""),this.vertexShader="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}".replace(Yy.VERTEX_HEAD,null!=(s=e.get(Yy.VERTEX_HEAD))?s:"").replace(Yy.VERTEX_MAIN_SUPPORT,null!=(r=e.get(Yy.VERTEX_MAIN_SUPPORT))?r:""),this.needsUpdate=!0,this}setDefines(e){for(const t of e.entries())this.defines[t[0]]=t[1];return this.needsUpdate=!0,this}setUniforms(e){for(const t of e.entries())this.uniforms[t[0]]=t[1];return this}setExtensions(e){this.extensions={};for(const t of e)this.extensions[t]=!0;return this}get encodeOutput(){return void 0!==this.defines.ENCODE_OUTPUT}set encodeOutput(e){this.encodeOutput!==e&&(e?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(e){return this.encodeOutput}setOutputEncodingEnabled(e){this.encodeOutput=e}get time(){return this.uniforms.time.value}set time(e){this.uniforms.time.value=e}setDeltaTime(e){this.uniforms.time.value+=e}adoptCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof Bi?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){const n=this.uniforms;n.resolution.value.set(e,t),n.texelSize.value.set(1/e,1/t),n.aspect.value=e/t}static get Section(){return Yy}},sb=class extends Di{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nt;super({name:"OutlineMaterial",uniforms:{inputBuffer:new hd(null),texelSize:new hd(new nt)},blending:0,depthWrite:!1,depthTest:!1,fragmentShader:"uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.setTexelSize(e.x,e.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},rb=class extends Di{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new nt,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new nt;super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new hd(null),searchTexture:new hd(null),areaTexture:new hd(null),resolution:new hd(t),texelSize:new hd(e)},blending:0,depthWrite:!1,depthTest:!1,fragmentShader:"#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize)\n#if __VERSION__ < 300\n#define round(v) floor(v + 0.5)\n#endif\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x>end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x<end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.y>end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;i++){if(!(texCoord.y<end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0);\n#endif\n}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0);\n#endif\n}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){\n#if !defined(DISABLE_DIAG_DETECTION)\nweights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){\n#endif\nvec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d);\n#if !defined(DISABLE_DIAG_DETECTION)\n}else{e.r=0.0;}\n#endif\n}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}",vertexShader:"uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(e){this.uniforms.searchTexture.value=e}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(e){this.uniforms.areaTexture.value=e}setLookupTextures(e,t){this.searchTexture=e,this.areaTexture=t}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(e){const t=Math.min(Math.max(e,0),112);this.defines.MAX_SEARCH_STEPS_INT=t.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=t.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(e){this.orthogonalSearchSteps=e}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(e){const t=Math.min(Math.max(e,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=t.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=t.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(e){this.diagonalSearchSteps=e}get diagonalDetection(){return void 0===this.defines.DISABLE_DIAG_DETECTION}set diagonalDetection(e){e?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(e){this.diagonalDetection=e}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(e){const t=Math.min(Math.max(e,0),100);this.defines.CORNER_ROUNDING=t.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(t/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(e){this.cornerRounding=e}get cornerDetection(){return void 0===this.defines.DISABLE_CORNER_DETECTION}set cornerDetection(e){e?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(e){this.cornerDetection=e}setSize(e,t){const n=this.uniforms;n.texelSize.value.set(1/e,1/t),n.resolution.value.set(e,t)}},ab=class extends Di{constructor(e){super({name:"SSAOMaterial",defines:{SAMPLES_INT:"0",SAMPLES_FLOAT:"0.0",SPIRAL_TURNS:"0.0",RADIUS:"1.0",RADIUS_SQ:"1.0",DISTANCE_SCALING:"1",DEPTH_PACKING:"0"},uniforms:{depthBuffer:new hd(null),normalBuffer:new hd(null),normalDepthBuffer:new hd(null),noiseTexture:new hd(null),inverseProjectionMatrix:new hd(new dn),projectionMatrix:new hd(new dn),texelSize:new hd(new nt),cameraNearFar:new hd(new nt),distanceCutoff:new hd(new nt),proximityCutoff:new hd(new nt),noiseScale:new hd(new nt),minRadiusScale:new hd(.33),intensity:new hd(1),fade:new hd(.01),bias:new hd(0)},blending:0,depthWrite:!1,depthTest:!1,fragmentShader:"#include <common>\n#include <packing>\n#ifdef NORMAL_DEPTH\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\n#else\nuniform lowp sampler2D normalBuffer;\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}\n#endif\nuniform lowp sampler2D noiseTexture;uniform mat4 inverseProjectionMatrix;uniform mat4 projectionMatrix;uniform vec2 texelSize;uniform vec2 cameraNearFar;uniform float minRadiusScale;uniform float intensity;uniform float fade;uniform float bias;uniform vec2 distanceCutoff;uniform vec2 proximityCutoff;varying vec2 vUv;varying vec2 vUv2;float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNearFar.x,cameraNearFar.y);\n#endif\n}vec3 getViewPosition(const in vec2 screenPosition,const in float depth,const in float viewZ){vec4 clipPosition=vec4(vec3(screenPosition,depth)*2.0-1.0,1.0);float clipW=projectionMatrix[2][3]*viewZ+projectionMatrix[3][3];clipPosition*=clipW;return(inverseProjectionMatrix*clipPosition).xyz;}float getAmbientOcclusion(const in vec3 p,const in vec3 n,const in float depth,const in vec2 uv){\n#ifdef DISTANCE_SCALING\nfloat radiusScale=1.0-smoothstep(0.0,distanceCutoff.y,depth);radiusScale=radiusScale*(1.0-minRadiusScale)+minRadiusScale;float radius=RADIUS*radiusScale;\n#else\nfloat radius=RADIUS;\n#endif\nfloat noise=texture2D(noiseTexture,vUv2).r;float baseAngle=noise*PI2;float invSamples=1.0/SAMPLES_FLOAT;float rings=SPIRAL_TURNS*PI2;float occlusion=0.0;int taps=0;for(int i=0;i<SAMPLES_INT;++i){float alpha=(float(i)+0.5)*invSamples;float angle=alpha*rings+baseAngle;vec2 coord=alpha*radius*vec2(cos(angle),sin(angle))*texelSize+uv;if(coord.s<0.0||coord.s>1.0||coord.t<0.0||coord.t>1.0){continue;}\n#ifdef NORMAL_DEPTH\nfloat sampleDepth=texture2D(normalDepthBuffer,coord).a;\n#else\nfloat sampleDepth=readDepth(coord);\n#endif\nfloat viewZ=getViewZ(sampleDepth);\n#ifdef PERSPECTIVE_CAMERA\nfloat linearSampleDepth=viewZToOrthographicDepth(viewZ,cameraNearFar.x,cameraNearFar.y);\n#else\nfloat linearSampleDepth=sampleDepth;\n#endif\nfloat proximity=abs(depth-linearSampleDepth);if(proximity<proximityCutoff.y){float falloff=1.0-smoothstep(proximityCutoff.x,proximityCutoff.y,proximity);vec3 Q=getViewPosition(coord,sampleDepth,viewZ);vec3 v=Q-p;float vv=dot(v,v);float vn=dot(v,n)-bias;float f=max(RADIUS_SQ-vv,0.0)/RADIUS_SQ;occlusion+=(f*f*f*max(vn/(fade+vv),0.0))*falloff;}++taps;}return occlusion/(4.0*max(float(taps),1.0));}void main(){\n#ifdef NORMAL_DEPTH\nvec4 normalDepth=texture2D(normalDepthBuffer,vUv);\n#else\nvec4 normalDepth=vec4(texture2D(normalBuffer,vUv).rgb,readDepth(vUv));\n#endif\nfloat ao=1.0;float depth=normalDepth.a;float viewZ=getViewZ(depth);\n#ifdef PERSPECTIVE_CAMERA\nfloat linearDepth=viewZToOrthographicDepth(viewZ,cameraNearFar.x,cameraNearFar.y);\n#else\nfloat linearDepth=depth;\n#endif\nif(linearDepth<distanceCutoff.y){vec3 viewPosition=getViewPosition(vUv,depth,viewZ);vec3 viewNormal=unpackRGBToNormal(normalDepth.rgb);ao-=getAmbientOcclusion(viewPosition,viewNormal,linearDepth,vUv);float d=smoothstep(distanceCutoff.x,distanceCutoff.y,linearDepth);ao=mix(ao,1.0,d);ao=clamp(pow(ao,abs(intensity)),0.0,1.0);}gl_FragColor.r=ao;}",vertexShader:"uniform vec2 noiseScale;varying vec2 vUv;varying vec2 vUv2;void main(){vUv=position.xy*0.5+0.5;vUv2=vUv*noiseScale;gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.adoptCameraSettings(e),this.resolution=new nt,this.r=1}get near(){return this.uniforms.cameraNearFar.value.x}get far(){return this.uniforms.cameraNearFar.value.y}set normalDepthBuffer(e){this.uniforms.normalDepthBuffer.value=e,null!==e?this.defines.NORMAL_DEPTH="1":delete this.defines.NORMAL_DEPTH,this.needsUpdate=!0}setNormalDepthBuffer(e){this.normalDepthBuffer=e}set normalBuffer(e){this.uniforms.normalBuffer.value=e}setNormalBuffer(e){this.uniforms.normalBuffer.value=e}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;this.depthBuffer=e,this.depthPacking=t}set noiseTexture(e){this.uniforms.noiseTexture.value=e}setNoiseTexture(e){this.uniforms.noiseTexture.value=e}get samples(){return Number(this.defines.SAMPLES_INT)}set samples(e){this.defines.SAMPLES_INT=e.toFixed(0),this.defines.SAMPLES_FLOAT=e.toFixed(1),this.needsUpdate=!0}getSamples(){return this.samples}setSamples(e){this.samples=e}get rings(){return Number(this.defines.SPIRAL_TURNS)}set rings(e){this.defines.SPIRAL_TURNS=e.toFixed(1),this.needsUpdate=!0}getRings(){return this.rings}setRings(e){this.rings=e}get intensity(){return this.uniforms.intensity.value}set intensity(e){this.uniforms.intensity.value=e}getIntensity(){return this.uniforms.intensity.value}setIntensity(e){this.uniforms.intensity.value=e}get fade(){return this.uniforms.fade.value}set fade(e){this.uniforms.fade.value=e}getFade(){return this.uniforms.fade.value}setFade(e){this.uniforms.fade.value=e}get bias(){return this.uniforms.bias.value}set bias(e){this.uniforms.bias.value=e}getBias(){return this.uniforms.bias.value}setBias(e){this.uniforms.bias.value=e}get minRadiusScale(){return this.uniforms.minRadiusScale.value}set minRadiusScale(e){this.uniforms.minRadiusScale.value=e}getMinRadiusScale(){return this.uniforms.minRadiusScale.value}setMinRadiusScale(e){this.uniforms.minRadiusScale.value=e}updateRadius(){const e=this.r*this.resolution.height;this.defines.RADIUS=e.toFixed(11),this.defines.RADIUS_SQ=(e*e).toFixed(11),this.needsUpdate=!0}get radius(){return this.r}set radius(e){this.r=Math.min(Math.max(e,1e-6),1),this.updateRadius()}getRadius(){return this.radius}setRadius(e){this.radius=e}get distanceScaling(){return void 0!==this.defines.DISTANCE_SCALING}set distanceScaling(e){this.isDistanceScalingEnabled()!==e&&(e?this.defines.DISTANCE_SCALING="1":delete this.defines.DISTANCE_SCALING,this.needsUpdate=!0)}isDistanceScalingEnabled(){return this.distanceScaling}setDistanceScalingEnabled(e){this.distanceScaling=e}get distanceThreshold(){return this.uniforms.distanceCutoff.value.x}set distanceThreshold(e){this.uniforms.distanceCutoff.value.set(Math.min(Math.max(e,0),1),Math.min(Math.max(e+this.distanceFalloff,0),1))}get worldDistanceThreshold(){return-ky(this.distanceThreshold,this.near,this.far)}set worldDistanceThreshold(e){this.distanceThreshold=By(-e,this.near,this.far)}get distanceFalloff(){return this.uniforms.distanceCutoff.value.y-this.distanceThreshold}set distanceFalloff(e){this.uniforms.distanceCutoff.value.y=Math.min(Math.max(this.distanceThreshold+e,0),1)}get worldDistanceFalloff(){return-ky(this.distanceFalloff,this.near,this.far)}set worldDistanceFalloff(e){this.distanceFalloff=By(-e,this.near,this.far)}setDistanceCutoff(e,t){this.uniforms.distanceCutoff.value.set(Math.min(Math.max(e,0),1),Math.min(Math.max(e+t,0),1))}get proximityThreshold(){return this.uniforms.proximityCutoff.value.x}set proximityThreshold(e){this.uniforms.proximityCutoff.value.set(Math.min(Math.max(e,0),1),Math.min(Math.max(e+this.proximityFalloff,0),1))}get worldProximityThreshold(){return-ky(this.proximityThreshold,this.near,this.far)}set worldProximityThreshold(e){this.proximityThreshold=By(-e,this.near,this.far)}get proximityFalloff(){return this.uniforms.proximityCutoff.value.y-this.proximityThreshold}set proximityFalloff(e){this.uniforms.proximityCutoff.value.y=Math.min(Math.max(this.proximityThreshold+e,0),1)}get worldProximityFalloff(){return-ky(this.proximityFalloff,this.near,this.far)}set worldProximityFalloff(e){this.proximityFalloff=By(-e,this.near,this.far)}setProximityCutoff(e,t){this.uniforms.proximityCutoff.value.set(Math.min(Math.max(e,0),1),Math.min(Math.max(e+t,0),1))}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}adoptCameraSettings(e){e&&(this.uniforms.cameraNearFar.value.set(e.near,e.far),this.uniforms.projectionMatrix.value.copy(e.projectionMatrix),this.uniforms.inverseProjectionMatrix.value.copy(e.projectionMatrix).invert(),e instanceof Bi?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){const n=this.uniforms,i=n.noiseTexture.value;null!==i&&n.noiseScale.value.set(e/i.image.width,t/i.image.height),n.texelSize.value.set(1/e,1/t),this.resolution.set(e,t),this.updateRadius()}},ob=new ki,lb=null;var cb=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Pass",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Va,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ob;this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;null!==t&&(t.needsUpdate=!0),this.rtt=!e}}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return null!==this.screen?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;null!==t?t.material=e:(t=new Wi(function(){if(null===lb){const e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]);void 0!==(lb=new yi).setAttribute?(lb.setAttribute("position",new $n(e,3)),lb.setAttribute("uv",new $n(t,2))):(lb.addAttribute("position",new $n(e,3)),lb.addAttribute("uv",new $n(t,2)))}return lb}(),e),t.frustumCulled=!1,null===this.scene&&(this.scene=new Va),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e){}render(e,t,n,i,s){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,n){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof Gt||t instanceof jn||t instanceof Lt||t instanceof cb)&&this[e].dispose()}}},hb=class extends cb{constructor(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];super("CopyPass"),this.fullscreenMaterial=new $y,this.needsSwap=!1,this.renderTarget=e,void 0===e&&(this.renderTarget=new Gt(1,1,{minFilter:M,magFilter:M,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=t}get resize(){return this.autoResize}set resize(e){this.autoResize=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(e){this.autoResize=e}render(e,t,n,i,s){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.autoResize&&this.renderTarget.setSize(e,t)}initialize(e,t,n){void 0!==n&&(this.renderTarget.texture.type=n,n!==T?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":e.outputEncoding===Ee&&(this.renderTarget.texture.encoding=Ee))}},db=class extends cb{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(e,t,n,i,s){const r=e.state.buffers.stencil;r.setLocked(!1),r.setTest(!1)}},ub=new bt,pb=class extends cb{constructor(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super("ClearPass",null,null),this.needsSwap=!1,this.color=e,this.depth=t,this.stencil=n,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(e,t,n){this.color=e,this.depth=t,this.stencil=n}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(e){this.overrideClearColor=e}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(e){this.overrideClearAlpha=e}render(e,t,n,i,s){const r=this.overrideClearColor,a=this.overrideClearAlpha,o=e.getClearAlpha(),l=null!==r,c=a>=0;l?(ub.copy(e.getClearColor(ub)),e.setClearColor(r,c?a:o)):c&&e.setClearAlpha(a),e.setRenderTarget(this.renderToScreen?null:t),e.clear(this.color,this.depth,this.stencil),l?e.setClearColor(ub,o):c&&e.setClearAlpha(o)}},mb=-1,fb=class extends Be{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mb,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:mb,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(),this.resizable=e,this.baseSize=new nt(1,1),this.preferredSize=new nt(t,n),this.target=this.preferredSize,this.s=i,this.effectiveSize=new nt,this.addEventListener("change",(()=>this.updateEffectiveSize())),this.updateEffectiveSize()}updateEffectiveSize(){const e=this.baseSize,t=this.preferredSize,n=this.effectiveSize,i=this.scale;t.width!==mb?n.width=t.width:t.height!==mb?n.width=Math.round(t.height*(e.width/Math.max(e.height,1))):n.width=Math.round(e.width*i),t.height!==mb?n.height=t.height:t.width!==mb?n.height=Math.round(t.width/Math.max(e.width/Math.max(e.height,1),1)):n.height=Math.round(e.height*i)}get width(){return this.effectiveSize.width}set width(e){this.preferredWidth=e}get height(){return this.effectiveSize.height}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferredSize.setScalar(mb),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.baseSize.width}set baseWidth(e){this.baseSize.width!==e&&(this.baseSize.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(e){this.baseWidth=e}get baseHeight(){return this.baseSize.height}set baseHeight(e){this.baseSize.height!==e&&(this.baseSize.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){this.baseSize.width===e&&this.baseSize.height===t||(this.baseSize.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(e){this.preferredSize.width!==e&&(this.preferredSize.width=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferredSize.height}set preferredHeight(e){this.preferredSize.height!==e&&(this.preferredSize.height=e,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){this.preferredSize.width===e&&this.preferredSize.height===t||(this.preferredSize.set(e,t),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(e){this.s=e.scale,this.baseSize.set(e.getBaseWidth(),e.getBaseHeight()),this.preferredSize.set(e.getPreferredWidth(),e.getPreferredHeight()),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return mb}},gb=!1,yb=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(e),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case 2:t=this.materialsFlatShadedDoubleSide;break;case 1:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded}else switch(e.material.side){case 2:t=this.materialsDoubleSide;break;case 1:t=this.materialsBackSide;break;default:t=this.materials}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}setMaterial(e){if(this.disposeMaterials(),this.material=e,null!==e){const t=this.materials=[e.clone(),e.clone(),e.clone()];for(const n of t)n.uniforms=Object.assign({},e.uniforms),n.side=0;t[2].skinning=!0,this.materialsBackSide=t.map((t=>{const n=t.clone();return n.uniforms=Object.assign({},e.uniforms),n.side=1,n})),this.materialsDoubleSide=t.map((t=>{const n=t.clone();return n.uniforms=Object.assign({},e.uniforms),n.side=2,n})),this.materialsFlatShaded=t.map((t=>{const n=t.clone();return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n})),this.materialsFlatShadedBackSide=t.map((t=>{const n=t.clone();return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=1,n})),this.materialsFlatShadedDoubleSide=t.map((t=>{const n=t.clone();return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=2,n}))}}render(e,t,n){const i=e.shadowMap.enabled;if(e.shadowMap.enabled=!1,gb){const i=this.originalMaterials;this.meshCount=0,t.traverse(this.replaceMaterial),e.render(t,n);for(const e of i)e[0].material=e[1];this.meshCount!==i.size&&i.clear()}else{const i=t.overrideMaterial;t.overrideMaterial=this.material,e.render(t,n),t.overrideMaterial=i}e.shadowMap.enabled=i}disposeMaterials(){if(null!==this.material){const e=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const t of e)t.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return gb}static set workaroundEnabled(e){gb=e}},bb=class extends cb{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super("RenderPass",e,t),this.needsSwap=!1,this.clearPass=new pb,this.overrideMaterialManager=null===n?null:new yb(n),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}get renderToScreen(){return super.renderToScreen}set renderToScreen(e){super.renderToScreen=e,this.clearPass.renderToScreen=e}get overrideMaterial(){const e=this.overrideMaterialManager;return null!==e?e.material:null}set overrideMaterial(e){const t=this.overrideMaterialManager;null!==e?null!==t?t.setMaterial(e):this.overrideMaterialManager=new yb(e):null!==t&&(t.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(e){this.overrideMaterial=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getSelection(){return this.selection}setSelection(e){this.selection=e}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(e){this.ignoreBackground=e}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(e){this.skipShadowMapUpdate=e}getClearPass(){return this.clearPass}render(e,t,n,i,s){const r=this.scene,a=this.camera,o=this.selection,l=a.layers.mask,c=r.background,h=e.shadowMap.autoUpdate,d=this.renderToScreen?null:t;null!==o&&a.layers.set(o.getLayer()),this.skipShadowMapUpdate&&(e.shadowMap.autoUpdate=!1),(this.ignoreBackground||null!==this.clearPass.overrideClearColor)&&(r.background=null),this.clearPass.enabled&&this.clearPass.render(e,t),e.setRenderTarget(d),null!==this.overrideMaterialManager?this.overrideMaterialManager.render(e,r,a):e.render(r,a),a.layers.mask=l,r.background=c,e.shadowMap.autoUpdate=h}},vb=class extends cb{constructor(e,t){let{renderTarget:n,resolutionScale:i=1,width:s=fb.AUTO_SIZE,height:r=fb.AUTO_SIZE,resolutionX:a=s,resolutionY:o=r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super("DepthPass"),this.needsSwap=!1,this.renderPass=new bb(e,t,new wa({depthPacking:Ze}));const l=this.renderPass;l.skipShadowMapUpdate=!0,l.ignoreBackground=!0;const c=l.getClearPass();c.overrideClearColor=new bt(16777215),c.overrideClearAlpha=1,this.renderTarget=n,void 0===this.renderTarget&&(this.renderTarget=new Gt(1,1,{minFilter:x,magFilter:x}),this.renderTarget.texture.name="DepthPass.Target");const h=this.resolution=new fb(this,a,o,i);h.addEventListener("change",(e=>this.setSize(h.baseWidth,h.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,i,s){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,r)}setSize(e,t){const n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}},xb=class extends cb{constructor(){let{normalBuffer:e=null,resolutionScale:t=.5,width:n=fb.AUTO_SIZE,height:i=fb.AUTO_SIZE,resolutionX:s=n,resolutionY:r=i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("DepthDownsamplingPass");const a=new tb;a.normalBuffer=e,this.fullscreenMaterial=a,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Gt(1,1,{minFilter:x,magFilter:x,depthBuffer:!1,type:z}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const o=this.resolution=new fb(this,s,r,t);o.addEventListener("change",(e=>this.setSize(o.baseWidth,o.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t}render(e,t,n,i,s){e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.fullscreenMaterial.setSize(e,t);const n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}initialize(e,t,n){if(!e.capabilities.isWebGL2)throw new Error("The DepthDownsamplingPass requires WebGL 2")}};function wb(e,t,n){for(const i of t){const t="$1"+e+i.charAt(0).toUpperCase()+i.slice(1),s=new RegExp("([^\\.])(\\b"+i+"\\b)","g");for(const e of n.entries())null!==e[1]&&n.set(e[0],e[1].replace(s,t))}}function Sb(e,t,n){var i,s,r,a,o;let l=t.getFragmentShader(),c=t.getVertexShader();const h=void 0!==l&&/mainImage/.test(l),d=void 0!==l&&/mainUv/.test(l);if(n.attributes|=t.getAttributes(),void 0===l)throw new Error(`Missing fragment shader (${t.name})`);if(d&&0!=(n.attributes&Oy.CONVOLUTION))throw new Error(`Effects that transform UVs are incompatible with convolution effects (${t.name})`);if(!h&&!d)throw new Error(`Could not find mainImage or mainUv function (${t.name})`);{const u=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,p=n.shaderParts;let m=null!=(i=p.get(Yy.FRAGMENT_HEAD))?i:"",f=null!=(s=p.get(Yy.FRAGMENT_MAIN_UV))?s:"",g=null!=(r=p.get(Yy.FRAGMENT_MAIN_IMAGE))?r:"",y=null!=(a=p.get(Yy.VERTEX_HEAD))?a:"",b=null!=(o=p.get(Yy.VERTEX_MAIN_SUPPORT))?o:"";const v=new Set,x=new Set;if(d&&(f+=`\t${e}MainUv(UV);\n`,n.uvTransformation=!0),null!==c&&/mainSupport/.test(c)){const t=/mainSupport *\([\w\s]*?uv\s*?\)/.test(c);b+=`\t${e}MainSupport(`,b+=t?"vUv);\n":");\n";for(const e of c.matchAll(/(?:varying\s+\w+\s+(\w*))/g))n.varyings.add(e[1]),v.add(e[1]),x.add(e[1]);for(const e of c.matchAll(u))x.add(e[1])}for(const e of l.matchAll(u))x.add(e[1]);for(const e of t.defines.keys())x.add(e.replace(/\([\w\s,]*\)/g,""));for(const e of t.uniforms.keys())x.add(e);x.delete("while"),x.delete("for"),x.delete("if"),t.uniforms.forEach(((t,i)=>n.uniforms.set(e+i.charAt(0).toUpperCase()+i.slice(1),t))),t.defines.forEach(((t,i)=>n.defines.set(e+i.charAt(0).toUpperCase()+i.slice(1),t)));const w=new Map([["fragment",l],["vertex",c]]);wb(e,x,n.defines),wb(e,x,w),l=w.get("fragment"),c=w.get("vertex");const S=t.blendMode;if(n.blendModes.set(S.blendFunction,S),h){null!==t.inputColorSpace&&t.inputColorSpace!==n.colorSpace&&(g+=t.inputColorSpace===Ee?"color0 = LinearTosRGB(color0);\n\t":"color0 = sRGBToLinear(color0);\n\t"),null!==t.outputColorSpace?n.colorSpace=t.outputColorSpace:null!==t.inputColorSpace&&(n.colorSpace=t.inputColorSpace);const i=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;g+=`${e}MainImage(color0, UV, `,0!=(n.attributes&Oy.DEPTH)&&i.test(l)&&(g+="depth, ",n.readDepth=!0),g+="color1);\n\t";const s=e+"BlendOpacity";n.uniforms.set(s,S.opacity),g+=`color0 = blend${S.blendFunction}(color0, color1, ${s});\n\n\t`,m+=`uniform float ${s};\n\n`}if(m+=l+"\n",null!==c&&(y+=c+"\n"),p.set(Yy.FRAGMENT_HEAD,m),p.set(Yy.FRAGMENT_MAIN_UV,f),p.set(Yy.FRAGMENT_MAIN_IMAGE,g),p.set(Yy.VERTEX_HEAD,y),p.set(Yy.VERTEX_MAIN_SUPPORT,b),null!==t.extensions)for(const e of t.extensions)n.extensions.add(e)}}var Mb=class extends cb{constructor(e){super("EffectPass"),this.fullscreenMaterial=new ib(null,null,null,e),this.listener=e=>this.handleEvent(e),this.effects=[];for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];this.setEffects(n),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(e){this.fullscreenMaterial.encodeOutput=e}get dithering(){return this.fullscreenMaterial.dithering}set dithering(e){const t=this.fullscreenMaterial;t.dithering=e,t.needsUpdate=!0}setEffects(e){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=e.sort(((e,t)=>t.attributes-e.attributes));for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const e=new Ab;let t=0;for(const n of this.effects)if(n.blendMode.blendFunction===Fy.DST)e.attributes|=n.getAttributes()&Oy.DEPTH;else{if(0!=(e.attributes&n.getAttributes()&Oy.CONVOLUTION))throw new Error(`Convolution effects cannot be merged (${n.name})`);Sb("e"+t++,n,e)}let n=e.shaderParts.get(Yy.FRAGMENT_HEAD),i=e.shaderParts.get(Yy.FRAGMENT_MAIN_IMAGE),s=e.shaderParts.get(Yy.FRAGMENT_MAIN_UV);const r=/\bblend\b/g;for(const t of e.blendModes.values())n+=t.getShaderCode().replace(r,`blend${t.blendFunction}`)+"\n";0!=(e.attributes&Oy.DEPTH)?(e.readDepth&&(i="float depth = readDepth(UV);\n\n\t"+i),this.needsDepthTexture=null===this.getDepthTexture()):this.needsDepthTexture=!1,e.colorSpace===Ee&&(i+="color0 = sRGBToLinear(color0);\n\t"),e.uvTransformation?(s="vec2 transformedUv = vUv;\n"+s,e.defines.set("UV","transformedUv")):e.defines.set("UV","vUv"),e.shaderParts.set(Yy.FRAGMENT_HEAD,n),e.shaderParts.set(Yy.FRAGMENT_MAIN_IMAGE,i),e.shaderParts.set(Yy.FRAGMENT_MAIN_UV,s),e.shaderParts.forEach(((e,t,n)=>n.set(t,null==e?void 0:e.trim().replace(/^#/,"\n#")))),this.skipRendering=0===t,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(e)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t;for(const n of this.effects)n.setDepthTexture(e,t)}render(e,t,n,i,s){for(const n of this.effects)n.update(e,t,i);if(!this.skipRendering||this.renderToScreen){const s=this.fullscreenMaterial;s.inputBuffer=t.texture,s.time+=i,e.setRenderTarget(this.renderToScreen?null:n),e.render(this.scene,this.camera)}}setSize(e,t){this.fullscreenMaterial.setSize(e,t);for(const n of this.effects)n.setSize(e,t)}initialize(e,t,n){this.renderer=e;for(const i of this.effects)i.initialize(e,t,n);this.updateMaterial(),void 0!==n&&n!==T&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const e of this.effects)e.removeEventListener("change",this.listener),e.dispose()}handleEvent(e){switch(e.type){case"change":this.recompile()}}},Lb=class extends cb{constructor(){let{kernelSize:e=Ky.MEDIUM,resolutionScale:t=.5,width:n=fb.AUTO_SIZE,height:i=fb.AUTO_SIZE,resolutionX:s=n,resolutionY:r=i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("KawaseBlurPass"),this.renderTargetA=new Gt(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const a=this.resolution=new fb(this,s,r,t);a.addEventListener("change",(e=>this.setSize(a.baseWidth,a.baseHeight))),this.blurMaterial=new qy,this.copyMaterial=new $y}getResolution(){return this.resolution}get dithering(){return this.copyMaterial.dithering}set dithering(e){this.copyMaterial.dithering=e}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(e){this.blurMaterial.kernelSize=e}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get scale(){return this.blurMaterial.scale}set scale(e){this.blurMaterial.scale=e}getScale(){return this.blurMaterial.scale}setScale(e){this.blurMaterial.scale=e}getKernelSize(){return this.kernelSize}setKernelSize(e){this.kernelSize=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,i,s){const r=this.scene,a=this.camera,o=this.renderTargetA,l=this.renderTargetB,c=this.blurMaterial,h=c.kernelSequence;let d=t;this.fullscreenMaterial=c;for(let t=0,n=h.length;t<n;++t){const n=0==(1&t)?o:l;c.kernel=h[t],c.inputBuffer=d.texture,e.setRenderTarget(n),e.render(r,a),d=n}this.fullscreenMaterial=this.copyMaterial,this.copyMaterial.inputBuffer=d.texture,e.setRenderTarget(this.renderToScreen?null:n),e.render(r,a)}setSize(e,t){const n=this.resolution;n.setBaseSize(e,t);const i=n.width,s=n.height;this.renderTargetA.setSize(i,s),this.renderTargetB.setSize(i,s),this.blurMaterial.setSize(e,t)}initialize(e,t,n){void 0!==n&&(this.renderTargetA.texture.type=n,this.renderTargetB.texture.type=n,n!==T?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):e.outputEncoding===Ee&&(this.renderTargetA.texture.encoding=Ee,this.renderTargetB.texture.encoding=Ee))}static get AUTO_SIZE(){return fb.AUTO_SIZE}},Cb=class extends cb{constructor(e,t){super("MaskPass",e,t),this.needsSwap=!1,this.clearPass=new pb(!1,!1,!0),this.inverse=!1}get inverted(){return this.inverse}set inverted(e){this.inverse=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(e){this.inverted=e}render(e,t,n,i,s){const r=e.getContext(),a=e.state.buffers,o=this.scene,l=this.camera,c=this.clearPass,h=this.inverted?0:1,d=1-h;a.color.setMask(!1),a.depth.setMask(!1),a.color.setLocked(!0),a.depth.setLocked(!0),a.stencil.setTest(!0),a.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),a.stencil.setFunc(r.ALWAYS,h,4294967295),a.stencil.setClear(d),a.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?c.render(e,null):(c.render(e,t),c.render(e,n))),this.renderToScreen?(e.setRenderTarget(null),e.render(o,l)):(e.setRenderTarget(t),e.render(o,l),e.setRenderTarget(n),e.render(o,l)),a.color.setLocked(!1),a.depth.setLocked(!1),a.stencil.setLocked(!1),a.stencil.setFunc(r.EQUAL,1,4294967295),a.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),a.stencil.setLocked(!0)}},Gb=class extends cb{constructor(e,t){let{renderTarget:n,resolutionScale:i=1,width:s=fb.AUTO_SIZE,height:r=fb.AUTO_SIZE,resolutionX:a=s,resolutionY:o=r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super("NormalPass"),this.needsSwap=!1,this.renderPass=new bb(e,t,new Lc);const l=this.renderPass;l.setBackgroundDisabled(!0),l.setShadowMapDisabled(!0);const c=l.getClearPass();c.setOverrideClearColor(new bt(7829503)),c.setOverrideClearAlpha(1),this.renderTarget=n,void 0===this.renderTarget&&(this.renderTarget=new Gt(1,1,{minFilter:x,magFilter:x}),this.renderTarget.texture.name="NormalPass.Target");const h=this.resolution=new fb(this,a,o,i);h.addEventListener("change",(e=>this.setSize(h.baseWidth,h.baseHeight)))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,i,s){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,r,r)}setSize(e,t){const n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}},Tb=class extends cb{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"inputBuffer";super("ShaderPass"),this.fullscreenMaterial=e,this.input=t}setInput(e){}render(e,t,n,i,s){const r=this.fullscreenMaterial.uniforms;null!==t&&void 0!==r&&void 0!==r[this.input]&&(r[this.input].value=t.texture),e.setRenderTarget(this.renderToScreen?null:n),e.render(this.scene,this.camera)}initialize(e,t,n){void 0!==n&&n!==T&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},Rb=.001,Ab=class{constructor(){this.shaderParts=new Map([[Yy.FRAGMENT_HEAD,null],[Yy.FRAGMENT_MAIN_UV,null],[Yy.FRAGMENT_MAIN_IMAGE,null],[Yy.VERTEX_HEAD,null],[Yy.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Oy.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=ze}},Xb=class extends Set{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;super(),this.l=t,this.exclusive=!1,void 0!==e&&this.set(e)}get layer(){return this.l}set layer(e){const t=this.l;for(const n of this)n.layers.disable(t),n.layers.enable(e);this.l=e}getLayer(){return this.layer}setLayer(e){this.layer=e}isExclusive(){return this.exclusive}setExclusive(e){this.exclusive=e}clear(){const e=this.layer;for(const t of this)t.layers.disable(e);return super.clear()}set(e){this.clear();for(const t of e)this.add(t);return this}indexOf(e){return this.has(e)?0:-1}add(e){return this.exclusive?e.layers.set(this.layer):e.layers.enable(this.layer),super.add(e)}delete(e){return this.has(e)&&e.layers.disable(this.layer),super.delete(e)}toggle(e){let t;return this.has(e)?(this.delete(e),t=!1):(this.add(e),t=!0),t}setVisible(e){for(const t of this)e?t.layers.enable(0):t.layers.disable(0);return this}},Ib=new Map([[Fy.ADD,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}"],[Fy.ALPHA,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}"],[Fy.AVERAGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}"],[Fy.COLOR,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}"],[Fy.COLOR_BURN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}"],[Fy.COLOR_DODGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}"],[Fy.DARKEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}"],[Fy.DIFFERENCE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}"],[Fy.DIVIDE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}"],[Fy.DST,null],[Fy.EXCLUSION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}"],[Fy.HARD_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*x*y,1.0-2.0*(1.0-x)*(1.0-y),step(0.5,y));return mix(x,z,opacity);}"],[Fy.HARD_MIX,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}"],[Fy.HUE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}"],[Fy.INVERT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}"],[Fy.INVERT_RGB,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}"],[Fy.LIGHTEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}"],[Fy.LINEAR_BURN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}"],[Fy.LINEAR_DODGE,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}"],[Fy.LINEAR_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}"],[Fy.LUMINOSITY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}"],[Fy.MULTIPLY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}"],[Fy.NEGATION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}"],[Fy.NORMAL,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}"],[Fy.OVERLAY,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}"],[Fy.PIN_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}"],[Fy.REFLECT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y)),opacity);}"],[Fy.SATURATION,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}"],[Fy.SCREEN,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-x*y,opacity);}"],[Fy.SOFT_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}"],[Fy.SRC,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}"],[Fy.SUBTRACT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}"],[Fy.VIVID_LIGHT,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(vec4(0.0),1.0-min(vec4(1.0),(1.0-x)/(2.0*y))),min(vec4(1.0),x/(2.0*(1.0-y))),step(0.5,y));return mix(x,z,opacity);}"]]),_b=class extends Be{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;super(),this._blendFunction=e,this.opacity=new hd(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this._blendFunction}set blendFunction(e){this._blendFunction=e,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return Ib.get(this.blendFunction)}},zb=class extends Be{constructor(e,t){let{attributes:n=Oy.NONE,blendFunction:i=Fy.NORMAL,defines:s=new Map,uniforms:r=new Map,extensions:a=null,vertexShader:o=null}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(),this.name=e,this.renderer=null,this.attributes=n,this.fragmentShader=t,this.vertexShader=o,this.defines=s,this.uniforms=r,this.extensions=a,this.blendMode=new _b(i),this.blendMode.addEventListener("change",(e=>this.setChanged())),this._inputColorSpace=ze,this._outputColorSpace=null}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e){}update(e,t,n){}setSize(e,t){}initialize(e,t,n){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof Gt||t instanceof jn||t instanceof Lt||t instanceof cb)&&this[e].dispose()}}};var Eb=class extends go{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:D,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:T;super(function(e,t,n){const i=new Map([[D,1],[U,1],[Y,2],[H,4]]);let s;if(i.has(t)||console.error("Invalid noise texture format"),n===T){s=new Uint8Array(e*i.get(t));for(let e=0,t=s.length;e<t;++e)s[e]=255*Math.random()+.5}else{s=new Float32Array(e*i.get(t));for(let e=0,t=s.length;e<t;++e)s[e]=Math.random()}return s}(e*t,n,i),e,t,n,i),this.needsUpdate=!0}};new zt,new dn,new bt;var Wb=class extends zb{constructor(e,t){let{blendFunction:n=Fy.SCREEN,patternTexture:i=null,patternScale:s=1,edgeStrength:r=1,pulseSpeed:a=0,visibleEdgeColor:o=16777215,hiddenEdgeColor:l=2230538,kernelSize:c=Ky.VERY_SMALL,blur:h=!1,xRay:d=!0,multisampling:u=0,resolutionScale:p=.5,width:m=fb.AUTO_SIZE,height:f=fb.AUTO_SIZE,resolutionX:g=m,resolutionY:y=f}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super("OutlineEffect","uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength;\n#ifdef USE_PATTERN\nuniform lowp sampler2D patternTexture;varying vec2 vUvPattern;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 edge=texture2D(edgeTexture,uv).rg;vec2 mask=texture2D(maskTexture,uv).rg;\n#ifndef X_RAY\nedge.y=0.0;\n#endif\nedge*=(edgeStrength*mask.x*pulse);vec3 color=edge.x*visibleEdgeColor+edge.y*hiddenEdgeColor;float visibilityFactor=0.0;\n#ifdef USE_PATTERN\nvec4 patternColor=texelToLinear(texture2D(patternTexture,vUvPattern));\n#ifdef X_RAY\nfloat hiddenFactor=0.5;\n#else\nfloat hiddenFactor=0.0;\n#endif\nvisibilityFactor=(1.0-mask.y>0.0)?1.0:hiddenFactor;visibilityFactor*=(1.0-mask.x)*patternColor.a;color+=visibilityFactor*patternColor.rgb;\n#endif\nfloat alpha=max(max(edge.x,edge.y),visibilityFactor);\n#ifdef ALPHA\noutputColor=vec4(color,alpha);\n#else\noutputColor=vec4(color,max(alpha,inputColor.a));\n#endif\n}",{uniforms:new Map([["maskTexture",new hd(null)],["edgeTexture",new hd(null)],["edgeStrength",new hd(r)],["visibleEdgeColor",new hd(new bt(o))],["hiddenEdgeColor",new hd(new bt(l))],["pulse",new hd(1)],["patternScale",new hd(s)],["patternTexture",new hd(null)]])}),this.blendMode.addEventListener("change",(e=>{this.blendMode.getBlendFunction()===Fy.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()})),this.blendMode.setBlendFunction(n),this.patternTexture=i,this.xRay=d,this.scene=e,this.camera=t,this.renderTargetMask=new Gt(1,1),this.renderTargetMask.samples=u,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new Gt(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new pb,this.clearPass.overrideClearColor=new bt(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new vb(e,t),this.maskPass=new bb(e,t,new eb(this.depthPass.texture,t));const b=this.maskPass.clearPass;b.overrideClearColor=new bt(16777215),b.overrideClearAlpha=1,this.blurPass=new Lb({resolutionScale:p,resolutionX:g,resolutionY:y,kernelSize:c}),this.blurPass.enabled=h;const v=this.blurPass.resolution;v.addEventListener("change",(e=>this.setSize(v.baseWidth,v.baseHeight))),this.outlinePass=new Tb(new sb);this.outlinePass.fullscreenMaterial.inputBuffer=this.renderTargetMask.texture,this.time=0,this.selection=new Xb,this.selection.layer=10,this.pulseSpeed=a}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(e){this.renderTargetMask.samples=e,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(e){this.uniforms.get("patternScale").value=e}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(e){this.uniforms.get("edgeStrength").value=e}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(e){this.uniforms.get("visibleEdgeColor").value=e}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(e){this.uniforms.get("hiddenEdgeColor").value=e}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(e){this.pulseSpeed=e}get width(){return this.resolution.width}set width(e){this.resolution.preferredWidth=e}get height(){return this.resolution.height}set height(e){this.resolution.preferredHeight=e}get selectionLayer(){return this.selection.layer}set selectionLayer(e){this.selection.layer=e}get dithering(){return this.blurPass.dithering}set dithering(e){this.blurPass.dithering=e}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(e){this.blurPass.kernelSize=e}get blur(){return this.blurPass.enabled}set blur(e){this.blurPass.enabled=e}get xRay(){return this.defines.has("X_RAY")}set xRay(e){this.xRay!==e&&(e?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(e){this.xRay=e}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(e){if(null!==e?(e.wrapS=e.wrapT=y,this.defines.set("USE_PATTERN","1"),this.setVertexShader("uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}")):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),null!==this.renderer){const t=Dy(e,this.renderer.capabilities.isWebGL2);this.defines.set("texelToLinear(texel)",t)}this.uniforms.get("patternTexture").value=e,this.setChanged()}setPatternTexture(e){this.patternTexture=e}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}setSelection(e){return this.selection.set(e),this}clearSelection(){return this.selection.clear(),this}selectObject(e){return this.selection.add(e),this}deselectObject(e){return this.selection.delete(e),this}update(e,t,n){const i=this.scene,s=this.camera,r=this.selection,a=this.uniforms.get("pulse"),o=i.background,l=s.layers.mask;r.size>0?(i.background=null,a.value=1,this.pulseSpeed>0&&(a.value=.375*Math.cos(this.time*this.pulseSpeed*10)+.625),this.time+=n,r.setVisible(!1),this.depthPass.render(e),r.setVisible(!0),s.layers.set(r.layer),this.maskPass.render(e,this.renderTargetMask),s.layers.mask=l,i.background=o,this.outlinePass.render(e,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(e,this.renderTargetOutline,this.renderTargetOutline)):this.time>0&&(this.clearPass.render(e,this.renderTargetOutline),this.time=0)}setSize(e,t){this.blurPass.setSize(e,t),this.renderTargetMask.setSize(e,t);const n=this.resolution;n.setBaseSize(e,t);const i=n.width,s=n.height;this.depthPass.setSize(i,s),this.renderTargetOutline.setSize(i,s),this.outlinePass.fullscreenMaterial.setSize(i,s)}initialize(e,t,n){const i=Dy(this.patternTexture,e.capabilities.isWebGL2);this.defines.set("texelToLinear(texel)",i),this.blurPass.initialize(e,t,T),void 0!==n&&(this.depthPass.initialize(e,t,n),this.maskPass.initialize(e,t,n),this.outlinePass.initialize(e,t,n))}};new zt,new zt;var Zb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",Pb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwAT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05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC",Nb=class extends zb{constructor(){let e,t,{blendFunction:n=Fy.SRC,preset:i=Jy.MEDIUM,edgeDetectionMode:s=Uy.COLOR,predicationMode:r=jy.DISABLED}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super("SMAAEffect","uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",{vertexShader:"varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",blendFunction:n,attributes:Oy.CONVOLUTION|Oy.DEPTH,uniforms:new Map([["weightMap",new hd(null)]])}),arguments.length>1&&(e=arguments[0],t=arguments[1],arguments.length>2&&(i=arguments[2]),arguments.length>3&&(s=arguments[3])),this.renderTargetEdges=new Gt(1,1,{depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new pb(!0,!1,!1),this.clearPass.overrideClearColor=new bt(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new Tb(new nb),this.edgeDetectionMaterial.edgeDetectionMode=s,this.edgeDetectionMaterial.predicationMode=r,this.weightsPass=new Tb(new rb);const a=new Fc;a.onLoad=()=>{const n=new Lt(e);n.name="SMAA.Search",n.magFilter=x,n.minFilter=x,n.generateMipmaps=!1,n.needsUpdate=!0,n.flipY=!0,this.weightsMaterial.searchTexture=n;const i=new Lt(t);i.name="SMAA.Area",i.magFilter=M,i.minFilter=M,i.generateMipmaps=!1,i.needsUpdate=!0,i.flipY=!1,this.weightsMaterial.areaTexture=i,this.dispatchEvent({type:"load"})},a.itemStart("search"),a.itemStart("area"),void 0!==e&&void 0!==t?(a.itemEnd("search"),a.itemEnd("area")):"undefined"!=typeof Image&&(e=new Image,t=new Image,e.addEventListener("load",(()=>a.itemEnd("search"))),t.addEventListener("load",(()=>a.itemEnd("area"))),e.src=Zb,t.src=Pb),this.applyPreset(i)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(e){this.edgeDetectionMaterial.edgeDetectionThreshold=e}setOrthogonalSearchSteps(e){this.weightsMaterial.orthogonalSearchSteps=e}applyPreset(e){const t=this.edgeDetectionMaterial,n=this.weightsMaterial;switch(e){case Jy.LOW:t.edgeDetectionThreshold=.15,n.orthogonalSearchSteps=4,n.diagonalDetection=!1,n.cornerDetection=!1;break;case Jy.MEDIUM:t.edgeDetectionThreshold=.1,n.orthogonalSearchSteps=8,n.diagonalDetection=!1,n.cornerDetection=!1;break;case Jy.HIGH:t.edgeDetectionThreshold=.1,n.orthogonalSearchSteps=16,n.diagonalSearchSteps=8,n.cornerRounding=25,n.diagonalDetection=!0,n.cornerDetection=!0;break;case Jy.ULTRA:t.edgeDetectionThreshold=.05,n.orthogonalSearchSteps=32,n.diagonalSearchSteps=16,n.cornerRounding=25,n.diagonalDetection=!0,n.cornerDetection=!0}}setDepthTexture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;this.edgeDetectionMaterial.depthBuffer=e,this.edgeDetectionMaterial.depthPacking=t}update(e,t,n){this.clearPass.render(e,this.renderTargetEdges),this.edgeDetectionPass.render(e,t,this.renderTargetEdges),this.weightsPass.render(e,this.renderTargetEdges,this.renderTargetWeights)}setSize(e,t){this.edgeDetectionMaterial.setSize(e,t),this.weightsMaterial.setSize(e,t),this.renderTargetEdges.setSize(e,t),this.renderTargetWeights.setSize(e,t)}dispose(){const{searchTexture:e,areaTexture:t}=this.weightsMaterial;null!==e&&null!==t&&(e.dispose(),t.dispose()),super.dispose()}static get searchImageDataURL(){return Zb}static get areaImageDataURL(){return Pb}},Vb=class extends zb{constructor(e,t){let{blendFunction:n=Fy.MULTIPLY,distanceScaling:i=!0,depthAwareUpsampling:s=!0,normalDepthBuffer:r=null,samples:a=9,rings:o=7,worldDistanceThreshold:l,worldDistanceFalloff:c,worldProximityThreshold:h,worldProximityFalloff:d,distanceThreshold:u=.97,distanceFalloff:p=.03,rangeThreshold:m=5e-4,rangeFalloff:f=.001,minRadiusScale:g=.1,luminanceInfluence:b=.7,radius:v=.1825,intensity:x=1,bias:w=.025,fade:S=.01,color:M=null,resolutionScale:L=1,width:C=fb.AUTO_SIZE,height:G=fb.AUTO_SIZE,resolutionX:T=C,resolutionY:R=G}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super("SSAOEffect","uniform lowp sampler2D aoBuffer;uniform float luminanceInfluence;\n#ifdef DEPTH_AWARE_UPSAMPLING\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D normalDepthBuffer;\n#else\nuniform mediump sampler2D normalDepthBuffer;\n#endif\n#endif\n#ifdef COLORIZE\nuniform vec3 color;\n#endif\nvoid mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){float aoLinear=texture2D(aoBuffer,uv).r;\n#if defined(DEPTH_AWARE_UPSAMPLING) && __VERSION__ == 300\nvec4 normalDepth[4];normalDepth[0]=textureOffset(normalDepthBuffer,uv,ivec2(0,0));normalDepth[1]=textureOffset(normalDepthBuffer,uv,ivec2(0,1));normalDepth[2]=textureOffset(normalDepthBuffer,uv,ivec2(1,0));normalDepth[3]=textureOffset(normalDepthBuffer,uv,ivec2(1,1));float dot01=dot(normalDepth[0].rgb,normalDepth[1].rgb);float dot02=dot(normalDepth[0].rgb,normalDepth[2].rgb);float dot03=dot(normalDepth[0].rgb,normalDepth[3].rgb);float minDot=min(dot01,min(dot02,dot03));float s=step(THRESHOLD,minDot);float smallestDistance=1.0;int index;for(int i=0;i<4;++i){float distance=abs(depth-normalDepth[i].a);if(distance<smallestDistance){smallestDistance=distance;index=i;}}ivec2 offsets[4];offsets[0]=ivec2(0,0);offsets[1]=ivec2(0,1);offsets[2]=ivec2(1,0);offsets[3]=ivec2(1,1);ivec2 coord=ivec2(uv*vec2(textureSize(aoBuffer,0)))+offsets[index];float aoNearest=texelFetch(aoBuffer,coord,0).r;float ao=mix(aoNearest,aoLinear,s);\n#else\nfloat ao=aoLinear;\n#endif\nfloat l=linearToRelativeLuminance(inputColor.rgb);ao=mix(ao,1.0,l*luminanceInfluence);\n#ifdef COLORIZE\noutputColor=vec4(1.0-(1.0-ao)*(1.0-color),inputColor.a);\n#else\noutputColor=vec4(vec3(ao),inputColor.a);\n#endif\n}",{blendFunction:n,attributes:Oy.DEPTH,defines:new Map([["THRESHOLD","0.997"]]),uniforms:new Map([["aoBuffer",new hd(null)],["normalDepthBuffer",new hd(r)],["luminanceInfluence",new hd(b)],["color",new hd(null)],["scale",new hd(0)]])}),this.renderTargetAO=new Gt(1,1,{depthBuffer:!1}),this.renderTargetAO.texture.name="AO.Target",this.uniforms.get("aoBuffer").value=this.renderTargetAO.texture;const A=this.resolution=new fb(this,T,R,L);A.addEventListener("change",(e=>this.setSize(A.baseWidth,A.baseHeight))),this.camera=e,this.ssaoPass=new Tb(new ab(e));const X=new Eb(64,64,H);X.wrapS=X.wrapT=y;const I=this.ssaoMaterial;I.noiseTexture=X,I.minRadiusScale=g,I.intensity=x,I.fade=S,I.bias=w,null!==r?(I.normalDepthBuffer=r,this.depthAwareUpsampling=s):I.normalBuffer=t,I.distanceThreshold=u,I.distanceFalloff=p,I.proximityThreshold=m,I.proximityFalloff=f,void 0!==l&&(I.worldDistanceThreshold=l),void 0!==c&&(I.worldDistanceFalloff=c),void 0!==h&&(I.worldProximityThreshold=h),void 0!==d&&(I.worldProximityFalloff=d),I.distanceScaling=i,I.samples=a,I.radius=v,I.rings=o,this.color=M}getResolution(){return this.resolution}get ssaoMaterial(){return this.ssaoPass.fullscreenMaterial}getSSAOMaterial(){return this.ssaoMaterial}get samples(){return this.ssaoMaterial.samples}set samples(e){this.ssaoMaterial.samples=e}get rings(){return this.ssaoMaterial.rings}set rings(e){this.ssaoMaterial.rings=e}get radius(){return this.ssaoMaterial.radius}set radius(e){this.ssaoMaterial.radius=e}get depthAwareUpsampling(){return this.defines.has("DEPTH_AWARE_UPSAMPLING")}set depthAwareUpsampling(e){this.depthAwareUpsampling!==e&&(e&&null!==this.uniforms.get("normalDepthBuffer").value?this.defines.set("DEPTH_AWARE_UPSAMPLING","1"):this.defines.delete("DEPTH_AWARE_UPSAMPLING"),this.setChanged())}isDepthAwareUpsamplingEnabled(){return this.depthAwareUpsampling}setDepthAwareUpsamplingEnabled(e){this.depthAwareUpsampling=e}get distanceScaling(){return this.ssaoMaterial.distanceScaling}set distanceScaling(e){this.ssaoMaterial.distanceScaling=e}get color(){return this.uniforms.get("color").value}set color(e){const t=this.uniforms,n=this.defines;null!==e?n.has("COLORIZE")?t.get("color").value.set(e):(n.set("COLORIZE","1"),t.get("color").value=new bt(e),this.setChanged()):n.has("COLORIZE")&&(n.delete("COLORIZE"),t.get("color").value=null,this.setChanged())}get luminanceInfluence(){return this.uniforms.get("luminanceInfluence").value}set luminanceInfluence(e){this.uniforms.get("luminanceInfluence").value=e}getColor(){return this.color}setColor(e){this.color=e}setDistanceCutoff(e,t){this.ssaoMaterial.distanceThreshold=e,this.ssaoMaterial.distanceFalloff=t}setProximityCutoff(e,t){this.ssaoMaterial.proximityThreshold=e,this.ssaoMaterial.proximityFalloff=t}setDepthTexture(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:We;this.ssaoMaterial.depthBuffer=e,this.ssaoMaterial.depthPacking=t}update(e,t,n){this.ssaoPass.render(e,null,this.renderTargetAO)}setSize(e,t){const n=this.resolution;n.setBaseSize(e,t);const i=n.width,s=n.height,r=this.ssaoMaterial;r.adoptCameraSettings(this.camera),r.setSize(i,s),this.renderTargetAO.setSize(i,s)}};class Hb{constructor(e,t,n){this.renderer=e,this.scene=t,this.camera=n,this.passesMap=new Map,this.effectsMap=new Map,this.effectComposer=this._initEffectComposer(),this._initPasses(),this._initEffects()}updateEffectPass(){const{effectComposer:e}=this;e.passes.forEach((t=>{"EffectPass"===t.name&&(e.removePass(t),t.dispose())}));const t=Array.from(this.effectsMap).filter((([,{enabled:e}])=>e)).map((([,{effect:e}])=>e)),n=new Mb(this.camera,...t);this.passesMap.set(Hb.CONSTANTS.effectPass,n),e.addPass(n)}updateCamera(e){const{passesMap:t,effectsMap:n}=this,{CONSTANTS:i}=Hb,s=t.get(i.renderPass),r=t.get(i.normalPass),a=t.get(i.effectPass);s.camera=e,r.camera=e,a.camera=e;n.get(i.outlineEffect).camera=e}_initEffectComposer(){return new class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{depthBuffer:t=!0,stencilBuffer:n=!1,multisampling:i=0,frameBufferType:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.renderer=null,this.inputBuffer=this.createBuffer(t,n,s,i),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new hb,this.depthTexture=null,this.passes=[],this.timer=new class{constructor(){this.previousTime=0,this.currentTime=0,this.delta=0,this.fixedDelta=1e3/60,this.elapsed=0,this.timescale=1,this.fixedDeltaEnabled=!1,this.autoReset=!1}setFixedDeltaEnabled(e){return this.fixedDeltaEnabled=e,this}isAutoResetEnabled(e){return this.autoReset}setAutoResetEnabled(e){return"undefined"!=typeof document&&void 0!==document.hidden&&(e?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this.autoReset=e),this}getDelta(){return this.delta*Rb}getFixedDelta(){return this.fixedDelta*Rb}setFixedDelta(e){return this.fixedDelta=1e3*e,this}getElapsed(){return this.elapsed*Rb}getTimescale(){return this.timescale}setTimescale(e){return this.timescale=e,this}update(e){return this.fixedDeltaEnabled?this.delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=void 0!==e?e:performance.now(),this.delta=this.currentTime-this.previousTime),this.delta*=this.timescale,this.elapsed+=this.delta,this}reset(){return this.delta=0,this.elapsed=0,this.currentTime=performance.now(),this}handleEvent(e){document.hidden||(this.currentTime=performance.now())}dispose(){this.setAutoResetEnabled(!1)}},this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){const t=this.inputBuffer,n=this.multisampling;n>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):n!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,null!==e){const t=e.getSize(new nt),n=e.getContext().getContextAttributes().alpha,i=this.inputBuffer.texture.type;i===T&&e.outputEncoding===Ee&&(this.inputBuffer.texture.encoding=Ee,this.outputBuffer.texture.encoding=Ee,this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const t of this.passes)t.initialize(e,n,i)}}replaceRenderer(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.renderer,i=n.domElement.parentNode;return this.setRenderer(e),t&&null!==i&&(i.removeChild(n.domElement),i.appendChild(e.domElement)),n}createDepthTexture(){const e=this.depthTexture=new Ia;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=F,e.type=P):e.type=_,e}deleteDepthTexture(){if(null!==this.depthTexture){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,n,s){const r=this.renderer,a=null===r?new nt:r.getDrawingBufferSize(new nt),o={minFilter:M,magFilter:M,stencilBuffer:t,depthBuffer:e,type:n};let l;return s>0?(l=Number(i.replace(/\D+/g,""))<138?new fu(a.width,a.height,o):new Gt(a.width,a.height,o),l.ignoreDepthForMultisampleCopy=!1,l.samples=s):l=new Gt(a.width,a.height,o),n===T&&null!==r&&r.outputEncoding===Ee&&(l.texture.encoding=Ee),l.texture.name="EffectComposer.Buffer",l.texture.generateMipmaps=!1,l}addPass(e,t){const n=this.passes,i=this.renderer,s=i.getDrawingBufferSize(new nt),r=i.getContext().getContextAttributes().alpha,a=this.inputBuffer.texture.type;if(e.setRenderer(i),e.setSize(s.width,s.height),e.initialize(i,r,a),this.autoRenderToScreen&&(n.length>0&&(n[n.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),void 0!==t?n.splice(t,0,e):n.push(e),this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!0),e.needsDepthTexture||null!==this.depthTexture)if(null===this.depthTexture){const t=this.createDepthTexture();for(e of n)e.setDepthTexture(t)}else e.setDepthTexture(this.depthTexture)}removePass(e){const t=this.passes,n=t.indexOf(e);if(-1!==n&&t.splice(n,1).length>0){if(null!==this.depthTexture){const n=(e,t)=>e||t.needsDepthTexture;t.reduce(n,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&n===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,n=this.copyPass;let i,s,r,a=this.inputBuffer,o=this.outputBuffer,l=!1;void 0===e&&(e=this.timer.update().getDelta());for(const c of this.passes)c.enabled&&(c.render(t,a,o,e,l),c.needsSwap&&(l&&(n.renderToScreen=c.renderToScreen,i=t.getContext(),s=t.state.buffers.stencil,s.setFunc(i.NOTEQUAL,1,4294967295),n.render(t,a,o,e,l),s.setFunc(i.EQUAL,1,4294967295)),r=a,a=o,o=r),c instanceof Cb?l=!0:c instanceof db&&(l=!1))}setSize(e,t,n){const i=this.renderer;if(void 0===e||void 0===t){const n=i.getSize(new nt);e=n.width,t=n.height}i.setSize(e,t,n);const s=i.getDrawingBufferSize(new nt);this.inputBuffer.setSize(s.width,s.height),this.outputBuffer.setSize(s.width,s.height);for(const e of this.passes)e.setSize(s.width,s.height)}reset(){const e=this.timer.isAutoResetEnabled();this.dispose(),this.autoRenderToScreen=!0,this.timer.setAutoResetEnabled(e)}dispose(){for(const e of this.passes)e.dispose();this.passes=[],null!==this.inputBuffer&&this.inputBuffer.dispose(),null!==this.outputBuffer&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}}(this.renderer,{multisampling:8,frameBufferType:E})}_initPasses(){const{effectComposer:e}=this,{CONSTANTS:t}=Hb,n=this._initRenderPass(),i=this._initNormalPass(),s=this._initDownSamplingPass(i),r=this._initEffectPass();e.addPass(n),e.addPass(i),e.addPass(s),e.addPass(r),this.passesMap.set(t.renderPass,n),this.passesMap.set(t.normalPass,i),this.passesMap.set(t.depthDownsamplingPass,s),this.passesMap.set(t.effectPass,r)}_initRenderPass(){return new bb(this.scene,this.camera)}_initNormalPass(){const e=new Gb(this.scene,this.camera,{resolutionScale:1});return e.enabled=!1,e}_initDownSamplingPass(e){const t=new xb({normalBuffer:e.texture,resolutionScale:.5});return t.enabled=!1,t}_initEffectPass(){return new Mb(this.camera)}_initEffects(){const{CONSTANTS:e}=Hb,t=this._initSMAAEffect(),n=this._initSSAOEffect(),i=this._initOutlineEffect();this.effectsMap.set(e.smaaEffect,{enabled:!0,effect:t}),this.effectsMap.set(e.ssaoEffect,{enabled:!1,effect:n}),this.effectsMap.set(e.outlineEffect,{enabled:!1,effect:i})}_initSMAAEffect(){return new Nb({preset:Jy.HIGH,edgeDetectionMode:Uy.COLOR})}_initSSAOEffect(){const{CONSTANTS:e}=Hb,t=this.passesMap.get(e.normalPass),n=this.passesMap.get(e.depthDownsamplingPass);return new Vb(this.camera,t.texture,{blendFunction:Fy.MULTIPLY,normalDepthBuffer:n.texture})}_initOutlineEffect(){return new Wb(this.scene,this.camera,{blendFunction:Fy.SCREEN})}}Hb.CONSTANTS={renderPass:"renderPass",normalPass:"normalPass",depthDownsamplingPass:"depthDownsamplingPass",effectPass:"effectPass",smaaEffect:"smaaEffect",ssaoEffect:"ssaoEffect",outlineEffect:"outlineEffect"};const Db=navigator.userAgent.toLowerCase().includes("mac");var kb;!function(e){e[e.NONE=-1]="NONE",e[e.ROTATE=0]="ROTATE",e[e.ZOOM=1]="ZOOM",e[e.PAN=2]="PAN"}(kb||(kb={}));const Bb=new zt,Fb=[new zt,new zt,new zt],Ub=[new zt,new zt,new zt];let Ob=new DOMRect;class Yb{constructor(e){this.viewport=e,this.camera=this.viewport.cameraManager.mainCamera,this.domElement=this.viewport.interactiveContainer,this.interactivePosition=null,this.fallbackInteractivePosition=null,this.enabled=!0,this.enabledMousePointInteractive=!0,this.enableZoom=!0,this.zoomSpeed=1,this.zoomMinDistance=1,this.zoomMaxDistance=1e5,this.zoomMinStepDistance=.1,this.zoomMaxStepDistance=2e4,this.enableRotate=!0,this.enableRotateX=!0,this.enableRotateY=!0,this.rotateSpeed=1,this.rotateTiltRange={max:Math.PI,min:0},this.enableAutoRotate=!1,this.autoRotateSpeed=1,this.autoRotateClockwise=!0,this.enableOutOfScene=!0,this.unOffsetOfScene=0,this.enablePan=!0,this.enablePanX=!0,this.enablePanY=!0,this.enablePanAxisX=!0,this.enablePanAxisY=!0,this.enablePanAxisZ=!0,this.panSpeed=2,this.state=kb.NONE,this.sceneBoxCenter=new zt,this.dispose=()=>{},this.domElement=e.interactiveContainer,this.init()}init(){const e=e=>{e.preventDefault(),!1!==this.enabled&&(0===e.button?this.state=kb.ROTATE:1===e.button?this.state=kb.ZOOM:2===e.button&&(this.state=kb.PAN),Ob=this.domElement.getBoundingClientRect(),this.state!==kb.ROTATE&&this.state!==kb.PAN||(this.interactivePosition=this.getInteractivePosition(e),this.interactivePosition||(this.sceneBoxCenter=this.getSceneBbox().getCenter(new zt)),this.domElement.addEventListener("mousemove",t,!1),window.addEventListener("mouseup",n,!0)))},t=e=>{if(e.preventDefault(),!1===this.enabled)return;const{movementX:t,movementY:n}=e;this.state===kb.ROTATE?this.rotate(new zt(.00375*-t,.00375*-n,0)):this.state===kb.PAN&&this.pan(new zt(-t,n,0))},n=e=>{e.preventDefault(),this.domElement.removeEventListener("mousemove",t,!1),window.removeEventListener("mouseup",n,!0),this.state=kb.NONE},i=e=>{if(e.preventDefault(),!this.enabled)return;let t=0;t=Db&&e.shiftKey?120*-e.deltaX:120*-e.deltaY,this.zoom_on_point(new zt(0,0,t),e)},s=e=>{if(e.preventDefault(),!1===this.enabled)return;Ob=this.domElement.getBoundingClientRect();const t=e.touches;switch(t.length){case 1:Fb[0].set(t[0].clientX,t[0].clientY,0),Fb[1].set(t[0].clientX,t[0].clientY,0);break;case 2:Fb[0].set(t[0].clientX,t[0].clientY,0),Fb[1].set(t[1].clientX,t[1].clientY,0);break;case 3:case 4:case 5:Fb[0].set(t[0].clientX,t[0].clientY,0),Fb[1].set(t[2].clientX,t[2].clientY,0)}const n=new zt(Ob.x,Ob.y,0);Fb[0].sub(n),Fb[1].sub(n),Ub[0].copy(Fb[0]),Ub[1].copy(Fb[1]),this.interactivePosition=this.getInteractivePosition({offsetX:(Fb[0].x+Fb[1].x)/2,offsetY:(Fb[0].y+Fb[1].y)/2}),this.interactivePosition||(this.sceneBoxCenter=this.getSceneBbox().getCenter(new zt)),this.domElement.addEventListener("touchmove",r,{passive:!1}),this.domElement.addEventListener("touchend",a,!1)},r=e=>{if(e.preventDefault(),!1===this.enabled)return;function t(e,t,n="y"){const i=new nt(e[1].x-e[0].x,e[1].y-e[0].y),s=new nt(t[1].x-t[0].x,t[1].y-t[0].y),r=i.angle(),a=s.angle();i.normalize(),s.normalize();const o=t[0].y-e[0].y;return"y"===n?new zt(0,.005*o,0):"x"===n?new zt(r-a,0,0):new zt}switch(e.touches.length){case 1:{Fb[0].set(e.touches[0].clientX-Ob.x,e.touches[0].clientY-Ob.y,0),Fb[1].set(e.touches[0].clientX-Ob.x,e.touches[0].clientY-Ob.y,0);const t=Fb[0].clone().sub(((e,t)=>{let n=t[0];for(const i in t)n.distanceTo(e)>t[i].distanceTo(e)&&(n=t[i]);return n})(Fb[0],Ub));t.x=-t.x;const n=t.multiplyScalar(.9);this.pan(n);break}case 2:{Fb[0].set(e.touches[0].clientX-Ob.x,e.touches[0].clientY-Ob.y,0),Fb[1].set(e.touches[1].clientX-Ob.x,e.touches[1].clientY-Ob.y,0);const n=Ub[0].distanceTo(Ub[1])-Fb[0].distanceTo(Fb[1]);this.zoom_touch(new zt(0,0,n*this.zoomSpeed/25)),this.rotate(t(Fb,Ub,"x"));break}case 3:case 4:case 5:Fb[0].set(e.touches[0].clientX-Ob.x,e.touches[0].clientY-Ob.y,0),Fb[1].set(e.touches[2].clientX-Ob.x,e.touches[2].clientY-Ob.y,0),this.rotate(t(Fb,Ub,"y"))}Ub[0].copy(Fb[0]),Ub[1].copy(Fb[1])},a=e=>{e.preventDefault(),this.state=kb.NONE,this.domElement.removeEventListener("touchmove",r,!1),this.domElement.removeEventListener("touchend",a,!1)};this.domElement.addEventListener("mousedown",e,!1),this.domElement.addEventListener("wheel",i,{passive:!1}),this.domElement.addEventListener("touchstart",s,{passive:!1}),this.dispose=()=>{this.domElement.removeEventListener("mousedown",e),this.domElement.removeEventListener("wheel",i),this.domElement.removeEventListener("touchstart",s)}}getInteractivePosition(e){if(this.enabledMousePointInteractive){const t=this.viewport.getIntersects(e,void 0,{isFilterHideObject:!0});if(t.length){const[{point:e}]=t;return e.clone()}return this.fallbackInteractivePosition}return this.fallbackInteractivePosition}intersectsBox(e){const t=this.getSceneBbox(),n=new zt;t.getSize(n);let i=Math.max(n.x,n.y,n.z);0!=this.unOffsetOfScene&&(i=this.unOffsetOfScene);const s=t.clone();s.min.addScalar(i/2),s.max.addScalar(-i/2);const r=(new Bi).copy(this.camera);r.position.add(e),r.updateMatrixWorld(),r.updateProjectionMatrix();return(new es).setFromProjectionMatrix((new dn).multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse)).intersectsBox(t)}caculateContainPoint(e,t){const n=(new zt).copy(e).applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);return!(Math.abs(n.x)>1||Math.abs(n.y)>1||Math.abs(n.z)>1)}panLeft(e){const t=new zt,n=this.camera.matrix.elements;this.enablePanAxisX&&t.setX(n[0]),this.enablePanAxisY&&t.setY(n[1]),this.enablePanAxisZ&&t.setZ(n[2]),t.multiplyScalar(e);let i=!0;this.enableOutOfScene||(i=this.intersectsBox(t)),i&&this.camera.position.add(t)}panUp(e){const t=new zt,n=this.camera.matrix.elements;this.enablePanAxisX&&t.setX(n[4]),this.enablePanAxisY&&t.setY(n[5]),this.enablePanAxisZ&&t.setZ(n[6]),t.multiplyScalar(e);let i=!0;this.enableOutOfScene||(i=this.intersectsBox(t)),i&&this.camera.position.add(t)}pan(e){var t;if(!this.enablePan)return;this.enablePanX||e.setX(0),this.enablePanY||e.setY(0);const n=null!==(t=this.interactivePosition)&&void 0!==t?t:this.sceneBoxCenter;let i=this.camera.position.clone().sub(n).length();i*=Math.tan(this.camera.fov/2*Math.PI/180),this.panLeft(this.panSpeed*e.x*i/Ob.height),this.panUp(this.panSpeed*e.y*i/Ob.height),this.viewport.signals.cameraChange.dispatch()}zoom_on_point(e,t){if(!this.enableZoom)return;this.interactivePosition=this.getInteractivePosition(t);let n=e.z>0?6:-6;const i=new zt(0,0,0);let s;if(this.interactivePosition){s=this.interactivePosition.distanceTo(this.camera.position);const e=this.domElement.getBoundingClientRect();i.set(t.offsetX/e.width*2-1,-t.offsetY/e.height*2+1,.1)}else s=this.camera.position.length(),i.set(0,0,.1);let r=!1;s>this.zoomMaxDistance&&n<0?(r=!0,s=this.zoomMaxDistance,n*=2):s<this.zoomMinDistance&&n>0&&(r=!0,s=this.zoomMinDistance,n*=2),i.unproject(this.camera),i.sub(this.camera.position);let a=s/n*this.zoomSpeed;if(a>0?a>this.zoomMaxStepDistance?a=this.zoomMaxStepDistance:a<this.zoomMinStepDistance&&(a=this.zoomMinStepDistance):a<0&&(a<-this.zoomMaxStepDistance?a=-this.zoomMaxStepDistance:a>-this.zoomMinStepDistance&&(a=-this.zoomMinStepDistance)),r&&!t.shiftKey)return;const o=this.camera.position.clone().addVectors(this.camera.position,i.setLength(a));this.camera.position.copy(o),this.viewport.signals.cameraChange.dispatch()}zoom_touch(e){if(!this.enableZoom)return;let t=e.z;const n=new zt(0,0,0);let i;if(this.interactivePosition){const e={offsetX:(Ub[0].x+Ub[1].x)/2,offsetY:(Ub[0].y+Ub[1].y)/2};i=this.interactivePosition.distanceTo(this.camera.position),n.set(e.offsetX/Ob.width*2-1,-e.offsetY/Ob.height*2+1,.1)}else i=this.camera.position.length(),n.set(0,0,.1);if(i>this.zoomMaxDistance&&t>0?(i=this.zoomMaxDistance,t=0):i<this.zoomMinDistance&&t<0&&(i=this.zoomMinDistance),0===t)return;n.unproject(this.camera),n.sub(this.camera.position);let s=i*-t*this.zoomSpeed*.1;s>0?s>this.zoomMaxStepDistance?s=this.zoomMaxStepDistance:s<this.zoomMinStepDistance&&(s=this.zoomMinStepDistance):s<0&&(s<-this.zoomMaxStepDistance?s=-this.zoomMaxStepDistance:s>-this.zoomMinStepDistance&&(s=-this.zoomMinStepDistance));const r=this.camera.position.clone().addVectors(this.camera.position,n.setLength(s));this.camera.position.copy(r),this.viewport.signals.cameraChange.dispatch()}rotate(e){var t;if(!this.enableRotate)return;e.x*=this.rotateSpeed,e.y*=this.rotateSpeed;const n=new zt(0,0,-1);n.applyQuaternion(this.camera.quaternion);const i=n.angleTo(new zt(0,1,0));(i-e.y>this.rotateTiltRange.max&&e.y<0||i-e.y<this.rotateTiltRange.min&&e.y>0)&&(e.y=0);const s=null!==(t=this.interactivePosition)&&void 0!==t?t:this.sceneBoxCenter;Bb.copy(this.camera.position).sub(s);const r=new dn,a=new zt(1,0,0);this.enableRotateX&&r.makeRotationAxis(new zt(0,1,0),e.x);const o=new dn;this.enableRotateY&&(a.applyEuler(this.camera.rotation),o.makeRotationAxis(a,e.y),r.multiply(o)),Bb.applyMatrix4(r),n.applyMatrix4(r),this.camera.position.copy(s).add(Bb),this.camera.lookAt(n.add(this.camera.position)),this.viewport.signals.cameraChange.dispatch()}autoRotate(){const e=this.autoRotateClockwise?.01:-.01;this.rotate(new zt(e*this.autoRotateSpeed,0,0))}update(){this.enableAutoRotate&&this.autoRotate()}getSceneBbox(){const e=this.viewport.scene,t=new Zt;return t.setFromObject(e),t}}const Kb={type:"change"},jb={type:"start"},Jb={type:"end"};class Qb extends Be{constructor(e,t){super(),this.object=e,this.domElement=t,this.enabled=!0,this.target=new zt,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.enableAutoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.ROTATE,MIDDLE:s.DOLLY,RIGHT:s.PAN},this.touches={ONE:r.ROTATE,TWO:r.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.userData.zoom,this._domElementKeyEvents=null,this.domElement.style.touchAction="none",this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(e){e.addEventListener("keydown",U),this._domElementKeyEvents=e},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.userData.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.userData.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(Kb),n.update(),a=i.NONE},this.update=function(){const t=new zt,s=(new _t).setFromUnitVectors(e.up,new zt(0,1,0)),r=s.clone().invert(),p=new zt,m=new _t,f=2*Math.PI;return function(){const e=n.object.position;t.copy(e).sub(n.target),t.applyQuaternion(s),l.setFromVector3(t),n.enableAutoRotate&&a===i.NONE&&C(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(l.theta+=c.theta*n.dampingFactor,l.phi+=c.phi*n.dampingFactor):(l.theta+=c.theta,l.phi+=c.phi);let g=n.minAzimuthAngle,y=n.maxAzimuthAngle;return isFinite(g)&&isFinite(y)&&(g<-Math.PI?g+=f:g>Math.PI&&(g-=f),y<-Math.PI?y+=f:y>Math.PI&&(y-=f),l.theta=g<=y?Math.max(g,Math.min(y,l.theta)):l.theta>(g+y)/2?Math.max(g,l.theta):Math.min(y,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),l.radius*=h,l.radius=Math.max(n.minDistance,Math.min(n.maxDistance,l.radius)),!0===n.enableDamping?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),t.setFromSpherical(l),t.applyQuaternion(r),e.copy(n.target).add(t),n.object.lookAt(n.target),!0===n.enableDamping?(c.theta*=1-n.dampingFactor,c.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(c.set(0,0,0),d.set(0,0,0)),h=1,!!(u||p.distanceToSquared(n.object.position)>o||8*(1-m.dot(n.object.quaternion))>o)&&(n.dispatchEvent(Kb),p.copy(n.object.position),m.copy(n.object.quaternion),u=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",O),n.domElement.removeEventListener("pointerdown",H),n.domElement.removeEventListener("pointercancel",B),n.domElement.removeEventListener("wheel",F),n.domElement.removeEventListener("pointermove",D),n.domElement.removeEventListener("pointerup",k),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",U)};const n=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let a=i.NONE;const o=1e-6,l=new gd,c=new gd;let h=1;const d=new zt;let u=!1;const p=new nt,m=new nt,f=new nt,g=new nt,y=new nt,b=new nt,v=new nt,x=new nt,w=new nt,S=[],M={};function L(){return Math.pow(.95,n.zoomSpeed)}function C(e){c.theta-=e}function G(e){c.phi-=e}const T=function(){const e=new zt;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),d.add(e)}}(),R=function(){const e=new zt;return function(t,i){!0===n.screenSpacePanning?e.setFromMatrixColumn(i,1):(e.setFromMatrixColumn(i,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),d.add(e)}}(),A=function(){const e=new zt;return function(t,i){const s=n.domElement;if(n.object instanceof Bi){const r=n.object.position;e.copy(r).sub(n.target);let a=e.length();a*=Math.tan(n.object.fov/2*Math.PI/180),T(2*t*a/s.clientHeight,n.object.matrix),R(2*i*a/s.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(T(t*(n.object.right-n.object.left)/n.object.userData.zoom/s.clientWidth,n.object.matrix),R(i*(n.object.top-n.object.bottom)/n.object.userData.zoom/s.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function X(e){n.object instanceof Bi?h/=e:n.object.isOrthographicCamera?(n.object.userData.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.userData.zoom*e)),n.object.updateProjectionMatrix(),u=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function I(e){n.object instanceof Bi?h*=e:n.object.isOrthographicCamera?(n.object.userData.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.userData.zoom/e)),n.object.updateProjectionMatrix(),u=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function _(e){p.set(e.clientX,e.clientY)}function z(e){g.set(e.clientX,e.clientY)}function E(){if(1===S.length)p.set(S[0].pageX,S[0].pageY);else{const e=.5*(S[0].pageX+S[1].pageX),t=.5*(S[0].pageY+S[1].pageY);p.set(e,t)}}function W(){if(1===S.length)g.set(S[0].pageX,S[0].pageY);else{const e=.5*(S[0].pageX+S[1].pageX),t=.5*(S[0].pageY+S[1].pageY);g.set(e,t)}}function Z(){const e=S[0].pageX-S[1].pageX,t=S[0].pageY-S[1].pageY,n=Math.sqrt(e*e+t*t);v.set(0,n)}function P(e){if(1==S.length)m.set(e.pageX,e.pageY);else{const t=j(e),n=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);m.set(n,i)}f.subVectors(m,p).multiplyScalar(n.rotateSpeed);const t=n.domElement;C(2*Math.PI*f.x/t.clientHeight),G(2*Math.PI*f.y/t.clientHeight),p.copy(m)}function N(e){if(1===S.length)y.set(e.pageX,e.pageY);else{const t=j(e),n=.5*(e.pageX+t.x),i=.5*(e.pageY+t.y);y.set(n,i)}b.subVectors(y,g).multiplyScalar(n.panSpeed),A(b.x,b.y),g.copy(y)}function V(e){const t=j(e),i=e.pageX-t.x,s=e.pageY-t.y,r=Math.sqrt(i*i+s*s);x.set(0,r),w.set(0,Math.pow(x.y/v.y,n.zoomSpeed)),X(w.y),v.copy(x)}function H(e){!1!==n.enabled&&(0===S.length&&(n.domElement.setPointerCapture(e.pointerId),n.domElement.addEventListener("pointermove",D),n.domElement.addEventListener("pointerup",k)),function(e){S.push(e)}(e),"touch"===e.pointerType?function(e){switch(K(e),S.length){case 1:switch(n.touches.ONE){case r.ROTATE:if(!1===n.enableRotate)return;E(),a=i.TOUCH_ROTATE;break;case r.PAN:if(!1===n.enablePan)return;W(),a=i.TOUCH_PAN;break;default:a=i.NONE}break;case 2:switch(n.touches.TWO){case r.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&Z(),n.enablePan&&W(),a=i.TOUCH_DOLLY_PAN;break;case r.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&Z(),n.enableRotate&&E(),a=i.TOUCH_DOLLY_ROTATE;break;default:a=i.NONE}break;default:a=i.NONE}a!==i.NONE&&n.dispatchEvent(jb)}(e):function(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.DOLLY:if(!1===n.enableZoom)return;!function(e){v.set(e.clientX,e.clientY)}(e),a=i.DOLLY;break;case s.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;z(e),a=i.PAN}else{if(!1===n.enableRotate)return;_(e),a=i.ROTATE}break;case s.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;_(e),a=i.ROTATE}else{if(!1===n.enablePan)return;z(e),a=i.PAN}break;default:a=i.NONE}a!==i.NONE&&n.dispatchEvent(jb)}(e))}function D(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(K(e),a){case i.TOUCH_ROTATE:if(!1===n.enableRotate)return;P(e),n.update();break;case i.TOUCH_PAN:if(!1===n.enablePan)return;N(e),n.update();break;case i.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&V(e),n.enablePan&&N(e)}(e),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&V(e),n.enableRotate&&P(e)}(e),n.update();break;default:a=i.NONE}}(e):function(e){switch(a){case i.ROTATE:if(!1===n.enableRotate)return;!function(e){m.set(e.clientX,e.clientY),f.subVectors(m,p).multiplyScalar(n.rotateSpeed);const t=n.domElement;C(2*Math.PI*f.x/t.clientHeight),G(2*Math.PI*f.y/t.clientHeight),p.copy(m),n.update()}(e);break;case i.DOLLY:if(!1===n.enableZoom)return;!function(e){x.set(e.clientX,e.clientY),w.subVectors(x,v),w.y>0?X(L()):w.y<0&&I(L()),v.copy(x),n.update()}(e);break;case i.PAN:if(!1===n.enablePan)return;!function(e){y.set(e.clientX,e.clientY),b.subVectors(y,g).multiplyScalar(n.panSpeed),A(b.x,b.y),g.copy(y),n.update()}(e)}}(e))}function k(e){Y(e),0===S.length&&(n.domElement.releasePointerCapture(e.pointerId),n.domElement.removeEventListener("pointermove",D),n.domElement.removeEventListener("pointerup",k)),n.dispatchEvent(Jb),a=i.NONE}function B(e){Y(e)}function F(e){!1!==n.enabled&&!1!==n.enableZoom&&a===i.NONE&&(e.preventDefault(),n.dispatchEvent(jb),function(e){e.deltaY<0?I(L()):e.deltaY>0&&X(L()),n.update()}(e),n.dispatchEvent(Jb))}function U(e){!1!==n.enabled&&!1!==n.enablePan&&function(e){let t=!1;switch(e.code){case n.keys.UP:A(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:A(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:A(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:A(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}(e)}function O(e){!1!==n.enabled&&e.preventDefault()}function Y(e){delete M[e.pointerId];for(let t=0;t<S.length;t++)if(S[t].pointerId==e.pointerId)return void S.splice(t,1)}function K(e){let t=M[e.pointerId];void 0===t&&(t=new nt,M[e.pointerId]=t),t.set(e.pageX,e.pageY)}function j(e){const t=e.pointerId===S[0].pointerId?S[1]:S[0];return M[t.pointerId]}n.domElement.addEventListener("contextmenu",O),n.domElement.addEventListener("pointerdown",H),n.domElement.addEventListener("pointercancel",B),n.domElement.addEventListener("wheel",F,{passive:!1})}}class qb{constructor(e){this.viewport=e,this._options={type:"free"},this._disposeList=new Set,this.currentControls=new Yb(this.viewport)}get options(){return this._options}set options(e){this._options=e,e.type||(this._options.type="free"),this._onChangeCallback()}handleFreeControls(){const e=Ep(this.options,["type"]),{postRender:t}=this.viewport,n=this.currentControls=new Yb(this.viewport);Object.assign(n,e),t.set("FreeControlsUpdate",(()=>{n.update()})),this._disposeList.add((()=>{t.delete("FreeControlsUpdate")}))}handleOrbitControls(){const e=Ep(Object.assign({},this.options),["type"]),{cameraManager:{mainCamera:t},interactiveContainer:n,postRender:i}=this.viewport,s=this.currentControls=new Qb(t,n);Object.assign(s,e),s.update();const r=()=>{this.viewport.signals.cameraChange.dispatch()};if(s.addEventListener("change",r),this._disposeList.add((()=>{s.removeEventListener("change",r)})),e.enableDamping||e.enableAutoRotate)i.set("OrbitControlsUpdate",(()=>{this.viewport.render((()=>{s.update()}))})),this._disposeList.add((()=>{i.delete("OrbitControlsUpdate")}));else{const e=e=>{e&&s.update()};this.viewport.signals.cameraChange.add(e),this._disposeList.add((()=>{this.viewport.signals.cameraChange.remove(e)}))}}_onChangeCallback(){switch(this.dispose(),this.options.type){case"free":this.handleFreeControls();break;case"orbit":this.handleOrbitControls();break;default:this.handleFreeControls()}this.viewport.triggerRender()}setOptions(e){this.options=e}dispose(){this.currentControls.dispose(),this._disposeList.forEach((e=>e())),this._disposeList.clear()}}class $b{constructor(e,t){this.scene=e,this.signals=t;const n=document.createElement("div");n.style.position="absolute",n.style.left="12px",n.style.bottom="12px",n.style.fontSize="12px",n.style.color="#fff",n.style.pointerEvents="none",this.container=n,this.state={objects:0,vertices:0,triangles:0,frametime:0,lodFrametime:0}}addListeners(){const{scene:e,signals:t}=this;function n(e,t=!0){const n=document.createElement("span");return t&&(n.style.marginLeft="6px"),n.innerHTML=e,n}function i(){return document.createElement("br")}const s=n("0"),r=n("0"),a=n("0"),o=n("0"),l=n("0");this.container.appendChild(n("objects",!1)),this.container.appendChild(s),this.container.appendChild(i()),this.container.appendChild(n("triangles",!1)),this.container.appendChild(r),this.container.appendChild(i()),this.container.appendChild(n("vertices",!1)),this.container.appendChild(a),this.container.appendChild(i()),this.container.appendChild(n("frametime",!1)),this.container.appendChild(o),this.container.appendChild(i()),this.container.appendChild(n("lodFrametime",!1)),this.container.appendChild(l);const c=()=>{this.state.objects=0,this.state.vertices=0,this.state.triangles=0;for(let t=0;t<e.children.length;t++){e.children[t].traverseVisible((e=>{var t,n,i,s;if("SceneManager"!==e.stype&&this.state.objects++,e.isMesh){const r=e.geometry;r.isGeometry?(this.state.vertices+=(null===(t=r.vertices)||void 0===t?void 0:t.length)||0,this.state.triangles+=(null===(n=r.faces)||void 0===n?void 0:n.length)||0):r.isBufferGeometry&&(this.state.vertices+=(null===(i=r.attributes.position)||void 0===i?void 0:i.count)||0,null!==r.index?this.state.triangles+=r.index.count/3:this.state.triangles+=(null===(s=r.attributes.position)||void 0===s?void 0:s.count)/3||0)}}))}s.innerHTML=String(this.state.objects),a.innerHTML=String(this.state.vertices),r.innerHTML=String(this.state.triangles)};t.objectAdded.add(c),t.objectRemoved.add(c),t.geometryChanged.add(c);t.sceneRendered.add((e=>{this.state.frametime=e,o.innerHTML=Number(e).toFixed(2)+" ms"}));t.loadRendered.add((e=>{this.state.lodFrametime=e,l.innerHTML=Number(e).toFixed(2)+" ms"}))}}const ev=new Ct;class tv extends Zn{constructor(e,t){super();const n=new bt("#ff3653"),i=new bt("#8adb00"),s=new bt("#2c8fff"),r=new ps(-2,2,2,-2,0,4);r.position.set(0,0,2);const a=new Pi(.8,.05,.05).translate(.4,0,0),o=new Wi(a,y(n)),l=new Wi(a,y(i)),c=new Wi(a,y(s));l.rotation.z=Math.PI/2,c.rotation.y=-Math.PI/2,this.add(o),this.add(c),this.add(l);const h=new io(b(n,"X"));h.userData.type="posX";const d=new io(b(i,"Y"));d.userData.type="posY";const u=new io(b(s,"Z"));u.userData.type="posZ";const p=new io(b(n));p.userData.type="negX";const m=new io(b(i));m.userData.type="negY";const f=new io(b(s));f.userData.type="negZ",h.position.x=1,d.position.y=1,u.position.z=1,p.position.x=-1,p.scale.setScalar(.8),m.position.y=-1,m.scale.setScalar(.8),f.position.z=-1,f.scale.setScalar(.8),this.add(h),this.add(d),this.add(u),this.add(p),this.add(m),this.add(f);const g=new zt;function y(e){return new Jn({color:e,toneMapped:!1})}function b(e,t=null){const n=document.createElement("canvas");n.width=64,n.height=64;const i=n.getContext("2d");if(!i)return;i.beginPath(),i.arc(32,32,16,0,2*Math.PI),i.closePath(),i.fillStyle=e.getStyle(),i.fill(),null!==t&&(i.font="24px Arial",i.textAlign="center",i.fillStyle="#000000",i.fillText(t,32,41));const s=new Yo(n);return new Ba({map:s,toneMapped:!1})}this.render=function(n){this.quaternion.copy(e.quaternion).invert(),this.updateMatrixWorld(),g.set(0,0,1),g.applyQuaternion(e.quaternion),g.x>=0?(h.material.opacity=1,p.material.opacity=.5):(h.material.opacity=.5,p.material.opacity=1),g.y>=0?(d.material.opacity=1,m.material.opacity=.5):(d.material.opacity=.5,m.material.opacity=1),g.z>=0?(u.material.opacity=1,f.material.opacity=.5):(u.material.opacity=.5,f.material.opacity=1);const i=t.offsetWidth-128;n.clearDepth(),n.getViewport(ev),n.setViewport(i,0,128,128),n.render(this,r),n.setViewport(ev.x,ev.y,ev.z,ev.w)}}}yi.prototype.disposeBoundsTree=function(){this.boundsTree=null},Wi.prototype.raycast=function(e,t){if(this.geometry.boundsTree){if(void 0===this.material)return;cg.copy(this.matrixWorld).invert(),lg.copy(e.ray).applyMatrix4(cg);const n=this.geometry.boundsTree;if(!0===e.firstHitOnly){const i=vf(n.raycastFirst(lg,this.material),this,e);i&&t.push(i)}else{const i=n.raycast(lg,this.material);for(let n=0,s=i.length;n<s;n++){const s=vf(i[n],this,e);s&&t.push(s)}}}else hg.call(this,e,t)},pd.prototype.firstHitOnly=!0;const nv={needsUpdate:!1};let iv=0,sv=0;class rv{constructor(e){this.clock=new Nh,this.sky=null,this.options=e,this.state={useFreq:1,animationTotal:0,isPausedRender:!1,isDisposed:!1},this.signals={windowResize:new ty,cameraObjectChange:new ty,sceneChanged:new ty,backgroundChanged:new ty,beforeRender:new ty,sceneRendered:new ty,loadRendered:new ty,tweenUpdate:new ty,hover:new ty,click:new ty,dblClick:new ty,rightClick:new ty,mouseDown:new ty,mouseMove:new ty,mouseUp:new ty,mouseWheel:new ty,keyDown:new ty,keyUp:new ty,modelHover:new ty,modelUnHover:new ty,modelClick:new ty,modelDblClick:new ty,modelRightClick:new ty,poiHover:new ty,poiUnHover:new ty,poiClick:new ty,poiDblClick:new ty,poiRightClick:new ty,selectPosition:new ty,sceneClick:new ty,objectAdded:new ty,objectRemoved:new ty,objectChanged:new ty,geometryChanged:new ty,materialAdded:new ty,materialChanged:new ty,materialRemoved:new ty,cameraChange:new ty,outlineChange:new ty,modelAnimation:new ty,getSceneInfo:new ty},this.scener=new iy(this.signals,this.state),this.scene=this.scener.scene,this.cameraManager=new Hy(this),this.camera=this.cameraManager.currentCamera,this.rendererManager=new Gy(e),this.container=this.rendererManager.container,this.interactiveContainer=this.rendererManager.interactiveContainer,this.renderer=this.rendererManager.renderer,this.rendererCSS3D=this.rendererManager.rendererCSS3D,this.rendererCSS2D=this.rendererManager.rendererCSS2D,this.rendererCSS2DHalf=this.rendererManager.rendererCSS2DHalf,this.pmremGenerator=new Ss(this.renderer),this.pmremGenerator.compileEquirectangularShader(),this.effectManager=new Hb(this.renderer,this.scene,this.camera),this.effectComposer=this.effectManager.effectComposer,this.controls=new qb(this),this.info=new $b(this.scene,this.signals),this.stats=new mg,this.mixer=new cd(this.scene),this.postUpdate=new Map,this.postRender=new Map,this.selectModel=null,this.selectPoi=null,this._loop=0,this.viewHelper=new tv(this.camera,this.container),this._initInfo(),this._initStats(),this._signalsEventListenr(),this._containerAddEventListener(this.container),this.animate(0)}_initInfo(){if(this.options.showInfo){this.info.addListeners();const{container:e}=this.info;e.style.zIndex="1",this.container.appendChild(e)}}_initStats(){if(this.options.showStats){const{dom:e}=this.stats;e.style.zIndex="1",this.container.appendChild(e),this.signals.sceneRendered.add((()=>{this.stats.update()}))}}setSobel(){}setBloom(){}setSSAO(e={}){const{enabled:t=!0,distanceScaling:n=!0,depthAwareUpsampling:i=!0,samples:s=16,rings:r=7,distanceThreshold:a=.02,distanceFalloff:o=.0025,rangeThreshold:l=3e-4,rangeFalloff:c=1e-4,luminanceInfluence:h=.7,minRadiusScale:d=.33,radius:u=.1,intensity:p=3,bias:m=.004,fade:f=.01,color:g=null,resolutionScale:y=.5}=e,{effectManager:b}=this,v=b.passesMap.get(Hb.CONSTANTS.normalPass),x=b.passesMap.get(Hb.CONSTANTS.depthDownsamplingPass),w=b.effectsMap.get(Hb.CONSTANTS.ssaoEffect);v.enabled=t,x.enabled=t,w.enabled=t;const{effect:S}=w,{ssaoMaterial:M}=S;S.depthAwareUpsampling=i,S.luminanceInfluence=h,S.resolution.scale=y,M.distanceScaling=n,M.samples=s,M.rings=r,M.distanceThreshold=a,M.distanceFalloff=o,M.proximityThreshold=l,M.proximityFalloff=c,M.minRadiusScale=d,M.intensity=p,M.fade=f,M.bias=m,M.radius=u,g&&(S.color=new bt(g)),this.triggerRender()}setColorSpace(e){this.renderer.outputEncoding="sRGB"===e?Ee:ze,this.signals.sceneChanged.dispatch()}setToneMapping(e={}){const{type:t="Linear",exposure:n=.8}=e,i={None:0,Linear:1,Reinhard:2,Cineon:3,ACESFilmic:4};this.renderer.toneMapping=i[t],this.renderer.toneMappingExposure=n,this.signals.sceneChanged.dispatch()}setSphereSkyBackground(e){(new eh).load(e,(e=>{e.mapping=m,this.scene.background=e,this.signals.backgroundChanged.dispatch()}))}setSkyBackground(e,t){Tp(e,t).then((e=>{this.scene.background=e,this.signals.backgroundChanged.dispatch()}))}setBackgroundColor(e){this.scene.background=new bt(e),this.signals.backgroundChanged.dispatch()}setBackgroundImage(e){(new eh).load(e,(e=>{e.wrapS=v,e.wrapT=v,this.scene.background=e,this.signals.backgroundChanged.dispatch()}))}setSky(e={}){const{enabled:t=!0,position:n={x:0,y:0,z:0},scalar:i=45e4,turbidity:s=10,rayleigh:r=3,elevation:a=2,azimuth:o=180,exposure:l=.6}=e;if(!t)return void this.closeSky();this.sky||(this.sky=new fg,this.scene.add(this.sky)),this.sky.name="sky",this.sky.position.set(n.x,n.y,n.z),this.sky.scale.setScalar(i);const c=this.sky.material.uniforms;c.turbidity.value=s,c.rayleigh.value=r,c.mieCoefficient.value=.005,c.mieDirectionalG.value=.7;const h=new zt,d=Sp(90-a),u=Sp(o);return h.setFromSphericalCoords(1,d,u),c.sunPosition.value.copy(h),this.sky.userData.toneMapping=this.renderer.toneMapping,this.sky.userData.toneMappingExposure=this.renderer.toneMappingExposure,this.renderer.toneMapping=4,this.renderer.toneMappingExposure=l,this.signals.objectAdded.dispatch(),this.sky}closeSky(){if(!this.sky)return!1;const{toneMapping:e,toneMappingExposure:t}=this.sky.userData;return this.renderer.toneMapping=e,this.renderer.toneMappingExposure=t,this.sky.removeFromParent(),this.sky=null,this.signals.objectRemoved.dispatch(),!0}setEnvironment(){return this.scene.environment=this.pmremGenerator.fromScene(new dg,.04).texture,this.signals.sceneChanged.dispatch(),this.scene.environment}playModelAnimation(e,t){let n;if(t instanceof Dc?n=t:Am(t)?n=e.animations[t]:_m(t)&&(n=e.animations.find(t)),!n)return;const i=this.mixer.clipAction(n,e);return i.play(),this.state.animationTotal++,i}stopModelAnimation(e,t){let n;t instanceof Dc?n=t:Am(t)?n=e.animations[t]:_m(t)&&(n=e.animations.find(t)),n&&(this.mixer.uncacheAction(n,e),this.state.animationTotal--)}render(e){return Wp(this,void 0,void 0,(function*(){return yield null==e?void 0:e(),new Promise((e=>{this.signals.sceneRendered.addOnce(e),this.triggerRender()}))}))}triggerRender(e=1){this.state.useFreq=e}setPauseRender(e=!0){return Wp(this,void 0,void 0,(function*(){if(this.state.isPausedRender=e,!1===e)return this.render()}))}_passesObserver(){this.effectManager.updateEffectPass()}autoRender(e){if(this.state.useFreq<=0&&!nv.needsUpdate)return;if(this.state.useFreq>0&&this.state.useFreq--,nv.needsUpdate&&(nv.needsUpdate=!1),this.state.isPausedRender)return;iv=performance.now(),this.signals.beforeRender.dispatch(),this._passesObserver(),this.effectComposer.render();const t=this.scene.autoUpdate;this.scene.autoUpdate=!1,this.rendererCSS2D&&this.rendererManager.internalOptions.enableRenderCss2D&&this.rendererCSS2D.render(this.scene,this.camera),this.rendererCSS2DHalf&&this.rendererManager.internalOptions.enableRenderCss2DHalf&&this.rendererCSS2DHalf.render(this.scene,this.camera),this.rendererCSS3D&&this.rendererManager.internalOptions.enableRenderCss3D&&this.rendererCSS3D.render(this.scene,this.camera),this.options.showViewHelper&&this.camera===this.cameraManager.mainCamera&&this.viewHelper.render(this.renderer),this.scene.autoUpdate=t,this.postRender.forEach((t=>t(e))),sv=performance.now(),this.signals.sceneRendered.dispatch(sv-iv)}animate(e){this._loop=requestAnimationFrame((e=>{this.animate(e)}));const t=this.clock.getDelta();this.state.animationTotal>0&&(this.mixer.update(t),this.signals.modelAnimation.dispatch()),up.update()&&this.signals.tweenUpdate.dispatch(),this.postUpdate.forEach((t=>t(e))),this.autoRender(e),this.signals.getSceneInfo.dispatch(this.info.state)}getOffsetByPosition(e){const t=new zt(e.x,e.y,e.z).project(this.camera),n=this.renderer.domElement.getBoundingClientRect();return{left:Math.round(n.left+n.width/2*(t.x+1)),top:Math.round(n.top+n.height/2*(1-t.y))}}getPositionByOffset(e,t=.1){const n=new zt(0,0,0),i=new zt(0,0,0),s=this.renderer.domElement.getBoundingClientRect();i.set(e.offsetX/s.width*2-1,-e.offsetY/s.height*2+1,t),i.unproject(this.camera),i.sub(this.camera.position).normalize();const r=i.distanceTo(this.camera.position);return n.copy(this.camera.position).add(i.multiplyScalar(r)),n}getIntersects(e,t=this.scener.intersectsList.getAll(),n={}){const{isFilterHideObject:i}=n,s=this.container.getBoundingClientRect();let r={offsetX:0,offsetY:0};if(e instanceof MouseEvent)r={offsetX:e.clientX-s.left,offsetY:e.clientY-s.top};else if(e instanceof TouchEvent){const{changedTouches:t}=e;r={offsetX:t[0].clientX-s.left,offsetY:t[0].clientY-s.top}}else r=e;const a=new nt;a.set(r.offsetX/s.width*2-1,-r.offsetY/s.height*2+1);const o=new pd;o.setFromCamera(a,this.camera);let l=[];return l=Xm(t)?o.intersectObjects(t,!0):o.intersectObject(t,!0),i?l.filter((({object:e})=>Cp(e))):l}rayClash(e=this.camera.position,t=new zt(0,-1,0),n=this.scener.intersectsList.meshOfModelList){const i=new pd;return i.set(e,t),Xm(n)?i.intersectObjects(n,!0):i.intersectObject(n,!0)}setHoverEnabled(e){this.options.hoverEnabled=e}clearSignals(){for(const e in this.signals)this.signals[e].removeAll()}dispose(){return new Promise((e=>{cancelAnimationFrame(this._loop),this.controls.dispose(),up.removeAll(),Lg.dispose(),this.clearSignals(),this.scene.clear(),this.pmremGenerator.dispose(),this.effectComposer.dispose(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.container.remove(),this.state.isDisposed=!0,e()}))}_signalsEventListenr(){const e=()=>{const{offsetWidth:e,offsetHeight:t}=this.container;this.effectManager.updateCamera(this.camera),this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t),this.effectComposer.setSize(e,t),this.rendererCSS3D&&this.rendererCSS3D.setSize(e,t),this.rendererCSS2D&&this.rendererCSS2D.setSize(e,t),this.rendererCSS2DHalf&&this.rendererCSS2DHalf.setSize(e,t),this.triggerRender()};setTimeout((()=>e())),this.signals.windowResize.add(e),this.signals.cameraObjectChange.add(e),this.signals.sceneChanged.add((()=>this.triggerRender())),this.signals.backgroundChanged.add((()=>this.triggerRender())),this.signals.objectAdded.add((()=>this.triggerRender())),this.signals.objectRemoved.add((()=>this.triggerRender())),this.signals.objectChanged.add((()=>this.triggerRender())),this.signals.materialAdded.add((()=>this.triggerRender())),this.signals.materialRemoved.add((()=>this.triggerRender())),this.signals.materialChanged.add((()=>this.triggerRender())),this.signals.geometryChanged.add((()=>this.triggerRender())),this.signals.cameraChange.add((()=>this.triggerRender())),this.signals.tweenUpdate.add((()=>this.triggerRender())),this.signals.modelAnimation.add((()=>this.triggerRender()));this.signals.outlineChange.add((e=>{const{objects:t,options:n}=e,{color:i,hideColor:s,edgeThickness:r,edgeStrength:a}=Object.assign(Object.assign({},{color:16777215,hideColor:10066329,edgeThickness:3,edgeStrength:10}),n),{effectManager:o}=this,l=o.effectsMap.get(Hb.CONSTANTS.outlineEffect),c=t.length>0;l.enabled=c;const{effect:h}=l,{uniforms:d}=h,u=[];t.forEach((e=>{e.traverse((e=>{e instanceof Wi&&u.push(e)}))})),h.selection.set(u),h.blur=r>0,h.blurPass.kernelSize=r;const p=d.get("visibleEdgeColor"),m=d.get("hiddenEdgeColor"),f=d.get("edgeStrength");p&&p.value.set(i),m&&m.value.set(s),f&&(f.value=a),this.triggerRender()}))}_containerAddEventListener(e){const t=[0,0];let n=null;const i=s=>{var r,a;this.signals.mouseUp.dispatch(s);const o=s.offsetX-(null!==(r=null==n?void 0:n.offsetX)&&void 0!==r?r:0),l=s.offsetY-(null!==(a=null==n?void 0:n.offsetY)&&void 0!==a?a:0);if(Math.abs(o)>2||Math.abs(l)>2)return t[0]=0,void(t[1]=0);setTimeout((()=>{0!==t[0]&&0===t[1]&&(0===s.button?(this.signals.click.dispatch(s),this._triggerSceneEventInAllObject("click",s)):2===s.button&&(this.signals.rightClick.dispatch(s),this._triggerSceneEventInAllObject("rightClick",s))),t[0]=0,t[1]=0}),300),e.removeEventListener("mouseup",i,!1)};let s=!1,r=null,a=null;const o=[0,0],l=e=>{var t,n;r&&clearTimeout(r);const i=()=>{s=!1,o[0]=0,o[1]=0},l=e.changedTouches[0].clientX-(null!==(t=null==a?void 0:a.changedTouches[0].clientX)&&void 0!==t?t:0),c=e.changedTouches[0].clientY-(null!==(n=null==a?void 0:a.changedTouches[0].clientY)&&void 0!==n?n:0);Math.abs(l)>2||Math.abs(c)>2?i():s?(i(),this.signals.rightClick.dispatch(e),this._triggerSceneEventInAllObject("rightClick",e)):setTimeout((()=>{0!==o[0]&&0===o[1]?(this.signals.click.dispatch(e),this._triggerSceneEventInAllObject("click",e)):0!==o[0]&&0!==o[1]&&o[1]-o[0]<=300&&(this.signals.dblClick.dispatch(e),this._triggerSceneEventInAllObject("dblClick",e)),i()}),300)};e.addEventListener("mousedown",(s=>{n=s,this.signals.mouseDown.dispatch(s),0===t[0]?t[0]=performance.now():0===t[1]&&(t[1]=performance.now()),e.addEventListener("mouseup",i,!1)}),!1),e.addEventListener("mousemove",(e=>{this.signals.mouseMove.dispatch(e),this.options.hoverEnabled&&this._triggerSceneEventInAllObject("hover",e)}),!1),e.addEventListener("dblclick",(e=>{this.signals.dblClick.dispatch(e),this._triggerSceneEventInAllObject("dblClick",e)}),!1),e.addEventListener("wheel",(e=>{this.signals.mouseWheel.dispatch(e)}),{passive:!0}),e.addEventListener("touchstart",(t=>{0===o[0]?o[0]=performance.now():0===o[1]&&(o[1]=performance.now()),a=t,r&&clearTimeout(r),r=setTimeout((()=>{s=!0}),800),e.addEventListener("touchend",l,{once:!0})}),{passive:!0}),e.addEventListener("contextmenu",(e=>e.preventDefault()),!1),document.addEventListener("keydown",(e=>{this.signals.keyDown.dispatch(e)}),!1),document.addEventListener("keyup",(e=>{this.signals.keyUp.dispatch(e)}),!1)}_triggerSceneEventInAllObject(e,t){const n=this.getIntersects(t,this.scener.intersectsList.getAll());if(0===n.length)return this.selectModel&&this.signals.modelHover.numListeners>0&&this.signals.modelUnHover.dispatch(this.selectModel),this.selectPoi&&this.signals.poiHover.numListeners>0&&this.signals.poiUnHover.dispatch(this.selectPoi),this.selectModel=null,this.selectPoi=null,void this.signals.sceneClick.dispatch({type:e,event:t});"click"===e&&n.length>0&&this.signals.selectPosition.dispatch(n[0].point);const i={object:null,type:null},s=[],r=[];function a(e){return e.parent?"Model"===e.parent.stype?e.parent:a(e.parent):void 0}n.forEach((e=>{if(e.object.parent instanceof gv){const t=e.object.parent;if(Cp(t)){i.object||(i.type="Poi",i.object=e.object);-1===s.findIndex((e=>e.poi.uuid===t.uuid))&&s.push({poi:t,sourceData:e})}}else if(e.object instanceof Zn){const t=a(e.object);t&&Cp(t)&&(i.object||(i.type="Model",i.object=e.object),r.push({model:t,sourceData:e}))}}));const o=e.slice(0,1).toUpperCase()+e.slice(1),l=e=>{var n;const{model:s}=e[0];if(s)if("Hover"===o)(null===(n=this.selectModel)||void 0===n?void 0:n.uuid)!==s.uuid&&(this.signals.modelHover.dispatch({target:s,currentTarget:i.object,intersects:e,event:t}),this.selectModel=s);else{let n=null;"Click"===o?(n=s.onClick,s.dispatchEvent({type:"click"})):"RightClick"===o?(n=s.onRightClick,s.dispatchEvent({type:"rightClick"})):"DblClick"===o&&(n=s.onDblClick,s.dispatchEvent({type:"dblClick"})),n?n(s):s.isEventPropagation=!0,s.isEventPropagation&&(this.signals[`model${o}`].dispatch({target:s,currentTarget:i.object,intersects:e,event:t}),s.isEventPropagation=!1)}},c=e=>{var n;const{poi:i}=e[0];if(i)if("Hover"===o)(null===(n=this.selectPoi)||void 0===n?void 0:n.uuid)!==i.uuid&&(this.signals.poiHover.dispatch({target:i,event:t}),this.selectPoi=i);else{let e=null;"Click"===o?(e=i.onClick,i.dispatchEvent({type:"click"})):"RightClick"===o?(e=i.onRightClick,i.dispatchEvent({type:"rightClick"})):"DblClick"===o&&(e=i.onDblClick,i.dispatchEvent({type:"dblClick"})),e?e(i):i.isEventPropagation=!0,i.isEventPropagation&&(this.signals[`poi${o}`].dispatch({target:i,event:t}),i.isEventPropagation=!1)}};"Model"===i.type?l(r):"Poi"===i.type&&c(s)}}class av extends Wi{constructor(e,t,n,i="BaseMesh"){super(e,t);const{id:s,name:r="",level:a={max:null,min:null},visible:o=!0,position:l={x:0,y:0,z:0},rotation:c={x:0,y:0,z:0},scale:h={x:1,y:1,z:1},userData:d={}}=n;if(void 0===s)throw new Error("In soonspacejs: 空间对象实例化失败,缺少必要字段 'id'!");this.sid=s,this.name=r,this.stype=i,this.level=a,this.visible=null==o||o,this.handleHide=!o,this.position.set(l.x,l.y,l.z),this.rotation.set(c.x,c.y,c.z),this.scale.set(h.x,h.y,h.z),this.castShadow=!0,this.receiveShadow=!0,this.userData=d,this.isEventPropagation=!1,this.autoUpdate=!1}show(){this.visible=!0,this.handleHide=!1,this.autoUpdate=!0,nv.needsUpdate=!0}hide(){this.visible=!1,this.handleHide=!0,this.autoUpdate=!0,nv.needsUpdate=!0}setMove(e,t,n,i){return Nm(this.position,yp(e),t,n,i)}setRotate(e,t,n,i){const s=bp(e),r=this.quaternion.clone(),a=(new _t).setFromEuler(s);return Nm({t:0},{t:1},t,(({t:e},t)=>{this.quaternion.slerpQuaternions(r,a,e),null==n||n(this.rotation,t)}),i)}setScale(e,t,n,i){return Nm(this.scale,yp(e),t,n,i)}getBoundingBox(){return new Zt(new zt,new zt).setFromObject(this)}eventPropagation(){this.isEventPropagation=!0}sClone(e){return new av(this.geometry,this.material,{id:`clone_${Wm()}`}).sCopy(this,e)}sCopy(e,t=!0){if(this.name=e.name,this.stype=e.stype,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.geometry=e.geometry,this.material=e.material,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++)e.children[t]instanceof ov||e.children[t]instanceof av?this.add(e.children[t].sClone()):this.add(e.children[t].clone());return this}}class ov extends Zn{constructor(e,t="BaseObject3D"){super();const{id:n,name:i="",level:s={max:null,min:null},visible:r=!0,position:a={x:0,y:0,z:0},rotation:o={x:0,y:0,z:0},scale:l={x:1,y:1,z:1},userData:c={}}=e;if(void 0===n)throw new Error("In soonspacejs: 空间对象实例化失败,缺少必要字段 'id'!");this.sid=n,this.name=i,this.stype=t,this.level=s,this.visible=null==r||r,this.handleHide=!r,this.position.set(a.x,a.y,a.z),this.rotation.set(o.x,o.y,o.z),this.scale.set(l.x,l.y,l.z),this.castShadow=!0,this.receiveShadow=!0,this.userData=c,this.autoUpdate=!1}show(){this.visible=!0,this.handleHide=!1,this.autoUpdate=!0,nv.needsUpdate=!0}hide(){this.visible=!1,this.handleHide=!0,this.autoUpdate=!0,nv.needsUpdate=!0}setMove(e,t,n,i){return Nm(this.position,yp(e),t,n,i)}setRotate(e,t,n,i){const s=bp(e),r=this.quaternion.clone(),a=(new _t).setFromEuler(s);return Nm({t:0},{t:1},t,(({t:e},t)=>{this.quaternion.slerpQuaternions(r,a,e),null==n||n(this.rotation,t)}),i)}setScale(e,t,n,i){return Nm(this.scale,yp(e),t,n,i)}sClone(e){return new ov({id:`clone_${Wm()}`}).sCopy(this,e)}sCopy(e,t=!0){if(this.name=e.name,this.stype=e.stype,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];n instanceof ov||n instanceof av?this.add(n.sClone()):this.add(n.clone())}return this}getBoundingBox(){return new Zt(new zt,new zt).setFromObject(this)}getSpaceAttribute(e=!0){return Mp(this,e)}syncSpaceAttribute(e,t=!0){e instanceof ov?Lp(this,e,t):console.warn("In soonspacejs: BaseObject3D 对象原型方法 'syncSpaceAttribute' 第一个参数对象类型错误!",e)}}class lv extends ov{constructor(e){super(e,"SceneManage"),this.name=e.id.toString(),this.isSceneManage=!0}}class cv extends ov{constructor(e){super(e,"Group")}showAllChild(){this.children.forEach((e=>{e instanceof ov&&e.show()}))}hideAllChild(){this.children.forEach((e=>{e instanceof ov&&e.hide()}))}}class hv extends ov{constructor(e){super(e,"PluginObject")}}class dv extends ov{constructor(e){super(e,"PoiNode");const{type:t,element:n}=e;this.elementType=t,this.element=n,this.create(t)}create(e){"2D"===e||"2d"===e?this._create2D():"2.5D"===e||"2.5d"===e?this._create2DHalf():"3D"!==e&&"3d"!==e||this._create3D()}show(){this.visible=!0,this.handleHide=!1,this._setElementDisplay(!0),this.autoUpdate=!0}hide(){this.visible=!1,this.handleHide=!0,this._setElementDisplay(!1),this.autoUpdate=!0}getBoundingBox(e=50){e=e<=0?50:e;const t=new zt,n=new zt,i=new zt(e,e,e);return t.copy(this.position),n.copy(this.position),t.sub(i),n.add(i),new Zt(t,n)}_create2D(){this.add(new sy(this.element))}_create2DHalf(){this.add(new Sy(this.element))}_create3D(){this.add(new my(this.element))}_setElementDisplay(e){this.children.forEach((t=>{(t instanceof sy||t instanceof Sy||t instanceof my)&&("2D"===this.elementType||"2d"===this.elementType?t.visible=e:e&&"none"===t.element.style.display?t.element.style.display=t.userData.elDisplay||"block":e||"none"===t.element.style.display||(t.userData.elDisplay=t.element.style.display,t.element.style.display="none"))}))}}const uv={onLoad:null,onClick:null,onDblClick:null,onRightClick:null};class pv extends ov{constructor(e){super(e,"Model");const{format:t,onLoad:n,onClick:i,onDblClick:s,onRightClick:r}=Object.assign(Object.assign({},uv),e);this.formatType=t,this.isEventPropagation=!1,this.onLoad=(null==n?void 0:n.bind(this))||null,this.onClick=(null==i?void 0:i.bind(this))||null,this.onDblClick=(null==s?void 0:s.bind(this))||null,this.onRightClick=(null==r?void 0:r.bind(this))||null}eventPropagation(){this.isEventPropagation=!0}setEnvMap(e,t,n={}){Tp(e,t).then((e=>{this.traverse((t=>{if(t instanceof Wi&&t.material instanceof xc){const{reflectivity:i=.5}=n;t.material.envMap=e,t.material.envMapIntensity=i,nv.needsUpdate=!0}}))}))}sClone(e){return new pv({id:`${this.sid}_clone`,url:"",format:this.formatType}).sCopy(this,e)}}const mv={position:{x:0,y:0,z:0},scale:{x:16,y:16,z:1},stype:"Icon"};class fv extends io{constructor(e,t){super(e);const{position:n,scale:i,stype:s}=Object.assign(Object.assign({},mv),t);this.stype=s,this.position.set(n.x,n.y,n.z),this.scale.set(i.x,i.y,i.z),this.renderOrder=1}}class gv extends ov{constructor(e,t){super(t,"Poi"),this.isEventPropagation=!1;const{name:n,nameScale:i={x:16,y:16,z:1},onClick:s,onDblClick:r,onRightClick:a}=t;this.onClick=(null==s?void 0:s.bind(this))||null,this.onDblClick=(null==r?void 0:r.bind(this))||null,this.onRightClick=(null==a?void 0:a.bind(this))||null,this.icon=this._createIcon(e),this.text=null,this.name&&this._createText({position:{x:0,y:10,z:0},name:n,scale:i}),this.renderOrder=11}getBoundingBox(e=50){e=e<=0?50:e;const t=new zt,n=new zt,i=new zt(e,e,e);return t.copy(this.position),n.copy(this.position),t.sub(i),n.add(i),new Zt(t,n)}eventPropagation(){this.isEventPropagation=!0}sClone(e){return new gv(this.icon.material,{id:`${this.sid}_clone`,url:"",name:this.name}).sCopy(this,e)}_createIcon(e){const t=new fv(e);return this.add(t),t}_createText(e){const t=this._createCanvasText(e.name||""),n=new Lt(t);n.flipY=!0,n.version+=1;const i=new Ba({map:n,depthTest:!0});this.text=new fv(i,e),this.add(this.text)}_createCanvasText(e,t){const n=256,i=document.createElement("canvas");i.width=n,i.height=n;const s=i.getContext("2d"),{fontFamily:r,fontSize:a,color:o,textAlign:l,textBaseline:c}=Object.assign(Object.assign({},{fontFamily:"Microsoft YaHei",fontSize:32,color:"#fff",textAlign:"center",textBaseline:"bottom"}),t);return s&&(s.save(),s.font=a+"px "+r,s.textAlign=l,s.textBaseline=c,s.shadowColor="black",s.strokeStyle="black",s.lineWidth=3,s.fillStyle=o,s.strokeText(e,128,128),s.fillText(e,128,128),s.restore()),i}}class yv extends av{constructor(e,t="Point"){const{radius:n=10,color:i=16777215,opacity:s=1,gradient:r}=e;super(function(e){return new hc(e,32,32)}(n),function(e,t,n){return new Jn({color:e,opacity:t,transparent:t<1,map:Rp(n)})}(i,s,r),e,t)}setOptions(e){const{color:t,opacity:n,radius:i,position:s,gradient:r}=e,a=this.material;t&&(a.color=new bt(t)),n&&(a.opacity=n),i&&(this.geometry=new hc(i,32,32)),s&&this.position.copy(yp(s)),r&&(a.map=Rp(r)),a.needsUpdate=!0,nv.needsUpdate=!0}}class bv extends yv{constructor(e){super(e,"Node"),this.graphs=e.graphs}}class vv extends av{constructor(e){const{radius:t=50,color:n=16777215,opacity:i=1,gradient:s}=e;super(function(e){return new bl(e,64)}(t),function(e,t,n){return new Jn({color:e,opacity:t,transparent:t<1,side:2,map:Rp(n)})}(n,i,s),e,"Circle"),this.rotation.set(Math.PI/2,0,0)}setOptions(e){const{color:t,opacity:n,radius:i,position:s,gradient:r}=e,a=this.material;t&&(a.color=new bt(t)),n&&(a.opacity=n),i&&(this.geometry=new bl(i,64)),s&&this.position.copy(yp(s)),r&&(a.map=Rp(r)),a.needsUpdate=!0,nv.needsUpdate=!0}}class xv extends av{constructor(e){const{start:t,end:n,imgUrl:i,width:s=20,color:r=65280,opacity:a=1,animation:o=!1,passable:l=0,restrict:c=0}=e,h=yp(t),d=yp(n),u=h.distanceTo(d);super(function(e,t,n,i=new zt(0,1,0)){const s=n/2,r=new zt,a=new zt;r.subVectors(t,e),r.normalize(),a.crossVectors(r,i);const o=new zt(a.x*s,a.y*s,a.z*s),l=new zt(-a.x*s,-a.y*s,-a.z*s),c=new zt;c.addVectors(e,o);const h=new zt;h.addVectors(e,l);const d=new zt;d.addVectors(t,l);const u=new zt;u.addVectors(t,o);const p=new yi;return p.setAttribute("position",new li([c.x,c.y,c.z,h.x,h.y,h.z,d.x,d.y,d.z,d.x,d.y,d.z,u.x,u.y,u.z,c.x,c.y,c.z],3)),p.setAttribute("uv",new li([0,0,1,0,1,1,1,1,0,1,0,0],2)),p}(h,d,s),function(e,t,n,i,s,r){const a=new Jn({color:n,side:2,transparent:!0,opacity:i});let o;return s&&(o=(new eh).load(s,(n=>{o.repeat.set(1,e/(t*(n.image.height/n.image.width))*.63*(n.image.height/n.image.height)),a.color.set(16777215)})),o.wrapS=y,o.wrapT=y,o.flipY=!0,o.matrixAutoUpdate=!0,Rm(r)&&r?Nm(o.offset,{y:-1,x:0},{repeat:!0,duration:500}):Im(r)&&Nm(o.offset,{y:-1,x:0},Object.assign(Object.assign({},r),{repeat:!0})),a.map=o),a}(u,s,r,a,i,o),e,"Link"),this.passable=l,this.restrict=c}}class wv extends ov{constructor(e){super(e,"Topology");const{type:t="line"}=e;this.type=t,this.nodes=[],this.links=[],this.info=e,this.create()}create(){const{nodes:e,renderLink:t=!0,linkWidth:n=20,linkColor:i=65280,renderNode:s=!0,nodeColor:r=255,nodeRadius:a=n/2,imgUrl:o,animation:l=!1}=this.info,c=[];for(const h of e){const e=this.createNode(Object.assign(Object.assign({},h),{radius:a,color:r}));if(!1===s&&e.hide(),this.nodes.push(e),!o&&t){const e=Xm(i)?i[h.graphs[0].passable]?i[h.graphs[0].passable]:i[0]:i;!s&&this.createCircle({id:`${h.id}_circle`,name:`${h.name||h.id}_circle`,position:h.position,radius:n/2,color:e})}if(t)for(let e=0;e<h.graphs.length;e++){const{linkInfo:t,targetNodeId:s,passable:r,restrict:a}=h.graphs[e],{id:d,name:u}=t,p=this.info.nodes.find((e=>e.id===s));if(!c.includes(d)&&p){c.push(d);const e=Xm(i)?i[r]?i[r]:i[0]:i,t=this.createLink({id:d,name:u,start:h.position,end:p.position,width:n,color:e,imgUrl:o,animation:l,passable:r,restrict:a,userData:{startNodeId:h.id,endNodeId:p.id}});this.links.push(t)}}}}createNode(e){const t=new bv(Object.assign({},e));return this.add(t),t}createCircle(e){const t=new vv(Object.assign(Object.assign({},e),{rotation:{x:Math.PI/2,y:0,z:0}}));return this.add(t),t}createLink(e){const t=new xv(Object.assign({},e));return this.add(t),t}resetNodes(e){const{nodes:t,renderLink:n=!0,linkWidth:i=20,linkColor:s=65280,renderNode:r=!0,nodeColor:a=255,nodeRadius:o=i/2,imgUrl:l,animation:c=!1}=this.info,h=[],d=[...this.info.nodes];this.info.nodes=[...e];const u=[];for(let t=0;t<d.length;t++){const n=e.find((e=>e.id===d[t].id));(!n||yp(n.position).distanceTo(yp(d[t].position))>1)&&u.push(d[t])}for(let e=0;e<u.length;e++){const t=this.nodes.findIndex((t=>u[e].id===t.sid));this.remove(this.nodes[t]),this.nodes.splice(t,1)}const p=[];for(let t=0;t<e.length;t++){const n=d.find((n=>n.id===e[t].id));(!n||yp(n.position).distanceTo(yp(e[t].position))>1)&&p.push(e[t])}for(let e=0;e<p.length;e++){const t=this.createNode(Object.assign(Object.assign({},p[e]),{radius:i/2,color:a}));this.nodes.push(t)}const m=[];for(let e=0;e<d.length;e++)for(let t=0;t<d[e].graphs.length;t++)m.push(Object.assign(Object.assign({},d[e].graphs[t]),{sourceNodeId:d[e].id.toString()}));const f=[];for(let t=0;t<e.length;t++)for(let n=0;n<e[t].graphs.length;n++)f.push(Object.assign(Object.assign({},e[t].graphs[n]),{sourceNodeId:e[t].id.toString()}));for(let e=0;e<this.links.length;e++)this.remove(this.links[e]),this.links.splice(e,1);for(const t of e)if(n)for(let e=0;e<t.graphs.length;e++){const{linkInfo:n,targetNodeId:r,passable:a,restrict:o}=t.graphs[e],{id:d,name:u}=n,p=this.info.nodes.find((e=>e.id===r));if(!h.includes(d)&&p){h.push(d);const e=Xm(s)?s[a]?s[a]:s[0]:s,n=this.createLink({id:d,name:u,start:t.position,end:p.position,width:i,color:e,imgUrl:l,animation:c,passable:a,restrict:o});this.links.push(n)}}}getLength(){let e=0;for(let t=1;t<this.nodes.length;t++)e+=this.nodes[t].position.distanceTo(this.nodes[t-1].position);return e}}function Sv(e,t,n=new zt(0,1,0)){const i=t/2,s=new yi;let r=[],a=[];if(e.length<2)return s;for(let t=0;t<e.length-1;t++){const s=yp(e[t]),o=yp(e[t+1]),l=new zt,c=new zt;l.subVectors(o,s),l.normalize(),c.crossVectors(l,n);const h=new zt(c.x*i,c.y*i,c.z*i),d=new zt(-c.x*i,-c.y*i,-c.z*i),u=new zt;u.addVectors(s,h);const p=new zt;p.addVectors(s,d);const m=new zt;m.addVectors(o,d);const f=new zt;f.addVectors(o,h),r=[...r,u.x,u.y,u.z,p.x,p.y,p.z,m.x,m.y,m.z,m.x,m.y,m.z,f.x,f.y,f.z,u.x,u.y,u.z],a=[...a,0,0,1,0,1,1,1,1,0,1,0,0]}return s.setAttribute("position",new li(r,3)),s.setAttribute("uv",new li(a,2)),s}class Mv extends av{constructor(e,t="Line"){const{points:n,width:i=20,color:s=16777215,opacity:r=1,gradient:a}=e;super(Sv(n,i),function(e,t,n){return new Jn({color:e,side:2,transparent:t<1,opacity:t,map:Rp(n)})}(s,r,a),e,t),this.params=e,this.points=n,this.frustumCulled=!1}setOptions(e){var t;const{color:n,opacity:i,points:s,width:r,gradient:a}=e;this.points=s;const o=this.material;n&&(o.color=new bt(n)),i&&(o.opacity=i),a&&(o.map=Rp(a)),s&&r?this.geometry=Sv(s,r):s?this.geometry=Sv(s,null!==(t=this.params.width)&&void 0!==t?t:20):r&&(this.geometry=Sv(this.points,r)),o.needsUpdate=!0,nv.needsUpdate=!0}}function Lv(e){const t=[];for(let n=0;n<e.length;n++)t.push(new nt(e[n].x,e[n].z));return t.length>2?new cc(new Rl(t)):new yi}class Cv extends av{constructor(e,t="Polygon"){const{yHeight:n,points:i,color:s=16777215,opacity:r=1,gradient:a}=e;super(Lv(i),function(e,t,n){return new Jn({color:e,opacity:t,transparent:t<1,side:2,map:Rp(n)})}(s,r,a),e,t),this.points=i,this.position.set(0,n,0),this.rotation.set(Math.PI/2,0,0)}setOptions(e){const{color:t,opacity:n,yHeight:i,points:s,gradient:r}=e,a=this.material;t&&(a.color=new bt(t)),n&&(a.opacity=n),i&&this.position.set(0,i,0),s&&(this.geometry=Lv(s)),r&&(a.map=Rp(r)),a.needsUpdate=!0,nv.needsUpdate=!0}}class Gv extends ov{constructor(e){super(e,"Canvas3D"),this.create(e)}create(e){const{points:t=[],lines:n=[],polygons:i=[],circles:s=[]}=e;for(let e=0;e<t.length;e++)this.createPoint(t[e]);for(let e=0;e<n.length;e++)this.createLine(n[e]);for(let e=0;e<i.length;e++)this.createPolygon(i[e]);for(let e=0;e<s.length;e++)this.createCircle(s[e])}createPoint(e){const t=new yv(e);return this.add(t),nv.needsUpdate=!0,t}getPoint(e){return this.getChildForType("Point",e)}removePoint(e){const t=this.getPoint(e);t&&this.remove(t),nv.needsUpdate=!0}createLine(e){const t=new Mv(e);return this.add(t),nv.needsUpdate=!0,t}getLine(e){return this.getChildForType("Line",e)}removeLine(e){const t=this.getLine(e);t&&this.remove(t),nv.needsUpdate=!0}createPolygon(e){const t=new Cv(e);return this.add(t),nv.needsUpdate=!0,t}getPolygon(e){return this.getChildForType("Polygon",e)}removePolygon(e){const t=this.getPolygon(e);t&&this.remove(t),nv.needsUpdate=!0}createCircle(e){const t=new vv(e);return this.add(t),nv.needsUpdate=!0,t}getCircle(e){return this.getChildForType("Circle",e)}removeCircle(e){const t=this.getCircle(e);t&&this.remove(t),nv.needsUpdate=!0}getChildForType(e,t){for(let n=0;n<this.children.length;n++)if(this.children[n].stype===e&&this.children[n].sid===t)return this.children[n];return null}}class Tv extends av{constructor(e,t,n){super(e,t,n,"Ground")}}var Rv=Object.freeze({__proto__:null,BaseObject3D:ov,BaseMesh:av,SceneManage:lv,Group:cv,PluginObject:hv,PoiNode:dv,Model:pv,Poi:gv,Icon:fv,Topology:wv,Point:yv,Line:Mv,Polygon:Cv,Circle:vv,Node:bv,Link:xv,Canvas3D:Gv,Ground:Tv});class Av{constructor(e,t,n){this.type=e,this.scene=n,this.viewport=t}createGroup(e,t){const n=new cv(e);return null!==t&&this.viewport.scener.addObject(n,null!=t?t:this.scene),n}clear(){this.getAll().forEach((e=>{this.viewport.scener.removeObject(e)}))}getAll(){const e=[];return this.scene.traverse((t=>{((t instanceof ov||t instanceof av)&&Im(t)&&t.stype===this.type||Im(t)&&t.userData.stype===this.type)&&e.push(t)})),e}hideAll(){this.getAll().forEach((e=>{e.hide?e.hide():e.visible=!1})),this.viewport.signals.objectChanged.dispatch()}showAll(){this.getAll().forEach((e=>{e.show?e.show():e.visible=!0})),this.viewport.signals.objectChanged.dispatch()}}class Xv extends Av{constructor(e,t){super("Light",e,t),class{static init(){const e=[1,0,0,2e-5,1,0,0,503905e-9,1,0,0,.00201562,1,0,0,.00453516,1,0,0,.00806253,1,0,0,.0125978,1,0,0,.018141,1,0,0,.0246924,1,0,0,.0322525,1,0,0,.0408213,1,0,0,.0503999,1,0,0,.0609894,1,0,0,.0725906,1,0,0,.0852058,1,0,0,.0988363,1,0,0,.113484,1,0,0,.129153,1,0,0,.145839,1,0,0,.163548,1,0,0,.182266,1,0,0,.201942,1,0,0,.222314,1,0,0,.241906,1,0,0,.262314,1,0,0,.285754,1,0,0,.310159,1,0,0,.335426,1,0,0,.361341,1,0,0,.387445,1,0,0,.412784,1,0,0,.438197,1,0,0,.466966,1,0,0,.49559,1,0,0,.523448,1,0,0,.549938,1,0,0,.57979,1,0,0,.608746,1,0,0,.636185,1,0,0,.664748,1,0,0,.69313,1,0,0,.71966,1,0,0,.747662,1,0,0,.774023,1,0,0,.799775,1,0,0,.825274,1,0,0,.849156,1,0,0,.873248,1,0,0,.89532,1,0,0,.917565,1,0,0,.937863,1,0,0,.958139,1,0,0,.976563,1,0,0,.994658,1,0,0,1.0112,1,0,0,1.02712,1,0,0,1.04189,1,0,0,1.05568,1,0,0,1.06877,1,0,0,1.08058,1,0,0,1.09194,1,0,0,1.10191,1,0,0,1.11161,1,0,0,1.1199,1,0,0,1.12813,.999547,-4.48815e-7,.0224417,199902e-10,.999495,-113079e-10,.0224406,503651e-9,.999496,-452317e-10,.0224406,.00201461,.999496,-101772e-9,.0224406,.00453287,.999495,-180928e-9,.0224406,.00805845,.999497,-282702e-9,.0224406,.0125914,.999496,-407096e-9,.0224406,.0181319,.999498,-554114e-9,.0224406,.02468,.999499,-723768e-9,.0224406,.0322363,.999495,-916058e-9,.0224405,.0408009,.999499,-.00113101,.0224408,.050375,.999494,-.00136863,.0224405,.0609586,.999489,-.00162896,.0224401,.0725537,.999489,-.00191201,.0224414,.0851619,.999498,-.00221787,.0224413,.0987867,.999492,-.00254642,.0224409,.113426,.999507,-.00289779,.0224417,.129088,.999494,-.0032716,.0224386,.145767,.999546,-.0036673,.0224424,.163472,.999543,-.00408166,.0224387,.182182,.999499,-.00450056,.0224338,.201843,.999503,-.00483661,.0224203,.222198,.999546,-.00452928,.022315,.241714,.999508,-.00587403,.0224329,.262184,.999509,-.00638806,.0224271,.285609,.999501,-.00691028,.0224166,.309998,.999539,-.00741979,.0223989,.335262,.999454,-.00786282,.0223675,.361154,.999529,-.00811928,.0222828,.387224,.999503,-.00799941,.0221063,.41252,.999561,-.00952753,.0223057,.438006,.999557,-.0099134,.0222065,.466735,.999541,-.0100935,.0220402,.495332,.999562,-.00996821,.0218067,.523197,.999556,-.0105031,.0217096,.550223,.999561,-.0114191,.0217215,.579498,.999588,-.0111818,.0213357,.608416,.999633,-.0107725,.0208689,.635965,.999527,-.0121671,.0210149,.664476,.999508,-.0116005,.020431,.692786,.999568,-.0115604,.0199791,.719709,.999671,-.0121117,.0197415,.74737,.999688,-.0110769,.0188846,.773692,.99962,-.0122368,.0188452,.799534,.999823,-.0110325,.0178001,.825046,.999599,-.0114923,.0174221,.849075,.999619,-.0105923,.0164345,.872999,.999613,-.0105988,.0158227,.895371,.99964,-.00979861,.0148131,.917364,.99977,-.00967238,.0140721,.938002,.999726,-.00869175,.0129543,.957917,.99973,-.00866872,.0122329,.976557,.999773,-.00731956,.0108958,.994459,.999811,-.00756027,.0102715,1.01118,.999862,-.00583732,.00878781,1.02701,.999835,-.00631438,.00827529,1.04186,.999871,-.00450785,.00674583,1.05569,.999867,-.00486079,.00621041,1.06861,.999939,-.00322072,.00478301,1.08064,.999918,-.00318199,.00406395,1.09181,1.00003,-.00193348,.00280682,1.10207,.999928,-.00153729,.00198741,1.11152,.999933,-623666e-9,917714e-9,1.12009,1,-102387e-11,9.07581e-7,1.12813,.997866,-8.96716e-7,.0448334,199584e-10,.997987,-225945e-10,.0448389,502891e-9,.997987,-903781e-10,.0448388,.00201156,.997985,-203351e-9,.0448388,.00452602,.997986,-361514e-9,.0448388,.00804629,.997987,-56487e-8,.0448389,.0125724,.997988,-813423e-9,.0448389,.0181045,.997984,-.00110718,.0448387,.0246427,.997985,-.00144616,.0448388,.0321875,.997987,-.00183038,.044839,.0407392,.997983,-.00225987,.0448387,.0502986,.997991,-.00273467,.0448389,.0608667,.997984,-.00325481,.0448384,.0724444,.998002,-.00382043,.044839,.0850348,.997997,-.00443145,.0448396,.0986372,.998007,-.00508796,.0448397,.113255,.998008,-.00578985,.04484,.128891,.998003,-.00653683,.0448384,.145548,.997983,-.00732713,.0448358,.163221,.997985,-.00815454,.0448358,.181899,.998005,-.00898985,.0448286,.201533,.998026,-.00964404,.0447934,.221821,.998055,-.00922677,.044611,.241282,.99804,-.0117361,.0448245,.261791,.998048,-.0127628,.0448159,.285181,.998088,-.0138055,.0447996,.30954,.998058,-.0148206,.0447669,.334751,.998099,-.0156998,.044697,.36061,.998116,-.0161976,.0445122,.386603,.998195,-.015945,.0441711,.411844,.998168,-.0183947,.0444255,.43773,.998184,-.0197913,.0443809,.466009,.998251,-.0201426,.0440689,.494574,.998305,-.0198847,.0435632,.522405,.998273,-.0210577,.043414,.549967,.998254,-.0227901,.0433943,.578655,.998349,-.0223108,.0426529,.60758,.99843,-.0223088,.042,.635524,.998373,-.0241141,.0418987,.663621,.998425,-.0231446,.0408118,.691906,.998504,-.0233684,.0400565,.719339,.998443,-.0241652,.0394634,.74643,.99848,-.0228715,.0380002,.773086,.998569,-.023519,.0372322,.798988,.998619,-.0223108,.0356468,.824249,.998594,-.0223105,.034523,.848808,.998622,-.0213426,.0328887,.87227,.998669,-.0207912,.0314374,.895157,.998705,-.0198416,.0296925,.916769,.998786,-.0189168,.0279634,.937773,.998888,-.0178811,.0261597,.957431,.99906,-.0166845,.0242159,.976495,.999038,-.0155464,.0222638,.994169,.999237,-.0141349,.0201967,1.01112,.999378,-.0129324,.0181744,1.02692,.999433,-.0113192,.0159898,1.04174,.999439,-.0101244,.0140385,1.05559,.999614,-.00837456,.0117826,1.06852,.999722,-.00721769,.00983745,1.08069,.999817,-.00554067,.00769002,1.09176,.99983,-.00426961,.005782,1.10211,.999964,-.00273904,.00374503,1.11152,1.00001,-.00136739,.00187176,1.12031,.999946,393227e-10,-28919e-9,1.12804,.995847,-13435e-10,.0671785,19916e-9,.995464,-338387e-10,.0671527,501622e-9,.99547,-135355e-9,.0671531,.00200649,.995471,-30455e-8,.0671532,.00451461,.99547,-541423e-9,.0671531,.008026,.995471,-84598e-8,.0671531,.0125407,.99547,-.00121823,.0671531,.0180589,.99547,-.00165817,.0671531,.0245806,.995463,-.00216583,.0671526,.0321062,.995468,-.00274127,.0671527,.0406366,.995474,-.00338447,.0671534,.0501717,.995473,-.00409554,.0671533,.0607131,.995478,-.00487451,.0671531,.0722618,.995476,-.00572148,.0671532,.0848191,.995477,-.00663658,.0671539,.0983882,.995498,-.00761986,.0671541,.112972,.995509,-.00867094,.0671542,.128568,.995509,-.00978951,.0671531,.145183,.995503,-.0109725,.0671491,.162808,.995501,-.012211,.0671465,.181441,.99553,-.0134565,.0671371,.201015,.99555,-.014391,.0670831,.221206,.99558,-.014351,.0668883,.240813,.995577,-.0173997,.0671055,.261257,.995602,-.0191111,.0671178,.284467,.995623,-.0206705,.0670946,.308765,.995658,-.022184,.0670472,.333905,.995705,-.0234832,.0669417,.359677,.995719,-.0241933,.0666714,.385554,.995786,-.0243539,.066266,.410951,.995887,-.0271866,.0664367,.437163,.995944,-.0296012,.0664931,.464842,.996004,-.0301045,.0660105,.49332,.996128,-.0298311,.0652694,.521131,.996253,-.0316426,.0650739,.549167,.996244,-.0339043,.0649433,.57737,.996309,-.033329,.0638926,.606073,.996417,-.0338935,.0630849,.634527,.996372,-.0353104,.0625083,.66256,.996542,-.0348942,.0611986,.690516,.996568,-.0351614,.060069,.718317,.996711,-.0354317,.0588522,.74528,.996671,-.0349513,.0571902,.772061,.996865,-.0345622,.0555321,.798089,.996802,-.0342566,.0537816,.823178,.996992,-.0330862,.0516095,.847949,.996944,-.0324666,.0495537,.871431,.997146,-.0309544,.0470302,.894357,.997189,-.0299372,.0446043,.916142,.997471,-.0281389,.0418812,.937193,.997515,-.0268702,.0391823,.957,.997812,-.0247166,.0361338,.975936,.998027,-.0233525,.0333945,.99391,.998233,-.0209839,.0301917,1.01075,.998481,-.0194309,.027271,1.02669,.998859,-.0169728,.0240162,1.04173,.99894,-.0152322,.0210517,1.05551,.999132,-.0127497,.0178632,1.06856,.999369,-.0108282,.014787,1.08054,.999549,-.00845886,.0116185,1.09185,.999805,-.0063937,.00867209,1.10207,.99985,-.00414582,.00566823,1.1117,.999912,-.00207443,.00277562,1.12022,1.00001,870226e-10,-53766e-9,1.12832,.991943,-178672e-11,.0893382,198384e-10,.991952,-450183e-10,.089339,499849e-9,.991956,-180074e-9,.0893394,.0019994,.991955,-405167e-9,.0893393,.00449867,.991953,-720298e-9,.0893391,.00799764,.991955,-.00112548,.0893393,.0124964,.991957,-.0016207,.0893395,.0179951,.991958,-.00220601,.0893396,.0244939,.991947,-.00288137,.0893385,.0319929,.991962,-.00364693,.0893399,.0404933,.991965,-.00450264,.0893399,.049995,.99198,-.00544862,.0893411,.0604995,.99197,-.00648491,.0893397,.0720074,.991976,-.00761164,.089341,.0845207,.99198,-.00882891,.0893405,.0980413,.991982,-.0101367,.0893396,.112571,.992008,-.011535,.0893415,.128115,.992026,-.0130228,.0893414,.144672,.992064,-.0145966,.0893418,.162241,.992041,-.0162421,.0893359,.180801,.992086,-.0178888,.0893214,.200302,.992157,-.0190368,.0892401,.220332,.992181,-.0195584,.0890525,.240144,.992175,-.0227257,.0892153,.260728,.99221,-.0254195,.089304,.283473,.99222,-.0274883,.0892703,.307673,.992317,-.0294905,.0892027,.332729,.992374,-.0311861,.0890577,.358387,.992505,-.0320656,.0886994,.384102,.992568,-.0329715,.0883198,.409767,.992675,-.036006,.0883602,.436145,.992746,-.0392897,.0884591,.463217,.992873,-.0399337,.0878287,.491557,.992934,-.040231,.0870108,.519516,.993091,-.0422013,.0865857,.547741,.993259,-.0443503,.0861937,.575792,.993455,-.0446368,.0851187,.604233,.993497,-.0454299,.0840576,.632925,.993694,-.0463296,.0829671,.660985,.993718,-.0470619,.0817185,.688714,.993973,-.0468838,.0800294,.716743,.994207,-.046705,.0781286,.74377,.994168,-.0469698,.0763337,.77042,.9945,-.0456816,.0738184,.796659,.994356,-.0455518,.0715545,.821868,.994747,-.0439488,.0686085,.846572,.994937,-.0430056,.065869,.870435,.995142,-.0413414,.0626446,.893272,.995451,-.0396521,.05929,.915376,.995445,-.0378453,.0558503,.936196,.995967,-.0355219,.0520949,.956376,.996094,-.0335146,.048377,.975327,.996622,-.030682,.0442575,.993471,.996938,-.0285504,.0404693,1.01052,.997383,-.0253399,.0360903,1.02637,.997714,-.0231651,.0322176,1.04139,.998249,-.0198138,.0278433,1.05542,.998596,-.0174337,.0238759,1.06846,.998946,-.0141349,.0195944,1.08056,.99928,-.0115603,.0156279,1.09181,.999507,-.00839065,.0114607,1.10213,.999697,-.005666,.00763325,1.11169,.999869,-.00269902,.00364946,1.12042,1.00001,623836e-10,-319288e-10,1.12832,.987221,-222675e-11,.111332,197456e-10,.98739,-561116e-10,.111351,497563e-9,.987448,-224453e-9,.111357,.00199031,.987441,-505019e-9,.111357,.0044782,.987442,-897816e-9,.111357,.00796129,.987442,-.00140284,.111357,.0124396,.987444,-.00202012,.111357,.0179132,.987442,-.00274964,.111357,.0243824,.987446,-.00359147,.111357,.0318474,.987435,-.00454562,.111356,.0403086,.987461,-.00561225,.111358,.0497678,.987458,-.00679125,.111358,.0602239,.987443,-.0080828,.111356,.0716792,.987476,-.0094872,.111358,.0841364,.98749,-.0110044,.111361,.097597,.987508,-.0126344,.111362,.112062,.987494,-.0143767,.111357,.127533,.987526,-.0162307,.111359,.144015,.987558,-.0181912,.111361,.161502,.987602,-.0202393,.111355,.179979,.987692,-.022273,.111346,.199386,.987702,-.0235306,.111215,.219183,.987789,-.0247628,.111061,.239202,.987776,-.0280668,.111171,.259957,.987856,-.0316751,.111327,.282198,.987912,-.0342468,.111282,.306294,.988,-.0367205,.111198,.331219,.988055,-.0387766,.110994,.356708,.988241,-.0397722,.110547,.382234,.988399,-.0416076,.110198,.408227,.988539,-.0448192,.110137,.434662,.988661,-.0483793,.110143,.461442,.988967,-.0495895,.109453,.489318,.989073,-.0506797,.108628,.517516,.989274,-.0526953,.108003,.545844,.989528,-.054578,.107255,.573823,.989709,-.0561503,.106294,.601944,.989991,-.056866,.104896,.630855,.990392,-.0572914,.103336,.658925,.990374,-.0586224,.10189,.686661,.990747,-.0584764,.099783,.714548,.991041,-.0582662,.0974309,.74186,.991236,-.0584118,.0951678,.768422,.991585,-.0573055,.0921581,.794817,.991984,-.0564241,.0891167,.820336,.9921,-.0553608,.085805,.84493,.992749,-.0533816,.0820354,.868961,.99288,-.0518661,.0782181,.891931,.993511,-.0492492,.0738935,.914186,.993617,-.0471956,.0696402,.93532,.99411,-.044216,.0649659,.95543,.994595,-.0416654,.0603177,.974685,.994976,-.0384314,.0553493,.992807,.995579,-.0353491,.0503942,1.00996,.996069,-.0319787,.0452123,1.02606,.996718,-.028472,.0400112,1.04114,.997173,-.0250789,.0349456,1.05517,.997818,-.0213326,.029653,1.0683,.998318,-.0178509,.024549,1.0805,.998853,-.0141118,.0194197,1.09177,.999218,-.0105914,.0143869,1.1022,.999594,-.00693474,.00943517,1.11175,.99975,-.00340478,.00464051,1.12056,1.00001,109172e-9,-112821e-9,1.12853,.983383,-266524e-11,.133358,196534e-10,.981942,-671009e-10,.133162,494804e-9,.981946,-268405e-9,.133163,.00197923,.981944,-603912e-9,.133163,.00445326,.981941,-.00107362,.133162,.00791693,.981946,-.00167755,.133163,.0123703,.981944,-.00241569,.133162,.0178135,.981945,-.00328807,.133163,.0242466,.981945,-.00429472,.133162,.03167,.981955,-.00543573,.133164,.0400846,.981951,-.00671105,.133163,.0494901,.981968,-.00812092,.133165,.0598886,.981979,-.00966541,.133166,.0712811,.981996,-.0113446,.133168,.083669,.982014,-.0131585,.133169,.0970533,.982011,-.0151073,.133167,.111438,.982062,-.0171906,.133172,.126826,.9821,-.0194067,.133175,.143215,.982149,-.0217502,.133176,.160609,.982163,-.0241945,.133173,.178981,.982247,-.0265907,.133148,.198249,.982291,-.027916,.132974,.217795,.982396,-.0299663,.132868,.238042,.982456,-.0334544,.132934,.258901,.982499,-.0378636,.133137,.280639,.982617,-.0409274,.133085,.304604,.98274,-.0438523,.132985,.329376,.982944,-.0462288,.132728,.354697,.98308,-.0475995,.132228,.380102,.983391,-.0501901,.131924,.406256,.983514,-.0535899,.131737,.432735,.98373,-.0571858,.131567,.459359,.984056,-.0592353,.130932,.486637,.984234,-.0610488,.130092,.51509,.984748,-.0630758,.12923,.543461,.985073,-.0647398,.128174,.571376,.985195,-.0671941,.127133,.599414,.985734,-.0681345,.125576,.628134,.986241,-.0686089,.123639,.656399,.986356,-.0698511,.121834,.684258,.986894,-.0700931,.119454,.711818,.987382,-.0698321,.116718,.739511,.988109,-.0693975,.113699,.766267,.988363,-.0689584,.110454,.792456,.989112,-.0672353,.106602,.81813,.989241,-.0662034,.10267,.842889,.990333,-.0638938,.0981381,.867204,.990591,-.0618534,.0935388,.89038,.991106,-.0593117,.088553,.912576,.991919,-.0562676,.0832187,.934118,.992111,-.0534085,.0778302,.954254,.992997,-.0495459,.0720453,.973722,.993317,-.0463707,.0663458,.991949,.994133,-.0421245,.0601883,1.00936,.994705,-.0384977,.0542501,1.02559,.995495,-.0340956,.0479862,1.04083,.996206,-.030105,.041887,1.05497,.996971,-.0256095,.0355355,1.06824,.997796,-.0213932,.0293655,1.08056,.998272,-.0169612,.0232926,1.09182,.998857,-.0126756,.0172786,1.10219,.99939,-.00832486,.0113156,1.11192,.999752,-.00410826,.00557892,1.12075,1,150957e-9,-119101e-9,1.12885,.975169,-309397e-11,.154669,195073e-10,.975439,-779608e-10,.154712,491534e-9,.975464,-311847e-9,.154716,.00196617,.975464,-701656e-9,.154716,.00442387,.975462,-.0012474,.154715,.0078647,.975461,-.00194906,.154715,.0122886,.975464,-.00280667,.154715,.0176959,.975468,-.00382025,.154716,.0240867,.975471,-.00498985,.154716,.0314612,.975472,-.00631541,.154717,.0398199,.975486,-.00779719,.154718,.0491639,.975489,-.00943505,.154718,.0594932,.975509,-.0112295,.154721,.0708113,.97554,-.0131802,.154724,.0831176,.975557,-.0152876,.154726,.096415,.975585,-.0175512,.154728,.110705,.975605,-.0199713,.154729,.125992,.975645,-.0225447,.154729,.142272,.975711,-.0252649,.154735,.159549,.975788,-.0280986,.154736,.177805,.975872,-.0308232,.154704,.196911,.975968,-.0324841,.154525,.216324,.976063,-.0351281,.154432,.236628,.976157,-.0388618,.15446,.257539,.976204,-.0437704,.154665,.278975,.976358,-.047514,.154652,.302606,.976571,-.0508638,.154535,.327204,.976725,-.0534995,.154221,.352276,.977013,-.0555547,.153737,.377696,.977294,-.0586728,.153403,.403855,.977602,-.0622715,.15312,.430333,.977932,-.0658166,.152755,.456855,.978241,-.0689877,.152233,.483668,.978602,-.0712805,.15132,.512097,.979234,-.0732775,.150235,.540455,.97977,-.075163,.148978,.568486,.979995,-.0778026,.147755,.596524,.98078,-.0791854,.146019,.624825,.981628,-.0799666,.143906,.653403,.982067,-.0808532,.141561,.681445,.98271,-.0816024,.139025,.708918,.983734,-.0812511,.135764,.736594,.98431,-.0806201,.132152,.763576,.985071,-.0801605,.12846,.789797,.98618,-.0784208,.124084,.815804,.986886,-.0766643,.1193,.840869,.987485,-.0747744,.114236,.864952,.988431,-.0716701,.108654,.888431,.988886,-.0691609,.102994,.910963,.990024,-.0654048,.0967278,.932629,.990401,-.0619765,.090384,.95313,.991093,-.0579296,.0837885,.972587,.992018,-.0536576,.0770171,.991184,.992536,-.0493719,.0701486,1.00863,.993421,-.0444813,.062953,1.02494,.993928,-.040008,.0560455,1.04017,.994994,-.0347982,.04856,1.05463,.995866,-.0301017,.0416152,1.06807,.996916,-.0248225,.0342597,1.08039,.997766,-.0199229,.0271668,1.09177,.998479,-.0147422,.0201387,1.10235,.99921,-.00980173,.0131944,1.11206,.999652,-.0047426,.00640712,1.12104,.999998,891673e-10,-10379e-8,1.12906,.967868,-351885e-11,.175947,193569e-10,.968001,-886733e-10,.175972,487782e-9,.96801,-354697e-9,.175973,.00195115,.968012,-798063e-9,.175974,.00439006,.968011,-.00141879,.175973,.00780461,.968011,-.00221686,.175973,.0121948,.968016,-.00319231,.175974,.0175607,.968019,-.00434515,.175974,.0239027,.968018,-.00567538,.175974,.0312208,.968033,-.00718308,.175977,.0395158,.968049,-.00886836,.175979,.0487885,.968047,-.0107312,.175978,.0590394,.968072,-.0127719,.175981,.0702705,.968108,-.0149905,.175986,.0824836,.968112,-.0173866,.175985,.0956783,.968173,-.0199611,.175993,.109862,.96827,-.0227128,.176008,.125033,.968292,-.025639,.17601,.141193,.968339,-.0287299,.176007,.158336,.968389,-.0319399,.176001,.176441,.968501,-.034941,.175962,.195359,.968646,-.0370812,.175793,.214686,.968789,-.0402329,.175708,.234973,.96886,-.0442601,.1757,.255871,.969013,-.049398,.175876,.277238,.969242,-.0539932,.17594,.300326,.969419,-.0577299,.175781,.324702,.969763,-.0605643,.175432,.349527,.970093,-.0634488,.174992,.374976,.970361,-.0670589,.174611,.401097,.970825,-.0708246,.174226,.427496,.971214,-.0742871,.173684,.453858,.971622,-.0782608,.173186,.480637,.972175,-.0813151,.172288,.508655,.972944,-.0832678,.170979,.536973,.973595,-.0855964,.169573,.565138,.974345,-.0882163,.168152,.593222,.975233,-.0901671,.166314,.621201,.976239,-.0912111,.163931,.649919,.977289,-.0916959,.161106,.678011,.978076,-.0927061,.158272,.705717,.979533,-.0925562,.15475,.733228,.980335,-.0918159,.150638,.760454,.981808,-.0908508,.146201,.786918,.983061,-.0896172,.141386,.812953,.984148,-.0871588,.135837,.838281,.985047,-.0850624,.130135,.862594,.986219,-.0818541,.123882,.88633,.987043,-.0784523,.117126,.908952,.988107,-.0749601,.110341,.930744,.988955,-.0703548,.102885,.951728,.989426,-.0662798,.0954167,.971166,.990421,-.0610834,.0876331,.989984,.991032,-.0562936,.0797785,1.00765,.992041,-.0508154,.0718166,1.02434,.992794,-.0454045,.0637125,1.03976,.993691,-.0398194,.0555338,1.05418,.994778,-.0341482,.0473388,1.06772,.995915,-.028428,.0391016,1.08028,.997109,-.022642,.0309953,1.09185,.998095,-.0168738,.0230288,1.10247,.998985,-.0111274,.0150722,1.11229,.999581,-.00543881,.00740605,1.12131,1.00003,162239e-9,-105549e-9,1.12946,.959505,-393734e-11,.196876,191893e-10,.959599,-992157e-10,.196895,483544e-9,.959641,-396868e-9,.196903,.0019342,.959599,-892948e-9,.196895,.00435193,.959603,-.00158747,.196896,.0077368,.959604,-.00248042,.196896,.0120888,.959605,-.00357184,.196896,.0174082,.959605,-.00486169,.196896,.0236949,.959613,-.00635008,.196897,.0309497,.959619,-.00803696,.196898,.0391725,.959636,-.00992255,.196901,.0483649,.959634,-.0120067,.1969,.0585266,.959675,-.0142898,.196906,.0696609,.959712,-.0167717,.196911,.0817678,.959752,-.0194524,.196918,.0948494,.959807,-.0223321,.196925,.10891,.959828,-.0254091,.196924,.123947,.959906,-.0286815,.196934,.139968,.960005,-.0321371,.196944,.156968,.960071,-.0357114,.196936,.17491,.960237,-.0389064,.196882,.193597,.960367,-.041623,.196731,.21285,.960562,-.0452655,.196654,.233075,.960735,-.0496207,.196643,.253941,.960913,-.0549379,.196774,.275278,.961121,-.0603414,.196893,.297733,.96139,-.0644244,.196717,.321877,.961818,-.067556,.196314,.346476,.962175,-.0712709,.195917,.371907,.96255,-.0752848,.1955,.397916,.963164,-.0792073,.195026,.424229,.963782,-.0828225,.194424,.450637,.964306,-.0873119,.193831,.477288,.964923,-.0911051,.192973,.504716,.966048,-.093251,.19151,.533053,.967024,-.0958983,.190013,.561366,.968038,-.09835,.188253,.589464,.969152,-.100754,.186257,.617433,.970557,-.102239,.183775,.645801,.972104,-.102767,.180645,.674278,.973203,-.103492,.177242,.702004,.975123,-.103793,.17345,.729529,.97641,-.102839,.168886,.756712,.978313,-.101687,.163892,.783801,.980036,-.100314,.158439,.809671,.981339,-.097836,.152211,.835402,.982794,-.0950006,.145679,.860081,.984123,-.0920994,.138949,.883757,.984918,-.0878641,.131283,.90685,.985999,-.083939,.123464,.928786,.987151,-.0791234,.115324,.94983,.987827,-.0739332,.106854,.96962,.988806,-.0688088,.0982691,.98861,.989588,-.0628962,.0893456,1.00667,.990438,-.0573146,.0805392,1.02344,.991506,-.0509433,.0713725,1.03933,.992492,-.0448724,.0623732,1.05378,.993663,-.0383497,.0530838,1.06747,.994956,-.0319593,.0439512,1.08007,.99634,-.025401,.0347803,1.09182,.99761,-.0189687,.0257954,1.1025,.99863,-.0124441,.0169893,1.11247,.99947,-.00614003,.00829498,1.12151,1.00008,216624e-9,-146107e-9,1.12993,.950129,-434955e-11,.217413,190081e-10,.950264,-10957e-8,.217444,47884e-8,.9503,-438299e-9,.217451,.00191543,.950246,-986124e-9,.21744,.00430951,.950246,-.00175311,.21744,.00766137,.950245,-.00273923,.21744,.011971,.950253,-.00394453,.217441,.0172385,.950258,-.00536897,.217442,.0234641,.950267,-.00701262,.217444,.030648,.950277,-.00887551,.217446,.038791,.950284,-.0109576,.217446,.0478931,.950312,-.0132591,.217451,.0579568,.950334,-.01578,.217454,.0689821,.950378,-.0185204,.217462,.0809714,.950417,-.0214803,.217467,.0939265,.950488,-.0246594,.217479,.10785,.950534,-.0280565,.217483,.122743,.950633,-.0316685,.217498,.138611,.950698,-.0354787,.217499,.155442,.950844,-.0394003,.217507,.173208,.950999,-.0426812,.217419,.191605,.951221,-.0461302,.217317,.21084,.951412,-.0502131,.217238,.230945,.951623,-.0549183,.21722,.251745,.951867,-.0604493,.217306,.273001,.952069,-.0665189,.217466,.294874,.952459,-.0709179,.217266,.318732,.952996,-.0746112,.216891,.34318,.953425,-.0789252,.216503,.36849,.953885,-.0833293,.216042,.394373,.954617,-.087371,.215469,.420505,.955429,-.0914054,.214802,.446907,.956068,-.0961671,.214146,.473522,.957094,-.10048,.213286,.50052,.958372,-.103248,.211796,.528715,.959654,-.106033,.21016,.557065,.961305,-.108384,.208149,.585286,.962785,-.111122,.206024,.613334,.964848,-.112981,.203442,.641334,.966498,-.113717,.19996,.669955,.968678,-.114121,.196105,.698094,.970489,-.114524,.191906,.725643,.972903,-.113792,.186963,.752856,.974701,-.112406,.181343,.780013,.976718,-.110685,.175185,.806268,.978905,-.108468,.168535,.832073,.980267,-.105061,.161106,.857149,.981967,-.101675,.153387,.881145,.983063,-.0974492,.145199,.904255,.984432,-.0925815,.136527,.926686,.985734,-.0877983,.127584,.947901,.986228,-.081884,.118125,.968111,.98719,-.0761208,.108594,.98719,.988228,-.0698196,.0989996,1.00559,.989046,-.0632739,.0890074,1.02246,.990242,-.056522,.0790832,1.03841,.991252,-.0495272,.0689182,1.05347,.992542,-.0425373,.0588592,1.06724,.994096,-.0353198,.0486833,1.08009,.995593,-.028235,.0385977,1.09177,.99711,-.0209511,.0286457,1.10274,.998263,-.0139289,.0188497,1.11262,.999254,-.0067359,.009208,1.12191,.999967,141846e-9,-657764e-10,1.13024,.935608,-474692e-11,.236466,187817e-10,.93996,-11971e-8,.237568,473646e-9,.939959,-478845e-9,.237567,.0018946,.939954,-.0010774,.237566,.00426284,.939956,-.00191538,.237566,.00757842,.939954,-.00299277,.237566,.0118413,.93996,-.00430961,.237567,.0170518,.939969,-.00586589,.237569,.02321,.939982,-.00766166,.237572,.0303164,.939987,-.00969686,.237572,.0383711,.939997,-.0119715,.237574,.0473751,.940031,-.0144858,.237581,.0573298,.940073,-.0172399,.237589,.0682366,.94012,-.0202335,.237598,.080097,.940162,-.0234663,.237604,.0929116,.940237,-.0269387,.237615,.106686,.940328,-.0306489,.237632,.121421,.940419,-.0345917,.237645,.137115,.940522,-.0387481,.237654,.153766,.940702,-.0429906,.237661,.17133,.940871,-.0465089,.237561,.189502,.941103,-.050531,.23748,.208616,.941369,-.0550657,.237423,.228595,.941641,-.0601337,.237399,.249287,.941903,-.0658804,.237443,.270467,.942224,-.0722674,.237597,.292024,.942633,-.0771788,.237419,.315272,.943172,-.0815623,.237068,.339579,.943691,-.0863973,.236682,.364717,.944382,-.0911536,.236213,.390435,.945392,-.0952967,.235562,.416425,.946185,-.0998948,.234832,.442772,.947212,-.104796,.234114,.469347,.948778,-.10928,.233222,.496162,.950149,-.113081,.231845,.523978,.951989,-.115893,.230005,.552295,.953921,-.11846,.227862,.580569,.955624,-.12115,.225439,.608698,.958234,-.123373,.222635,.636696,.960593,-.124519,.219093,.665208,.963201,-.124736,.214749,.693557,.965642,-.125012,.210059,.721334,.968765,-.124661,.204935,.748613,.971753,-.122996,.198661,.776224,.973751,-.120998,.191823,.802461,.976709,-.118583,.184359,.828399,.977956,-.115102,.176437,.853693,.979672,-.111077,.167681,.877962,.981816,-.10688,.158872,.901564,.98238,-.101469,.149398,.924057,.983964,-.0960013,.139436,.945751,.984933,-.0899626,.12943,.966272,.985694,-.0832973,.11894,.985741,.986822,-.0767082,.108349,1.00407,.987725,-.0693614,.0976026,1.02154,.98877,-.06211,.086652,1.03757,.990129,-.0544143,.0756182,1.05296,.991337,-.046744,.0645753,1.06683,.992978,-.0387931,.0534683,1.0798,.994676,-.030973,.0424137,1.09181,.99645,-.0230311,.0314035,1.10286,.997967,-.0152065,.0206869,1.11291,.99922,-.00744837,.010155,1.12237,1.00002,240209e-9,-752767e-10,1.13089,.922948,-515351e-11,.255626,186069e-10,.928785,-129623e-9,.257244,468009e-9,.928761,-51849e-8,.257237,.00187202,.928751,-.0011666,.257235,.00421204,.928751,-.00207395,.257234,.0074881,.928754,-.00324055,.257235,.0117002,.92876,-.00466639,.257236,.0168486,.928763,-.00635149,.257237,.0229334,.928774,-.00829584,.257239,.029955,.928791,-.0104995,.257243,.0379139,.928804,-.0129623,.257245,.0468108,.928847,-.0156846,.257255,.0566473,.92889,-.0186661,.257263,.0674246,.928924,-.0219067,.257268,.0791433,.928989,-.0254066,.257282,.0918076,.92909,-.0291651,.257301,.105419,.92918,-.0331801,.257316,.119978,.92929,-.0374469,.257332,.135491,.929453,-.041939,.257357,.151948,.929586,-.0464612,.257347,.169275,.929858,-.0503426,.257269,.187257,.930125,-.0548409,.257199,.206204,.930403,-.0598063,.257149,.22601,.930726,-.0652437,.257122,.246561,.931098,-.0712376,.257153,.267618,.931396,-.0777506,.257237,.288993,.931947,-.0832374,.257124,.311527,.932579,-.0883955,.25683,.335697,.933194,-.0937037,.256444,.360634,.934013,-.0987292,.255939,.386126,.935307,-.103215,.255282,.412018,.936374,-.108234,.254538,.438292,.93776,-.113234,.253728,.464805,.939599,-.118013,.25275,.491464,.941036,-.122661,.251404,.518751,.94337,-.125477,.249435,.547133,.945318,-.128374,.247113,.575456,.947995,-.130996,.244441,.60372,.950818,-.133438,.241352,.63174,.954378,-.135004,.237849,.659971,.957151,-.135313,.233188,.688478,.960743,-.13521,.228001,.716767,.964352,-.135007,.222249,.744349,.967273,-.133523,.21542,.771786,.969767,-.131155,.208039,.798639,.973195,-.128492,.200076,.824774,.975557,-.125094,.191451,.850222,.977692,-.120578,.18184,.874761,.98026,-.115882,.172102,.898497,.981394,-.110372,.161859,.921636,.982386,-.10415,.15108,.943467,.983783,-.0978128,.140407,.964045,.98422,-.0906171,.129058,.98398,.985447,-.0832921,.117614,1.00276,.986682,-.0754412,.10585,1.02047,.987326,-.0673885,.0940943,1.03678,.988707,-.0592565,.0822093,1.05218,.990185,-.050717,.070192,1.06652,.991866,-.0423486,.0582081,1.07965,.993897,-.0336118,.0460985,1.09188,.995841,-.0252178,.0342737,1.10307,.997605,-.0164893,.0224829,1.11324,.999037,-.00817112,.0110647,1.12262,1.00003,291686e-9,-168673e-9,1.13139,.915304,-552675e-11,.275999,183285e-10,.91668,-139285e-9,.276414,461914e-9,.916664,-55713e-8,.276409,.00184763,.916653,-.00125354,.276406,.00415715,.916651,-.00222851,.276405,.00739053,.916655,-.00348205,.276406,.0115478,.916653,-.00501414,.276405,.0166291,.916667,-.00682478,.276409,.0226346,.91668,-.00891398,.276412,.0295648,.91669,-.0112817,.276413,.0374199,.916727,-.013928,.276422,.0462016,.916759,-.0168528,.276429,.0559101,.916793,-.0200558,.276436,.0665466,.916849,-.0235373,.276448,.0781139,.916964,-.0272973,.276474,.0906156,.917047,-.0313344,.276491,.104051,.917152,-.0356465,.276511,.118424,.917286,-.0402271,.276533,.133736,.917469,-.0450408,.276564,.149978,.917686,-.0497872,.276563,.167057,.917953,-.0540937,.276493,.184846,.918228,-.0590709,.276437,.203614,.918572,-.0644277,.276398,.223212,.918918,-.0702326,.276362,.243584,.919356,-.076484,.276383,.264465,.919842,-.0830808,.276434,.285701,.920451,-.0892972,.276407,.307559,.921113,-.095016,.276128,.331501,.921881,-.100771,.275754,.356207,.923027,-.106029,.275254,.381477,.924364,-.111029,.274595,.40722,.925818,-.116345,.273841,.433385,.92746,-.121424,.272913,.459848,.929167,-.12657,.271837,.486493,.931426,-.131581,.270575,.513432,.934001,-.135038,.268512,.541502,.936296,-.138039,.266135,.569658,.939985,-.140687,.263271,.598375,.943516,-.143247,.260058,.626563,.94782,-.145135,.256138,.654711,.951023,-.145733,.251154,.683285,.955338,-.145554,.245562,.711831,.959629,-.145008,.239265,.739573,.963123,-.144003,.232064,.767027,.966742,-.141289,.224036,.794359,.969991,-.138247,.215305,.820361,.973403,-.134786,.206051,.846548,.975317,-.129966,.195914,.871541,.977647,-.12471,.185184,.895313,.980137,-.119086,.174161,.918398,.981031,-.112297,.162792,.940679,.982037,-.105372,.150952,.961991,.983164,-.097821,.138921,.981913,.983757,-.0897245,.126611,1.00109,.985036,-.0815974,.114228,1.01902,.986289,-.0727725,.101389,1.03604,.987329,-.0639323,.0886476,1.05149,.989193,-.0548109,.0756837,1.06619,.990716,-.045687,.0627581,1.07948,.992769,-.0364315,.0498337,1.09172,.99524,-.0271761,.0370305,1.1033,.997154,-.0179609,.0243959,1.11353,.998845,-.00878063,.0119567,1.12319,1.00002,259038e-9,-108146e-9,1.13177,.903945,-591681e-11,.295126,181226e-10,.903668,-148672e-9,.295037,455367e-9,.903677,-594683e-9,.29504,.00182145,.903673,-.00133805,.295039,.00409831,.903666,-.00237872,.295036,.00728584,.903668,-.00371676,.295037,.0113842,.903679,-.00535212,.29504,.0163936,.903684,-.00728479,.295041,.0223141,.903698,-.00951473,.295044,.0291462,.903718,-.0120419,.295049,.0368904,.903754,-.0148664,.295058,.0455477,.903801,-.017988,.29507,.0551194,.903851,-.0214064,.295082,.0656058,.903921,-.0251219,.295097,.0770109,.904002,-.0291337,.295116,.0893354,.904111,-.033441,.29514,.102583,.904246,-.0380415,.295169,.116755,.904408,-.0429258,.295202,.131853,.904637,-.0480468,.295245,.147869,.904821,-.0529208,.295214,.164658,.905163,-.0577748,.295185,.182274,.905469,-.0631763,.295143,.200828,.905851,-.068917,.295112,.2202,.906322,-.0750861,.295104,.240372,.906761,-.0815855,.295086,.261082,.90735,-.0882138,.295095,.282123,.908087,-.095082,.295139,.303563,.908826,-.101488,.29492,.327028,.909832,-.107577,.294577,.351464,.911393,-.113033,.294115,.376497,.912804,-.118629,.293446,.402115,.914081,-.124232,.292581,.428111,.91637,-.129399,.29166,.454442,.91814,-.134892,.290422,.481024,.921179,-.140069,.289194,.507924,.924544,-.144431,.287421,.535557,.927995,-.147498,.284867,.563984,.931556,-.150197,.281722,.5923,.935777,-.152711,.278207,.620832,.940869,-.154836,.274148,.649069,.945994,-.155912,.269057,.677746,.949634,-.155641,.262799,.706293,.955032,-.154809,.256097,.734278,.95917,-.153678,.248618,.761751,.962931,-.151253,.239794,.789032,.966045,-.147625,.230281,.815422,.96971,-.143964,.220382,.841787,.972747,-.139464,.209846,.867446,.975545,-.133459,.198189,.892004,.978381,-.127424,.186362,.915458,.979935,-.120506,.173964,.937948,.980948,-.11282,.161429,.959732,.982234,-.104941,.148557,.980118,.982767,-.0962905,.135508,.999463,.983544,-.0873625,.122338,1.01756,.984965,-.0783447,.108669,1.03492,.986233,-.0684798,.0949911,1.05087,.987796,-.0590867,.0811386,1.0656,.989885,-.0489145,.0673099,1.0794,.991821,-.0391,.0535665,1.09174,.99448,-.029087,.0397529,1.10341,.996769,-.019114,.0261463,1.11383,.998641,-.00947007,.0128731,1.1237,.999978,446316e-9,-169093e-9,1.13253,.888362,-627064e-11,.312578,178215e-10,.889988,-157791e-9,.313148,448451e-9,.889825,-631076e-9,.313092,.00179356,.88984,-.00141994,.313097,.00403554,.889828,-.0025243,.313092,.00717429,.889831,-.00394421,.313093,.0112099,.889831,-.00567962,.313093,.0161425,.889844,-.00773051,.313096,.0219724,.889858,-.0100968,.3131,.0286999,.889882,-.0127786,.313106,.0363256,.889918,-.0157757,.313116,.0448509,.889967,-.0190878,.313129,.0542758,.89003,-.022715,.313145,.0646032,.890108,-.0266566,.313165,.0758339,.890218,-.0309131,.313193,.0879729,.890351,-.0354819,.313226,.101019,.89051,-.0403613,.313263,.114979,.890672,-.0455385,.313294,.129848,.890882,-.0509444,.313333,.145616,.891189,-.0559657,.313324,.162122,.891457,-.0613123,.313281,.179524,.891856,-.0671488,.313281,.197855,.892312,-.0732732,.313268,.216991,.892819,-.0797865,.313263,.236924,.893369,-.0865269,.313247,.257433,.894045,-.0931592,.313205,.278215,.894884,-.100532,.313276,.299467,.895832,-.107716,.313205,.322276,.897043,-.114099,.312873,.34642,.898515,-.119941,.312331,.371187,.900191,-.126044,.311731,.396656,.90188,-.131808,.310859,.422488,.904359,-.137289,.309857,.448744,.906923,-.142991,.308714,.475239,.910634,-.148253,.307465,.501983,.914502,-.153332,.305774,.529254,.919046,-.156646,.303156,.557709,.923194,-.159612,.299928,.586267,.928858,-.162027,.296245,.614925,.934464,-.164203,.291832,.643187,.939824,-.165602,.286565,.671601,.944582,-.165383,.280073,.700213,.949257,-.164439,.272891,.728432,.954389,-.162953,.264771,.756082,.958595,-.161007,.255927,.78369,.962138,-.157243,.245769,.810769,.966979,-.152872,.235127,.836999,.969566,-.148209,.22347,.862684,.972372,-.142211,.211147,.887847,.975916,-.135458,.198606,.911843,.978026,-.128398,.185498,.934795,.979686,-.120313,.17171,.956787,.980748,-.11166,.158159,.978046,.981622,-.103035,.144399,.997693,.982356,-.0930328,.13001,1.01642,.983308,-.0834627,.115778,1.03366,.985037,-.0732249,.101327,1.05014,.986493,-.0628145,.086554,1.06507,.988484,-.0526556,.0720413,1.07907,.991051,-.0415744,.0571151,1.09189,.993523,-.0314275,.0426643,1.10369,.99628,-.0203603,.0279325,1.11423,.998344,-.0102446,.0138182,1.12421,.999997,42612e-8,-193628e-9,1.1333,.871555,-660007e-11,.329176,174749e-10,.875255,-166579e-9,.330571,441051e-9,.875644,-666394e-9,.330718,.00176441,.875159,-.00149903,.330536,.00396899,.87516,-.00266493,.330536,.007056,.875158,-.00416393,.330535,.0110251,.87516,-.00599598,.330535,.0158764,.875163,-.00816108,.330536,.0216101,.875174,-.0106591,.330538,.0282266,.875199,-.0134899,.330545,.0357266,.875257,-.0166538,.330563,.0441117,.875304,-.0201501,.330575,.0533821,.875373,-.0239785,.330595,.0635395,.875464,-.0281389,.330619,.0745872,.875565,-.0326301,.330645,.0865255,.875691,-.0374516,.330676,.0993599,.875897,-.0425993,.330733,.113093,.876091,-.0480576,.330776,.127722,.876353,-.0537216,.330826,.143227,.876649,-.0589807,.330809,.159462,.877034,-.0647865,.330819,.176642,.877443,-.0709789,.330817,.194702,.877956,-.0774782,.330832,.213577,.878499,-.0843175,.330822,.233246,.879144,-.0912714,.330804,.253512,.879982,-.0980824,.330766,.274137,.88097,-.105823,.330864,.295209,.882051,-.113671,.330896,.317226,.883397,-.120303,.330545,.341068,.884987,-.12667,.330068,.365613,.886789,-.133118,.329418,.390807,.889311,-.139024,.328683,.416494,.891995,-.144971,.327729,.442618,.895106,-.150747,.326521,.469131,.899527,-.156283,.325229,.495921,.90504,-.161707,.32378,.523162,.909875,-.165661,.32122,.55092,.91561,-.168755,.317942,.579928,.921225,-.171193,.313983,.608539,.927308,-.17319,.309636,.636854,.933077,-.174819,.304262,.66523,.938766,-.175002,.297563,.693609,.943667,-.173946,.289613,.722157,.949033,-.172221,.281227,.750021,.953765,-.169869,.271545,.777466,.95804,-.166578,.261034,.804853,.962302,-.161761,.249434,.831569,.966544,-.156636,.237484,.857779,.969372,-.150784,.224395,.883051,.972486,-.143672,.210786,.907864,.975853,-.135772,.196556,.931223,.977975,-.127942,.182307,.954061,.979122,-.118347,.167607,.97531,.980719,-.109112,.152739,.995666,.981223,-.0991789,.137932,1.01475,.98216,-.0883553,.122692,1.03253,.983379,-.0780825,.107493,1.04917,.985434,-.0665646,.0917791,1.06464,.987332,-.0557714,.0764949,1.07896,.990004,-.0442805,.060721,1.09199,.992975,-.0331676,.0452284,1.10393,.995811,-.0219547,.0297934,1.11476,.9982,-.0107613,.0146415,1.12484,1.00002,248678e-9,-14555e-8,1.13413,.859519,-693595e-11,.347264,171673e-10,.859843,-17503e-8,.347394,433219e-9,.859656,-700076e-9,.347319,.00173277,.859671,-.00157517,.347325,.00389875,.859669,-.00280028,.347324,.00693112,.85967,-.0043754,.347324,.01083,.859665,-.00630049,.347321,.0155954,.859685,-.0085755,.347328,.0212278,.859694,-.0112003,.347329,.0277273,.859718,-.0141747,.347336,.0350946,.85976,-.0174988,.347348,.0433314,.85982,-.0211722,.347366,.0524384,.859892,-.0251941,.347387,.0624168,.860006,-.0295649,.347422,.0732708,.860122,-.0342825,.347453,.0849999,.860282,-.0393462,.347499,.0976102,.860482,-.0447513,.347554,.111104,.860719,-.0504775,.347614,.125479,.860998,-.0563577,.347666,.140703,.861322,-.0619473,.347662,.156681,.861724,-.0681277,.347684,.173597,.862198,-.0746567,.347709,.191371,.862733,-.0815234,.347727,.209976,.863371,-.0886643,.347744,.229351,.86414,-.0957908,.347734,.24934,.865138,-.102912,.34772,.269797,.866182,-.110924,.3478,.290654,.867436,-.119223,.347911,.312074,.869087,-.126197,.347649,.335438,.870859,-.133145,.347222,.359732,.872997,-.139869,.346645,.38467,.875939,-.146089,.345935,.41019,.879012,-.152334,.345012,.436218,.883353,-.15821,.343924,.462641,.888362,-.164097,.342636,.489449,.895026,-.169528,.341351,.516629,.900753,-.174408,.339115,.544109,.906814,-.17751,.335809,.572857,.912855,-.180101,.331597,.601554,.919438,-.182116,.32698,.630198,.925962,-.183494,.321449,.658404,.931734,-.184159,.314595,.686625,.93762,-.18304,.306462,.71531,.943858,-.181323,.297514,.744272,.948662,-.178683,.287447,.771462,.953299,-.175379,.276166,.798593,.957346,-.170395,.263758,.8256,.962565,-.165042,.251019,.852575,.966075,-.158655,.237011,.878316,.969048,-.151707,.222518,.90329,.972423,-.143271,.207848,.927745,.975833,-.134824,.192463,.950859,.977629,-.125444,.1768,.972947,.978995,-.114949,.161033,.993263,.980533,-.104936,.145523,1.01337,.980745,-.0935577,.129799,1.03128,.981814,-.0822956,.113486,1.04825,.983943,-.0710082,.0972925,1.06405,.986141,-.0587931,.0808138,1.0785,.988878,-.0472755,.0644915,1.09204,.992132,-.0349128,.0478128,1.10413,.9953,-.0232407,.031621,1.11527,.998117,-.0112713,.0154935,1.12551,1.00003,339743e-9,-195763e-9,1.13504,.845441,-729126e-11,.364305,169208e-10,.843588,-183164e-9,.363506,425067e-9,.843412,-73253e-8,.36343,.00169999,.843401,-.00164818,.363426,.00382495,.843399,-.00293008,.363425,.00679993,.843401,-.00457822,.363425,.010625,.843394,-.00659249,.363421,.0153002,.843398,-.00897282,.363421,.0208258,.843415,-.0117191,.363426,.0272024,.843438,-.0148312,.363432,.0344305,.843483,-.018309,.363447,.0425116,.84356,-.0221521,.363472,.0514471,.843646,-.0263597,.363499,.061238,.843743,-.0309315,.363527,.0718873,.84388,-.0358658,.363569,.0833969,.844079,-.0411624,.363631,.0957742,.844279,-.0468128,.363688,.109015,.844549,-.0527923,.363761,.123124,.844858,-.0588204,.363817,.138044,.84522,-.0647573,.36383,.153755,.845669,-.0713181,.363879,.170394,.846155,-.0781697,.363908,.187861,.846789,-.0853913,.363969,.206176,.847502,-.0928086,.363999,.225244,.8484,-.10005,.363997,.244926,.849461,-.107615,.364008,.265188,.850562,-.115814,.364055,.28587,.851962,-.124334,.364179,.306926,.854326,-.131995,.364233,.329605,.856295,-.139338,.363856,.35359,.858857,-.146346,.363347,.37831,.862428,-.152994,.362807,.403722,.866203,-.159463,.361963,.429537,.871629,-.165623,.36112,.456,.877365,-.171649,.359917,.482773,.883744,-.177151,.35848,.509705,.890693,-.182381,.356523,.537215,.897278,-.186076,.3533,.565493,.903958,-.188602,.349095,.594293,.910908,-.190755,.344215,.623165,.918117,-.192063,.338606,.651573,.924644,-.192758,.331544,.679869,.931054,-.192238,.323163,.708668,.937303,-.190035,.313529,.737201,.943387,-.187162,.303152,.764977,.948494,-.183876,.29146,.792683,.952546,-.178901,.277917,.819228,.958077,-.173173,.264753,.846559,.962462,-.16645,.25002,.872962,.966569,-.159452,.234873,.898729,.969108,-.15074,.218752,.923126,.973072,-.141523,.202673,.947278,.975452,-.132075,.186326,.969938,.977784,-.121257,.169396,.991325,.97899,-.110182,.153044,1.01123,.979777,-.0989634,.136485,1.0299,.980865,-.0865894,.119343,1.04727,.982432,-.0746115,.102452,1.06341,.984935,-.0621822,.0852423,1.07834,.987776,-.0495694,.0678546,1.092,.99103,-.0372386,.0506917,1.1043,.99474,-.0244353,.0333316,1.11576,.997768,-.0121448,.0164348,1.12617,1.00003,31774e-8,-169504e-9,1.13598,.825551,-756799e-11,.378425,165099e-10,.82664,-190922e-9,.378923,416504e-9,.826323,-763495e-9,.378779,.0016656,.826359,-.00171789,.378795,.00374768,.82636,-.00305402,.378795,.00666259,.826368,-.00477185,.378798,.0104104,.826364,-.00687131,.378795,.0149912,.826368,-.00935232,.378795,.0204054,.826376,-.0122146,.378797,.0266532,.826399,-.0154581,.378803,.0337355,.82646,-.0190825,.378824,.0416537,.826525,-.0230873,.378846,.0504091,.826614,-.0274719,.378876,.0600032,.82674,-.0322355,.378917,.0704393,.826888,-.0373766,.378964,.0817195,.827078,-.0428936,.379024,.0938492,.827318,-.0487778,.379099,.106828,.82764,-.0549935,.379199,.120659,.827926,-.0611058,.379227,.13526,.828325,-.0675054,.379275,.150713,.828801,-.0743455,.379332,.167034,.8294,-.0815523,.379415,.184209,.830094,-.0890779,.379495,.202203,.8309,-.096736,.379555,.220945,.831943,-.104135,.379577,.240306,.833037,-.112106,.379604,.260317,.834278,-.120554,.379668,.2808,.836192,-.129128,.3799,.301654,.838671,-.137541,.380109,.323502,.840939,-.14523,.379809,.347176,.844575,-.15248,.379593,.371706,.848379,-.159607,.37909,.39688,.853616,-.166267,.378617,.422702,.858921,-.172698,.377746,.448919,.865324,-.178823,.376749,.475661,.872207,-.184542,.375363,.502599,.880018,-.189836,.373657,.529914,.88694,-.194294,.370673,.557683,.894779,-.197022,.36662,.586848,.902242,-.199108,.36138,.615831,.909914,-.200398,.355434,.644478,.917088,-.20094,.348173,.672905,.923888,-.200671,.339482,.701327,.930495,-.198773,.32956,.730101,.937247,-.195394,.318363,.758383,.943108,-.191956,.306323,.786539,.948296,-.187227,.292576,.813637,.953472,-.181165,.278234,.840793,.958485,-.174119,.263054,.867712,.962714,-.166564,.246756,.893635,.966185,-.158181,.229945,.919028,.970146,-.148275,.212633,.943413,.973491,-.138157,.195229,.966627,.975741,-.127574,.178048,.988817,.977238,-.11554,.160312,1.00924,.978411,-.10364,.142857,1.02845,.979811,-.0913122,.125317,1.04648,.98116,-.0782558,.107627,1.06284,.983543,-.0655957,.0895862,1.07798,.986789,-.0520411,.0713756,1.092,.990292,-.0389727,.053228,1.10484,.994187,-.025808,.0351945,1.11642,.997499,-.0126071,.0173198,1.12703,.999999,275604e-9,-148602e-9,1.13674,.81075,-78735e-10,.394456,161829e-10,.808692,-198293e-9,.393453,407564e-9,.80846,-792877e-9,.39334,.00162965,.808595,-.00178416,.393407,.00366711,.808597,-.00317182,.393408,.00651934,.808598,-.00495589,.393408,.0101866,.808591,-.00713627,.393403,.0146689,.808592,-.00971285,.393402,.0199667,.80861,-.0126855,.393407,.0260803,.808633,-.0160538,.393413,.0330107,.80868,-.0198175,.393429,.0407589,.808748,-.0239758,.393453,.0493264,.808854,-.0285286,.39349,.0587161,.808992,-.0334748,.39354,.0689304,.809141,-.0388116,.393588,.0799707,.809352,-.0445375,.39366,.0918432,.809608,-.0506427,.393742,.104549,.809915,-.0570708,.393834,.118085,.810253,-.0633526,.393885,.132377,.810687,-.0700966,.393953,.147537,.811233,-.0772274,.394047,.163543,.811865,-.0847629,.394148,.180394,.812648,-.0925663,.394265,.198051,.813583,-.100416,.394363,.216443,.814683,-.108119,.394402,.235502,.815948,-.11644,.394489,.255242,.817278,-.125036,.394542,.275441,.819605,-.133655,.39486,.296094,.822256,-.142682,.395248,.317309,.825349,-.150756,.395241,.340516,.829605,-.158392,.395285,.364819,.83391,-.165801,.394922,.389736,.839808,-.172677,.394691,.415409,.845708,-.179448,.394006,.441546,.853025,-.185746,.393279,.46832,.859666,-.191684,.391655,.495302,.86789,-.197146,.390068,.52262,.875845,-.201904,.38727,.550336,.882634,-.205023,.382688,.578825,.891076,-.207098,.377543,.608103,.900589,-.208474,.371752,.63723,.90791,-.209068,.364016,.665769,.915971,-.208655,.355593,.694428,.923455,-.20729,.345439,.723224,.931514,-.203821,.334099,.751925,.937885,-.19986,.321069,.780249,.943136,-.194993,.306571,.8077,.948818,-.189132,.291556,.83497,.954433,-.181617,.275745,.86188,.959078,-.173595,.258695,.888562,.962705,-.164855,.240825,.914008,.966753,-.155129,.22268,.939145,.970704,-.144241,.204542,.963393,.973367,-.133188,.185927,.985983,.975984,-.121146,.167743,1.00704,.976994,-.108366,.149218,1.02715,.978485,-.0956746,.13131,1.0455,.980074,-.0820733,.112513,1.06221,.98225,-.0684061,.0938323,1.07782,.98553,-.0549503,.0749508,1.09199,.989529,-.0407857,.055848,1.10508,.993536,-.0271978,.0368581,1.11684,.997247,-.0132716,.0181845,1.12789,1,431817e-9,-198809e-9,1.13792,.785886,-812608e-11,.405036,157669e-10,.790388,-205278e-9,.407355,398297e-9,.790145,-820824e-9,.407231,.00159263,.790135,-.00184681,.407226,.00358336,.790119,-.00328316,.407218,.00637039,.790126,-.00512988,.40722,.0099539,.79013,-.00738684,.407221,.0143339,.790135,-.0100538,.407221,.0195107,.790134,-.0131306,.407217,.0254848,.79016,-.0166169,.407224,.0322572,.790197,-.020512,.407236,.0398284,.790273,-.0248157,.407263,.0482014,.790381,-.029527,.407304,.0573777,.790521,-.0346446,.407355,.0673602,.790704,-.0401665,.40742,.0781522,.790925,-.0460896,.407499,.0897582,.791195,-.0524017,.407589,.10218,.791522,-.0590121,.407691,.11541,.791878,-.0654876,.407748,.12939,.792361,-.0725207,.407849,.144237,.792942,-.0799844,.407963,.159924,.79362,-.0877896,.408087,.176425,.794529,-.0958451,.408259,.193733,.795521,-.103827,.408362,.211756,.796778,-.111937,.408482,.230524,.798027,-.120521,.408547,.249967,.799813,-.129242,.408721,.269926,.802387,-.138048,.409148,.290338,.805279,-.147301,.409641,.311193,.809251,-.155895,.410154,.333611,.813733,-.163942,.410297,.357615,.819081,-.171666,.410373,.382339,.825427,-.178905,.410348,.407828,.83172,-.185812,.409486,.434034,.83877,-.192318,.408776,.460493,.845817,-.198249,.407176,.487346,.854664,-.204034,.405719,.514832,.863495,-.208908,.403282,.542401,.871883,-.212765,.399293,.570683,.88065,-.214911,.393803,.599947,.89004,-.216214,.387536,.62932,.898476,-.216745,.379846,.658319,.906738,-.216387,.370625,.687138,.914844,-.215053,.360139,.71601,.923877,-.212007,.348849,.745124,.931925,-.207481,.335639,.773366,.938054,-.202418,.320798,.801636,.943895,-.196507,.304772,.829055,.949468,-.189009,.288033,.856097,.955152,-.180539,.270532,.88301,.959403,-.171437,.251639,.909296,.963309,-.161661,.232563,.934868,.967399,-.150425,.213231,.959662,.972009,-.138659,.194247,.98302,.97433,-.126595,.174718,1.00517,.975823,-.113205,.155518,1.02566,.976371,-.0996096,.136709,1.04418,.978705,-.0860754,.117571,1.06146,.981477,-.0714438,.0980046,1.07777,.984263,-.0572304,.0782181,1.09214,.988423,-.0428875,.0584052,1.10553,.993,-.0282442,.038522,1.11758,.99704,-.0140183,.0190148,1.12864,.999913,369494e-9,-145203e-9,1.13901,.777662,-84153e-10,.423844,154403e-10,.770458,-211714e-9,.419915,38845e-8,.770716,-846888e-9,.420055,.00155386,.770982,-.00190567,.420202,.00349653,.770981,-.00338782,.420201,.00621606,.77098,-.00529338,.4202,.00971274,.770983,-.00762223,.4202,.0139867,.770985,-.0103741,.420198,.0190381,.770996,-.0135489,.4202,.0248677,.771029,-.0171461,.420212,.0314764,.771052,-.0211647,.420215,.0388648,.771131,-.0256048,.420245,.047036,.771235,-.0304647,.420284,.0559911,.771383,-.0357436,.420341,.0657346,.771591,-.0414392,.420423,.0762694,.771819,-.0475462,.420506,.0875984,.772123,-.0540506,.420617,.099727,.772464,-.060797,.42072,.112637,.772855,-.0675393,.420799,.126313,.773317,-.0748323,.420893,.140824,.773981,-.0825681,.421058,.15617,.774746,-.0906307,.421226,.172322,.77566,-.0988982,.421397,.189253,.776837,-.106994,.421569,.206912,.778097,-.115528,.421704,.225359,.779588,-.124317,.421849,.24447,.781574,-.133139,.422097,.264156,.784451,-.142179,.422615,.284318,.787682,-.15165,.423269,.304902,.792433,-.160771,.424396,.3265,.797359,-.169166,.424772,.35014,.803986,-.177149,.425475,.374768,.809504,-.184745,.424996,.399928,.815885,-.19173,.424247,.425796,.823513,-.198525,.423515,.452287,.832549,-.204709,.422787,.479321,.841653,-.210447,.421187,.506718,.850401,-.215501,.418519,.53432,.859854,-.219752,.414715,.56242,.869364,-.222305,.409462,.591558,.878837,-.223744,.402926,.621074,.888636,-.224065,.395043,.650538,.898132,-.223742,.38564,.679538,.907181,-.222308,.375378,.708674,.915621,-.219837,.363212,.737714,.9239,-.215233,.349313,.767014,.931644,-.209592,.334162,.795133,.938887,-.203644,.317943,.823228,.945282,-.196349,.300581,.850822,.950758,-.18742,.282195,.877594,.956146,-.177879,.262481,.904564,.960355,-.167643,.242487,.930741,.965256,-.156671,.222668,.955868,.968029,-.144123,.201907,.979869,.97251,-.131305,.18202,1.00291,.974925,-.118335,.161909,1.02392,.975402,-.103714,.142129,1.0433,.976987,-.089415,.122447,1.06089,.979677,-.0748858,.102248,1.07713,.983184,-.0596086,.0814851,1.09218,.987466,-.0447671,.0609484,1.10585,.992348,-.0295217,.0401835,1.11829,.996674,-.0143917,.0198163,1.12966,1.00003,321364e-9,-149983e-9,1.1402,.757901,-869074e-11,.436176,151011e-10,.751195,-217848e-9,.432317,378533e-9,.751178,-871373e-9,.432307,.0015141,.751195,-.00196061,.432317,.0034068,.751198,-.00348552,.432318,.00605659,.751195,-.00544599,.432315,.00946353,.751207,-.00784203,.43232,.013628,.751213,-.0106732,.43232,.0185499,.751221,-.0139393,.432319,.0242302,.751244,-.0176398,.432325,.0306694,.7513,-.0217743,.432348,.0378698,.751358,-.0263412,.432367,.0458321,.751458,-.0313396,.432404,.0545587,.751608,-.0367682,.432464,.0640543,.7518,-.0426246,.43254,.0743222,.752065,-.0489031,.432645,.0853668,.752376,-.0555828,.432762,.0971911,.752715,-.0623861,.432859,.109768,.753137,-.069415,.432958,.123126,.753676,-.0770039,.433099,.137308,.754345,-.084971,.433272,.15229,.755235,-.0932681,.433504,.168075,.756186,-.10171,.433693,.184625,.757363,-.110019,.433857,.201897,.75884,-.11887,.434102,.220014,.760467,-.127881,.434306,.238778,.762969,-.136766,.434751,.258172,.765823,-.14612,.43529,.278062,.769676,-.15566,.436236,.298437,.774909,-.165177,.437754,.319532,.77994,-.17402,.438343,.342505,.785757,-.182201,.438609,.366693,.792487,-.190104,.438762,.391668,.80038,-.197438,.438795,.417494,.808494,-.204365,.438226,.443933,.817695,-.210714,.437283,.470929,.828111,-.216651,.436087,.498569,.837901,-.221804,.433717,.526165,.847813,-.226318,.430133,.554155,.858314,-.229297,.425213,.582822,.868891,-.230999,.418576,.612847,.878941,-.231155,.410405,.642445,.888809,-.230935,.400544,.672024,.898089,-.229343,.389613,.701366,.908081,-.226886,.377197,.730763,.916819,-.222676,.363397,.759642,.924968,-.216835,.347437,.788775,.932906,-.210245,.32995,.817135,.940025,-.202992,.312262,.844912,.946101,-.19436,.293313,.872164,.952835,-.184125,.273638,.899443,.957347,-.173657,.252385,.926389,.961434,-.162204,.231038,.951947,.965522,-.14979,.209834,.976751,.969412,-.136307,.188821,1.00022,.973902,-.122527,.168013,1.02229,.974045,-.108213,.147634,1.04199,.975775,-.0927397,.12705,1.06019,.978383,-.0778212,.106309,1.07711,.98211,-.0621216,.0849279,1.09245,.986517,-.0463847,.0633519,1.10651,.991696,-.0309353,.0419698,1.11903,.996349,-.0150914,.0206272,1.13073,1.00003,442449e-9,-231396e-9,1.14146,.727498,-885074e-11,.441528,145832e-10,.730897,-223525e-9,.443589,368298e-9,.730796,-893996e-9,.443528,.00147303,.730805,-.00201149,.443533,.00331433,.730814,-.00357596,.443538,.00589222,.730815,-.00558734,.443538,.00920678,.730822,-.00804544,.44354,.0132582,.730836,-.0109501,.443545,.0180468,.730848,-.0143008,.443546,.0235732,.730871,-.0180969,.443552,.0298382,.730915,-.022338,.443567,.0368438,.730982,-.0270225,.443591,.044591,.731076,-.0321491,.443627,.0530831,.731245,-.0377166,.443699,.0623243,.73144,-.0437216,.443777,.0723181,.7317,-.0501576,.443881,.0830691,.732034,-.0569942,.444014,.0945809,.732388,-.0638756,.444113,.106825,.732853,-.071203,.444247,.119859,.733473,-.0790076,.444442,.13369,.734195,-.0871937,.444645,.148304,.735069,-.095696,.444877,.163702,.736169,-.10426,.445133,.179861,.73747,-.112853,.44537,.196778,.738991,-.12199,.445651,.214496,.740865,-.131153,.445958,.232913,.743637,-.140245,.446548,.251977,.746797,-.149722,.447246,.271551,.751517,-.159341,.448656,.291774,.756156,-.169106,.449866,.312455,.761519,-.178436,.450919,.334552,.768295,-.186904,.451776,.358491,.776613,-.195117,.452832,.383446,.783966,-.202695,.45249,.408945,.793542,-.20985,.452587,.435364,.803192,-.216403,.451852,.462336,.813892,-.22251,.450708,.48987,.824968,-.227676,.4486,.517697,.835859,-.232443,.445156,.545975,.846825,-.235775,.440351,.574483,.858085,-.237897,.433641,.604246,.868825,-.238074,.425354,.634101,.879638,-.237661,.415383,.664201,.889966,-.236186,.404136,.693918,.899479,-.233599,.390917,.723481,.908769,-.229737,.376352,.75258,.917966,-.223836,.360372,.781764,.926304,-.217067,.342551,.811139,.934626,-.209309,.324238,.839585,.941841,-.20071,.304484,.867044,.94789,-.190602,.283607,.894579,.954196,-.179253,.262205,.921743,.958383,-.167646,.239847,.948026,.963119,-.155073,.218078,.973296,.966941,-.141426,.195899,.998135,.970836,-.126849,.174121,1.02021,.973301,-.112296,.153052,1.04085,.97448,-.0964965,.131733,1.05946,.977045,-.080489,.10997,1.07693,.980751,-.064844,.0881657,1.09254,.985475,-.0481938,.0657987,1.10697,.991089,-.0319185,.0435215,1.12004,.996122,-.0158088,.0214779,1.13173,1.00001,372455e-9,-200295e-9,1.14291,.708622,-907597e-11,.45304,141962e-10,.711162,-228911e-9,.454662,358052e-9,.709812,-914446e-9,.453797,.00143034,.709865,-.00205819,.453834,.00321935,.709864,-.00365894,.453833,.00572331,.709855,-.00571692,.453826,.00894278,.709862,-.00823201,.453828,.012878,.709875,-.011204,.453832,.0175295,.709896,-.0146323,.453839,.0228978,.709925,-.0185163,.453847,.0289839,.709974,-.0228551,.453866,.0357894,.710045,-.0276473,.453892,.0433161,.710133,-.032891,.453924,.0515665,.710292,-.0385851,.453992,.0605458,.710485,-.0447254,.45407,.0702574,.710769,-.0513051,.454192,.0807077,.711106,-.0582733,.454329,.091896,.711516,-.0652866,.45446,.103814,.712071,-.0728426,.454653,.116508,.712676,-.0808307,.45484,.129968,.713476,-.0892216,.455096,.144206,.714377,-.0979047,.455346,.159212,.715579,-.106531,.455647,.174973,.716977,-.115492,.455961,.191504,.71862,-.124821,.456315,.208835,.72084,-.134079,.4568,.226869,.723786,-.143427,.457521,.245582,.727464,-.153061,.458475,.264957,.732771,-.162768,.460239,.284948,.736515,-.172627,.460899,.30522,.743519,-.182487,.463225,.326717,.750041,-.191295,.464027,.350113,.758589,-.199746,.465227,.374782,.767703,-.207584,.465877,.400226,.777484,-.214973,.465996,.426442,.788792,-.221796,.466019,.453688,.800194,-.228038,.465083,.481246,.811234,-.233346,.462506,.509086,.822859,-.238073,.459257,.537338,.835082,-.241764,.454863,.566108,.846332,-.244241,.448163,.595126,.858355,-.244736,.439709,.625574,.87034,-.244278,.429837,.65617,.881027,-.24255,.418002,.686029,.891007,-.239912,.404325,.716039,.900874,-.236133,.389222,.745518,.911072,-.230672,.373269,.775026,.920359,-.22356,.355083,.804521,.928604,-.215591,.335533,.834045,.937175,-.206503,.315278,.861612,.942825,-.196684,.293653,.889131,.949805,-.185116,.271503,.916853,.955535,-.172703,.248821,.943541,.959843,-.159978,.225591,.970132,.964393,-.146375,.202719,.994709,.968008,-.131269,.179928,1.0186,.971013,-.11569,.158007,1.03928,.973334,-.1003,.13624,1.05887,.975775,-.0833352,.1138,1.07652,.979579,-.0668981,.0913141,1.09297,.984323,-.0500902,.0683051,1.10734,.990351,-.0332377,.0451771,1.12084,.995823,-.0161491,.0221705,1.13296,1.0001,234083e-9,-108712e-9,1.14441,.683895,-924677e-11,.46015,137429e-10,.68833,-233383e-9,.463134,346865e-9,.688368,-933547e-9,.463159,.00138748,.688367,-.00210049,.463159,.00312187,.688369,-.00373415,.463159,.00555004,.688377,-.00583449,.463163,.00867216,.688386,-.00840128,.463166,.0124884,.688398,-.0114343,.463169,.0169993,.688418,-.0149329,.463175,.0222054,.688453,-.0188964,.463188,.028108,.688515,-.0233239,.463214,.0347085,.68857,-.0282136,.463231,.0420091,.688679,-.033564,.463276,.0500132,.688854,-.0393733,.463356,.0587255,.689038,-.0456354,.46343,.0681476,.689321,-.0523433,.463553,.0782897,.689662,-.059412,.463693,.0891501,.690188,-.0665736,.4639,.100735,.690755,-.0743106,.464107,.113074,.691405,-.0824722,.464329,.126161,.692198,-.0910484,.464585,.140007,.693196,-.0998778,.464893,.154612,.69454,-.108651,.465285,.169984,.695921,-.117855,.465596,.186106,.697749,-.12734,.466056,.203034,.700375,-.136714,.466771,.220703,.703395,-.146386,.467579,.239062,.707904,-.156096,.469067,.258188,.711673,-.165904,.469851,.277759,.717489,-.175812,.471815,.297935,.724051,-.185931,.47389,.318916,.731965,-.195238,.47587,.341591,.741151,-.204021,.477523,.366062,.751416,-.212113,.478881,.391396,.761848,-.21979,.479226,.417599,.771886,-.2267,.478495,.444401,.783998,-.232991,.477622,.472084,.796523,-.238645,.475833,.500193,.808851,-.243396,.472568,.52865,.821191,-.247226,.467857,.557362,.834261,-.250102,.461871,.586768,.846762,-.251056,.453543,.617085,.859867,-.250604,.443494,.647659,.871948,-.248783,.431711,.678119,.882967,-.245855,.417911,.708399,.892826,-.242168,.401993,.738256,.90332,-.237062,.385371,.767999,.913633,-.22997,.366837,.798191,.922774,-.221687,.346372,.827756,.931371,-.212345,.325682,.856425,.938929,-.20206,.303665,.884299,.944821,-.190981,.280786,.912023,.951792,-.178065,.2573,.939669,.957712,-.164634,.233448,.96655,.961912,-.150863,.209504,.992366,.966382,-.13577,.18597,1.01633,.969588,-.119593,.162905,1.03843,.971777,-.103203,.14053,1.05841,.97433,-.0865888,.117909,1.07632,.978686,-.0690829,.0944101,1.09326,.983281,-.0516568,.0705671,1.10796,.989562,-.034558,.0468592,1.12182,.995465,-.0167808,.0229846,1.1342,.999991,373016e-9,-235606e-9,1.1459,.662251,-939016e-11,.468575,132714e-10,.666634,-237624e-9,.471675,335842e-9,.666411,-950385e-9,.471516,.00134321,.666399,-.00213833,.471509,.00302221,.666386,-.0038014,.471499,.00537283,.666405,-.00593958,.471511,.00839533,.666406,-.00855253,.471508,.0120898,.666428,-.0116401,.471519,.0164569,.666444,-.0152015,.471522,.0214971,.66649,-.0192362,.471543,.027212,.666537,-.0237428,.471558,.033603,.666617,-.0287198,.471591,.0406728,.666718,-.0341647,.471631,.0484238,.666889,-.0400759,.47171,.0568621,.667104,-.0464479,.471805,.0659915,.667374,-.0532677,.471923,.0758178,.667772,-.0603805,.472098,.0863425,.668371,-.0677392,.472363,.0975917,.668971,-.0756028,.472596,.109567,.669696,-.0839293,.472869,.122272,.670481,-.0926683,.473126,.135718,.6715,-.1016,.473442,.149914,.672911,-.110566,.47389,.164882,.674512,-.119984,.474354,.180602,.67651,-.129574,.474922,.19711,.679292,-.139106,.475764,.214371,.682798,-.148993,.476886,.232405,.686955,-.158737,.478179,.251153,.691406,-.168754,.479432,.270436,.697438,-.178703,.481481,.290374,.704761,-.188955,.484143,.311044,.713599,-.198814,.487007,.333003,.723194,-.207869,.488962,.357144,.732601,-.216189,.489815,.382169,.744193,-.22398,.490888,.408227,.754907,-.231156,.490355,.434928,.767403,-.23747,.489548,.462599,.78107,-.243503,.488274,.490908,.793893,-.248114,.484843,.519421,.807296,-.25222,.4803,.548561,.820529,-.255265,.474097,.577772,.833716,-.256741,.466041,.607782,.848403,-.25637,.456547,.638807,.860755,-.254804,.443946,.670058,.874012,-.251834,.430852,.700749,.885619,-.247867,.414903,.731446,.896069,-.242634,.397276,.761191,.906266,-.236093,.378535,.791053,.916759,-.227543,.358038,.821298,.92523,-.21783,.335705,.850747,.93436,-.207534,.313797,.879258,.941631,-.195983,.289671,.907734,.947564,-.183567,.265319,.935206,.953681,-.169345,.240815,.962739,.960008,-.154909,.216119,.989227,.964145,-.140161,.192096,1.01465,.968171,-.123411,.167855,1.03737,.969859,-.106525,.144817,1.05767,.972666,-.0891023,.12149,1.0761,.977055,-.0718094,.0975306,1.09336,.982527,-.0534213,.0730217,1.10878,.989001,-.0355579,.0483366,1.12285,.99512,-.0176383,.023938,1.13548,1.00007,368831e-9,-211581e-9,1.14744,.651047,-960845e-11,.484101,12922e-9,.644145,-241347e-9,.478968,324578e-9,.64396,-965142e-9,.478831,.00129798,.64396,-.00217154,.47883,.00292046,.643968,-.00386049,.478835,.00519202,.643974,-.00603186,.478838,.0081128,.643977,-.0086854,.478836,.011683,.643982,-.0118207,.478834,.0159031,.644024,-.0154374,.478856,.0207743,.644059,-.0195343,.478868,.0262975,.644122,-.0241103,.478896,.0324747,.644207,-.0291638,.478933,.039309,.64432,-.0346919,.478981,.0468029,.644481,-.0406919,.479053,.0549614,.644722,-.047159,.479169,.0637909,.645013,-.0540748,.479302,.0732974,.645503,-.0612001,.479541,.0834898,.646117,-.0687303,.479829,.0943873,.646707,-.0767846,.480061,.105991,.647431,-.0852465,.480343,.11831,.64831,-.0940719,.48066,.131348,.649486,-.103056,.481083,.14514,.650864,-.112261,.481528,.159676,.652604,-.121852,.482102,.174979,.654825,-.131505,.482813,.191079,.657876,-.141189,.483876,.207927,.661339,-.151239,.48499,.225586,.665463,-.161091,.486279,.243947,.670542,-.171235,.487968,.262957,.677361,-.181347,.49053,.282781,.685672,-.191679,.493862,.303311,.694551,-.201781,.49699,.324607,.703753,-.211164,.498884,.347916,.713703,-.219675,.500086,.372628,.725911,-.227836,.501554,.398694,.73862,-.23533,.502193,.425529,.752118,-.241786,.501811,.453209,.76579,-.247865,.500185,.481381,.779568,-.252696,.497159,.51011,.793991,-.256802,.492765,.539322,.808182,-.259942,.486827,.569078,.821698,-.261703,.478386,.598818,.836009,-.262006,.468772,.629762,.849824,-.260333,.456352,.661366,.863888,-.257398,.442533,.69295,.876585,-.253264,.426573,.723608,.888665,-.248026,.408964,.754378,.899537,-.241487,.389677,.784761,.9094,-.233463,.368516,.814688,.920166,-.223397,.346624,.845009,.928899,-.21255,.322717,.874431,.937156,-.200869,.298698,.902922,.943861,-.188387,.273491,.931356,.949557,-.174341,.247866,.958854,.955862,-.158994,.222496,.986098,.961721,-.143664,.197522,1.01229,.965976,-.127412,.17302,1.03571,.968652,-.109798,.148954,1.05699,.971084,-.0916787,.125044,1.07587,.975584,-.0739634,.100577,1.09372,.98122,-.055322,.0753666,1.10948,.988253,-.0366825,.0498899,1.12394,.99482,-.0180389,.024611,1.13694,1.00001,229839e-9,-188283e-9,1.14919,.613867,-964198e-11,.479449,123452e-10,.621485,-244534e-9,.485399,313091e-9,.621429,-978202e-9,.485353,.00125245,.62112,-.00220004,.485114,.00281687,.621119,-.0039111,.485112,.00500783,.621122,-.00611091,.485112,.00782498,.621133,-.00879922,.485117,.0112687,.621152,-.0119756,.485125,.0153394,.621183,-.0156396,.485139,.0200382,.621227,-.0197898,.485158,.0253663,.621298,-.0244253,.485192,.0313261,.621388,-.0295441,.485233,.0379204,.621507,-.0351432,.485286,.0451523,.621693,-.0412198,.485378,.0530277,.621933,-.0477673,.485495,.0615522,.622232,-.0547574,.485635,.0707316,.622809,-.0619417,.485943,.0805883,.623407,-.069625,.486232,.0911267,.62406,-.077796,.486516,.102354,.624835,-.0863731,.486838,.114279,.625758,-.095251,.487188,.126902,.627043,-.104299,.487695,.140285,.628438,-.113724,.488163,.154397,.630325,-.123417,.488858,.169267,.632801,-.133137,.489754,.184941,.635784,-.143052,.490815,.20136,.639406,-.153132,.492048,.218643,.643872,-.163143,.49363,.236615,.6499,-.17333,.496009,.255449,.657201,-.183622,.498994,.275006,.666221,-.194019,.502888,.295354,.674419,-.204192,.505459,.316244,.683729,-.21406,.507771,.33849,.695584,-.222854,.510245,.363166,.708583,-.231315,.512293,.389071,.721233,-.238911,.512747,.415737,.735134,-.245657,.512482,.443331,.750179,-.251879,.511526,.471891,.765073,-.256911,.508935,.500892,.779794,-.261144,.504341,.530294,.794801,-.264316,.498515,.560144,.810339,-.266276,.491015,.590213,.824818,-.266981,.481126,.620865,.839375,-.265778,.468685,.652687,.853043,-.262748,.453925,.684759,.867335,-.258474,.437912,.716209,.88037,-.253187,.419648,.747508,.891711,-.246476,.39982,.77797,.902896,-.238735,.37879,.808586,.913601,-.22885,.355891,.838843,.923019,-.217656,.331773,.869014,.933432,-.205539,.307356,.898512,.939691,-.192595,.281321,.9269,.946938,-.178945,.255441,.955297,.952372,-.163587,.229013,.983231,.95909,-.147214,.203179,1.00971,.963675,-.13064,.17792,1.03438,.968247,-.113121,.152898,1.05625,.97001,-.0945824,.128712,1.07598,.974458,-.0755648,.103349,1.094,.980168,-.0571998,.0776731,1.1104,.987295,-.0377994,.0514445,1.12491,.994432,-.0186417,.025429,1.13851,.999975,542714e-9,-282356e-9,1.15108,.592656,-980249e-11,.486018,119532e-10,.598467,-247275e-9,.490781,301531e-9,.597934,-988317e-9,.490343,.00120517,.597903,-.00222366,.490319,.0027116,.597913,-.00395315,.490327,.00482077,.597919,-.00617653,.490329,.00753264,.597936,-.00889375,.490339,.0108478,.597956,-.0121043,.490347,.0147668,.597992,-.0158073,.490365,.0192905,.598032,-.0200017,.490382,.0244204,.598109,-.0246865,.49042,.0301593,.598215,-.0298594,.490474,.03651,.59833,-.0355167,.490524,.0434757,.598525,-.0416559,.490624,.0510629,.598778,-.0482692,.490753,.0592781,.599135,-.0553114,.49094,.0681304,.599802,-.062542,.491328,.0776467,.600361,-.0703638,.491598,.0878184,.60101,-.0786256,.491882,.0986573,.601811,-.0872962,.492232,.11018,.602861,-.0962284,.492684,.1224,.604167,-.10538,.493213,.135354,.605693,-.114896,.493799,.149034,.607682,-.124654,.494576,.163469,.610672,-.13456,.4959,.178747,.613313,-.144581,.496713,.194723,.617603,-.154703,.498499,.211617,.622174,-.16489,.500188,.229183,.628855,-.175164,.503072,.247786,.636963,-.185565,.506798,.267116,.644866,-.195911,.509719,.28702,.653741,-.206104,.512776,.307763,.664942,-.216447,.516812,.329631,.67633,-.22552,.519181,.353515,.690012,-.234316,.521681,.379226,.704243,-.242032,.523129,.405901,.719396,-.249172,.523768,.433585,.734471,-.255543,.522541,.462085,.750539,-.260697,.520217,.491233,.766365,-.26501,.516293,.521094,.781677,-.268409,.509708,.551014,.797132,-.270399,.501944,.581463,.812655,-.271247,.492025,.612402,.828592,-.270708,.480424,.643798,.844044,-.268085,.465955,.67682,.857305,-.263459,.448425,.708496,.87114,-.258151,.430243,.74046,.884936,-.251171,.410578,.771583,.895772,-.243305,.38862,.802234,.906961,-.234037,.365214,.833179,.917775,-.222714,.34116,.86353,.927883,-.210175,.31572,.893557,.936617,-.196925,.289159,.922976,.943384,-.182788,.261996,.951606,.949713,-.167965,.235324,.979958,.955818,-.151109,.208408,1.00765,.961344,-.133834,.182591,1.03329,.965469,-.115987,.156958,1.0557,.968693,-.09746,.132239,1.07583,.973165,-.0778514,.106195,1.09451,.979387,-.0585067,.0797669,1.11137,.98671,-.0390409,.0530263,1.12643,.994093,-.019408,.0263163,1.14016,1.00002,540029e-9,-194487e-9,1.15299,.574483,-989066e-11,.494533,114896e-10,.574478,-249127e-9,.494528,289403e-9,.574607,-996811e-9,.494637,.00115797,.574396,-.00224241,.494458,.00260498,.574377,-.00398632,.49444,.00463102,.574386,-.00622836,.494445,.00723623,.574401,-.0089683,.494453,.010421,.574419,-.0122056,.49446,.0141859,.574459,-.0159396,.494481,.0185322,.574525,-.0201692,.49452,.0234617,.574587,-.0248924,.494547,.0289762,.574697,-.0301074,.494604,.0350797,.574853,-.0358114,.494688,.0417767,.575027,-.041999,.494772,.0490718,.575294,-.0486618,.494915,.0569728,.575733,-.0557148,.495173,.0654955,.576356,-.0630489,.495537,.0746612,.576944,-.0709285,.495836,.0844615,.57765,-.0792723,.496177,.0949142,.578491,-.0880167,.496563,.10603,.579639,-.0969462,.497096,.117841,.580989,-.10622,.497684,.130367,.582587,-.115861,.498337,.143609,.584951,-.125605,.499414,.157625,.587602,-.135608,.500518,.172413,.59076,-.145742,.501767,.187999,.594992,-.155934,.503542,.20445,.600656,-.166303,.506135,.221764,.607816,-.176681,.509542,.24002,.61522,-.187071,.51263,.258992,.623702,-.197465,.516021,.278773,.634192,-.207816,.520422,.299377,.644936,-.218183,.524073,.320802,.657888,-.2278,.528049,.34384,.670666,-.236747,.52986,.36916,.685626,-.24484,.531892,.395867,.701304,-.252071,.532727,.423488,.717727,-.258714,.532146,.452201,.733914,-.264211,.529883,.481579,.750529,-.26859,.5259,.511558,.76747,-.272046,.51999,.542042,.785189,-.274225,.513083,.572799,.800954,-.275189,.502936,.603816,.816962,-.274946,.490921,.635461,.83336,-.272695,.47684,.6676,.848143,-.268223,.459405,.70051,.861818,-.262768,.440319,.732902,.876828,-.255872,.420123,.765084,.889312,-.247703,.398379,.796391,.900412,-.238381,.374496,.827333,.912251,-.227783,.349874,.858385,.921792,-.214832,.323181,.888652,.931273,-.200949,.296624,.917763,.940295,-.186537,.269211,.947878,.946812,-.171538,.241447,.977016,.953588,-.155254,.213829,1.00501,.958841,-.137156,.186807,1.03179,.963746,-.118699,.160706,1.05502,.966468,-.0998358,.135504,1.07568,.971178,-.0805186,.109131,1.09479,.97831,-.0599348,.0818293,1.1123,.985886,-.0399661,.0545872,1.12771,.994021,-.0198682,.0269405,1.14186,1.00009,271022e-9,-12989e-8,1.15514,.538716,-990918e-11,.486732,109675e-10,.550656,-250642e-9,.497518,277412e-9,.55057,-.00100265,.497441,.00110974,.550903,-.00225672,.497733,.00249779,.550568,-.00401046,.497438,.00443906,.550574,-.00626613,.49744,.00693637,.550591,-.0090226,.497449,.00998921,.550623,-.0122795,.497469,.0135984,.550667,-.0160361,.497495,.0177654,.550724,-.0202908,.497526,.0224915,.550792,-.0250421,.497557,.0277795,.550918,-.0302878,.49763,.0336334,.551058,-.0360241,.497701,.0400573,.551276,-.0422473,.497824,.0470585,.551551,-.0489441,.497977,.0546433,.552074,-.0559596,.498312,.0628367,.552681,-.0633978,.498679,.071646,.553324,-.0713176,.499031,.0810746,.554011,-.0797268,.499365,.091129,.55488,-.0885238,.499779,.101837,.556171,-.0974417,.500444,.113239,.557498,-.106841,.501025,.125316,.559299,-.116533,.501864,.138128,.561647,-.126298,.502967,.151695,.564347,-.136388,.504129,.16604,.567863,-.146576,.505713,.181207,.572569,-.156832,.507953,.197259,.578919,-.167323,.511186,.214258,.585387,-.177712,.514042,.232038,.593134,-.188184,.517484,.250733,.603295,-.198717,.522345,.270454,.613854,-.209177,.526751,.290807,.626092,-.219644,.531595,.312202,.637868,-.229494,.534721,.334435,.652458,-.238718,.538304,.359184,.666985,-.247061,.539875,.385637,.683301,-.254652,.541042,.41328,.69998,-.261376,.540735,.441903,.717824,-.267085,.539139,.471609,.734617,-.271465,.534958,.501446,.753663,-.27528,.53032,.532571,.770512,-.277617,.522134,.563641,.787356,-.278525,.51206,.595067,.806252,-.278512,.50119,.627226,.822061,-.277023,.486791,.659402,.838959,-.273175,.470467,.692874,.85379,-.267238,.450688,.725702,.868268,-.260327,.429741,.75832,.881994,-.251946,.407223,.790189,.893885,-.242432,.383214,.821625,.905118,-.231904,.357297,.853011,.916045,-.219545,.330733,.883773,.927614,-.205378,.303916,.914435,.936005,-.190388,.275941,.944502,.944533,-.1749,.247493,.974439,.950758,-.158588,.218996,1.00286,.957078,-.141027,.191559,1.0304,.962448,-.121507,.164457,1.05466,.964993,-.102068,.138636,1.0761,.970017,-.0822598,.111861,1.09541,.97661,-.062033,.0843438,1.11317,.985073,-.0409832,.0558496,1.12911,.993515,-.020146,.0275331,1.1438,1.00006,27329e-8,-107883e-9,1.15736,.525324,-999341e-11,.498153,105385e-10,.526513,-251605e-9,.499277,265329e-9,.526517,-.00100641,.499282,.0010613,.526588,-.00226466,.499337,.00238823,.526539,-.0040255,.499302,.00424535,.526547,-.00628954,.499306,.00663364,.526561,-.00905628,.499313,.00955337,.526593,-.0123253,.499334,.0130054,.526642,-.0160957,.499365,.0169911,.5267,-.0203661,.499396,.0215122,.526792,-.0251347,.499451,.0265718,.526904,-.0303985,.499511,.0321732,.527079,-.0361554,.499617,.0383231,.527285,-.0423982,.499731,.045026,.527602,-.0491121,.499924,.0522936,.528166,-.0561127,.500306,.0601528,.52879,-.0635988,.5007,.0686059,.529421,-.071581,.501048,.0776518,.530144,-.0799854,.501421,.0873148,.531062,-.0888032,.501884,.0976084,.532374,-.0977643,.50259,.108588,.533828,-.107197,.50329,.120234,.53581,-.116887,.504312,.132602,.538063,-.126755,.505365,.145721,.5409,-.136819,.506668,.159617,.544882,-.147117,.508731,.174369,.550238,-.157446,.511601,.190028,.556038,-.167988,.514431,.206587,.563031,-.178364,.517808,.224046,.571543,-.189007,.521937,.242503,.582255,-.199546,.527415,.261977,.59272,-.210084,.531682,.282162,.605648,-.220448,.537123,.303426,.61785,-.230593,.540664,.325323,.632223,-.240238,.544467,.348993,.648819,-.24887,.547594,.375462,.665825,-.256657,.54912,.403024,.683389,-.263711,.549294,.431773,.701495,-.269666,.547649,.461494,.719197,-.274169,.543786,.491623,.737906,-.278124,.538644,.522994,.756652,-.280632,.531057,.554775,.775279,-.281741,.521972,.586441,.792688,-.281652,.509613,.618596,.811894,-.280345,.496497,.651462,.827938,-.277128,.47968,.684023,.844837,-.271646,.460688,.718024,.859239,-.264397,.438872,.751207,.874088,-.256144,.41577,.784232,.887693,-.246311,.391369,.816191,.899402,-.235497,.365872,.847828,.910973,-.223631,.338618,.87934,.92204,-.209874,.310803,.910325,.930987,-.194265,.281802,.940695,.94,-.178125,.252836,.970958,.948018,-.161479,.224239,1.00078,.955141,-.144038,.195857,1.0288,.960513,-.124915,.168487,1.05371,.963964,-.104284,.141495,1.07596,.968713,-.0838732,.114437,1.09628,.975524,-.0635579,.0863105,1.11448,.98431,-.042291,.0574774,1.13069,.992916,-.0209131,.0284343,1.14568,.999926,743097e-9,-379265e-9,1.15955,.501042,-998428e-11,.498726,100306e-10,.502992,-252112e-9,.500665,253283e-9,.502417,-.00100791,.500092,.00101259,.502965,-.00226919,.500621,.00227978,.502318,-.00403109,.499994,.00405011,.502333,-.00629832,.500005,.00632868,.502362,-.00906907,.500027,.00911446,.502369,-.0123423,.500023,.0124078,.50243,-.0161178,.500066,.016211,.502493,-.0203937,.500103,.0205256,.502592,-.0251684,.500166,.0253548,.502707,-.0304389,.50023,.0307029,.502881,-.0362015,.500335,.0365753,.503124,-.0424507,.500488,.0429798,.503443,-.0491582,.500686,.0499268,.504083,-.0561476,.501155,.0574541,.504668,-.0636846,.501524,.0655408,.505319,-.0716834,.501904,.0742072,.50609,-.0800925,.502321,.0834699,.507122,-.0888425,.502896,.0933603,.508414,-.097855,.503603,.10391,.509955,-.107304,.504416,.115113,.512061,-.116921,.505565,.127054,.514419,-.12689,.506732,.139709,.517529,-.136934,.508338,.153173,.522085,-.147327,.510987,.167528,.526986,-.157612,.513527,.182708,.533122,-.168213,.516717,.198881,.540807,-.178688,.520832,.215986,.550687,-.189511,.52632,.234335,.560567,-.199998,.531009,.253375,.571698,-.210652,.535839,.273499,.584364,-.220917,.541091,.294355,.599066,-.23137,.546875,.316525,.614148,-.241206,.551306,.339671,.631157,-.250379,.555187,.36531,.647919,-.258397,.556595,.392767,.666112,-.265528,.556949,.421397,.686158,-.271827,.556617,.451433,.704838,-.27674,.552975,.482131,.723957,-.280733,.547814,.513458,.74262,-.283359,.53997,.545446,.762009,-.284541,.530422,.57775,.781314,-.284507,.518546,.610434,.799116,-.283309,.504178,.643178,.817604,-.280378,.48843,.676248,.83459,-.275619,.469457,.709698,.850974,-.26856,.447698,.744245,.866747,-.260094,.424791,.777695,.881412,-.249929,.399913,.810392,.8936,-.239137,.37308,.842872,.905943,-.226818,.345705,.874677,.916408,-.213699,.31706,.906257,.927215,-.198428,.288444,.936881,.935625,-.181643,.258329,.96795,.944076,-.164386,.228488,.998216,.951229,-.146339,.199763,1.02689,.958793,-.127709,.172153,1.0535,.963219,-.107244,.144989,1.07646,.967562,-.0857764,.11685,1.09675,.974866,-.0645377,.0880571,1.11576,.983353,-.0431732,.0587352,1.13227,.992503,-.0218356,.0294181,1.1478,1.00003,605203e-9,-231013e-9,1.16207,.482935,-101177e-10,.504695,968142e-11,.477554,-251521e-9,.499071,240676e-9,.477904,-.00100683,.499436,96342e-8,.478368,-.00226636,.499899,.0021687,.477977,-.00402719,.499513,.00385384,.477993,-.00629226,.499525,.0060221,.478011,-.00906011,.499536,.00867289,.478051,-.0123305,.499566,.0118074,.478089,-.016102,.499587,.0154269,.478171,-.0203736,.499645,.0195341,.478254,-.025143,.499692,.0241318,.47839,-.0304071,.499779,.0292247,.478588,-.0361631,.499911,.0348196,.478812,-.0424023,.500046,.0409231,.479208,-.0490724,.500326,.047552,.479841,-.0560722,.500805,.0547377,.480392,-.0636125,.501152,.0624607,.481068,-.0716134,.501561,.0707473,.481898,-.0800062,.502054,.0796118,.483022,-.0886568,.502728,.0890974,.484332,-.0977553,.503479,.0992099,.486126,-.107173,.504546,.10999,.488066,-.11677,.50557,.121476,.490521,-.126725,.506849,.133672,.494232,-.136793,.50911,.146731,.498302,-.147116,.511345,.160577,.503565,-.157446,.514344,.175335,.510902,-.168121,.518824,.191207,.519263,-.178799,.523666,.208058,.528204,-.189407,.528296,.225875,.538854,-.200145,.533724,.244782,.551278,-.210701,.539833,.264753,.565222,-.221303,.546131,.285745,.579403,-.231688,.551496,.307592,.595469,-.241718,.556809,.330582,.610929,-.250992,.559641,.354995,.629433,-.259602,.562379,.382471,.648504,-.267038,.563676,.411126,.66756,-.273388,.562092,.440924,.689143,-.278788,.560807,.472118,.709056,-.282783,.555701,.503774,.729855,-.285836,.548698,.536364,.748954,-.287078,.538544,.56895,.768373,-.287133,.526711,.601991,.78827,-.285839,.512511,.635403,.807465,-.283238,.496323,.668797,.825194,-.27906,.477638,.702584,.842203,-.272286,.456253,.736393,.857749,-.263854,.432412,.77096,.874799,-.253943,.407806,.80489,.887497,-.24237,.38033,.83771,.89966,-.230278,.352446,.870376,.911753,-.21646,.323268,.902256,.923011,-.202071,.294314,.933306,.932375,-.185519,.264104,.965177,.940537,-.167604,.234035,.996303,.948904,-.149068,.20412,1.0261,.955263,-.129539,.175431,1.05304,.960303,-.109932,.148116,1.07617,.965512,-.0880572,.119693,1.09742,.973466,-.0660548,.0901619,1.11721,.98284,-.0439228,.0599875,1.13436,.992216,-.0219588,.0298975,1.15006,.999946,119402e-9,-208547e-10,1.16471,.447827,-100414e-10,.491543,914833e-11,.454778,-251257e-9,.499172,22891e-8,.453519,-.00100342,.497787,914184e-9,.45357,-.00225776,.497847,.00205701,.453578,-.00401371,.497855,.00365705,.45357,-.00627107,.497841,.00571453,.453598,-.00902968,.497864,.00823019,.453627,-.0122888,.497882,.0112049,.453684,-.0160475,.497923,.0146405,.453764,-.0203044,.49798,.0185394,.453866,-.0250576,.498049,.0229054,.453996,-.0303028,.49813,.0277424,.454196,-.0360379,.498267,.0330587,.454457,-.0422521,.498445,.0388613,.454926,-.0488393,.498812,.0451767,.455525,-.0558653,.499272,.0520153,.456074,-.0633772,.499625,.0593754,.456752,-.0713606,.500049,.0672751,.457648,-.07971,.500615,.0757447,.458849,-.0883032,.501399,.0848231,.46029,-.0974095,.502293,.0945135,.462,-.106729,.503301,.104848,.464121,-.116354,.504533,.115884,.466889,-.126214,.506172,.127652,.470744,-.136324,.508667,.14024,.47488,-.146595,.510995,.153673,.480845,-.157027,.514832,.168053,.488262,-.167658,.519506,.183508,.496547,-.178343,.524347,.199948,.506254,-.188916,.52983,.217503,.517961,-.199975,.536357,.236272,.531484,-.210624,.543641,.256096,.545496,-.221227,.550048,.277085,.559497,-.231568,.555076,.298615,.575752,-.241698,.560541,.321547,.591999,-.251172,.564156,.345602,.610654,-.260178,.567607,.371851,.630484,-.268094,.56923,.40076,.651807,-.274661,.569779,.430801,.67239,-.280331,.566791,.461939,.693024,-.284501,.562007,.493854,.715473,-.287852,.555791,.526992,.736323,-.28929,.546345,.560102,.755771,-.289405,.534,.593543,.775424,-.2881,.519114,.627256,.795447,-.285562,.502543,.661464,.815319,-.281416,.484773,.695206,.831769,-.275523,.463445,.729044,.849464,-.267516,.440269,.764069,.866775,-.257584,.415049,.799089,.881252,-.245817,.388049,.831948,.894209,-.233127,.35889,.865526,.906922,-.219579,.329915,.89818,.919686,-.204491,.300441,.930013,.929044,-.188962,.269445,.962061,.938393,-.171079,.238402,.994214,.94661,-.15199,.208204,1.02533,.953095,-.131953,.178653,1.0529,.958644,-.111233,.150684,1.0771,.963925,-.0903098,.122359,1.09855,.971995,-.0680505,.0923342,1.11874,.981658,-.0448512,.0614195,1.13635,.991649,-.0221931,.0303582,1.15238,.999985,393403e-9,-111086e-9,1.16772,.396806,-971563e-11,.457671,842355e-11,.429186,-249421e-9,.495017,21625e-8,.429324,-998052e-9,.495173,865322e-9,.429175,-.00224487,.494999,.00194637,.429129,-.00399041,.494952,.00346004,.429153,-.00623476,.494974,.00540684,.429168,-.0089773,.494983,.00778714,.429207,-.0122175,.495012,.0106022,.429257,-.0159542,.495047,.0138535,.429338,-.0201864,.495106,.0175443,.429431,-.0249104,.495165,.0216774,.429587,-.0301252,.495279,.0262594,.429796,-.0358249,.495432,.0312968,.430065,-.0419972,.495621,.0367985,.430588,-.0485144,.496061,.042798,.43113,-.0555028,.496472,.0492914,.431743,-.0629852,.496904,.0562907,.432448,-.0709256,.497369,.0638056,.433414,-.0791942,.498032,.071885,.434638,-.0877346,.498854,.0805517,.43611,-.0968056,.499812,.0898047,.437859,-.106002,.500891,.0997142,.440017,-.115648,.502198,.110289,.443236,-.125427,.504389,.121644,.44697,-.135492,.506809,.133769,.451689,-.145746,.509858,.146787,.45811,-.156219,.514247,.160793,.465305,-.166834,.518816,.175791,.474085,-.177546,.524331,.191906,.484808,-.188262,.53104,.209199,.49732,-.199346,.538511,.227825,.509693,-.209951,.544554,.247269,.524367,-.220533,.551616,.267978,.539228,-.231082,.557368,.289672,.55644,-.241342,.563782,.31268,.574204,-.250964,.568851,.33651,.593388,-.260306,.57312,.362219,.613358,-.268667,.574916,.390322,.634512,-.275591,.575053,.420478,.65563,-.281328,.572404,.451614,.678265,-.285948,.568893,.484112,.70011,-.289408,.561878,.517348,.723005,-.291328,.55359,.551355,.743744,-.291418,.541099,.585109,.763949,-.290252,.526489,.619487,.784186,-.287648,.509496,.65404,.804304,-.283782,.491484,.688649,.823629,-.278067,.470517,.723133,.84094,-.270588,.44705,.757163,.857852,-.261188,.421252,.792816,.874934,-.249313,.394191,.827248,.888709,-.236492,.365359,.861074,.902589,-.222185,.336016,.894417,.914201,-.207314,.30527,.926825,.925978,-.191146,.274532,.9595,.93512,-.174135,.243393,.991583,.943656,-.155231,.212414,1.02356,.951719,-.134403,.182005,1.05239,.957164,-.113023,.153043,1.07754,.962656,-.0914493,.124186,1.09984,.970695,-.0694179,.0941654,1.12,.980749,-.0466199,.0629671,1.13849,.991205,-.0227032,.0311146,1.15494,.999884,632388e-9,-254483e-9,1.1706,.379821,-957289e-11,.460637,789337e-11,.405188,-247483e-9,.491396,204064e-9,.404796,-989434e-9,.490914,815853e-9,.40483,-.00222607,.490949,.00183559,.40473,-.00395723,.49084,.00326332,.404731,-.00618287,.490836,.00509945,.404768,-.00890258,.490871,.00734463,.404791,-.0121156,.490883,.00999992,.404857,-.0158214,.490938,.0130676,.404943,-.0200178,.491004,.0165503,.405059,-.0247027,.491093,.0204521,.405213,-.0298729,.491205,.0247788,.405399,-.0355226,.491333,.0295373,.405731,-.0416352,.491604,.034741,.406303,-.0480807,.492116,.0404255,.406814,-.0550458,.492506,.0465732,.407404,-.0624652,.492926,.0532058,.408149,-.0702958,.493442,.0603442,.409128,-.0784623,.494136,.0680297,.410408,-.087007,.495054,.0762786,.411813,-.0959639,.495962,.0851046,.413735,-.105075,.497257,.0945878,.416137,-.114646,.498882,.104725,.41934,-.124394,.501132,.11563,.423326,-.134328,.503883,.127325,.428419,-.14458,.50747,.139911,.43484,-.154979,.511964,.153481,.442641,-.165628,.517328,.168114,.452511,-.176365,.524258,.183995,.463473,-.187298,.531248,.200953,.475564,-.198244,.538367,.219176,.488664,-.208938,.545175,.238514,.504073,-.219599,.553227,.259129,.520832,-.230378,.560653,.280997,.538455,-.240703,.567523,.303821,.55709,-.250548,.573287,.327948,.576646,-.259964,.577795,.353362,.596705,-.268721,.580077,.380336,.618053,-.276054,.58018,.4101,.640303,-.282176,.578747,.44161,.662365,-.286931,.574294,.474106,.684542,-.290521,.567035,.507549,.707984,-.292672,.558687,.541853,.730913,-.293189,.547606,.576581,.752948,-.292199,.533471,.61172,.773452,-.289508,.516395,.646339,.794715,-.285716,.497873,.682131,.814251,-.280051,.476845,.716396,.833057,-.272873,.453449,.751503,.84959,-.263982,.427857,.786085,.867022,-.252745,.400335,.821355,.882277,-.239655,.371304,.85646,.895375,-.225386,.340397,.890828,.909347,-.209587,.310005,.923532,.921885,-.193433,.2796,.956419,.932127,-.176135,.247276,.989445,.941869,-.157872,.216186,1.02221,.949735,-.137577,.185602,1.05195,.956617,-.115285,.155767,1.07822,.961974,-.0928418,.126103,1.10149,.96972,-.0700592,.0956758,1.12207,.98012,-.0474671,.0643269,1.1408,.990825,-.0238113,.0320863,1.1577,.999876,381574e-9,-812203e-10,1.17403,.367636,-961342e-11,.469176,753287e-11,.380377,-244772e-9,.485434,191797e-9,.380416,-978857e-9,.485475,767015e-9,.380376,-.00220165,.485435,.00172522,.380419,-.00391408,.485487,.00306734,.380438,-.00611549,.485505,.00479332,.380462,-.00880558,.485525,.00690391,.380496,-.0119837,.485551,.00940039,.38056,-.0156487,.485605,.0122848,.38064,-.0197988,.485666,.0155601,.380767,-.0244324,.48577,.0192313,.380909,-.0295444,.485871,.0233032,.381142,-.0351321,.48606,.0277861,.381472,-.0411535,.486336,.0326939,.382015,-.0475408,.486833,.0380565,.382523,-.0544395,.487231,.0438615,.383129,-.061784,.487683,.0501332,.383952,-.0695085,.488313,.0568996,.38498,-.0775819,.489077,.0641952,.386331,-.0860443,.490113,.0720324,.387788,-.0948406,.491099,.0804379,.389808,-.103899,.492566,.0894899,.39252,-.113313,.494601,.0992098,.395493,-.123007,.496619,.109641,.399826,-.132859,.499912,.120919,.405341,-.143077,.504061,.133107,.411932,-.153465,.508905,.146263,.420591,-.164108,.515482,.160544,.43101,-.174893,.523191,.176123,.441881,-.185839,.53026,.192757,.453919,-.196633,.537295,.210535,.468715,-.207611,.546156,.229886,.485182,-.218517,.555173,.250543,.501926,-.229249,.562728,.27221,.51785,-.239481,.567494,.294892,.536947,-.249395,.573889,.318987,.557115,-.259,.578831,.344348,.577966,-.268075,.582055,.371223,.599489,-.276115,.583307,.399834,.62479,-.282523,.583902,.431415,.647504,-.287663,.57953,.464301,.670601,-.291538,.573103,.498123,.693539,-.293842,.563731,.532662,.717385,-.294681,.553169,.567925,.741533,-.293717,.539908,.603502,.762142,-.291156,.521902,.639074,.783014,-.28719,.502815,.674439,.805158,-.281773,.482598,.710497,.823646,-.274682,.458949,.7456,.841879,-.266184,.433129,.781085,.859515,-.255682,.406064,.816,.875335,-.242849,.376509,.851074,.890147,-.228329,.345502,.886473,.903144,-.212491,.31428,.920751,.916618,-.195695,.282994,.954606,.927953,-.178267,.251091,.988402,.937414,-.159549,.219107,1.02141,.946823,-.140022,.18896,1.05167,.954651,-.118154,.158667,1.07819,.959955,-.0946636,.128808,1.1025,.96858,-.0711792,.0973787,1.12391,.97938,-.0475046,.0650965,1.14322,.990498,-.024059,.0326267,1.16077,.999844,-512408e-10,112444e-9,1.17727,.316912,-934977e-11,.425996,695559e-11,.356423,-241372e-9,.479108,179562e-9,.356272,-965292e-9,.478897,71811e-8,.356262,-.00217182,.478894,.00161574,.356265,-.00386092,.478895,.00287261,.356278,-.0060324,.478905,.00448907,.356293,-.00868565,.478914,.00646572,.356346,-.0118207,.478965,.00880438,.356395,-.0154355,.479001,.0115066,.356484,-.019529,.479075,.0145762,.356609,-.0240991,.47918,.018018,.356766,-.0291413,.479305,.0218379,.357009,-.0346498,.479512,.0260454,.357424,-.0405462,.479909,.0306657,.357899,-.0468825,.480337,.0357054,.358424,-.0536887,.480771,.0411728,.359041,-.0609416,.481242,.0470841,.359903,-.0685239,.481943,.0534831,.360932,-.0764883,.482741,.0603795,.362196,-.0848364,.483688,.0678028,.363847,-.0935002,.484947,.0758086,.365972,-.102471,.486588,.0844173,.368741,-.111751,.488787,.0937199,.372146,-.121334,.491405,.103732,.377114,-.131147,.495604,.114608,.38226,-.141213,.499436,.126345,.389609,-.151632,.505334,.139116,.397925,-.162073,.51168,.152995,.407824,-.172819,.518876,.168071,.420014,-.183929,.527639,.184495,.434266,-.195032,.537588,.20232,.447352,-.205792,.544379,.221189,.463726,-.216704,.553422,.241616,.481406,-.227531,.562074,.263298,.498707,-.238017,.568227,.286116,.518039,-.247936,.574473,.3101,.538277,-.257437,.579191,.335401,.561166,-.266829,.584807,.362246,.583189,-.275329,.586476,.390609,.606024,-.28234,.585578,.420998,.632419,-.287924,.584496,.454357,.656128,-.291972,.577766,.488233,.679953,-.29456,.56875,.523248,.704654,-.295816,.558388,.559168,.729016,-.295157,.544826,.595326,.752062,-.292779,.528273,.631864,.773138,-.288681,.508482,.667793,.794869,-.283358,.487341,.704035,.815101,-.27608,.46354,.739925,.834212,-.26767,.438672,.775539,.852368,-.257397,.411239,.810895,.870207,-.245689,.3829,.846472,.884063,-.231452,.351496,.881788,.898284,-.215561,.31895,.917438,.912964,-.198208,.287367,.952422,.924666,-.180426,.254487,.987551,.934429,-.161525,.222226,1.02142,.943485,-.141197,.191143,1.05218,.9521,-.120085,.161112,1.07937,.957876,-.0975881,.130982,1.10403,.966943,-.0726842,.0990553,1.12616,.978313,-.0483705,.0662818,1.14619,.990048,-.0239072,.0329243,1.16413,.999984,461885e-9,-772859e-10,1.18099,.321287,-935049e-11,.455413,659662e-11,.332595,-237513e-9,.471437,167562e-9,.332729,-949964e-9,.471618,670192e-9,.332305,-.00213618,.471028,.00150712,.332326,-.00379765,.471055,.00267959,.332344,-.00593353,.471072,.00418751,.332356,-.00854349,.471077,.00603172,.332403,-.0116268,.471121,.00821362,.332461,-.0151824,.47117,.0107357,.332552,-.0192088,.471251,.0136014,.332657,-.0237024,.47133,.0168152,.332835,-.0286615,.471487,.0203853,.333083,-.0340765,.471708,.0243212,.333547,-.0398563,.47219,.0286518,.333989,-.0460916,.472587,.0333763,.334532,-.0527897,.473054,.0385084,.335167,-.0599284,.473568,.0440638,.33608,-.0673514,.474362,.0500962,.337146,-.0752237,.475231,.0566022,.338462,-.083418,.476282,.0636272,.34014,-.0919382,.477615,.0712153,.342341,-.100741,.479404,.079417,.345088,-.109905,.481618,.0882631,.349049,-.119369,.485081,.0978851,.353939,-.129033,.489317,.108336,.359893,-.139038,.494309,.119698,.366945,-.149411,.499983,.132024,.375814,-.159843,.507185,.145558,.387112,-.170664,.516392,.160433,.40023,-.181897,.526519,.176648,.412555,-.192785,.53423,.193922,.427023,-.203663,.542741,.212662,.443685,-.214695,.552066,.232944,.461499,-.225561,.560762,.254495,.480975,-.236257,.569421,.277531,.501,-.24639,.576101,.301724,.521691,-.256101,.581493,.327112,.543478,-.265289,.585221,.353917,.566094,-.273938,.587614,.381941,.589578,-.281679,.587991,.41172,.614583,-.287655,.585928,.444148,.641813,-.292228,.582092,.478617,.666189,-.295172,.57398,.51397,.690475,-.29648,.561676,.550118,.715543,-.296203,.548758,.586933,.740405,-.293999,.532792,.62384,.762183,-.28998,.512735,.660723,.786069,-.28478,.492402,.69807,.806812,-.277568,.469058,.734422,.826987,-.268951,.443017,.770946,.844588,-.259049,.415501,.80699,.863725,-.2471,.387328,.842107,.879137,-.234157,.356108,.878078,.894634,-.218719,.324315,.914058,.909162,-.201293,.291813,.949922,.92072,-.18267,.258474,.985337,.93158,-.163212,.225593,1.0205,.941238,-.142771,.193986,1.05273,.949293,-.120956,.163392,1.08075,.956226,-.0985743,.132934,1.10559,.96546,-.075118,.101255,1.12823,.977403,-.0497921,.0675441,1.149,.989648,-.0241574,.0334681,1.16765,1.00001,5762e-7,-184807e-9,1.18519,.303474,-916603e-11,.4542,61243e-10,.308894,-232869e-9,.462306,155592e-9,.309426,-931661e-9,.463093,622499e-9,.308643,-.0020949,.461933,.00139979,.308651,-.0037242,.461941,.00248874,.308662,-.00581873,.46195,.00388933,.308687,-.00837818,.461974,.00560247,.308728,-.0114016,.462011,.00762948,.308789,-.0148884,.462067,.00997326,.308882,-.0188369,.462151,.0126375,.309007,-.0232436,.462263,.0156271,.30918,-.0281054,.462417,.0189498,.309442,-.0334065,.462667,.0226167,.309901,-.0390589,.463162,.0266614,.310331,-.0452042,.463555,.0310715,.310858,-.0517735,.464019,.0358698,.311576,-.0587359,.464669,.0410848,.312436,-.0660383,.465406,.0467453,.313526,-.0737266,.466339,.0528718,.314903,-.0817574,.467504,.0595039,.316814,-.090167,.469226,.0666888,.318965,-.0987555,.470981,.0744658,.322077,-.107792,.473814,.082912,.325947,-.117098,.477241,.0920846,.331008,-.126602,.48184,.102137,.337893,-.136619,.488334,.113135,.345106,-.146838,.494415,.12511,.355111,-.157357,.503275,.138356,.365095,-.167955,.510966,.152686,.378344,-.179157,.521508,.16856,.391599,-.190143,.530455,.18561,.407786,-.20123,.541275,.204308,.425294,-.212456,.551784,.224623,.444021,-.223568,.561493,.246172,.463418,-.234154,.569886,.268979,.484077,-.244546,.577116,.293411,.505513,-.254301,.582914,.318936,.527672,-.263564,.587208,.345856,.550565,-.272332,.589277,.374054,.573656,-.280011,.588426,.403276,.59827,-.286924,.587504,.43474,.624731,-.291994,.583401,.468767,.652396,-.295159,.576997,.504411,.67732,-.296954,.565863,.54114,.703147,-.296877,.552316,.57816,.728715,-.295147,.536773,.616124,.752448,-.291275,.51771,.653885,.775169,-.285905,.496087,.691537,.799307,-.279064,.474232,.729251,.819482,-.270294,.447676,.766267,.837659,-.260032,.419656,.802616,.856903,-.248497,.391328,.838583,.873325,-.235252,.360285,.874711,.889788,-.221126,.329215,.91077,.904486,-.204304,.296392,.94653,.917711,-.185562,.262159,.983828,.928969,-.165635,.229142,1.01955,.939707,-.14442,.19673,1.05317,.948167,-.122147,.165095,1.0823,.955222,-.099098,.13451,1.10791,.964401,-.0755332,.102476,1.1312,.976605,-.0513817,.0689667,1.15218,.989085,-.0258499,.034506,1.17129,.999908,617773e-9,-271268e-9,1.18961,.285803,-905752e-11,.452348,572272e-11,.284689,-22732e-8,.450581,143626e-9,.285263,-910214e-9,.451482,575099e-9,.285302,-.00204784,.451553,.00129395,.285318,-.00364057,.451574,.0023006,.28533,-.00568813,.451585,.00359547,.285361,-.00819001,.451618,.00517934,.285397,-.0111458,.45165,.007054,.285447,-.0145536,.451688,.00922167,.285527,-.0184127,.451758,.0116869,.285688,-.0227207,.451929,.0144555,.28584,-.0274712,.452055,.0175341,.286136,-.0326278,.452369,.0209406,.286574,-.0381792,.452853,.0246965,.287012,-.0441879,.453272,.0287996,.287542,-.0506096,.453752,.033268,.288299,-.0573634,.454488,.0381504,.289186,-.0645458,.455294,.0434447,.290302,-.0720405,.456301,.0491973,.291776,-.0799046,.457648,.0554453,.29372,-.088117,.459483,.0622311,.296052,-.0965328,.461571,.0695992,.299563,-.105409,.465085,.077658,.30335,-.114553,.468506,.0864176,.309167,-.123917,.474423,.0961078,.31529,-.13381,.47995,.106643,.324163,-.144021,.488592,.118322,.333272,-.154382,.496461,.131133,.344224,-.165015,.50562,.145208,.357733,-.176168,.516719,.16073,.373046,-.187468,.528513,.177807,.38788,-.198488,.537713,.196072,.405133,-.209545,.547999,.21605,.423845,-.220724,.55759,.237484,.443777,-.231518,.566246,.26039,.464824,-.242035,.574326,.284835,.486635,-.251898,.58037,.310518,.51012,-.261304,.58568,.337678,.535301,-.270384,.590197,.366242,.559193,-.27841,.590569,.395873,.583544,-.285325,.588161,.426857,.608834,-.291113,.584249,.459477,.635753,-.294882,.57763,.494734,.664367,-.297088,.569479,.532023,.689688,-.297364,.555064,.569629,.715732,-.295949,.539522,.608124,.741307,-.292259,.521613,.646231,.764949,-.287063,.49969,.684938,.788599,-.28012,.476747,.723548,.81048,-.27153,.45116,.761135,.831372,-.261289,.424101,.798916,.850092,-.249559,.39443,.835952,.867777,-.236348,.363849,.871606,.884632,-.221569,.332477,.907843,.90047,-.20618,.300667,.944187,.914524,-.188771,.266552,.981371,.926892,-.168362,.232349,1.01841,.937951,-.146761,.199359,1.05308,.947236,-.123813,.1675,1.0839,.954367,-.099984,.136166,1.11047,.963907,-.0759278,.103808,1.13414,.976218,-.0511367,.0697061,1.15575,.988772,-.0267415,.0352529,1.17531,.999888,-520778e-9,289926e-9,1.19389,.263546,-883274e-11,.441896,526783e-11,.262352,-221849e-9,.439889,132311e-9,.262325,-886683e-9,.439848,528824e-9,.26228,-.00199476,.439765,.00118975,.262372,-.00354671,.439922,.00211568,.26239,-.00554141,.439941,.00330652,.262412,-.00797888,.439961,.00476346,.262453,-.0108584,.440002,.00648818,.262528,-.0141788,.440085,.0084835,.262615,-.017938,.440166,.0107533,.262744,-.0221346,.440291,.0133044,.262939,-.026762,.440493,.0161445,.263277,-.0317573,.440889,.0192974,.26368,-.0371832,.441338,.0227699,.264106,-.0430371,.441753,.0265698,.264624,-.0493035,.442227,.0307178,.265378,-.0558669,.442985,.0352616,.266253,-.0628718,.443795,.0401968,.267478,-.0701569,.445008,.04559,.269062,-.077845,.446599,.0514539,.270926,-.0857941,.448349,.0578382,.273693,-.0940773,.451221,.0648363,.276746,-.102704,.454097,.0724389,.281693,-.111735,.459517,.0808744,.287335,-.121004,.46531,.0901551,.29448,-.130734,.472605,.100371,.30257,-.140777,.480251,.111644,.312465,-.15111,.489444,.124111,.324856,-.16189,.500919,.137979,.33774,-.172946,.511317,.153163,.35255,-.184152,.522684,.169817,.367786,-.19522,.53248,.187886,.385474,-.20632,.543326,.207634,.404976,-.217744,.554109,.229165,.425203,-.228691,.563395,.252068,.446704,-.239299,.571565,.276471,.468951,-.249348,.577935,.302323,.493487,-.258933,.584309,.329882,.517861,-.268009,.58773,.358525,.543309,-.276238,.589612,.388585,.569704,-.28356,.589294,.419787,.594871,-.289497,.585137,.452114,.622555,-.294452,.580356,.486466,.651167,-.296918,.57185,.523079,.677332,-.297647,.558428,.5611,.703718,-.296321,.542232,.599592,.730262,-.293339,.524541,.639138,.754304,-.288036,.502691,.677978,.778051,-.281018,.479212,.716537,.801557,-.272414,.454071,.75586,.822559,-.262419,.425952,.794477,.843051,-.250702,.397313,.832664,.86232,-.237264,.366534,.869876,.879044,-.222716,.334816,.906973,.896362,-.206827,.303143,.943558,.910342,-.189659,.269699,.979759,.924119,-.171108,.236411,1.01718,.935374,-.149579,.202224,1.05289,.944295,-.126295,.16989,1.08496,.952227,-.101511,.138089,1.11256,.962041,-.0766392,.105053,1.1375,.97528,-.0511967,.070329,1.15983,.988476,-.025463,.0351268,1.17987,.999962,286808e-10,145564e-10,1.19901,.227089,-841413e-11,.404216,472707e-11,.239725,-215083e-9,.426708,120833e-9,.239904,-860718e-9,.427028,483555e-9,.239911,-.00193661,.427039,.00108806,.239914,-.00344276,.42704,.00193457,.239933,-.00537907,.427064,.00302363,.239944,-.00774482,.427065,.00435604,.239993,-.01054,.427122,.00593398,.240052,-.0137626,.427179,.00775987,.240148,-.0174115,.427279,.00983854,.240278,-.021484,.42741,.0121763,.240472,-.0259729,.427618,.0147827,.240839,-.0308131,.428086,.0176837,.241201,-.0360893,.428482,.0208775,.241626,-.0417723,.428907,.0243821,.242207,-.0478337,.42952,.0282228,.24298,-.0542199,.430332,.0324333,.243881,-.0610015,.431222,.0370252,.245123,-.0680874,.432512,.0420535,.24667,-.0755482,.434088,.0475414,.248779,-.0832873,.436323,.0535542,.251665,-.0913546,.439509,.0601716,.255305,-.0998489,.443478,.0674282,.260049,-.108576,.448713,.0754673,.266192,-.117754,.455524,.084339,.273158,-.127294,.4627,.0941683,.282131,-.137311,.472068,.10515,.293332,-.147736,.483565,.117402,.304667,-.158357,.493702,.130824,.317785,-.169274,.504708,.145724,.333245,-.180595,.517107,.16215,.349843,-.191892,.528849,.180149,.367944,-.203168,.540301,.199746,.387579,-.214443,.551514,.221047,.408247,-.225624,.560906,.243981,.43014,-.236422,.56959,.268513,.452669,-.24654,.576098,.294409,.476196,-.256157,.580925,.322002,.501157,-.265289,.584839,.351052,.527632,-.273671,.587614,.3812,.555754,-.281254,.589119,.412994,.581682,-.287448,.585204,.445498,.608196,-.292614,.579006,.479505,.635661,-.296068,.571297,.514643,.664999,-.297395,.560855,.552213,.691039,-.296645,.544525,.591365,.7179,-.293785,.526535,.630883,.744059,-.289089,.50545,.670932,.76863,-.282239,.482514,.710904,.793273,-.273688,.457246,.750259,.814731,-.26328,.428872,.78948,.835603,-.251526,.399384,.828597,.85489,-.238339,.368811,.866892,.872828,-.223607,.336617,.90563,.889462,-.207538,.303997,.943538,.904929,-.190297,.270812,.980591,.919101,-.172034,.237453,1.01935,.930536,-.152058,.204431,1.05498,.941223,-.129515,.172495,1.08717,.94982,-.104263,.140175,1.11551,.960592,-.0781944,.106465,1.14098,.974629,-.051688,.0711592,1.16418,.98811,-.0253929,.0354432,1.18465,1.00004,804378e-9,-330876e-9,1.20462,.214668,-821282e-11,.406619,433582e-11,.218053,-208144e-9,.413025,109887e-9,.217987,-832212e-9,.412901,439362e-9,.217971,-.00187246,.412876,988623e-9,.217968,-.00332855,.41286,.00175772,.217985,-.00520055,.412882,.00274729,.218014,-.00748814,.412916,.00395842,.218054,-.0101901,.412957,.00539274,.218106,-.0133057,.413005,.00705348,.218217,-.0168342,.413139,.00894581,.218338,-.0207707,.413258,.0110754,.21855,-.0251001,.413509,.0134551,.218913,-.0297861,.413992,.0161081,.219265,-.0348956,.414383,.0190307,.219696,-.0403909,.414839,.0222458,.220329,-.0462003,.415567,.025792,.220989,-.0524208,.41621,.0296637,.222027,-.058948,.417385,.0339323,.223301,-.0658208,.418779,.0386055,.224988,-.0730347,.420665,.0437355,.227211,-.0805274,.423198,.0493844,.230131,-.088395,.426566,.0556135,.233908,-.0966208,.43091,.0624829,.239092,-.105223,.437148,.0701636,.245315,-.11424,.444302,.0786949,.253166,-.12368,.453262,.0882382,.262374,-.133569,.463211,.0988682,.273145,-.143836,.474271,.110727,.285512,-.154577,.4863,.123945,.299512,-.165501,.498817,.138581,.314287,-.176698,.510341,.154676,.331083,-.188066,.522583,.172459,.349615,-.199597,.534879,.191979,.369318,-.210843,.546083,.21309,.390377,-.222068,.5562,.235998,.412411,-.233059,.564704,.260518,.435715,-.24357,.572314,.286795,.461196,-.253356,.579395,.314559,.485587,-.262362,.581985,.343581,.511908,-.270895,.584347,.374367,.539798,-.278452,.58505,.406015,.567974,-.284877,.583344,.439168,.594303,-.290124,.577348,.473005,.622951,-.294183,.570751,.508534,.652404,-.296389,.561541,.544764,.679291,-.296605,.546426,.582927,.706437,-.294095,.528599,.622681,.734485,-.28978,.508676,.663567,.758841,-.283363,.484768,.704092,.78537,-.275015,.460434,.745101,.807315,-.264689,.432166,.784712,.8271,-.252597,.401807,.824241,.849191,-.239154,.371458,.863803,.867046,-.224451,.338873,.903063,.8852,-.208342,.306175,.942763,.901771,-.190684,.272759,.981559,.915958,-.172105,.239306,1.02048,.928046,-.152214,.206071,1.05765,.939961,-.130247,.17367,1.08999,.948711,-.10672,.142201,1.11829,.959305,-.0808688,.108454,1.14467,.973009,-.0539145,.0728109,1.16839,.987631,-.0262947,.0360625,1.19004,.999978,.00132758,-559424e-9,1.21058,.193925,-793421e-11,.391974,392537e-11,.196746,-200315e-9,.397675,991033e-10,.19667,-801099e-9,.397521,396342e-9,.196633,-.00180246,.397445,891829e-9,.196654,-.00320443,.397482,.00158582,.196659,-.00500647,.39748,.00247867,.196683,-.0072086,.397506,.00357167,.196728,-.00981001,.397562,.00486675,.196792,-.0128096,.397633,.00636707,.19689,-.0162055,.397746,.00807752,.197017,-.0199943,.397884,.0100052,.19729,-.024139,.39827,.0121691,.197583,-.0286671,.398639,.0145755,.197927,-.0335858,.399034,.0172355,.198383,-.0388806,.399554,.0201718,.199002,-.0444736,.400289,.0234194,.199739,-.0504583,.401111,.026984,.200784,-.056729,.402349,.0309217,.202075,-.0633643,.403841,.0352496,.203898,-.0703247,.406076,.0400313,.206199,-.0775565,.408841,.0453282,.209252,-.085184,.41259,.0511794,.213638,-.0931994,.418288,.0577459,.21881,-.101617,.424681,.0650508,.225642,-.11052,.433429,.0732759,.233717,-.119772,.442897,.0824683,.242823,-.129505,.452888,.0927484,.254772,-.139906,.466407,.104417,.266603,-.150402,.477413,.117211,.28073,-.161395,.490519,.131598,.295399,-.172465,.50201,.147407,.312705,-.183982,.515311,.165031,.331335,-.195532,.52786,.184336,.351037,-.206971,.5392,.205361,.372175,-.218117,.54941,.228043,.394548,-.229327,.558642,.25267,.419598,-.240052,.567861,.279071,.443922,-.249937,.573332,.306882,.471495,-.259407,.58013,.33661,.496769,-.267749,.580564,.367328,.524951,-.275524,.581696,.399753,.55318,-.282148,.579885,.433134,.581577,-.287533,.575471,.467534,.609231,-.291612,.567445,.502943,.637478,-.293911,.557657,.53871,.667795,-.295096,.546535,.576568,.694272,-.294073,.529561,.614929,.722937,-.290386,.510561,.655909,.749682,-.284481,.487846,.697663,.774754,-.276188,.462487,.738515,.799301,-.266215,.43481,.779802,.820762,-.254116,.404879,.820045,.843231,-.240393,.374559,.860294,.861857,-.225503,.341582,.900965,.880815,-.209382,.308778,.941727,.89766,-.19155,.275232,.980916,.912926,-.172346,.240938,1.02162,.926391,-.151799,.207223,1.0597,.938429,-.129968,.17484,1.09291,.947834,-.10651,.142984,1.12248,.958432,-.0824098,.109902,1.149,.972402,-.0565242,.0744454,1.1733,.987191,-.028427,.0373794,1.19538,.999975,385685e-10,-4203e-8,1.21676,.178114,-766075e-11,.385418,354027e-11,.176074,-191966e-9,.381002,887135e-10,.17601,-767549e-9,.380861,354715e-9,.17598,-.00172696,.380798,798168e-9,.175994,-.00307012,.380824,.00141928,.176017,-.00479684,.380858,.00221859,.176019,-.00690648,.380839,.00319714,.176072,-.00939888,.380913,.0043572,.176131,-.0122726,.380979,.005702,.176239,-.0155264,.38112,.00723689,.176371,-.0191551,.381272,.00896907,.176638,-.023117,.381669,.0109194,.176912,-.0274633,.382015,.0130903,.177279,-.032173,.382476,.0154949,.17774,-.0372219,.383041,.0181669,.178344,-.0426132,.38378,.0211209,.179153,-.0483309,.384773,.0243899,.180197,-.0543447,.386076,.0280062,.181581,-.0607122,.387809,.032004,.18344,-.0673855,.390205,.036453,.186139,-.0743989,.393944,.0414162,.189432,-.0817731,.39832,.0469394,.193795,-.0895464,.404188,.0531442,.199641,-.0978264,.4121,.0601374,.206679,-.106499,.421425,.0680078,.214865,-.115654,.431504,.076919,.224406,-.125268,.442526,.0868835,.235876,-.135475,.455465,.0981875,.248335,-.146023,.4681,.110759,.262868,-.157016,.482069,.124885,.278962,-.168245,.496182,.140645,.295082,-.17958,.507401,.157838,.313738,-.191227,.520252,.17695,.333573,-.202718,.531708,.197817,.356433,-.214424,.544509,.220785,.378853,-.225492,.55373,.245306,.402717,-.236236,.561348,.271593,.428375,-.246568,.568538,.299776,.454724,-.255941,.573462,.329433,.482291,-.264511,.576356,.360598,.509706,-.272129,.576446,.393204,.538805,-.278979,.575298,.427227,.568919,-.284528,.572154,.462157,.596804,-.288801,.564691,.497997,.625987,-.291334,.555134,.534467,.656414,-.292722,.545051,.571736,.683916,-.292185,.528813,.610158,.711809,-.290043,.51106,.649061,.739547,-.285246,.490103,.690081,.766914,-.277647,.465523,.732554,.791375,-.267603,.437718,.773982,.814772,-.256109,.40882,.81609,.836691,-.242281,.377823,.856849,.856984,-.227155,.34496,.898363,.876332,-.210395,.311335,.939471,.894988,-.192612,.277703,.980799,.911113,-.173236,.243019,1.02215,.924092,-.152258,.209037,1.06139,.936828,-.129575,.175909,1.09635,.946869,-.10594,.143852,1.12707,.958284,-.081318,.110289,1.15419,.972325,-.0556133,.0747232,1.17909,.986878,-.0297899,.0383149,1.20163,.999936,-.00197169,912402e-9,1.22338,.151174,-720365e-11,.351531,309789e-11,.155594,-18279e-8,.361806,78608e-9,.156099,-731569e-9,.362982,314615e-9,.156053,-.00164578,.362869,707845e-9,.156093,-.0029261,.362961,.00125884,.156099,-.00457155,.362959,.00196783,.15612,-.00658224,.362982,.00283622,.156168,-.00895774,.363048,.00386625,.156221,-.0116962,.363101,.00506109,.156324,-.0147973,.363241,.00642675,.156476,-.0182503,.363448,.00797175,.156731,-.0220266,.36384,.00971484,.156994,-.026176,.364179,.0116575,.157341,-.0306701,.36462,.0138207,.157867,-.0354591,.365364,.0162356,.15846,-.0406141,.366111,.0189092,.159308,-.0460519,.367248,.021885,.160426,-.0518096,.368767,.0252004,.161877,-.0578906,.370745,.0288825,.163995,-.0642812,.373831,.0330139,.16655,-.0710067,.377366,.0376283,.170237,-.0781522,.382799,.0428493,.175096,-.0857172,.389915,.0487324,.181069,-.0938025,.398487,.0554214,.188487,-.102363,.408799,.0630189,.197029,-.111343,.419991,.071634,.206684,-.120812,.431455,.0812797,.218698,-.131033,.445746,.0923651,.230726,-.141373,.457471,.104545,.245516,-.152387,.472388,.118449,.261551,-.163628,.486671,.133923,.277437,-.174814,.49762,.150849,.296662,-.186713,.51162,.169924,.31795,-.198513,.525435,.190848,.339422,-.210119,.536267,.213504,.362143,-.221354,.545982,.237947,.387198,-.23224,.555364,.264427,.412349,-.24257,.561489,.292519,.439274,-.252284,.566903,.322561,.466779,-.261023,.569614,.353952,.496011,-.26899,.571589,.387278,.524964,-.275498,.570325,.421356,.556518,-.281449,.568792,.457314,.584363,-.285526,.560268,.493199,.614214,-.28844,.55205,.530276,.645684,-.289777,.541906,.56855,.673446,-.289722,.526464,.606927,.701924,-.287792,.509872,.645945,.73037,-.284315,.490649,.685564,.757405,-.278804,.467964,.726511,.784025,-.269543,.441468,.768601,.808255,-.258117,.41216,.811321,.830739,-.244728,.380606,.853496,.851914,-.229428,.348111,.895374,.872586,-.212508,.314732,.937674,.891581,-.194025,.280338,.979869,.907641,-.174711,.245203,1.02253,.922233,-.153509,.21077,1.06371,.935878,-.130418,.177399,1.09972,.946338,-.105558,.144507,1.13124,.957265,-.080059,.110508,1.15973,.971668,-.0539766,.0742311,1.18515,.9866,-.0277101,.0375224,1.20858,1.00021,-515531e-9,135226e-9,1.23135,.137468,-686011e-11,.345041,273315e-11,.13703,-173378e-9,.343936,690761e-10,.136986,-693048e-9,.34383,276126e-9,.136964,-.00155931,.343761,621337e-9,.137003,-.00277211,.343863,.00110494,.137012,-.00433103,.343868,.00172744,.137043,-.00623606,.343916,.00249022,.13709,-.0084868,.343986,.00339559,.137145,-.0110814,.344045,.00444687,.137242,-.0140187,.344177,.00565007,.137431,-.0172713,.344491,.00701868,.137644,-.0208605,.344805,.00856042,.13791,-.024792,.345172,.0102863,.138295,-.0290461,.345734,.0122185,.138764,-.0335957,.346371,.0143771,.139415,-.038467,.347298,.0167894,.140272,-.0436176,.348527,.0194895,.141457,-.0491016,.350276,.0225043,.14303,-.0548764,.352646,.0258962,.145289,-.0610096,.356206,.0297168,.148502,-.0674777,.361488,.0340562,.152188,-.074345,.367103,.0389534,.157359,-.0817442,.375247,.0445541,.16379,-.0896334,.385064,.0509535,.171376,-.098005,.396082,.0582611,.179901,-.106817,.407418,.06654,.189892,-.116239,.420031,.075994,.201838,-.12627,.434321,.0867239,.214311,-.136701,.447631,.0987517,.228902,-.147616,.462046,.112353,.245107,-.158871,.476942,.127605,.262292,-.170261,.490285,.144469,.281215,-.182017,.503783,.163282,.301058,-.193729,.515505,.183873,.322752,-.205512,.52682,.206466,.347547,-.217214,.539473,.231194,.370969,-.227966,.546625,.257288,.397533,-.238555,.55472,.285789,.42398,-.248278,.559468,.315746,.452928,-.257422,.564095,.347724,.482121,-.265306,.565426,.380922,.510438,-.272043,.563205,.415639,.541188,-.277614,.561087,.451702,.571667,-.281927,.554922,.48845,.602432,-.285015,.546838,.526442,.634126,-.286512,.537415,.564896,.662816,-.286388,.522906,.604037,.692411,-.284734,.507003,.643795,.720946,-.281297,.488398,.68298,.748293,-.276262,.466353,.723466,.776931,-.269978,.443573,.764565,.801065,-.260305,.415279,.805838,.825843,-.247426,.384773,.849985,.84807,-.232437,.352555,.893174,.869122,-.215806,.318642,.936564,.888963,-.197307,.28381,.980253,.905547,-.177203,.247888,1.02463,.918554,-.155542,.212904,1.06714,.931395,-.131948,.1787,1.10451,.941749,-.106723,.145902,1.13694,.954551,-.0804939,.111193,1.1666,.970279,-.0534239,.0744697,1.19249,.986117,-.0257452,.0368788,1.21665,.999938,.00190634,-.0010291,1.23981,.118493,-647439e-11,.32272,23772e-10,.118765,-163023e-9,.323456,598573e-10,.118772,-65212e-8,.323477,239447e-9,.118843,-.00146741,.323657,538881e-9,.118804,-.00260846,.323553,95826e-8,.118826,-.00407576,.323595,.00149845,.118846,-.00586826,.323617,.00216047,.118886,-.00798578,.32367,.00294679,.118947,-.0104273,.323753,.00386124,.119055,-.0131909,.323922,.00490999,.119241,-.0162444,.324251,.00610804,.11944,-.0196339,.324544,.00745805,.119739,-.0233378,.325026,.00897805,.12011,-.0273179,.325586,.0106895,.120571,-.0316143,.326231,.0126073,.12124,-.0361939,.327264,.0147654,.122162,-.0410511,.328733,.0172001,.123378,-.0462233,.330659,.0199375,.125183,-.0517109,.333754,.0230498,.127832,-.0575652,.338507,.026597,.130909,-.0637441,.343666,.0306345,.135221,-.0704302,.351063,.035273,.14082,-.0776364,.360604,.0406137,.146781,-.0852293,.369638,.0466788,.155121,-.0935351,.3827,.0537628,.16398,-.102234,.39522,.0617985,.173926,-.111465,.40793,.07097,.185137,-.121296,.42105,.0813426,.19826,-.13169,.435735,.0931596,.212938,-.142614,.450932,.106547,.229046,-.153884,.465726,.121575,.246246,-.165382,.479461,.138286,.264637,-.176806,.492106,.15666,.284959,-.188793,.504774,.17728,.308157,-.200763,.518805,.19988,.330951,-.21239,.528231,.224293,.3549,-.223521,.536376,.250541,.381502,-.234169,.544846,.278902,.409529,-.244077,.551717,.309227,.437523,-.253363,.55517,.341426,.467624,-.261659,.557772,.37518,.497268,-.268498,.556442,.41007,.528294,-.274018,.553915,.446445,.559053,-.278169,.549153,.483779,.589329,-.281229,.539878,.522249,.622503,-.282902,.53162,.561754,.652382,-.282815,.518119,.601544,.681847,-.281247,.502187,.641574,.712285,-.277986,.484824,.682633,.740094,-.273017,.463483,.723426,.768478,-.266692,.441299,.763747,.794556,-.258358,.415238,.805565,.819408,-.248807,.386912,.847254,.843411,-.236214,.356165,.891091,.862397,-.219794,.320562,.936174,.883113,-.201768,.285322,.982562,.90023,-.181672,.249713,1.02862,.915192,-.159279,.214546,1.07163,.928458,-.134725,.180285,1.10995,.94069,-.10913,.147119,1.14354,.953409,-.0821315,.112492,1.17372,.969537,-.0542677,.0752014,1.20043,.985612,-.0259096,.0370361,1.22528,.999835,.00298198,-.00151801,1.24959,.10097,-602574e-11,.300277,202619e-11,.101577,-152164e-9,.302077,511662e-10,.101572,-608889e-9,.302066,204751e-9,.101566,-.00136997,.302047,460753e-9,.101592,-.00243557,.302114,819497e-9,.101608,-.0038053,.30214,.00128154,.101627,-.00547906,.30216,.0018483,.101669,-.00745647,.302224,.00252223,.101732,-.00973615,.302318,.00330716,.101844,-.0123097,.302513,.00421061,.102025,-.0151681,.30285,.00524481,.102224,-.0183334,.303166,.0064154,.102515,-.0217819,.303654,.00774063,.102886,-.0255067,.304243,.0092398,.103395,-.029514,.305089,.0109339,.104109,-.0337912,.306301,.0128561,.105074,-.0383565,.30798,.0150338,.10654,-.0432132,.310726,.0175228,.108478,-.0484244,.314351,.0203648,.111015,-.0539339,.319032,.0236325,.114682,-.0598885,.32605,.0274188,.11911,-.0663375,.334109,.0317905,.124736,-.0733011,.344013,.0368502,.131479,-.0807744,.355358,.0427104,.139283,-.0888204,.367614,.0494788,.148054,-.0973394,.380072,.0572367,.159037,-.10665,.395678,.0662704,.169794,-.116221,.40795,.0763192,.18314,-.126632,.423546,.087956,.197515,-.137383,.438213,.101042,.213514,-.148641,.453248,.115827,.23065,-.160117,.46688,.132283,.249148,-.171807,.479962,.150644,.270219,-.183695,.494618,.171073,.292338,-.195574,.506937,.193378,.314999,-.207205,.516463,.217585,.340991,-.218955,.528123,.24428,.367982,-.229917,.537025,.272784,.39432,-.239737,.541627,.302742,.423364,-.249048,.546466,.335112,.453751,-.257329,.549466,.369032,.48416,-.264623,.549503,.404577,.515262,-.270411,.547008,.441337,.547036,-.274581,.542249,.479162,.576614,-.277266,.533015,.517904,.611143,-.279144,.525512,.558508,.640989,-.279001,.51154,.598995,.671182,-.277324,.495641,.639935,.700848,-.273908,.477526,.681017,.729862,-.269063,.457955,.722764,.758273,-.262282,.434846,.764349,.784121,-.254281,.409203,.806206,.809798,-.24505,.382694,.848617,.834953,-.233861,.354034,.892445,.856817,-.221308,.321764,.936263,.877609,-.205996,.288118,.982401,.897489,-.186702,.253277,1.02975,.913792,-.164618,.217963,1.07488,.92785,-.140023,.183221,1.11487,.940378,-.11328,.149385,1.14947,.95273,-.0853958,.114152,1.1807,.969059,-.0568698,.0769845,1.20912,.985574,-.0276502,.0381186,1.23498,.999943,.00239052,-.00126861,1.25987,.0852715,-560067e-11,.279021,171162e-11,.0854143,-140871e-9,.279483,430516e-10,.0854191,-563385e-9,.2795,172184e-9,.0854188,-.00126753,.279493,387464e-9,.0854229,-.00225337,.279501,68918e-8,.0854443,-.00352086,.279549,.00107803,.0854697,-.00506962,.279591,.00155536,.0855093,-.00689873,.279652,.00212354,.0855724,-.00900821,.279752,.00278703,.0856991,-.0113799,.280011,.0035551,.085855,-.0140314,.280297,.00443449,.0860682,-.016963,.280682,.00543636,.086344,-.0201438,.281159,.0065788,.0867426,-.0235999,.281886,.00787977,.087239,-.0273069,.282745,.0093606,.0879815,-.031269,.284139,.011056,.0891258,-.035531,.28647,.0130065,.0906909,-.0400947,.289708,.0152495,.0927624,-.0449638,.293904,.0178454,.0958376,-.0502427,.300471,.0208915,.0995827,-.0559514,.30806,.0244247,.104526,-.0622152,.317874,.0285721,.110532,-.0690046,.329332,.0334227,.117385,-.0763068,.341217,.0390466,.12522,-.084184,.353968,.0455786,.134037,-.0925248,.366797,.0530773,.144014,-.101487,.380209,.0617424,.156013,-.111273,.395956,.071777,.168872,-.121431,.41053,.0830905,.183089,-.132105,.425073,.0959341,.198763,-.143286,.439833,.110448,.216159,-.154841,.454507,.126769,.234859,-.166588,.468368,.14495,.255879,-.178626,.482846,.165233,.27677,-.190218,.493489,.187217,.301184,-.202227,.506549,.211659,.325852,-.213764,.5158,.237922,.352824,-.22487,.525442,.26632,.380882,-.235246,.532487,.296691,.410137,-.244847,.537703,.329179,.439787,-.253122,.540361,.363135,.472291,-.260517,.542734,.399222,.501856,-.266519,.538826,.436352,.534816,-.270905,.535152,.474505,.565069,-.273826,.525979,.513988,.597154,-.275333,.516394,.554852,.630473,-.275314,.506206,.596592,.660574,-.273323,.489769,.638117,.692015,-.270008,.472578,.680457,.720647,-.265001,.452134,.723008,.750528,-.258311,.430344,.765954,.777568,-.250046,.405624,.809012,.80387,-.240114,.378339,.852425,.828439,-.228737,.349877,.895346,.851472,-.216632,.318968,.940695,.873906,-.202782,.287489,.987235,.89467,-.187059,.254394,1.03348,.912281,-.168818,.221294,1.07812,.927358,-.146494,.18675,1.11928,.940385,-.120009,.152322,1.15609,.952672,-.0917183,.117514,1.18875,.968496,-.0620321,.0797405,1.21821,.985236,-.0314945,.0402383,1.24523,.99998,-575153e-9,110644e-9,1.27133,.0702429,-512222e-11,.255273,140947e-11,.0702981,-128826e-9,.255469,354488e-10,.0703691,-515562e-9,.255727,141874e-9,.0703805,-.00116,.255754,31929e-8,.0703961,-.00206224,.255813,567999e-9,.0704102,-.00322223,.255839,88871e-8,.0704298,-.00463928,.255863,.00128272,.0704759,-.00631375,.255953,.00175283,.0705434,-.00824317,.256079,.00230342,.0706693,-.010412,.25636,.0029443,.0708189,-.0128439,.256647,.00368031,.0710364,-.0155177,.257084,.00452614,.0713223,-.0184374,.257637,.00549706,.0717182,-.0216002,.258416,.00661246,.072321,-.0249966,.259699,.00790147,.0731446,-.0286566,.261475,.0093884,.0743352,-.0325888,.264132,.0111186,.0760676,-.036843,.26815,.013145,.078454,-.0414292,.273636,.0155251,.0818618,-.0464634,.281653,.0183525,.0857382,-.0519478,.289992,.0216642,.0908131,-.0579836,.30066,.0255956,.0967512,-.0645124,.312204,.0301954,.103717,-.0716505,.325001,.0356017,.111596,-.0793232,.338129,.041896,.120933,-.087645,.352853,.0492447,.130787,-.096492,.366192,.0576749,.142311,-.105973,.380864,.0673969,.155344,-.116182,.396575,.0785899,.169535,-.126815,.411443,.0912377,.185173,-.138015,.426256,.105607,.201755,-.149325,.439607,.121551,.221334,-.161207,.455467,.139608,.241461,-.173162,.469096,.159591,.26294,-.18504,.481014,.18156,.286776,-.196881,.493291,.205781,.311596,-.208311,.503556,.231819,.338667,-.219671,.513268,.260274,.366021,-.230451,.519414,.290862,.395875,-.240131,.526766,.323196,.425564,-.248566,.52905,.357071,.457094,-.256195,.530796,.393262,.488286,-.262331,.528703,.430797,.522291,-.267141,.52727,.470231,.554172,-.270411,.519848,.510477,.586427,-.271986,.510307,.551594,.619638,-.27192,.499158,.593849,.650656,-.269817,.483852,.636314,.68284,-.266267,.467515,.679679,.714356,-.26113,.44931,.723884,.742717,-.254067,.425789,.767245,.770894,-.245652,.401144,.811819,.797358,-.235554,.374224,.856315,.823377,-.223896,.346167,.901077,.847456,-.210865,.316056,.946502,.870697,-.196574,.284503,.993711,.891068,-.180814,.251628,1.04134,.909267,-.163314,.219065,1.08609,.925653,-.143304,.186446,1.12702,.940017,-.121322,.153416,1.16371,.952398,-.0973872,.120334,1.19712,.967568,-.0698785,.08352,1.22791,.984772,-.0390031,.0439209,1.25672,1.00026,-.0070087,.00315668,1.28428,.0556653,-459654e-11,.227325,112556e-11,.0565238,-116382e-9,.230826,284985e-10,.0565717,-465666e-9,.231026,114036e-9,.0565859,-.00104773,.231079,256656e-9,.0565761,-.00186255,.231025,45663e-8,.0565913,-.00291002,.231058,714664e-9,.0566108,-.00418998,.231085,.00103224,.0566532,-.00570206,.231169,.00141202,.0567473,-.00743666,.231417,.00186018,.0568567,-.00940298,.231661,.00238264,.0569859,-.0115991,.231895,.00298699,.0572221,-.0140096,.232456,.00368957,.057519,-.0166508,.233096,.00450303,.0579534,-.01951,.234094,.00544945,.0585922,-.0225991,.235629,.00655564,.0595647,-.0259416,.238106,.00785724,.0609109,-.0295661,.241557,.00939127,.0628751,-.0335126,.246652,.0112198,.0656908,-.0378604,.254091,.0134168,.0691347,-.0426543,.262666,.0160374,.0732165,-.0478967,.272029,.0191514,.0782863,-.0536716,.283007,.0228597,.0843973,-.0600683,.295732,.0272829,.0913598,-.0670095,.308779,.032484,.0994407,-.0745516,.322886,.0385886,.108189,-.082712,.336408,.0457133,.118574,-.0914927,.351692,.0539832,.129989,-.100854,.366502,.0635162,.142722,-.110837,.381675,.0744386,.156654,-.121353,.3963,.0868483,.172151,-.132414,.411477,.100963,.188712,-.143809,.42508,.116795,.208093,-.155765,.441328,.134715,.227936,-.167608,.454328,.154396,.249495,-.179579,.467235,.176179,.27362,-.191488,.480248,.200193,.296371,-.202618,.487886,.225775,.324234,-.214133,.499632,.25441,.353049,-.225212,.509532,.285077,.381785,-.234875,.514265,.317047,.414038,-.244205,.521282,.351874,.445251,-.252145,.522931,.388279,.476819,-.258433,.520947,.425825,.509209,-.263411,.517669,.465104,.542759,-.266732,.512841,.505741,.574822,-.268263,.503317,.547611,.609324,-.268489,.493035,.590953,.641772,-.266941,.478816,.63488,.674049,-.263297,.462863,.679072,.705071,-.257618,.442931,.723487,.734709,-.250625,.421299,.768708,.763704,-.24179,.397085,.814375,.791818,-.231115,.370577,.859907,.817439,-.21922,.34232,.906715,.843202,-.205658,.312627,.953943,.866639,-.190563,.280933,1.00185,.888129,-.173978,.248393,1.05105,.907239,-.155485,.216007,1.09704,.923893,-.134782,.183233,1.13857,.938882,-.11249,.150376,1.17539,.952464,-.0890706,.117177,1.20924,.968529,-.0646523,.0813095,1.24055,.984763,-.038606,.0439378,1.27018,1.00053,-.01238,.00598668,1.29873,.0437928,-409594e-11,.204012,8.79224e-7,.0440166,-103395e-9,.205049,221946e-10,.0440529,-413633e-9,.205225,887981e-10,.0440493,-930594e-9,.2052,199858e-9,.0439884,-.00165352,.204901,355495e-9,.0440716,-.0025849,.205255,556983e-9,.0440968,-.00372222,.205311,805326e-9,.0441359,-.00506478,.205391,.00110333,.0442231,-.00660384,.205638,.00145768,.0443254,-.00835246,.205877,.00187275,.0444832,-.0102992,.20627,.00235938,.0447001,-.0124449,.206796,.0029299,.0450168,-.0147935,.207593,.0036005,.0454816,-.017336,.208819,.00439246,.0462446,-.0201156,.211036,.00533864,.0473694,-.0231568,.214388,.00646984,.0490191,-.0264941,.219357,.00783856,.0512776,-.030184,.226061,.00950182,.0541279,-.0342661,.234094,.0115156,.0578989,-.0388539,.244297,.0139687,.0620835,-.0438735,.254457,.0169015,.0673497,-.04951,.266706,.0204554,.0731759,-.0556263,.278753,.0246606,.0803937,-.0624585,.29309,.0297126,.0879287,-.0697556,.305856,.0355868,.0970669,-.0778795,.321059,.0425768,.106508,-.0863541,.333873,.05056,.11776,-.0955935,.349008,.0598972,.130081,-.105438,.363776,.0706314,.144454,-.115899,.380112,.0828822,.1596,-.126827,.394843,.0967611,.176097,-.138161,.409033,.112381,.194726,-.149904,.424257,.129952,.213944,-.161675,.436945,.149333,.235516,-.173659,.450176,.170892,.260564,-.185963,.466305,.194984,.285183,-.197582,.477328,.220805,.311095,-.208697,.486566,.248694,.338924,-.219519,.494811,.279015,.369757,-.229766,.504065,.311725,.3996,-.238879,.507909,.345844,.430484,-.246802,.509805,.381749,.46413,-.253924,.511436,.420251,.497077,-.259319,.508787,.459957,.530434,-.263297,.50394,.501356,.565725,-.265619,.49804,.544252,.599254,-.265842,.487346,.587856,.631251,-.263978,.472975,.631969,.663972,-.26043,.457135,.677471,.697724,-.255358,.439844,.723744,.727725,-.248308,.417872,.770653,.756417,-.239181,.39273,.817357,.785419,-.22814,.367839,.864221,.81266,-.215681,.339449,.912701,.839391,-.201623,.309279,.962419,.86366,-.185624,.278029,1.0122,.885028,-.16797,.245294,1.06186,.904639,-.148336,.212689,1.10934,.922048,-.12637,.179616,1.15063,.936952,-.102928,.146749,1.18885,.951895,-.0785268,.112733,1.22352,.967198,-.0530153,.0760056,1.25681,.984405,-.02649,.0383183,1.28762,1.00021,70019e-8,-20039e-8,1.31656,.0325964,-355447e-11,.176706,6.55682e-7,.0329333,-899174e-10,.178527,165869e-10,.0329181,-359637e-9,.178453,663498e-10,.0329085,-808991e-9,.178383,149332e-9,.0329181,-.00143826,.178394,265873e-9,.0329425,-.00224678,.178517,416597e-9,.0329511,-.00323575,.17849,603299e-9,.033011,-.00439875,.178695,829422e-9,.0330733,-.00574059,.178843,.00109908,.0331857,-.00725896,.179176,.00141933,.0333445,-.00895289,.179618,.0017999,.0335674,-.0108219,.180238,.00225316,.033939,-.0128687,.181417,.00279765,.0345239,-.015114,.183395,.0034564,.0354458,-.017596,.186616,.00425864,.0368313,-.0203524,.191547,.00524936,.0386115,-.0234105,.197508,.00647033,.0410303,-.0268509,.205395,.00798121,.0442245,-.0307481,.215365,.0098557,.0478659,-.0350863,.225595,.0121417,.0522416,-.0399506,.236946,.0149385,.0574513,-.045357,.249442,.0183189,.0631208,-.0512863,.261222,.0223644,.0701124,-.0579273,.275418,.0272418,.0777331,-.0650652,.288989,.0329458,.0862709,-.0728813,.302546,.0396819,.096103,-.081363,.317164,.04757,.106976,-.0904463,.331733,.0567012,.119175,-.100105,.34661,.067202,.132919,-.110375,.362249,.0792588,.147727,-.121115,.376978,.0928672,.163618,-.132299,.390681,.108228,.182234,-.143887,.406571,.125502,.201809,-.155827,.42042,.144836,.225041,-.168357,.438411,.166706,.247621,-.18004,.450368,.189909,.27097,-.191536,.460083,.215251,.296658,-.203024,.469765,.243164,.325892,-.214056,.481837,.273388,.35406,-.224104,.487474,.305344,.384372,-.233489,.492773,.339741,.41749,-.241874,.498451,.376287,.45013,-.248834,.499632,.414195,.481285,-.254658,.495233,.454077,.519183,-.259367,.496401,.496352,.551544,-.261818,.487686,.538798,.587349,-.262964,.479453,.583626,.621679,-.262128,.467709,.629451,.654991,-.258998,.452123,.67566,.686873,-.254119,.433495,.723248,.719801,-.246946,.413657,.771156,.750355,-.237709,.390366,.81989,.780033,-.226549,.364947,.868601,.809254,-.214186,.337256,.920034,.836576,-.199639,.307395,.971706,.861774,-.183169,.275431,1.02479,.885707,-.165111,.243431,1.07837,.904742,-.144363,.210921,1.12783,.915604,-.121305,.17647,1.17254,.930959,-.0962119,.143106,1.21012,.948404,-.069969,.108112,1.24474,.967012,-.0427586,.0708478,1.27718,.984183,-.0147043,.032335,1.3083,.999577,.0142165,-.00726867,1.3382,.0229227,-299799e-11,.148623,4.62391e-7,.0232194,-758796e-10,.15054,117033e-10,.0232315,-303636e-9,.15063,468397e-10,.0232354,-683189e-9,.150624,105472e-9,.0232092,-.0012136,.150445,187744e-9,.0232523,-.00189765,.150679,294847e-9,.0232828,-.00273247,.150789,428013e-9,.0233371,-.00371287,.150995,591134e-9,.0234015,-.00484794,.15118,787642e-9,.023514,-.00612877,.151562,.00102547,.023679,-.00756125,.152116,.00131351,.0239559,-.00914651,.153162,.00166594,.0244334,-.010904,.155133,.00210182,.025139,-.0128615,.158035,.00264406,.0262598,-.0150628,.162751,.00332923,.0277875,-.0175532,.168944,.00419773,.0298472,-.0203981,.176835,.00530034,.0325444,-.023655,.186686,.00669777,.0355581,-.0272982,.196248,.00842661,.0392841,-.0314457,.207352,.0105854,.0436815,-.0361157,.219279,.0132458,.0485272,-.0412932,.230728,.0164736,.0541574,-.0470337,.242994,.0203715,.0609479,-.0535002,.257042,.0250953,.0685228,-.0605409,.27102,.0306856,.0768042,-.0680553,.28406,.037193,.0864844,-.0765011,.299186,.0449795,.0969415,-.0852674,.3132,.0538316,.108478,-.0947333,.327138,.0641149,.121705,-.10481,.342345,.0759185,.136743,-.115474,.358472,.0894116,.152986,-.126536,.374067,.104562,.170397,-.138061,.388267,.121632,.191392,-.150203,.406467,.140996,.211566,-.161751,.418641,.161696,.233567,-.173407,.430418,.184557,.257769,-.185397,.44277,.210092,.28531,-.197048,.457191,.237827,.311726,-.20784,.464712,.267253,.340537,-.218345,.472539,.299332,.372921,-.228306,.482331,.333988,.402924,-.236665,.484378,.369722,.434475,-.244097,.484717,.407836,.469736,-.250547,.487093,.448465,.505045,-.25511,.485575,.490263,.540262,-.258444,.481225,.534495,.576347,-.259903,.473481,.579451,.608656,-.259572,.4603,.625604,.646679,-.257908,.450341,.674511,.679902,-.253663,.431561,.723269,.714159,-.247419,.412684,.773263,.745345,-.239122,.389388,.824182,.778248,-.228837,.365361,.876634,.807208,-.216197,.337667,.92945,.835019,-.201772,.307197,.985261,.860261,-.185291,.274205,1.04299,.877601,-.165809,.240178,1.09816,.898211,-.143897,.207571,1.14694,.915789,-.119513,.174904,1.19008,.931831,-.0932919,.141423,1.2297,.949244,-.0656528,.105603,1.26553,.967527,-.0370262,.0679551,1.29986,.984139,-.00730117,.0283133,1.33252,.999713,.0234648,-.0121785,1.36397,.0152135,-245447e-11,.122795,3.04092e-7,.0151652,-615778e-10,.122399,76292e-10,.0151181,-245948e-9,.122023,304802e-10,.0151203,-553394e-9,.12203,686634e-10,.015125,-983841e-9,.122037,122463e-9,.0151427,-.00153774,.12214,192706e-9,.0151708,-.0022103,.122237,281219e-9,.0152115,-.00300741,.12238,390804e-9,.0152877,-.00392494,.1227,526317e-9,.015412,-.00496597,.123244,69443e-8,.0156201,-.00613314,.124228,90547e-8,.0159658,-.00744113,.125945,.0011732,.0165674,-.00892546,.129098,.00151888,.017487,-.010627,.133865,.00197007,.018839,-.0126043,.140682,.0025637,.020554,-.0148814,.148534,.00333637,.0226727,-.0175123,.157381,.00433738,.0251879,-.0205266,.166685,.00561664,.0283635,-.0240319,.177796,.00725563,.0318694,-.0279432,.188251,.00928811,.0361044,-.0324313,.200038,.011835,.0406656,-.0373527,.210685,.0149146,.0463846,-.0430132,.224182,.0187254,.0525696,-.0491013,.23634,.0232283,.0598083,-.0559175,.250013,.0286521,.0679437,-.0633657,.263981,.0350634,.0771181,-.0714602,.278072,.0425882,.0881273,-.0803502,.29511,.0514487,.0996628,-.0896903,.309976,.0615766,.112702,-.099644,.325611,.0732139,.126488,-.109829,.339321,.0862324,.142625,-.120859,.35574,.101275,.15953,-.131956,.369845,.117892,.176991,-.143145,.38146,.136205,.199715,-.155292,.40052,.157252,.220787,-.167066,.412055,.179966,.243697,-.178396,.423133,.204418,.272106,-.190433,.439524,.232141,.297637,-.201265,.447041,.261109,.325273,-.211834,.454488,.292627,.357219,-.221889,.465004,.326669,.387362,-.230729,.468527,.362426,.423131,-.23924,.475836,.401533,.45543,-.246067,.475017,.441902,.493393,-.251557,.478017,.484239,.526253,-.255571,.4709,.528586,.560554,-.257752,.463167,.574346,.599306,-.258076,.456452,.621655,.634541,-.256471,.443725,.670492,.668907,-.253283,.428719,.721943,.705619,-.247562,.411348,.772477,.739034,-.240626,.388939,.8264,.771408,-.231493,.36425,.881702,.803312,-.220125,.337321,.9385,.828457,-.206645,.305364,.997437,.854819,-.190664,.273715,1.05693,.878666,-.171429,.242218,1.11251,.898404,-.149235,.209556,1.16398,.917416,-.12435,.176863,1.21014,.933133,-.0972703,.142775,1.25178,.95066,-.0683607,.106735,1.29028,.968589,-.0378724,.0681609,1.32703,.984776,-.00605712,.0273966,1.36158,.99994,.0263276,-.0138124,1.3943,.00867437,-186005e-11,.0928979,1.73682e-7,.00864003,-466389e-10,.0925237,435505e-11,.00864593,-186594e-9,.0925806,174322e-10,.00864095,-419639e-9,.0924903,392862e-10,.00863851,-746272e-9,.0924589,702598e-10,.00868531,-.00116456,.0929,111188e-9,.00869667,-.00167711,.0928529,163867e-9,.00874332,-.00228051,.0930914,23104e-8,.00882709,-.00297864,.0935679,31741e-8,.00898874,-.00377557,.0946165,430186e-9,.00929346,-.00469247,.0967406,580383e-9,.00978271,-.00575491,.100084,783529e-9,.0105746,-.00701514,.105447,.00106304,.0116949,-.00851797,.112494,.00144685,.0130419,-.0102757,.119876,.00196439,.0148375,-.012381,.129034,.00266433,.0168725,-.01482,.137812,.00358364,.0193689,-.0176563,.147696,.00478132,.0222691,-.0209211,.157795,.00631721,.0256891,-.0246655,.168431,.00826346,.0294686,-.0288597,.178587,.0106714,.0340412,-.0336441,.190251,.0136629,.0393918,-.039033,.202999,.0173272,.0453947,-.0450087,.215655,.0217448,.0521936,-.0515461,.228686,.0269941,.0600279,-.058817,.242838,.033272,.0692398,-.0667228,.258145,.0406457,.0793832,-.0752401,.273565,.0492239,.0902297,-.0841851,.287735,.0590105,.102014,-.0936479,.301161,.0702021,.116054,-.103967,.317438,.0832001,.13191,-.114622,.334166,.0977951,.148239,-.125452,.348192,.113985,.165809,-.136453,.361094,.131928,.184616,-.147648,.373534,.151811,.207491,-.159607,.39101,.174476,.230106,-.171119,.402504,.198798,.257036,-.182906,.418032,.225796,.281172,-.193605,.425468,.254027,.312034,-.204771,.440379,.285713,.340402,-.214988,.445406,.319196,.370231,-.224711,.44968,.35537,.407105,-.233516,.460747,.393838,.439037,-.240801,.460624,.433747,.47781,-.24762,.465957,.477234,.510655,-.251823,.460054,.52044,.550584,-.255552,.459172,.567853,.585872,-.257036,.450311,.615943,.620466,-.257535,.437763,.667693,.660496,-.255248,.426639,.718988,.695578,-.251141,.409185,.772503,.732176,-.244718,.39015,.827023,.760782,-.236782,.362594,.885651,.79422,-.225923,.33711,.943756,.824521,-.213855,.308272,1.00874,.854964,-.197723,.278529,1.06764,.878065,-.179209,.246208,1.12836,.899834,-.157569,.21329,1.18318,.918815,-.133206,.181038,1.23161,.934934,-.106545,.146993,1.27644,.952115,-.0780574,.111175,1.31842,.96906,-.0478279,.0728553,1.35839,.985178,-.0160014,.032579,1.39697,1.00039,.0173126,-.0095256,1.43312,.00384146,-124311e-11,.0613583,7.78271e-8,.00390023,-314043e-10,.0622919,196626e-11,.00389971,-125622e-9,.0622632,787379e-11,.00389491,-282352e-9,.0620659,1778e-8,.00391618,-502512e-9,.0624687,320918e-10,.00392662,-784458e-9,.0625113,515573e-10,.00396053,-.00112907,.0628175,778668e-10,.00401911,-.00153821,.0633286,113811e-9,.00414994,-.0020208,.0646443,16445e-8,.00441223,-.00260007,.0673886,237734e-9,.00484427,-.0033097,.0716528,345929e-9,.00549109,-.00418966,.0774998,505987e-9,.00636293,-.00527331,.0844758,739208e-9,.00746566,-.00660428,.0921325,.00107347,.00876625,-.00818826,.0997067,.00153691,.0103125,-.0100811,.107433,.00217153,.0123309,-.0123643,.117088,.00303427,.0146274,-.0150007,.126438,.00416018,.0172295,-.0180531,.135672,.00561513,.0204248,-.0215962,.146244,.007478,.0241597,-.0256234,.157481,.00981046,.0284693,-.0302209,.169125,.0127148,.033445,-.0353333,.181659,.0162453,.0391251,-.0410845,.1944,.0205417,.0454721,-.0473451,.207082,.0256333,.0530983,-.0542858,.221656,.0317036,.0615356,-.0618384,.236036,.0388319,.0703363,-.0697631,.248398,.046974,.0810391,-.0784757,.263611,.0565246,.0920144,-.0873488,.275857,.0671724,.105584,-.0973652,.292555,.0798105,.119506,-.107271,.306333,.0935945,.134434,-.117608,.318888,.109106,.153399,-.128938,.337552,.127074,.171258,-.139944,.349955,.14643,.191059,-.151288,.361545,.168,.215069,-.163018,.378421,.192082,.237838,-.174226,.38879,.217838,.266965,-.186063,.405857,.246931,.292827,-.196909,.414146,.277505,.324352,-.207473,.426955,.310711,.354427,-.217713,.433429,.346794,.389854,-.227183,.443966,.385237,.420749,-.235131,.44471,.424955,.459597,-.242786,.451729,.468446,.495316,-.248767,.45072,.513422,.534903,-.253351,.450924,.560618,.572369,-.256277,.445266,.609677,.612383,-.2576,.438798,.660995,.644037,-.256931,.421693,.713807,.686749,-.254036,.4109,.767616,.719814,-.249785,.390151,.82533,.754719,-.244283,.367847,.888311,.792022,-.235076,.345013,.948177,.822404,-.225061,.316193,1.01661,.853084,-.211113,.287013,1.08075,.879871,-.19449,.255424,1.14501,.901655,-.174023,.222879,1.20203,.919957,-.1509,.18989,1.25698,.938412,-.124923,.15606,1.30588,.953471,-.0968139,.120512,1.3529,.970451,-.066734,.0828515,1.3986,.985522,-.034734,.0424458,1.44148,1.00099,-.00102222,678929e-9,1.48398,965494e-9,-6.27338e-7,.0306409,1.97672e-8,99168e-8,-158573e-10,.0314638,4.99803e-7,991068e-9,-634012e-10,.031363,200682e-11,974567e-9,-14144e-8,.03036,457312e-11,998079e-9,-252812e-9,.031496,860131e-11,.00102243,-396506e-9,.0319955,148288e-10,.00107877,-577593e-9,.0331376,249141e-10,.00121622,-816816e-9,.0359396,423011e-10,.0014455,-.00113761,.0399652,724613e-10,.00178791,-.00156959,.0450556,123929e-9,.00225668,-.00214064,.0508025,208531e-9,.00285627,-.00287655,.0568443,341969e-9,.0035991,-.00380271,.0630892,544158e-9,.00455524,-.00496264,.0702204,842423e-9,.00569143,-.0063793,.0773426,.00126704,.00716928,-.00813531,.0860839,.00186642,.00885307,-.0101946,.0944079,.00267014,.0109316,-.0126386,.103951,.00374033,.0133704,-.0154876,.113786,.0051304,.0161525,-.0187317,.123477,.00688858,.0194267,-.0224652,.133986,.00910557,.0230967,-.0265976,.143979,.0118074,.0273627,-.0312848,.154645,.0151266,.0323898,-.0365949,.166765,.0191791,.0379225,-.0422914,.177932,.0239236,.0447501,-.0487469,.19167,.0296568,.0519391,-.0556398,.203224,.0362924,.0599464,-.0631646,.215652,.0440585,.0702427,-.0714308,.232089,.0531619,.0806902,-.0800605,.245258,.0634564,.0923194,-.0892815,.258609,.0752481,.106938,-.09931,.276654,.0888914,.121238,-.109575,.289847,.104055,.138817,-.120461,.307566,.121266,.15595,-.131209,.320117,.139944,.178418,-.143049,.339677,.161591,.197875,-.154074,.349886,.184303,.224368,-.166307,.369352,.210669,.252213,-.178051,.386242,.238895,.277321,-.189335,.395294,.269182,.310332,-.200683,.412148,.302508,.338809,-.210856,.418266,.337264,.372678,-.220655,.428723,.374881,.405632,-.230053,.433887,.415656,.442293,-.237993,.439911,.457982,.477256,-.244897,.440175,.502831,.515592,-.250657,.441079,.550277,.550969,-.255459,.435219,.601102,.592883,-.257696,.432882,.651785,.629092,-.259894,.421054,.708961,.672033,-.258592,.41177,.763806,.709147,-.256525,.395267,.824249,.745367,-.254677,.375013,.8951,.784715,-.247892,.353906,.959317,.818107,-.240162,.327801,1.03153,.847895,-.229741,.298821,1.10601,.879603,-.213084,.269115,1.164,.902605,-.195242,.236606,1.22854,.922788,-.174505,.203442,1.29017,.944831,-.150169,.169594,1.34157,.959656,-.124099,.135909,1.3956,.972399,-.0960626,.0990563,1.45128,.986549,-.0657097,.0602348,1.50312,1.00013,-.0333558,.0186694,1.55364,619747e-11,-1e-7,.00778326,796756e-16,2.37499e-8,-9.99999e-8,282592e-10,1.14596e-10,100292e-11,-166369e-11,250354e-9,6.77492e-9,350752e-11,-637769e-11,357289e-9,6.31655e-8,826445e-11,-174689e-10,516179e-9,3.1851e-7,242481e-10,-450868e-10,.0010223,130577e-11,455631e-10,-89044e-9,.00144302,374587e-11,971222e-10,-178311e-9,.00241912,102584e-10,171403e-9,-313976e-9,.00354938,236481e-10,292747e-9,-520026e-9,.00513765,496014e-10,789827e-9,-.00118187,.0238621,139056e-9,.00114093,-.00171827,.0286691,244093e-9,.00176119,-.00249667,.0368565,420623e-9,.0022233,-.00333742,.0400469,65673e-8,.00343382,-.00481976,.0535751,.00109323,.00427602,-.00600755,.057099,.00155268,.00461435,-.00737637,.0551084,.00215031,.00695698,-.00971401,.0715767,.00316529,.00867619,-.0120943,.0793314,.00436995,.0106694,-.0148202,.0869391,.0058959,.0140351,-.0183501,.101572,.00798757,.0168939,-.022006,.11018,.0104233,.020197,-.0261568,.119041,.0134167,.0254702,-.0312778,.135404,.0173009,.0298384,-.0362469,.1437,.0215428,.035159,-.042237,.15512,.0268882,.0427685,-.0488711,.17128,.033235,.0494848,-.0557997,.181813,.0404443,.0592394,-.0635578,.198745,.0490043,.0681463,-.071838,.210497,.0588239,.0804753,-.0809297,.228864,.0702835,.0942205,-.0906488,.247008,.0834012,.106777,-.100216,.258812,.0975952,.124471,-.110827,.278617,.114162,.138389,-.121193,.287049,.131983,.159543,-.13253,.307151,.152541,.176432,-.143611,.31564,.174673,.201723,-.15548,.33538,.199842,.229721,-.167166,.355256,.227097,.250206,-.178238,.360047,.256014,.282118,-.189905,.378761,.28855,.312821,-.201033,.39181,.323348,.341482,-.211584,.397716,.360564,.377368,-.221314,.410141,.400004,.418229,-.230474,.423485,.442371,.444881,-.239443,.418874,.488796,.488899,-.245987,.427545,.535012,.520317,-.253948,.422147,.589678,.568566,-.256616,.42719,.637683,.599607,-.26376,.415114,.703363,.64222,-.268687,.408715,.771363,.685698,-.2694,.399722,.83574,.732327,-.266642,.388651,.897764,.769873,-.267712,.369198,.983312,.806733,-.263479,.346802,1.06222,.843466,-.254575,.321368,1.13477,.873008,-.242749,.29211,1.20712,.908438,-.22725,.262143,1.27465,.936321,-.207621,.228876,1.33203,.950353,-.187932,.19484,1.40439,.96442,-.165154,.163178,1.4732,.979856,-.139302,.127531,1.53574,.982561,-.11134,.0903457,1.59982,.996389,-.0808124,.0489007,1.6577],t=[1,0,0,0,1,791421e-36,0,0,1,104392e-29,0,0,1,349405e-26,0,0,1,109923e-23,0,0,1,947414e-22,0,0,1,359627e-20,0,0,1,772053e-19,0,0,1,108799e-17,0,0,1,110655e-16,0,0,1,865818e-16,0,0,.999998,5.45037e-10,0,0,.999994,2.85095e-9,0,0,.999989,1.26931e-8,0,0,.999973,4.89938e-8,0,0,.999947,1.66347e-7,0,0,.999894,5.02694e-7,0,0,.999798,136532e-11,0,0,.999617,335898e-11,0,0,.999234,752126e-11,0,0,.998258,152586e-10,0,0,.99504,266207e-10,0,0,.980816,236802e-10,0,0,.967553,207684e-11,0,0,.966877,403733e-11,0,0,.965752,741174e-11,0,0,.96382,127746e-10,0,0,.960306,202792e-10,0,0,.953619,280232e-10,0,0,.941103,278816e-10,0,0,.926619,160221e-10,0,0,.920983,235164e-10,0,0,.912293,311924e-10,0,.0158731,.899277,348118e-10,0,.0476191,.880884,26041e-9,0,.0793651,.870399,338726e-10,0,.111111,.856138,392906e-10,0,.142857,.837436,372874e-10,0,.174603,.820973,392558e-10,0,.206349,.803583,434658e-10,0,.238095,.782168,40256e-9,0,.269841,.764107,448159e-10,0,.301587,.743092,457627e-10,0,.333333,.721626,455314e-10,0,.365079,.700375,477335e-10,0,.396825,.677334,461072e-10,0,.428571,.655702,484393e-10,0,.460317,.632059,464583e-10,0,.492064,.610125,483923e-10,0,.52381,.58653,464342e-10,0,.555556,.564508,477033e-10,0,.587302,.541405,459263e-10,0,.619048,.519556,46412e-9,0,.650794,.497292,448913e-10,0,.68254,.475898,445789e-10,0,.714286,.454722,433496e-10,0,.746032,.434042,423054e-10,0,.777778,.414126,413737e-10,0,.809524,.394387,397265e-10,0,.84127,.375841,390709e-10,0,.873016,.357219,369938e-10,0,.904762,.340084,365618e-10,0,.936508,.322714,342533e-10,0,.968254,.306974,339596e-10,0,1,1,101524e-23,0,0,1,10292e-22,0,0,1,130908e-23,0,0,1,473331e-23,0,0,1,625319e-22,0,0,1,107932e-20,0,0,1,163779e-19,0,0,1,203198e-18,0,0,1,204717e-17,0,0,.999999,168995e-16,0,0,.999998,1.15855e-10,0,0,.999996,6.6947e-10,0,0,.999991,3.30863e-9,0,0,.999983,1.41737e-8,0,0,.999968,5.32626e-8,0,0,.99994,1.77431e-7,0,0,.999891,5.28835e-7,0,0,.999797,142169e-11,0,0,.999617,347057e-11,0,0,.999227,77231e-10,0,0,.998239,155753e-10,0,0,.994937,268495e-10,0,0,.980225,213742e-10,0,0,.967549,21631e-10,0,0,.966865,417989e-11,0,0,.965739,763341e-11,0,0,.963794,130892e-10,0,0,.960244,206456e-10,0,0,.953495,282016e-10,0,148105e-9,.940876,271581e-10,0,.002454,.926569,164159e-10,0,.00867491,.920905,239521e-10,0,.01956,.912169,315127e-10,0,.035433,.899095,346626e-10,0,.056294,.882209,290223e-10,0,.0818191,.870272,342992e-10,0,.111259,.855977,394164e-10,0,.142857,.837431,372343e-10,0,.174603,.820826,396691e-10,0,.206349,.803408,435395e-10,0,.238095,.782838,419579e-10,0,.269841,.763941,450953e-10,0,.301587,.742904,455847e-10,0,.333333,.721463,458833e-10,0,.365079,.700197,477159e-10,0,.396825,.677501,470641e-10,0,.428571,.655527,484732e-10,0,.460317,.6324,476834e-10,0,.492064,.609964,484213e-10,0,.52381,.586839,475541e-10,0,.555556,.564353,476951e-10,0,.587302,.541589,467611e-10,0,.619048,.519413,463493e-10,0,.650794,.497337,453994e-10,0,.68254,.475797,445308e-10,0,.714286,.454659,435787e-10,0,.746032,.434065,424839e-10,0,.777778,.414018,41436e-9,0,.809524,.39455,401902e-10,0,.84127,.375742,390813e-10,0,.873016,.357501,377116e-10,0,.904762,.339996,36535e-9,0,.936508,.323069,351265e-10,0,.968254,.306897,339112e-10,0,1,1,10396e-19,0,0,1,104326e-20,0,0,1,110153e-20,0,0,1,144668e-20,0,0,1,34528e-19,0,0,1,175958e-19,0,0,1,12627e-17,0,0,1,936074e-18,0,0,1,645742e-17,0,0,.999998,401228e-16,0,0,.999997,2.22338e-10,0,0,.999995,1.0967e-9,0,0,.999991,4.82132e-9,0,0,.999981,1.89434e-8,0,0,.999967,6.67716e-8,0,0,.999938,2.12066e-7,0,0,.999886,6.0977e-7,0,0,.999792,159504e-11,0,0,.999608,381191e-11,0,0,.999209,833727e-11,0,0,.998179,165288e-10,0,0,.994605,274387e-10,0,0,.979468,167316e-10,0,0,.967529,242877e-11,0,0,.966836,461696e-11,0,0,.96569,830977e-11,0,0,.963706,140427e-10,0,244659e-11,.960063,217353e-10,0,760774e-9,.953113,286606e-10,0,.00367261,.940192,247691e-10,0,.00940263,.927731,195814e-10,0,.018333,.920669,252531e-10,0,.0306825,.911799,324277e-10,0,.0465556,.89857,340982e-10,0,.0659521,.883283,319622e-10,0,.0887677,.86989,35548e-9,0,.114784,.855483,397143e-10,0,.143618,.837987,391665e-10,0,.174606,.820546,411306e-10,0,.206349,.802878,436753e-10,0,.238095,.783402,444e-7,0,.269841,.763439,458726e-10,0,.301587,.742925,467097e-10,0,.333333,.721633,478887e-10,0,.365079,.69985,481251e-10,0,.396825,.67783,491811e-10,0,.428571,.655126,488199e-10,0,.460318,.632697,496025e-10,0,.492064,.609613,48829e-9,0,.52381,.587098,492754e-10,0,.555556,.564119,482625e-10,0,.587302,.541813,482807e-10,0,.619048,.519342,471552e-10,0,.650794,.497514,466765e-10,0,.68254,.475879,455582e-10,0,.714286,.454789,446007e-10,0,.746032,.434217,435382e-10,0,.777778,.414086,421753e-10,0,.809524,.394744,412093e-10,0,.84127,.375782,396634e-10,0,.873016,.357707,386419e-10,0,.904762,.340038,370345e-10,0,.936508,.323284,359725e-10,0,.968254,.306954,3436e-8,0,1,1,599567e-19,0,0,1,600497e-19,0,0,1,614839e-19,0,0,1,686641e-19,0,0,1,972658e-19,0,0,1,221271e-18,0,0,1,833195e-18,0,0,1,403601e-17,0,0,.999999,206001e-16,0,0,.999998,1.01739e-10,0,0,.999997,4.70132e-10,0,0,.999993,2.00436e-9,0,0,.999988,7.83682e-9,0,0,.999979,2.80338e-8,0,0,.999962,9.17033e-8,0,0,.999933,2.74514e-7,0,0,.999881,7.53201e-7,0,0,.999783,189826e-11,0,0,.999594,440279e-11,0,0,.999178,93898e-10,0,0,.998073,181265e-10,0,0,.993993,280487e-10,0,0,.979982,149422e-10,0,0,.968145,378481e-11,0,0,.966786,53771e-10,0,0,.965611,947508e-11,0,388934e-10,.963557,156616e-10,0,9693e-7,.959752,235144e-10,0,.00370329,.952461,291568e-10,0,.00868428,.940193,240102e-10,0,.0161889,.929042,231235e-10,0,.0263948,.920266,273968e-10,0,.0394088,.911178,337915e-10,0,.0552818,.897873,333629e-10,0,.0740138,.884053,351405e-10,0,.0955539,.869455,378034e-10,0,.119795,.854655,399378e-10,0,.14656,.838347,419108e-10,0,.175573,.820693,440831e-10,0,.206388,.802277,445599e-10,0,.238095,.783634,472691e-10,0,.269841,.763159,476984e-10,0,.301587,.742914,491487e-10,0,.333333,.721662,502312e-10,0,.365079,.699668,502817e-10,0,.396825,.677839,51406e-9,0,.428571,.655091,511095e-10,0,.460317,.632665,516067e-10,0,.492064,.609734,512255e-10,0,.52381,.587043,510263e-10,0,.555556,.564298,50565e-9,0,.587302,.541769,497951e-10,0,.619048,.519529,492698e-10,0,.650794,.497574,482066e-10,0,.68254,.476028,473689e-10,0,.714286,.454961,461941e-10,0,.746032,.434341,450618e-10,0,.777778,.414364,438355e-10,0,.809524,.394832,424196e-10,0,.84127,.376109,412563e-10,0,.873016,.35779,396226e-10,0,.904762,.340379,384886e-10,0,.936508,.323385,368214e-10,0,.968254,.307295,356636e-10,0,1,1,106465e-17,0,0,1,106555e-17,0,0,1,107966e-17,0,0,1,114601e-17,0,0,1,137123e-17,0,0,1,21243e-16,0,0,.999999,489653e-17,0,0,.999999,160283e-16,0,0,.999998,62269e-15,0,0,.999997,2.51859e-10,0,0,.999996,9.96192e-10,0,0,.999992,3.74531e-9,0,0,.999986,1.32022e-8,0,0,.999975,4.33315e-8,0,0,.999959,1.31956e-7,0,0,.999927,3.72249e-7,0,0,.999871,9.72461e-7,0,0,.999771,235343e-11,0,0,.999572,52768e-10,0,0,.999133,109237e-10,0,0,.997912,203675e-10,0,0,.993008,279396e-10,0,0,.980645,139604e-10,0,0,.970057,646596e-11,0,0,.966717,65089e-10,0,474145e-10,.965497,111863e-10,0,89544e-8,.96334,179857e-10,0,.0032647,.959294,259045e-10,0,.0075144,.951519,292327e-10,0,.0138734,.940517,249769e-10,0,.0224952,.93014,26803e-9,0,.0334828,.91972,303656e-10,0,.0468973,.910294,353323e-10,0,.0627703,.897701,351002e-10,0,.0811019,.884522,388104e-10,0,.10186,.869489,412932e-10,0,.124985,.853983,415781e-10,0,.150372,.838425,454066e-10,0,.177868,.820656,471624e-10,0,.207245,.801875,475243e-10,0,.238143,.783521,505621e-10,0,.269841,.763131,50721e-9,0,.301587,.74261,523293e-10,0,.333333,.72148,528699e-10,0,.365079,.699696,538677e-10,0,.396825,.677592,539255e-10,0,.428571,.65525,546367e-10,0,.460317,.632452,541348e-10,0,.492064,.609903,544976e-10,0,.52381,.586928,536201e-10,0,.555556,.564464,535185e-10,0,.587302,.541801,524949e-10,0,.619048,.519681,51812e-9,0,.650794,.497685,507687e-10,0,.68254,.47622,496243e-10,0,.714286,.455135,485714e-10,0,.746032,.4346,471847e-10,0,.777778,.414564,459294e-10,0,.809524,.395165,444705e-10,0,.84127,.376333,430772e-10,0,.873016,.358197,416229e-10,0,.904762,.34064,401019e-10,0,.936508,.323816,386623e-10,0,.968254,.307581,370933e-10,0,1,1,991541e-17,0,0,1,992077e-17,0,0,1,100041e-16,0,0,1,10385e-15,0,0,1,115777e-16,0,0,1,150215e-16,0,0,.999999,254738e-16,0,0,.999999,598822e-16,0,0,.999998,1.79597e-10,0,0,.999997,6.02367e-10,0,0,.999994,2.06835e-9,0,0,.99999,6.94952e-9,0,0,.999984,2.23363e-8,0,0,.999972,6.78578e-8,0,0,.999952,1.93571e-7,0,0,.999919,5.16594e-7,0,0,.99986,128739e-11,0,0,.999753,299298e-11,0,0,.999546,648258e-11,0,0,.999074,129985e-10,0,0,.997671,232176e-10,0,0,.991504,256701e-10,0,0,.981148,131141e-10,0,0,.971965,869048e-11,0,280182e-10,.966624,808301e-11,0,695475e-9,.965344,135235e-10,0,.00265522,.963048,210592e-10,0,.00622975,.958673,287473e-10,0,.0116234,.950262,281379e-10,0,.018976,.940836,271089e-10,0,.0283844,.930996,30926e-9,0,.0399151,.919848,348359e-10,0,.0536063,.909136,366092e-10,0,.0694793,.897554,384162e-10,0,.0875342,.884691,430971e-10,0,.107749,.869414,447803e-10,0,.130087,.853462,452858e-10,0,.154481,.838187,495769e-10,0,.180833,.820381,502709e-10,0,.209005,.801844,522713e-10,0,.238791,.783061,541505e-10,0,.269869,.763205,553712e-10,0,.301587,.742362,564909e-10,0,.333333,.721393,572646e-10,0,.365079,.699676,581012e-10,0,.396825,.677395,58096e-9,0,.428571,.655208,585766e-10,0,.460317,.632451,583602e-10,0,.492064,.609839,580234e-10,0,.52381,.587093,577161e-10,0,.555556,.564467,568447e-10,0,.587302,.542043,563166e-10,0,.619048,.519826,55156e-9,0,.650794,.497952,541682e-10,0,.68254,.476477,528971e-10,0,.714286,.455412,514952e-10,0,.746032,.434926,502222e-10,0,.777778,.4149,485779e-10,0,.809524,.395552,472242e-10,0,.84127,.376712,454891e-10,0,.873016,.358622,440924e-10,0,.904762,.341048,422984e-10,0,.936508,.324262,408582e-10,0,.968254,.308013,390839e-10,0,1,1,613913e-16,0,0,1,614145e-16,0,0,1,617708e-16,0,0,1,633717e-16,0,0,1,681648e-16,0,0,1,808291e-16,0,0,1,1.14608e-10,0,0,.999998,2.10507e-10,0,0,.999997,4.99595e-10,0,0,.999995,1.39897e-9,0,0,.999994,4.19818e-9,0,0,.999988,1.27042e-8,0,0,.999979,3.75153e-8,0,0,.999965,1.06206e-7,0,0,.999945,2.85381e-7,0,0,.999908,7.23611e-7,0,0,.999846,17255e-10,0,0,.999733,386104e-11,0,0,.999511,808493e-11,0,0,.998993,156884e-10,0,0,.997326,265538e-10,0,0,.989706,206466e-10,0,0,.981713,130756e-10,0,70005e-10,.973636,106473e-10,0,464797e-9,.966509,10194e-9,0,.00201743,.965149,165881e-10,0,.00497549,.962669,249147e-10,0,.00953262,.95786,317449e-10,0,.0158211,.949334,281045e-10,0,.0239343,.941041,303263e-10,0,.0339372,.931575,356754e-10,0,.0458738,.920102,397075e-10,0,.059772,.908002,384886e-10,0,.075645,.897269,43027e-9,0,.0934929,.884559,479925e-10,0,.113302,.869161,48246e-9,0,.135045,.853342,509505e-10,0,.158678,.837633,542846e-10,0,.184136,.820252,554139e-10,0,.211325,.801872,581412e-10,0,.240113,.782418,585535e-10,0,.270306,.7631,610923e-10,0,.301594,.742183,613678e-10,0,.333333,.721098,627275e-10,0,.365079,.699512,629413e-10,0,.396825,.677372,636351e-10,0,.428571,.655059,633555e-10,0,.460317,.632567,636513e-10,0,.492064,.609784,628965e-10,0,.52381,.587237,625546e-10,0,.555556,.564525,615825e-10,0,.587302,.542181,605048e-10,0,.619048,.520017,596329e-10,0,.650794,.498204,581516e-10,0,.68254,.476742,569186e-10,0,.714286,.455803,553833e-10,0,.746032,.435251,537807e-10,0,.777778,.415374,522025e-10,0,.809524,.395921,503421e-10,0,.84127,.377253,488211e-10,0,.873016,.359021,468234e-10,0,.904762,.341637,453269e-10,0,.936508,.3247,433014e-10,0,.968254,.308625,418007e-10,0,1,1,2.86798e-10,0,0,1,2.86877e-10,0,0,1,2.88094e-10,0,0,1,2.93506e-10,0,0,1,3.09262e-10,0,0,.999999,3.48593e-10,0,0,.999999,4.44582e-10,0,0,.999998,6.88591e-10,0,0,.999996,1.34391e-9,0,0,.999993,3.17438e-9,0,0,.999989,8.35609e-9,0,0,.999983,2.28677e-8,0,0,.999974,6.23361e-8,0,0,.999959,1.65225e-7,0,0,.999936,4.19983e-7,0,0,.999896,101546e-11,0,0,.99983,232376e-11,0,0,.999709,50156e-10,0,0,.999469,10167e-9,0,0,.998886,190775e-10,0,0,.996819,300511e-10,0,0,.988837,185092e-10,0,1.68222e-7,.982178,134622e-10,0,259622e-9,.975017,125961e-10,0,.00142595,.967101,13507e-9,0,.00382273,.964905,205003e-10,0,.00764164,.96218,29546e-9,0,.0130121,.956821,343738e-10,0,.0200253,.948829,305063e-10,0,.0287452,.941092,346487e-10,0,.039218,.931883,412061e-10,0,.0514748,.920211,444651e-10,0,.0655351,.907307,431252e-10,0,.0814082,.89684,490382e-10,0,.0990939,.884119,53334e-9,0,.118583,.869148,54114e-9,0,.139856,.853377,578536e-10,0,.162882,.836753,592285e-10,0,.187615,.820063,622787e-10,0,.213991,.801694,645492e-10,0,.241918,.782116,65353e-9,0,.271267,.762673,674344e-10,0,.301847,.742133,682788e-10,0,.333333,.720779,691959e-10,0,.365079,.699386,696817e-10,0,.396826,.67732,699583e-10,0,.428572,.654888,698447e-10,0,.460318,.632499,694063e-10,0,.492064,.609825,691612e-10,0,.52381,.587287,681576e-10,0,.555556,.564743,674138e-10,0,.587302,.542409,661617e-10,0,.619048,.520282,647785e-10,0,.650794,.498506,633836e-10,0,.68254,.477102,615905e-10,0,.714286,.456167,601013e-10,0,.746032,.435728,581457e-10,0,.777778,.415809,564215e-10,0,.809524,.396517,544997e-10,0,.84127,.377737,525061e-10,0,.873016,.359698,506831e-10,0,.904762,.342164,48568e-9,0,.936508,.325417,467826e-10,0,.968254,.309186,446736e-10,0,1,1,1.09018e-9,0,0,1,1.0904e-9,0,0,1,1.09393e-9,0,0,1,1.1095e-9,0,0,1,1.154e-9,0,0,1,1.26089e-9,0,0,.999999,1.5059e-9,0,0,.999997,2.07899e-9,0,0,.999994,3.48164e-9,0,0,.999993,7.05728e-9,0,0,.999987,1.63692e-8,0,0,.999981,4.06033e-8,0,0,.999969,1.0245e-7,0,0,.999953,2.55023e-7,0,0,.999925,6.1511e-7,0,0,.999881,142218e-11,0,0,.99981,313086e-11,0,0,.99968,653119e-11,0,0,.999418,12832e-9,0,0,.998748,232497e-10,0,0,.996066,329522e-10,0,0,.988379,179613e-10,0,108799e-9,.982567,143715e-10,0,921302e-9,.976097,148096e-10,0,.00280738,.968475,178905e-10,0,.00596622,.964606,253921e-10,0,.0105284,.961564,348623e-10,0,.0165848,.955517,357612e-10,0,.0242,.948381,343493e-10,0,.03342,.941095,405849e-10,0,.0442777,.931923,475394e-10,0,.0567958,.91996,484328e-10,0,.0709879,.907419,502146e-10,0,.086861,.89618,561654e-10,0,.104415,.88337,587612e-10,0,.123643,.869046,618057e-10,0,.144531,.853278,657392e-10,0,.167057,.836091,66303e-9,0,.191188,.819644,704445e-10,0,.216878,.801246,714071e-10,0,.244062,.782031,740093e-10,0,.272649,.762066,74685e-9,0,.302509,.741964,766647e-10,0,.333442,.720554,766328e-10,0,.365079,.699098,777857e-10,0,.396826,.677189,774633e-10,0,.428572,.65484,776235e-10,0,.460318,.632496,770316e-10,0,.492064,.609908,762669e-10,0,.52381,.587312,753972e-10,0,.555556,.564938,739994e-10,0,.587302,.542577,728382e-10,0,.619048,.52062,71112e-9,0,.650794,.498819,694004e-10,0,.68254,.477555,675575e-10,0,.714286,.456568,653449e-10,0,.746032,.436278,636068e-10,0,.777778,.41637,613466e-10,0,.809524,.397144,594177e-10,0,.84127,.378412,570987e-10,0,.873016,.360376,550419e-10,0,.904762,.342906,527422e-10,0,.936508,.326136,506544e-10,0,.968254,.30997,484307e-10,0,1,1,3.54014e-9,0,0,1,3.54073e-9,0,0,1,3.54972e-9,0,0,1,3.58929e-9,0,0,1,3.70093e-9,0,0,.999999,3.96194e-9,0,0,.999998,4.53352e-9,0,0,.999997,5.78828e-9,0,0,.999994,8.63812e-9,0,0,.999991,1.53622e-8,0,0,.999985,3.16356e-8,0,0,.999977,7.12781e-8,0,0,.999964,1.66725e-7,0,0,.999945,3.90501e-7,0,0,.999912,8.95622e-7,0,0,.999866,198428e-11,0,0,.999786,421038e-11,0,0,.999647,850239e-11,0,0,.999356,162059e-10,0,0,.998563,282652e-10,0,0,.994928,336309e-10,0,244244e-10,.987999,178458e-10,0,523891e-9,.982893,159162e-10,0,.00194729,.977044,178056e-10,0,.00451099,.969972,230624e-10,0,.00835132,.964237,313922e-10,0,.013561,.960791,406145e-10,0,.0202056,.954292,372796e-10,0,.0283321,.948052,403199e-10,0,.0379739,.940938,479537e-10,0,.0491551,.931689,545292e-10,0,.0618918,.91987,54038e-9,0,.0761941,.907665,589909e-10,0,.0920672,.895281,642651e-10,0,.109511,.882621,659707e-10,0,.12852,.86873,709973e-10,0,.149085,.853008,742221e-10,0,.171189,.835944,761754e-10,0,.194809,.818949,797052e-10,0,.21991,.800951,812434e-10,0,.246447,.781847,838075e-10,0,.274352,.761649,84501e-9,0,.303535,.74152,860258e-10,0,.333857,.720495,866233e-10,0,.365104,.698742,868326e-10,0,.396826,.677096,87133e-9,0,.428572,.654782,863497e-10,0,.460318,.632335,860206e-10,0,.492064,.610031,849337e-10,0,.52381,.587457,838279e-10,0,.555556,.56513,82309e-9,0,.587302,.542877,803542e-10,0,.619048,.5209,786928e-10,0,.650794,.499291,765171e-10,0,.68254,.477971,744753e-10,0,.714286,.457221,72209e-9,0,.746032,.436803,697448e-10,0,.777778,.417083,675333e-10,0,.809524,.397749,648058e-10,0,.84127,.379177,625759e-10,0,.873016,.361061,598584e-10,0,.904762,.343713,575797e-10,0,.936508,.326894,549999e-10,0,.968254,.310816,527482e-10,0,1,1,1.0153e-8,0,0,1,1.01544e-8,0,0,1,1.01751e-8,0,0,1,1.02662e-8,0,0,1,1.0521e-8,0,0,.999999,1.11049e-8,0,0,.999999,1.23408e-8,0,0,.999996,1.4924e-8,0,0,.999992,2.04471e-8,0,0,.999989,3.26539e-8,0,0,.99998,6.03559e-8,0,0,.999971,1.23936e-7,0,0,.999955,2.69058e-7,0,0,.999933,5.93604e-7,0,0,.999901,129633e-11,0,0,.999847,275621e-11,0,0,.999761,564494e-11,0,0,.999607,110485e-10,0,0,.999282,204388e-10,0,0,.99831,341084e-10,0,2.2038e-7,.993288,294949e-10,0,242388e-9,.987855,192736e-10,0,.0012503,.983167,182383e-10,0,.0032745,.977908,218633e-10,0,.00646321,.971194,290662e-10,0,.0109133,.963867,386401e-10,0,.0166927,.95982,462827e-10,0,.0238494,.953497,420705e-10,0,.0324178,.947621,477743e-10,0,.0424225,.940611,568258e-10,0,.0538808,.931174,618061e-10,0,.0668047,.919919,627098e-10,0,.0812014,.907856,694714e-10,0,.0970745,.894509,735008e-10,0,.114424,.881954,763369e-10,0,.133246,.868309,821896e-10,0,.153534,.852511,83769e-9,0,.175275,.835821,881615e-10,0,.198453,.817981,896368e-10,0,.223042,.800504,930906e-10,0,.249009,.78141,945056e-10,0,.276304,.761427,963605e-10,0,.304862,.74094,968088e-10,0,.334584,.720233,981481e-10,0,.365322,.698592,979122e-10,0,.396826,.676763,981057e-10,0,.428571,.654808,973956e-10,0,.460318,.632326,962619e-10,0,.492064,.610049,952996e-10,0,.52381,.58763,933334e-10,0,.555556,.565261,917573e-10,0,.587302,.543244,896636e-10,0,.619048,.521273,873304e-10,0,.650794,.499818,852648e-10,0,.68254,.478536,823961e-10,0,.714286,.457826,79939e-9,0,.746032,.437549,77126e-9,0,.777778,.41776,743043e-10,0,.809524,.39863,716426e-10,0,.84127,.379954,686456e-10,0,.873016,.362025,660514e-10,0,.904762,.344581,630755e-10,0,.936508,.327909,605439e-10,0,.968254,.311736,576345e-10,0,1,1,2.63344e-8,0,0,1,2.63373e-8,0,0,1,2.63815e-8,0,0,1,2.65753e-8,0,0,1,2.71132e-8,0,0,.999999,2.83279e-8,0,0,.999997,3.0833e-8,0,0,.999995,3.58711e-8,0,0,.999992,4.61266e-8,0,0,.999985,6.7574e-8,0,0,.999977,1.1358e-7,0,0,.999966,2.13657e-7,0,0,.999948,4.31151e-7,0,0,.999923,8.96656e-7,0,0,.999884,186603e-11,0,0,.999826,381115e-11,0,0,.999732,754184e-11,0,0,.999561,143192e-10,0,0,.999191,257061e-10,0,0,.997955,405724e-10,0,744132e-10,.992228,276537e-10,0,716477e-9,.987638,208885e-10,0,.0022524,.983395,215226e-10,0,.00484816,.978614,270795e-10,0,.00860962,.972389,365282e-10,0,.0136083,.964392,474747e-10,0,.0198941,.95861,509141e-10,0,.0275023,.952806,48963e-9,0,.0364584,.94712,571119e-10,0,.04678,.940104,671704e-10,0,.0584799,.930398,687586e-10,0,.0715665,.919866,738161e-10,0,.086045,.907853,813235e-10,0,.101918,.894078,834582e-10,0,.119186,.881177,892093e-10,0,.137845,.867575,944548e-10,0,.157891,.852107,969607e-10,0,.179316,.835502,101456e-9,0,.202106,.81756,103256e-9,0,.226243,.79984,106954e-9,0,.251704,.780998,108066e-9,0,.278451,.761132,110111e-9,0,.306436,.740429,110459e-9,0,.335586,.719836,111219e-9,0,.365796,.698467,11145e-8,0,.3969,.676446,110393e-9,0,.428571,.654635,110035e-9,0,.460318,.632411,108548e-9,0,.492064,.609986,106963e-9,0,.52381,.587872,105238e-9,0,.555556,.565528,102665e-9,0,.587302,.543563,100543e-9,0,.619048,.52176,976182e-10,0,.650794,.500188,947099e-10,0,.68254,.479204,919929e-10,0,.714286,.458413,886139e-10,0,.746032,.438314,857839e-10,0,.777778,.418573,82411e-9,0,.809524,.39947,792211e-10,0,.84127,.380892,759546e-10,0,.873016,.362953,727571e-10,0,.904762,.345601,695738e-10,0,.936508,.328895,664907e-10,0,.968254,.312808,634277e-10,0,1,1,6.28647e-8,0,0,1,6.28705e-8,0,0,1,6.29587e-8,0,0,1,6.33441e-8,0,0,.999999,6.44087e-8,0,0,.999998,6.67856e-8,0,0,.999997,7.15889e-8,0,0,.999995,8.09577e-8,0,0,.999989,9.92764e-8,0,0,.999983,1.35834e-7,0,0,.999974,2.10482e-7,0,0,.999959,3.65215e-7,0,0,.999939,6.86693e-7,0,0,.999911,13472e-10,0,0,.999868,26731e-10,0,0,.999804,524756e-11,0,0,.9997,100403e-10,0,0,.99951,185019e-10,0,0,.999078,322036e-10,0,620676e-11,.997428,470002e-10,0,341552e-9,.99162,287123e-10,0,.00143727,.987479,234706e-10,0,.00349201,.983582,260083e-10,0,.0066242,.979186,337927e-10,0,.0109113,.97325,454689e-10,0,.0164064,.965221,573759e-10,0,.0231463,.957262,544114e-10,0,.0311571,.952211,587006e-10,0,.0404572,.946631,692256e-10,0,.0510592,.939391,787819e-10,0,.0629723,.929795,792368e-10,0,.0762025,.91965,875075e-10,0,.090753,.907737,950903e-10,0,.106626,.893899,972963e-10,0,.123822,.880239,10459e-8,0,.142337,.866562,107689e-9,0,.16217,.85164,113081e-9,0,.183314,.835021,116636e-9,0,.20576,.817311,120074e-9,0,.229496,.798845,121921e-9,0,.254502,.780479,12475e-8,0,.280753,.760694,125255e-9,0,.308212,.740142,126719e-9,0,.336825,.719248,12636e-8,0,.366517,.698209,126712e-9,0,.397167,.676398,125769e-9,0,.428578,.654378,124432e-9,0,.460318,.632484,123272e-9,0,.492064,.610113,12085e-8,0,.52381,.587931,118411e-9,0,.555556,.565872,11569e-8,0,.587302,.543814,112521e-9,0,.619048,.522265,109737e-9,0,.650794,.500835,106228e-9,0,.68254,.479818,102591e-9,0,.714286,.459258,991288e-10,0,.746032,.439061,952325e-10,0,.777778,.419552,91895e-9,0,.809524,.400399,879051e-10,0,.84127,.381976,844775e-10,0,.873016,.364009,806316e-10,0,.904762,.346761,771848e-10,0,.936508,.330049,735429e-10,0,.968254,.314018,702103e-10,0,1,1,1.39968e-7,0,0,1,1.39979e-7,0,0,1,1.40145e-7,0,0,1,1.4087e-7,0,0,.999999,1.42865e-7,0,0,.999998,1.47279e-7,0,0,.999997,1.56057e-7,0,0,.999992,1.7276e-7,0,0,.999989,2.04352e-7,0,0,.99998,2.6494e-7,0,0,.999969,3.83435e-7,0,0,.999953,6.18641e-7,0,0,.999929,108755e-11,0,0,.999898,201497e-11,0,0,.999849,381346e-11,0,0,.999778,719815e-11,0,0,.999661,133215e-10,0,0,.999451,238313e-10,0,0,.998936,401343e-10,0,113724e-9,.99662,517346e-10,0,820171e-9,.991094,304323e-10,0,.00238143,.987487,281757e-10,0,.00493527,.983731,320048e-10,0,.00856859,.979647,423905e-10,0,.0133393,.973837,562935e-10,0,.0192863,.96584,677442e-10,0,.0264369,.956309,623073e-10,0,.03481,.951523,704131e-10,0,.0444184,.946003,836594e-10,0,.0552713,.938454,911736e-10,0,.0673749,.929279,938264e-10,0,.0807329,.919239,103754e-9,0,.0953479,.907293,109928e-9,0,.111221,.893936,115257e-9,0,.128352,.879674,122265e-9,0,.14674,.865668,125733e-9,0,.166382,.850998,132305e-9,0,.187276,.834498,134844e-9,0,.209413,.816903,139276e-9,0,.232786,.798235,140984e-9,0,.257382,.779724,14378e-8,0,.283181,.760251,144623e-9,0,.310156,.739808,145228e-9,0,.338269,.718762,14539e-8,0,.367461,.697815,144432e-9,0,.397646,.67631,143893e-9,0,.428685,.654278,141846e-9,0,.460318,.632347,13935e-8,0,.492064,.610296,137138e-9,0,.52381,.588039,133806e-9,0,.555556,.566218,130755e-9,0,.587302,.544346,127128e-9,0,.619048,.522701,123002e-9,0,.650794,.501542,119443e-9,0,.68254,.480508,115055e-9,0,.714286,.460092,111032e-9,0,.746032,.440021,106635e-9,0,.777778,.420446,102162e-9,0,.809524,.401512,98184e-9,0,.84127,.38299,936497e-10,0,.873016,.365232,89813e-9,0,.904762,.347865,853073e-10,0,.936508,.331342,817068e-10,0,.968254,.315202,773818e-10,0,1,1,2.9368e-7,0,0,1,2.937e-7,0,0,1,2.93998e-7,0,0,1,2.95298e-7,0,0,.999999,2.98865e-7,0,0,.999998,3.067e-7,0,0,.999995,3.22082e-7,0,0,.999992,3.50767e-7,0,0,.999986,4.03538e-7,0,0,.999976,5.01372e-7,0,0,.999964,6.8562e-7,0,0,.999945,10374e-10,0,0,.999919,171269e-11,0,0,.999882,300175e-11,0,0,.999829,542144e-11,0,0,.999749,984182e-11,0,0,.99962,176213e-10,0,0,.999382,305995e-10,0,138418e-10,.998751,496686e-10,0,389844e-9,.995344,510733e-10,0,.00150343,.990768,345829e-10,0,.00352451,.987464,342841e-10,0,.00655379,.983846,399072e-10,0,.0106554,.980007,533219e-10,0,.0158723,.974494,696992e-10,0,.0222333,.96622,776754e-10,0,.029758,.956273,747718e-10,0,.0384596,.950952,864611e-10,0,.0483473,.945215,100464e-9,0,.0594266,.937287,103729e-9,0,.0717019,.928649,111665e-9,0,.0851752,.918791,12353e-8,0,.0998479,.906685,127115e-9,0,.115721,.893706,13628e-8,0,.132794,.879248,142427e-9,0,.151067,.864685,148091e-9,0,.170538,.850032,153517e-9,0,.191204,.833853,157322e-9,0,.213063,.816353,161086e-9,0,.236107,.797834,164111e-9,0,.260329,.778831,165446e-9,0,.285714,.759756,167492e-9,0,.312243,.739419,166928e-9,0,.339887,.718491,167e-6,0,.368604,.697392,165674e-9,0,.398329,.676102,163815e-9,0,.428961,.654243,162003e-9,0,.460331,.632176,158831e-9,0,.492064,.610407,155463e-9,0,.52381,.588394,152062e-9,0,.555556,.56645,147665e-9,0,.587302,.5449,14375e-8,0,.619048,.523276,138905e-9,0,.650794,.502179,134189e-9,0,.68254,.481359,129392e-9,0,.714286,.46092,124556e-9,0,.746032,.441084,11957e-8,0,.777778,.421517,114652e-9,0,.809524,.402721,109688e-9,0,.84127,.384222,104667e-9,0,.873016,.366534,999633e-10,0,.904762,.349205,950177e-10,0,.936508,.332702,907301e-10,0,.968254,.316599,859769e-10,0,1,1,5.85473e-7,0,0,1,5.85507e-7,0,0,1,5.8602e-7,0,0,.999999,5.88259e-7,0,0,.999999,5.94381e-7,0,0,.999998,6.07754e-7,0,0,.999995,6.33729e-7,0,0,.99999,6.8137e-7,0,0,.999984,7.67003e-7,0,0,.999973,9.21212e-7,0,0,.999959,120218e-11,0,0,.999936,172024e-11,0,0,.999907,268088e-11,0,0,.999866,445512e-11,0,0,.999806,768481e-11,0,0,.999716,1342e-8,0,0,.999576,232473e-10,0,0,.9993,391694e-10,0,129917e-9,.998498,608429e-10,0,845035e-9,.994132,489743e-10,0,.00237616,.99031,384644e-10,0,.00484456,.987409,421768e-10,0,.00832472,.983981,504854e-10,0,.0128643,.980268,671028e-10,0,.0184947,.974875,852749e-10,0,.025237,.966063,85531e-9,0,.0331046,.956779,900588e-10,0,.0421067,.950259,10577e-8,0,.0522487,.944239,119458e-9,0,.0635343,.936341,122164e-9,0,.0759654,.928047,134929e-9,0,.0895434,.918065,145544e-9,0,.104269,.906267,150531e-9,0,.120142,.893419,161652e-9,0,.137163,.878758,16593e-8,0,.15533,.863699,174014e-9,0,.174645,.848876,177877e-9,0,.195106,.833032,184049e-9,0,.21671,.815557,186088e-9,0,.239454,.797323,19054e-8,0,.263332,.778124,191765e-9,0,.288336,.758929,192535e-9,0,.314451,.738979,192688e-9,0,.341658,.718213,191522e-9,0,.369924,.696947,190491e-9,0,.399202,.675807,187913e-9,0,.429416,.654147,184451e-9,0,.460447,.63229,181442e-9,0,.492064,.610499,177139e-9,0,.523809,.588747,172596e-9,0,.555555,.566783,167457e-9,0,.587301,.545359,162518e-9,0,.619048,.523984,156818e-9,0,.650794,.502917,151884e-9,0,.68254,.482294,145514e-9,0,.714286,.461945,140199e-9,0,.746032,.442133,134101e-9,0,.777778,.422705,128374e-9,0,.809524,.403916,122996e-9,0,.84127,.38554,116808e-9,0,.873016,.367909,111973e-9,0,.904762,.350651,105938e-9,0,.936508,.334208,101355e-9,0,.968254,.318123,957629e-10,0,1,1,111633e-11,0,0,1,111639e-11,0,0,1,111725e-11,0,0,1,112096e-11,0,0,.999999,11311e-10,0,0,.999997,115315e-11,0,0,.999995,11956e-10,0,0,.999989,127239e-11,0,0,.999981,140772e-11,0,0,.999969,164541e-11,0,0,.999952,206607e-11,0,0,.999928,281783e-11,0,0,.999895,416835e-11,0,0,.999848,658728e-11,0,0,.999781,108648e-10,0,0,.999682,182579e-10,0,0,.999523,306003e-10,0,159122e-10,.999205,499862e-10,0,391184e-9,.998131,73306e-9,0,.00147534,.993334,513229e-10,0,.0034227,.99016,467783e-10,0,.00632232,.987321,523413e-10,0,.0102295,.984099,64267e-9,0,.0151794,.980432,843042e-10,0,.0211947,.974976,102819e-9,0,.0282899,.966429,996234e-10,0,.0364739,.957633,111074e-9,0,.0457522,.949422,128644e-9,0,.0561278,.943045,140076e-9,0,.0676023,.935448,146349e-9,0,.0801762,.927225,161854e-9,0,.0938499,.917033,169135e-9,0,.108623,.905762,179987e-9,0,.124496,.892879,189832e-9,0,.141469,.878435,195881e-9,0,.159541,.863114,20466e-8,0,.178713,.84776,209473e-9,0,.198985,.832084,214861e-9,0,.220355,.814915,217695e-9,0,.242823,.796711,220313e-9,0,.266385,.777603,22313e-8,0,.291036,.757991,222471e-9,0,.316767,.738371,222869e-9,0,.343563,.717872,221243e-9,0,.371402,.696619,218089e-9,0,.400248,.675379,21562e-8,0,.430047,.65411,21169e-8,0,.460709,.63241,206947e-9,0,.492079,.61046,201709e-9,0,.52381,.58903,196753e-9,0,.555556,.567267,189637e-9,0,.587302,.545886,184735e-9,0,.619048,.524714,177257e-9,0,.650794,.503789,171424e-9,0,.68254,.483204,164688e-9,0,.714286,.462976,157172e-9,0,.746032,.443294,151341e-9,0,.777778,.423988,143737e-9,0,.809524,.405325,138098e-9,0,.84127,.386981,130698e-9,0,.873016,.369436,125276e-9,0,.904762,.35219,118349e-9,0,.936508,.335804,11312e-8,0,.968254,.319749,106687e-9,0,1,1,204685e-11,0,0,1,204694e-11,0,0,1,204831e-11,0,0,.999999,205428e-11,0,0,.999999,207056e-11,0,0,.999997,210581e-11,0,0,.999993,21732e-10,0,0,.999987,229365e-11,0,0,.999979,250243e-11,0,0,.999965,286127e-11,0,0,.999947,348028e-11,0,0,.999918,455588e-11,0,0,.999881,643303e-11,0,0,.999828,970064e-11,0,0,.999753,153233e-10,0,0,.999642,24793e-9,0,0,.999464,402032e-10,0,122947e-9,.999089,635852e-10,0,807414e-9,.997567,857026e-10,0,.00227206,.992903,594912e-10,0,.00462812,.990011,578515e-10,0,.00794162,.987192,65399e-9,0,.0122534,.98418,819675e-10,0,.0175888,.980491,105514e-9,0,.0239635,.974779,121532e-9,0,.031387,.96675,119144e-9,0,.0398644,.958248,136125e-9,0,.0493982,.948884,155408e-9,0,.0599896,.941673,162281e-9,0,.0716382,.934521,176754e-9,0,.0843437,.926205,192873e-9,0,.0981056,.916089,200038e-9,0,.112923,.904963,213624e-9,0,.128796,.892089,221834e-9,0,.145725,.878028,232619e-9,0,.163709,.86249,238632e-9,0,.182749,.846587,247002e-9,0,.202847,.830988,250702e-9,0,.224001,.814165,255562e-9,0,.246214,.796135,257505e-9,0,.269482,.777052,258625e-9,0,.293805,.757201,258398e-9,0,.319176,.737655,256714e-9,0,.345587,.717477,255187e-9,0,.373021,.696433,251792e-9,0,.401454,.675084,247223e-9,0,.430844,.653907,242213e-9,0,.461125,.632561,237397e-9,0,.492187,.610658,229313e-9,0,.52381,.589322,224402e-9,0,.555556,.567857,216116e-9,0,.587302,.54652,209124e-9,0,.619048,.525433,201601e-9,0,.650794,.504679,192957e-9,0,.68254,.484203,186052e-9,0,.714286,.464203,177672e-9,0,.746032,.444549,170005e-9,0,.777778,.425346,162401e-9,0,.809524,.406706,1544e-7,0,.84127,.388576,147437e-9,0,.873016,.37094,139493e-9,0,.904762,.353996,133219e-9,0,.936508,.337391,125573e-9,0,.968254,.321648,119867e-9,0,1,1,362511e-11,0,0,1,362525e-11,0,0,1,362739e-11,0,0,.999999,363673e-11,0,0,.999998,366214e-11,0,0,.999996,371698e-11,0,0,.999992,382116e-11,0,0,.999986,400554e-11,0,0,.999976,432058e-11,0,0,.999961,485194e-11,0,0,.999938,574808e-11,0,0,.999908,726643e-11,0,0,.999865,984707e-11,0,0,.999807,142217e-10,0,0,.999723,215581e-10,0,0,.999602,336114e-10,0,119113e-10,.999398,527353e-10,0,355813e-9,.998946,805809e-10,0,.00137768,.996647,942908e-10,0,.00322469,.992298,668733e-10,0,.00597897,.989802,716564e-10,0,.00968903,.987019,821355e-10,0,.0143845,.984219,104555e-9,0,.0200831,.980425,131245e-9,0,.0267948,.974241,139613e-9,0,.034525,.967006,145931e-9,0,.0432757,.95893,167153e-9,0,.0530471,.949157,188146e-9,0,.0638386,.94062,194625e-9,0,.0756487,.933509,213721e-9,0,.0884762,.925088,229616e-9,0,.10232,.915178,239638e-9,0,.117178,.904093,254814e-9,0,.133051,.891337,263685e-9,0,.149939,.877326,274789e-9,0,.167841,.861794,280534e-9,0,.18676,.845758,289534e-9,0,.206696,.829792,294446e-9,0,.22765,.813037,296877e-9,0,.249625,.795285,300217e-9,0,.27262,.776323,299826e-9,0,.296636,.756673,299787e-9,0,.321671,.736856,297867e-9,0,.347718,.716883,294052e-9,0,.374768,.696089,289462e-9,0,.402804,.67505,285212e-9,0,.431796,.653509,27653e-8,0,.461695,.63258,271759e-9,0,.49242,.61104,262811e-9,0,.523822,.589567,255151e-9,0,.555556,.568322,246434e-9,0,.587302,.547235,237061e-9,0,.619048,.52616,228343e-9,0,.650794,.505716,219236e-9,0,.68254,.485274,209595e-9,0,.714286,.465411,201011e-9,0,.746032,.445854,19109e-8,0,.777778,.426911,182897e-9,0,.809524,.408222,173569e-9,0,.84127,.390307,165496e-9,0,.873016,.372624,156799e-9,0,.904762,.355804,14917e-8,0,.936508,.33924,140907e-9,0,.968254,.323534,134062e-9,0,1,1,622487e-11,0,0,1,62251e-10,0,0,1,622837e-11,0,0,.999999,624259e-11,0,0,.999998,628127e-11,0,0,.999996,636451e-11,0,0,.999991,65218e-10,0,0,.999984,679782e-11,0,0,.999973,726361e-11,0,0,.999955,803644e-11,0,0,.999931,931397e-11,0,0,.999896,114299e-10,0,0,.999847,149402e-10,0,0,.999784,207461e-10,0,0,.999692,302493e-10,0,0,.999554,454957e-10,0,997275e-10,.999326,690762e-10,0,724813e-9,.998757,101605e-9,0,.0020972,.995367,958745e-10,0,.00432324,.99209,832808e-10,0,.00746347,.989517,887601e-10,0,.0115534,.987008,10564e-8,0,.0166134,.98421,133179e-9,0,.0226552,.98021,161746e-9,0,.0296838,.973676,161821e-9,0,.0377016,.967052,178635e-9,0,.0467079,.959385,206765e-9,0,.0567013,.949461,22476e-8,0,.0676796,.939578,23574e-8,0,.0796403,.932416,25893e-8,0,.0925812,.923759,271228e-9,0,.106501,.914223,289165e-9,0,.121397,.902942,301156e-9,0,.13727,.890419,313852e-9,0,.15412,.876639,324408e-9,0,.171946,.861316,33249e-8,0,.190751,.84496,338497e-9,0,.210537,.828427,345861e-9,0,.231305,.811871,347863e-9,0,.253057,.794397,350225e-9,0,.275797,.775726,349915e-9,0,.299525,.75617,347297e-9,0,.324242,.736091,344232e-9,0,.349947,.716213,340835e-9,0,.376633,.695736,332369e-9,0,.404289,.674961,327943e-9,0,.432895,.653518,318533e-9,0,.462415,.632574,310391e-9,0,.492788,.61134,300755e-9,0,.523909,.590017,290506e-9,0,.555556,.568752,280446e-9,0,.587302,.548061,269902e-9,0,.619048,.52711,258815e-9,0,.650794,.506682,248481e-9,0,.68254,.486524,237141e-9,0,.714286,.466812,226872e-9,0,.746032,.44732,216037e-9,0,.777778,.428473,205629e-9,0,.809524,.409921,195691e-9,0,.84127,.392028,185457e-9,0,.873016,.374606,176436e-9,0,.904762,.357601,166508e-9,0,.936508,.341348,158385e-9,0,.968254,.32542,149203e-9,0,1,1,103967e-10,0,0,1,10397e-9,0,0,1,104019e-10,0,0,.999999,104231e-10,0,0,.999998,104806e-10,0,0,.999995,106042e-10,0,0,.999991,108366e-10,0,0,.999982,112415e-10,0,0,.999968,119174e-10,0,0,.99995,130227e-10,0,0,.999922,148176e-10,0,0,.999884,177303e-10,0,0,.99983,224564e-10,0,0,.999758,300966e-10,0,0,.999654,423193e-10,0,549083e-11,.999503,614848e-10,0,296087e-9,.999237,903576e-10,0,.00123144,.998491,1271e-7,0,.00295954,.994594,107754e-9,0,.00555829,.99178,103025e-9,0,.00907209,.989265,11154e-8,0,.0135257,.986998,136296e-9,0,.0189327,.984137,169154e-9,0,.0252993,.979798,196671e-9,0,.0326272,.97337,196678e-9,0,.0409157,.967239,223121e-9,0,.0501623,.959543,253809e-9,0,.0603638,.949466,265972e-9,0,.0715171,.939074,288372e-9,0,.0836187,.931118,310983e-9,0,.0966657,.922525,325561e-9,0,.110656,.912983,345725e-9,0,.125588,.901617,3556e-7,0,.141461,.889487,374012e-9,0,.158275,.875787,383445e-9,0,.176031,.860654,393972e-9,0,.19473,.844417,400311e-9,0,.214374,.82741,405004e-9,0,.234967,.810545,407378e-9,0,.256512,.793312,407351e-9,0,.279011,.774847,406563e-9,0,.302468,.755621,404903e-9,0,.326887,.735511,397486e-9,0,.352266,.715435,39357e-8,0,.378605,.695403,384739e-9,0,.405897,.674681,376108e-9,0,.43413,.65359,365997e-9,0,.463277,.632471,354957e-9,0,.493295,.61151,343593e-9,0,.524106,.59064,331841e-9,0,.555561,.569386,318891e-9,0,.587302,.548785,3072e-7,0,.619048,.528146,29361e-8,0,.650794,.507872,281709e-9,0,.68254,.487805,268627e-9,0,.714286,.468196,255887e-9,0,.746032,.448922,243997e-9,0,.777778,.430093,231662e-9,0,.809524,.411845,220339e-9,0,.84127,.393808,208694e-9,0,.873016,.376615,198045e-9,0,.904762,.359655,187375e-9,0,.936508,.343452,177371e-9,0,.968254,.32765,167525e-9,0,1,1,169351e-10,0,0,1,169356e-10,0,0,1,169427e-10,0,0,.999999,169736e-10,0,0,.999998,170575e-10,0,0,.999995,172372e-10,0,0,.99999,175739e-10,0,0,.999979,181568e-10,0,0,.999966,191206e-10,0,0,.999944,20677e-9,0,0,.999912,231644e-10,0,0,.999869,271268e-10,0,0,.999811,334272e-10,0,0,.99973,433979e-10,0,0,.999617,590083e-10,0,680315e-10,.999445,829497e-10,0,612796e-9,.999138,118019e-9,0,.00187408,.998095,156712e-9,0,.00395791,.993919,125054e-9,0,.00692144,.991333,126091e-9,0,.0107962,.989226,144912e-9,0,.0155986,.986954,175737e-9,0,.0213364,.983982,213883e-9,0,.0280114,.979128,234526e-9,0,.0356226,.973327,243725e-9,0,.0441668,.967416,2773e-7,0,.0536399,.959729,308799e-9,0,.0640376,.949758,322447e-9,0,.0753554,.939173,350021e-9,0,.0875893,.9296,370089e-9,0,.100736,.921181,391365e-9,0,.114793,.91164,413636e-9,0,.129759,.900435,427068e-9,0,.145632,.888183,441046e-9,0,.162412,.874772,454968e-9,0,.180101,.859566,461882e-9,0,.1987,.843579,471556e-9,0,.218213,.826453,474335e-9,0,.238641,.809164,477078e-9,0,.259989,.792179,47755e-8,0,.282262,.773866,472573e-9,0,.305464,.754944,469765e-9,0,.329599,.735133,462371e-9,0,.35467,.714858,453674e-9,0,.380678,.694829,443888e-9,0,.407622,.674453,432052e-9,0,.435493,.653685,420315e-9,0,.464275,.632666,406829e-9,0,.493938,.611676,392234e-9,0,.524422,.591193,379208e-9,0,.555624,.570145,36319e-8,0,.587302,.549566,349111e-9,0,.619048,.529278,334166e-9,0,.650794,.509026,318456e-9,0,.68254,.489186,30449e-8,0,.714286,.469662,289051e-9,0,.746032,.450691,275494e-9,0,.777778,.431841,261437e-9,0,.809524,.413752,247846e-9,0,.84127,.395951,235085e-9,0,.873016,.378633,222245e-9,0,.904762,.36194,210533e-9,0,.936508,.345599,198494e-9,0,.968254,.329999,188133e-9,0,1,1,269663e-10,0,0,1,26967e-9,0,0,1,269772e-10,0,0,.999999,270214e-10,0,0,.999998,271415e-10,0,0,.999994,27398e-9,0,0,.999988,278771e-10,0,0,.999977,287019e-10,0,0,.999961,300544e-10,0,0,.999937,322138e-10,0,0,.999904,356163e-10,0,0,.999854,409465e-10,0,0,.99979,492651e-10,0,0,.999699,621722e-10,0,8.8288e-7,.999572,819715e-10,0,223369e-9,.999381,111689e-9,0,.00105414,.999016,153862e-9,0,.0026493,.997437,187667e-9,0,.00508608,.993545,155672e-9,0,.00840554,.991135,161455e-9,0,.012629,.989157,188241e-9,0,.0177661,.986874,226229e-9,0,.0238198,.983714,268668e-9,0,.0307887,.978301,277109e-9,0,.0386688,.973227,303446e-9,0,.0474554,.967317,341851e-9,0,.0571428,.959477,370885e-9,0,.0677256,.950012,392753e-9,0,.0791988,.939484,42781e-8,0,.0915576,.928135,443866e-9,0,.104798,.919819,472959e-9,0,.118918,.910049,491551e-9,0,.133915,.899181,512616e-9,0,.149788,.886881,523563e-9,0,.166537,.87359,540183e-9,0,.184164,.858613,547386e-9,0,.202669,.842809,554809e-9,0,.222056,.825727,558316e-9,0,.242329,.808086,557824e-9,0,.263492,.790728,556346e-9,0,.285551,.772987,552672e-9,0,.30851,.7541,543738e-9,0,.332376,.734669,536107e-9,0,.357153,.714411,523342e-9,0,.382845,.694196,512238e-9,0,.409454,.674252,497465e-9,0,.436977,.65357,481096e-9,0,.465404,.632999,467054e-9,0,.494713,.611994,448771e-9,0,.524864,.591604,431889e-9,0,.555779,.571134,415238e-9,0,.587302,.550528,396369e-9,0,.619048,.530292,379477e-9,0,.650794,.510364,361488e-9,0,.68254,.490749,343787e-9,0,.714286,.471266,327822e-9,0,.746032,.452462,310626e-9,0,.777778,.433907,295352e-9,0,.809524,.415659,279179e-9,0,.84127,.398138,264685e-9,0,.873016,.380833,249905e-9,0,.904762,.364247,236282e-9,0,.936508,.348041,222905e-9,0,.968254,.332389,210522e-9,0,1,1,420604e-10,0,0,1,420614e-10,0,0,1,420757e-10,0,0,.999999,42138e-9,0,0,.999997,423067e-10,0,0,.999993,426668e-10,0,0,.999986,433372e-10,0,0,.999974,444857e-10,0,0,.999956,463554e-10,0,0,.99993,493105e-10,0,0,.999892,539077e-10,0,0,.999838,610005e-10,0,0,.999767,718822e-10,0,0,.999666,884581e-10,0,365471e-10,.999525,113398e-9,0,485623e-9,.999311,150043e-9,0,.00162096,.998865,200063e-9,0,.00355319,.996278,211014e-9,0,.00633818,.992956,189672e-9,0,.0100043,.991017,210262e-9,0,.0145648,.989055,244292e-9,0,.0200237,.986741,290481e-9,0,.0263798,.983288,334303e-9,0,.033629,.977784,340307e-9,0,.0417652,.973037,377864e-9,0,.0507821,.967181,4239e-7,0,.060673,.958971,443854e-9,0,.0714314,.950093,483039e-9,0,.0830518,.939552,517934e-9,0,.0955288,.927678,539449e-9,0,.108859,.918278,568604e-9,0,.123038,.908449,588505e-9,0,.138065,.897713,612473e-9,0,.153938,.885533,625575e-9,0,.170657,.872131,63854e-8,0,.188224,.857517,647034e-9,0,.20664,.841796,65209e-8,0,.225909,.824726,6544e-7,0,.246035,.807297,655744e-9,0,.267022,.789058,646716e-9,0,.288878,.77189,643898e-9,0,.311607,.753082,629973e-9,0,.335216,.7341,621564e-9,0,.359713,.714094,605171e-9,0,.385103,.693839,588752e-9,0,.41139,.673891,573294e-9,0,.438576,.653565,552682e-9,0,.466656,.633326,533446e-9,0,.495617,.612582,514635e-9,0,.525431,.59205,49303e-8,0,.556041,.571918,471842e-9,0,.587338,.551572,451713e-9,0,.619048,.531553,430049e-9,0,.650794,.51175,410445e-9,0,.68254,.49238,390098e-9,0,.714286,.473143,370033e-9,0,.746032,.45423,351205e-9,0,.777778,.435963,332049e-9,0,.809524,.41787,315021e-9,0,.84127,.400387,297315e-9,0,.873016,.383332,281385e-9,0,.904762,.366665,265397e-9,0,.936508,.350633,250601e-9,0,.968254,.334964,23589e-8,0,1,1,643736e-10,0,0,1,64375e-9,0,0,1,643947e-10,0,0,.999999,64481e-9,0,0,.999997,647143e-10,0,0,.999994,652119e-10,0,0,.999985,661359e-10,0,0,.999972,677116e-10,0,0,.999952,702599e-10,0,0,.999922,742517e-10,0,0,.99988,803906e-10,0,0,.99982,897315e-10,0,0,.999741,103838e-9,0,0,.999629,12496e-8,0,149024e-9,.999474,156161e-9,0,861027e-9,.999229,201034e-9,0,.00231198,.998662,259069e-9,0,.00458147,.995299,245439e-9,0,.00770895,.992732,24498e-8,0,.0117126,.990847,273211e-9,0,.0165989,.988911,316492e-9,0,.0223674,.98654,37161e-8,0,.0290135,.982636,410352e-9,0,.0365309,.977346,421756e-9,0,.0449117,.972909,475578e-9,0,.0541481,.966821,522482e-9,0,.0642326,.958686,545008e-9,0,.075158,.949754,589286e-9,0,.0869181,.939184,619995e-9,0,.0995074,.927505,654266e-9,0,.112922,.916606,682362e-9,0,.127157,.906707,704286e-9,0,.142212,.895937,725909e-9,0,.158085,.883913,743939e-9,0,.174776,.870642,755157e-9,0,.192287,.856241,764387e-9,0,.210619,.84069,771032e-9,0,.229775,.823728,765906e-9,0,.249761,.806481,767604e-9,0,.270582,.787924,754385e-9,0,.292243,.770588,749668e-9,0,.314753,.751991,731613e-9,0,.338118,.733407,717655e-9,0,.362347,.713688,700604e-9,0,.387447,.693595,678765e-9,0,.413424,.673426,657042e-9,0,.440284,.65359,635892e-9,0,.468027,.633576,611569e-9,0,.496645,.613144,586011e-9,0,.526122,.592711,563111e-9,0,.556417,.572722,537699e-9,0,.587451,.552762,512556e-9,0,.619048,.532985,489757e-9,0,.650794,.513219,464139e-9,0,.68254,.493992,442193e-9,0,.714286,.47509,418629e-9,0,.746032,.456287,397045e-9,0,.777778,.438152,375504e-9,0,.809524,.420294,35492e-8,0,.84127,.402749,335327e-9,0,.873016,.385879,316422e-9,0,.904762,.369352,298333e-9,0,.936508,.353301,281417e-9,0,.968254,.337781,265203e-9,0,1,1,968267e-10,0,0,1,968284e-10,0,0,1,968556e-10,0,0,.999999,969733e-10,0,0,.999997,972913e-10,0,0,.999993,979688e-10,0,0,.999984,992239e-10,0,0,.999969,101356e-9,0,0,.999946,104784e-9,0,0,.999913,110111e-9,0,0,.999868,118217e-9,0,0,.999801,130396e-9,0,0,.999712,148523e-9,0,124907e-10,.999589,175233e-9,0,355405e-9,.999416,213999e-9,0,.0013528,.999136,268529e-9,0,.00312557,.998367,333088e-9,0,.00573045,.994701,304757e-9,0,.00919397,.992497,318031e-9,0,.0135261,.990608,353863e-9,0,.0187278,.988715,409044e-9,0,.0247947,.986241,472967e-9,0,.0317196,.981696,495104e-9,0,.039494,.977097,532873e-9,0,.0481087,.972583,594447e-9,0,.0575549,.966142,636867e-9,0,.0678242,.95823,669899e-9,0,.0789089,.949677,719499e-9,0,.0908023,.939226,750584e-9,0,.103499,.927501,793183e-9,0,.116993,.915199,81995e-8,0,.131282,.90498,847654e-9,0,.146364,.894243,868929e-9,0,.162237,.882154,884278e-9,0,.178902,.869161,898108e-9,0,.196358,.854751,901254e-9,0,.21461,.839368,90679e-8,0,.23366,.822874,901541e-9,0,.253512,.805514,897297e-9,0,.274174,.78716,881856e-9,0,.29565,.769061,870032e-9,0,.31795,.751,851719e-9,0,.341081,.732614,830671e-9,0,.365053,.713171,806569e-9,0,.389874,.693472,78338e-8,0,.415553,.673528,756404e-9,0,.442098,.653397,726872e-9,0,.469512,.633781,700494e-9,0,.497794,.613877,67105e-8,0,.526935,.593506,640361e-9,0,.556908,.573667,613502e-9,0,.587657,.553932,583177e-9,0,.61906,.534345,554375e-9,0,.650794,.515042,527811e-9,0,.68254,.495674,499367e-9,0,.714286,.477132,47429e-8,0,.746032,.458609,447726e-9,0,.777778,.440354,424205e-9,0,.809524,.422765,399549e-9,0,.84127,.405472,378315e-9,0,.873016,.388482,355327e-9,0,.904762,.372191,336122e-9,0,.936508,.356099,315247e-9,0,.968254,.340737,29794e-8,0,1,1,143327e-9,0,0,1,14333e-8,0,0,1,143366e-9,0,0,.999999,143524e-9,0,0,.999996,143952e-9,0,0,.999991,144862e-9,0,0,.999981,146544e-9,0,0,.999966,149391e-9,0,0,.999941,153946e-9,0,0,.999905,160971e-9,0,0,.999852,171562e-9,0,0,.99978,18729e-8,0,0,.999681,210386e-9,0,826239e-10,.999546,243906e-9,0,664807e-9,.999352,291739e-9,0,.00196192,.999027,357419e-9,0,.00405941,.997886,422349e-9,0,.00699664,.99419,385008e-9,0,.0107896,.99214,409775e-9,0,.0154415,.990274,456418e-9,0,.0209488,.988455,527008e-9,0,.0273037,.985804,597685e-9,0,.0344969,.98103,613124e-9,0,.0425183,.976674,668321e-9,0,.0513575,.972021,736985e-9,0,.0610046,.965274,773789e-9,0,.0714508,.958046,830852e-9,0,.0826877,.949333,875766e-9,0,.0947085,.939135,917088e-9,0,.107507,.927119,952244e-9,0,.121078,.91469,990626e-9,0,.135419,.903006,.00101304,0,.150526,.892368,.00103834,0,.166399,.880231,.00105002,0,.183038,.867432,.00106331,0,.200443,.853208,.00106783,0,.218618,.837956,.00106458,0,.237566,.821772,.00105945,0,.257291,.804328,.00104685,0,.2778,.786465,.00103178,0,.2991,.768004,.00101077,0,.321199,.74972,985504e-9,0,.344106,.731682,962893e-9,0,.36783,.712813,932146e-9,0,.392383,.693139,89871e-8,0,.417774,.673566,869678e-9,0,.444013,.653483,835525e-9,0,.471107,.633891,799853e-9,0,.49906,.614433,766838e-9,0,.527869,.594586,732227e-9,0,.557517,.574769,696442e-9,0,.587966,.555149,663935e-9,0,.61913,.535898,629826e-9,0,.650794,.516753,596486e-9,0,.68254,.497816,567078e-9,0,.714286,.479034,534399e-9,0,.746032,.460975,507013e-9,0,.777778,.442935,477421e-9,0,.809524,.425263,451101e-9,0,.84127,.408248,424964e-9,0,.873016,.391339,39993e-8,0,.904762,.37513,377619e-9,0,.936508,.359172,354418e-9,0,.968254,.343876,334823e-9,0,1,1,209042e-9,0,0,1,209045e-9,0,0,1,209093e-9,0,0,.999999,209304e-9,0,0,.999996,209871e-9,0,0,.999991,211078e-9,0,0,.999979,213304e-9,0,0,.999963,217061e-9,0,0,.999933,223042e-9,0,0,.999894,232206e-9,0,0,.999837,245901e-9,0,0,.999756,266023e-9,0,102927e-11,.999648,295204e-9,0,233468e-9,.999499,336958e-9,0,.00108237,.999283,395563e-9,0,.00268832,.998896,473785e-9,0,.00511138,.997006,520008e-9,0,.00837705,.993819,497261e-9,0,.0124928,.991632,523722e-9,0,.0174561,.989875,587258e-9,0,.0232596,.988109,676329e-9,0,.0298932,.985155,747701e-9,0,.0373453,.980479,768803e-9,0,.0456045,.976271,841054e-9,0,.0546593,.971347,911469e-9,0,.0644994,.964528,953057e-9,0,.0751152,.957632,.00102221,0,.0864981,.948681,.00106122,0,.0986407,.938716,.00111857,0,.111537,.926629,.00114762,0,.125182,.914025,.00118995,0,.139571,.901026,.00121228,0,.154703,.890358,.00123946,0,.170576,.878283,.0012527,0,.18719,.865459,.00125536,0,.204547,.851407,.00126134,0,.222648,.836276,.00124759,0,.241498,.820436,.00124443,0,.261101,.803253,.00122071,0,.281465,.785562,.00120107,0,.302595,.76718,.00117762,0,.324501,.748551,.00114289,0,.347192,.730564,.00110872,0,.370679,.712253,.00107636,0,.394973,.692867,.00103646,0,.420085,.673695,996793e-9,0,.446027,.653912,95675e-8,0,.47281,.634129,916739e-9,0,.500441,.615004,874401e-9,0,.528921,.595587,833411e-9,0,.558244,.575965,794556e-9,0,.588384,.5566,75196e-8,0,.619281,.537428,716381e-9,0,.650795,.518623,676558e-9,0,.68254,.499964,64074e-8,0,.714286,.481356,605984e-9,0,.746032,.463279,570256e-9,0,.777778,.445673,540138e-9,0,.809524,.428032,507299e-9,0,.84127,.411112,479553e-9,0,.873016,.394444,450737e-9,0,.904762,.378247,424269e-9,0,.936508,.362415,399111e-9,0,.968254,.347103,375274e-9,0,1,1,300729e-9,0,0,1,300733e-9,0,0,1,300797e-9,0,0,.999998,301072e-9,0,0,.999996,301817e-9,0,0,.999989,303398e-9,0,0,.999977,306309e-9,0,0,.999958,311209e-9,0,0,.999927,318975e-9,0,0,.999884,330804e-9,0,0,.99982,34834e-8,0,0,.999733,373854e-9,0,326995e-10,.999613,410424e-9,0,477174e-9,.999447,462047e-9,0,.00161099,.999204,533322e-9,0,.00353153,.998725,624964e-9,0,.00627965,.995871,631786e-9,0,.0098693,.993194,632017e-9,0,.0143011,.991541,68923e-8,0,.019568,.989773,766892e-9,0,.0256593,.987647,863668e-9,0,.0325625,.984193,922089e-9,0,.0402647,.980016,970749e-9,0,.0487532,.975859,.00106027,0,.058016,.970514,.00112239,0,.0680419,.963625,.00117212,0,.0788208,.956959,.00125211,0,.0903439,.947956,.00129411,0,.102604,.93809,.00135879,0,.115594,.92659,.00139309,0,.129309,.913829,.00143253,0,.143745,.90005,.00145809,0,.158901,.888129,.0014748,0,.174774,.87607,.00148756,0,.191365,.863461,.00148714,0,.208674,.849594,.00148892,0,.226705,.834531,.00146496,0,.245461,.81903,.0014579,0,.264947,.802122,.00143039,0,.28517,.78445,.00139717,0,.306137,.766434,.00136312,0,.327857,.747816,.00132597,0,.350341,.729519,.00128323,0,.373598,.711454,.00123803,0,.397642,.692699,.00119097,0,.422485,.673723,.00114565,0,.448139,.654386,.00109552,0,.474619,.634673,.00104553,0,.501933,.615554,99985e-8,0,.530089,.596462,948207e-9,0,.559087,.577385,902299e-9,0,.588913,.558257,856448e-9,0,.619525,.5392,810395e-9,0,.650826,.520543,768558e-9,0,.68254,.502206,7239e-7,0,.714286,.48402,685794e-9,0,.746032,.465779,64471e-8,0,.777778,.448455,609583e-9,0,.809524,.431091,57227e-8,0,.84127,.414147,54042e-8,0,.873016,.39765,506545e-9,0,.904762,.381576,477635e-9,0,.936508,.365881,448446e-9,0,.968254,.350582,421424e-9,0,1,1,427144e-9,0,0,1,427151e-9,0,0,1,427232e-9,0,0,.999998,42759e-8,0,0,.999995,428555e-9,0,0,.999988,430603e-9,0,0,.999976,434368e-9,0,0,.999952,440688e-9,0,0,.999919,450667e-9,0,0,.999871,46578e-8,0,0,.999801,488024e-9,0,0,.999704,520092e-9,0,129791e-9,.999572,565553e-9,0,821056e-9,.999389,628906e-9,0,.00225241,.999114,714911e-9,0,.00449109,.998488,819218e-9,0,.00756249,.995234,80415e-8,0,.0114716,.993021,830181e-9,0,.0162131,.991407,902645e-9,0,.021776,.989625,996934e-9,0,.0281471,.987064,.00109707,0,.0353118,.983265,.00114353,0,.0432562,.979535,.0012272,0,.0519665,.975224,.00132642,0,.0614298,.969574,.00138092,0,.0716348,.963021,.00145896,0,.0825709,.956046,.00152834,0,.094229,.947136,.00158217,0,.106602,.937313,.0016347,0,.119682,.926073,.00168383,0,.133465,.913121,.00171627,0,.147947,.899165,.00174229,0,.163125,.885891,.00176137,0,.178998,.873783,.00176406,0,.195566,.861331,.00176156,0,.21283,.847569,.00175346,0,.230793,.832785,.00172753,0,.249459,.817442,.00170204,0,.268832,.800613,.00166576,0,.28892,.783597,.00162909,0,.30973,.76571,.0015826,0,.331271,.747021,.00153106,0,.353554,.728593,.00148036,0,.37659,.710661,.00142808,0,.400391,.692426,.00136906,0,.424973,.673623,.00131066,0,.450347,.65494,.00125569,0,.476531,.635448,.00119517,0,.503535,.616221,.00113828,0,.531372,.597531,.0010816,0,.560047,.578795,.00102673,0,.589554,.559892,970985e-9,0,.619869,.541307,919773e-9,0,.650923,.522608,868479e-9,0,.68254,.504484,82137e-8,0,.714286,.486603,772916e-9,0,.746032,.468802,730353e-9,0,.777778,.451172,684955e-9,0,.809524,.434348,647565e-9,0,.84127,.417445,605863e-9,0,.873016,.401077,571885e-9,0,.904762,.385039,536034e-9,0,.936508,.369483,504227e-9,0,.968254,.354272,473165e-9,0,1,1,599525e-9,0,0,1,599533e-9,0,0,1,599639e-9,0,0,.999998,600097e-9,0,0,.999994,601336e-9,0,0,.999987,603958e-9,0,0,.999972,608775e-9,0,0,.999949,616842e-9,0,0,.999912,629534e-9,0,0,.999857,648658e-9,0,0,.999781,676615e-9,0,538873e-11,.999674,716574e-9,0,308602e-9,.999528,772641e-9,0,.00127003,.999326,849806e-9,0,.00300783,.999009,952682e-9,0,.00556637,.998112,.00106394,0,.00895889,.994496,.00102228,0,.0131827,.992806,.00108586,0,.0182277,.991211,.0011759,0,.0240795,.989415,.00128955,0,.030723,.986499,.00139038,0,.0381418,.982679,.00144539,0,.046321,.978839,.00153954,0,.0552459,.974295,.00164417,0,.0649034,.968784,.00171517,0,.0752814,.962324,.00180282,0,.0863693,.954956,.00186387,0,.0981578,.94624,.00193817,0,.110639,.936517,.00198156,0,.123806,.925186,.00203042,0,.137655,.91252,.0020664,0,.15218,.898441,.00207822,0,.16738,.884394,.0020992,0,.183253,.871273,.00208748,0,.199799,.859057,.00208686,0,.21702,.845243,.00205519,0,.234918,.830723,.00202868,0,.253496,.815801,.00199501,0,.272761,.79914,.00194193,0,.292719,.782372,.00188824,0,.313377,.76482,.00183695,0,.334745,.746586,.00177418,0,.356833,.7281,.00170628,0,.379654,.709842,.00164063,0,.403221,.692019,.00157355,0,.427548,.67364,.00150262,0,.452651,.655277,.00143473,0,.478545,.636438,.00136371,0,.505246,.617364,.00129911,0,.532768,.598603,.00123014,0,.561122,.580195,.00116587,0,.590309,.561786,.00110398,0,.620318,.543377,.00104148,0,.651102,.525093,983984e-9,0,.682545,.506791,92667e-8,0,.714286,.489291,874326e-9,0,.746032,.471811,821734e-9,0,.777778,.454435,774698e-9,0,.809524,.437493,727302e-9,0,.84127,.420977,684039e-9,0,.873016,.404729,64373e-8,0,.904762,.388756,60285e-8,0,.936508,.373344,56765e-8,0,.968254,.358191,531929e-9,0,1,1,832169e-9,0,0,1,832178e-9,0,0,1,83231e-8,0,0,.999998,832893e-9,0,0,.999995,834465e-9,0,0,.999985,837791e-9,0,0,.999969,843893e-9,0,0,.999944,854086e-9,0,0,.999903,870071e-9,0,0,.999843,894042e-9,0,0,.999759,928865e-9,0,531805e-10,.999643,978242e-9,0,579365e-9,.99948,.00104684,0,.00182774,.999255,.00114012,0,.00387804,.998885,.00126188,0,.00675709,.997405,.00135888,0,.010468,.99424,.00133626,0,.0150018,.992458,.00140905,0,.0203443,.990929,.00152305,0,.0264786,.989116,.00165882,0,.0333875,.985624,.00174128,0,.0410536,.982003,.00182108,0,.0494609,.978336,.00194498,0,.0585941,.973184,.00202708,0,.0684396,.9678,.00212166,0,.0789851,.961348,.00221366,0,.0902199,.953841,.00228219,0,.102134,.94534,.00235662,0,.114721,.935552,.00240572,0,.127972,.924064,.00244405,0,.141884,.911827,.00247557,0,.156451,.897731,.00248374,0,.171672,.883409,.00249863,0,.187545,.868625,.00246688,0,.20407,.856529,.00246523,0,.221249,.842999,.00242368,0,.239083,.828505,.00237354,0,.257578,.813825,.00232588,0,.276738,.797813,.00226731,0,.296569,.781097,.00219704,0,.31708,.764038,.00212394,0,.338281,.746067,.00204786,0,.360181,.727687,.00196728,0,.382794,.709571,.00188779,0,.406133,.691503,.00180532,0,.430213,.673673,.00171849,0,.45505,.655732,.00164147,0,.480662,.637399,.00155858,0,.507065,.618616,.00147641,0,.534278,.60005,.00140125,0,.562313,.581713,.00132441,0,.59118,.563546,.00125014,0,.620875,.545605,.00118249,0,.651373,.527559,.0011116,0,.682593,.509764,.00104979,0,.714286,.49193,985977e-9,0,.746032,.475011,928592e-9,0,.777778,.457878,873466e-9,0,.809524,.440979,819585e-9,0,.84127,.424613,772365e-9,0,.873016,.408549,722195e-9,0,.904762,.392771,680014e-9,0,.936508,.377317,636797e-9,0,.968254,.362352,598318e-9,0,1,1,.00114313,0,0,1,.00114314,0,0,.999999,.00114331,0,0,.999998,.00114404,0,0,.999994,.00114601,0,0,.999984,.00115019,0,0,.999967,.00115784,0,0,.999937,.0011706,0,0,.999894,.00119054,0,0,.999828,.00122031,0,0,.999735,.00126331,0,169263e-9,.999606,.00132382,0,949167e-9,.999426,.0014071,0,.00249668,.999173,.00151895,0,.00486392,.99873,.00166102,0,.00806323,.996243,.0017023,0,.0120895,.993779,.00172782,0,.0169288,.9919,.0018108,0,.0225633,.990524,.00196028,0,.028974,.98868,.00212014,0,.036142,.984663,.00217598,0,.044049,.981457,.00230563,0,.0526781,.977608,.00243966,0,.0620137,.972215,.00251336,0,.0720418,.966798,.0026285,0,.0827499,.960241,.00271409,0,.0941271,.952489,.00278381,0,.106164,.944127,.00285399,0,.118852,.934282,.00290994,0,.132185,.923271,.00294558,0,.146157,.910803,.00296269,0,.160766,.896705,.00296803,0,.176007,.88238,.00296637,0,.19188,.867116,.00293163,0,.208385,.853636,.00289418,0,.225523,.840469,.00284663,0,.243296,.82639,.00278594,0,.261709,.811759,.00271618,0,.280767,.796113,.00263187,0,.300476,.779518,.00254589,0,.320845,.763142,.00246003,0,.341883,.745464,.00236529,0,.363601,.727491,.00226536,0,.386011,.709414,.00216375,0,.409128,.691396,.00207127,0,.432967,.67368,.00197106,0,.457545,.656049,.00187022,0,.482881,.638188,.00177605,0,.508992,.620177,.00168482,0,.535899,.601506,.00158909,0,.563619,.58362,.00150583,0,.592165,.565496,.00141791,0,.621544,.54789,.00133693,0,.651743,.530323,.00126038,0,.682709,.512795,.00118556,0,.714286,.495199,.00111527,0,.746032,.478101,.0010489,0,.777778,.461511,984264e-9,0,.809524,.444879,92591e-8,0,.84127,.428424,866582e-9,0,.873016,.412495,814463e-9,0,.904762,.396975,764498e-9,0,.936508,.381614,715967e-9,0,.968254,.366732,672483e-9,0,1,1,.00155501,0,0,1,.00155503,0,0,1,.00155524,0,0,.999998,.00155615,0,0,.999994,.0015586,0,0,.999983,.00156379,0,0,.999963,.0015733,0,0,.999932,.00158911,0,0,.999882,.00161376,0,0,.99981,.00165041,0,100875e-10,.999708,.00170304,0,367658e-9,.999565,.00177658,0,.0014234,.999368,.00187688,0,.00327939,.999081,.00200989,0,.00596629,.99852,.00217177,0,.0094852,.99549,.0021745,0,.013824,.993252,.00222357,0,.0189642,.991727,.00235022,0,.0248856,.989951,.00250561,0,.0315669,.988029,.00268829,0,.0389882,.984029,.0027496,0,.0471302,.980683,.00289793,0,.0559754,.976554,.00303315,0,.0655081,.97139,.00313257,0,.0757138,.965544,.00323656,0,.08658,.95912,.00333432,0,.0980954,.951183,.0034039,0,.110251,.942974,.00347515,0,.123038,.932642,.00350381,0,.13645,.922158,.00354519,0,.150482,.909404,.00353851,0,.165129,.896071,.0035435,0,.18039,.881206,.00349936,0,.196263,.866077,.00347256,0,.212748,.85093,.003415,0,.229847,.837703,.00333367,0,.247561,.823878,.003249,0,.265895,.809449,.00316347,0,.284854,.794379,.00306351,0,.304445,.778138,.0029499,0,.324675,.761997,.00284099,0,.345555,.744938,.00272104,0,.367095,.727212,.00260715,0,.389309,.709549,.00248855,0,.41221,.691704,.00236783,0,.435814,.673689,.00225178,0,.460138,.656453,.00213765,0,.485203,.639128,.00202178,0,.511028,.621512,.00191443,0,.537634,.603598,.00180977,0,.565041,.58559,.00170456,0,.593268,.567852,.00160927,0,.622327,.5503,.00151395,0,.652217,.533033,.00142499,0,.682907,.515942,.00133955,0,.714296,.498814,.0012602,0,.746032,.481595,.00118188,0,.777778,.465117,.00111171,0,.809524,.448865,.00104091,0,.84127,.432711,976618e-9,0,.873016,.416822,91859e-8,0,.904762,.401272,857704e-9,0,.936508,.386226,807172e-9,0,.968254,.371321,75464e-8,0,1,1,.00209596,0,0,1,.00209598,0,0,1,.00209624,0,0,.999997,.00209736,0,0,.999991,.00210039,0,0,.999979,.00210678,0,0,.999959,.00211847,0,0,.999925,.0021379,0,0,.99987,.00216809,0,0,.999791,.00221281,0,681487e-10,.999677,.00227669,0,658161e-9,.999521,.00236533,0,.00200635,.999301,.00248514,0,.0041779,.998977,.00264185,0,.00718648,.998191,.00281695,0,.0110239,.994801,.00278518,0,.015672,.993091,.00288774,0,.0211091,.991571,.00303931,0,.0273123,.9897,.00321643,0,.034259,.987023,.00337332,0,.0419282,.983289,.00346146,0,.0502998,.979892,.00363704,0,.0593562,.975111,.00373601,0,.069081,.970351,.0038842,0,.0794598,.964131,.00397053,0,.0904798,.957747,.00408078,0,.10213,.949536,.00413533,0,.1144,.941372,.00420305,0,.127284,.931049,.00422815,0,.140772,.920647,.00425048,0,.154862,.908033,.0042281,0,.169548,.895028,.00422026,0,.184828,.879968,.00415042,0,.200701,.864875,.00408821,0,.217167,.84918,.00400909,0,.234227,.834934,.00391178,0,.251884,.821397,.00380066,0,.270141,.807135,.00367974,0,.289004,.792363,.00355172,0,.308479,.776661,.003411,0,.328575,.760705,.00328123,0,.349301,.744408,.00314003,0,.370668,.726994,.0029906,0,.392689,.709598,.00285034,0,.415379,.692112,.00271179,0,.438754,.674435,.00257185,0,.46283,.65676,.00243425,0,.48763,.639982,.00230351,0,.513173,.622983,.0021777,0,.539482,.605471,.00204991,0,.566579,.58796,.00193759,0,.594488,.570463,.00181976,0,.623226,.553058,.00171497,0,.6528,.535894,.00161109,0,.683198,.519089,.00151394,0,.714354,.502454,.00142122,0,.746032,.485681,.00133488,0,.777778,.468935,.00124975,0,.809524,.452951,.00117309,0,.84127,.437139,.00110155,0,.873016,.421446,.00103124,0,.904762,.405951,966387e-9,0,.936508,.391003,908119e-9,0,.968254,.376198,848057e-9,0,1,1,.00280076,0,0,1,.00280078,0,0,.999999,.00280109,0,0,.999997,.00280246,0,0,.999992,.00280616,0,0,.999979,.00281396,0,0,.999956,.00282822,0,0,.999916,.00285186,0,0,.999857,.0028885,0,0,.999768,.00294259,0,196026e-9,.999645,.00301946,0,.00104842,.99947,.00312541,0,.00270199,.999229,.00326733,0,.00519449,.998852,.00344992,0,.00852602,.997558,.00361052,0,.0126804,.994417,.0035898,0,.017635,.992824,.00372393,0,.023365,.991344,.00390695,0,.0298456,.989337,.00410392,0,.0370529,.985811,.00420987,0,.0449651,.982772,.00437488,0,.0535615,.979001,.00455069,0,.0628243,.974102,.00464462,0,.0727368,.969197,.00480577,0,.0832844,.962759,.00487818,0,.0944545,.956207,.00498176,0,.106236,.947909,.00503392,0,.118619,.939596,.00507474,0,.131595,.929642,.00509798,0,.145159,.918807,.00508476,0,.159305,.906921,.00505634,0,.174028,.893312,.00498845,0,.189327,.878933,.0049133,0,.2052,.863986,.0048259,0,.221647,.847936,.00470848,0,.23867,.832253,.00456889,0,.25627,.818619,.00442726,0,.274453,.804788,.00427677,0,.293222,.790241,.00411906,0,.312585,.775162,.00394833,0,.33255,.759463,.00377366,0,.353126,.743598,.00361026,0,.374324,.72697,.00343627,0,.396158,.709646,.00326422,0,.418641,.69277,.00309717,0,.44179,.675371,.0029356,0,.465624,.657863,.00277712,0,.490163,.640772,.00261738,0,.515429,.624441,.0024737,0,.541445,.607497,.00233125,0,.568236,.590438,.00218994,0,.595828,.573224,.0020664,0,.624242,.556168,.00193526,0,.653496,.539232,.00182463,0,.683588,.522352,.00170735,0,.714482,.506172,.00160555,0,.746032,.489842,.00150451,0,.777778,.473463,.00140938,0,.809524,.457266,.00132568,0,.84127,.441609,.0012376,0,.873016,.426348,.00116265,0,.904762,.411002,.00108935,0,.936508,.396045,.00101946,0,.968254,.381448,955665e-9,0,1,1,.0037121,0,0,1,.00371213,0,0,1,.00371251,0,0,.999997,.00371417,0,0,.99999,.00371863,0,0,.999977,.00372807,0,0,.99995,.00374529,0,0,.999908,.0037738,0,0,.999843,.00381789,0,123596e-10,.999745,.00388273,0,407442e-9,.999608,.00397443,0,.0015447,.999415,.00409998,0,.00351385,.999143,.00426662,0,.0063316,.9987,.00447625,0,.00998679,.996363,.00455323,0,.0144569,.994021,.00461052,0,.0197151,.992372,.00476359,0,.0257344,.991007,.00499101,0,.0324882,.988767,.0051972,0,.0399517,.984872,.00528407,0,.0481022,.982004,.00548926,0,.0569191,.977714,.00564385,0,.0663839,.973076,.0057693,0,.0764801,.967565,.0058924,0,.0871928,.961384,.00599629,0,.0985095,.954435,.00605998,0,.110419,.946303,.0061133,0,.122912,.937662,.00612028,0,.13598,.927867,.00612209,0,.149617,.916475,.00604813,0,.163817,.90541,.00603088,0,.178577,.891591,.00592218,0,.193894,.877573,.00578854,0,.209767,.862511,.00566648,0,.226196,.846861,.00551481,0,.243182,.83068,.00533754,0,.260728,.815725,.00515487,0,.278837,.802321,.0049655,0,.297515,.787826,.00475421,0,.316768,.773454,.00456002,0,.336605,.758224,.00434727,0,.357034,.74265,.00414444,0,.378067,.726729,.00393738,0,.399717,.710155,.00373575,0,.421998,.693312,.00353736,0,.444928,.67653,.00334368,0,.468523,.659444,.00315981,0,.492806,.642051,.00297809,0,.517798,.625758,.00280592,0,.543525,.609615,.00264254,0,.570012,.592919,.00248459,0,.597288,.576298,.00233327,0,.625379,.559489,.00219519,0,.654307,.542891,.00205441,0,.684084,.526255,.00193385,0,.714693,.509853,.00180745,0,.746044,.494131,.00169817,0,.777778,.478114,.0015913,0,.809524,.462274,.00148981,0,.84127,.446412,.00139537,0,.873016,.431274,.00130984,0,.904762,.41635,.00122403,0,.936508,.401476,.00114809,0,.968254,.386993,.00107563,0,1,1,.00488216,0,0,1,.0048822,0,0,1,.00488265,0,0,.999997,.00488463,0,0,.999988,.00488999,0,0,.999974,.00490129,0,0,.999946,.00492191,0,0,.999897,.00495598,0,0,.999825,.00500855,0,744791e-10,.999718,.00508559,0,712744e-9,.999565,.005194,0,.00215249,.999352,.00534147,0,.00444576,.999046,.00553523,0,.00759218,.998492,.00577016,0,.0115714,.995564,.00578487,0,.0163557,.993339,.00586414,0,.021915,.991834,.00606002,0,.0282201,.990496,.00633312,0,.0352433,.987826,.00651941,0,.042959,.98383,.00660842,0,.0513439,.98109,.00685523,0,.0603772,.976131,.00695778,0,.0700402,.971922,.00714236,0,.0803163,.965901,.00721437,0,.0911908,.959606,.00732017,0,.102651,.952504,.00735788,0,.114686,.944365,.00738493,0,.127286,.935652,.00737969,0,.140443,.925813,.00733612,0,.154151,.914397,.00723094,0,.168405,.903257,.00714002,0,.183201,.890015,.00700149,0,.198536,.876014,.00682813,0,.214409,.861436,.00665567,0,.23082,.845752,.00644526,0,.24777,.829169,.00621635,0,.265263,.813435,.00597789,0,.283301,.799701,.00575694,0,.301889,.785726,.00549866,0,.321035,.77152,.0052503,0,.340746,.75683,.00499619,0,.361032,.741951,.0047543,0,.381904,.726367,.0045084,0,.403374,.710537,.00426784,0,.425457,.693965,.00403487,0,.448169,.677724,.0038075,0,.47153,.66117,.00359431,0,.495561,.644274,.00338354,0,.520284,.627449,.00318163,0,.545725,.611645,.00299672,0,.571911,.595614,.00281016,0,.598873,.579426,.00264252,0,.62664,.563016,.00247509,0,.655239,.546728,.00232647,0,.684692,.530539,.00217803,0,.714999,.514164,.00204216,0,.746106,.498344,.00191403,0,.777778,.482957,.00179203,0,.809524,.467336,.00167695,0,.84127,.451994,.00157567,0,.873016,.436514,.00147113,0,.904762,.42178,.00138034,0,.936508,.407271,.00129219,0,.968254,.392822,.0012098,0,1,1,.00637427,0,0,1,.00637431,0,0,.999999,.00637485,0,0,.999996,.00637721,0,0,.999987,.00638357,0,0,.999971,.006397,0,0,.999939,.00642142,0,0,.999888,.00646177,0,0,.999807,.00652387,0,207916e-9,.999689,.00661454,0,.00112051,.99952,.00674155,0,.00287719,.999283,.00691313,0,.00550145,.998936,.00713598,0,.00897928,.998165,.00738501,0,.0132829,.994847,.00734388,0,.01838,.993182,.00749991,0,.0242381,.991665,.0077246,0,.030826,.989708,.00797579,0,.0381152,.986663,.00813011,0,.0460794,.983288,.00830365,0,.0546951,.980104,.00853496,0,.0639411,.974855,.00861045,0,.0737988,.97045,.00879133,0,.0842516,.964509,.00886377,0,.0952848,.957594,.00890346,0,.106886,.950546,.00893289,0,.119044,.942225,.00890074,0,.131749,.933365,.00886826,0,.144994,.923202,.0087316,0,.158772,.912605,.00863082,0,.173078,.901099,.00847403,0,.187908,.888177,.00825838,0,.203261,.873955,.00801834,0,.219134,.860091,.00779026,0,.235527,.84434,.00752478,0,.252443,.828517,.00724074,0,.269883,.81239,.00693769,0,.287851,.79721,.00664817,0,.306352,.783489,.00634763,0,.325393,.769514,.00604221,0,.344981,.755419,.00573568,0,.365126,.741083,.00544359,0,.385839,.726059,.00515515,0,.407132,.710809,.00487139,0,.42902,.695052,.00459846,0,.45152,.678886,.00433412,0,.474651,.663042,.00407981,0,.498433,.646634,.00384264,0,.52289,.630117,.00360897,0,.548048,.613804,.00338863,0,.573936,.598338,.00318486,0,.600584,.582687,.00298377,0,.628027,.566809,.00280082,0,.656295,.550817,.00262255,0,.685417,.534937,.00245835,0,.715406,.519151,.00230574,0,.74624,.503118,.0021549,0,.777778,.487723,.00202008,0,.809524,.472725,.00189355,0,.84127,.457599,.00177108,0,.873016,.442558,.00165843,0,.904762,.427624,.00155494,0,.936508,.413171,.00145273,0,.968254,.399122,.00136454,0,1,1,.00826496,0,0,1,.00826499,0,0,1,.00826564,0,0,.999996,.00826842,0,0,.999987,.00827589,0,0,.999967,.00829167,0,0,.999933,.00832037,0,0,.999876,.00836768,0,109338e-10,.999786,.00844031,0,427145e-9,.999655,.00854603,0,.0016384,.999468,.00869337,0,.00372392,.999203,.008891,0,.00668513,.998803,.00914387,0,.0104968,.99748,.00935838,0,.015125,.994446,.00933309,0,.0205338,.99292,.00953084,0,.0266884,.991414,.0097893,0,.0335565,.989049,.0100228,0,.0411086,.98582,.0101664,0,.0493181,.982441,.0103582,0,.0581613,.978595,.0105292,0,.0676169,.973495,.0106274,0,.0776661,.968405,.0107261,0,.0882926,.962717,.0108234,0,.0994817,.955478,.0108102,0,.111221,.948275,.0107914,0,.123499,.940006,.0107161,0,.136308,.930831,.0106309,0,.149639,.920648,.0104083,0,.163485,.910205,.0102312,0,.177843,.898445,.0100051,0,.192707,.885986,.00971928,0,.208077,.872204,.00940747,0,.22395,.858436,.0091085,0,.240326,.843454,.00876595,0,.257208,.827437,.00839794,0,.274596,.811488,.00803692,0,.292496,.796039,.00767352,0,.310911,.781083,.0073097,0,.329849,.767642,.00694032,0,.349316,.753901,.00657476,0,.369323,.740131,.00622699,0,.38988,.725845,.0058838,0,.410999,.710991,.00555586,0,.432696,.696002,.00523089,0,.454987,.680461,.00492494,0,.47789,.664875,.00463464,0,.501426,.649273,.00435422,0,.52562,.63302,.0040875,0,.550498,.61705,.00384075,0,.576089,.601154,.00359557,0,.602427,.586008,.00337636,0,.629544,.570699,.00316019,0,.657479,.555166,.00296033,0,.686264,.539645,.00277552,0,.715924,.524159,.00259499,0,.746459,.508682,.00243257,0,.777789,.493163,.00227851,0,.809524,.478004,.00213083,0,.84127,.46347,.00199502,0,.873016,.448778,.00186967,0,.904762,.434105,.00174732,0,.936508,.419576,.00163861,0,.968254,.405541,.00153341,0,1,1,.0106462,0,0,1,.0106462,0,0,.999999,.010647,0,0,.999995,.0106502,0,0,.999985,.0106589,0,0,.999964,.0106773,0,0,.999925,.0107106,0,0,.999861,.0107655,0,712986e-10,.999763,.0108497,0,743959e-9,.999616,.0109716,0,.00227361,.999408,.0111408,0,.0046983,.999112,.0113659,0,.00800158,.998637,.0116475,0,.0121493,.996223,.0117231,0,.0171023,.994006,.0118064,0,.0228218,.992444,.0120254,0,.0292711,.991028,.0123314,0,.036417,.98803,.0124954,0,.0442295,.984816,.0126538,0,.0526815,.981399,.0128537,0,.0617492,.977085,.0129694,0,.0714114,.972154,.013091,0,.0816495,.966617,.0131166,0,.0924472,.960628,.0131583,0,.10379,.953295,.0131094,0,.115665,.94575,.0129966,0,.128062,.937654,.0128796,0,.140972,.927716,.0126477,0,.154387,.917932,.0123889,0,.168301,.907719,.012131,0,.182709,.89584,.0118013,0,.197608,.883526,.0114145,0,.212994,.870301,.0110075,0,.228867,.856272,.0106019,0,.245227,.842251,.0101938,0,.262074,.826466,.00973254,0,.279412,.810859,.0092846,0,.297244,.795051,.00883304,0,.315575,.780053,.00840272,0,.334412,.76575,.00796438,0,.35376,.752298,.00752526,0,.373631,.739153,.00711486,0,.394034,.725514,.00670361,0,.414983,.711473,.00632656,0,.436491,.696936,.00595206,0,.458575,.682126,.00559191,0,.481253,.667027,.00525362,0,.504547,.651875,.00493805,0,.528481,.636463,.00462848,0,.553081,.620641,.00433936,0,.578377,.604931,.00407,0,.604404,.589549,.00380864,0,.631197,.574712,.00357049,0,.658795,.559775,.00334466,0,.687238,.544514,.00312505,0,.716559,.529555,.00293199,0,.746776,.514402,.00274204,0,.777849,.499302,.00256647,0,.809524,.484114,.00239901,0,.84127,.469308,.00225148,0,.873016,.455133,.00210178,0,.904762,.440939,.0019727,0,.936508,.426627,.00184382,0,.968254,.412509,.00172548,0,1,1,.013628,0,0,1,.0136281,0,0,.999999,.0136289,0,0,.999995,.0136327,0,0,.999983,.0136427,0,0,.99996,.0136638,0,0,.999917,.0137022,0,0,.999846,.0137652,0,204597e-9,.999736,.0138615,0,.00116837,.999573,.0140007,0,.00303325,.99934,.0141927,0,.00580613,.999004,.0144457,0,.00945626,.998407,.0147489,0,.0139421,.995464,.014731,0,.0192202,.993328,.0148283,0,.0252495,.991799,.0150797,0,.0319921,.990397,.0154316,0,.0394138,.986835,.0155005,0,.0474843,.983938,.0157308,0,.0561763,.980154,.0158753,0,.0654661,.975659,.0159581,0,.0753326,.970171,.0159832,0,.0857571,.964803,.0160084,0,.0967236,.958366,.0159484,0,.108218,.950613,.0158001,0,.120227,.942874,.0155845,0,.132741,.935005,.0154292,0,.145751,.924991,.0150742,0,.159249,.914814,.0146757,0,.17323,.904743,.0143097,0,.187687,.893216,.0138695,0,.202619,.880769,.0133706,0,.218021,.868136,.0128606,0,.233894,.85469,.0123403,0,.250238,.840593,.0118091,0,.267052,.825808,.011253,0,.284341,.81009,.0107099,0,.302106,.79504,.0101636,0,.320354,.779757,.00964041,0,.33909,.764697,.00911896,0,.358322,.750913,.00859533,0,.378059,.738175,.00811592,0,.398311,.725242,.00764504,0,.41909,.711864,.00718885,0,.440412,.698009,.00675843,0,.462292,.683841,.00634984,0,.484748,.669391,.00595502,0,.507802,.654731,.00558671,0,.531477,.639805,.00523578,0,.555802,.624789,.00490834,0,.580805,.609325,.00459448,0,.606522,.593975,.00430342,0,.63299,.578983,.00403019,0,.66025,.564442,.0037707,0,.688346,.549835,.0035316,0,.717319,.535039,.00330255,0,.7472,.520403,.00308932,0,.777982,.505687,.00289335,0,.809524,.490939,.00270818,0,.84127,.476233,.0025343,0,.873016,.461624,.00237097,0,.904762,.447833,.00222065,0,.936508,.433992,.00207561,0,.968254,.420147,.00194955,0,1,1,.0173415,0,0,1,.0173416,0,0,.999999,.0173426,0,0,.999995,.0173468,0,0,.999983,.0173582,0,0,.999954,.0173822,0,0,.999908,.0174258,0,669501e-11,.999828,.0174973,0,427399e-9,.999705,.0176063,0,.00171019,.999524,.0177631,0,.0039248,.999263,.0179781,0,.00705382,.998878,.018258,0,.0110552,.998012,.0185551,0,.0158812,.994614,.0184264,0,.0214852,.993132,.0186385,0,.0278239,.991563,.0189067,0,.0348585,.989298,.0191577,0,.0425544,.986036,.0192522,0,.050881,.982558,.0194063,0,.059811,.978531,.019486,0,.0693209,.974198,.0195847,0,.0793895,.968148,.0194749,0,.0899984,.962565,.0194277,0,.101132,.956041,.0192991,0,.112775,.947749,.0189893,0,.124917,.94018,.018704,0,.137547,.93165,.0183458,0,.150655,.921798,.0178775,0,.164236,.911573,.0173618,0,.178281,.901569,.0168482,0,.192788,.890341,.016265,0,.207752,.877835,.0156199,0,.223171,.865472,.0149516,0,.239044,.852905,.0143274,0,.255371,.838906,.0136643,0,.272153,.824888,.0129903,0,.289393,.809977,.0123218,0,.307093,.794697,.0116572,0,.325259,.780028,.0110307,0,.343896,.765124,.0104236,0,.363012,.750411,.0098219,0,.382617,.737264,.00924397,0,.402719,.724799,.00868719,0,.423332,.712253,.00816476,0,.444469,.699267,.00767262,0,.466146,.685618,.00719746,0,.488383,.671736,.00673916,0,.511199,.657777,.00631937,0,.534618,.643497,.00592411,0,.558668,.62889,.00553928,0,.58338,.614299,.0051934,0,.608787,.599197,.00485985,0,.634929,.584175,.00454357,0,.661849,.569541,.00425787,0,.689594,.555193,.00397905,0,.718211,.540947,.00372364,0,.747742,.526593,.00348599,0,.778205,.512335,.00326103,0,.80953,.498017,.00305137,0,.84127,.483609,.00285485,0,.873016,.469368,.00267472,0,.904762,.455037,.00249945,0,.936508,.441493,.00234792,0,.968254,.428147,.00219936,0,1,1,.0219422,0,0,1,.0219423,0,0,.999998,.0219434,0,0,.999993,.0219481,0,0,.999981,.021961,0,0,.999949,.0219879,0,0,.999896,.0220367,0,593194e-10,.999808,.0221167,0,75364e-8,.99967,.0222383,0,.00237884,.999466,.0224125,0,.00495612,.999174,.0226495,0,.00844887,.998725,.0229525,0,.0128058,.996979,.0231123,0,.0179742,.994317,.0230742,0,.0239047,.992781,.0232895,0,.0305526,.991191,.0235734,0,.0378786,.987787,.0236152,0,.0458475,.985092,.0237994,0,.0544287,.981121,.0238553,0,.0635952,.976924,.0238706,0,.0733233,.97218,.0238704,0,.0835922,.965956,.0236598,0,.0943839,.959998,.0234735,0,.105682,.953245,.0232277,0,.117474,.944445,.0226973,0,.129747,.937087,.0223527,0,.142491,.928341,.0218144,0,.155697,.9184,.0211516,0,.169358,.907959,.0204553,0,.183469,.89808,.0197673,0,.198024,.887047,.0189915,0,.21302,.875221,.0182082,0,.228455,.86269,.0173584,0,.244329,.850735,.0165718,0,.260639,.837545,.0157524,0,.277389,.823639,.0149482,0,.29458,.809699,.0141431,0,.312216,.794797,.0133527,0,.3303,.780578,.0126193,0,.34884,.766019,.0118914,0,.367842,.751447,.0111839,0,.387315,.737275,.010514,0,.40727,.724545,.00987277,0,.427717,.712644,.00926569,0,.448671,.700432,.00869029,0,.470149,.687664,.00814691,0,.492167,.674288,.00763012,0,.514746,.660966,.00714437,0,.537911,.647264,.00668457,0,.561688,.633431,.00626581,0,.586108,.619133,.00585593,0,.611206,.604935,.00548188,0,.637022,.590236,.00513288,0,.663599,.575473,.0047906,0,.690989,.561228,.00448895,0,.719242,.547054,.00420233,0,.748411,.533175,.00392869,0,.778531,.519163,.00367445,0,.809583,.505328,.00344097,0,.84127,.491446,.00322003,0,.873016,.477356,.00301283,0,.904762,.46356,.00282592,0,.936508,.449623,.00264956,0,.968254,.436068,.00246956,0,1,1,.0276135,0,0,1,.0276136,0,0,.999998,.0276148,0,0,.999993,.0276201,0,0,.999976,.0276342,0,0,.999945,.027664,0,0,.999884,.0277179,0,18679e-8,.999784,.027806,0,.00119607,.99963,.0279394,0,.00318407,.999401,.0281295,0,.00613601,.999066,.0283858,0,.00999963,.998524,.0287027,0,.0147164,.995702,.0286256,0,.0202295,.993593,.0286733,0,.0264876,.992067,.0288989,0,.0334452,.990548,.0292135,0,.0410621,.986775,.0291296,0,.0493032,.984054,.0293099,0,.0581381,.979481,.0291881,0,.0675397,.975297,.0291598,0,.0774848,.96981,.028954,0,.0879528,.963524,.028628,0,.0989258,.957398,.0283135,0,.110388,.950088,.0278469,0,.122327,.941538,.0271798,0,.134729,.933332,.0265388,0,.147587,.924392,.0257776,0,.160889,.914581,.024916,0,.174631,.904347,.0240242,0,.188806,.894324,.0231229,0,.203409,.883724,.022153,0,.218437,.872207,.0211355,0,.233888,.859927,.0201048,0,.249761,.848373,.0191263,0,.266056,.836023,.0181306,0,.282774,.82289,.0171718,0,.299917,.809324,.0162196,0,.317488,.795361,.0152622,0,.335493,.781253,.01439,0,.353936,.767338,.013533,0,.372825,.753156,.0127244,0,.392168,.739122,.0119454,0,.411976,.725358,.0112054,0,.432259,.712949,.010487,0,.453032,.701621,.00984032,0,.47431,.689703,.00921495,0,.496111,.677216,.00862492,0,.518456,.664217,.00806882,0,.541367,.65137,.00755922,0,.564872,.638,.00705705,0,.589001,.62453,.00661266,0,.613789,.610601,.00618432,0,.639277,.59676,.00578033,0,.66551,.582433,.00540927,0,.692539,.568026,.00506104,0,.720422,.55414,.0047353,0,.749216,.540178,.00442889,0,.778974,.526513,.00414363,0,.809711,.512954,.00388237,0,.84127,.499403,.00362875,0,.873016,.486026,.00340827,0,.904762,.472345,.00318598,0,.936508,.458828,.00297635,0,.968254,.445379,.00279447,0,1,1,.0345716,0,0,1,.0345717,0,0,.999999,.034573,0,0,.999991,.0345787,0,0,.999974,.0345941,0,0,.999937,.0346263,0,188589e-11,.999869,.0346847,0,409238e-9,.999757,.0347798,0,.0017674,.999582,.0349233,0,.00413658,.999322,.0351265,0,.00747408,.998939,.0353967,0,.0117157,.998219,.0357018,0,.0167966,.994974,.0354726,0,.0226572,.993201,.0355621,0,.0292445,.991573,.0357641,0,.0365123,.989301,.0359252,0,.0444203,.985712,.0358017,0,.0529334,.982411,.0358353,0,.0620214,.977827,.035617,0,.0716574,.973278,.0354398,0,.0818186,.967397,.0350483,0,.0924846,.960696,.0344795,0,.103638,.954349,.0339861,0,.115263,.946066,.0331323,0,.127348,.938012,.032359,0,.13988,.929413,.0314413,0,.152849,.920355,.0304103,0,.166248,.910586,.0292785,0,.18007,.900609,.0281391,0,.194308,.890093,.0269103,0,.208958,.880013,.0257269,0,.224018,.869001,.0244671,0,.239485,.85751,.0232252,0,.255359,.84582,.0220117,0,.271638,.834383,.0208274,0,.288324,.822158,.0196628,0,.305419,.809056,.0185306,0,.322927,.795832,.0174174,0,.340851,.782547,.0163758,0,.359199,.7689,.015391,0,.377975,.755526,.0144488,0,.397189,.741681,.0135372,0,.416851,.728178,.0126957,0,.436971,.714642,.0118812,0,.457564,.702756,.0111165,0,.478644,.69175,.0104145,0,.500229,.680159,.00974439,0,.522339,.668073,.00911926,0,.544997,.655405,.00851393,0,.56823,.642921,.00797637,0,.592068,.629993,.00745119,0,.616546,.616828,.00696972,0,.641705,.603305,.00652425,0,.66759,.589833,.00610188,0,.694255,.575945,.00570834,0,.72176,.561745,.00533384,0,.750168,.548277,.00500001,0,.779545,.534467,.00467582,0,.809933,.521032,.00438092,0,.841272,.507877,.00410348,0,.873016,.494654,.00383618,0,.904762,.481592,.00358699,0,.936508,.468509,.00337281,0,.968254,.455293,.00316196,0,1,1,.0430698,0,0,1,.0430699,0,0,.999998,.0430713,0,0,.999991,.0430773,0,0,.99997,.0430936,0,0,.999928,.0431277,0,406396e-10,.999852,.0431893,0,744376e-9,.999724,.0432895,0,.0024806,.999527,.0434397,0,.00524779,.99923,.0436507,0,.00898164,.998783,.0439255,0,.0136083,.997507,.0441104,0,.0190582,.994418,.0438225,0,.0252694,.992864,.0439396,0,.0321879,.991127,.0440962,0,.039767,.987331,.0438408,0,.0479667,.984819,.0438991,0,.056752,.980384,.0435906,0,.0660929,.975846,.0432543,0,.075963,.970748,.0428293,0,.0863398,.964303,.042153,0,.0972035,.95772,.0414111,0,.108537,.950747,.0405893,0,.120325,.942533,.0394887,0,.132554,.934045,.0383544,0,.145215,.924942,.037057,0,.158296,.915811,.0356993,0,.17179,.90612,.0342401,0,.185691,.896434,.0328078,0,.199993,.886021,.031288,0,.214691,.876081,.0297776,0,.229782,.865608,.0282334,0,.245265,.854924,.026749,0,.261138,.843607,.02526,0,.277401,.832456,.0238214,0,.294056,.821342,.0224682,0,.311104,.809303,.0211297,0,.328548,.796468,.0198387,0,.346394,.784046,.0186227,0,.364645,.771262,.0174561,0,.38331,.758118,.0163806,0,.402396,.745075,.0153287,0,.421912,.731926,.0143647,0,.44187,.71863,.0134363,0,.462283,.705414,.0125603,0,.483165,.693792,.0117508,0,.504535,.683108,.0110016,0,.52641,.67183,.0102757,0,.548816,.66015,.00962044,0,.571776,.647907,.00898031,0,.595323,.635734,.00840811,0,.619489,.623208,.00786211,0,.644317,.610438,.00734953,0,.669852,.597345,.00687688,0,.696148,.584138,.00643469,0,.723267,.5707,.00602236,0,.75128,.556966,.0056324,0,.780258,.543607,.00528277,0,.810268,.530213,.00493999,0,.841311,.516912,.00462265,0,.873016,.503916,.0043307,0,.904762,.491146,.00406858,0,.936508,.478439,.00381436,0,.968254,.465834,.00358003,0,1,1,.0534039,0,0,1,.053404,0,0,.999998,.0534055,0,0,.999989,.0534116,0,0,.999968,.0534283,0,0,.999918,.0534633,0,155895e-9,.99983,.0535262,0,.00120914,.999685,.0536281,0,.00334944,.999461,.0537799,0,.00653077,.999119,.0539902,0,.0106718,.998582,.0542524,0,.0156907,.995919,.0540318,0,.0215147,.993735,.0538914,0,.0280801,.992126,.0539557,0,.0353323,.990266,.0540401,0,.0432247,.986317,.0536064,0,.0517172,.983213,.0534425,0,.0607754,.978303,.0528622,0,.0703698,.973665,.0523363,0,.0804742,.968091,.0516165,0,.0910667,.961026,.0505434,0,.102128,.954333,.049523,0,.113641,.946372,.0481698,0,.125591,.938254,.0467674,0,.137965,.929516,.0452341,0,.150754,.920106,.0435083,0,.163947,.910899,.0417399,0,.177537,.901532,.0399389,0,.191516,.891919,.0380901,0,.205881,.882006,.0362341,0,.220626,.871965,.0343444,0,.235749,.862145,.0324832,0,.251248,.852058,.0306681,0,.267121,.84161,.0289097,0,.283368,.830806,.0272079,0,.299992,.820476,.0256089,0,.316992,.809514,.0240394,0,.334374,.797865,.0225379,0,.35214,.785621,.0211235,0,.370296,.773765,.0197908,0,.388849,.761629,.0185235,0,.407807,.748891,.0173358,0,.427178,.736437,.0162305,0,.446974,.723707,.0151778,0,.467207,.710606,.0141791,0,.487892,.698019,.0132592,0,.509046,.686203,.0123887,0,.530687,.675692,.0115976,0,.552839,.664826,.0108325,0,.575527,.65349,.0101348,0,.59878,.641774,.00947756,0,.622634,.629794,.00886058,0,.647128,.617647,.00828526,0,.672308,.60534,.00775312,0,.698231,.592718,.00726033,0,.724958,.579746,.00679731,0,.752563,.566763,.00636111,0,.781127,.553515,.00595228,0,.810733,.540118,.00556876,0,.841426,.527325,.00523051,0,.873016,.514265,.00490712,0,.904762,.501406,.00460297,0,.936508,.488922,.00431247,0,.968254,.476541,.0040472,0,1,1,.0659184,0,0,1,.0659185,0,0,.999998,.06592,0,0,.999988,.0659259,0,0,.999963,.0659423,0,0,.999907,.0659764,0,374198e-9,.999806,.0660376,0,.00182071,.999639,.0661361,0,.0043894,.999378,.0662814,0,.00800055,.998985,.0664779,0,.0125594,.998285,.0666914,0,.0179786,.995071,.0661989,0,.0241822,.993172,.0660454,0,.031106,.991438,.0660105,0,.0386952,.988428,.0656875,0,.0469032,.985218,.0652913,0,.0556905,.981128,.0647107,0,.065023,.976015,.0638491,0,.0748717,.97097,.062993,0,.0852112,.964582,.0617927,0,.0960199,.957383,.0603626,0,.107279,.949969,.0588128,0,.118971,.941843,.0570274,0,.131084,.933624,.0551885,0,.143604,.924543,.053122,0,.156521,.914919,.0508897,0,.169825,.905773,.0486418,0,.18351,.896434,.0463364,0,.197569,.887195,.0440623,0,.211997,.877706,.0417799,0,.226789,.867719,.03945,0,.241944,.858587,.037243,0,.257458,.849317,.0350956,0,.273331,.839585,.0329852,0,.289563,.829856,.0310028,0,.306154,.819589,.0290953,0,.323108,.809714,.0272738,0,.340426,.79934,.0255631,0,.358113,.788224,.0239175,0,.376175,.776619,.0223831,0,.394616,.76521,.0209298,0,.413445,.753716,.0195786,0,.432671,.741564,.0183001,0,.452305,.729413,.0171259,0,.472358,.717146,.0159933,0,.492845,.70436,.0149495,0,.513783,.69219,.0139681,0,.535189,.680289,.0130577,0,.557087,.669611,.0122198,0,.5795,.659113,.0114174,0,.602459,.648148,.0106729,0,.625997,.636905,.00998997,0,.650154,.625154,.00934313,0,.674976,.613481,.00874839,0,.700518,.60154,.00818265,0,.726845,.58943,.00766889,0,.754032,.576828,.00717153,0,.782167,.564194,.00672696,0,.811344,.551501,.00630863,0,.841644,.538635,.00592177,0,.873016,.525724,.00554888,0,.904762,.513209,.00520225,0,.936508,.500457,.00488231,0,.968254,.48799,.00457153,0,1,1,.0810131,0,0,1,.0810133,0,0,.999997,.0810145,0,0,.999985,.08102,0,0,.999956,.0810347,0,195026e-10,.999893,.0810656,0,719316e-9,.999777,.0811205,0,.00259774,.999583,.081208,0,.00561807,.999281,.0813343,0,.00967472,.998813,.0814969,0,.0146627,.997597,.0815217,0,.0204902,.994379,.0808502,0,.0270802,.992744,.0806792,0,.0343674,.990745,.0804589,0,.0422974,.986646,.0796107,0,.0508242,.983611,.0790913,0,.0599087,.978869,.0780746,0,.0695175,.973475,.0768218,0,.0796223,.967845,.0754926,0,.0901983,.960778,.0737063,0,.101224,.953333,.0718052,0,.112682,.945274,.0695946,0,.124555,.936955,.0672492,0,.136831,.928319,.0647732,0,.149496,.919075,.0620947,0,.162542,.909114,.0591816,0,.175958,.900137,.0563917,0,.189739,.891069,.0535392,0,.203877,.882262,.0507642,0,.218368,.873232,.0479793,0,.233208,.864042,.045226,0,.248393,.855002,.0425413,0,.263923,.846569,.0400126,0,.279796,.837714,.0375269,0,.296012,.828918,.0352027,0,.312573,.819783,.0330011,0,.329479,.810129,.0308908,0,.346734,.800866,.0289112,0,.364342,.79093,.0270255,0,.382307,.780593,.0252758,0,.400637,.769511,.0236178,0,.419337,.758558,.0220652,0,.438418,.747632,.0206289,0,.457889,.736146,.0192873,0,.477761,.724093,.0180333,0,.49805,.71234,.0168264,0,.51877,.700201,.015746,0,.53994,.687949,.0147027,0,.561581,.676163,.0137512,0,.583718,.665001,.0128655,0,.60638,.65472,.0120366,0,.629599,.644213,.0112604,0,.653415,.633382,.0105413,0,.677874,.62212,.00986498,0,.70303,.610631,.00923308,0,.728948,.599078,.00864206,0,.755706,.587519,.00811784,0,.783396,.575505,.00761237,0,.812121,.563148,.00713949,0,.841989,.550828,.00668379,0,.873035,.538458,.00627715,0,.904762,.525905,.00588336,0,.936508,.513517,.00552687,0,.968254,.501395,.00519681,0,1,1,.0991506,0,0,1,.0991504,0,0,.999996,.0991515,0,0,.999984,.0991558,0,0,.999947,.0991672,0,114389e-9,.999874,.0991912,0,.00121503,.999739,.0992331,0,.00356108,.999514,.0992983,0,.00705578,.999159,.0993877,0,.011574,.998586,.0994837,0,.017003,.995731,.0988425,0,.0232484,.993384,.098276,0,.0302318,.991615,.0979269,0,.0378884,.989029,.0973432,0,.0461641,.985373,.0963539,0,.0550136,.981278,.0952306,0,.0643988,.975777,.0936233,0,.0742868,.970526,.0920219,0,.0846501,.963755,.0898912,0,.0954644,.956676,.0876064,0,.106709,.948099,.0847751,0,.118367,.939718,.0818638,0,.130423,.931305,.078857,0,.142862,.922342,.0756127,0,.155674,.912842,.0721473,0,.168849,.903304,.0686195,0,.182378,.89411,.0650589,0,.196255,.885512,.0616022,0,.210473,.877193,.0582434,0,.225027,.86877,.0548979,0,.239915,.860267,.0516095,0,.255132,.851915,.048468,0,.270678,.843912,.0454447,0,.286551,.83604,.0425612,0,.302751,.828245,.0398752,0,.31928,.820159,.0373198,0,.336138,.81167,.034916,0,.35333,.802659,.0326402,0,.370858,.793921,.0304901,0,.388728,.784713,.0284857,0,.406944,.774946,.0266186,0,.425515,.76448,.0248593,0,.444449,.753793,.0232114,0,.463756,.743506,.0217039,0,.483447,.732555,.0202841,0,.503535,.720965,.0189648,0,.524036,.709422,.0177189,0,.544968,.697756,.0165626,0,.56635,.685565,.015483,0,.588208,.673987,.0144892,0,.610569,.66244,.0135607,0,.633466,.651675,.0126956,0,.656936,.641598,.0118788,0,.681025,.63121,.0111261,0,.705788,.620514,.010437,0,.731289,.609366,.00978747,0,.757606,.598137,.00917257,0,.784834,.586966,.00859778,0,.813085,.575549,.00806803,0,.842485,.563797,.00757294,0,.87313,.551758,.00710592,0,.904762,.539894,.0066841,0,.936508,.527901,.00627901,0,.968254,.515819,.00590506,0,1,1,.120864,0,0,1,.120864,0,0,.999996,.120864,0,0,.99998,.120867,0,0,.99994,.120872,0,323781e-9,.999852,.120884,0,.00188693,.999693,.120903,0,.00473489,.999426,.120929,0,.00872704,.999002,.120955,0,.0137237,.998235,.120918,0,.0196068,.994608,.119764,0,.0262803,.992997,.119265,0,.0336657,.990968,.11863,0,.0416987,.987002,.117261,0,.0503261,.983524,.116009,0,.0595035,.97875,.114252,0,.0691935,.972652,.11193,0,.0793645,.966613,.109555,0,.0899894,.959275,.106612,0,.101045,.951272,.103375,0,.112512,.942323,.0996594,0,.124372,.933679,.0958841,0,.136611,.924822,.0919265,0,.149216,.915742,.0878061,0,.162176,.906348,.0834894,0,.175482,.896883,.079085,0,.189125,.88774,.0746745,0,.203098,.87986,.0705773,0,.217396,.871998,.0665005,0,.232015,.864325,.0625413,0,.24695,.856685,.0586781,0,.2622,.84925,.0550063,0,.277761,.841719,.0514727,0,.293634,.834755,.0481398,0,.309819,.827853,.0450172,0,.326315,.820888,.0420969,0,.343126,.813616,.0393702,0,.360254,.805767,.0367771,0,.377701,.797338,.0343274,0,.395474,.789122,.0320529,0,.413577,.780601,.0299485,0,.432018,.771424,.0279812,0,.450804,.761502,.0261054,0,.469944,.751166,.0243942,0,.489451,.741276,.0228087,0,.509337,.730898,.0213265,0,.529617,.719878,.0199307,0,.550307,.708379,.0186574,0,.571428,.697165,.0174446,0,.593003,.685554,.0163144,0,.615059,.673631,.015276,0,.637628,.662385,.0143003,0,.660746,.651059,.0134112,0,.68446,.640451,.0125794,0,.70882,.630536,.011793,0,.733893,.620316,.0110547,0,.759756,.609722,.0103668,0,.786505,.598804,.00973009,0,.814259,.587871,.00912812,0,.843157,.577121,.00858916,0,.87334,.566019,.00807333,0,.904762,.554664,.00759687,0,.936508,.543101,.00714759,0,.968254,.531558,.00673418,0,1,1,.146767,0,0,1,.146767,0,0,.999997,.146767,0,0,.999977,.146765,0,320658e-11,.999929,.146762,0,682576e-9,.999823,.146753,0,.00276402,.999633,.146735,0,.00614771,.999314,.146699,0,.0106613,.998796,.14662,0,.0161546,.997124,.146107,0,.0225063,.994062,.144857,0,.0296198,.992154,.144011,0,.037417,.989186,.142712,0,.0458348,.985279,.140926,0,.0548211,.980826,.13885,0,.0643326,.975056,.136168,0,.074333,.969005,.133217,0,.0847917,.961554,.12959,0,.0956828,.954206,.125886,0,.106984,.945046,.121335,0,.118675,.935678,.116492,0,.130741,.926748,.111635,0,.143166,.917764,.106625,0,.155939,.908358,.101325,0,.169049,.899219,.0960249,0,.182487,.890089,.0906527,0,.196245,.881488,.0853905,0,.210317,.874031,.0804177,0,.224697,.866932,.0756005,0,.23938,.859976,.0709019,0,.254364,.853375,.0664391,0,.269646,.846971,.0622012,0,.285223,.840483,.058129,0,.301096,.833969,.0542762,0,.317265,.82806,.0507042,0,.333729,.822128,.047368,0,.350491,.815989,.044272,0,.367554,.809336,.0413444,0,.38492,.802177,.038601,0,.402594,.79441,.0360227,0,.420582,.786573,.0336383,0,.438891,.778619,.0314321,0,.457527,.77,.029362,0,.476499,.760698,.0274102,0,.49582,.750932,.0256146,0,.5155,.740993,.023974,0,.535555,.731159,.0224182,0,.556,.720836,.0209889,0,.576855,.709913,.0196411,0,.598143,.698415,.0183824,0,.619888,.68745,.0172222,0,.642123,.676154,.0161509,0,.664883,.664383,.0151397,0,.688211,.6533,.0141873,0,.71216,.642072,.0133105,0,.736792,.631412,.0124932,0,.762186,.621622,.0117408,0,.788439,.611681,.0110358,0,.815672,.60142,.0103775,0,.844034,.59083,.00975623,0,.873699,.580254,.00918084,0,.904765,.569841,.00864721,0,.936508,.559224,.00815731,0,.968254,.548315,.00767924,0,1,1,.177563,0,0,1,.177563,0,0,.999994,.177562,0,0,.999972,.177555,0,664171e-10,.999914,.177536,0,.0012276,.999787,.177496,0,.00388025,.999556,.17742,0,.00783463,.999165,.177285,0,.0128953,.9985,.177037,0,.0189053,.995388,.175634,0,.025742,.993102,.174375,0,.033309,.990992,.173121,0,.0415298,.986932,.170896,0,.0503425,.982786,.16847,0,.0596964,.977592,.165455,0,.0695498,.971075,.161676,0,.0798676,.963967,.157458,0,.0906201,.956397,.152836,0,.101783,.947489,.147467,0,.113333,.937564,.14145,0,.125254,.928182,.135383,0,.137529,.919027,.129212,0,.150144,.909618,.12276,0,.163088,.900492,.116273,0,.176351,.891671,.1098,0,.189924,.883146,.103362,0,.203799,.875151,.0970799,0,.21797,.868338,.0911732,0,.232433,.862033,.0854966,0,.247182,.856107,.0800691,0,.262216,.850644,.0749618,0,.27753,.845261,.070079,0,.293124,.839885,.0654321,0,.308997,.834609,.0610975,0,.325149,.829083,.0569741,0,.341581,.82404,.0531736,0,.358294,.818968,.049665,0,.37529,.813496,.0463856,0,.392573,.807533,.0433217,0,.410148,.80099,.0404402,0,.428019,.793891,.0377578,0,.446192,.786281,.0352616,0,.464676,.778773,.0329577,0,.483478,.770737,.030808,0,.502608,.762094,.0287964,0,.522079,.752898,.0269254,0,.541905,.743306,.0251926,0,.5621,.733416,.023595,0,.582684,.723742,.0221155,0,.603677,.713542,.0207435,0,.625106,.702755,.019434,0,.646998,.691484,.0182046,0,.66939,.680531,.0170771,0,.692324,.66953,.0160339,0,.715849,.658126,.0150677,0,.740028,.646933,.0141551,0,.764937,.636107,.0133179,0,.790673,.625271,.0125284,0,.817358,.615225,.0117937,0,.84515,.605678,.0111181,0,.874244,.59583,.0104759,0,.904828,.585704,.00986672,0,.936508,.575413,.00929712,0,.968254,.565373,.00876713,0,1,1,.214058,0,0,.999999,.214058,0,0,.999994,.214055,0,0,.999966,.214039,0,259642e-9,.999893,.213998,0,.00200075,.999737,.21391,0,.00527775,.999449,.213745,0,.00983959,.99896,.213458,0,.0154755,.9979,.212855,0,.0220249,.994278,.210779,0,.0293654,.992254,.20926,0,.0374021,.98881,.206908,0,.0460604,.984715,.204009,0,.0552802,.979738,.200471,0,.0650127,.972884,.195813,0,.0752175,.965996,.190856,0,.0858612,.957974,.185077,0,.0969155,.949155,.17868,0,.108356,.939288,.171513,0,.120163,.928996,.163838,0,.132319,.919563,.156246,0,.144808,.910004,.148359,0,.157618,.900791,.140417,0,.170737,.892135,.132569,0,.184155,.883803,.124741,0,.197866,.876034,.117091,0,.211861,.869219,.109835,0,.226134,.863062,.102859,0,.240682,.857795,.0962928,0,.255499,.853009,.0900725,0,.270583,.848603,.0842101,0,.285931,.844335,.0786527,0,.301542,.840208,.0734397,0,.317415,.836035,.0685334,0,.33355,.83172,.0639275,0,.349948,.827135,.0595909,0,.36661,.822797,.0556204,0,.383539,.818387,.0519394,0,.400738,.813565,.0485317,0,.41821,.808142,.0453138,0,.435961,.802212,.0423354,0,.453997,.79573,.0395553,0,.472324,.788741,.036988,0,.490951,.781093,.0345688,0,.509887,.773597,.0323297,0,.529144,.765622,.0302719,0,.548735,.757083,.0283477,0,.568674,.747992,.0265562,0,.588979,.738591,.0248844,0,.609671,.728719,.0233342,0,.630773,.719146,.0219081,0,.652314,.709165,.0205711,0,.674328,.69875,.0193248,0,.696854,.687884,.0181582,0,.719942,.676818,.0170746,0,.743651,.666247,.0160718,0,.768057,.655284,.0151262,0,.793253,.64401,.0142561,0,.819363,.633353,.0134327,0,.846547,.622674,.012653,0,.875017,.612265,.0119354,0,.905021,.602455,.0112533,0,.936508,.593147,.0106234,0,.968254,.583592,.0100213,0,1,1,.25717,0,0,1,.25717,0,0,.999992,.257164,0,0,.999958,.257135,0,641715e-9,.999864,.25706,0,.00305314,.999666,.256897,0,.00700975,.999302,.256596,0,.0122194,.998663,.25607,0,.0184622,.995607,.254123,0,.0255773,.993094,.252081,0,.0334439,.9907,.249867,0,.0419696,.98594,.246118,0,.0510823,.981214,.242049,0,.0607242,.974966,.236869,0,.0708486,.967589,.230724,0,.081417,.95915,.223635,0,.0923974,.950257,.21596,0,.103763,.940165,.207296,0,.115491,.929396,.197901,0,.127562,.919288,.188437,0,.13996,.909428,.178762,0,.15267,.900105,.169072,0,.165679,.891418,.159478,0,.178979,.883347,.15002,0,.192558,.875992,.140813,0,.20641,.869466,.13196,0,.220529,.863699,.123501,0,.234907,.858553,.115436,0,.249542,.854379,.107901,0,.264428,.850894,.10088,0,.279564,.847632,.0942296,0,.294947,.844571,.0879861,0,.310575,.84163,.0821534,0,.326448,.838542,.0766409,0,.342566,.835412,.0715322,0,.358929,.831899,.0666883,0,.37554,.828177,.0622175,0,.392399,.82416,.0580452,0,.409511,.820393,.054267,0,.426878,.816068,.0507172,0,.444506,.811201,.0474041,0,.4624,.805785,.0443174,0,.480566,.799878,.0414562,0,.499013,.793469,.0388147,0,.517749,.786473,.0363453,0,.536785,.778874,.0340225,0,.556134,.771277,.0318599,0,.575809,.763426,.0298859,0,.595827,.755044,.0280357,0,.616207,.746161,.0262979,0,.636973,.737124,.0247295,0,.65815,.72761,.0232514,0,.679772,.717822,.0218755,0,.701876,.708279,.0205942,0,.724509,.698333,.0193947,0,.74773,.68802,.0182717,0,.771609,.677321,.0172044,0,.79624,.666504,.0162122,0,.821743,.656184,.0152924,0,.84828,.64556,.0144326,0,.876069,.634636,.0136157,0,.905404,.624124,.0128612,0,.936508,.613914,.0121435,0,.968254,.603589,.0114887,0,1,1,.307946,0,0,.999999,.307945,0,0,.999988,.307934,0,204479e-10,.999944,.307886,0,.00127833,.999824,.307756,0,.00445047,.999565,.30748,0,.00914673,.999085,.306966,0,.0150498,.998103,.306004,0,.0219367,.994249,.303028,0,.0296485,.991807,.300435,0,.038068,.987773,.296554,0,.0471062,.982673,.2916,0,.0566942,.976623,.285641,0,.0667768,.968757,.27815,0,.0773099,.959849,.269529,0,.088257,.950663,.260248,0,.0995879,.940129,.249704,0,.111277,.92895,.238291,0,.123304,.917996,.226501,0,.13565,.907813,.214669,0,.148299,.898305,.202835,0,.161237,.889626,.191158,0,.174455,.88175,.179695,0,.187941,.874715,.168548,0,.201687,.868746,.15792,0,.215687,.863703,.147807,0,.229933,.859315,.138149,0,.24442,.855538,.128993,0,.259145,.852428,.120414,0,.274103,.850168,.112498,0,.289293,.848132,.105054,0,.304711,.846291,.0981087,0,.320357,.844431,.0915942,0,.33623,.842493,.0855056,0,.35233,.840368,.0798204,0,.368658,.83798,.0745097,0,.385214,.83523,.0695424,0,.402002,.832091,.0649092,0,.419023,.828667,.0606291,0,.436282,.824805,.0566523,0,.453782,.820988,.0530229,0,.471529,.816635,.0496364,0,.489528,.811725,.0464658,0,.507788,.806316,.0435082,0,.526317,.800469,.0407873,0,.545124,.794107,.038255,0,.564221,.787218,.0358825,0,.583621,.779872,.0336785,0,.603341,.772097,.0316379,0,.623397,.764484,.0297379,0,.643812,.756428,.0279581,0,.664611,.748022,.0263153,0,.685824,.739268,.0247799,0,.707488,.73024,.0233385,0,.729646,.720893,.0220035,0,.752354,.71119,.0207555,0,.77568,.701791,.0195843,0,.799715,.692184,.0184891,0,.824574,.682258,.0174541,0,.850417,.67206,.0164873,0,.877466,.661717,.0155959,0,.90604,.651462,.0147519,0,.936528,.641467,.0139727,0,.968254,.631229,.0132363,0,1,1,.367573,0,0,.999999,.367571,0,0,.999984,.367553,0,183382e-9,.999925,.367473,0,.00225254,.999759,.367259,0,.00628165,.99941,.366801,0,.0117858,.998739,.365946,0,.0184359,.995529,.363191,0,.0260114,.992875,.360171,0,.0343581,.989135,.355981,0,.0433637,.984166,.350401,0,.0529438,.977871,.343348,0,.0630334,.96951,.334341,0,.0735805,.959964,.323862,0,.0845437,.950162,.312521,0,.095889,.938882,.299577,0,.107588,.926992,.285573,0,.119617,.915589,.271212,0,.131957,.904791,.256611,0,.144591,.895177,.242224,0,.157503,.886403,.227952,0,.170682,.878957,.214192,0,.184117,.872418,.200795,0,.197799,.867029,.188015,0,.21172,.862835,.175975,0,.225873,.859411,.164526,0,.240253,.856655,.153693,0,.254854,.854519,.14352,0,.269673,.852828,.13397,0,.284707,.851412,.124984,0,.299953,.850609,.116748,0,.315408,.849855,.10905,0,.331073,.849017,.101839,0,.346946,.848079,.0951359,0,.363028,.846911,.0888774,0,.379318,.845445,.0830375,0,.395818,.84362,.0775844,0,.41253,.841411,.0725054,0,.429457,.838768,.0677691,0,.446602,.835801,.0634016,0,.463968,.832341,.0593095,0,.481561,.828424,.0555121,0,.499386,.824312,.052024,0,.51745,.819918,.0487865,0,.535761,.815072,.0457801,0,.554328,.809863,.0430184,0,.573162,.804164,.0404245,0,.592275,.798034,.0380146,0,.611681,.791436,.0357436,0,.631398,.784498,.0336475,0,.651445,.777125,.0316666,0,.671845,.769365,.0298122,0,.692628,.761579,.0281001,0,.713827,.753746,.0265049,0,.735484,.745573,.0250067,0,.75765,.737083,.0236026,0,.78039,.728545,.0223302,0,.803789,.719691,.0211243,0,.82796,.710569,.0199983,0,.853056,.701216,.0189569,0,.879298,.692094,.0179702,0,.907014,.682909,.0170418,0,.936691,.673509,.0161732,0,.968254,.663863,.0153406,0,1,1,.437395,0,0,.999998,.437394,0,0,.99998,.437363,0,616704e-9,.999891,.437232,0,.00367925,.999656,.436877,0,.00867446,.999148,.436121,0,.0150679,.997959,.434564,0,.022531,.993464,.430134,0,.0308507,.990606,.426077,0,.0398805,.985027,.419397,0,.0495148,.978491,.41118,0,.0596749,.969643,.40048,0,.0703001,.959189,.38769,0,.0813427,.948223,.373575,0,.0927641,.935955,.357622,0,.104533,.923237,.34043,0,.116624,.911074,.322735,0,.129015,.899724,.30479,0,.141687,.890189,.287392,0,.154626,.881796,.270248,0,.167818,.874781,.253659,0,.181252,.869166,.237786,0,.194918,.864725,.222618,0,.208807,.861565,.208356,0,.222913,.859284,.194867,0,.237229,.857677,.18212,0,.25175,.856714,.17018,0,.266473,.856155,.158969,0,.281392,.8558,.148413,0,.296505,.855672,.138578,0,.311811,.855538,.129345,0,.327306,.855689,.120861,0,.342991,.855767,.112969,0,.358864,.855618,.105593,0,.374925,.85525,.0987451,0,.391176,.854583,.0923727,0,.407616,.853534,.0864143,0,.424249,.852061,.0808338,0,.441076,.850253,.0756771,0,.4581,.848004,.0708612,0,.475324,.845333,.0663784,0,.492754,.842376,.0622631,0,.510394,.838956,.0584112,0,.528251,.835121,.0548328,0,.546331,.830842,.0514838,0,.564644,.826212,.048355,0,.583198,.821522,.0454714,0,.602005,.816551,.0428263,0,.621078,.811211,.0403612,0,.640434,.805479,.038039,0,.660089,.799409,.0358739,0,.680066,.79306,.0338727,0,.70039,.786395,.0319985,0,.721094,.779416,.030241,0,.742215,.77214,.0285951,0,.7638,.764636,.0270747,0,.785912,.756836,.0256354,0,.808628,.749315,.0243027,0,.832055,.741561,.0230497,0,.856338,.733589,.0218801,0,.88169,.725479,.020784,0,.908441,.717255,.0197702,0,.937125,.708829,.0188168,0,.968254,.700191,.0179113,0,1,1,.518937,0,0,.999998,.518933,0,0,.999967,.518883,0,.00147741,.999832,.51866,0,.00573221,.999466,.518057,0,.011826,.998644,.516752,0,.0192116,.994458,.512347,0,.027573,.991223,.507675,0,.0367099,.985515,.500188,0,.046487,.978308,.490408,0,.0568071,.968359,.477357,0,.0675984,.95682,.461752,0,.0788059,.943929,.443796,0,.090386,.930224,.423893,0,.102304,.916514,.402682,0,.114532,.903653,.380914,0,.127047,.892315,.359212,0,.139828,.882942,.338102,0,.152861,.875438,.31773,0,.16613,.869642,.298186,0,.179624,.865304,.279491,0,.193332,.862382,.261804,0,.207247,.860666,.245146,0,.22136,.859788,.229406,0,.235666,.859608,.214605,0,.250158,.859912,.200691,0,.264832,.86053,.187623,0,.279684,.861368,.17539,0,.294711,.862237,.163901,0,.309911,.863127,.153175,0,.32528,.863923,.143147,0,.340819,.864567,.133781,0,.356524,.865013,.125042,0,.372397,.86539,.116952,0,.388438,.865591,.109476,0,.404645,.865517,.102542,0,.421022,.865084,.0960688,0,.437569,.864309,.0900499,0,.454287,.863151,.0844328,0,.471181,.861649,.0792218,0,.488253,.859742,.0743482,0,.505507,.857446,.0697963,0,.522947,.854757,.0655364,0,.54058,.851783,.061608,0,.558412,.848516,.0579701,0,.576449,.844897,.0545742,0,.594701,.840956,.0514167,0,.613178,.836676,.0484598,0,.631892,.832075,.0456934,0,.650856,.827191,.0431178,0,.670088,.822295,.0407718,0,.689606,.817294,.0386032,0,.709434,.812013,.0365675,0,.7296,.806465,.0346547,0,.750138,.800691,.0328717,0,.771093,.794709,.031211,0,.792519,.788493,.0296504,0,.814488,.782049,.0281782,0,.837097,.775403,.0267965,0,.860481,.76857,.0255002,0,.884842,.761536,.0242759,0,.910494,.754303,.0231142,0,.937985,.74692,.0220305,0,.968254,.739745,.0210192,0,1,1,.613914,0,0,.999996,.613907,0,963597e-10,.999942,.613814,0,.00301247,.999704,.613407,0,.00870385,.999046,.612302,0,.0160714,.995516,.608266,0,.0245899,.991726,.602863,0,.0339681,.985157,.593956,0,.0440254,.97642,.581748,0,.0546409,.964404,.565183,0,.0657284,.950601,.545273,0,.0772246,.935158,.522129,0,.0890812,.919364,.496782,0,.10126,.904754,.470571,0,.113731,.89176,.444037,0,.126469,.881492,.418322,0,.139454,.873656,.393522,0,.15267,.868053,.369795,0,.166101,.864336,.347171,0,.179736,.862259,.325737,0,.193565,.861556,.305532,0,.207578,.861776,.286416,0,.221769,.862661,.268355,0,.23613,.864015,.251334,0,.250656,.865711,.235352,0,.265343,.867519,.220302,0,.280187,.869351,.206161,0,.295183,.871144,.192908,0,.31033,.872839,.180505,0,.325624,.874307,.168848,0,.341065,.875667,.158021,0,.35665,.876758,.147877,0,.37238,.87764,.138441,0,.388253,.878237,.129627,0,.404269,.878563,.121415,0,.42043,.878572,.113741,0,.436735,.87842,.106652,0,.453187,.878057,.100097,0,.469786,.877413,.0940128,0,.486536,.87646,.0883462,0,.503439,.875233,.0830924,0,.520498,.8737,.0781975,0,.537717,.871873,.07364,0,.555102,.86978,.0694103,0,.572657,.867405,.0654696,0,.59039,.864751,.0617914,0,.608307,.861818,.0583491,0,.626419,.858645,.0551443,0,.644733,.855307,.0521894,0,.663264,.851736,.0494334,0,.682025,.847927,.0468504,0,.701032,.843888,.0444261,0,.720308,.839629,.0421497,0,.739875,.835158,.0400082,0,.759764,.830509,.0380076,0,.780014,.825714,.0361488,0,.800673,.820729,.0343956,0,.821803,.815751,.0327781,0,.843492,.810752,.031275,0,.86586,.805587,.0298542,0,.889087,.800317,.0285397,0,.913466,.79489,.0272948,0,.93952,.789314,.0261139,0,.96835,.783593,.0249938,0,1,1,.724258,0,0,.999992,.724243,0,726889e-9,.99987,.724044,0,.00569574,.999336,.72317,0,.0131702,.996271,.719432,0,.0220738,.991159,.712576,0,.0319405,.982465,.700927,0,.0425202,.97049,.684297,0,.0536599,.953973,.661244,0,.065258,.935546,.633804,0,.0772427,.916596,.603071,0,.0895616,.899353,.57105,0,.102175,.885216,.539206,0,.11505,.875076,.508714,0,.128164,.868334,.479571,0,.141495,.864414,.451796,0,.155026,.862678,.425328,0,.168745,.862835,.400352,0,.182639,.864067,.376532,0,.196699,.866086,.35391,0,.210915,.868557,.332424,0,.225282,.871271,.312053,0,.239792,.874058,.292764,0,.25444,.8768,.27453,0,.269223,.87939,.257297,0,.284135,.8819,.24114,0,.299174,.884187,.225934,0,.314337,.886262,.211669,0,.329622,.888119,.198311,0,.345026,.889709,.185783,0,.360549,.891054,.174063,0,.376189,.892196,.163143,0,.391946,.893101,.152952,0,.407819,.893803,.143475,0,.423808,.894277,.134647,0,.439914,.894532,.126434,0,.456137,.894576,.1188,0,.472479,.894393,.111694,0,.48894,.893976,.105069,0,.505523,.893346,.0989077,0,.52223,.892502,.0931724,0,.539064,.891441,.0878276,0,.556028,.890276,.082903,0,.573125,.888972,.0783505,0,.590361,.887469,.0741083,0,.607741,.885785,.0701633,0,.62527,.883914,.0664835,0,.642957,.881872,.0630567,0,.660809,.879651,.0598527,0,.678836,.877267,.0568615,0,.69705,.874717,.05406,0,.715465,.872012,.0514378,0,.734098,.869157,.0489805,0,.752968,.866155,.0466727,0,.772101,.863014,.0445056,0,.791529,.859748,.0424733,0,.81129,.856416,.0405957,0,.831438,.852958,.0388273,0,.852044,.849382,.0371619,0,.87321,.845694,.0355959,0,.89509,.841893,.0341155,0,.917932,.837981,.0327141,0,.942204,.833963,.0313856,0,.968981,.829847,.0301275,0,1,1,.85214,0,0,.999969,.852095,0,.00279627,.999483,.851408,0,.0107635,.994545,.84579,0,.0206454,.986188,.835231,0,.0315756,.969847,.814687,0,.0432021,.945951,.783735,0,.0553396,.91917,.746074,0,.0678766,.895488,.706938,0,.0807395,.878232,.669534,0,.0938767,.868252,.635168,0,.10725,.863873,.603069,0,.120832,.863369,.572514,0,.134598,.86545,.543169,0,.148533,.868803,.514578,0,.16262,.872794,.486762,0,.176849,.87702,.459811,0,.19121,.881054,.433654,0,.205694,.884974,.408574,0,.220294,.888587,.384525,0,.235005,.891877,.36156,0,.24982,.894793,.339661,0,.264737,.89743,.318913,0,.279751,.899796,.299302,0,.294859,.901943,.280843,0,.310058,.903858,.263481,0,.325346,.905574,.247197,0,.340721,.907069,.231915,0,.356181,.908379,.217614,0,.371725,.90952,.20425,0,.387353,.910483,.191758,0,.403063,.91128,.180092,0,.418854,.911936,.169222,0,.434727,.912454,.159098,0,.450682,.912835,.149668,0,.466718,.913078,.140884,0,.482837,.913192,.132709,0,.499038,.913175,.125095,0,.515324,.91304,.118012,0,.531695,.912781,.111417,0,.548153,.91241,.105281,0,.5647,.911924,.0995691,0,.581338,.911331,.0942531,0,.59807,.910637,.0893076,0,.6149,.90984,.0846998,0,.63183,.908941,.0804044,0,.648865,.907944,.0763984,0,.666011,.906857,.0726638,0,.683273,.90568,.0691783,0,.700659,.904416,.0659222,0,.718176,.903067,.0628782,0,.735834,.901637,.0600307,0,.753646,.900128,.0573647,0,.771625,.898544,.0548668,0,.78979,.89689,.052527,0,.808162,.895165,.0503306,0,.826771,.893371,.0482668,0,.845654,.891572,.0463605,0,.864863,.889763,.0445998,0,.884472,.887894,.0429451,0,.904592,.885967,.0413884,0,.925407,.883984,.0399225,0,.947271,.881945,.0385405,0,.97105,.879854,.0372362,0,1,.999804,.995833,0,0,.938155,.933611,0,.0158731,.864755,.854311,0,.0317461,.888594,.865264,0,.0476191,.905575,.863922,0,.0634921,.915125,.850558,0,.0793651,.920665,.829254,0,.0952381,.924073,.802578,0,.111111,.926304,.772211,0,.126984,.927829,.739366,0,.142857,.928924,.705033,0,.15873,.92973,.670019,0,.174603,.930339,.634993,0,.190476,.930811,.600485,0,.206349,.931191,.566897,0,.222222,.93149,.534485,0,.238095,.931737,.503429,0,.253968,.931939,.473811,0,.269841,.932108,.445668,0,.285714,.93225,.418993,0,.301587,.932371,.393762,0,.31746,.932474,.369939,0,.333333,.932562,.347479,0,.349206,.932638,.326336,0,.365079,.932703,.306462,0,.380952,.93276,.287805,0,.396825,.932809,.270313,0,.412698,.932851,.253933,0,.428571,.932887,.23861,0,.444444,.932917,.224289,0,.460317,.932943,.210917,0,.47619,.932965,.19844,0,.492063,.932982,.186807,0,.507937,.932995,.175966,0,.52381,.933005,.165869,0,.539683,.933011,.156468,0,.555556,.933013,.147719,0,.571429,.933013,.139579,0,.587302,.93301,.132007,0,.603175,.933004,.124965,0,.619048,.932994,.118416,0,.634921,.932982,.112326,0,.650794,.932968,.106663,0,.666667,.93295,.101397,0,.68254,.932931,.0964993,0,.698413,.932908,.0919438,0,.714286,.932883,.0877057,0,.730159,.932856,.0837623,0,.746032,.932827,.0800921,0,.761905,.932796,.0766754,0,.777778,.932762,.0734936,0,.793651,.932727,.0705296,0,.809524,.932689,.0677676,0,.825397,.93265,.0651929,0,.84127,.932609,.0627917,0,.857143,.932565,.0605515,0,.873016,.932521,.0584606,0,.888889,.932474,.0565082,0,.904762,.932427,.0546841,0,.920635,.932377,.0529793,0,.936508,.932326,.0513851,0,.952381,.932274,.0498936,0,.968254,.93222,.0484975,0,.984127,.932164,.0471899,0,1],n=new Float32Array(e),i=new Float32Array(t);rs.LTC_FLOAT_1=new go(n,64,64,H,z,d,b,b,M,x,1),rs.LTC_FLOAT_2=new go(i,64,64,H,z,d,b,b,M,x,1),rs.LTC_FLOAT_1.needsUpdate=!0,rs.LTC_FLOAT_2.needsUpdate=!0;const s=new Uint16Array(e.length);e.forEach((function(e,t){s[t]=cu.toHalfFloat(e)}));const r=new Uint16Array(t.length);t.forEach((function(e,t){r[t]=cu.toHalfFloat(e)})),rs.LTC_HALF_1=new go(s,64,64,H,E,d,b,b,M,x,1),rs.LTC_HALF_2=new go(r,64,64,H,E,d,b,b,M,x,1),rs.LTC_HALF_1.needsUpdate=!0,rs.LTC_HALF_2.needsUpdate=!0}}.init()}createAmbientLight(e){const{id:t,name:n="",color:i=10132122,intensity:s=1}=e,r=new gh(i,s);return r.name=n,r.userData.sid=t,r.userData.stype="Light",this.viewport.scener.addObject(r,this.scene),r}setAmbientLight(e,t){const{name:n="",color:i=10132122,intensity:s=1}=t;return!!e&&(e.name=n,e.color=new bt(i),e.intensity=s,this.viewport.signals.objectChanged.dispatch(),!0)}createDirectionalLight(e){const{id:t,name:n="",color:i=10132122,intensity:s=1,position:r={x:1e3,y:1e3,z:1e3},target:a={x:-1e3,y:-1e3,z:-1e3},openShadow:o=!1,shadowAutoUpdate:l=!1,mapSize:c=4096}=e,h=new fh(i,s);if(h.name=n,h.userData.sid=t,h.userData.stype="Light",h.position.set(r.x,r.y,r.z),h.target.name=`${n}-target`,h.target.position.set(a.x,a.y,a.z),h.castShadow=o,o){const e=h.position.distanceTo(h.target.position);h.shadow.bias=-.005,h.shadow.camera.left=-e,h.shadow.camera.right=e,h.shadow.camera.top=e,h.shadow.camera.bottom=-e,h.shadow.camera.far=e,h.shadow.autoUpdate=l,h.shadow.mapSize.width=c,h.shadow.mapSize.height=c,h.shadow.camera.updateProjectionMatrix()}return this.viewport.scener.addObject(h,this.scene),this.viewport.scener.addObject(h.target,this.scene),h}setDirectionalLight(e,t){const{name:n="",color:i=10132122,intensity:s=1,position:r={x:1e3,y:1e3,z:1e3},target:a={x:-1e3,y:-1e3,z:-1e3},openShadow:o=!1,shadowAutoUpdate:l=!1,mapSize:c=4096}=t;if(!e)return!1;if(e.name=n,e.color=new bt(i),e.intensity=s,e.position.set(r.x,r.y,r.z),e.target.position.set(a.x,a.y,a.z),e.castShadow=o,o){const t=e.position.distanceTo(e.target.position);e.shadow.bias=-.005,e.shadow.camera.left=-t,e.shadow.camera.right=t,e.shadow.camera.top=t,e.shadow.camera.bottom=-t,e.shadow.camera.far=t,e.shadow.autoUpdate=l,e.shadow.mapSize.width=c,e.shadow.mapSize.height=c,e.shadow.camera.updateProjectionMatrix()}return this.viewport.signals.objectChanged.dispatch(),!0}createHemisphereLight(e){const{id:t,name:n="",skyColor:i=16777215,groundColor:s=14540253,intensity:r=1,position:a={x:0,y:0,z:0}}=e,o=new nh(i,s,r);return o.name=n,o.position.set(a.x,a.y,a.z),o.userData.sid=t,o.userData.stype="Light",this.viewport.scener.addObject(o,this.scene),o}setHemisphereLight(e,t){const{name:n="",skyColor:i=16777215,groundColor:s=14540253,intensity:r=1,position:a={x:0,y:0,z:0}}=t;return!!e&&(e.name=n,e.color=new bt(i),e.groundColor=new bt(s),e.intensity=r,e.position.set(a.x,a.y,a.z),this.viewport.signals.objectChanged.dispatch(),!0)}createSpotLight(e){const{id:t,name:n="",color:i=16777215,intensity:s=1,angle:r=45,position:a={x:0,y:500,z:0},target:o={x:0,y:0,z:0},openShadow:l=!1,shadowAutoUpdate:c=!1,mapSize:h=4096}=e,d=yp(a).distanceTo(yp(o)),u=new lh(i,s,d,Math.PI/360*r,0,0);if(u.name=n,u.position.set(a.x,a.y,a.z),u.userData.sid=t,u.userData.stype="Light",u.castShadow=l,u.target.position.set(o.x,o.y,o.z),u.target.castShadow=l,u.target.receiveShadow=!0,u.target.updateMatrixWorld(),l){const e=u.position.distanceTo(u.target.position);u.shadow.autoUpdate=c,u.shadow.mapSize.width=h,u.shadow.mapSize.height=h,u.shadow.bias=-.005,u.shadow.focus=.6,u.shadow.camera.far=e,u.shadow.camera.updateProjectionMatrix()}return this.viewport.scener.addObject(u,this.scene),u}setSpotLight(e,t){const{name:n="",color:i=16777215,intensity:s=1,angle:r=45,position:a={x:0,y:500,z:0},target:o={x:0,y:0,z:0},openShadow:l=!1,shadowAutoUpdate:c=!1,mapSize:h=4096}=t;if(!e)return!1;const d=yp(a).distanceTo(yp(o));if(e.name=n,e.color=new bt(i),e.intensity=s,e.distance=d,e.angle=Math.PI/360*r,e.position.set(a.x,a.y,a.z),e.castShadow=l,e.target.position.set(o.x,o.y,o.z),e.target.castShadow=l,e.target.updateMatrixWorld(),l){const t=e.position.distanceTo(e.target.position);e.shadow.autoUpdate=c,e.shadow.mapSize.width=h,e.shadow.mapSize.height=h,e.shadow.bias=-.005,e.shadow.focus=.6,e.shadow.camera.far=t,e.shadow.camera.updateProjectionMatrix()}return this.viewport.signals.objectChanged.dispatch(),!0}createPointLight(e){const{id:t,name:n="",color:i=16777215,intensity:s=1,distance:r=5e3,position:a={x:0,y:500,z:0},openShadow:o=!1,shadowAutoUpdate:l=!1,mapSize:c=4096}=e,h=new ph(i,s,r);return h.name=n,h.userData.sid=t,h.userData.stype="Light",h.position.set(a.x,a.y,a.z),h.castShadow=o,o&&(h.shadow.bias=-.005,h.shadow.camera.far=r,h.shadow.autoUpdate=l,h.shadow.mapSize.width=c,h.shadow.mapSize.height=c,h.shadow.camera.updateProjectionMatrix()),this.viewport.scener.addObject(h,this.scene),h}setPointLight(e,t){const{name:n="",color:i=16777215,intensity:s=1,distance:r=5e3,position:a={x:0,y:500,z:0},openShadow:o=!1,shadowAutoUpdate:l=!1,mapSize:c=4096}=t;return!!e&&(e.name=n,e.color=new bt(i),e.intensity=s,e.distance=r,e.position.set(a.x,a.y,a.z),e.castShadow=o,o&&(e.shadow.bias=-.005,e.shadow.camera.far=r,e.shadow.autoUpdate=l,e.shadow.mapSize.width=c,e.shadow.mapSize.height=c,e.shadow.camera.updateProjectionMatrix()),this.viewport.signals.objectChanged.dispatch(),!0)}createRectAreaLight(e){const{id:t,name:n="",color:i=16777215,intensity:s=1,width:r=10,height:a=10,position:o={x:0,y:0,z:0}}=e,l=new yh(i,s,r,a);return l.name=n,l.userData.sid=t,l.userData.stype="Light",l.position.set(o.x,o.y,o.z),this.viewport.scener.addObject(l,this.scene),l}setRectAreaLight(e,t){const{name:n="",color:i=16777215,intensity:s=1,width:r=10,height:a=10,position:o={x:0,y:0,z:0}}=t;return!!e&&(e.name=n,e.color=new bt(i),e.intensity=s,e.width=r,e.height=a,e.position.set(o.x,o.y,o.z),this.viewport.signals.objectChanged.dispatch(),!0)}updateAllShadow(){this.getAll().forEach((e=>{var t;!1===(null===(t=e.shadow)||void 0===t?void 0:t.autoUpdate)&&(e.shadow.needsUpdate=!0)})),this.viewport.signals.objectChanged.dispatch()}}
|
|
27
|
-
/*!
|
|
28
|
-
fflate - fast JavaScript compression/decompression
|
|
29
|
-
<https://101arrowz.github.io/fflate>
|
|
30
|
-
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
|
|
31
|
-
version 0.6.9
|
|
32
|
-
*/var Iv={},_v=function(e){return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},zv=function(e){return new Worker(e)};try{URL.revokeObjectURL(_v(""))}catch(kM){_v=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)},zv=function(e){return new Worker(e,{type:"module"})}}var Ev=Uint8Array,Wv=Uint16Array,Zv=Uint32Array,Pv=new Ev([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,0]),Nv=new Ev([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,0,0]),Vv=new Ev([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Hv=function(e,t){for(var n=new Wv(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];var s=new Zv(n[30]);for(i=1;i<30;++i)for(var r=n[i];r<n[i+1];++r)s[r]=r-n[i]<<5|i;return[n,s]},Dv=Hv(Pv,2),kv=Dv[0],Bv=Dv[1];kv[28]=258,Bv[258]=28;for(var Fv=Hv(Nv,0),Uv=Fv[0],Ov=Fv[1],Yv=new Wv(32768),Kv=0;Kv<32768;++Kv){var jv=(43690&Kv)>>>1|(21845&Kv)<<1;jv=(61680&(jv=(52428&jv)>>>2|(13107&jv)<<2))>>>4|(3855&jv)<<4,Yv[Kv]=((65280&jv)>>>8|(255&jv)<<8)>>>1}var Jv=function(e,t,n){for(var i=e.length,s=0,r=new Wv(t);s<i;++s)++r[e[s]-1];var a,o=new Wv(t);for(s=0;s<t;++s)o[s]=o[s-1]+r[s-1]<<1;if(n){a=new Wv(1<<t);var l=15-t;for(s=0;s<i;++s)if(e[s])for(var c=s<<4|e[s],h=t-e[s],d=o[e[s]-1]++<<h,u=d|(1<<h)-1;d<=u;++d)a[Yv[d]>>>l]=c}else for(a=new Wv(i),s=0;s<i;++s)e[s]&&(a[s]=Yv[o[e[s]-1]++]>>>15-e[s]);return a},Qv=new Ev(288);for(Kv=0;Kv<144;++Kv)Qv[Kv]=8;for(Kv=144;Kv<256;++Kv)Qv[Kv]=9;for(Kv=256;Kv<280;++Kv)Qv[Kv]=7;for(Kv=280;Kv<288;++Kv)Qv[Kv]=8;var qv=new Ev(32);for(Kv=0;Kv<32;++Kv)qv[Kv]=5;var $v=Jv(Qv,9,0),ex=Jv(Qv,9,1),tx=Jv(qv,5,0),nx=Jv(qv,5,1),ix=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},sx=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(7&t)&n},rx=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},ax=function(e){return(e/8|0)+(7&e&&1)},ox=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var i=new(e instanceof Wv?Wv:e instanceof Zv?Zv:Ev)(n-t);return i.set(e.subarray(t,n)),i},lx=function(e,t,n){var i=e.length;if(!i||n&&!n.l&&i<5)return t||new Ev(0);var s=!t||n,r=!n||n.i;n||(n={}),t||(t=new Ev(3*i));var a=function(e){var n=t.length;if(e>n){var i=new Ev(Math.max(2*n,e));i.set(t),t=i}},o=n.f||0,l=n.p||0,c=n.b||0,h=n.l,d=n.d,u=n.m,p=n.n,m=8*i;do{if(!h){n.f=o=sx(e,l,1);var f=sx(e,l+1,3);if(l+=3,!f){var g=e[(T=ax(l)+4)-4]|e[T-3]<<8,y=T+g;if(y>i){if(r)throw"unexpected EOF";break}s&&a(c+g),t.set(e.subarray(T,y),c),n.b=c+=g,n.p=l=8*y;continue}if(1==f)h=ex,d=nx,u=9,p=5;else{if(2!=f)throw"invalid block type";var b=sx(e,l,31)+257,v=sx(e,l+10,15)+4,x=b+sx(e,l+5,31)+1;l+=14;for(var w=new Ev(x),S=new Ev(19),M=0;M<v;++M)S[Vv[M]]=sx(e,l+3*M,7);l+=3*v;var L=ix(S),C=(1<<L)-1,G=Jv(S,L,1);for(M=0;M<x;){var T,R=G[sx(e,l,C)];if(l+=15&R,(T=R>>>4)<16)w[M++]=T;else{var A=0,X=0;for(16==T?(X=3+sx(e,l,3),l+=2,A=w[M-1]):17==T?(X=3+sx(e,l,7),l+=3):18==T&&(X=11+sx(e,l,127),l+=7);X--;)w[M++]=A}}var I=w.subarray(0,b),_=w.subarray(b);u=ix(I),p=ix(_),h=Jv(I,u,1),d=Jv(_,p,1)}if(l>m){if(r)throw"unexpected EOF";break}}s&&a(c+131072);for(var z=(1<<u)-1,E=(1<<p)-1,W=l;;W=l){var Z=(A=h[rx(e,l)&z])>>>4;if((l+=15&A)>m){if(r)throw"unexpected EOF";break}if(!A)throw"invalid length/literal";if(Z<256)t[c++]=Z;else{if(256==Z){W=l,h=null;break}var P=Z-254;if(Z>264){var N=Pv[M=Z-257];P=sx(e,l,(1<<N)-1)+kv[M],l+=N}var V=d[rx(e,l)&E],H=V>>>4;if(!V)throw"invalid distance";l+=15&V;_=Uv[H];if(H>3){N=Nv[H];_+=rx(e,l)&(1<<N)-1,l+=N}if(l>m){if(r)throw"unexpected EOF";break}s&&a(c+131072);for(var D=c+P;c<D;c+=4)t[c]=t[c-_],t[c+1]=t[c+1-_],t[c+2]=t[c+2-_],t[c+3]=t[c+3-_];c=D}}n.l=h,n.p=W,n.b=c,h&&(o=1,n.m=u,n.d=d,n.n=p)}while(!o);return c==t.length?t:ox(t,0,c)},cx=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8},hx=function(e,t,n){n<<=7&t;var i=t/8|0;e[i]|=n,e[i+1]|=n>>>8,e[i+2]|=n>>>16},dx=function(e,t){for(var n=[],i=0;i<e.length;++i)e[i]&&n.push({s:i,f:e[i]});var s=n.length,r=n.slice();if(!s)return[bx,0];if(1==s){var a=new Ev(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var o=n[0],l=n[1],c=0,h=1,d=2;for(n[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=s-1;)o=n[n[c].f<n[d].f?c++:d++],l=n[c!=h&&n[c].f<n[d].f?c++:d++],n[h++]={s:-1,f:o.f+l.f,l:o,r:l};var u=r[0].s;for(i=1;i<s;++i)r[i].s>u&&(u=r[i].s);var p=new Wv(u+1),m=ux(n[h-1],p,0);if(m>t){i=0;var f=0,g=m-t,y=1<<g;for(r.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));i<s;++i){var b=r[i].s;if(!(p[b]>t))break;f+=y-(1<<m-p[b]),p[b]=t}for(f>>>=g;f>0;){var v=r[i].s;p[v]<t?f-=1<<t-p[v]++-1:++i}for(;i>=0&&f;--i){var x=r[i].s;p[x]==t&&(--p[x],++f)}m=t}return[new Ev(p),m]},ux=function(e,t,n){return-1==e.s?Math.max(ux(e.l,t,n+1),ux(e.r,t,n+1)):t[e.s]=n},px=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Wv(++t),i=0,s=e[0],r=1,a=function(e){n[i++]=e},o=1;o<=t;++o)if(e[o]==s&&o!=t)++r;else{if(!s&&r>2){for(;r>138;r-=138)a(32754);r>2&&(a(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(a(s),--r;r>6;r-=6)a(8304);r>2&&(a(r-3<<5|8208),r=0)}for(;r--;)a(s);r=1,s=e[o]}return[n.subarray(0,i),t]},mx=function(e,t){for(var n=0,i=0;i<t.length;++i)n+=e[i]*t[i];return n},fx=function(e,t,n){var i=n.length,s=ax(t+2);e[s]=255&i,e[s+1]=i>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var r=0;r<i;++r)e[s+r+4]=n[r];return 8*(s+4+i)},gx=function(e,t,n,i,s,r,a,o,l,c,h){cx(t,h++,n),++s[256];for(var d=dx(s,15),u=d[0],p=d[1],m=dx(r,15),f=m[0],g=m[1],y=px(u),b=y[0],v=y[1],x=px(f),w=x[0],S=x[1],M=new Wv(19),L=0;L<b.length;++L)M[31&b[L]]++;for(L=0;L<w.length;++L)M[31&w[L]]++;for(var C=dx(M,7),G=C[0],T=C[1],R=19;R>4&&!G[Vv[R-1]];--R);var A,X,I,_,z=c+5<<3,E=mx(s,Qv)+mx(r,qv)+a,W=mx(s,u)+mx(r,f)+a+14+3*R+mx(M,G)+(2*M[16]+3*M[17]+7*M[18]);if(z<=E&&z<=W)return fx(t,h,e.subarray(l,l+c));if(cx(t,h,1+(W<E)),h+=2,W<E){A=Jv(u,p,0),X=u,I=Jv(f,g,0),_=f;var Z=Jv(G,T,0);cx(t,h,v-257),cx(t,h+5,S-1),cx(t,h+10,R-4),h+=14;for(L=0;L<R;++L)cx(t,h+3*L,G[Vv[L]]);h+=3*R;for(var P=[b,w],N=0;N<2;++N){var V=P[N];for(L=0;L<V.length;++L){var H=31&V[L];cx(t,h,Z[H]),h+=G[H],H>15&&(cx(t,h,V[L]>>>5&127),h+=V[L]>>>12)}}}else A=$v,X=Qv,I=tx,_=qv;for(L=0;L<o;++L)if(i[L]>255){H=i[L]>>>18&31;hx(t,h,A[H+257]),h+=X[H+257],H>7&&(cx(t,h,i[L]>>>23&31),h+=Pv[H]);var D=31&i[L];hx(t,h,I[D]),h+=_[D],D>3&&(hx(t,h,i[L]>>>5&8191),h+=Nv[D])}else hx(t,h,A[i[L]]),h+=X[i[L]];return hx(t,h,A[256]),h+X[256]},yx=new Zv([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bx=new Ev(0),vx=function(e,t,n,i,s,r){var a=e.length,o=new Ev(i+a+5*(1+Math.ceil(a/7e3))+s),l=o.subarray(i,o.length-s),c=0;if(!t||a<8)for(var h=0;h<=a;h+=65535){var d=h+65535;d<a?c=fx(l,c,e.subarray(h,d)):(l[h]=r,c=fx(l,c,e.subarray(h,a)))}else{for(var u=yx[t-1],p=u>>>13,m=8191&u,f=(1<<n)-1,g=new Wv(32768),y=new Wv(f+1),b=Math.ceil(n/3),v=2*b,x=function(t){return(e[t]^e[t+1]<<b^e[t+2]<<v)&f},w=new Zv(25e3),S=new Wv(288),M=new Wv(32),L=0,C=0,G=(h=0,0),T=0,R=0;h<a;++h){var A=x(h),X=32767&h,I=y[A];if(g[X]=I,y[A]=X,T<=h){var _=a-h;if((L>7e3||G>24576)&&_>423){c=gx(e,l,0,w,S,M,C,G,R,h-R,c),G=L=C=0,R=h;for(var z=0;z<286;++z)S[z]=0;for(z=0;z<30;++z)M[z]=0}var E=2,W=0,Z=m,P=X-I&32767;if(_>2&&A==x(h-P))for(var N=Math.min(p,_)-1,V=Math.min(32767,h),H=Math.min(258,_);P<=V&&--Z&&X!=I;){if(e[h+E]==e[h+E-P]){for(var D=0;D<H&&e[h+D]==e[h+D-P];++D);if(D>E){if(E=D,W=P,D>N)break;var k=Math.min(P,D-2),B=0;for(z=0;z<k;++z){var F=h-P+z+32768&32767,U=F-g[F]+32768&32767;U>B&&(B=U,I=F)}}}P+=(X=I)-(I=g[X])+32768&32767}if(W){w[G++]=268435456|Bv[E]<<18|Ov[W];var O=31&Bv[E],Y=31&Ov[W];C+=Pv[O]+Nv[Y],++S[257+O],++M[Y],T=h+E,++L}else w[G++]=e[h],++S[e[h]]}}c=gx(e,l,r,w,S,M,C,G,R,h-R,c),!r&&7&c&&(c=fx(l,c+1,bx))}return ox(o,0,i+ax(c)+s)},xx=function(){for(var e=new Zv(256),t=0;t<256;++t){for(var n=t,i=9;--i;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),wx=function(){var e=-1;return{p:function(t){for(var n=e,i=0;i<t.length;++i)n=xx[255&n^t[i]]^n>>>8;e=n},d:function(){return~e}}},Sx=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,r=n.length,a=0;a!=r;){for(var o=Math.min(a+2655,r);a<o;++a)s+=i+=n[a];i=(65535&i)+15*(i>>16),s=(65535&s)+15*(s>>16)}e=i,t=s},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},Mx=function(e,t,n,i,s){return vx(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,i,!s)},Lx=function(e,t){var n={};for(var i in e)n[i]=e[i];for(var i in t)n[i]=t[i];return n},Cx=function(e,t,n){for(var i=e(),s=e.toString(),r=s.slice(s.indexOf("[")+1,s.lastIndexOf("]")).replace(/ /g,"").split(","),a=0;a<i.length;++a){var o=i[a],l=r[a];if("function"==typeof o){t+=";"+l+"=";var c=o.toString();if(o.prototype)if(-1!=c.indexOf("[native code]")){var h=c.indexOf(" ",8)+1;t+=c.slice(h,c.indexOf("(",h))}else for(var d in t+=c,o.prototype)t+=";"+l+".prototype."+d+"="+o.prototype[d].toString();else t+=c}else n[l]=o}return[t,n]},Gx=[],Tx=function(e,t,n,i){var s;if(!Gx[n]){for(var r="",a={},o=e.length-1,l=0;l<o;++l)r=(s=Cx(e[l],r,a))[0],a=s[1];Gx[n]=Cx(e[o],r,a)}var c=Lx({},Gx[n][1]);return function(e,t,n,i,s){var r=zv(Iv[t]||(Iv[t]=_v(e)));return r.onerror=function(e){return s(e.error,null)},r.onmessage=function(e){return s(null,e.data)},r.postMessage(n,i),r}(Gx[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,c,function(e){var t=[];for(var n in e)(e[n]instanceof Ev||e[n]instanceof Wv||e[n]instanceof Zv)&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t}(c),i)},Rx=function(){return[Ev,Wv,Zv,Pv,Nv,Vv,kv,Uv,ex,nx,Yv,Jv,ix,sx,rx,ax,ox,lx,iw,Ex,Wx]},Ax=function(){return[Ev,Wv,Zv,Pv,Nv,Vv,Bv,Ov,$v,Qv,tx,qv,Yv,yx,bx,Jv,cx,hx,dx,ux,px,mx,fx,gx,ax,ox,vx,Mx,$x,Ex]},Xx=function(){return[Bx,Ox,kx,wx,xx]},Ix=function(){return[Fx,Ux]},_x=function(){return[Yx,kx,Sx]},zx=function(){return[Kx]},Ex=function(e){return postMessage(e,[e.buffer])},Wx=function(e){return e&&e.size&&new Ev(e.size)},Zx=function(e,t,n,i,s,r){var a=Tx(n,i,s,(function(e,t){a.terminate(),r(e,t)}));return a.postMessage([e,t],t.consume?[e.buffer]:[]),function(){a.terminate()}},Px=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},Nx=function(e,t,n,i,s){var r,a=Tx(e,i,s,(function(e,n){e?(a.terminate(),t.ondata.call(t,e)):(n[1]&&a.terminate(),t.ondata.call(t,e,n[0],n[1]))}));a.postMessage(n),t.push=function(e,n){if(r)throw"stream finished";if(!t.ondata)throw"no stream handler";a.postMessage([e,r=n],[e.buffer])},t.terminate=function(){a.terminate()}},Vx=function(e,t){return e[t]|e[t+1]<<8},Hx=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},Dx=function(e,t){return Hx(e,t)+4294967296*Hx(e,t+4)},kx=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Bx=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&kx(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var i=0;i<=n.length;++i)e[i+10]=n.charCodeAt(i)}},Fx=function(e){if(31!=e[0]||139!=e[1]||8!=e[2])throw"invalid gzip data";var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var i=(t>>3&1)+(t>>4&1);i>0;i-=!e[n++]);return n+(2&t)},Ux=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Ox=function(e){return 10+(e.filename&&e.filename.length+1||0)},Yx=function(e,t){var n=t.level,i=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=i<<6|(i?32-2*i:1)},Kx=function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function jx(e,t){return t||"function"!=typeof e||(t=e,e={}),this.ondata=t,e}var Jx=function(){function e(e,t){t||"function"!=typeof e||(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(Mx(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=t,this.p(e,t||!1)},e}(),Qx=function(){return function(e,t){Nx([Ax,function(){return[Px,Jx]}],this,jx.call(this,e,t),(function(e){var t=new Jx(e.data);onmessage=Px(t)}),6)}}();function qx(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return Zx(e,t,[Ax],(function(e){return Ex($x(e.data[0],e.data[1]))}),0,n)}function $x(e,t){return Mx(e,t||{},0,0)}var ew=function(){function e(e){this.s={},this.p=new Ev(0),this.ondata=e}return e.prototype.e=function(e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var t=this.p.length,n=new Ev(t+e.length);n.set(this.p),n.set(e,t),this.p=n},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,n=lx(this.p,this.o,this.s);this.ondata(ox(n,t,this.s.b),this.d),this.o=ox(n,this.s.b-32768),this.s.b=this.o.length,this.p=ox(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),tw=function(){return function(e){this.ondata=e,Nx([Rx,function(){return[Px,ew]}],this,0,(function(){var e=new ew;onmessage=Px(e)}),7)}}();function nw(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return Zx(e,t,[Rx],(function(e){return Ex(iw(e.data[0],Wx(e.data[1])))}),1,n)}function iw(e,t){return lx(e,t)}var sw=function(){function e(e,t){this.c=wx(),this.l=0,this.v=1,Jx.call(this,e,t)}return e.prototype.push=function(e,t){Jx.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var n=Mx(e,this.o,this.v&&Ox(this.o),t&&8,!t);this.v&&(Bx(n,this.o),this.v=0),t&&(kx(n,n.length-8,this.c.d()),kx(n,n.length-4,this.l)),this.ondata(n,t)},e}(),rw=function(){return function(e,t){Nx([Ax,Xx,function(){return[Px,Jx,sw]}],this,jx.call(this,e,t),(function(e){var t=new sw(e.data);onmessage=Px(t)}),8)}}();function aw(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return Zx(e,t,[Ax,Xx,function(){return[ow]}],(function(e){return Ex(ow(e.data[0],e.data[1]))}),2,n)}function ow(e,t){t||(t={});var n=wx(),i=e.length;n.p(e);var s=Mx(e,t,Ox(t),8),r=s.length;return Bx(s,t),kx(s,r-8,n.d()),kx(s,r-4,i),s}var lw=function(){function e(e){this.v=1,ew.call(this,e)}return e.prototype.push=function(e,t){if(ew.prototype.e.call(this,e),this.v){var n=this.p.length>3?Fx(this.p):4;if(n>=this.p.length&&!t)return;this.p=this.p.subarray(n),this.v=0}if(t){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}ew.prototype.c.call(this,t)},e}(),cw=function(){return function(e){this.ondata=e,Nx([Rx,Ix,function(){return[Px,ew,lw]}],this,0,(function(){var e=new lw;onmessage=Px(e)}),9)}}();function hw(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return Zx(e,t,[Rx,Ix,function(){return[dw]}],(function(e){return Ex(dw(e.data[0]))}),3,n)}function dw(e,t){return lx(e.subarray(Fx(e),-8),t||new Ev(Ux(e)))}var uw=function(){function e(e,t){this.c=Sx(),this.v=1,Jx.call(this,e,t)}return e.prototype.push=function(e,t){Jx.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var n=Mx(e,this.o,this.v&&2,t&&4,!t);this.v&&(Yx(n,this.o),this.v=0),t&&kx(n,n.length-4,this.c.d()),this.ondata(n,t)},e}(),pw=function(){return function(e,t){Nx([Ax,_x,function(){return[Px,Jx,uw]}],this,jx.call(this,e,t),(function(e){var t=new uw(e.data);onmessage=Px(t)}),10)}}();function mw(e,t){t||(t={});var n=Sx();n.p(e);var i=Mx(e,t,2,4);return Yx(i,t),kx(i,i.length-4,n.d()),i}var fw=function(){function e(e){this.v=1,ew.call(this,e)}return e.prototype.push=function(e,t){if(ew.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}if(t){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}ew.prototype.c.call(this,t)},e}(),gw=function(){return function(e){this.ondata=e,Nx([Rx,zx,function(){return[Px,ew,fw]}],this,0,(function(){var e=new fw;onmessage=Px(e)}),11)}}();function yw(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return Zx(e,t,[Rx,zx,function(){return[bw]}],(function(e){return Ex(bw(e.data[0],Wx(e.data[1])))}),5,n)}function bw(e,t){return lx((Kx(e),e.subarray(2,-4)),t)}var vw=function(){function e(e){this.G=lw,this.I=ew,this.Z=fw,this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var n=new Ev(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var i=this,s=function(){i.ondata.apply(i,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(s):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(s):new this.Z(s),this.s.push(this.p,t),this.p=null}}},e}(),xw=function(){function e(e){this.G=cw,this.I=tw,this.Z=gw,this.ondata=e}return e.prototype.push=function(e,t){vw.prototype.push.call(this,e,t)},e}();var ww=function(e,t,n,i){for(var s in e){var r=e[s],a=t+s;r instanceof Ev?n[a]=[r,i]:Array.isArray(r)?n[a]=[r[0],Lx(i,r[1])]:ww(r,a+"/",n,i)}},Sw="undefined"!=typeof TextEncoder&&new TextEncoder,Mw="undefined"!=typeof TextDecoder&&new TextDecoder,Lw=0;try{Mw.decode(bx,{stream:!0}),Lw=1}catch(kM){}var Cw=function(e){for(var t="",n=0;;){var i=e[n++],s=(i>127)+(i>223)+(i>239);if(n+s>e.length)return[t,ox(e,n-1)];s?3==s?(i=((15&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|i>>10,56320|1023&i)):t+=1&s?String.fromCharCode((31&i)<<6|63&e[n++]):String.fromCharCode((15&i)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(i)}},Gw=function(){function e(e){this.ondata=e,Lw?this.t=new TextDecoder:this.p=bx}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(t=!!t,this.t){if(this.ondata(this.t.decode(e,{stream:!0}),t),t){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}}else{if(!this.p)throw"stream finished";var n=new Ev(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var i=Cw(n),s=i[0],r=i[1];if(t){if(r.length)throw"invalid utf-8 data";this.p=null}else this.p=r;this.ondata(s,t)}},e}(),Tw=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(Rw(e),this.d=t||!1)},e}();function Rw(e,t){if(t){for(var n=new Ev(e.length),i=0;i<e.length;++i)n[i]=e.charCodeAt(i);return n}if(Sw)return Sw.encode(e);var s=e.length,r=new Ev(e.length+(e.length>>1)),a=0,o=function(e){r[a++]=e};for(i=0;i<s;++i){if(a+5>r.length){var l=new Ev(a+8+(s-i<<1));l.set(r),r=l}var c=e.charCodeAt(i);c<128||t?o(c):c<2048?(o(192|c>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++i))>>18),o(128|c>>12&63),o(128|c>>6&63),o(128|63&c)):(o(224|c>>12),o(128|c>>6&63),o(128|63&c))}return ox(r,0,a)}function Aw(e,t){if(t){for(var n="",i=0;i<e.length;i+=16384)n+=String.fromCharCode.apply(null,e.subarray(i,i+16384));return n}if(Mw)return Mw.decode(e);var s=Cw(e),r=s[0];if(s[1].length)throw"invalid utf-8 data";return r}var Xw=function(e){return 1==e?3:e<6?2:9==e?1:0},Iw=function(e,t){return t+30+Vx(e,t+26)+Vx(e,t+28)},_w=function(e,t,n){var i=Vx(e,t+28),s=Aw(e.subarray(t+46,t+46+i),!(2048&Vx(e,t+8))),r=t+46+i,a=Hx(e,t+20),o=n&&4294967295==a?zw(e,r):[a,Hx(e,t+24),Hx(e,t+42)],l=o[0],c=o[1],h=o[2];return[Vx(e,t+10),l,c,s,r+Vx(e,t+30)+Vx(e,t+32),h]},zw=function(e,t){for(;1!=Vx(e,t);t+=4+Vx(e,t+2));return[Dx(e,t+12),Dx(e,t+4),Dx(e,t+20)]},Ew=function(e){var t=0;if(e)for(var n in e){var i=e[n].length;if(i>65535)throw"extra field too long";t+=i+4}return t},Ww=function(e,t,n,i,s,r,a,o){var l=i.length,c=n.extra,h=o&&o.length,d=Ew(c);kx(e,t,null!=a?33639248:67324752),t+=4,null!=a&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(null==r&&8),e[t++]=s&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var u=new Date(null==n.mtime?Date.now():n.mtime),p=u.getFullYear()-1980;if(p<0||p>119)throw"date not in range 1980-2099";if(kx(e,t,p<<25|u.getMonth()+1<<21|u.getDate()<<16|u.getHours()<<11|u.getMinutes()<<5|u.getSeconds()>>>1),t+=4,null!=r&&(kx(e,t,n.crc),kx(e,t+4,r),kx(e,t+8,n.size)),kx(e,t+12,l),kx(e,t+14,d),t+=16,null!=a&&(kx(e,t,h),kx(e,t+6,n.attrs),kx(e,t+10,a),t+=14),e.set(i,t),t+=l,d)for(var m in c){var f=c[m],g=f.length;kx(e,t,+m),kx(e,t+2,g),e.set(f,t+4),t+=4+g}return h&&(e.set(o,t),t+=h),t},Zw=function(e,t,n,i,s){kx(e,t,101010256),kx(e,t+8,n),kx(e,t+10,n),kx(e,t+12,i),kx(e,t+16,s)},Pw=function(){function e(e){this.filename=e,this.c=wx(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),Nw=function(){function e(e,t){var n=this;t||(t={}),Pw.call(this,e),this.d=new Jx(t,(function(e,t){n.ondata(null,e,t)})),this.compression=8,this.flag=Xw(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e.prototype.push=function(e,t){Pw.prototype.push.call(this,e,t)},e}(),Vw=function(){function e(e,t){var n=this;t||(t={}),Pw.call(this,e),this.d=new Qx(t,(function(e,t,i){n.ondata(e,t,i)})),this.compression=8,this.flag=Xw(t.level),this.terminate=this.d.terminate}return e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){Pw.prototype.push.call(this,e,t)},e}(),Hw=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(2&this.d)throw"stream finished";var n=Rw(e.filename),i=n.length,s=e.comment,r=s&&Rw(s),a=i!=e.filename.length||r&&s.length!=r.length,o=i+Ew(e.extra)+30;if(i>65535)throw"filename too long";var l=new Ev(o);Ww(l,0,e,n,a);var c=[l],h=function(){for(var e=0,n=c;e<n.length;e++){var i=n[e];t.ondata(null,i,!1)}c=[]},d=this.d;this.d=0;var u=this.u.length,p=Lx(e,{f:n,u:a,o:r,t:function(){e.terminate&&e.terminate()},r:function(){if(h(),d){var e=t.u[u+1];e?e.r():t.d=1}d=1}}),m=0;e.ondata=function(n,i,s){if(n)t.ondata(n,i,s),t.terminate();else if(m+=i.length,c.push(i),s){var r=new Ev(16);kx(r,0,134695760),kx(r,4,e.crc),kx(r,8,m),kx(r,12,e.size),c.push(r),p.c=m,p.b=o+m+16,p.crc=e.crc,p.size=e.size,d&&p.r(),d=1}else d&&h()},this.u.push(p)},e.prototype.end=function(){var e=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){1&e.d&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3},e.prototype.e=function(){for(var e=0,t=0,n=0,i=0,s=this.u;i<s.length;i++){n+=46+(l=s[i]).f.length+Ew(l.extra)+(l.o?l.o.length:0)}for(var r=new Ev(n+22),a=0,o=this.u;a<o.length;a++){var l=o[a];Ww(r,e,l,l.f,l.u,l.c,t,l.o),e+=46+l.f.length+Ew(l.extra)+(l.o?l.o.length:0),t+=l.b}Zw(r,e,this.u.length,n,t),this.ondata(null,r,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++){t[e].t()}this.d=2},e}();var Dw=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),kw=function(){function e(){var e=this;this.i=new ew((function(t,n){e.ondata(null,t,n)}))}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(n){this.ondata(n,e,t)}},e.compression=8,e}(),Bw=function(){function e(e,t){var n=this;t<32e4?this.i=new ew((function(e,t){n.ondata(null,e,t)})):(this.i=new tw((function(e,t,i){n.ondata(e,t,i)})),this.terminate=this.i.terminate)}return e.prototype.push=function(e,t){this.i.terminate&&(e=ox(e,0)),this.i.push(e,t)},e.compression=8,e}(),Fw=function(){function e(e){this.onfile=e,this.k=[],this.o={0:Dw},this.p=bx}return e.prototype.push=function(e,t){var n=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var i=Math.min(this.c,e.length),s=e.subarray(0,i);if(this.c-=i,this.d?this.d.push(s,!this.c):this.k[0].push(s),(e=e.subarray(i)).length)return this.push(e,t)}else{var r=0,a=0,o=void 0,l=void 0;this.p.length?e.length?((l=new Ev(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var c=l.length,h=this.c,d=h&&this.d,u=function(){var e,t=Hx(l,a);if(67324752==t){r=1,o=a,p.d=null,p.c=0;var i=Vx(l,a+6),s=Vx(l,a+8),d=2048&i,u=8&i,m=Vx(l,a+26),f=Vx(l,a+28);if(c>a+30+m+f){var g=[];p.k.unshift(g),r=2;var y,b=Hx(l,a+18),v=Hx(l,a+22),x=Aw(l.subarray(a+30,a+=30+m),!d);4294967295==b?(e=u?[-2]:zw(l,a),b=e[0],v=e[1]):u&&(b=-1),a+=f,p.c=b;var w={name:x,compression:s,start:function(){if(!w.ondata)throw"no callback";if(b){var e=n.o[s];if(!e)throw"unknown compression type "+s;(y=b<0?new e(x):new e(x,b,v)).ondata=function(e,t,n){w.ondata(e,t,n)};for(var t=0,i=g;t<i.length;t++){var r=i[t];y.push(r,!1)}n.k[0]==g&&n.c?n.d=y:y.push(bx,!0)}else w.ondata(null,bx,!0)},terminate:function(){y&&y.terminate&&y.terminate()}};b>=0&&(w.size=b,w.originalSize=v),p.onfile(w)}return"break"}if(h){if(134695760==t)return o=a+=12+(-2==h&&8),r=3,p.c=0,"break";if(33639248==t)return o=a-=4,r=3,p.c=0,"break"}},p=this;a<c-4;++a){if("break"===u())break}if(this.p=bx,h<0){var m=r?l.subarray(0,o-12-(-2==h&&8)-(134695760==Hx(l,o-16)&&4)):l.subarray(0,a);d?d.push(m,!!r):this.k[+(2==r)].push(m)}if(2&r)return this.push(l.subarray(a),t);this.p=l.subarray(a)}if(t){if(this.c)throw"invalid zip file";this.p=null}},e.prototype.register=function(e){this.o[e.compression]=e},e}();var Uw=Object.freeze({__proto__:null,Deflate:Jx,AsyncDeflate:Qx,deflate:qx,deflateSync:$x,Inflate:ew,AsyncInflate:tw,inflate:nw,inflateSync:iw,Gzip:sw,AsyncGzip:rw,gzip:aw,gzipSync:ow,Gunzip:lw,AsyncGunzip:cw,gunzip:hw,gunzipSync:dw,Zlib:uw,AsyncZlib:pw,zlib:function(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return Zx(e,t,[Ax,_x,function(){return[mw]}],(function(e){return Ex(mw(e.data[0],e.data[1]))}),4,n)},zlibSync:mw,Unzlib:fw,AsyncUnzlib:gw,unzlib:yw,unzlibSync:bw,compress:aw,AsyncCompress:rw,compressSync:ow,Compress:sw,Decompress:vw,AsyncDecompress:xw,decompress:function(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return 31==e[0]&&139==e[1]&&8==e[2]?hw(e,t,n):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?nw(e,t,n):yw(e,t,n)},decompressSync:function(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?dw(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?iw(e,t):bw(e,t)},DecodeUTF8:Gw,EncodeUTF8:Tw,strToU8:Rw,strFromU8:Aw,ZipPassThrough:Pw,ZipDeflate:Nw,AsyncZipDeflate:Vw,Zip:Hw,zip:function(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";var i={};ww(e,"",i,t);var s=Object.keys(i),r=s.length,a=0,o=0,l=r,c=new Array(r),h=[],d=function(){for(var e=0;e<h.length;++e)h[e]()},u=function(){var e=new Ev(o+22),t=a,i=o-a;o=0;for(var s=0;s<l;++s){var r=c[s];try{var h=r.c.length;Ww(e,o,r,r.f,r.u,h);var d=30+r.f.length+Ew(r.extra),u=o+d;e.set(r.c,u),Ww(e,a,r,r.f,r.u,h,o,r.m),a+=16+d+(r.m?r.m.length:0),o=u+h}catch(e){return n(e,null)}}Zw(e,a,c.length,i,t),n(null,e)};r||u();for(var p=function(e){var t=s[e],l=i[t],p=l[0],m=l[1],f=wx(),g=p.length;f.p(p);var y=Rw(t),b=y.length,v=m.comment,x=v&&Rw(v),w=x&&x.length,S=Ew(m.extra),M=0==m.level?0:8,L=function(i,s){if(i)d(),n(i,null);else{var l=s.length;c[e]=Lx(m,{size:g,crc:f.d(),c:s,f:y,m:x,u:b!=t.length||x&&v.length!=w,compression:M}),a+=30+b+S+l,o+=76+2*(b+S)+(w||0)+l,--r||u()}};if(b>65535&&L("filename too long",null),M)if(g<16e4)try{L(null,$x(p,m))}catch(e){L(e,null)}else h.push(qx(p,m,L));else L(null,p)},m=0;m<l;++m)p(m);return d},zipSync:function(e,t){t||(t={});var n={},i=[];ww(e,"",n,t);var s=0,r=0;for(var a in n){var o=n[a],l=o[0],c=o[1],h=0==c.level?0:8,d=(M=Rw(a)).length,u=c.comment,p=u&&Rw(u),m=p&&p.length,f=Ew(c.extra);if(d>65535)throw"filename too long";var g=h?$x(l,c):l,y=g.length,b=wx();b.p(l),i.push(Lx(c,{size:l.length,crc:b.d(),c:g,f:M,m:p,u:d!=a.length||p&&u.length!=m,o:s,compression:h})),s+=30+d+f+y,r+=76+2*(d+f)+(m||0)+y}for(var v=new Ev(r+22),x=s,w=r-s,S=0;S<i.length;++S){var M=i[S];Ww(v,M.o,M,M.f,M.u,M.c.length);var L=30+M.f.length+Ew(M.extra);v.set(M.c,M.o+L),Ww(v,s,M,M.f,M.u,M.c.length,M.o,M.m),s+=16+L+(M.m?M.m.length:0)}return Zw(v,s,i.length,w,x),v},UnzipPassThrough:Dw,UnzipInflate:kw,AsyncUnzipInflate:Bw,Unzip:Fw,unzip:function(e,t){if("function"!=typeof t)throw"no callback";for(var n=[],i=function(){for(var e=0;e<n.length;++e)n[e]()},s={},r=e.length-22;101010256!=Hx(e,r);--r)if(!r||e.length-r>65558)return void t("invalid zip file",null);var a=Vx(e,r+8);a||t(null,{});var o=a,l=Hx(e,r+16),c=4294967295==l;if(c){if(r=Hx(e,r-12),101075792!=Hx(e,r))return void t("invalid zip file",null);o=a=Hx(e,r+32),l=Hx(e,r+48)}for(var h=function(r){var o=_w(e,l,c),h=o[0],d=o[1],u=o[2],p=o[3],m=o[4],f=o[5],g=Iw(e,f);l=m;var y=function(e,n){e?(i(),t(e,null)):(s[p]=n,--a||t(null,s))};if(h)if(8==h){var b=e.subarray(g,g+d);if(d<32e4)try{y(null,iw(b,new Ev(u)))}catch(e){y(e,null)}else n.push(nw(b,{size:u},y))}else y("unknown compression type "+h,null);else y(null,ox(e,g,g+d))},d=0;d<o;++d)h();return i},unzipSync:function(e){for(var t={},n=e.length-22;101010256!=Hx(e,n);--n)if(!n||e.length-n>65558)throw"invalid zip file";var i=Vx(e,n+8);if(!i)return{};var s=Hx(e,n+16),r=4294967295==s;if(r){if(n=Hx(e,n-12),101075792!=Hx(e,n))throw"invalid zip file";i=Hx(e,n+32),s=Hx(e,n+48)}for(var a=0;a<i;++a){var o=_w(e,s,r),l=o[0],c=o[1],h=o[2],d=o[3],u=o[4],p=o[5],m=Iw(e,p);if(s=u,l){if(8!=l)throw"unknown compression type "+l;t[d]=iw(e.subarray(m,m+c),new Ev(h))}else t[d]=ox(e,m,m+c)}return t}});function Ow(e,t,n){const i=n.length-e-1;if(t>=n[i])return i-1;if(t<=n[e])return e;let s=e,r=i,a=Math.floor((s+r)/2);for(;t<n[a]||t>=n[a+1];)t<n[a]?r=a:s=a,a=Math.floor((s+r)/2);return a}function Yw(e,t){let n=1;for(let t=2;t<=e;++t)n*=t;let i=1;for(let e=2;e<=t;++e)i*=e;for(let n=2;n<=e-t;++n)i*=n;return n/i}function Kw(e,t,n,i,s){return function(e){const t=e.length,n=[],i=[];for(let s=0;s<t;++s){const t=e[s];n[s]=new zt(t.x,t.y,t.z),i[s]=t.w}const s=[];for(let e=0;e<t;++e){const t=n[e].clone();for(let n=1;n<=e;++n)t.sub(s[e-n].clone().multiplyScalar(Yw(e,n)*i[n]));s[e]=t.divideScalar(i[0])}return s}(function(e,t,n,i,s){const r=s<e?s:e,a=[],o=Ow(e,i,t),l=function(e,t,n,i,s){const r=[];for(let e=0;e<=n;++e)r[e]=0;const a=[];for(let e=0;e<=i;++e)a[e]=r.slice(0);const o=[];for(let e=0;e<=n;++e)o[e]=r.slice(0);o[0][0]=1;const l=r.slice(0),c=r.slice(0);for(let i=1;i<=n;++i){l[i]=t-s[e+1-i],c[i]=s[e+i]-t;let n=0;for(let e=0;e<i;++e){const t=c[e+1],s=l[i-e];o[i][e]=t+s;const r=o[e][i-1]/o[i][e];o[e][i]=n+t*r,n=s*r}o[i][i]=n}for(let e=0;e<=n;++e)a[0][e]=o[e][n];for(let e=0;e<=n;++e){let t=0,s=1;const l=[];for(let e=0;e<=n;++e)l[e]=r.slice(0);l[0][0]=1;for(let r=1;r<=i;++r){let i=0;const c=e-r,h=n-r;e>=r&&(l[s][0]=l[t][0]/o[h+1][c],i=l[s][0]*o[c][h]);const d=e-1<=h?r-1:n-e;for(let e=c>=-1?1:-c;e<=d;++e)l[s][e]=(l[t][e]-l[t][e-1])/o[h+1][c+e],i+=l[s][e]*o[c+e][h];e<=h&&(l[s][r]=-l[t][r-1]/o[h+1][e],i+=l[s][r]*o[e][h]),a[r][e]=i;const u=t;t=s,s=u}}let h=n;for(let e=1;e<=i;++e){for(let t=0;t<=n;++t)a[e][t]*=h;h*=n-e}return a}(o,i,e,r,t),c=[];for(let e=0;e<n.length;++e){const t=n[e].clone(),i=t.w;t.x*=i,t.y*=i,t.z*=i,c[e]=t}for(let t=0;t<=r;++t){const n=c[o-e].clone().multiplyScalar(l[t][0]);for(let i=1;i<=e;++i)n.add(c[o-e+i].clone().multiplyScalar(l[t][i]));a[t]=n}for(let e=r+1;e<=s+1;++e)a[e]=new Ct(0,0,0);return a}(e,t,n,i,s))}class jw extends Ko{constructor(e,t,n,i,s){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=i||0,this.endKnot=s||this.knots.length-1;for(let e=0;e<n.length;++e){const t=n[e];this.controlPoints[e]=new Ct(t.x,t.y,t.z,t.w)}}getPoint(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt,n=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=function(e,t,n,i){const s=Ow(e,i,t),r=function(e,t,n,i){const s=[],r=[],a=[];s[0]=1;for(let o=1;o<=n;++o){r[o]=t-i[e+1-o],a[o]=i[e+o]-t;let n=0;for(let e=0;e<o;++e){const t=a[e+1],i=r[o-e],l=s[e]/(t+i);s[e]=n+t*l,n=i*l}s[o]=n}return s}(s,i,e,t),a=new Ct(0,0,0,0);for(let t=0;t<=e;++t){const i=n[s-e+t],o=r[t],l=i.w*o;a.x+=i.x*l,a.y+=i.y*l,a.z+=i.z*l,a.w+=i.w*o}return a}(this.degree,this.knots,this.controlPoints,n);return 1!==i.w&&i.divideScalar(i.w),t.set(i.x,i.y,i.z)}getTangent(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new zt,n=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),i=Kw(this.degree,this.knots,this.controlPoints,n,1);return t.copy(i[1]).normalize(),t}}let Jw,Qw,qw;class $w extends Oc{constructor(e){super(e)}load(e,t,n,i){const s=this,r=""===s.path?wh.extractUrlBase(e):s.path,a=new Kc(this.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,(function(n){try{t(s.parse(n,r))}catch(t){i?i(t):console.error(t),s.manager.itemError(e)}}),n,i)}parse(e,t){if(function(e){const t="Kaydara FBX Binary \0";return e.byteLength>=t.length&&t===gS(e,0,t.length)}(e))Jw=(new sS).parse(e);else{const t=gS(e);if(!function(e){const t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let n=0;function i(t){const i=e[t-1];return e=e.slice(n+t),n++,i}for(let e=0;e<t.length;++e){if(i(1)===t[e])return!1}return!0}(t))throw new Error("THREE.FBXLoader: Unknown format.");if(oS(t)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+oS(t));Jw=(new iS).parse(t)}const n=new eh(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new eS(n,this.manager).parse(Jw)}}class eS{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){Qw=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),n=this.parseMaterials(t),i=this.parseDeformers(),s=(new tS).parse(i);return this.parseScene(i,s,n),qw}parseConnections(){const e=new Map;if("Connections"in Jw){Jw.Connections.connections.forEach((function(t){const n=t[0],i=t[1],s=t[2];e.has(n)||e.set(n,{parents:[],children:[]});const r={ID:i,relationship:s};e.get(n).parents.push(r),e.has(i)||e.set(i,{parents:[],children:[]});const a={ID:n,relationship:s};e.get(i).children.push(a)}))}return e}parseImages(){const e={},t={};if("Video"in Jw.Objects){const n=Jw.Objects.Video;for(const i in n){const s=n[i];if(e[parseInt(i)]=s.RelativeFilename||s.Filename,"Content"in s){const e=s.Content instanceof ArrayBuffer&&s.Content.byteLength>0,r="string"==typeof s.Content&&""!==s.Content;if(e||r){const e=this.parseImage(n[i]);t[s.RelativeFilename||s.Filename]=e}}}}for(const n in e){const i=e[n];void 0!==t[i]?e[n]=t[i]:e[n]=e[n].split("\\").pop()}return e}parseImage(e){const t=e.Content,n=e.RelativeFilename||e.Filename,i=n.slice(n.lastIndexOf(".")+1).toLowerCase();let s;switch(i){case"bmp":s="image/bmp";break;case"jpg":case"jpeg":s="image/jpeg";break;case"png":s="image/png";break;case"tif":s="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),s="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+i+'" is not supported.')}if("string"==typeof t)return"data:"+s+";base64,"+t;{const e=new Uint8Array(t);return window.URL.createObjectURL(new Blob([e],{type:s}))}}parseTextures(e){const t=new Map;if("Texture"in Jw.Objects){const n=Jw.Objects.Texture;for(const i in n){const s=this.parseTexture(n[i],e);t.set(parseInt(i),s)}}return t}parseTexture(e,t){const n=this.loadTexture(e,t);n.ID=e.id,n.name=e.attrName;const i=e.WrapModeU,s=e.WrapModeV,r=void 0!==i?i.value:0,a=void 0!==s?s.value:0;if(n.wrapS=0===r?y:b,n.wrapT=0===a?y:b,"Scaling"in e){const t=e.Scaling.value;n.repeat.x=t[0],n.repeat.y=t[1]}if("Translation"in e){const t=e.Translation.value;n.offset.x=t[0],n.offset.y=t[1]}return n}loadTexture(e,t){let n;const i=this.textureLoader.path,s=Qw.get(e.id).children;let r;void 0!==s&&s.length>0&&void 0!==t[s[0].ID]&&(n=t[s[0].ID],0!==n.indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0));const a=e.FileName.slice(-3).toLowerCase();if("tga"===a){const t=this.manager.getHandler(".tga");null===t?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),r=new Lt):(t.setPath(this.textureLoader.path),r=t.load(n))}else"psd"===a?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),r=new Lt):r=this.textureLoader.load(n);return this.textureLoader.setPath(i),r}parseMaterials(e){const t=new Map;if("Material"in Jw.Objects){const n=Jw.Objects.Material;for(const i in n){const s=this.parseMaterial(n[i],e);null!==s&&t.set(parseInt(i),s)}}return t}parseMaterial(e,t){const n=e.id,i=e.attrName;let s=e.ShadingModel;if("object"==typeof s&&(s=s.value),!Qw.has(n))return null;const r=this.parseParameters(e,t,n);let a;switch(s.toLowerCase()){case"phong":a=new Sc;break;case"lambert":a=new Cc;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',s),a=new Sc}return a.setValues(r),a.name=i,a}parseParameters(e,t,n){const i={};e.BumpFactor&&(i.bumpScale=e.BumpFactor.value),e.Diffuse?i.color=(new bt).fromArray(e.Diffuse.value):!e.DiffuseColor||"Color"!==e.DiffuseColor.type&&"ColorRGB"!==e.DiffuseColor.type||(i.color=(new bt).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(i.displacementScale=e.DisplacementFactor.value),e.Emissive?i.emissive=(new bt).fromArray(e.Emissive.value):!e.EmissiveColor||"Color"!==e.EmissiveColor.type&&"ColorRGB"!==e.EmissiveColor.type||(i.emissive=(new bt).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(i.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(i.opacity=parseFloat(e.Opacity.value)),i.opacity<1&&(i.transparent=!0),e.ReflectionFactor&&(i.reflectivity=e.ReflectionFactor.value),e.Shininess&&(i.shininess=e.Shininess.value),e.Specular?i.specular=(new bt).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(i.specular=(new bt).fromArray(e.SpecularColor.value));const s=this;return Qw.get(n).children.forEach((function(e){const n=e.relationship;switch(n){case"Bump":i.bumpMap=s.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":i.aoMap=s.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":i.map=s.getTexture(t,e.ID),void 0!==i.map&&(i.map.encoding=Ee);break;case"DisplacementColor":i.displacementMap=s.getTexture(t,e.ID);break;case"EmissiveColor":i.emissiveMap=s.getTexture(t,e.ID),void 0!==i.emissiveMap&&(i.emissiveMap.encoding=Ee);break;case"NormalMap":case"Maya|TEX_normal_map":i.normalMap=s.getTexture(t,e.ID);break;case"ReflectionColor":i.envMap=s.getTexture(t,e.ID),void 0!==i.envMap&&(i.envMap.mapping=m,i.envMap.encoding=Ee);break;case"SpecularColor":i.specularMap=s.getTexture(t,e.ID),void 0!==i.specularMap&&(i.specularMap.encoding=Ee);break;case"TransparentColor":case"TransparencyFactor":i.alphaMap=s.getTexture(t,e.ID),i.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",n)}})),i}getTexture(e,t){return"LayeredTexture"in Jw.Objects&&t in Jw.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=Qw.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in Jw.Objects){const n=Jw.Objects.Deformer;for(const i in n){const s=n[i],r=Qw.get(parseInt(i));if("Skin"===s.attrType){const t=this.parseSkeleton(r,n);t.ID=i,r.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),t.geometryID=r.parents[0].ID,e[i]=t}else if("BlendShape"===s.attrType){const e={id:i};e.rawTargets=this.parseMorphTargets(r,n),e.id=i,r.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[i]=e}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const n=[];return e.children.forEach((function(e){const i=t[e.ID];if("Cluster"!==i.attrType)return;const s={ID:e.ID,indices:[],weights:[],transformLink:(new dn).fromArray(i.TransformLink.a)};"Indexes"in i&&(s.indices=i.Indexes.a,s.weights=i.Weights.a),n.push(s)})),{rawBones:n,bones:[]}}parseMorphTargets(e,t){const n=[];for(let i=0;i<e.children.length;i++){const s=e.children[i],r=t[s.ID],a={name:r.attrName,initialWeight:r.DeformPercent,id:r.id,fullWeights:r.FullWeights.a};if("BlendShapeChannel"!==r.attrType)return;a.geoID=Qw.get(parseInt(s.ID)).children.filter((function(e){return void 0===e.relationship}))[0].ID,n.push(a)}return n}parseScene(e,t,n){qw=new Ra;const i=this.parseModels(e.skeletons,t,n),s=Jw.Objects.Model,r=this;i.forEach((function(e){const t=s[e.ID];r.setLookAtProperties(e,t);Qw.get(e.ID).parents.forEach((function(t){const n=i.get(t.ID);void 0!==n&&n.add(e)})),null===e.parent&&qw.add(e)})),this.bindSkeleton(e.skeletons,t,i),this.createAmbientLight(),qw.traverse((function(e){if(e.userData.transformData){e.parent&&(e.userData.transformData.parentMatrix=e.parent.matrix,e.userData.transformData.parentMatrixWorld=e.parent.matrixWorld);const t=pS(e.userData.transformData);e.applyMatrix4(t),e.updateWorldMatrix()}}));const a=(new nS).parse();1===qw.children.length&&qw.children[0].isGroup&&(qw.children[0].animations=a,qw=qw.children[0]),qw.animations=a}parseModels(e,t,n){const i=new Map,s=Jw.Objects.Model;for(const r in s){const a=parseInt(r),o=s[r],l=Qw.get(a);let c=this.buildSkeleton(l,e,a,o.attrName);if(!c){switch(o.attrType){case"Camera":c=this.createCamera(l);break;case"Light":c=this.createLight(l);break;case"Mesh":c=this.createMesh(l,t,n);break;case"NurbsCurve":c=this.createCurve(l,t);break;case"LimbNode":case"Root":c=new fo;break;case"Null":default:c=new Ra}c.name=o.attrName?rd.sanitizeNodeName(o.attrName):"",c.ID=a}this.getTransformData(c,o),i.set(a,c)}return i}buildSkeleton(e,t,n,i){let s=null;return e.parents.forEach((function(e){for(const r in t){const a=t[r];a.rawBones.forEach((function(t,r){if(t.ID===e.ID){const e=s;s=new fo,s.matrixWorld.copy(t.transformLink),s.name=i?rd.sanitizeNodeName(i):"",s.ID=n,a.bones[r]=s,null!==e&&s.add(e)}}))}})),s}createCamera(e){let t,n;if(e.children.forEach((function(e){const t=Jw.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new Zn;else{let e=0;void 0!==n.CameraProjectionType&&1===n.CameraProjectionType.value&&(e=1);let i=1;void 0!==n.NearPlane&&(i=n.NearPlane.value/1e3);let s=1e3;void 0!==n.FarPlane&&(s=n.FarPlane.value/1e3);let r=window.innerWidth,a=window.innerHeight;void 0!==n.AspectWidth&&void 0!==n.AspectHeight&&(r=n.AspectWidth.value,a=n.AspectHeight.value);const o=r/a;let l=45;void 0!==n.FieldOfView&&(l=n.FieldOfView.value);const c=n.FocalLength?n.FocalLength.value:null;switch(e){case 0:t=new Bi(l,o,i,s),null!==c&&t.setFocalLength(c);break;case 1:t=new ps(-r/2,r/2,a/2,-a/2,i,s);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+e+"."),t=new Zn}}return t}createLight(e){let t,n;if(e.children.forEach((function(e){const t=Jw.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new Zn;else{let e;e=void 0===n.LightType?0:n.LightType.value;let i=16777215;void 0!==n.Color&&(i=(new bt).fromArray(n.Color.value));let s=void 0===n.Intensity?1:n.Intensity.value/100;void 0!==n.CastLightOnObject&&0===n.CastLightOnObject.value&&(s=0);let r=0;void 0!==n.FarAttenuationEnd&&(r=void 0!==n.EnableFarAttenuation&&0===n.EnableFarAttenuation.value?0:n.FarAttenuationEnd.value);const a=1;switch(e){case 0:t=new ph(i,s,r,a);break;case 1:t=new fh(i,s);break;case 2:let e=Math.PI/3;void 0!==n.InnerAngle&&(e=tt.degToRad(n.InnerAngle.value));let o=0;void 0!==n.OuterAngle&&(o=tt.degToRad(n.OuterAngle.value),o=Math.max(o,1)),t=new lh(i,s,r,e,o,a);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),t=new ph(i,s)}void 0!==n.CastShadows&&1===n.CastShadows.value&&(t.castShadow=!0)}return t}createMesh(e,t,n){let i,s=null,r=null;const a=[];return e.children.forEach((function(e){t.has(e.ID)&&(s=t.get(e.ID)),n.has(e.ID)&&a.push(n.get(e.ID))})),a.length>1?r=a:a.length>0?r=a[0]:(r=new Sc({color:13421772}),a.push(r)),"color"in s.attributes&&a.forEach((function(e){e.vertexColors=!0})),s.FBX_Deformer?(i=new mo(s,r),i.normalizeSkinWeights()):i=new Wi(s,r),i}createCurve(e,t){const n=e.children.reduce((function(e,n){return t.has(n.ID)&&(e=t.get(n.ID)),e}),null),i=new Go({color:3342591,linewidth:1});return new _o(n,i)}getTransformData(e,t){const n={};"InheritType"in t&&(n.inheritType=parseInt(t.InheritType.value)),n.eulerOrder="RotationOrder"in t?mS(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(n.translation=t.Lcl_Translation.value),"PreRotation"in t&&(n.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(n.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(n.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(n.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(n.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(n.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(n.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(n.rotationPivot=t.RotationPivot.value),e.userData.transformData=n}setLookAtProperties(e,t){if("LookAtProperty"in t){Qw.get(e.ID).children.forEach((function(t){if("LookAtProperty"===t.relationship){const n=Jw.Objects.Model[t.ID];if("Lcl_Translation"in n){const t=n.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),qw.add(e.target)):e.lookAt((new zt).fromArray(t))}}}))}}bindSkeleton(e,t,n){const i=this.parsePoseNodes();for(const s in e){const r=e[s];Qw.get(parseInt(r.ID)).parents.forEach((function(e){if(t.has(e.ID)){const t=e.ID;Qw.get(t).parents.forEach((function(e){if(n.has(e.ID)){n.get(e.ID).bind(new vo(r.bones),i[e.ID])}}))}}))}}parsePoseNodes(){const e={};if("Pose"in Jw.Objects){const t=Jw.Objects.Pose;for(const n in t)if("BindPose"===t[n].attrType&&t[n].NbPoseNodes>0){const i=t[n].PoseNode;Array.isArray(i)?i.forEach((function(t){e[t.Node]=(new dn).fromArray(t.Matrix.a)})):e[i.Node]=(new dn).fromArray(i.Matrix.a)}}return e}createAmbientLight(){if("GlobalSettings"in Jw&&"AmbientColor"in Jw.GlobalSettings){const e=Jw.GlobalSettings.AmbientColor.value,t=e[0],n=e[1],i=e[2];if(0!==t||0!==n||0!==i){const e=new bt(t,n,i);qw.add(new gh(e,1))}}}}class tS{parse(e){const t=new Map;if("Geometry"in Jw.Objects){const n=Jw.Objects.Geometry;for(const i in n){const s=Qw.get(parseInt(i)),r=this.parseGeometry(s,n[i],e);t.set(parseInt(i),r)}}return t}parseGeometry(e,t,n){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,n);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,n){const i=n.skeletons,s=[],r=e.parents.map((function(e){return Jw.Objects.Model[e.ID]}));if(0===r.length)return;const a=e.children.reduce((function(e,t){return void 0!==i[t.ID]&&(e=i[t.ID]),e}),null);e.children.forEach((function(e){void 0!==n.morphTargets[e.ID]&&s.push(n.morphTargets[e.ID])}));const o=r[0],l={};"RotationOrder"in o&&(l.eulerOrder=mS(o.RotationOrder.value)),"InheritType"in o&&(l.inheritType=parseInt(o.InheritType.value)),"GeometricTranslation"in o&&(l.translation=o.GeometricTranslation.value),"GeometricRotation"in o&&(l.rotation=o.GeometricRotation.value),"GeometricScaling"in o&&(l.scale=o.GeometricScaling.value);const c=pS(l);return this.genGeometry(t,a,s,c)}genGeometry(e,t,n,i){const s=new yi;e.attrName&&(s.name=e.attrName);const r=this.parseGeoNode(e,t),a=this.genBuffers(r),o=new li(a.vertex,3);if(o.applyMatrix4(i),s.setAttribute("position",o),a.colors.length>0&&s.setAttribute("color",new li(a.colors,3)),t&&(s.setAttribute("skinIndex",new si(a.weightsIndices,4)),s.setAttribute("skinWeight",new li(a.vertexWeights,4)),s.FBX_Deformer=t),a.normal.length>0){const e=(new it).getNormalMatrix(i),t=new li(a.normal,3);t.applyNormalMatrix(e),s.setAttribute("normal",t)}if(a.uvs.forEach((function(e,t){let n="uv"+(t+1).toString();0===t&&(n="uv"),s.setAttribute(n,new li(a.uvs[t],2))})),r.material&&"AllSame"!==r.material.mappingType){let e=a.materialIndex[0],t=0;if(a.materialIndex.forEach((function(n,i){n!==e&&(s.addGroup(t,i-t,e),e=n,t=i)})),s.groups.length>0){const t=s.groups[s.groups.length-1],n=t.start+t.count;n!==a.materialIndex.length&&s.addGroup(n,a.materialIndex.length-n,e)}0===s.groups.length&&s.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(s,e,n,i),s}parseGeoNode(e,t){const n={};if(n.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],n.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(n.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(n.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(n.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){n.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&n.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}return n.weightTable={},null!==t&&(n.skeleton=t,t.rawBones.forEach((function(e,t){e.indices.forEach((function(i,s){void 0===n.weightTable[i]&&(n.weightTable[i]=[]),n.weightTable[i].push({id:t,weight:e.weights[s]})}))}))),n}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,i=0,s=!1,r=[],a=[],o=[],l=[],c=[],h=[];const d=this;return e.vertexIndices.forEach((function(u,p){let m,f=!1;u<0&&(u^=-1,f=!0);let g=[],y=[];if(r.push(3*u,3*u+1,3*u+2),e.color){const t=hS(p,n,u,e.color);o.push(t[0],t[1],t[2])}if(e.skeleton){if(void 0!==e.weightTable[u]&&e.weightTable[u].forEach((function(e){y.push(e.weight),g.push(e.id)})),y.length>4){s||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),s=!0);const e=[0,0,0,0],t=[0,0,0,0];y.forEach((function(n,i){let s=n,r=g[i];t.forEach((function(t,n,i){if(s>t){i[n]=s,s=t;const a=e[n];e[n]=r,r=a}}))})),g=e,y=t}for(;y.length<4;)y.push(0),g.push(0);for(let e=0;e<4;++e)c.push(y[e]),h.push(g[e])}if(e.normal){const t=hS(p,n,u,e.normal);a.push(t[0],t[1],t[2])}e.material&&"AllSame"!==e.material.mappingType&&(m=hS(p,n,u,e.material)[0]),e.uv&&e.uv.forEach((function(e,t){const i=hS(p,n,u,e);void 0===l[t]&&(l[t]=[]),l[t].push(i[0]),l[t].push(i[1])})),i++,f&&(d.genFace(t,e,r,m,a,o,l,c,h,i),n++,i=0,r=[],a=[],o=[],l=[],c=[],h=[])})),t}genFace(e,t,n,i,s,r,a,o,l,c){for(let h=2;h<c;h++)e.vertex.push(t.vertexPositions[n[0]]),e.vertex.push(t.vertexPositions[n[1]]),e.vertex.push(t.vertexPositions[n[2]]),e.vertex.push(t.vertexPositions[n[3*(h-1)]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+1]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+2]]),e.vertex.push(t.vertexPositions[n[3*h]]),e.vertex.push(t.vertexPositions[n[3*h+1]]),e.vertex.push(t.vertexPositions[n[3*h+2]]),t.skeleton&&(e.vertexWeights.push(o[0]),e.vertexWeights.push(o[1]),e.vertexWeights.push(o[2]),e.vertexWeights.push(o[3]),e.vertexWeights.push(o[4*(h-1)]),e.vertexWeights.push(o[4*(h-1)+1]),e.vertexWeights.push(o[4*(h-1)+2]),e.vertexWeights.push(o[4*(h-1)+3]),e.vertexWeights.push(o[4*h]),e.vertexWeights.push(o[4*h+1]),e.vertexWeights.push(o[4*h+2]),e.vertexWeights.push(o[4*h+3]),e.weightsIndices.push(l[0]),e.weightsIndices.push(l[1]),e.weightsIndices.push(l[2]),e.weightsIndices.push(l[3]),e.weightsIndices.push(l[4*(h-1)]),e.weightsIndices.push(l[4*(h-1)+1]),e.weightsIndices.push(l[4*(h-1)+2]),e.weightsIndices.push(l[4*(h-1)+3]),e.weightsIndices.push(l[4*h]),e.weightsIndices.push(l[4*h+1]),e.weightsIndices.push(l[4*h+2]),e.weightsIndices.push(l[4*h+3])),t.color&&(e.colors.push(r[0]),e.colors.push(r[1]),e.colors.push(r[2]),e.colors.push(r[3*(h-1)]),e.colors.push(r[3*(h-1)+1]),e.colors.push(r[3*(h-1)+2]),e.colors.push(r[3*h]),e.colors.push(r[3*h+1]),e.colors.push(r[3*h+2])),t.material&&"AllSame"!==t.material.mappingType&&(e.materialIndex.push(i),e.materialIndex.push(i),e.materialIndex.push(i)),t.normal&&(e.normal.push(s[0]),e.normal.push(s[1]),e.normal.push(s[2]),e.normal.push(s[3*(h-1)]),e.normal.push(s[3*(h-1)+1]),e.normal.push(s[3*(h-1)+2]),e.normal.push(s[3*h]),e.normal.push(s[3*h+1]),e.normal.push(s[3*h+2])),t.uv&&t.uv.forEach((function(t,n){void 0===e.uvs[n]&&(e.uvs[n]=[]),e.uvs[n].push(a[n][0]),e.uvs[n].push(a[n][1]),e.uvs[n].push(a[n][2*(h-1)]),e.uvs[n].push(a[n][2*(h-1)+1]),e.uvs[n].push(a[n][2*h]),e.uvs[n].push(a[n][2*h+1])}))}addMorphTargets(e,t,n,i){if(0===n.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const s=this;n.forEach((function(n){n.rawTargets.forEach((function(n){const r=Jw.Objects.Geometry[n.geoID];void 0!==r&&s.genMorphGeometry(e,t,r,i,n.name)}))}))}genMorphGeometry(e,t,n,i,s){const r=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],a=void 0!==n.Vertices?n.Vertices.a:[],o=void 0!==n.Indexes?n.Indexes.a:[],l=3*e.attributes.position.count,c=new Float32Array(l);for(let e=0;e<o.length;e++){const t=3*o[e];c[t]=a[3*e],c[t+1]=a[3*e+1],c[t+2]=a[3*e+2]}const h={vertexIndices:r,vertexPositions:c},d=this.genBuffers(h),u=new li(d.vertex,3);u.name=s||n.attrName,u.applyMatrix4(i),e.morphAttributes.position.push(u)}parseNormals(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,i=e.Normals.a;let s=[];return"IndexToDirect"===n&&("NormalIndex"in e?s=e.NormalIndex.a:"NormalsIndex"in e&&(s=e.NormalsIndex.a)),{dataSize:3,buffer:i,indices:s,mappingType:t,referenceType:n}}parseUVs(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,i=e.UV.a;let s=[];return"IndexToDirect"===n&&(s=e.UVIndex.a),{dataSize:2,buffer:i,indices:s,mappingType:t,referenceType:n}}parseVertexColors(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,i=e.Colors.a;let s=[];return"IndexToDirect"===n&&(s=e.ColorIndex.a),{dataSize:4,buffer:i,indices:s,mappingType:t,referenceType:n}}parseMaterialIndices(e){const t=e.MappingInformationType,n=e.ReferenceInformationType;if("NoMappingInformation"===t)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};const i=e.Materials.a,s=[];for(let e=0;e<i.length;++e)s.push(e);return{dataSize:1,buffer:i,indices:s,mappingType:t,referenceType:n}}parseNurbsGeometry(e){if(void 0===jw)return console.error("THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new yi;const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new yi;const n=t-1,i=e.KnotVector.a,s=[],r=e.Points.a;for(let e=0,t=r.length;e<t;e+=4)s.push((new Ct).fromArray(r,e));let a,o;if("Closed"===e.Form)s.push(s[0]);else if("Periodic"===e.Form){a=n,o=i.length-1-a;for(let e=0;e<n;++e)s.push(s[e])}const l=new jw(n,i,s,a,o).getPoints(12*s.length);return(new yi).setFromPoints(l)}}class nS{parse(){const e=[],t=this.parseClips();if(void 0!==t)for(const n in t){const i=t[n],s=this.addClip(i);e.push(s)}return e}parseClips(){if(void 0===Jw.Objects.AnimationCurve)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=Jw.Objects.AnimationCurveNode,t=new Map;for(const n in e){const i=e[n];if(null!==i.attrName.match(/S|R|T|DeformPercent/)){const e={id:i.id,attr:i.attrName,curves:{}};t.set(e.id,e)}}return t}parseAnimationCurves(e){const t=Jw.Objects.AnimationCurve;for(const n in t){const i={id:t[n].id,times:t[n].KeyTime.a.map(lS),values:t[n].KeyValueFloat.a},s=Qw.get(i.id);if(void 0!==s){const t=s.parents[0].ID,n=s.parents[0].relationship;n.match(/X/)?e.get(t).curves.x=i:n.match(/Y/)?e.get(t).curves.y=i:n.match(/Z/)?e.get(t).curves.z=i:n.match(/d|DeformPercent/)&&e.has(t)&&(e.get(t).curves.morph=i)}}}parseAnimationLayers(e){const t=Jw.Objects.AnimationLayer,n=new Map;for(const i in t){const t=[],s=Qw.get(parseInt(i));if(void 0!==s){s.children.forEach((function(n,i){if(e.has(n.ID)){const s=e.get(n.ID);if(void 0!==s.curves.x||void 0!==s.curves.y||void 0!==s.curves.z){if(void 0===t[i]){const e=Qw.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID;if(void 0!==e){const s=Jw.Objects.Model[e.toString()];if(void 0===s)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",n);const r={modelName:s.attrName?rd.sanitizeNodeName(s.attrName):"",ID:s.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};qw.traverse((function(e){e.ID===s.id&&(r.transform=e.matrix,e.userData.transformData&&(r.eulerOrder=e.userData.transformData.eulerOrder))})),r.transform||(r.transform=new dn),"PreRotation"in s&&(r.preRotation=s.PreRotation.value),"PostRotation"in s&&(r.postRotation=s.PostRotation.value),t[i]=r}}t[i]&&(t[i][s.attr]=s)}else if(void 0!==s.curves.morph){if(void 0===t[i]){const e=Qw.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID,s=Qw.get(e).parents[0].ID,r=Qw.get(s).parents[0].ID,a=Qw.get(r).parents[0].ID,o=Jw.Objects.Model[a],l={modelName:o.attrName?rd.sanitizeNodeName(o.attrName):"",morphName:Jw.Objects.Deformer[e].attrName};t[i]=l}t[i][s.attr]=s}}})),n.set(parseInt(i),t)}}return n}parseAnimStacks(e){const t=Jw.Objects.AnimationStack,n={};for(const i in t){const s=Qw.get(parseInt(i)).children;s.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const r=e.get(s[0].ID);n[i]={name:t[i].attrName,layer:r}}return n}addClip(e){let t=[];const n=this;return e.layer.forEach((function(e){t=t.concat(n.generateTracks(e))})),new Dc(e.name,-1,t)}generateTracks(e){const t=[];let n=new zt,i=new _t,s=new zt;if(e.transform&&e.transform.decompose(n,i,s),n=n.toArray(),i=(new wn).setFromQuaternion(i,e.eulerOrder).toArray(),s=s.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){const i=this.generateVectorTrack(e.modelName,e.T.curves,n,"position");void 0!==i&&t.push(i)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,i,e.preRotation,e.postRotation,e.eulerOrder);void 0!==n&&t.push(n)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,s,"scale");void 0!==n&&t.push(n)}if(void 0!==e.DeformPercent){const n=this.generateMorphTrack(e);void 0!==n&&t.push(n)}return t}generateVectorTrack(e,t,n,i){const s=this.getTimesForAllAxes(t),r=this.getKeyframeTrackValues(s,t,n);return new Hc(e+"."+i,s,r)}generateRotationTrack(e,t,n,i,s,r){void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=t.x.values.map(tt.degToRad)),void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=t.y.values.map(tt.degToRad)),void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=t.z.values.map(tt.degToRad));const a=this.getTimesForAllAxes(t),o=this.getKeyframeTrackValues(a,t,n);void 0!==i&&((i=i.map(tt.degToRad)).push(r),i=(new wn).fromArray(i),i=(new _t).setFromEuler(i)),void 0!==s&&((s=s.map(tt.degToRad)).push(r),s=(new wn).fromArray(s),s=(new _t).setFromEuler(s).invert());const l=new _t,c=new wn,h=[];for(let e=0;e<o.length;e+=3)c.set(o[e],o[e+1],o[e+2],r),l.setFromEuler(c),void 0!==i&&l.premultiply(i),void 0!==s&&l.multiply(s),l.toArray(h,e/3*4);return new Nc(e+".quaternion",a,h)}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,n=t.values.map((function(e){return e/100})),i=qw.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new Zc(e.modelName+".morphTargetInfluences["+i+"]",t.times,n)}getTimesForAllAxes(e){let t=[];if(void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})),t.length>1){let e=1,n=t[0];for(let i=1;i<t.length;i++){const s=t[i];s!==n&&(t[e]=s,n=s,e++)}t=t.slice(0,e)}return t}getKeyframeTrackValues(e,t,n){const i=n,s=[];let r=-1,a=-1,o=-1;return e.forEach((function(e){if(t.x&&(r=t.x.times.indexOf(e)),t.y&&(a=t.y.times.indexOf(e)),t.z&&(o=t.z.times.indexOf(e)),-1!==r){const e=t.x.values[r];s.push(e),i[0]=e}else s.push(i[0]);if(-1!==a){const e=t.y.values[a];s.push(e),i[1]=e}else s.push(i[1]);if(-1!==o){const e=t.z.values[o];s.push(e),i[2]=e}else s.push(i[2])})),s}interpolateRotations(e){for(let t=1;t<e.values.length;t++){const n=e.values[t-1],i=e.values[t]-n,s=Math.abs(i);if(s>=180){const r=s/180,a=i/r;let o=n+a;const l=e.times[t-1],c=(e.times[t]-l)/r;let h=l+c;const d=[],u=[];for(;h<e.times[t];)d.push(h),h+=c,u.push(o),o+=a;e.times=yS(e.times,t,d),e.values=yS(e.values,t,u)}}}}class iS{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new aS,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,n=e.split(/[\r\n]+/);return n.forEach((function(e,i){const s=e.match(/^[\s\t]*;/),r=e.match(/^[\s\t]*$/);if(s||r)return;const a=e.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),o=e.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=e.match("^\\t{"+(t.currentIndent-1)+"}}");a?t.parseNodeBegin(e,a):o?t.parseNodeProperty(e,o,n[++i]):l?t.popStack():e.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(e)})),this.allNodes}parseNodeBegin(e,t){const n=t[1].trim().replace(/^"/,"").replace(/"$/,""),i=t[2].split(",").map((function(e){return e.trim().replace(/^"/,"").replace(/"$/,"")})),s={name:n},r=this.parseNodeAttr(i),a=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(n,s):n in a?("PoseNode"===n?a.PoseNode.push(s):void 0!==a[n].id&&(a[n]={},a[n][a[n].id]=a[n]),""!==r.id&&(a[n][r.id]=s)):"number"==typeof r.id?(a[n]={},a[n][r.id]=s):"Properties70"!==n&&(a[n]="PoseNode"===n?[s]:s),"number"==typeof r.id&&(s.id=r.id),""!==r.name&&(s.attrName=r.name),""!==r.type&&(s.attrType=r.type),this.pushStack(s)}parseNodeAttr(e){let t=e[0];""!==e[0]&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let n="",i="";return e.length>1&&(n=e[1].replace(/^(\w+)::/,""),i=e[2]),{id:t,name:n,type:i}}parseNodeProperty(e,t,n){let i=t[1].replace(/^"/,"").replace(/"$/,"").trim(),s=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===i&&","===s&&(s=n.replace(/"/g,"").replace(/,$/,"").trim());const r=this.getCurrentNode();if("Properties70"!==r.name){if("C"===i){const e=s.split(",").slice(1),t=parseInt(e[0]),n=parseInt(e[1]);let a=s.split(",").slice(3);a=a.map((function(e){return e.trim().replace(/^"/,"")})),i="connections",s=[t,n],function(e,t){for(let n=0,i=e.length,s=t.length;n<s;n++,i++)e[i]=t[n]}(s,a),void 0===r[i]&&(r[i]=[])}"Node"===i&&(r.id=s),i in r&&Array.isArray(r[i])?r[i].push(s):"a"!==i?r[i]=s:r.a=s,this.setCurrentProp(r,i),"a"===i&&","!==s.slice(-1)&&(r.a=fS(s))}else this.parseNodeSpecialProperty(e,i,s)}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,","!==e.slice(-1)&&(t.a=fS(t.a))}parseNodeSpecialProperty(e,t,n){const i=n.split('",').map((function(e){return e.trim().replace(/^\"/,"").replace(/\s/,"_")})),s=i[0],r=i[1],a=i[2],o=i[3];let l=i[4];switch(r){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=fS(l)}this.getPrevNode()[s]={type:r,type2:a,flag:o,value:l},this.setCurrentProp(this.getPrevNode(),s)}}class sS{parse(e){const t=new rS(e);t.skip(23);const n=t.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const i=new aS;for(;!this.endOfContent(t);){const e=this.parseNode(t,n);null!==e&&i.add(e.name,e)}return i}endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const n={},i=t>=7500?e.getUint64():e.getUint32(),s=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const r=e.getUint8(),a=e.getString(r);if(0===i)return null;const o=[];for(let t=0;t<s;t++)o.push(this.parseProperty(e));const l=o.length>0?o[0]:"",c=o.length>1?o[1]:"",h=o.length>2?o[2]:"";for(n.singleProperty=1===s&&e.getOffset()===i;i>e.getOffset();){const i=this.parseNode(e,t);null!==i&&this.parseSubNode(a,n,i)}return n.propertyList=o,"number"==typeof l&&(n.id=l),""!==c&&(n.attrName=c),""!==h&&(n.attrType=h),""!==a&&(n.name=a),n}parseSubNode(e,t,n){if(!0===n.singleProperty){const e=n.propertyList[0];Array.isArray(e)?(t[n.name]=n,n.a=e):t[n.name]=e}else if("Connections"===e&&"C"===n.name){const e=[];n.propertyList.forEach((function(t,n){0!==n&&e.push(t)})),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===n.name){Object.keys(n).forEach((function(e){t[e]=n[e]}))}else if("Properties70"===e&&"P"===n.name){let e=n.propertyList[0],i=n.propertyList[1];const s=n.propertyList[2],r=n.propertyList[3];let a;0===e.indexOf("Lcl ")&&(e=e.replace("Lcl ","Lcl_")),0===i.indexOf("Lcl ")&&(i=i.replace("Lcl ","Lcl_")),a="Color"===i||"ColorRGB"===i||"Vector"===i||"Vector3D"===i||0===i.indexOf("Lcl_")?[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:n.propertyList[4],t[e]={type:i,type2:s,flag:r,value:a}}else void 0===t[n.name]?"number"==typeof n.id?(t[n.name]={},t[n.name][n.id]=n):t[n.name]=n:"PoseNode"===n.name?(Array.isArray(t[n.name])||(t[n.name]=[t[n.name]]),t[n.name].push(n)):void 0===t[n.name][n.id]&&(t[n.name][n.id]=n)}parseProperty(e){const t=e.getString(1);let n;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return n=e.getUint32(),e.getArrayBuffer(n);case"S":return n=e.getUint32(),e.getString(n);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const i=e.getUint32(),s=e.getUint32(),r=e.getUint32();if(0===s)switch(t){case"b":case"c":return e.getBooleanArray(i);case"d":return e.getFloat64Array(i);case"f":return e.getFloat32Array(i);case"i":return e.getInt32Array(i);case"l":return e.getInt64Array(i)}void 0===Uw&&console.error("THREE.FBXLoader: External library fflate.min.js required.");const a=bw(new Uint8Array(e.getArrayBuffer(r))),o=new rS(a.buffer);switch(t){case"b":case"c":return o.getBooleanArray(i);case"d":return o.getFloat64Array(i);case"f":return o.getFloat32Array(i);case"i":return o.getInt32Array(i);case"l":return o.getInt64Array(i)}break;default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class rS{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(e){const t=[];for(let n=0;n<e;n++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,e=4294967295&~e,4294967295===e&&(t=t+1&4294967295),e=e+1&4294967295,-(4294967296*t+e)):4294967296*t+e}getInt64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){let t=[];for(let n=0;n<e;n++)t[n]=this.getUint8();const n=t.indexOf(0);return n>=0&&(t=t.slice(0,n)),wh.decodeText(new Uint8Array(t))}}class aS{add(e,t){this[e]=t}}function oS(e){const t=e.match(/FBXVersion: (\d+)/);if(t){return parseInt(t[1])}throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function lS(e){return e/46186158e3}const cS=[];function hS(e,t,n,i){let s;switch(i.mappingType){case"ByPolygonVertex":s=e;break;case"ByPolygon":s=t;break;case"ByVertice":s=n;break;case"AllSame":s=i.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+i.mappingType)}"IndexToDirect"===i.referenceType&&(s=i.indices[s]);const r=s*i.dataSize,a=r+i.dataSize;return function(e,t,n,i){for(let s=n,r=0;s<i;s++,r++)e[r]=t[s];return e}(cS,i.buffer,r,a)}const dS=new wn,uS=new zt;function pS(e){const t=new dn,n=new dn,i=new dn,s=new dn,r=new dn,a=new dn,o=new dn,l=new dn,c=new dn,h=new dn,d=new dn,u=new dn,p=e.inheritType?e.inheritType:0;if(e.translation&&t.setPosition(uS.fromArray(e.translation)),e.preRotation){const t=e.preRotation.map(tt.degToRad);t.push(e.eulerOrder),n.makeRotationFromEuler(dS.fromArray(t))}if(e.rotation){const t=e.rotation.map(tt.degToRad);t.push(e.eulerOrder),i.makeRotationFromEuler(dS.fromArray(t))}if(e.postRotation){const t=e.postRotation.map(tt.degToRad);t.push(e.eulerOrder),s.makeRotationFromEuler(dS.fromArray(t)),s.invert()}e.scale&&r.scale(uS.fromArray(e.scale)),e.scalingOffset&&o.setPosition(uS.fromArray(e.scalingOffset)),e.scalingPivot&&a.setPosition(uS.fromArray(e.scalingPivot)),e.rotationOffset&&l.setPosition(uS.fromArray(e.rotationOffset)),e.rotationPivot&&c.setPosition(uS.fromArray(e.rotationPivot)),e.parentMatrixWorld&&(d.copy(e.parentMatrix),h.copy(e.parentMatrixWorld));const m=n.clone().multiply(i).multiply(s),f=new dn;f.extractRotation(h);const g=new dn;g.copyPosition(h);const y=g.clone().invert().multiply(h),b=f.clone().invert().multiply(y),v=r,x=new dn;if(0===p)x.copy(f).multiply(m).multiply(b).multiply(v);else if(1===p)x.copy(f).multiply(b).multiply(m).multiply(v);else{const e=(new dn).scale((new zt).setFromMatrixScale(d)).clone().invert(),t=b.clone().multiply(e);x.copy(f).multiply(m).multiply(t).multiply(v)}const w=c.clone().invert(),S=a.clone().invert();let M=t.clone().multiply(l).multiply(c).multiply(n).multiply(i).multiply(s).multiply(w).multiply(o).multiply(a).multiply(r).multiply(S);const L=(new dn).copyPosition(M),C=h.clone().multiply(L);return u.copyPosition(C),M=u.clone().multiply(x),M.premultiply(h.invert()),M}function mS(e){const t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(e=e||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[e]}function fS(e){return e.split(",").map((function(e){return parseFloat(e)}))}function gS(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.byteLength),wh.decodeText(new Uint8Array(e,t,n))}function yS(e,t,n){return e.slice(0,t).concat(n).concat(e.slice(t))}class bS extends $c{constructor(e){super(e)}parse(e){const t=0,n=1,i=2,s=3,r=9,a=10,o=11,l=48,c=4,h=0,d=1,u=2,p=3;e.length<19&&console.error("THREE.TGALoader: Not enough data to contain header.");let m=0;const f=new Uint8Array(e),g={id_length:f[m++],colormap_type:f[m++],image_type:f[m++],colormap_index:f[m++]|f[m++]<<8,colormap_length:f[m++]|f[m++]<<8,colormap_size:f[m++],origin:[f[m++]|f[m++]<<8,f[m++]|f[m++]<<8],width:f[m++]|f[m++]<<8,height:f[m++]|f[m++]<<8,pixel_size:f[m++],flags:f[m++]};!function(e){switch(e.image_type){case n:case r:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case i:case s:case a:case o:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(g),g.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=g.id_length;let y=!1,b=!1,v=!1;switch(g.image_type){case r:y=!0,b=!0;break;case n:b=!0;break;case a:y=!0;break;case i:break;case o:y=!0,v=!0;break;case s:v=!0}const x=new Uint8Array(g.width*g.height*4),w=function(e,t,n,i,s){let r,a;const o=n.pixel_size>>3,l=n.width*n.height*o;if(t&&(a=s.subarray(i,i+=n.colormap_length*(n.colormap_size>>3))),e){let e,t,n;r=new Uint8Array(l);let a=0;const c=new Uint8Array(o);for(;a<l;)if(e=s[i++],t=1+(127&e),128&e){for(n=0;n<o;++n)c[n]=s[i++];for(n=0;n<t;++n)r.set(c,a+n*o);a+=o*t}else{for(t*=o,n=0;n<t;++n)r[a+n]=s[i++];a+=t}}else r=s.subarray(i,i+=t?n.width*n.height:l);return{pixel_data:r,palettes:a}}(y,b,g,m,f);return function(e,t,n,i,s){let r,a,o,m,f,y;switch((g.flags&l)>>c){default:case u:r=0,o=1,f=t,a=0,m=1,y=n;break;case h:r=0,o=1,f=t,a=n-1,m=-1,y=-1;break;case p:r=t-1,o=-1,f=-1,a=0,m=1,y=n;break;case d:r=t-1,o=-1,f=-1,a=n-1,m=-1,y=-1}if(v)switch(g.pixel_size){case 8:!function(e,t,n,i,s,r,a,o){let l,c,h,d=0;const u=g.width;for(h=t;h!==i;h+=n)for(c=s;c!==a;c+=r,d++)l=o[d],e[4*(c+u*h)+0]=l,e[4*(c+u*h)+1]=l,e[4*(c+u*h)+2]=l,e[4*(c+u*h)+3]=255}(e,a,m,y,r,o,f,i);break;case 16:!function(e,t,n,i,s,r,a,o){let l,c,h=0;const d=g.width;for(c=t;c!==i;c+=n)for(l=s;l!==a;l+=r,h+=2)e[4*(l+d*c)+0]=o[h+0],e[4*(l+d*c)+1]=o[h+0],e[4*(l+d*c)+2]=o[h+0],e[4*(l+d*c)+3]=o[h+1]}(e,a,m,y,r,o,f,i);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(g.pixel_size){case 8:!function(e,t,n,i,s,r,a,o,l){const c=l;let h,d,u,p=0;const m=g.width;for(u=t;u!==i;u+=n)for(d=s;d!==a;d+=r,p++)h=o[p],e[4*(d+m*u)+3]=255,e[4*(d+m*u)+2]=c[3*h+0],e[4*(d+m*u)+1]=c[3*h+1],e[4*(d+m*u)+0]=c[3*h+2]}(e,a,m,y,r,o,f,i,s);break;case 16:!function(e,t,n,i,s,r,a,o){let l,c,h,d=0;const u=g.width;for(h=t;h!==i;h+=n)for(c=s;c!==a;c+=r,d+=2)l=o[d+0]+(o[d+1]<<8),e[4*(c+u*h)+0]=(31744&l)>>7,e[4*(c+u*h)+1]=(992&l)>>2,e[4*(c+u*h)+2]=(31&l)<<3,e[4*(c+u*h)+3]=32768&l?0:255}(e,a,m,y,r,o,f,i);break;case 24:!function(e,t,n,i,s,r,a,o){let l,c,h=0;const d=g.width;for(c=t;c!==i;c+=n)for(l=s;l!==a;l+=r,h+=3)e[4*(l+d*c)+3]=255,e[4*(l+d*c)+2]=o[h+0],e[4*(l+d*c)+1]=o[h+1],e[4*(l+d*c)+0]=o[h+2]}(e,a,m,y,r,o,f,i);break;case 32:!function(e,t,n,i,s,r,a,o){let l,c,h=0;const d=g.width;for(c=t;c!==i;c+=n)for(l=s;l!==a;l+=r,h+=4)e[4*(l+d*c)+2]=o[h+0],e[4*(l+d*c)+1]=o[h+1],e[4*(l+d*c)+0]=o[h+2],e[4*(l+d*c)+3]=o[h+3]}(e,a,m,y,r,o,f,i);break;default:console.error("THREE.TGALoader: Format not supported.")}}(x,g.width,g.height,w.pixel_data,w.palettes),{data:x,width:g.width,height:g.height,flipY:!0,generateMipmaps:!0,minFilter:C}}}class vS extends Oc{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new CS(e)})),this.register((function(e){return new _S(e)})),this.register((function(e){return new zS(e)})),this.register((function(e){return new TS(e)})),this.register((function(e){return new RS(e)})),this.register((function(e){return new AS(e)})),this.register((function(e){return new XS(e)})),this.register((function(e){return new LS(e)})),this.register((function(e){return new IS(e)})),this.register((function(e){return new GS(e)})),this.register((function(e){return new SS(e)})),this.register((function(e){return new ES(e)}))}load(e,t,n,i){const s=this;let r;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:wh.extractUrlBase(e),this.manager.itemStart(e);const a=function(t){i?i(t):console.error(t),s.manager.itemError(e),s.manager.itemEnd(e)},o=new Kc(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{s.parse(n,r,(function(n){t(n),s.manager.itemEnd(e)}),a)}catch(e){a(e)}}),n,a)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const r={},a={};if("string"==typeof e)s=e;else{if(wh.decodeText(new Uint8Array(e,0,4))===WS){try{r[wS.KHR_BINARY_GLTF]=new NS(e)}catch(e){return void(i&&i(e))}s=r[wS.KHR_BINARY_GLTF].content}else s=wh.decodeText(new Uint8Array(e))}const o=JSON.parse(s);if(void 0===o.asset||o.asset.version[0]<2)return void(i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const l=new yM(o,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){const t=this.pluginCallbacks[e](l);a[t.name]=t,r[t.name]=!0}if(o.extensionsUsed)for(let e=0;e<o.extensionsUsed.length;++e){const t=o.extensionsUsed[e],n=o.extensionsRequired||[];switch(t){case wS.KHR_MATERIALS_UNLIT:r[t]=new MS;break;case wS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:r[t]=new kS;break;case wS.KHR_DRACO_MESH_COMPRESSION:r[t]=new VS(o,this.dracoLoader);break;case wS.KHR_TEXTURE_TRANSFORM:r[t]=new HS;break;case wS.KHR_MESH_QUANTIZATION:r[t]=new BS;break;default:n.indexOf(t)>=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(r),l.setPlugins(a),l.parse(n,i)}parseAsync(e,t){const n=this;return new Promise((function(i,s){n.parse(e,t,i,s)}))}}function xS(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const wS={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class SS{constructor(e){this.parser=e,this.name=wS.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const i=t[n];i.extensions&&i.extensions[this.name]&&void 0!==i.extensions[this.name].light&&e._addNodeRef(this.cache,i.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,r=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let a;const o=new bt(16777215);void 0!==r.color&&o.fromArray(r.color);const l=void 0!==r.range?r.range:0;switch(r.type){case"directional":a=new fh(o),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new ph(o),a.distance=l;break;case"spot":a=new lh(o),a.distance=l,r.spot=r.spot||{},r.spot.innerConeAngle=void 0!==r.spot.innerConeAngle?r.spot.innerConeAngle:0,r.spot.outerConeAngle=void 0!==r.spot.outerConeAngle?r.spot.outerConeAngle:Math.PI/4,a.angle=r.spot.outerConeAngle,a.penumbra=1-r.spot.innerConeAngle/r.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+r.type)}return a.position.set(0,0,0),a.decay=2,void 0!==r.intensity&&(a.intensity=r.intensity),a.name=t.createUniqueName(r.name||"light_"+e),i=Promise.resolve(a),t.cache.add(n,i),i}createNodeAttachment(e){const t=this,n=this.parser,i=n.json.nodes[e],s=(i.extensions&&i.extensions[this.name]||{}).light;return void 0===s?null:this._loadLight(s).then((function(e){return n._getNodeRef(t.cache,s,e)}))}}class MS{constructor(){this.name=wS.KHR_MATERIALS_UNLIT}getMaterialType(){return Jn}extendParams(e,t,n){const i=[];e.color=new bt(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const t=s.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==s.baseColorTexture&&i.push(n.assignTexture(e,"map",s.baseColorTexture,Ee))}return Promise.all(i)}}class LS{constructor(e){this.parser=e,this.name=wS.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return void 0!==i&&(t.emissiveIntensity=i),Promise.resolve()}}class CS{constructor(e){this.parser=e,this.name=wS.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?wc:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],r=i.extensions[this.name];if(void 0!==r.clearcoatFactor&&(t.clearcoat=r.clearcoatFactor),void 0!==r.clearcoatTexture&&s.push(n.assignTexture(t,"clearcoatMap",r.clearcoatTexture)),void 0!==r.clearcoatRoughnessFactor&&(t.clearcoatRoughness=r.clearcoatRoughnessFactor),void 0!==r.clearcoatRoughnessTexture&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",r.clearcoatRoughnessTexture)),void 0!==r.clearcoatNormalTexture&&(s.push(n.assignTexture(t,"clearcoatNormalMap",r.clearcoatNormalTexture)),void 0!==r.clearcoatNormalTexture.scale)){const e=r.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new nt(e,e)}return Promise.all(s)}}class GS{constructor(e){this.parser=e,this.name=wS.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?wc:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],r=i.extensions[this.name];return void 0!==r.iridescenceFactor&&(t.iridescence=r.iridescenceFactor),void 0!==r.iridescenceTexture&&s.push(n.assignTexture(t,"iridescenceMap",r.iridescenceTexture)),void 0!==r.iridescenceIor&&(t.iridescenceIOR=r.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==r.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=r.iridescenceThicknessMinimum),void 0!==r.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=r.iridescenceThicknessMaximum),void 0!==r.iridescenceThicknessTexture&&s.push(n.assignTexture(t,"iridescenceThicknessMap",r.iridescenceThicknessTexture)),Promise.all(s)}}class TS{constructor(e){this.parser=e,this.name=wS.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?wc:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new bt(0,0,0),t.sheenRoughness=0,t.sheen=1;const r=i.extensions[this.name];return void 0!==r.sheenColorFactor&&t.sheenColor.fromArray(r.sheenColorFactor),void 0!==r.sheenRoughnessFactor&&(t.sheenRoughness=r.sheenRoughnessFactor),void 0!==r.sheenColorTexture&&s.push(n.assignTexture(t,"sheenColorMap",r.sheenColorTexture,Ee)),void 0!==r.sheenRoughnessTexture&&s.push(n.assignTexture(t,"sheenRoughnessMap",r.sheenRoughnessTexture)),Promise.all(s)}}class RS{constructor(e){this.parser=e,this.name=wS.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?wc:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],r=i.extensions[this.name];return void 0!==r.transmissionFactor&&(t.transmission=r.transmissionFactor),void 0!==r.transmissionTexture&&s.push(n.assignTexture(t,"transmissionMap",r.transmissionTexture)),Promise.all(s)}}class AS{constructor(e){this.parser=e,this.name=wS.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?wc:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],r=i.extensions[this.name];t.thickness=void 0!==r.thicknessFactor?r.thicknessFactor:0,void 0!==r.thicknessTexture&&s.push(n.assignTexture(t,"thicknessMap",r.thicknessTexture)),t.attenuationDistance=r.attenuationDistance||0;const a=r.attenuationColor||[1,1,1];return t.attenuationColor=new bt(a[0],a[1],a[2]),Promise.all(s)}}class XS{constructor(e){this.parser=e,this.name=wS.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?wc:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=void 0!==i.ior?i.ior:1.5,Promise.resolve()}}class IS{constructor(e){this.parser=e,this.name=wS.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?wc:null}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],r=i.extensions[this.name];t.specularIntensity=void 0!==r.specularFactor?r.specularFactor:1,void 0!==r.specularTexture&&s.push(n.assignTexture(t,"specularIntensityMap",r.specularTexture));const a=r.specularColorFactor||[1,1,1];return t.specularColor=new bt(a[0],a[1],a[2]),void 0!==r.specularColorTexture&&s.push(n.assignTexture(t,"specularColorMap",r.specularColorTexture,Ee)),Promise.all(s)}}class _S{constructor(e){this.parser=e,this.name=wS.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],r=t.options.ktx2Loader;if(!r){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,r)}}class zS{constructor(e){this.parser=e,this.name=wS.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const r=s.extensions[t],a=i.images[r.source];let o=n.textureLoader;if(a.uri){const e=n.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then((function(s){if(s)return n.loadTextureImage(e,r.source,o);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class ES{constructor(e){this.name=wS.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],i=this.parser.getDependency("buffer",e.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([i,s.ready]).then((function(t){const n=e.byteOffset||0,i=e.byteLength||0,r=e.count,a=e.byteStride,o=new ArrayBuffer(r*a),l=new Uint8Array(t[0],n,i);return s.decodeGltfBuffer(new Uint8Array(o),r,a,l,e.mode,e.filter),o}))}return null}}const WS="glTF",ZS=1313821514,PS=5130562;class NS{constructor(e){this.name=wS.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:wh.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==WS)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,i=new DataView(e,12);let s=0;for(;s<n;){const t=i.getUint32(s,!0);s+=4;const n=i.getUint32(s,!0);if(s+=4,n===ZS){const n=new Uint8Array(e,12+s,t);this.content=wh.decodeText(n)}else if(n===PS){const n=12+s;this.body=e.slice(n,n+t)}s+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class VS{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=wS.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,r=e.extensions[this.name].attributes,a={},o={},l={};for(const e in r){const t=sM[e]||e.toLowerCase();a[t]=r[e]}for(const t in e.attributes){const i=sM[t]||t.toLowerCase();if(void 0!==r[t]){const s=n.accessors[e.attributes[t]],r=eM[s.componentType];l[i]=r,o[i]=!0===s.normalized}}return t.getDependency("bufferView",s).then((function(e){return new Promise((function(t){i.decodeDracoFile(e,(function(e){for(const t in e.attributes){const n=e.attributes[t],i=o[t];void 0!==i&&(n.normalized=i)}t(e)}),a,l)}))}))}}class HS{constructor(){this.name=wS.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class DS extends xc{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;const t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),i=["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"),s=["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"),r=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),a={specular:{value:(new bt).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=a,this.onBeforeCompile=function(e){for(const t in a)e.uniforms[t]=a[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",n).replace("#include <roughnessmap_fragment>",i).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",r)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(e){a.specular.value=e}},specularMap:{get:function(){return a.specularMap.value},set:function(e){a.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(e){a.glossiness.value=e}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(e){a.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class kS{constructor(){this.name=wS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity"]}getMaterialType(){return DS}extendParams(e,t,n){const i=t.extensions[this.name];e.color=new bt(1,1,1),e.opacity=1;const s=[];if(Array.isArray(i.diffuseFactor)){const t=i.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==i.diffuseTexture&&s.push(n.assignTexture(e,"map",i.diffuseTexture,Ee)),e.emissive=new bt(0,0,0),e.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,e.specular=new bt(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){const t=i.specularGlossinessTexture;s.push(n.assignTexture(e,"glossinessMap",t)),s.push(n.assignTexture(e,"specularMap",t,Ee))}return Promise.all(s)}createMaterial(e){const t=new DS(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=void 0===e.emissiveIntensity?1:e.emissiveIntensity,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=0,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t}}class BS{constructor(){this.name=wS.KHR_MESH_QUANTIZATION}}class FS extends Ac{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let e=0;e!==i;e++)t[e]=n[s+e];return t}interpolate_(e,t,n,i){const s=this.resultBuffer,r=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,c=i-t,h=(n-t)/c,d=h*h,u=d*h,p=e*l,m=p-l,f=-2*u+3*d,g=u-d,y=1-f,b=g-d+h;for(let e=0;e!==a;e++){const t=r[m+e+a],n=r[m+e+o]*c,i=r[p+e+a],l=r[p+e]*c;s[e]=y*t+b*n+f*i+g*l}return s}}const US=new _t;class OS extends FS{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return US.fromArray(s).normalize().toArray(s),s}}const YS=0,KS=1,jS=2,JS=3,QS=4,qS=5,$S=6,eM={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},tM={9728:x,9729:M,9984:w,9985:L,9986:S,9987:C},nM={33071:b,33648:v,10497:y},iM={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},sM={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},rM={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},aM={CUBICSPLINE:void 0,LINEAR:Ge,STEP:Ce},oM="OPAQUE",lM="MASK",cM="BLEND";function hM(e){return void 0===e.DefaultMaterial&&(e.DefaultMaterial=new xc({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),e.DefaultMaterial}function dM(e,t,n){for(const i in n.extensions)void 0===e[i]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=n.extensions[i])}function uM(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function pM(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,i=t.weights.length;n<i;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){const n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,i=n.length;t<i;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function mM(e){const t=e.extensions&&e.extensions[wS.KHR_DRACO_MESH_COMPRESSION];let n;return n=t?"draco:"+t.bufferView+":"+t.indices+":"+fM(t.attributes):e.indices+":"+fM(e.attributes)+":"+e.mode,n}function fM(e){let t="";const n=Object.keys(e).sort();for(let i=0,s=n.length;i<s;i++)t+=n[i]+":"+e[n[i]]+";";return t}function gM(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class yM{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new xS,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};const n=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createImageBitmap||n||i&&s<98?this.textureLoader=new eh(this.options.manager):this.textureLoader=new Rh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Kc(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const r={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:n,userData:{}};dM(s,r,i),uM(r,i),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(r)}))).then((function(){e(r)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,i=t.length;n<i;n++){const i=t[n].joints;for(let t=0,n=i.length;t<n;t++)e[i[t]].isBone=!0}for(let t=0,i=e.length;t<i;t++){const i=e[t];void 0!==i.mesh&&(this._addNodeRef(this.meshCache,i.mesh),void 0!==i.skin&&(n[i.mesh].isSkinnedMesh=!0)),void 0!==i.camera&&this._addNodeRef(this.cameraCache,i.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),s=(e,t)=>{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[n,i]of e.children.entries())s(i,t.children[n])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this.loadNode(t);break;case"mesh":i=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":i=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":i=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(i.map((function(t,i){return n.getDependency(e,i)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[wS.KHR_BINARY_GLTF].body);const i=this.options;return new Promise((function(e,s){n.load(wh.resolveURL(t.uri,i.path),e,void 0,(function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const n=t.byteLength||0,i=t.byteOffset||0;return e.slice(i,i+n)}))}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse)return Promise.resolve(null);const s=[];return void 0!==i.bufferView?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),void 0!==i.sparse&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then((function(e){const s=e[0],r=iM[i.type],a=eM[i.componentType],o=a.BYTES_PER_ELEMENT,l=o*r,c=i.byteOffset||0,h=void 0!==i.bufferView?n.bufferViews[i.bufferView].byteStride:void 0,d=!0===i.normalized;let u,p;if(h&&h!==l){const e=Math.floor(c/h),n="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+e+":"+i.count;let l=t.cache.get(n);l||(u=new a(s,e*h,i.count*h/o),l=new Ha(u,h/o),t.cache.add(n,l)),p=new ka(l,r,c%h/o,d)}else u=null===s?new a(i.count*r):new a(s,c,i.count*r),p=new $n(u,r,d);if(void 0!==i.sparse){const t=iM.SCALAR,n=eM[i.sparse.indices.componentType],o=i.sparse.indices.byteOffset||0,l=i.sparse.values.byteOffset||0,c=new n(e[1],o,i.sparse.count*t),h=new a(e[2],l,i.sparse.count*r);null!==s&&(p=new $n(p.array.slice(),p.itemSize,p.normalized));for(let e=0,t=c.length;e<t;e++){const t=c[e];if(p.setX(t,h[e*r]),r>=2&&p.setY(t,h[e*r+1]),r>=3&&p.setZ(t,h[e*r+2]),r>=4&&p.setW(t,h[e*r+3]),r>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,n=this.options,i=t.textures[e].source,s=t.images[i];let r=this.textureLoader;if(s.uri){const e=n.manager.getHandler(s.uri);null!==e&&(r=e)}return this.loadTextureImage(e,i,r)}loadTextureImage(e,t,n){const i=this,s=this.json,r=s.textures[e],a=s.images[t],o=(a.uri||a.bufferView)+":"+r.sampler;if(this.textureCache[o])return this.textureCache[o];const l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,r.name&&(t.name=r.name);const n=(s.samplers||{})[r.sampler]||{};return t.magFilter=tM[n.magFilter]||M,t.minFilter=tM[n.minFilter]||C,t.wrapS=nM[n.wrapS]||y,t.wrapT=nM[n.wrapT]||y,i.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[o]=l,l}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const r=i.images[e],a=self.URL||self.webkitURL;let o=r.uri||"",l=!1;if(void 0!==r.bufferView)o=n.getDependency("bufferView",r.bufferView).then((function(e){l=!0;const t=new Blob([e],{type:r.mimeType});return o=a.createObjectURL(t),o}));else if(void 0===r.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(o).then((function(e){return new Promise((function(n,i){let r=n;!0===t.isImageBitmapLoader&&(r=function(e){const t=new Lt(e);t.needsUpdate=!0,n(t)}),t.load(wh.resolveURL(e,s.path),r,void 0,i)}))})).then((function(e){var t;return!0===l&&a.revokeObjectURL(o),e.userData.mimeType=r.mimeType||((t=r.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e}));return this.sourceCache[e]=c,c}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then((function(r){if(void 0===n.texCoord||0==n.texCoord||"aoMap"===t&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),s.extensions[wS.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[wS.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=s.associations.get(r);r=s.extensions[wS.KHR_TEXTURE_TRANSFORM].extendTexture(r,e),s.associations.set(r,t)}}return void 0!==i&&(r.encoding=i),e[t]=r,r}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=void 0===t.attributes.tangent,s=void 0!==t.attributes.color,r=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new Po,jn.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new Go,jn.prototype.copy.call(t,n),t.color.copy(n.color),this.cache.add(e,t)),n=t}if(i||s||r){let e="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),i&&(e+="derivative-tangents:"),s&&(e+="vertex-colors:"),r&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),s&&(t.vertexColors=!0),r&&(t.flatShading=!0),i&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return xc}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let r;const a={},o=s.extensions||{},l=[];if(o[wS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=i[wS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];r=e.getMaterialType(),l.push(e.extendParams(a,s,t))}else if(o[wS.KHR_MATERIALS_UNLIT]){const e=i[wS.KHR_MATERIALS_UNLIT];r=e.getMaterialType(),l.push(e.extendParams(a,s,t))}else{const n=s.pbrMetallicRoughness||{};if(a.color=new bt(1,1,1),a.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;a.color.fromArray(e),a.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(t.assignTexture(a,"map",n.baseColorTexture,Ee)),a.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,a.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(t.assignTexture(a,"metalnessMap",n.metallicRoughnessTexture)),l.push(t.assignTexture(a,"roughnessMap",n.metallicRoughnessTexture))),r=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)}))))}!0===s.doubleSided&&(a.side=2);const c=s.alphaMode||oM;if(c===cM?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,c===lM&&(a.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&r!==Jn&&(l.push(t.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new nt(1,1),void 0!==s.normalTexture.scale)){const e=s.normalTexture.scale;a.normalScale.set(e,e)}return void 0!==s.occlusionTexture&&r!==Jn&&(l.push(t.assignTexture(a,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(a.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&r!==Jn&&(a.emissive=(new bt).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&r!==Jn&&l.push(t.assignTexture(a,"emissiveMap",s.emissiveTexture,Ee)),Promise.all(l).then((function(){let n;return n=r===DS?i[wS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(a):new r(a),s.name&&(n.name=s.name),uM(n,s),t.associations.set(n,{materials:e}),s.extensions&&dM(i,n,s),n}))}createUniqueName(e){const t=rd.sanitizeNodeName(e||"");let n=t;for(let e=1;this.nodeNamesUsed[n];++e)n=t+"_"+e;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(e){return n[wS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return vM(n,e,t)}))}const r=[];for(let n=0,a=e.length;n<a;n++){const a=e[n],o=mM(a),l=i[o];if(l)r.push(l.promise);else{let e;e=a.extensions&&a.extensions[wS.KHR_DRACO_MESH_COMPRESSION]?s(a):vM(new yi,a,t),i[o]={primitive:a,promise:e},r.push(e)}}return Promise.all(r)}loadMesh(e){const t=this,n=this.json,i=this.extensions,s=n.meshes[e],r=s.primitives,a=[];for(let e=0,t=r.length;e<t;e++){const t=void 0===r[e].material?hM(this.cache):this.getDependency("material",r[e].material);a.push(t)}return a.push(t.loadGeometries(r)),Promise.all(a).then((function(n){const a=n.slice(0,n.length-1),o=n[n.length-1],l=[];for(let n=0,c=o.length;n<c;n++){const c=o[n],h=r[n];let d;const u=a[n];if(h.mode===QS||h.mode===qS||h.mode===$S||void 0===h.mode)d=!0===s.isSkinnedMesh?new mo(c,u):new Wi(c,u),!0!==d.isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),h.mode===qS?d.geometry=xM(d.geometry,1):h.mode===$S&&(d.geometry=xM(d.geometry,2));else if(h.mode===KS)d=new Wo(c,u);else if(h.mode===JS)d=new _o(c,u);else if(h.mode===jS)d=new Zo(c,u);else{if(h.mode!==YS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);d=new ko(c,u)}Object.keys(d.geometry.morphAttributes).length>0&&pM(d,s),d.name=t.createUniqueName(s.name||"mesh_"+e),uM(d,s),h.extensions&&dM(i,d,h),t.assignFinalMaterial(d),l.push(d)}for(let n=0,i=l.length;n<i;n++)t.associations.set(l[n],{meshes:e,primitives:n});if(1===l.length)return l[0];const c=new Ra;t.associations.set(c,{meshes:e});for(let e=0,t=l.length;e<t;e++)c.add(l[e]);return c}))}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(i)return"perspective"===n.type?t=new Bi(tt.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===n.type&&(t=new ps(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),uM(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return n.inverseBindMatrices=e,n}))}loadAnimation(e){const t=this.json.animations[e],n=[],i=[],s=[],r=[],a=[];for(let e=0,o=t.channels.length;e<o;e++){const o=t.channels[e],l=t.samplers[o.sampler],c=o.target,h=void 0!==c.node?c.node:c.id,d=void 0!==t.parameters?t.parameters[l.input]:l.input,u=void 0!==t.parameters?t.parameters[l.output]:l.output;n.push(this.getDependency("node",h)),i.push(this.getDependency("accessor",d)),s.push(this.getDependency("accessor",u)),r.push(l),a.push(c)}return Promise.all([Promise.all(n),Promise.all(i),Promise.all(s),Promise.all(r),Promise.all(a)]).then((function(n){const i=n[0],s=n[1],r=n[2],a=n[3],o=n[4],l=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],n=s[e],c=r[e],h=a[e],d=o[e];if(void 0===t)continue;let u;switch(t.updateMatrix(),t.matrixAutoUpdate=!0,rM[d.path]){case rM.weights:u=Zc;break;case rM.rotation:u=Nc;break;case rM.position:case rM.scale:default:u=Hc}const p=t.name?t.name:t.uuid,m=void 0!==h.interpolation?aM[h.interpolation]:Ge,f=[];rM[d.path]===rM.weights?t.traverse((function(e){e.morphTargetInfluences&&f.push(e.name?e.name:e.uuid)})):f.push(p);let g=c.array;if(c.normalized){const e=gM(g.constructor),t=new Float32Array(g.length);for(let n=0,i=g.length;n<i;n++)t[n]=g[n]*e;g=t}for(let e=0,t=f.length;e<t;e++){const t=new u(f[e]+"."+rM[d.path],n.array,g,m);"CUBICSPLINE"===h.interpolation&&(t.createInterpolant=function(e){return new(this instanceof Nc?OS:FS)(this.times,this.values,this.getValueSize()/3,e)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(t)}}const c=t.name?t.name:"animation_"+e;return new Dc(c,void 0,l)}))}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return void 0===i.mesh?null:n.getDependency("mesh",i.mesh).then((function(e){const t=n._getNodeRef(n.meshCache,i.mesh,e);return void 0!==i.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,n=i.weights.length;t<n;t++)e.morphTargetInfluences[t]=i.weights[t]})),t}))}loadNode(e){const t=this.json,n=this.extensions,i=this,s=t.nodes[e],r=s.name?i.createUniqueName(s.name):"";return function(){const t=[],n=i._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return n&&t.push(n),void 0!==s.camera&&t.push(i.getDependency("camera",s.camera).then((function(e){return i._getNodeRef(i.cameraCache,s.camera,e)}))),i._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){t.push(e)})),Promise.all(t)}().then((function(t){let a;if(a=!0===s.isBone?new fo:t.length>1?new Ra:1===t.length?t[0]:new Zn,a!==t[0])for(let e=0,n=t.length;e<n;e++)a.add(t[e]);if(s.name&&(a.userData.name=s.name,a.name=r),uM(a,s),s.extensions&&dM(n,a,s),void 0!==s.matrix){const e=new dn;e.fromArray(s.matrix),a.applyMatrix4(e)}else void 0!==s.translation&&a.position.fromArray(s.translation),void 0!==s.rotation&&a.quaternion.fromArray(s.rotation),void 0!==s.scale&&a.scale.fromArray(s.scale);return i.associations.has(a)||i.associations.set(a,{}),i.associations.get(a).nodes=e,a}))}loadScene(e){const t=this.json,n=this.extensions,i=this.json.scenes[e],s=this,r=new Ra;i.name&&(r.name=s.createUniqueName(i.name)),uM(r,i),i.extensions&&dM(n,r,i);const a=i.nodes||[],o=[];for(let e=0,n=a.length;e<n;e++)o.push(bM(a[e],r,t,s));return Promise.all(o).then((function(){return s.associations=(e=>{const t=new Map;for(const[e,n]of s.associations)(e instanceof jn||e instanceof Lt)&&t.set(e,n);return e.traverse((e=>{const n=s.associations.get(e);null!=n&&t.set(e,n)})),t})(r),r}))}}function bM(e,t,n,i){const s=n.nodes[e];return i.getDependency("node",e).then((function(e){if(void 0===s.skin)return e;let t;return i.getDependency("skin",s.skin).then((function(e){t=e;const n=[];for(let e=0,s=t.joints.length;e<s;e++)n.push(i.getDependency("node",t.joints[e]));return Promise.all(n)})).then((function(n){return e.traverse((function(e){if(!e.isMesh)return;const i=[],s=[];for(let e=0,r=n.length;e<r;e++){const r=n[e];if(r){i.push(r);const n=new dn;void 0!==t.inverseBindMatrices&&n.fromArray(t.inverseBindMatrices.array,16*e),s.push(n)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}e.bind(new vo(i,s),e.matrixWorld)})),e}))})).then((function(e){t.add(e);const r=[];if(s.children){const t=s.children;for(let s=0,a=t.length;s<a;s++){const a=t[s];r.push(bM(a,e,n,i))}}return Promise.all(r)}))}function vM(e,t,n){const i=t.attributes,s=[];function r(t,i){return n.getDependency("accessor",t).then((function(t){e.setAttribute(i,t)}))}for(const t in i){const n=sM[t]||t.toLowerCase();n in e.attributes||s.push(r(i[t],n))}if(void 0!==t.indices&&!e.index){const i=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));s.push(i)}return uM(e,t),function(e,t,n){const i=t.attributes,s=new Zt;if(void 0===i.POSITION)return;{const e=n.json.accessors[i.POSITION],t=e.min,r=e.max;if(void 0===t||void 0===r)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(s.set(new zt(t[0],t[1],t[2]),new zt(r[0],r[1],r[2])),e.normalized){const t=gM(eM[e.componentType]);s.min.multiplyScalar(t),s.max.multiplyScalar(t)}}const r=t.targets;if(void 0!==r){const e=new zt,t=new zt;for(let i=0,s=r.length;i<s;i++){const s=r[i];if(void 0!==s.POSITION){const i=n.json.accessors[s.POSITION],r=i.min,a=i.max;if(void 0!==r&&void 0!==a){if(t.setX(Math.max(Math.abs(r[0]),Math.abs(a[0]))),t.setY(Math.max(Math.abs(r[1]),Math.abs(a[1]))),t.setZ(Math.max(Math.abs(r[2]),Math.abs(a[2]))),i.normalized){const e=gM(eM[i.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(e)}e.boundingBox=s;const a=new tn;s.getCenter(a.center),a.radius=s.min.distanceTo(s.max)/2,e.boundingSphere=a}(e,t,n),Promise.all(s).then((function(){return void 0!==t.targets?function(e,t,n){let i=!1,s=!1,r=!1;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(void 0!==n.POSITION&&(i=!0),void 0!==n.NORMAL&&(s=!0),void 0!==n.COLOR_0&&(r=!0),i&&s&&r)break}if(!i&&!s&&!r)return Promise.resolve(e);const a=[],o=[],l=[];for(let c=0,h=t.length;c<h;c++){const h=t[c];if(i){const t=void 0!==h.POSITION?n.getDependency("accessor",h.POSITION):e.attributes.position;a.push(t)}if(s){const t=void 0!==h.NORMAL?n.getDependency("accessor",h.NORMAL):e.attributes.normal;o.push(t)}if(r){const t=void 0!==h.COLOR_0?n.getDependency("accessor",h.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(a),Promise.all(o),Promise.all(l)]).then((function(t){const n=t[0],a=t[1],o=t[2];return i&&(e.morphAttributes.position=n),s&&(e.morphAttributes.normal=a),r&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}function xM(e,t){let n=e.getIndex();if(null===n){const t=[],i=e.getAttribute("position");if(void 0===i)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<i.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const i=n.count-2,s=[];if(2===t)for(let e=1;e<=i;e++)s.push(n.getX(0)),s.push(n.getX(e)),s.push(n.getX(e+1));else for(let e=0;e<i;e++)e%2==0?(s.push(n.getX(e)),s.push(n.getX(e+1)),s.push(n.getX(e+2))):(s.push(n.getX(e+2)),s.push(n.getX(e+1)),s.push(n.getX(e)));s.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const r=e.clone();return r.setIndex(s),r}const wM=new WeakMap;class SM extends Oc{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,i){const s=new Kc(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(e=>{const n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(i)}),n,i)}decodeDracoFile(e,t,n,i){const s={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,s).then(t)}decodeGeometry(e,t){for(const e in t.attributeTypes){const n=t.attributeTypes[e];void 0!==n.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=n.name)}const n=JSON.stringify(t);if(wM.has(e)){const t=wM.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let i;const s=this.workerNextTaskID++,r=e.byteLength,a=this._getWorker(s,r).then((n=>(i=n,new Promise(((n,r)=>{i._callbacks[s]={resolve:n,reject:r},i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return a.catch((()=>!0)).then((()=>{i&&s&&this._releaseTask(i,s)})),wM.set(e,{key:n,promise:a}),a}_createGeometry(e){const t=new yi;e.index&&t.setIndex(new $n(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const i=e.attributes[n],s=i.name,r=i.array,a=i.itemSize;t.setAttribute(s,new $n(r,a))}return t}_loadLibrary(e,t){const n=new Kc(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise(((t,i)=>{n.load(e,t,void 0,i)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const i=MM.toString(),s=["/* draco decoder */",n,"","/* worker */",i.substring(i.indexOf("{")+1,i.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([s]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function MM(){let e,t;function n(e,t,n,i,s,r){const a=r.num_components(),o=n.num_points()*a,l=o*s.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,s),h=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,r,c,l,h);const d=new s(e.HEAPF32.buffer,h,o).slice();return e._free(h),{name:i,array:d,itemSize:a}}onmessage=function(i){const s=i.data;switch(s.type){case"init":e=s.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const i=s.buffer,r=s.taskConfig;t.then((e=>{const t=e.draco,a=new t.Decoder,o=new t.DecoderBuffer;o.Init(new Int8Array(i),i.byteLength);try{const e=function(e,t,i,s){const r=s.attributeIDs,a=s.attributeTypes;let o,l;const c=t.GetEncodedGeometryType(i);if(c===e.TRIANGULAR_MESH)o=new e.Mesh,l=t.DecodeBufferToMesh(i,o);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");o=new e.PointCloud,l=t.DecodeBufferToPointCloud(i,o)}if(!l.ok()||0===o.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const i in r){const l=self[a[i]];let c,d;if(s.useUniqueIDs)d=r[i],c=t.GetAttributeByUniqueId(o,d);else{if(d=t.GetAttributeId(o,e[r[i]]),-1===d)continue;c=t.GetAttribute(o,d)}h.attributes.push(n(e,t,o,i,l,c))}c===e.TRIANGULAR_MESH&&(h.index=function(e,t,n){const i=3*n.num_faces(),s=4*i,r=e._malloc(s);t.GetTrianglesUInt32Array(n,s,r);const a=new Uint32Array(e.HEAPF32.buffer,r,i).slice();return e._free(r),{array:a,itemSize:1}}(e,t,o));return e.destroy(o),h}(t,a,o,r),i=e.attributes.map((e=>e.array.buffer));e.index&&i.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},i)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(o),t.destroy(a)}}))}}}
|
|
33
|
-
/*!
|
|
34
|
-
localForage -- Offline Storage, Improved
|
|
35
|
-
Version 1.9.0
|
|
36
|
-
https://localforage.github.io/localForage
|
|
37
|
-
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
38
|
-
*/var LM=function(e){var t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){e.exports=function e(t,n,i){function s(a,o){if(!n[a]){if(!t[a]){if(!o&&zg)return zg(a);if(r)return r(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,(function(e){var n=t[a][1][e];return s(n||e)}),c,c.exports,e,t,n,i)}return n[a].exports}for(var r=zg,a=0;a<i.length;a++)s(i[a]);return s}({1:[function(e,t,n){(function(e){var n,i,s=e.MutationObserver||e.WebKitMutationObserver;if(s){var r=0,a=new s(h),o=e.document.createTextNode("");a.observe(o,{characterData:!0}),n=function(){o.data=r=++r%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){h(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(h,0)};else{var l=new e.MessageChannel;l.port1.onmessage=h,n=function(){l.port2.postMessage(0)}}var c=[];function h(){var e,t;i=!0;for(var n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}i=!1}function d(e){1!==c.push(e)||i||n()}t.exports=d}).call(this,void 0!==Ig?Ig:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){var i=e(1);function s(){}var r={},a=["REJECTED"],o=["FULFILLED"],l=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==s&&p(this,e)}function h(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){i((function(){var i;try{i=t(n)}catch(t){return r.reject(e,t)}i===e?r.reject(e,new TypeError("Cannot resolve promise with itself")):r.resolve(e,i)}))}function u(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function i(t){n||(n=!0,r.reject(e,t))}function s(t){n||(n=!0,r.resolve(e,t))}function a(){t(s,i)}var o=m(a);"error"===o.status&&i(o.value)}function m(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}function f(e){return e instanceof this?e:r.resolve(new this(s),e)}function g(e){var t=new this(s);return r.reject(t,e)}function y(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var a=new Array(n),o=0,l=-1,c=new this(s);++l<n;)h(e[l],l);return c;function h(e,s){function l(e){a[s]=e,++o!==n||i||(i=!0,r.resolve(c,a))}t.resolve(e).then(l,(function(e){i||(i=!0,r.reject(c,e))}))}}function b(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var a=-1,o=new this(s);++a<n;)l(e[a]);return o;function l(e){t.resolve(e).then((function(e){i||(i=!0,r.resolve(o,e))}),(function(e){i||(i=!0,r.reject(o,e))}))}}t.exports=c,c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===o||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(s);return this.state!==l?d(n,this.state===o?e:t,this.outcome):this.queue.push(new h(n,e,t)),n},h.prototype.callFulfilled=function(e){r.resolve(this.promise,e)},h.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},h.prototype.callRejected=function(e){r.reject(this.promise,e)},h.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},r.resolve=function(e,t){var n=m(u,t);if("error"===n.status)return r.reject(e,n.value);var i=n.value;if(i)p(e,i);else{e.state=o,e.outcome=t;for(var s=-1,a=e.queue.length;++s<a;)e.queue[s].callFulfilled(t)}return e},r.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,i=e.queue.length;++n<i;)e.queue[n].callRejected(t);return e},c.resolve=f,c.reject=g,c.all=y,c.race=b},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==Ig?Ig:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var a=r();function o(){try{if(!a||!a.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}function l(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(s){if("TypeError"!==s.name)throw s;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),i=0;i<e.length;i+=1)n.append(e[i]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var c=Promise;function h(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function d(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function p(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var m="local-forage-detect-blob-support",f=void 0,g={},y=Object.prototype.toString,b="readonly",v="readwrite";function x(e){for(var t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n),s=0;s<t;s++)i[s]=e.charCodeAt(s);return n}function w(e){return new c((function(t){var n=e.transaction(m,v),i=l([""]);n.objectStore(m).put(i,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}function S(e){return"boolean"==typeof f?c.resolve(f):w(e).then((function(e){return f=e}))}function M(e){var t=g[e.name],n={};n.promise=new c((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function L(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function C(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function G(e,t){return new c((function(n,i){if(g[e.name]=g[e.name]||Z(),e.db){if(!t)return n(e.db);M(e),e.db.close()}var s=[e.name];t&&s.push(e.version);var r=a.open.apply(a,s);t&&(r.onupgradeneeded=function(t){var n=r.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(m)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),r.onerror=function(e){e.preventDefault(),i(r.error)},r.onsuccess=function(){n(r.result),L(e)}}))}function T(e){return G(e,!1)}function R(e){return G(e,!0)}function A(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,s=e.version>e.db.version;if(i&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),s||n){if(n){var r=e.db.version+1;r>e.version&&(e.version=r)}return!0}return!1}function X(e){return new c((function(t,n){var i=new FileReader;i.onerror=n,i.onloadend=function(n){var i=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:i,type:e.type})},i.readAsBinaryString(e)}))}function I(e){return l([x(atob(e.data))],{type:e.type})}function _(e){return e&&e.__local_forage_encoded_blob}function z(e){var t=this,n=t._initReady().then((function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return d(n,e,e),n}function E(e){M(e);for(var t=g[e.name],n=t.forages,i=0;i<n.length;i++){var s=n[i];s._dbInfo.db&&(s._dbInfo.db.close(),s._dbInfo.db=null)}return e.db=null,T(e).then((function(t){return e.db=t,A(e)?R(e):t})).then((function(i){e.db=t.db=i;for(var s=0;s<n.length;s++)n[s]._dbInfo.db=i})).catch((function(t){throw C(e,t),t}))}function W(e,t,n,i){void 0===i&&(i=1);try{var s=e.db.transaction(e.storeName,t);n(null,s)}catch(s){if(i>0&&(!e.db||"InvalidStateError"===s.name||"NotFoundError"===s.name))return c.resolve().then((function(){if(!e.db||"NotFoundError"===s.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),R(e)})).then((function(){return E(e).then((function(){W(e,t,n,i-1)}))})).catch(n);n(s)}}function Z(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function P(e){var t=this,n={db:null};if(e)for(var i in e)n[i]=e[i];var s=g[n.name];s||(s=Z(),g[n.name]=s),s.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=z);var r=[];function a(){return c.resolve()}for(var o=0;o<s.forages.length;o++){var l=s.forages[o];l!==t&&r.push(l._initReady().catch(a))}var h=s.forages.slice(0);return c.all(r).then((function(){return n.db=s.db,T(n)})).then((function(e){return n.db=e,A(n,t._defaultConfig.version)?R(n):e})).then((function(e){n.db=s.db=e,t._dbInfo=n;for(var i=0;i<h.length;i++){var r=h[i];r!==t&&(r._dbInfo.db=n.db,r._dbInfo.version=n.version)}}))}function N(e,t){var n=this;e=u(e);var i=new c((function(t,i){n.ready().then((function(){W(n._dbInfo,b,(function(s,r){if(s)return i(s);try{var a=r.objectStore(n._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),_(e)&&(e=I(e)),t(e)},a.onerror=function(){i(a.error)}}catch(e){i(e)}}))})).catch(i)}));return h(i,t),i}function V(e,t){var n=this,i=new c((function(t,i){n.ready().then((function(){W(n._dbInfo,b,(function(s,r){if(s)return i(s);try{var a=r.objectStore(n._dbInfo.storeName).openCursor(),o=1;a.onsuccess=function(){var n=a.result;if(n){var i=n.value;_(i)&&(i=I(i));var s=e(i,n.key,o++);void 0!==s?t(s):n.continue()}else t()},a.onerror=function(){i(a.error)}}catch(e){i(e)}}))})).catch(i)}));return h(i,t),i}function H(e,t,n){var i=this;e=u(e);var s=new c((function(n,s){var r;i.ready().then((function(){return r=i._dbInfo,"[object Blob]"===y.call(t)?S(r.db).then((function(e){return e?t:X(t)})):t})).then((function(t){W(i._dbInfo,v,(function(r,a){if(r)return s(r);try{var o=a.objectStore(i._dbInfo.storeName);null===t&&(t=void 0);var l=o.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),n(t)},a.onabort=a.onerror=function(){var e=l.error?l.error:l.transaction.error;s(e)}}catch(e){s(e)}}))})).catch(s)}));return h(s,n),s}function D(e,t){var n=this;e=u(e);var i=new c((function(t,i){n.ready().then((function(){W(n._dbInfo,v,(function(s,r){if(s)return i(s);try{var a=r.objectStore(n._dbInfo.storeName).delete(e);r.oncomplete=function(){t()},r.onerror=function(){i(a.error)},r.onabort=function(){var e=a.error?a.error:a.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return h(i,t),i}function k(e){var t=this,n=new c((function(e,n){t.ready().then((function(){W(t._dbInfo,v,(function(i,s){if(i)return n(i);try{var r=s.objectStore(t._dbInfo.storeName).clear();s.oncomplete=function(){e()},s.onabort=s.onerror=function(){var e=r.error?r.error:r.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return h(n,e),n}function B(e){var t=this,n=new c((function(e,n){t.ready().then((function(){W(t._dbInfo,b,(function(i,s){if(i)return n(i);try{var r=s.objectStore(t._dbInfo.storeName).count();r.onsuccess=function(){e(r.result)},r.onerror=function(){n(r.error)}}catch(e){n(e)}}))})).catch(n)}));return h(n,e),n}function F(e,t){var n=this,i=new c((function(t,i){e<0?t(null):n.ready().then((function(){W(n._dbInfo,b,(function(s,r){if(s)return i(s);try{var a=r.objectStore(n._dbInfo.storeName),o=!1,l=a.openKeyCursor();l.onsuccess=function(){var n=l.result;n?0===e||o?t(n.key):(o=!0,n.advance(e)):t(null)},l.onerror=function(){i(l.error)}}catch(e){i(e)}}))})).catch(i)}));return h(i,t),i}function U(e){var t=this,n=new c((function(e,n){t.ready().then((function(){W(t._dbInfo,b,(function(i,s){if(i)return n(i);try{var r=s.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];r.onsuccess=function(){var t=r.result;t?(a.push(t.key),t.continue()):e(a)},r.onerror=function(){n(r.error)}}catch(e){n(e)}}))})).catch(n)}));return h(n,e),n}function O(e,t){t=p.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var i,s=this;if(e.name){var r=e.name===n.name&&s._dbInfo.db?c.resolve(s._dbInfo.db):T(e).then((function(t){var n=g[e.name],i=n.forages;n.db=t;for(var s=0;s<i.length;s++)i[s]._dbInfo.db=t;return t}));i=e.storeName?r.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;M(e);var i=g[e.name],s=i.forages;t.close();for(var r=0;r<s.length;r++){var o=s[r];o._dbInfo.db=null,o._dbInfo.version=n}return new c((function(t,i){var s=a.open(e.name,n);s.onerror=function(e){s.result.close(),i(e)},s.onupgradeneeded=function(){s.result.deleteObjectStore(e.storeName)},s.onsuccess=function(){var e=s.result;e.close(),t(e)}})).then((function(e){i.db=e;for(var t=0;t<s.length;t++){var n=s[t];n._dbInfo.db=e,L(n._dbInfo)}})).catch((function(t){throw(C(e,t)||c.resolve()).catch((function(){})),t}))}})):r.then((function(t){M(e);var n=g[e.name],i=n.forages;t.close();for(var s=0;s<i.length;s++)i[s]._dbInfo.db=null;return new c((function(t,n){var i=a.deleteDatabase(e.name);i.onerror=i.onblocked=function(e){var t=i.result;t&&t.close(),n(e)},i.onsuccess=function(){var e=i.result;e&&e.close(),t(e)}})).then((function(e){n.db=e;for(var t=0;t<i.length;t++)L(i[t]._dbInfo)})).catch((function(t){throw(C(e,t)||c.resolve()).catch((function(){})),t}))}))}else i=c.reject("Invalid arguments");return h(i,t),i}var Y={_driver:"asyncStorage",_initStorage:P,_support:o(),iterate:V,getItem:N,setItem:H,removeItem:D,clear:k,length:B,key:F,keys:U,dropInstance:O};function K(){return"function"==typeof openDatabase}var j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",J="~~local_forage_type~",Q=/^~~local_forage_type~([^~]+)~/,q="__lfsc__:",$=q.length,ee="arbf",te="blob",ne="si08",ie="ui08",se="uic8",re="si16",ae="si32",oe="ur16",le="ui32",ce="fl32",he="fl64",de=$+ee.length,ue=Object.prototype.toString;function pe(e){var t,n,i,s,r,a=.75*e.length,o=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),h=new Uint8Array(c);for(t=0;t<o;t+=4)n=j.indexOf(e[t]),i=j.indexOf(e[t+1]),s=j.indexOf(e[t+2]),r=j.indexOf(e[t+3]),h[l++]=n<<2|i>>4,h[l++]=(15&i)<<4|s>>2,h[l++]=(3&s)<<6|63&r;return c}function me(e){var t,n=new Uint8Array(e),i="";for(t=0;t<n.length;t+=3)i+=j[n[t]>>2],i+=j[(3&n[t])<<4|n[t+1]>>4],i+=j[(15&n[t+1])<<2|n[t+2]>>6],i+=j[63&n[t+2]];return n.length%3==2?i=i.substring(0,i.length-1)+"=":n.length%3==1&&(i=i.substring(0,i.length-2)+"=="),i}function fe(e,t){var n="";if(e&&(n=ue.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===ue.call(e.buffer))){var i,s=q;e instanceof ArrayBuffer?(i=e,s+=ee):(i=e.buffer,"[object Int8Array]"===n?s+=ne:"[object Uint8Array]"===n?s+=ie:"[object Uint8ClampedArray]"===n?s+=se:"[object Int16Array]"===n?s+=re:"[object Uint16Array]"===n?s+=oe:"[object Int32Array]"===n?s+=ae:"[object Uint32Array]"===n?s+=le:"[object Float32Array]"===n?s+=ce:"[object Float64Array]"===n?s+=he:t(new Error("Failed to get type for BinaryArray"))),t(s+me(i))}else if("[object Blob]"===n){var r=new FileReader;r.onload=function(){var n=J+e.type+"~"+me(this.result);t(q+te+n)},r.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}}function ge(e){if(e.substring(0,$)!==q)return JSON.parse(e);var t,n=e.substring(de),i=e.substring($,de);if(i===te&&Q.test(n)){var s=n.match(Q);t=s[1],n=n.substring(s[0].length)}var r=pe(n);switch(i){case ee:return r;case te:return l([r],{type:t});case ne:return new Int8Array(r);case ie:return new Uint8Array(r);case se:return new Uint8ClampedArray(r);case re:return new Int16Array(r);case oe:return new Uint16Array(r);case ae:return new Int32Array(r);case le:return new Uint32Array(r);case ce:return new Float32Array(r);case he:return new Float64Array(r);default:throw new Error("Unkown type: "+i)}}var ye={serialize:fe,deserialize:ge,stringToBuffer:pe,bufferToString:me};function be(e,t,n,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,i)}function ve(e){var t=this,n={db:null};if(e)for(var i in e)n[i]="string"!=typeof e[i]?e[i].toString():e[i];var s=new c((function(e,i){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return i(e)}n.db.transaction((function(s){be(s,n,(function(){t._dbInfo=n,e()}),(function(e,t){i(t)}))}),i)}));return n.serializer=ye,s}function xe(e,t,n,i,s,r){e.executeSql(n,i,s,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,o){o.rows.length?r(e,a):be(e,t,(function(){e.executeSql(n,i,s,r)}),r)}),r):r(e,a)}),r)}function we(e,t){var n=this;e=u(e);var i=new c((function(t,i){n.ready().then((function(){var s=n._dbInfo;s.db.transaction((function(n){xe(n,s,"SELECT * FROM "+s.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var i=n.rows.length?n.rows.item(0).value:null;i&&(i=s.serializer.deserialize(i)),t(i)}),(function(e,t){i(t)}))}))})).catch(i)}));return h(i,t),i}function Se(e,t){var n=this,i=new c((function(t,i){n.ready().then((function(){var s=n._dbInfo;s.db.transaction((function(n){xe(n,s,"SELECT * FROM "+s.storeName,[],(function(n,i){for(var r=i.rows,a=r.length,o=0;o<a;o++){var l=r.item(o),c=l.value;if(c&&(c=s.serializer.deserialize(c)),void 0!==(c=e(c,l.key,o+1)))return void t(c)}t()}),(function(e,t){i(t)}))}))})).catch(i)}));return h(i,t),i}function Me(e,t,n,i){var s=this;e=u(e);var r=new c((function(r,a){s.ready().then((function(){void 0===t&&(t=null);var o=t,l=s._dbInfo;l.serializer.serialize(t,(function(t,c){c?a(c):l.db.transaction((function(n){xe(n,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){r(o)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(i>0)return void r(Me.apply(s,[e,o,n,i-1]));a(t)}}))}))})).catch(a)}));return h(r,n),r}function Le(e,t,n){return Me.apply(this,[e,t,n,1])}function Ce(e,t){var n=this;e=u(e);var i=new c((function(t,i){n.ready().then((function(){var s=n._dbInfo;s.db.transaction((function(n){xe(n,s,"DELETE FROM "+s.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){i(t)}))}))})).catch(i)}));return h(i,t),i}function Ge(e){var t=this,n=new c((function(e,n){t.ready().then((function(){var i=t._dbInfo;i.db.transaction((function(t){xe(t,i,"DELETE FROM "+i.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return h(n,e),n}function Te(e){var t=this,n=new c((function(e,n){t.ready().then((function(){var i=t._dbInfo;i.db.transaction((function(t){xe(t,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],(function(t,n){var i=n.rows.item(0).c;e(i)}),(function(e,t){n(t)}))}))})).catch(n)}));return h(n,e),n}function Re(e,t){var n=this,i=new c((function(t,i){n.ready().then((function(){var s=n._dbInfo;s.db.transaction((function(n){xe(n,s,"SELECT key FROM "+s.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var i=n.rows.length?n.rows.item(0).key:null;t(i)}),(function(e,t){i(t)}))}))})).catch(i)}));return h(i,t),i}function Ae(e){var t=this,n=new c((function(e,n){t.ready().then((function(){var i=t._dbInfo;i.db.transaction((function(t){xe(t,i,"SELECT key FROM "+i.storeName,[],(function(t,n){for(var i=[],s=0;s<n.rows.length;s++)i.push(n.rows.item(s).key);e(i)}),(function(e,t){n(t)}))}))})).catch(n)}));return h(n,e),n}function Xe(e){return new c((function(t,n){e.transaction((function(i){i.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,i){for(var s=[],r=0;r<i.rows.length;r++)s.push(i.rows.item(r).name);t({db:e,storeNames:s})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}function Ie(e,t){t=p.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var i,s=this;return h(i=e.name?new c((function(t){var i;i=e.name===n.name?s._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:i,storeNames:[e.storeName]}):t(Xe(i))})).then((function(e){return new c((function(t,n){e.db.transaction((function(i){function s(e){return new c((function(t,n){i.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var r=[],a=0,o=e.storeNames.length;a<o;a++)r.push(s(e.storeNames[a]));c.all(r).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):c.reject("Invalid arguments"),t),i}var _e={_driver:"webSQLStorage",_initStorage:ve,_support:K(),iterate:Se,getItem:we,setItem:Le,removeItem:Ce,clear:Ge,length:Te,key:Re,keys:Ae,dropInstance:Ie};function ze(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}function Ee(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function We(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}function Ze(){return!We()||localStorage.length>0}function Pe(e){var t=this,n={};if(e)for(var i in e)n[i]=e[i];return n.keyPrefix=Ee(e,t._defaultConfig),Ze()?(t._dbInfo=n,n.serializer=ye,c.resolve()):c.reject()}function Ne(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);0===i.indexOf(e)&&localStorage.removeItem(i)}}));return h(n,e),n}function Ve(e,t){var n=this;e=u(e);var i=n.ready().then((function(){var t=n._dbInfo,i=localStorage.getItem(t.keyPrefix+e);return i&&(i=t.serializer.deserialize(i)),i}));return h(i,t),i}function He(e,t){var n=this,i=n.ready().then((function(){for(var t=n._dbInfo,i=t.keyPrefix,s=i.length,r=localStorage.length,a=1,o=0;o<r;o++){var l=localStorage.key(o);if(0===l.indexOf(i)){var c=localStorage.getItem(l);if(c&&(c=t.serializer.deserialize(c)),void 0!==(c=e(c,l.substring(s),a++)))return c}}}));return h(i,t),i}function De(e,t){var n=this,i=n.ready().then((function(){var t,i=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(i.keyPrefix.length)),t}));return h(i,t),i}function ke(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,i=[],s=0;s<n;s++){var r=localStorage.key(s);0===r.indexOf(e.keyPrefix)&&i.push(r.substring(e.keyPrefix.length))}return i}));return h(n,e),n}function Be(e){var t=this.keys().then((function(e){return e.length}));return h(t,e),t}function Fe(e,t){var n=this;e=u(e);var i=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return h(i,t),i}function Ue(e,t,n){var i=this;e=u(e);var s=i.ready().then((function(){void 0===t&&(t=null);var n=t;return new c((function(s,r){var a=i._dbInfo;a.serializer.serialize(t,(function(t,i){if(i)r(i);else try{localStorage.setItem(a.keyPrefix+e,t),s(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||r(e),r(e)}}))}))}));return h(s,n),s}function Oe(e,t){if(t=p.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var i,s=this;return h(i=e.name?new c((function(t){e.storeName?t(Ee(e,s._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):c.reject("Invalid arguments"),t),i}var Ye={_driver:"localStorageWrapper",_initStorage:Pe,_support:ze(),iterate:He,getItem:Ve,setItem:Ue,removeItem:Fe,clear:Ne,length:Be,key:De,keys:ke,dropInstance:Oe},Ke=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},je=function(e,t){for(var n=e.length,i=0;i<n;){if(Ke(e[i],t))return!0;i++}return!1},Je=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Qe={},qe={},$e={INDEXEDDB:Y,WEBSQL:_e,LOCALSTORAGE:Ye},et=[$e.INDEXEDDB._driver,$e.WEBSQL._driver,$e.LOCALSTORAGE._driver],tt=["dropInstance"],nt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tt),it={description:"",driver:et.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function st(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function rt(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(Je(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var at=new(function(){function e(t){for(var n in s(this,e),$e)if($e.hasOwnProperty(n)){var i=$e[n],r=i._driver;this[n]=r,Qe[r]||this.defineDriver(i)}this._defaultConfig=rt({},it),this._config=rt({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":i(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var i=new c((function(t,n){try{var i=e._driver,s=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(s);for(var r=nt.concat("_initStorage"),a=0,o=r.length;a<o;a++){var l=r[a];if((!je(tt,l)||e[l])&&"function"!=typeof e[l])return void n(s)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=c.reject(t);return h(n,arguments[arguments.length-1]),n}},n=0,i=tt.length;n<i;n++){var s=tt[n];e[s]||(e[s]=t(s))}}();var d=function(n){Qe[i]&&console.info("Redefining LocalForage driver: "+i),Qe[i]=e,qe[i]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}}));return d(i,t,n),i},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var i=Qe[e]?c.resolve(Qe[e]):c.reject(new Error("Driver not found."));return d(i,t,n),i},e.prototype.getSerializer=function(e){var t=c.resolve(ye);return d(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return d(n,e,e),n},e.prototype.setDriver=function(e,t,n){var i=this;Je(e)||(e=[e]);var s=this._getSupportedDrivers(e);function r(){i._config.driver=i.driver()}function a(e){return i._extend(e),r(),i._ready=i._initStorage(i._config),i._ready}function o(e){return function(){var t=0;function n(){for(;t<e.length;){var s=e[t];return t++,i._dbInfo=null,i._ready=null,i.getDriver(s).then(a).catch(n)}r();var o=new Error("No available storage method found.");return i._driverSet=c.reject(o),i._driverSet}return n()}}var l=null!==this._driverSet?this._driverSet.catch((function(){return c.resolve()})):c.resolve();return this._driverSet=l.then((function(){var e=s[0];return i._dbInfo=null,i._ready=null,i.getDriver(e).then((function(e){i._driver=e._driver,r(),i._wrapLibraryMethodsWithReady(),i._initDriver=o(s)}))})).catch((function(){r();var e=new Error("No available storage method found.");return i._driverSet=c.reject(e),i._driverSet})),d(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!qe[e]},e.prototype._extend=function(e){rt(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,i=e.length;n<i;n++){var s=e[n];this.supports(s)&&t.push(s)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=nt.length;e<t;e++)st(this,nt[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=at},{3:3}]},{},[4])(4)}));class CM{constructor(e){this.name="EXT_mesh_gpu_instancing",this.parser=e}createNodeMesh(e){const t=this.parser.json.nodes[e];if(!t.extensions||!t.extensions[this.name]||void 0===t.mesh)return null;const n=t.extensions[this.name].attributes,i=[],s={};for(const e in n)i.push(this.parser.getDependency("accessor",n[e]).then((t=>(s[e]=t,s[e]))));return i.length<1?null:(i.push(this.parser.createNodeMesh(e)),Promise.all(i).then((e=>{const t=e.pop(),n=t.isGroup?t.children:[t],i=e[0].count,r=[];for(const e of n){const t=e.matrix.clone(),n=e.position.clone().set(0,0,0),a=e.quaternion.clone().set(0,0,0,1),o=e.scale.clone().set(1,1,1),l=new Co(e.geometry,e.material,i);for(let e=0;e<i;e++)s.TRANSLATION&&n.fromBufferAttribute(s.TRANSLATION,e),s.ROTATION&&a.fromBufferAttribute(s.ROTATION,e),s.SCALE&&o.fromBufferAttribute(s.SCALE,e),l.setMatrixAt(e,t.compose(n,a,o));for(const t in s)"TRANSLATION"!==t&&"ROTATION"!==t&&"SCALE"!==t&&e.geometry.setAttribute(t,s[t]);Zn.prototype.copy.call(l,e),l.frustumCulled=!1,this.parser.assignFinalMaterial(l),r.push(l)}if(t.isGroup){for(;t.children.length>0;)t.remove(t.children[0]);for(const e of r)t.add(e);return t}return r[0]})))}}const GM=()=>{self.noCompressWorker=function(e,t){const[n]=new Uint32Array(e,t,1),i={byteOffset:t+=4,length:3*n},s={byteOffset:t+=3*n*4,length:2*n},r={byteOffset:t+=2*n*4,length:4*n},a={byteOffset:t+=4*n*1,length:3*n};t+=3*n*1;let o=(r.length+a.length)%4;o>0&&(o=4-o,t+=o);const l=new Uint32Array(e,t,1);t+=4;const[c]=l,h={byteOffset:t,length:c};t+=4*c;const d=new Uint32Array(e,t,1);t+=4;const[u]=d,p=[];if(u>0)for(let n=0;n<u;n++){const[n]=new Uint32Array(e,t,1);t+=4;const[i]=new Uint32Array(e,t,1);t+=4;const[s]=new Uint32Array(e,t,1);t+=4;const[r]=new Uint32Array(e,t,1);t+=4;const a=new Uint8Array(e,t,r);t+=r;const o=(new TextDecoder).decode(a);p.push({start:n,count:i,uuid:o,alphaMode:s})}return{buffer:e,position:i,normal:a,color:r,texcoord:s,indice:h,sub_mesh:p}}},TM=()=>{self.gzipCompressWorker=function(e){const t=new Uint8Array(e,4,e.byteLength-4),n=new pako.Inflate;n.push(t,!0);const{result:i}=n;if(i instanceof Uint8Array){const{buffer:e}=i;let t=0;const[n]=new Uint32Array(e,t,1);t+=4;const s={byteOffset:t,length:3*n};t+=3*n*4;const r={byteOffset:t,length:2*n};t+=2*n*4;const a={byteOffset:t,length:4*n};t+=4*n*1;const o={byteOffset:t,length:3*n};t+=3*n*1;let l=(a.length+o.length)%4;l>0&&(l=4-l,t+=l);const c=new Uint32Array(e,t,1);t+=4;const[h]=c,d={byteOffset:t,length:h};t+=4*h;const u=new Uint32Array(e,t,1);t+=4;const[p]=u,m=[];if(p>0)for(let n=0;n<p;n++){const[n]=new Uint32Array(e,t,1);t+=4;const[i]=new Uint32Array(e,t,1);t+=4;const[s]=new Uint32Array(e,t,1);t+=4;const[r]=new Uint32Array(e,t,1);t+=4;const a=new Uint8Array(e,t,r);t+=r;const o=(new TextDecoder).decode(a);m.push({start:n,count:i,uuid:o,alphaMode:s})}return{buffer:e,position:s,normal:o,color:a,texcoord:r,indice:d,sub_mesh:m}}}},RM=()=>{self.parseChunkWorker=function(e){let t=0;const n=new Int8Array(e,t,128);t+=128,(new TextDecoder).decode(n.slice(0,4));const[i]=n.slice(4,8);if(0===i)return self.noCompressWorker(e,t);if(1===i){const t=e.slice(128);return self.gzipCompressWorker(t)}throw new Error("unknown compress mode [ .sbmx model ]")}},AM="\n onmessage = function ( e ) {\n \n const message = e.data\n\n switch ( message.type ) {\n\n case 'decode': {\n\n const chunkInfo = self.parseChunkWorker( message.data )\n\n if ( chunkInfo ) { \n\n self.postMessage( \n { type: 'decode', data: chunkInfo, }, \n [ chunkInfo.buffer ]\n )\n\n } else {\n\n self.postMessage( { type: 'decode', data: {}, } )\n\n }\n\n break\n \n }\n \n }\n\n }\n\n",XM="textureIndex.json";class IM extends Oc{constructor(e){super(),this.store=e,this.loadedTextures=new Map,this.loadedMaterialsMap=new Map,this.defaultMaterial=new xc({name:"defaultDatMaterial",color:0}),this.loadedMaterials=[this.defaultMaterial],this.dracoDecoderPath=null,this.workerPool=new yg(4),this.workerSourceURL="",this.imageBitmaps=new Set;const t=this._initWorkerCreator();this.workerPool.setWorkerCreator(t)}parseAsync(e,t){return Wp(this,void 0,void 0,(function*(){const[n]=yield Promise.allSettled([this._decodeBuffer(e,t),this._createMaterial(t)]);if("fulfilled"===n.status&&n.value){const e=Ap(t),i=this._createMesh(n.value,e),s=new Ra;return s.add(i),s}}))}_decodeBuffer(e,t){return Wp(this,void 0,void 0,(function*(){const n=yield this.store.getItem(`${t}_object`);if(n)return n;const[{data:i}]=yield Promise.all([this.workerPool.postMessage({type:"decode",data:e},[e])]);if(i){const{type:e,data:n}=null!=i?i:{};if("decode"===e&&n){const{buffer:{byteLength:e}}=n;return Am(e)&&e/1024/1024<=500&&Bp((()=>{this.store.setItem(`${t}_object`,n)})),n}}}))}_initWorkerCreator(){if(!this.workerSourceURL){const e=GM.toString(),t=TM.toString(),n=RM.toString(),i=["/* dat decoder */",["/* pako */","\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.pako = {}));\n}(this, (function (exports) { 'use strict';\n\n // Note: adler32 takes 12% for level 0 and 2% for level 6.\n // It isn't worth it to make additional optimizations as in original.\n // Small size is preferable.\n\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express ofr implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n\n const adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n };\n\n\n var adler32_1 = adler32;\n\n // Note: we can't get significant speed boost here.\n // So write code to minimize size - no pregenerated tables\n // and array tools dependencies.\n\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n\n // Use ordinary array, since untyped makes no boost here\n const makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n };\n\n // Create table on load. Just 255 signed longs. Not a problem.\n const crcTable = new Uint32Array(makeTable());\n\n\n const crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n };\n\n\n var crc32_1 = crc32;\n\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n\n // See state defs from inflate.js\n const BAD$1 = 30; /* got a data error -- remain here until reset */\n const TYPE$1 = 12; /* i: waiting for type bits, including last-flag bit */\n\n /*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\n var inffast = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n //#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n //#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n let input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n //#ifdef INFLATE_STRICT\n dmax = state.dmax;\n //#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\" :\n // \"inflate: literal 0x%02x\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n //#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD$1;\n break top;\n }\n //#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD$1;\n break top;\n }\n\n // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n // if (len <= op - whave) {\n // do {\n // output[_out++] = 0;\n // } while (--len);\n // continue top;\n // }\n // len -= op - whave;\n // do {\n // output[_out++] = 0;\n // } while (--op > whave);\n // if (op === 0) {\n // from = _out - dist;\n // do {\n // output[_out++] = output[from++];\n // } while (--len);\n // continue top;\n // }\n //#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD$1;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\"));\n state.mode = TYPE$1;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD$1;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n };\n\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n\n const MAXBITS = 15;\n const ENOUGH_LENS$1 = 852;\n const ENOUGH_DISTS$1 = 592;\n //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\n const CODES$1 = 0;\n const LENS$1 = 1;\n const DISTS$1 = 2;\n\n const lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n ]);\n\n const lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n ]);\n\n const dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n ]);\n\n const dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n ]);\n\n const inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n {\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n let base_index = 0;\n // let shoextra; /* extra bits table to use */\n let end; /* use base and extra for symbol > end */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n let extra_index = 0;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES$1 || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES$1) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS$1) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS$1 && used > ENOUGH_LENS$1) ||\n (type === DISTS$1 && used > ENOUGH_DISTS$1)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS$1 && used > ENOUGH_LENS$1) ||\n (type === DISTS$1 && used > ENOUGH_DISTS$1)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n };\n\n\n var inftrees = inflate_table;\n\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n\n var constants$1 = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n };\n\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n\n\n\n\n\n\n const CODES = 0;\n const LENS = 1;\n const DISTS = 2;\n\n /* Public constants ==========================================================*/\n /* ===========================================================================*/\n\n const {\n Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES,\n Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR,\n Z_DEFLATED\n } = constants$1;\n\n\n /* STATES ====================================================================*/\n /* ===========================================================================*/\n\n\n const HEAD = 1; /* i: waiting for magic header */\n const FLAGS = 2; /* i: waiting for method and flags (gzip) */\n const TIME = 3; /* i: waiting for modification time (gzip) */\n const OS = 4; /* i: waiting for extra flags and operating system (gzip) */\n const EXLEN = 5; /* i: waiting for extra length (gzip) */\n const EXTRA = 6; /* i: waiting for extra bytes (gzip) */\n const NAME = 7; /* i: waiting for end of file name (gzip) */\n const COMMENT = 8; /* i: waiting for end of comment (gzip) */\n const HCRC = 9; /* i: waiting for header crc (gzip) */\n const DICTID = 10; /* i: waiting for dictionary check value */\n const DICT = 11; /* waiting for inflateSetDictionary() call */\n const TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n const TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\n const STORED = 14; /* i: waiting for stored size (length and complement) */\n const COPY_ = 15; /* i/o: same as COPY below, but only first time in */\n const COPY = 16; /* i/o: waiting for input or output to copy stored block */\n const TABLE = 17; /* i: waiting for dynamic block table lengths */\n const LENLENS = 18; /* i: waiting for code length code lengths */\n const CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\n const LEN_ = 20; /* i: same as LEN below, but only first time in */\n const LEN = 21; /* i: waiting for length/lit/eob code */\n const LENEXT = 22; /* i: waiting for length extra bits */\n const DIST = 23; /* i: waiting for distance code */\n const DISTEXT = 24; /* i: waiting for distance extra bits */\n const MATCH = 25; /* o: waiting for output space to copy string */\n const LIT = 26; /* o: waiting for output space to write literal */\n const CHECK = 27; /* i: waiting for 32-bit check value */\n const LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\n const DONE = 29; /* finished check, done -- remain here until reset */\n const BAD = 30; /* got a data error -- remain here until reset */\n const MEM = 31; /* got an inflate() memory error -- remain here until reset */\n const SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n /* ===========================================================================*/\n\n\n\n const ENOUGH_LENS = 852;\n const ENOUGH_DISTS = 592;\n //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\n const MAX_WBITS = 15;\n /* 32K LZ77 window */\n const DEF_WBITS = MAX_WBITS;\n\n\n const zswap32 = (q) => {\n\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n };\n\n\n function InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new Uint16Array(320); /* temporary storage for code lengths */\n this.work = new Uint16Array(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new Int32Array(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n }\n\n\n const inflateResetKeep = (strm) => {\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);\n state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\"));\n return Z_OK$1;\n };\n\n\n const inflateReset = (strm) => {\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n };\n\n\n const inflateReset2 = (strm, windowBits) => {\n let wrap;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR$1;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n };\n\n\n const inflateInit2 = (strm, windowBits) => {\n\n if (!strm) { return Z_STREAM_ERROR$1; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n const state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n const ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK$1) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n };\n\n\n const inflateInit = (strm) => {\n\n return inflateInit2(strm, DEF_WBITS);\n };\n\n\n /*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\n let virgin = true;\n\n let lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\n\n const fixedtables = (state) => {\n\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n lenfix = new Int32Array(512);\n distfix = new Int32Array(32);\n\n /* literal/length table */\n let sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inftrees(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inftrees(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n };\n\n\n /*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\n const updatewindow = (strm, src, end, copy) => {\n\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new Uint8Array(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n state.window.set(src.subarray(end - state.wsize, end), 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n state.window.set(src.subarray(end - copy, end), 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n };\n\n\n const inflate$1 = (strm, flush) => {\n\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //let last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary variable for NEED_BITS\n\n const order = /* permutation of code lengths */\n new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR$1;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK$1;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n // !!! pako patch. Force use `options.windowBits` if passed.\n // Required to always use max window size by default.\n state.dmax = 1 << state.wbits;\n //state.dmax = 1 << len;\n\n //Tracev((stderr, \"inflate: zlib header ok\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32_1(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32_1(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Uint8Array(state.head.extra_len);\n }\n state.head.extra.set(\n input.subarray(\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n next + copy\n ),\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32_1(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT$1;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n output.set(input.subarray(next, next + copy), put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n //#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n //#endif\n //Tracev((stderr, \"inflate: table sizes ok\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inftrees(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inftrees(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inftrees(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inffast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\" :\n // \"inflate: literal 0x%02x\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n //#endif\n //Tracevv((stderr, \"inflate: distance %u\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n // (!) This block is disabled in zlib defaults,\n // don't enable it for binary compatibility\n //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n // Trace((stderr, \"inflate.c too far\"));\n // copy -= state.whave;\n // if (copy > state.length) { copy = state.length; }\n // if (copy > left) { copy = left; }\n // left -= copy;\n // state.length -= copy;\n // do {\n // output[put++] = 0;\n // } while (--copy);\n // if (state.length === 0) { state.mode = LEN; }\n // break;\n //#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32_1(state.check, output, _out, put - _out) : adler32_1(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END$1;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR$1;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR$1;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR$1;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH$1))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ;\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32_1(state.check, output, _out, strm.next_out - _out) : adler32_1(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n };\n\n\n const inflateEnd = (strm) => {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR$1;\n }\n\n let state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK$1;\n };\n\n\n const inflateGetHeader = (strm, head) => {\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR$1; }\n const state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR$1; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK$1;\n };\n\n\n const inflateSetDictionary = (strm, dictionary) => {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR$1; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR$1;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32_1(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR$1;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR$1;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\"));\n return Z_OK$1;\n };\n\n\n var inflateReset_1 = inflateReset;\n var inflateReset2_1 = inflateReset2;\n var inflateResetKeep_1 = inflateResetKeep;\n var inflateInit_1 = inflateInit;\n var inflateInit2_1 = inflateInit2;\n var inflate_2$1 = inflate$1;\n var inflateEnd_1 = inflateEnd;\n var inflateGetHeader_1 = inflateGetHeader;\n var inflateSetDictionary_1 = inflateSetDictionary;\n var inflateInfo = 'pako inflate (from Nodeca project)';\n\n /* Not implemented\n module.exports.inflateCopy = inflateCopy;\n module.exports.inflateGetDictionary = inflateGetDictionary;\n module.exports.inflateMark = inflateMark;\n module.exports.inflatePrime = inflatePrime;\n module.exports.inflateSync = inflateSync;\n module.exports.inflateSyncPoint = inflateSyncPoint;\n module.exports.inflateUndermine = inflateUndermine;\n */\n\n var inflate_1$1 = {\n \tinflateReset: inflateReset_1,\n \tinflateReset2: inflateReset2_1,\n \tinflateResetKeep: inflateResetKeep_1,\n \tinflateInit: inflateInit_1,\n \tinflateInit2: inflateInit2_1,\n \tinflate: inflate_2$1,\n \tinflateEnd: inflateEnd_1,\n \tinflateGetHeader: inflateGetHeader_1,\n \tinflateSetDictionary: inflateSetDictionary_1,\n \tinflateInfo: inflateInfo\n };\n\n const _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n };\n\n var assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n };\n\n\n // Join array of chunks to single array.\n var flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n };\n\n var common = {\n \tassign: assign,\n \tflattenChunks: flattenChunks\n };\n\n // String encode/decode helpers\n\n\n // Quick check if we can use fast array to bin string conversion\n //\n // - apply(Array) can fail on Android 2.2\n // - apply(Uint8Array) can fail on iOS 5.1 Safari\n //\n let STR_APPLY_UIA_OK = true;\n\n try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n // Table with utf8 lengths (calculated by first byte of sequence)\n // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n // because max possible codepoint is 0x10ffff\n const _utf8len = new Uint8Array(256);\n for (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n }\n _utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n // convert string to array (typed, when possible)\n var string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n };\n\n // Helper\n const buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n };\n\n\n // convert array to string\n var buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n };\n\n\n // Calculate max possible position in utf8 buffer,\n // that will not break sequence. If that's not possible\n // - (very small limits) return max size as is.\n //\n // buf[] - utf8 bytes array\n // max - length limit (mandatory);\n var utf8border = (buf, max) => {\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n let pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n };\n\n var strings = {\n \tstring2buf: string2buf,\n \tbuf2string: buf2string,\n \tutf8border: utf8border\n };\n\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n\n var messages = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n };\n\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n\n function ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n }\n\n var zstream = ZStream;\n\n // (C) 1995-2013 Jean-loup Gailly and Mark Adler\n // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n //\n // This software is provided 'as-is', without any express or implied\n // warranty. In no event will the authors be held liable for any damages\n // arising from the use of this software.\n //\n // Permission is granted to anyone to use this software for any purpose,\n // including commercial applications, and to alter it and redistribute it\n // freely, subject to the following restrictions:\n //\n // 1. The origin of this software must not be misrepresented; you must not\n // claim that you wrote the original software. If you use this software\n // in a product, an acknowledgment in the product documentation would be\n // appreciated but is not required.\n // 2. Altered source versions must be plainly marked as such, and must not be\n // misrepresented as being the original software.\n // 3. This notice may not be removed or altered from any source distribution.\n\n function GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n }\n\n var gzheader = GZheader;\n\n const toString = Object.prototype.toString;\n\n /* Public constants ==========================================================*/\n /* ===========================================================================*/\n\n const {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n } = constants$1;\n\n /* ===========================================================================*/\n\n\n /**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n /* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n /**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n /**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n /**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n /**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\n function Inflate(options) {\n this.options = common.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new zstream();\n this.strm.avail_out = 0;\n\n let status = inflate_1$1.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== Z_OK) {\n throw new Error(messages[status]);\n }\n\n this.header = new gzheader();\n\n inflate_1$1.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = inflate_1$1.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== Z_OK) {\n throw new Error(messages[status]);\n }\n }\n }\n }\n\n /**\n * Inflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer): input data\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE\n * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,\n * `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. If end of stream detected,\n * [[Inflate#onEnd]] will be called.\n *\n * `flush_mode` is not needed for normal operation, because end of stream\n * detected automatically. You may try to use it for advanced things, but\n * this functionality was not tested.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\n Inflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n const dictionary = this.options.dictionary;\n let status, _flush_mode, last_avail_out;\n\n if (this.ended) return false;\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = inflate_1$1.inflate(strm, _flush_mode);\n\n if (status === Z_NEED_DICT && dictionary) {\n status = inflate_1$1.inflateSetDictionary(strm, dictionary);\n\n if (status === Z_OK) {\n status = inflate_1$1.inflate(strm, _flush_mode);\n } else if (status === Z_DATA_ERROR) {\n // Replace code with more verbose\n status = Z_NEED_DICT;\n }\n }\n\n // Skip snyc markers if more data follows and not raw mode\n while (strm.avail_in > 0 &&\n status === Z_STREAM_END &&\n strm.state.wrap > 0 &&\n data[strm.next_in] !== 0)\n {\n inflate_1$1.inflateReset(strm);\n status = inflate_1$1.inflate(strm, _flush_mode);\n }\n\n switch (status) {\n case Z_STREAM_ERROR:\n case Z_DATA_ERROR:\n case Z_NEED_DICT:\n case Z_MEM_ERROR:\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n // Remember real `avail_out` value, because we may patch out buffer content\n // to align utf8 strings boundaries.\n last_avail_out = strm.avail_out;\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === Z_STREAM_END) {\n\n if (this.options.to === 'string') {\n\n let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n let tail = strm.next_out - next_out_utf8;\n let utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail & realign counters\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);\n\n this.onData(utf8str);\n\n } else {\n this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));\n }\n }\n }\n\n // Must repeat iteration if out buffer is full\n if (status === Z_OK && last_avail_out === 0) continue;\n\n // Finalize if end of stream reached.\n if (status === Z_STREAM_END) {\n status = inflate_1$1.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return true;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n };\n\n\n /**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|String): output data. When string output requested,\n * each chunk will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\n Inflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n };\n\n\n /**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\n Inflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = common.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n };\n\n\n /**\n * inflate(data[, options]) -> Uint8Array|String\n * - data (Uint8Array): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako');\n * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));\n * let output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err) {\n * console.log(err);\n * }\n * ```\n **/\n function inflate(input, options) {\n const inflator = new Inflate(options);\n\n inflator.push(input);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) throw inflator.msg || messages[inflator.err];\n\n return inflator.result;\n }\n\n\n /**\n * inflateRaw(data[, options]) -> Uint8Array|String\n * - data (Uint8Array): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\n function inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n }\n\n\n /**\n * ungzip(data[, options]) -> Uint8Array|String\n * - data (Uint8Array): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\n var Inflate_1 = Inflate;\n var inflate_2 = inflate;\n var inflateRaw_1 = inflateRaw;\n var ungzip = inflate;\n var constants = constants$1;\n\n var inflate_1 = {\n \tInflate: Inflate_1,\n \tinflate: inflate_2,\n \tinflateRaw: inflateRaw_1,\n \tungzip: ungzip,\n \tconstants: constants\n };\n\n exports.Inflate = Inflate_1;\n exports.constants = constants;\n exports['default'] = inflate_1;\n exports.inflate = inflate_2;\n exports.inflateRaw = inflateRaw_1;\n exports.ungzip = ungzip;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n","/* noCompress */",e.substring(e.indexOf("{")+1,e.lastIndexOf("}")),"/* gzipCompress */",t.substring(t.indexOf("{")+1,t.lastIndexOf("}")),"/* parseChunk */",n.substring(n.indexOf("{")+1,n.lastIndexOf("}"))].join("\n"),"","/* worker */",AM].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))}return()=>new Worker(this.workerSourceURL)}_createMesh(e,t){const{buffer:n,position:i,normal:s,texcoord:r,indice:a,sub_mesh:o}=e,l=new Uint32Array(n,a.byteOffset,a.length),c=new Float32Array(n,i.byteOffset,i.length),h=new Int8Array(n,s.byteOffset,s.length),d=new Float32Array(n,r.byteOffset,r.length),u=new yi;u.setIndex(new $n(l,1)),u.setAttribute("position",new $n(c,3)),u.setAttribute("normal",new $n(h,3,!0)),u.setAttribute("uv",new $n(d,2));for(let e=0;e<o.length;e++){const{uuid:n,start:i,count:s}=o[e],r=this.loadedMaterialsMap.get(n);if(r){const{materialIndex:e}=r;u.addGroup(i,s,e)}else u.addGroup(i,s,0),console.warn(`sbmx material: not found uuid: ${n} in file: ${t+XM}`)}Lg.generate(u).then((e=>{u.boundsTree=e}));const p=new Wi(u,this.loadedMaterials);return p.castShadow=!0,p.receiveShadow=!0,p}_createMaterial(e){return Wp(this,void 0,void 0,(function*(){const t=Ap(e),n=t+XM,i=this.loadedTextures.get(n);if(i)return i;const s=yield this.store.getItem(`${e}_texture`);let r;if(s)r=s,this.loadedTextures.set(n,Promise.resolve(r));else{const t=this.loadedTextures.get(n);if(t)return t;const i=kp(n).then((e=>e.json()));this.loadedTextures.set(n,i),r=yield i,Bp((()=>{this.store.setItem(`${e}_texture`,r)}))}Object.entries(r).forEach((([e,n])=>{if(this.loadedMaterialsMap.has(e))return;const{name:i,base_map:s,nor_map:r,alphamode:a,color:o={r:1,g:1,b:1,a:1},metallic:l=.5,roughness:c=.5}=n,{r:h,g:d,b:u,a:p}=o,m=0!==a,f=new xc({name:i,color:new bt(h,d,u),side:0,metalness:l,roughness:c,opacity:p,transparent:m,depthWrite:!m});if(s){const e=t+s;(new Rh).setOptions({imageOrientation:"flipY"}).load(e,(e=>{this.imageBitmaps.add(e);const t=new Yo(e);t.encoding=Ee,t.wrapS=y,t.wrapT=y,t.minFilter=G,t.magFilter=M,t.needsUpdate=!0,f.map=t,f.needsUpdate=!0,nv.needsUpdate=!0}))}if(r){const e=t+r;(new Rh).setOptions({imageOrientation:"flipY"}).load(e,(e=>{this.imageBitmaps.add(e);const t=new Yo(e);t.encoding=Ee,t.wrapS=y,t.wrapT=y,t.needsUpdate=!0,f.normalMap=t,f.needsUpdate=!0,nv.needsUpdate=!0}))}const g=this.loadedMaterials.push(f)-1;this.loadedMaterialsMap.set(e,{material:f,materialIndex:g})}))}))}dispose(){this.workerPool.dispose(),URL.revokeObjectURL(this.workerSourceURL),this.imageBitmaps.clear()}}const _M=new Map,zM=e=>{if(_M.has(e))return _M.get(e);const t=new Lt;return _M.set(e,t),(new Qc).load(e,(e=>{t.image=e,t.needsUpdate=!0,nv.needsUpdate=!0})),t.encoding=Ee,t.wrapS=y,t.wrapT=y,t.flipY=!1,t.anisotropy=16,t.mipmaps=[],t.generateMipmaps=!0,t},EM=(e,t,n)=>{const[i,s,r,a,o]=t,l=a<1;return new xc({name:e,color:new bt(i,s,r),opacity:a,transparent:l,depthWrite:!l,alphaTest:.01,map:n,side:o})};class WM extends DataView{constructor(e,t){super(e),this.isLE=!0,this.appKeys=t}byteRevers(e,t){const n=t%this.appKeys.length;return e^this.appKeys[n]}getSoonUint8(e){return this.byteRevers(this.getUint8(e),e)}getSoonUint16(e){const t=new DataView(new Uint8Array(2).buffer);for(let n=0;n<2;n++)t.setUint8(n,this.getSoonUint8(e+n));return t.getUint16(0,this.isLE)}getSoonUint32(e){const t=new DataView(new Uint8Array(4).buffer);for(let n=0;n<4;n++)t.setUint8(n,this.getSoonUint8(e+n));return t.getUint32(0,this.isLE)}getSoonFloat32(e){const t=new DataView(new Uint8Array(4).buffer);for(let n=0;n<4;n++)t.setUint8(n,this.getSoonUint8(e+n));return t.getFloat32(0,this.isLE)}}class ZM{constructor(){this.materials=new Map}parseObject(e,t){const n=new pv(Object.assign(Object.assign({},t),{format:"sbm"})),i=new cv({id:Wm()});n.add(i);const{materialsCache:s,meshsCache:r}=e;for(const[e,t]of Object.entries(s)){if(this.materials.has(e))continue;const{textureUrl:n,materialInfo:i}=t;let s=null;n&&(s=zM(n));const r=EM(e,i,s);this.materials.set(e,r)}for(const[e,t]of Object.entries(r)){const{materialId:n,position:s,uv:r}=t,a=this.materials.get(n.toString());if(a){const t=new yi,n=new Float32Array(s),o=new Float32Array(r);n.length>0&&t.setAttribute("position",new $n(n,3)),o.length>0&&t.setAttribute("uv",new $n(o,2)),t.computeVertexNormals(),Lg.generate(t).then((e=>{t.boundsTree=e}));const l=new av(t,a,{id:`${e}_${Wm()}`,name:e});i.add(l)}}return n}}var PM=class{constructor(){this.materials=new Map,this.sbmInfo=null}parseBuffer(e,t,n){return Wp(this,void 0,void 0,(function*(){this.sbmInfo=t;const i=new DataView(e);let s=0;const r=[];for(let e=0;e<8;e++)r.push(i.getUint8(s)),s+=1;if("SBK-----"!==String.fromCharCode(...r))return Promise.reject(`In soonspacejs: sbm 资源模型(${this.sbmInfo.url})格式或数据错误!`);const a=[],o=[],l=[];for(let e=0;e<32;e++)a.push(i.getUint8(s)),s+=1;const c=i.getUint8(s);s+=1;const h=i.getUint8(s);s+=1;for(let e=0;e<32;e++)o.push(i.getUint8(s)),s+=1;for(let e=0;e<64;e++)l.push(i.getUint8(s)),s+=1;const d=[...o,...l,...a],u=[];for(let e=0;e<d.length;e++)(e<=7||e>23&&e<=31||e>39&&e<=55||e>63&&e<=87||e>95&&e<=103)&&u.push(d[e]);if(64!==u.length)return Promise.reject(`In soonspacejs: sbm 资源模型(${this.sbmInfo.url} 数据错误!`);if(1===c){const e=i.buffer.slice(s,i.buffer.byteLength),t=new WM(e,u);return 1===h||2===h?this._parseV2(t,n):3===h?this._parseV3(t,n):Promise.reject(`In soonspacejs: sbm 资源模型(${this.sbmInfo.url})版本错误!`)}return Promise.reject(`In soonspacejs: sbm 资源模型(${this.sbmInfo.url})key 错误!`)}))}_parseV2(e,t){let n=0;const i=performance.now();n+=66;const s={total:0,loaded:0,timeStamp:0};if(!this.sbmInfo)return Promise.reject("In soonspacejs: sbm 模型资源解析时 'sbmInfo' 缺失!");const r=new pv(Object.assign(Object.assign({},this.sbmInfo),{format:"sbm"})),a=new cv({id:Wm()});r.add(a);const o=e.getSoonUint16(n);n+=2;const l=e.getSoonUint16(n);n+=2,s.total=l;const c={};for(let t=0;t<o;++t){const t=e.getSoonUint16(n).toString();n+=2,c[t]={materialInfo:[]},n+=4,n+=4,n+=4,n+=4;const i=e.getSoonFloat32(n);n+=4;const s=e.getSoonFloat32(n);n+=4;const r=e.getSoonFloat32(n);n+=4;const a=e.getSoonFloat32(n);n+=4,n+=4,n+=4,n+=4,n+=4;let o=e.getSoonUint8(n);n+=1,0===o?o=0:1===o?o=1:2===o&&(o=2);const l=e.getSoonUint16(n);n+=2;let h=null;if(l>0){let i="",s="";for(let t=0;t<l;t++){const t=e.getSoonUint8(n);t>127?s=s+"%"+t.toString(16).toUpperCase():s.length>0?(i+=decodeURIComponent(s)+String.fromCharCode(t),s=""):i+=String.fromCharCode(t),n+=1}i=i.replace("\\","/");const{url:r,isPlatform:a}=this.sbmInfo,o=this.getTextureUrl(r,i,a);c[t].textureUrl=o,h=zM(o)}if(!this.materials.has(t)){const e=[i,s,r,a,o],n=EM(t,e,h);this.materials.set(t,n),c[t].materialInfo=e}}const h={};for(let r=0;r<l;++r){const r=e.getSoonUint16(n);n+=2;const o=e.getSoonUint16(n).toString();n+=2,h[r]={materialId:o,position:new ArrayBuffer(0),uv:new ArrayBuffer(0)};const l=[],c=[],d=[],u=[],p=e.getSoonUint16(n);if(n+=2,p>0)for(let t=0;t<p;t++){const t=new zt;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,t.setZ(e.getSoonFloat32(n)),n+=4,l.push(t)}const m=e.getSoonUint16(n);if(n+=2,m>0)for(let t=0;t<m;t++){const t=new zt;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,t.setZ(e.getSoonFloat32(n)),n+=4}const f=e.getSoonUint16(n);if(n+=2,f>0)for(let t=0;t<f;t++){const t=new nt;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,c.push(t)}const g=e.getSoonUint16(n);if(n+=2,g>0)for(let t=0;t<g;t++){const t=e.getSoonUint16(n);n+=2;const i=e.getSoonUint16(n);n+=2;const s=e.getSoonUint16(n);n+=2;const r=[t,i,s];d.push(r),c.length>0&&u.push([c[r[0]],c[r[1]],c[r[2]]])}const y=[],b=[];for(let e=0;e<d.length;e++){const t=d[e],n=l[t[0]],i=l[t[1]],s=l[t[2]];y.push(...n.toArray(),...i.toArray(),...s.toArray());let r=new nt,a=new nt,o=new nt;const c=u[e];void 0!==c&&(r=c[0],a=c[1],o=c[2]),b.push(...r.toArray(),...a.toArray(),...o.toArray())}const v=new Float32Array(y),x=new Float32Array(b);h[r].position=v.buffer,h[r].uv=x.buffer;const w=new yi;v.length>0&&w.setAttribute("position",new $n(v,3)),x.length>0&&w.setAttribute("uv",new $n(x,2)),w.computeVertexNormals(),Lg.generate(w).then((e=>{w.boundsTree=e}));const S=this.materials.get(o);if(S){const e=new av(w,S,{id:`${r}_${Wm()}`,name:r.toString()});a.add(e)}s.loaded++,s.timeStamp=performance.now()-i,null==t||t(s)}const d={materialsCache:c,meshsCache:h};return Promise.resolve({model:r,caches:d})}_parseV3(e,t){let n=0;n+=66;const i=performance.now(),s={total:0,loaded:0,timeStamp:0};if(!this.sbmInfo)return Promise.reject("In soonspacejs: sbm 模型资源解析时 'sbmInfo' 缺失!");const r=new pv(Object.assign(Object.assign({},this.sbmInfo),{format:"sbm"})),a=new cv({id:Wm()});r.add(a);const o=e.getSoonUint16(n);n+=2;const l=e.getSoonUint16(n);n+=2,s.total=l;const c={};for(let t=0;t<o;++t){const t=e.getSoonUint16(n).toString();n+=2,c[t]={materialInfo:[]},n+=4,n+=4,n+=4,n+=4;const i=e.getSoonFloat32(n);n+=4;const s=e.getSoonFloat32(n);n+=4;const r=e.getSoonFloat32(n);n+=4;const a=e.getSoonFloat32(n);n+=4,n+=4,n+=4,n+=4,n+=4;let o=e.getSoonUint8(n);n+=1,0===o?o=0:1===o?o=1:2===o&&(o=2);const l=e.getSoonUint16(n);n+=2;let h=null;if(l>0){let i="",s="";for(let t=0;t<l;t++){const t=e.getSoonUint8(n);t>127?s=s+"%"+t.toString(16).toUpperCase():s.length>0?(i+=decodeURIComponent(s)+String.fromCharCode(t),s=""):i+=String.fromCharCode(t),n+=1}i=i.replace("\\","/");const{url:r,isPlatform:a}=this.sbmInfo,o=this.getTextureUrl(r,i,a);c[t].textureUrl=o,h=zM(o)}if(!this.materials.has(t)){const e=[i,s,r,a,o],n=EM(t,e,h);this.materials.set(t,n),c[t].materialInfo=e}}const h={};for(let r=0;r<l;++r){const r=e.getSoonUint16(n).toString();n+=2;const o=e.getSoonUint16(n);if(n+=2,o>0){let t="";for(let i=0;i<o;i++){const i=e.getUint8(n);i>127?t=t+"%"+i.toString(16).toUpperCase():t.length>0&&(t=""),n+=1}}const l=e.getSoonUint16(n).toString();n+=2,h[r]={materialId:l,position:new ArrayBuffer(0),uv:new ArrayBuffer(0)};const c=[],d=[],u=[],p=[],m=e.getSoonUint32(n);if(n+=4,m>0)for(let t=0;t<m;t++){const t=new zt;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,t.setZ(e.getSoonFloat32(n)),n+=4,c.push(t)}const f=e.getSoonUint32(n);if(n+=4,f>0)for(let t=0;t<f;t++){const t=new zt;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,t.setZ(e.getSoonFloat32(n)),n+=4}const g=e.getSoonUint32(n);if(n+=4,g>0)for(let t=0;t<g;t++){const t=new nt;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,d.push(t)}const y=e.getSoonUint32(n);if(n+=4,y>0)for(let t=0;t<y;t++){const t=e.getSoonUint32(n);n+=4;const i=e.getSoonUint32(n);n+=4;const s=e.getSoonUint32(n);n+=4;const r=[t,i,s];u.push(r),d.length>0&&p.push([d[r[0]],d[r[1]],d[r[2]]])}const b=[],v=[];for(let e=0;e<u.length;e++){const t=u[e],n=c[t[0]],i=c[t[1]],s=c[t[2]];b.push(...n.toArray(),...i.toArray(),...s.toArray());let r=new nt,a=new nt,o=new nt;const l=p[e];void 0!==l&&(r=l[0],a=l[1],o=l[2]),v.push(...r.toArray(),...a.toArray(),...o.toArray())}const x=new Float32Array(b),w=new Float32Array(v);h[r].position=x.buffer,h[r].uv=w.buffer;const S=new yi;if(x.length>0&&S.setAttribute("position",new $n(x,3)),w.length>0&&S.setAttribute("uv",new $n(w,2)),S.computeVertexNormals(),Lg.generate(S).then((e=>{S.boundsTree=e})),this.materials.has(l)){const e=new av(S,this.materials.get(l),{id:`${r}_${Wm()}`,name:r});a.add(e)}s.loaded++,s.timeStamp=performance.now()-i,null==t||t(s)}const d={materialsCache:c,meshsCache:h};return Promise.resolve({model:r,caches:d})}getTextureUrl(e,t,n){let i="",s=t;const r=s.lastIndexOf("/");if(-1!==r&&(s=s.substring(r+1)),i=e,n){const e=i.split("/");e.length>1&&(e.splice(e.length-3,e.length),i=e.join("/")+"/Maps/"+s)}else{const e=i.lastIndexOf("/");-1!==e&&(i=i.substring(0,e+1)+"Maps/"+s)}return i}};class NM extends Av{constructor(e,t){super("Model",e,t),this.viewport=e,this.modelsPromiseMap=new Map,this.modelsMap=new Map,this.store=LM.createInstance({name:"soonspace",storeName:"modelData"}),this.cacheStore=LM.createInstance({name:"soonspace",storeName:"modelCache"}),this.loadingManager=new Fc,this.datLoader=new IM(this.cacheStore),this.gltfLoader=new vS(this.loadingManager),this.fbxLoader=new $w(this.loadingManager),this.dracoDecoderPath=null,this.gltfLoader.register((e=>new CM(e))),this._initLoadingManager(this.loadingManager)}setDracoDecoderPath(e){this.dracoDecoderPath=e;const t=new SM;t.setDecoderPath(e),this.gltfLoader.setDRACOLoader(t),this.datLoader.dracoDecoderPath=e}load(e,t=this.scene){return Wp(this,void 0,void 0,(function*(){const{url:n}=e,i=this.modelsPromiseMap.get(n);if(i){yield i;const s=this.modelsMap.get(n);return s?this.clone(s,e,t):null}const s=this._innerLoad(e,t);return this.modelsPromiseMap.set(n,s),s}))}parse(e){return Wp(this,void 0,void 0,(function*(){const{url:t,id:n}=e;if(!t)return gp(`id: ${n} url: ${t} is empty`),null;switch(t.slice(t.lastIndexOf(".")+1).toLocaleUpperCase()){case"SBM":return this._parseSbm(e);case"SBMX":return this._parseSbmx(e);case"DAT":return this._parseDat(e);case"GLB":case"GLTF":return this._parseGltf(e);case"FBX":return this._parseFbx(e);default:return gp(`模型资源( id: ${n}, url: ${t} )格式错误,当前格式支持 sbm、sbmx、fbx、gltf、glb !`),null}}))}clone(e,t,n){return new Promise(((i,s)=>{var r;"Model"!==e.stype&&s("In soonspacejs: 方法 cloneModel 参入对象类型错误!");const{id:a,name:o,level:l,visible:c,position:h,rotation:d,scale:u,onClick:p,onDblClick:m,onRightClick:f,onLoad:g,userData:y}=t;function b(e,t,n){n(e,t);for(let i=0;i<e.children.length;i++)b(e.children[i],t.children[i],n)}const v=function(e){const t=new Map,n=new Map,i=e.sClone();return b(e,i,(function(e,i){t.set(i,e),n.set(e,i)})),i.traverse((function(e){if(e instanceof mo){const i=e,s=t.get(e),r=s.skeleton.bones;i.skeleton=s.skeleton.clone(),i.bindMatrix.copy(s.bindMatrix),i.skeleton.bones=r.map((function(e){return n.get(e)})),i.bind(i.skeleton,i.bindMatrix)}})),i}(e);v.animations=v.animations.map((e=>e.clone())),a&&(v.sid=a),o&&(v.name=o),l&&(v.level=l),!1===c&&v.hide(),h&&v.position.set(h.x,h.y,h.z),d&&v.rotation.set(d.x,d.y,d.z),u&&v.scale.set(u.x,u.y,u.z),v.onClick=p?p.bind(v):null,v.onDblClick=m?m.bind(v):null,v.onRightClick=f?f.bind(v):null,v.onLoad=g?g.bind(v):null,null===(r=v.onLoad)||void 0===r||r.call(v,v),y&&(v.userData=y),null!==n&&this.viewport.scener.addObject(v,n||this.scene||e.parent),i(v)}))}loadToGroup(e,t){return Wp(this,void 0,void 0,(function*(){const n=this.createGroup(e,null);return yield Promise.allSettled(t.map((e=>this.load(e,null).then((e=>e&&n.add(e))).catch(console.error)))),this.viewport.scener.addObject(n,this.scene),n}))}addForGroup(e,t){return Wp(this,void 0,void 0,(function*(){return e&&(yield Promise.allSettled(t.map((t=>Wp(this,void 0,void 0,(function*(){return this.load(t,null).then((t=>t&&this.viewport.scener.addObject(t,e))).catch(console.error)})))))),e}))}clearIdb(){return Wp(this,void 0,void 0,(function*(){yield this.store.clear(),yield this.cacheStore.clear()}))}dispose(){var e;this.modelsPromiseMap.clear(),this.modelsMap.clear(),null===(e=this.gltfLoader.dracoLoader)||void 0===e||e.dispose(),this.datLoader.dispose()}_initLoadingManager(e){e.addHandler(/\.tga$/i,new bS)}_setModelsMap(e,t){if(!this.modelsMap.has(e)){const n=t.sClone();this.modelsMap.set(e,n)}}_parseSbm(e){return Wp(this,void 0,void 0,(function*(){const{useIndexedDB:t}=this.viewport.options,{url:n}=e,i=t=>Wp(this,void 0,void 0,(function*(){const i=yield(new PM).parseBuffer(t,e),{model:s,caches:r}=i;return r&&Bp((()=>{this.cacheStore.setItem(n,r)})),s})),s=e=>{var t;null===(t=e.onLoad)||void 0===t||t.call(e,e)};if(t){const t=yield this.cacheStore.getItem(n);if(t){const n=(new ZM).parseObject(t,e);return s(n),n}{const e=(yield this.store.getItem(n))||(yield this._fetchBuffer(n)),t=yield i(e);return s(t),t}}{const e=yield this._fetchBuffer(n),t=yield i(e);return s(t),t}}))}_parseSbmx(e){return Wp(this,void 0,void 0,(function*(){const{url:t}=e,n=yield this._getBuffer(t),i=Em(n,0,8),s=new DataView(n.slice(8));switch(i){case"SBMG----":for(let e=0;e<s.byteLength;e++){const t=s.getUint8(e),n=(t>>4&15)+(t<<4&240);s.setUint8(e,n)}return this._parseGltf(e,s.buffer);case"SBMD----":return this._parseDat(e,s.buffer);default:return this._parseGltf(e,s.buffer)}}))}_parseDat(e,t){return Wp(this,void 0,void 0,(function*(){const{url:n}=e,i=t||(yield this._getBuffer(n)),s=new pv(Object.assign(Object.assign({},e),{format:"dat"})),r=yield this.datLoader.parseAsync(i,n);return r&&s.add(r),s}))}_parseGltf(e,t){return Wp(this,void 0,void 0,(function*(){const{url:n}=e,i=Ap(n),s=t||(yield this._getBuffer(n)),r=new pv(Object.assign(Object.assign({},e),{format:"gltf"})),a=yield this.gltfLoader.parseAsync(s,i),{animations:o}=a;return o&&o.length>0&&(r.animations=o),a.scene.traverse((e=>{"AmbientLight"!==e.type&&"DirectionalLight"!==e.type||(e.visible=!1),e.castShadow=!0,e.receiveShadow=!0,e instanceof Wi&&Lg.generate(e.geometry).then((t=>{e.geometry.boundsTree=t}))})),r.add(a.scene),r}))}_parseFbx(e){return Wp(this,void 0,void 0,(function*(){const{url:t}=e,n=Ap(t),i=yield this._getBuffer(t),s=new pv(Object.assign(Object.assign({},e),{format:"gltf"})),r=this.fbxLoader.parse(i,n),{animations:a}=r;return a&&a.length>0&&(s.animations=a),r.traverse((e=>{"AmbientLight"!==e.type&&"DirectionalLight"!==e.type||(e.visible=!1),e.castShadow=!0,e.receiveShadow=!0,e instanceof Wi&&Lg.generate(e.geometry).then((t=>{e.geometry.boundsTree=t}))})),s.add(r),s}))}_innerLoad(e,t=this.scene){var n;return Wp(this,void 0,void 0,(function*(){const{url:i}=e,s=this.modelsMap.get(i);if(s)return this.clone(s,e,t);{const s=yield this.parse(e);return s?(null===(n=s.onLoad)||void 0===n||n.call(s,s),this._setModelsMap(i,s),null!==t&&this.viewport.scener.addObject(s,t),s):null}}))}_fetchBuffer(e){return Wp(this,void 0,void 0,(function*(){const{useIndexedDB:t}=this.viewport.options,n=yield kp(e),i=yield n.arrayBuffer();return t&&this.store.setItem(e,i),i}))}_getBuffer(e){return Wp(this,void 0,void 0,(function*(){const{useIndexedDB:t}=this.viewport.options;if(t){const t=yield this.store.getItem(e);return t||this._fetchBuffer(e)}return this._fetchBuffer(e)}))}}class VM extends Av{constructor(e,t){super("Poi",e,t),this.materials=new Map}create(e){const t=this._createMaterial(e.url),n=new gv(t,e);return this.viewport.scener.addObject(n,this.scene),n}clone(e,t,n){"Poi"!==e.stype&&console.error("In soonspacejs: 方法 clonePoi 参入对象类型错误!");const{id:i,name:s,level:r,visible:a,position:o,rotation:l,scale:c,onClick:h,onDblClick:d,onRightClick:u,userData:p}=t,m=e.sClone(!1);return this._copyMaterial(m),i&&(m.sid=i),s&&(m.name=s),r&&(m.level=r),Rm(a)&&(m.visible=a),o&&m.position.set(o.x,o.y,o.z),l&&m.rotation.set(l.x,l.y,l.z),c&&m.scale.set(c.x,c.y,c.z),m.onClick=h?h.bind(m):null,m.onDblClick=d?d.bind(m):null,m.onRightClick=u?u.bind(m):null,p&&(m.userData=p),null!==n&&this.viewport.scener.addObject(m,n||this.scene||e.parent),m}createToGroup(e,t){const n=this.createGroup(e,null);return t.forEach((e=>{const t=this._createMaterial(e.url),i=new gv(t,e);n.add(i)})),this.viewport.scener.addObject(n,this.scene),n}addForGroup(e,t){return e&&(t.forEach((t=>{const n=this._createMaterial(t.url),i=new gv(n,t);e.add(i)})),this.viewport.scener.addObject(e,this.scene)),e}_createMaterial(e){const t=this.materials.get(e);if(!t){const t=(new eh).load(e);t.flipY=!0;const n=new Ba({map:t,color:16777215});return this.materials.set(e,n),n}return t}_copyMaterial(e){e.traverse((e=>{(e instanceof Wi||e instanceof io)&&(Xm(e.material)?e.material=e.material.map((e=>e.clone())):e.material instanceof jn&&(e.material=e.material.clone()))}))}}class HM extends Av{constructor(e,t){super("PoiNode",e,t)}create(e){this._openEnableRenderCss(e);const t=new dv(e);return this.viewport.scener.addObject(t,this.scene),t}createToGroup(e,t){const n=this.createGroup(e,null);return t.forEach((e=>{this._openEnableRenderCss(e);const t=new dv(e);n.add(t)})),this.viewport.scener.addObject(n,this.scene),n}addForGroup(e,t){return e&&(t.forEach((t=>{this._openEnableRenderCss(t);const n=new dv(t);e.add(n)})),this.viewport.scener.addObject(e,this.scene)),e}_openEnableRenderCss(e){switch(e.type){case"2d":case"2D":this.viewport.rendererManager.setInternalState("enableRenderCss2D",!0);break;case"2.5d":case"2.5D":this.viewport.rendererManager.setInternalState("enableRenderCss2DHalf",!0);break;case"3d":case"3D":this.viewport.rendererManager.setInternalState("enableRenderCss3D",!0)}}}class DM extends Av{constructor(e,t){super("Canvas3D",e,t)}create(e){const t=new Gv(e);return this.viewport.scener.addObject(t,this.scene),t}createToGroup(e,t){const n=this.createGroup(e,null);return t.forEach((e=>{const t=new Gv(e);n.add(t)})),this.viewport.scener.addObject(n,this.scene),n}addForGroup(e,t){return e&&(t.forEach((t=>{const n=new Gv(t);e.add(n)})),this.viewport.scener.addObject(e,this.scene)),e}}var kM=function(){function e(){}return e.prototype.toJson=function(e,t){var n=this.xmlStringToXmlDom(e),i=this.xmlToJson(n);return t?(t.removeLineBreaks&&this.removeLineBreaks(i),t.removeComments&&this.removeCommentProperties(i),t.transformTextOnly&&this.transformTextOnly(i),i):i},e.prototype.xmlStringToXmlDom=function(e){return(new DOMParser).parseFromString(e,"text/xml")},e.prototype.removeLineBreaks=function(e){var t=this;Object.keys(e).forEach((function(n,i){"#text"===n&&Array.isArray(e[n])&&delete e[n],"object"==typeof e[n]&&t.removeLineBreaks(e[n])}))},e.prototype.removeCommentProperties=function(e){var t=this;Object.keys(e).forEach((function(n,i){"#comment"===n&&delete e[n],"object"==typeof e[n]&&t.removeCommentProperties(e[n])}))},e.prototype.transformTextOnly=function(e){var t=this;Object.keys(e).forEach((function(n,i){var s=Object.keys(e[n]).length>1,r=Object.keys(e[n])[0];s||"object"==typeof e[n][r]?t.transformTextOnly(e[n]):"object"==typeof e[n]&&e[n]["#text"]&&(e[n]=e[n]["#text"])}))},e.prototype.xmlToJson=function(e){var t={};if(1==e.nodeType){if(e.attributes.length>0){t._attributes={};for(var n=0;n<e.attributes.length;n++){var i=e.attributes.item(n);t._attributes[i.nodeName]=i.nodeValue}}}else 3==e.nodeType&&(t=e.nodeValue);if(e.hasChildNodes())for(var s=0;s<e.childNodes.length;s++){var r=e.childNodes.item(s),a=r.nodeName;if(void 0===t[a])t[a]=this.xmlToJson(r);else{if(void 0===t[a].push){var o=t[a];t[a]=[],t[a].push(o)}t[a].push(this.xmlToJson(r))}}return t},e}();function BM(e){return kp(e).then((e=>e.text())).then((e=>Promise.resolve(function(e){return(new kM).toJson(e,{transformTextOnly:!0,removeComments:!0,removeLineBreaks:!0})}(e))))}class FM{constructor(){this.graph=[],this.queue=null,this.distance=[],this.previous=[]}setGraph(e){if(!(e.length<1))for(let t=0;t<e.length;t++){const n=e[t],i=n[0],s=n[1];this.graph[i]=[];for(let e=0;e<s.length;e++){const t=s[e],n=t[0],r=t[1];this.graph[i][n]=r}}}getPath(e,t){if(e===t)return[];let n;for(this.queue=new Gp,this.queue.add(e,0),this.previous[e]=null;n=this.queue.shift();){if(n===t){const e=[];for(;Am(n)&&null!==this.previous[n];)e.unshift(n),n=this.previous[n];return e}const e=this.queue.getDistance(n);if(e===1/0)return[];for(const t in this.graph[n]){const i=this.queue.getDistance(Number(t)),s=e+this.graph[n][t];s<i&&(this.queue.update(Number(t),s),this.previous[t]=n)}}return[]}}class UM extends Av{constructor(e,t){super("Topology",e,t),this.dijkstra=new FM}createFromGml(e){return Wp(this,void 0,void 0,(function*(){const{url:t,linkWidth:n=20,linkColor:i=65280,renderNode:s=!0,nodeColor:r=255}=e;return BM(t).then((t=>{if(!t||!t.MultiLayeredGraph)return Promise.reject('In soonspace: createTopologyFromGml "url" path error!');const a=[],o=new Map;let l=[],c=[];const h=t.MultiLayeredGraph.SpaceLayerMember.SpaceLayer.X_floor;Xm(h)?h.forEach((e=>{l=[...l,...e.state],c=[...c,...e.transition]})):(l=[...l,...h.state],c=[...c,...h.transition]),l.forEach(((e,t)=>{const n=e.State._attributes["gml:id"],i=e.State.topoNode["gml:Node"].node_name;a.push({id:Tm(n)?n:"",name:Tm(i)?i:"",position:{x:Number(e.State.topoNode["gml:Node"].xcoord["#text"]),y:Number(e.State.topoNode["gml:Node"].zcoord["#text"]),z:-1*Number(e.State.topoNode["gml:Node"].ycoord["#text"])},graphs:[]}),o.set(n,t)})),c.forEach((e=>{const t=e.Transition.topoEdge["gml:Edge"]["gml:directedNode"][0]._attributes["xlink:href"],n=e.Transition.topoEdge["gml:Edge"]["gml:directedNode"][1]._attributes["xlink:href"],i=e.Transition.topoEdge["gml:Edge"].restrict["#text"],s=e.Transition.topoEdge["gml:Edge"].passable["#text"],r=o.get(t),l=o.get(n),c=e.Transition._attributes["gml:id"],h=e.Transition.topoEdge["gml:Edge"].link_name["#text"];void 0!==r&&void 0!==l&&("2"!==s&&"3"!==s&&a[r].graphs.push({targetNodeId:n,linkInfo:{id:c,name:h},enable:!0,restrict:parseInt(i),passable:parseInt(s)}),"1"!==s&&"3"!==s&&a[l].graphs.push({targetNodeId:t,linkInfo:{id:c,name:h},enable:!0,restrict:parseInt(i),passable:parseInt(s)}))}));const d=new wv(Object.assign(Object.assign({},e),{type:"network",nodes:a,linkWidth:n,renderLink:!0,linkColor:i,renderNode:s,nodeColor:r}));return this.setDijkstraGraph(d.nodes),this.viewport.scener.addObject(d,this.scene),Promise.resolve(d)}))}))}create(e){const t=this.generateLineTopologyInfoNodeGraphs(e),n=new wv(t);return this.setDijkstraGraph(n.nodes),this.viewport.scener.addObject(n,this.scene),n}resetNodes(e,t){const n=this.generateLineTopologyInfoNodeGraphs(Object.assign(Object.assign({},e.info),{nodes:t}));return e.resetNodes(n.nodes),this.viewport.signals.objectChanged.dispatch(),e}createToGroup(e,t){const n=this.createGroup(e,null);return t.forEach((e=>{const t=this.generateLineTopologyInfoNodeGraphs(e),i=new wv(t);this.setDijkstraGraph(i.nodes),n.add(i)})),this.viewport.scener.addObject(n,this.scene),n}addForGroup(e,t){return e&&t.forEach((t=>{const n=this.generateLineTopologyInfoNodeGraphs(t),i=new wv(n);this.setDijkstraGraph(i.nodes),e.add(i)})),e}getShortestPath(e,t){const n=Xp(e.info.nodes),i=yp(t.start),s=yp(t.end);let r=null,a=1/0,o=null,l=1/0;for(let t=0;t<n.length;t++){const c=n[t];if(0===c.graphs.length)continue;const h=e.nodes.find((e=>e.sid===c.id));if(!h)continue;const d=h.getWorldPosition(new zt),u=d.distanceTo(i),p=d.distanceTo(s);u<a&&(a=u,r=c),p<l&&(l=p,o=c)}if(!r||!o||r.id===o.id)return null;const c=Number(r.id),h=Number(o.id),d=this.dijkstra.getPath(c,h);if(0===d.length)return null;const u=[r];for(let e=0;e<d.length;e++){const t=n.find((t=>t.id==d[e]));t&&(t.id+=Wm(),t.position.y+=1,u.push(t))}const p=Object.assign(Object.assign(Object.assign({},t),{type:"line",nodes:u}),e.getSpaceAttribute(!0));this.generateLineTopologyInfoNodeGraphs(p);const m=new wv(p);return this.viewport.scener.addObject(m,this.scene),m}getShortestPathByMultipleStartPoints(e,t){const{nodes:n}=e.info,i=[];t.start.forEach((e=>{const s=yp(e),r=yp(t.end);let a=null,o=1/0,l=null,c=1/0;if(n.forEach((e=>{if(e.graphs.length>0){const t=yp(e.position),n=t.distanceTo(s),i=t.distanceTo(r);n<o&&(o=n,a=Number(e.id)),i<c&&(c=i,l=Number(e.id))}})),a&&l){let e=0;const t=this.dijkstra.getPath(a,l);if(t.length>0){const a=[{id:"startPoint",position:s,graphs:[]}];t.forEach(((t,i)=>{const r=n.find((e=>e.id==t));r&&(e+=0===i?yp(r.position).distanceTo(s):yp(r.position).distanceTo(yp(a[a.length-1].position)),a.push(r))})),a.push({id:"endPoint",position:r,graphs:[]}),e+=r.distanceTo(yp(a[a.length-1].position)),i.push({nodeInfo:a,pathLength:e})}}}));let s=[],r=1/0;if(i.forEach((({nodeInfo:e,pathLength:t})=>{t<r&&(r=t,s=e)})),s.length){for(let e=0;e<s.length;e++)s[e].position.y+=1;const n=Object.assign(Object.assign({},t),{type:"line",nodes:s,position:e.getWorldPosition(new zt),rotation:(new wn).setFromQuaternion(e.getWorldQuaternion(new _t)),scale:e.getWorldScale(new zt)});this.generateLineTopologyInfoNodeGraphs(n);const i=new wv(n);return this.viewport.scener.addObject(i,this.scene),i}return null}getShortestPathByMultipleEndPoints(e,t){const{nodes:n}=e.info,i=[];t.end.forEach((e=>{const s=yp(t.start),r=yp(e);let a=null,o=1/0,l=null,c=1/0;if(n.forEach((e=>{if(e.graphs.length>0){const t=yp(e.position),n=t.distanceTo(s),i=t.distanceTo(r);n<o&&(o=n,a=Number(e.id)),i<c&&(c=i,l=Number(e.id))}})),a&&l){let e=0;const t=this.dijkstra.getPath(a,l);if(t.length>0){const a=[{id:"startPoint",position:s,graphs:[]}];t.forEach(((t,i)=>{const r=n.find((e=>e.id==t));r&&(e+=0===i?yp(r.position).distanceTo(s):yp(r.position).distanceTo(yp(a[a.length-1].position)),a.push(r))})),a.push({id:"endPoint",position:r,graphs:[]}),e+=r.distanceTo(yp(a[a.length-1].position)),i.push({nodeInfo:a,pathLength:e})}}}));let s=[],r=1/0;if(i.forEach((({nodeInfo:e,pathLength:t})=>{t<r&&(r=t,s=e)})),s.length){for(let e=0;e<s.length;e++)s[e].position.y+=1;const n=Object.assign(Object.assign({},t),{type:"line",nodes:s,position:e.getWorldPosition(new zt),rotation:(new wn).setFromQuaternion(e.getWorldQuaternion(new _t)),scale:e.getWorldScale(new zt)});this.generateLineTopologyInfoNodeGraphs(n);const i=new wv(n);return this.viewport.scener.addObject(i,this.scene),i}return null}setDijkstraGraph(e){const t=[];for(let n=0;n<e.length;n++){const i=e[n];if(0===i.graphs.length)continue;const s=[];for(let t=0;t<i.graphs.length;t++){const n=i.graphs[t],r=e.find((e=>e.sid===n.targetNodeId));if(!r)continue;const a=yp(i.getWorldPosition(new zt)),o=yp(r.getWorldPosition(new zt));s.push([Number(n.targetNodeId),a.distanceTo(o)])}t.push([Number(i.sid),s])}t.length>0&&this.dijkstra.setGraph(t)}generateLineTopologyInfoNodeGraphs(e){const{type:t,nodes:n}=e;if("line"===t)for(let t=0;t<n.length;t++)if(t===n.length-1)n[t].graphs=[];else{const i=e.nodes[t],s=e.nodes[t+1];n[t].graphs=[{targetNodeId:s.id,linkInfo:{id:`${i.id}_to_${s.id}`,name:`${i.name||i.id}_to_${s.name||s.id}`},enable:!0,restrict:0,passable:0}]}return Object.assign(Object.assign({},e),{nodes:n})}}class OM extends _o{constructor(e,t){const n=new yi;n.setAttribute("position",new li([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere();super(n,new Go({fog:!1})),this.light=e,this.color=t,this.type="RectAreaLightHelper";const i=new yi;i.setAttribute("position",new li([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),i.computeBoundingSphere(),this.add(new Wi(i,new Jn({side:1,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}class YM extends Av{constructor(e,t){super("Helper",e,t)}addGridHelper(e){const{id:t,size:n=1e3,divisions:i=20,color:s="#fff",position:r={x:0,y:0,z:0},rotation:a={x:0,y:0,z:0},scale:o={x:1,y:1,z:1}}=e,l=new Wd(n,i,s,s);return l.position.set(r.x,r.y,r.z),l.rotation.set(a.x,a.y,a.z),l.scale.set(o.x,o.y,o.z),l.userData.sid=t,l.userData.stype="Helper",this.viewport.scener.addObject(l,this.scene),l}addAxesHelper(e){const{id:t,axesLength:n=1e3}=e,i=new $d(n);return i.userData.sid=t,i.userData.stype="Helper",this.viewport.scener.addObject(i,this.scene),i}addBoxHelper(e){const{id:t,box:n,color:i="#00ff00"}=e,s=new Yd(n,new bt(i));return s.userData.sid=t,s.userData.stype="Helper",this.viewport.scener.addObject(s,this.scene),s}addPlaneHelper(e){const{id:t,width:n=500,height:i=500,color:s="#00ff00",opacity:r=.2,position:a={x:0,y:0,z:0},rotation:o={x:0,y:0,z:0},scale:l={x:1,y:1,z:1}}=e,c=new av(new is(n,i),new Jn({color:s,opacity:r,transparent:r<1,side:2}),{id:t,position:a,rotation:o,scale:l});return c.userData.sid=t,c.userData.stype="Helper",this.viewport.scener.addObject(c,this.scene),c}addGroundHelper(e){const{imgUrl:t,id:n,width:i=500,height:s=500,opacity:r=1,position:a={x:0,y:0,z:0},rotation:o={x:0,y:0,z:0},scale:l={x:1,y:1,z:1},repeat:c={x:10,y:10}}=e,h=(new eh).load(t),d=new is(i,s);d.computeBoundingBox();const u=new xc({side:2,map:h,transparent:r<1,opacity:r,roughness:.8});u.map&&(u.map.repeat.set(c.x,c.x),u.map.wrapS=y,u.map.wrapT=y,u.map.version++),o.x-=Math.PI/2,u.version++;const p=new Tv(d,u,{id:n,position:a,rotation:o,scale:l});return p.userData.sid=n,p.userData.stype="Helper",this.viewport.scener.addObject(p,this.scene),p}addDirectionalLightHelper(e){const{id:t,light:n,color:i,size:s=50}=e,r=new Hd(n,s,i);return r.userData.sid=t,r.userData.stype="Helper",this.viewport.scener.addObject(r,this.scene),r}addHemisphereLightHelper(e){const{id:t,light:n,color:i,size:s=20}=e,r=new Ed(n,s,i);return r.userData.sid=t,r.userData.stype="Helper",this.viewport.scener.addObject(r,this.scene),r}addSpotLightHelper(e){const{id:t,light:n,color:i}=e,s=new Ld(n,i);return s.userData.sid=t,s.userData.stype="Helper",this.viewport.scener.addObject(s,this.scene),s}addPointLightHelper(e){const{id:t,light:n,color:i,size:s=20}=e,r=new Xd(n,s,i);return r.userData.sid=t,r.userData.stype="Helper",this.viewport.scener.addObject(r,this.scene),r}addRectAreaLightHelper(e){const{id:t,light:n,color:i}=e,s=new OM(n,i);return s.userData.sid=t,s.userData.stype="Helper",this.viewport.scener.addObject(s,this.scene),s}}class KM extends Av{constructor(e,t){super("PluginObject",e,t)}createObject(e,t){const n=new hv(e);return t&&n.add(t),this.viewport.scener.addObject(n,this.scene),n}addToObject(e,t){return e?(this.viewport.scener.addObject(t,e),e):null}}class jM extends Av{constructor(e,t){super("Group",e,t)}}class JM{constructor(e){this.viewport=e,this.cache={objects:new Map},this.scene=new lv({id:"sceneManage"}),this.store={groupManager:new jM(e,this.scene),lightManager:new Xv(e,this.scene),modelManager:new NM(e,this.scene),poiManager:new VM(e,this.scene),poiNodeManager:new HM(e,this.scene),canvas3DManager:new DM(e,this.scene),topologyManager:new UM(e,this.scene),helperManager:new YM(e,this.scene),pluginObjectManager:new KM(e,this.scene)},e.postUpdate.set("ManagerRender",this.update.bind(this)),e.scene.add(this.scene),e.signals.objectAdded.add(this.setObjectCache.bind(this)),e.signals.objectRemoved.add(this.deleteObjectCache.bind(this))}levelUpdate(){if(!this.viewport.options.levelEnabled)return;const e=(e,t)=>{e.visible!==t&&(e instanceof dv&&e._setElementDisplay(t),e.visible=t,e.matrixAutoUpdate=t,e.autoUpdate=!0)},t=t=>{const{level:n,handleHide:i,autoUpdate:s}=t,{max:r=null,min:a=null}=n;if(s)t.autoUpdate=!1,this.viewport.signals.objectChanged.dispatch();else if(!i&&(r||a)){const n=this.viewport.camera.position.distanceTo(t.position);e(t,!(r&&n>r)&&!(a&&n<a))}};this.scene.traverse((e=>{(e instanceof ov||e instanceof av)&&t(e)}))}update(){if(0===this.scene.children.length)return;const e=performance.now();this.levelUpdate(),this.viewport.signals.loadRendered.dispatch(performance.now()-e)}isObjectInScene(e){let t=!1;return e.traverseAncestors((e=>{e===this.scene&&(t=!0)})),t}getObjectById(e){const t=this.getObjectCache(e);if(t){if(this.isObjectInScene(t))return t}return null}getObjectByName(e){return this._getObjectByProps("name",e)}getObjectByUserDataProperty(e,t){const n=[];return this.cache.objects.forEach((i=>{this.isObjectInScene(i)&&Im(i)&&(i instanceof ov||i.userData.stype)&&(_m(e)&&e(i.userData)||Tm(e)&&i.userData[e]===t)&&n.push(i)})),n}removeObjectById(e){const t=this.getObjectById(e);return!!t&&(this.viewport.scener.removeObject(t),!0)}_getObjectByProps(e,t){const n=[];return this.cache.objects.forEach((i=>{this.isObjectInScene(i)&&(i instanceof ov&&Im(i)&&i[e]===t||Im(i)&&i.userData.stype&&("name"===e&&i.name===t||"sid"===e&&i.userData.sid===t))&&n.push(i)})),n}getObjectCache(e){return this.cache.objects.get(e)}setObjectCache(e){const t=(e,t)=>{const n=this.cache.objects.get(t);n&&n!==e&&console.warn(`object id ${t} already exists in scene`)};null==e||e.traverse((n=>{if(n instanceof ov||n instanceof av){if("string"==typeof n.sid&&n.sid.startsWith(pp))return;t(n,n.sid),this.cache.objects.set(n.sid,n)}else n.userData.sid&&e.userData.stype&&(t(n,n.userData.sid),this.cache.objects.set(n.userData.sid,n))}))}deleteObjectCache(e){null==e||e.traverse((t=>{t instanceof ov||t instanceof av?this.cache.objects.delete(t.sid):t.userData.sid&&e.userData.stype&&this.cache.objects.delete(t.userData.sid)}))}clearObject(){this.store.modelManager.clear(),this.store.poiManager.clear(),this.store.poiNodeManager.clear(),this.store.canvas3DManager.clear(),this.store.topologyManager.clear(),this.store.helperManager.clear(),this.store.pluginObjectManager.clear()}clear(){this.clearObject(),this.store.lightManager.clear()}dispose(){this.clear(),this.store.modelManager.dispose()}}self.THREE=bu;class QM{constructor(e){this.THREE=bu,this.THREE_PLUGINS={TransformControls:Ru},this.version=n,this.animation=Nm,this.library=Rv,this.utils=Zm,this.plugins={};const{el:t,options:i={},events:s={}}=e;if(this.domElement=document.querySelector(t),this.options=Object.assign(Object.assign({},{showInfo:!1,showStats:!1,showViewHelper:!1,showGrid:!1,background:{color:11459572,alpha:!1},fog:!1,controls:{type:"free"},hoverEnabled:!1,levelEnabled:!1,closeInfoLog:!1,closeWarnLog:!1,useIndexedDB:!0,logarithmicDepthBuffer:!0}),i),this.viewport=new rv(this.options),this.signals=this.viewport.signals,this.manager=new JM(this.viewport),!this.domElement)throw new Error(`In SoonSpace: Can't find element by "${t}"!`);this.domElement.appendChild(this.viewport.container),this._init(),this._initEvents(s),this._initDefaultSettings()}_init(){const{showGrid:e,background:n,fog:i,controls:s,closeInfoLog:r,closeWarnLog:a,useIndexedDB:o}=this.options;if(!r){fp(" ____ ____ _ \n / ___| ___ ___ _ __ / ___| _ __ __ _ ___ ___ (_)___ \n \\___ \\ / _ \\ / _ \\| '_ \\\\___ \\| '_ \\ / _` |/ __/ _ \\ | / __| \n ___) | (_) | (_) | | | |___) | |_) | (_| | (_| __/_ | \\__ \\ \n |____/ \\___/ \\___/|_| |_|____/| .__/ \\__,_|\\___\\___(_)/ |___/ \n |_| |__/ \n",{color:"#3eaf7c"}),fp(t,{color:"#3eaf7c","font-size":"24px"}),fp(`当前版本: ${this.version}`,{color:"#3eaf7c","font-size":"12px"}),fp("文档: http://www.xwbuilders.com:8800",{color:"#3eaf7c","font-size":"12px"}),fp("样例: http://www.xwbuilders.com:8800/examples",{color:"#3eaf7c","font-size":"12px"}),fp("GitHub: https://github.com/soonspacejs",{color:"#3eaf7c","font-size":"12px"})}e&&this.addGridHelper(!0===e?{id:"defaultGridHelper"}:e),(null==n?void 0:n.skyBox)?Tm(null==n?void 0:n.skyBox)?this.setSphereSkyBackground(null==n?void 0:n.skyBox):Im(null==n?void 0:n.skyBox)&&this.setSkyBackground(n.skyBox.dirPath,n.skyBox.fileNames):(null==n?void 0:n.img)?this.setBackgroundImage(n.img):(null==n?void 0:n.color)&&this.setBackgroundColor(n.color),i&&this.openSceneFog(!0===i?void 0:i),s&&this.setControlsOptions(s),a&&(window.console.warn=function(){}),o&&!window.indexedDB&&(this.options.useIndexedDB=!1,window.console.warn("Your browser doesn't support a stable version of IndexedDB. Such and such feature will not be available."))}_initEvents(e){const{modelHover:t,modelUnHover:n,modelClick:i,modelRightClick:s,modelDblClick:r,poiHover:a,poiUnHover:o,poiClick:l,poiRightClick:c,poiDblClick:h,selectPosition:d,sceneClick:u,resize:p}=e;t&&this.signals.modelHover.add(t),n&&this.signals.modelUnHover.add(n),i&&this.signals.modelClick.add(i),s&&this.signals.modelRightClick.add(s),r&&this.signals.modelDblClick.add(r),a&&this.signals.poiHover.add(a),o&&this.signals.poiUnHover.add(o),l&&this.signals.poiClick.add(l),c&&this.signals.poiRightClick.add(c),h&&this.signals.poiDblClick.add(h),d&&this.signals.selectPosition.add(d),u&&this.signals.sceneClick.add(u),p&&this.signals.windowResize.add(p),this.signals.windowResize.dispatch(),window.addEventListener("resize",(()=>this.signals.windowResize.dispatch()),!1)}_initDefaultSettings(){this.setEnvironment(),this.setColorSpace("sRGB"),this.setToneMapping({type:"Linear",exposure:.8})}registerPlugin(e,t){const n=new e(this);return this.plugins[t]=n,n}getPlugin(e){return this.plugins[e]?this.plugins[e]:null}createPluginObject(e,t){return this.manager.store.pluginObjectManager.createObject(e,t)}addToPluginObject(e,t){const n=this.getObjectById(e);return this.manager.store.pluginObjectManager.addToObject(n,t)}getPluginObjectById(e){return gp("getPluginObjectById is deprecated, use getObjectById instead"),this.getObjectById(e)}getPluginObjectByName(e){return gp("getPluginObjectByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}removePluginObjectById(e){return gp("removePluginObjectById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}setSobel(){this.viewport.setSobel()}setBloom(){this.viewport.setBloom()}setSSAO(e){this.viewport.setSSAO(e)}setColorSpace(e){this.viewport.setColorSpace(e)}setToneMapping(e){this.viewport.setToneMapping(e)}setHoverEnabled(e){this.viewport.setHoverEnabled(e)}setBackgroundColor(e){this.viewport.setBackgroundColor(e)}setBackgroundImage(e){this.viewport.setBackgroundImage(e)}setSphereSkyBackground(e){this.viewport.setSphereSkyBackground(e)}setSkyBackground(e,t){this.viewport.setSkyBackground(e,t)}setEnvironment(){return this.viewport.setEnvironment()}playModelAnimation(e,t){return this.viewport.playModelAnimation(e,t)}stopModelAnimation(e,t){this.viewport.stopModelAnimation(e,t)}getOffsetByPosition(e){return this.viewport.getOffsetByPosition(e)}getPositionByOffset(e,t){return this.viewport.getPositionByOffset(e,t)}render(e){return this.viewport.render(e)}clearSignals(){this.viewport.clearSignals()}dispose(){return this.manager.dispose(),this.viewport.dispose()}getCameraViewpoint(){return this.viewport.cameraManager.getCameraViewpoint()}setCameraViewpoint(e){this.viewport.cameraManager.setCameraViewpoint(e)}getCameraTargetView(){return this.viewport.cameraManager.getCameraViewpoint()}setCameraTargetView(e){this.viewport.cameraManager.setCameraViewpoint(e)}flyTo(e,t="frontTop",n){return"orbit"===this.viewport.controls.options.type&&this.utils.warn("flyTo 方法不适用于 orbit 控制器"),this.viewport.cameraManager.flyTo(e,t,n)}flyToBoundingBox(e,t="frontTop",n){return this.viewport.cameraManager.flyToBoundingBox(e,t,n)}flyToObj(e,t="frontTop",n){return this.viewport.cameraManager.flyToObj(e,t,n)}flyMainViewpoint(e="frontTop",t){return this.flyToObj(this.manager.scene,e,t)}surroundOnTarget(e,t){return this.viewport.cameraManager.surroundOnTarget(e,t)}surroundOnObject(e,t){return this.viewport.cameraManager.surroundOnObject(e,t)}getObjectLabelPos(e,t="frontTop",n){return this.viewport.cameraManager.getObjectLabelPos(e,t,n)}setControlsOptions(e){return this.viewport.controls.setOptions(e)}addObject(e,t){this.viewport.scener.addObject(e,t)}removeObject(e){this.viewport.scener.removeObject(e)}openSceneFog(e){this.viewport.scener.openSceneFog(e)}closeSceneFog(){this.viewport.scener.closeSceneFog()}setSky(e){return this.viewport.setSky(e)}edgeShow(e,t){return this.viewport.scener.edgeShow(e,t)}unEdgeShow(e){return this.viewport.scener.unEdgeShow(e)}strokeShow(e,t){return this.viewport.scener.strokeShow(e,t)}unStrokeShow(e){return this.viewport.scener.unStrokeShow(e)}opacityShow(e,t){return this.viewport.scener.opacityShow(e,t)}unOpacityShow(e){return this.viewport.scener.unOpacityShow(e)}highlightShow(e,t){return this.viewport.scener.highlightShow(e,t)}unHighlightShow(e){return this.viewport.scener.unHighlightShow(e)}emissiveShow(e,t){return this.viewport.scener.emissiveShow(e,t)}unEmissiveShow(e){return this.viewport.scener.unEmissiveShow(e)}clearObject(){this.manager.clearObject()}clear(){this.manager.clear()}createAmbientLight(e){return this.manager.store.lightManager.createAmbientLight(e)}setAmbientLight(e){const t=this.getObjectById(e.id);return this.manager.store.lightManager.setAmbientLight(t,e)}createDirectionalLight(e){return this.manager.store.lightManager.createDirectionalLight(e)}setDirectionalLight(e){const t=this.getObjectById(e.id);return this.manager.store.lightManager.setDirectionalLight(t,e)}createHemisphereLight(e){return this.manager.store.lightManager.createHemisphereLight(e)}setHemisphereLight(e){const t=this.getObjectById(e.id);return this.manager.store.lightManager.setHemisphereLight(t,e)}createSpotLight(e){return this.manager.store.lightManager.createSpotLight(e)}setSpotLight(e){const t=this.getObjectById(e.id);return this.manager.store.lightManager.setSpotLight(t,e)}createPointLight(e){return this.manager.store.lightManager.createPointLight(e)}setPointLight(e){const t=this.getObjectById(e.id);return this.manager.store.lightManager.setPointLight(t,e)}createRectAreaLight(e){return this.manager.store.lightManager.createRectAreaLight(e)}setRectAreaLight(e){const t=this.getObjectById(e.id);return this.manager.store.lightManager.setRectAreaLight(t,e)}getLightById(e){return gp("getLightById is deprecated, use getObjectById instead"),this.getObjectById(e)}removeLightById(e){return gp("removeLightById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}getAllLight(){return this.manager.store.lightManager.getAll()}clearLight(){return this.manager.store.lightManager.clear()}showAllLight(){return this.manager.store.lightManager.showAll()}hideAllLight(){return this.manager.store.lightManager.hideAll()}updateAllShadow(){return this.manager.store.lightManager.updateAllShadow()}getObjectById(e){return this.manager.getObjectById(e)}getObjectByName(e){return this.manager.getObjectByName(e)}getObjectByUserDataProperty(e,t){return this.manager.getObjectByUserDataProperty(e,t)}removeObjectById(e){return this.manager.removeObjectById(e)}createGroup(e){return this.manager.store.groupManager.createGroup(e)}getGroupById(e){return gp("getGroupById is deprecated, use getObjectById instead"),this.getObjectById(e)}getGroupByName(e){return gp("getGroupByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getAllGroup(){return this.manager.store.groupManager.getAll()}showAllGroup(){return this.manager.store.groupManager.showAll()}hideAllGroup(){return this.manager.store.groupManager.hideAll()}removeGroupById(e){return gp("removeGroupById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}loadSbm(e){return gp("loadSbm is deprecated, use loadModel instead"),this.loadModel(e)}parseSbm(){gp("parseSbm is deprecated!")}cloneSbm(e,t,n){return gp("cloneSbm is deprecated, use cloneModel instead"),this.cloneModel(e,t,n)}getSbmById(e){return gp("getSbmById is deprecated, use getObjectById instead"),this.getObjectById(e)}getSbmByName(e){return gp("getSbmByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getSbmByUserDataProperty(e,t){return gp("getSbmByUserDataProperty is deprecated, use getObjectByUserDataProperty instead"),this.getObjectByUserDataProperty(e,t)}removeSbmById(e){return gp("removeSbmById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}createGroupForSbm(e){return gp("createGroupForSbm is deprecated, use createGroup instead"),this.createGroup(e)}loadSbmToGroup(e,t){return gp("loadSbmToGroup is deprecated, use loadModelToGroup instead"),this.loadModelToGroup(e,t)}addSbmForGroup(e,t){return gp("addSbmForGroup is deprecated, use addModelForGroup instead"),this.addModelForGroup(e,t)}createSbmGroupFromXml(){gp("createGroupForSbm is deprecated!")}getSbmGroupById(e){return gp("getSbmGroupById is deprecated, use getObjectById instead"),this.getObjectById(e)}getSbmGroupByName(e){return gp("getSbmGroupByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getAllSbmGroup(){return gp("getAllSbmGroup is deprecated, use getAllGroup instead"),this.getAllGroup()}removeSbmGroupById(e){return gp("removeSbmGroupById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}clearSbm(){return gp("clearSbm is deprecated, use clearModel instead"),this.clearModel()}getAllSbm(){return gp("getAllSbm is deprecated, use getAllModel instead"),this.getAllModel()}showAllSbm(){return gp("showAllSbm is deprecated, use showAllModel instead"),this.showAllModel()}hideAllSbm(){return gp("hideAllSbm is deprecated, use hideAllModel instead"),this.hideAllModel()}getSbmModelMaps(){return gp("getSbmModelMaps is deprecated, use getModelsMap instead"),this.getModelsMap()}setSbmModelMaps(e){return gp("setSbmModelMaps is deprecated, use setModelsMap instead"),this.setModelsMap(e)}setModelDracoDecoderPath(e){return this.manager.store.modelManager.setDracoDecoderPath(e)}loadModel(e){return this.manager.store.modelManager.load(e)}cloneModel(e,t,n){return this.manager.store.modelManager.clone(e,t,n)}getModelById(e){return gp("getModelById is deprecated, use getObjectById instead"),this.getObjectById(e)}getModelByName(e){return gp("getModelByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getModelByUserDataProperty(e,t){return gp("getModelByUserDataProperty is deprecated, use getObjectByUserDataProperty instead"),this.getObjectByUserDataProperty(e,t)}removeModelById(e){return gp("removeModelById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}createGroupForModel(e){return gp("createGroupForModel is deprecated, use createGroup instead"),this.createGroup(e)}loadModelToGroup(e,t){return this.manager.store.modelManager.loadToGroup(e,t)}addModelForGroup(e,t){const n=this.getObjectById(e);return this.manager.store.modelManager.addForGroup(n,t)}getModelGroupById(e){return gp("getModelGroupById is deprecated, use getObjectById instead"),this.getObjectById(e)}getModelGroupByName(e){return gp("getModelGroupByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getAllModelGroup(){return gp("getAllModelGroup is deprecated, use getAllGroup instead"),this.getAllGroup()}removeModelGroupById(e){return gp("removeModelGroupById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}clearModel(){return this.manager.store.modelManager.clear()}getAllModel(){return this.manager.store.modelManager.getAll()}showAllModel(){return this.manager.store.modelManager.showAll()}hideAllModel(){return this.manager.store.modelManager.hideAll()}clearIdb(){return this.manager.store.modelManager.clearIdb()}getModelsMap(){return this.manager.store.modelManager.modelsMap}setModelsMap(e){this.manager.store.modelManager.modelsMap=e}createPoi(e){return this.manager.store.poiManager.create(e)}clonePoi(e,t,n){return this.manager.store.poiManager.clone(e,t,n)}getPoiById(e){return gp("getPoiById is deprecated, use getObjectById instead"),this.getObjectById(e)}getPoiByName(e){return gp("getPoiByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getPoiByUserDataProperty(e,t){return gp("getPoiByUserDataProperty is deprecated, use getObjectByUserDataProperty instead"),this.getObjectByUserDataProperty(e,t)}removePoiById(e){return gp("removePoiById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}createGroupForPoi(e){return gp("createGroupForPoi is deprecated, use createGroup instead"),this.createGroup(e)}createPoiToGroup(e,t){return this.manager.store.poiManager.createToGroup(e,t)}addPoiForGroup(e,t){const n=this.getObjectById(e);return this.manager.store.poiManager.addForGroup(n,t)}getPoiGroupById(e){return gp("getPoiGroupById is deprecated, use getObjectById instead"),this.getObjectById(e)}getPoiGroupByName(e){return gp("getPoiGroupByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getAllPoiGroup(){return gp("getAllPoiGroup is deprecated, use getAllGroup instead"),this.getAllGroup()}removePoiGroupById(e){return gp("removePoiGroupById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}clearPoi(){return this.manager.store.poiManager.clear()}getAllPoi(){return this.manager.store.poiManager.getAll()}showAllPoi(){return this.manager.store.poiManager.showAll()}hideAllPoi(){return this.manager.store.poiManager.hideAll()}createPoiNode(e){return this.manager.store.poiNodeManager.create(e)}getPoiNodeById(e){return gp("getPoiNodeById is deprecated, use getObjectById instead"),this.getObjectById(e)}getPoiNodeByName(e){return gp("getPoiNodeByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getPoiNodeByUserDataProperty(e,t){return gp("getPoiNodeByUserDataProperty is deprecated, use getObjectByUserDataProperty instead"),this.getObjectByUserDataProperty(e,t)}removePoiNodeById(e){return gp("removePoiNodeById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}createGroupForPoiNode(e){return gp("createGroupForPoiNode is deprecated, use createGroup instead"),this.createGroup(e)}createPoiNodeToGroup(e,t){return this.manager.store.poiNodeManager.createToGroup(e,t)}addPoiNodeForGroup(e,t){const n=this.getObjectById(e);return this.manager.store.poiNodeManager.addForGroup(n,t)}getPoiNodeGroupById(e){return gp("getPoiNodeGroupById is deprecated, use getObjectById instead"),this.getObjectById(e)}getPoiNodeGroupByName(e){return gp("getPoiNodeGroupByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getAllPoiNodeGroup(){return gp("getAllPoiNodeGroup is deprecated, use getAllGroup instead"),this.getAllGroup()}removePoiNodeGroupById(e){return gp("removePoiNodeGroupById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}clearPoiNode(){return this.manager.store.poiNodeManager.clear()}getAllPoiNode(){return this.manager.store.poiNodeManager.getAll()}showAllPoiNode(){return this.manager.store.poiNodeManager.showAll()}hideAllPoiNode(){return this.manager.store.poiNodeManager.hideAll()}createCanvas3D(e){return this.manager.store.canvas3DManager.create(e)}getCanvas3DById(e){return gp("getCanvas3DById is deprecated, use getObjectById instead"),this.getObjectById(e)}getCanvas3DByName(e){return gp("getCanvas3DByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getCanvas3DByUserDataProperty(e,t){return gp("getCanvas3DByUserDataProperty is deprecated, use getObjectByUserDataProperty instead"),this.getObjectByUserDataProperty(e,t)}removeCanvas3DById(e){return gp("removeCanvas3DById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}createGroupForCanvas3D(e){return gp("createGroupForCanvas3D is deprecated, use createGroup instead"),this.createGroup(e)}createCanvas3DToGroup(e,t){return this.manager.store.canvas3DManager.createToGroup(e,t)}addCanvas3DForGroup(e,t){const n=this.getObjectById(e);return this.manager.store.canvas3DManager.addForGroup(n,t)}getCanvas3DGroupById(e){return gp("getCanvas3DGroupById is deprecated, use getObjectById instead"),this.getObjectById(e)}getCanvas3DGroupByName(e){return gp("getCanvas3DGroupByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getAllCanvas3DGroup(){return gp("getAllCanvas3DGroup is deprecated, use getAllGroup instead"),this.getAllGroup()}removeCanvas3DGroupById(e){return gp("removeCanvas3DGroupById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}clearCanvas3D(){return this.manager.store.canvas3DManager.clear()}getAllCanvas3D(){return this.manager.store.canvas3DManager.getAll()}showAllCanvas3D(){return this.manager.store.canvas3DManager.showAll()}hideAllCanvas3D(){return this.manager.store.canvas3DManager.hideAll()}getShortestPath(e,t){return this.manager.store.topologyManager.getShortestPath(e,t)}getShortestPathByMultipleStartPoints(e,t){return this.manager.store.topologyManager.getShortestPathByMultipleStartPoints(e,t)}getShortestPathByMultipleEndPoints(e,t){return this.manager.store.topologyManager.getShortestPathByMultipleEndPoints(e,t)}createTopologyFromGml(e){return this.manager.store.topologyManager.createFromGml(e)}createTopology(e){return this.manager.store.topologyManager.create(e)}resetTopologyNodes(e,t){return this.manager.store.topologyManager.resetNodes(e,t)}getTopologyById(e){return gp("getTopologyById is deprecated, use getObjectById instead"),this.getObjectById(e)}getTopologyByName(e){return gp("getTopologyByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getTopologyByUserDataProperty(e,t){return gp("getTopologyByUserDataProperty is deprecated, use getObjectByUserDataProperty instead"),this.getObjectByUserDataProperty(e,t)}removeTopologyById(e){return gp("removeTopologyById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}createGroupForTopology(e){return gp("createGroupForTopology is deprecated, use createGroup instead"),this.createGroup(e)}createTopologyToGroup(e,t){return this.manager.store.topologyManager.createToGroup(e,t)}addTopologyForGroup(e,t){const n=this.getObjectById(e);return this.manager.store.topologyManager.addForGroup(n,t)}getTopologyGroupById(e){return gp("getTopologyGroupById is deprecated, use getObjectById instead"),this.getObjectById(e)}getTopologyGroupByName(e){return gp("getTopologyGroupByName is deprecated, use getObjectByName instead"),this.getObjectByName(e)}getAllTopologyGroup(){return gp("getAllTopologyGroup is deprecated, use getAllGroups instead"),this.getAllGroup()}removeTopologyGroupById(e){return gp("removeTopologyGroupById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}clearTopology(){return this.manager.store.topologyManager.clear()}getAllTopology(){return this.manager.store.topologyManager.getAll()}showAllTopology(){return this.manager.store.topologyManager.showAll()}hideAllTopology(){return this.manager.store.topologyManager.hideAll()}addGridHelper(e){return this.manager.store.helperManager.addGridHelper(e)}addAxesHelper(e){return this.manager.store.helperManager.addAxesHelper(e)}addBoxHelper(e){return this.manager.store.helperManager.addBoxHelper(e)}addPlaneHelper(e){return this.manager.store.helperManager.addPlaneHelper(e)}createGround(e){return gp("In soonspacejs: 'createGround' 已弃用,请使用 'addGroundHelper'!"),this.addGroundHelper(e)}addGroundHelper(e){return this.manager.store.helperManager.addGroundHelper(e)}addDirectionalLightHelper(e){return this.manager.store.helperManager.addDirectionalLightHelper(e)}addHemisphereLightHelper(e){return this.manager.store.helperManager.addHemisphereLightHelper(e)}addSpotLightHelper(e){return this.manager.store.helperManager.addSpotLightHelper(e)}addPointLightHelper(e){return this.manager.store.helperManager.addPointLightHelper(e)}addRectAreaLightHelper(e){return this.manager.store.helperManager.addRectAreaLightHelper(e)}getHelperById(e){return gp("getHelperById is deprecated, use getObjectById instead"),this.getObjectById(e)}removeHelperById(e){return gp("removeHelperById is deprecated, use removeObjectById instead"),this.removeObjectById(e)}clearHelper(){return this.manager.store.helperManager.clear()}showAllHelper(){return this.manager.store.helperManager.showAll()}hideAllHelper(){return this.manager.store.helperManager.hideAll()}}QM.THREE=bu,QM.TWEEN=up,QM.utils=Zm,e.ACESFilmicToneMapping=4,e.AddEquation=a,e.AddOperation=2,e.AdditiveAnimationBlendMode=_e,e.AdditiveBlending=2,e.AlphaFormat=N,e.AlwaysDepth=1,e.AlwaysStencilFunc=519,e.AmbientLight=gh,e.AmbientLightProbe=zh,e.AnimationClip=Dc,e.AnimationLoader=jc,e.AnimationMixer=cd,e.AnimationObjectGroup=ad,e.AnimationUtils=Rc,e.ArcCurve=Jo,e.ArrayCamera=Ta,e.ArrowHelper=qd,e.Audio=Uh,e.AudioAnalyser=Qh,e.AudioContext=Xh,e.AudioListener=Fh,e.AudioLoader=Ih,e.AxesHelper=$d,e.BackSide=1,e.BasicDepthPacking=We,e.BasicShadowMap=0,e.Bone=fo,e.BooleanKeyframeTrack=Ec,e.Box2=vd,e.Box3=Zt,e.Box3Helper=Yd,e.BoxBufferGeometry=Pi,e.BoxGeometry=Pi,e.BoxHelper=Od,e.BufferAttribute=$n,e.BufferGeometry=yi,e.BufferGeometryLoader=Mh,e.ByteType=R,e.Cache=Bc,e.Camera=ki,e.CameraHelper=Bd,e.CanvasTexture=Yo,e.CapsuleBufferGeometry=yl,e.CapsuleGeometry=yl,e.CatmullRomCurve3=nl,e.CineonToneMapping=3,e.CircleBufferGeometry=bl,e.CircleGeometry=bl,e.ClampToEdgeWrapping=b,e.Clock=Nh,e.Color=bt,e.ColorKeyframeTrack=Wc,e.ColorManagement=dt,e.CompressedTexture=Oo,e.CompressedTextureLoader=Jc,e.ConeBufferGeometry=xl,e.ConeGeometry=xl,e.CubeCamera=Ui,e.CubeReflectionMapping=u,e.CubeRefractionMapping=p,e.CubeTexture=Oi,e.CubeTextureLoader=qc,e.CubeUVReflectionMapping=g,e.CubicBezierCurve=al,e.CubicBezierCurve3=ol,e.CubicInterpolant=Xc,e.CullFaceBack=1,e.CullFaceFront=2,e.CullFaceFrontBack=3,e.CullFaceNone=0,e.Curve=Ko,e.CurvePath=ml,e.CustomBlending=5,e.CustomToneMapping=5,e.CylinderBufferGeometry=vl,e.CylinderGeometry=vl,e.Cylindrical=yd,e.Data3DTexture=At,e.DataArrayTexture=Tt,e.DataTexture=go,e.DataTexture2DArray=gu,e.DataTexture3D=yu,e.DataTextureLoader=$c,e.DataUtils=cu,e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=Uc,e.DepthFormat=B,e.DepthStencilFormat=F,e.DepthTexture=Ia,e.DirectionalLight=fh,e.DirectionalLightHelper=Hd,e.DiscreteInterpolant=_c,e.DodecahedronBufferGeometry=Sl,e.DodecahedronGeometry=Sl,e.DoubleSide=2,e.DstAlphaFactor=206,e.DstColorFactor=208,e.DynamicCopyUsage=35050,e.DynamicDrawUsage=35048,e.DynamicReadUsage=35049,e.EdgesGeometry=Tl,e.EllipseCurve=jo,e.EqualDepth=4,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=m,e.EquirectangularRefractionMapping=f,e.Euler=wn,e.EventDispatcher=Be,e.ExtrudeBufferGeometry=sc,e.ExtrudeGeometry=sc,e.FileLoader=Kc,e.FlatShading=1,e.Float16BufferAttribute=oi,e.Float32BufferAttribute=li,e.Float64BufferAttribute=ci,e.FloatType=z,e.Fog=Na,e.FogExp2=Pa,e.Font=pu,e.FontLoader=uu,e.FramebufferTexture=Uo,e.FrontSide=0,e.Frustum=es,e.GLBufferAttribute=ud,e.GLSL1="100",e.GLSL3=De,e.GreaterDepth=6,e.GreaterEqualDepth=5,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=Wd,e.Group=Ra,e.HalfFloatType=E,e.HemisphereLight=nh,e.HemisphereLightHelper=Ed,e.HemisphereLightProbe=_h,e.IcosahedronBufferGeometry=ac,e.IcosahedronGeometry=ac,e.ImageBitmapLoader=Rh,e.ImageLoader=Qc,e.ImageUtils=xt,e.ImmediateRenderObject=mu,e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=xo,e.InstancedBufferGeometry=Sh,e.InstancedInterleavedBuffer=dd,e.InstancedMesh=Co,e.Int16BufferAttribute=ii,e.Int32BufferAttribute=ri,e.Int8BufferAttribute=ei,e.IntType=I,e.InterleavedBuffer=Ha,e.InterleavedBufferAttribute=ka,e.Interpolant=Ac,e.InterpolateDiscrete=Ce,e.InterpolateLinear=Ge,e.InterpolateSmooth=Te,e.InvertStencilOp=5386,e.KeepStencilOp=Ve,e.KeyframeTrack=zc,e.LOD=oo,e.LatheBufferGeometry=gl,e.LatheGeometry=gl,e.Layers=Sn,e.LessDepth=2,e.LessEqualDepth=3,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=th,e.LightProbe=vh,e.Line=_o,e.Line3=Sd,e.LineBasicMaterial=Go,e.LineCurve=ll,e.LineCurve3=cl,e.LineDashedMaterial=Tc,e.LineLoop=Zo,e.LineSegments=Wo,e.LinearEncoding=ze,e.LinearFilter=M,e.LinearInterpolant=Ic,e.LinearMipMapLinearFilter=G,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=C,e.LinearMipmapNearestFilter=L,e.LinearSRGBColorSpace=Ne,e.LinearToneMapping=1,e.Loader=Oc,e.LoaderUtils=wh,e.LoadingManager=Fc,e.LoopOnce=Se,e.LoopPingPong=Le,e.LoopRepeat=Me,e.LuminanceAlphaFormat=k,e.LuminanceFormat=D,e.MOUSE=s,e.Material=jn,e.MaterialLoader=xh,e.MathUtils=tt,e.Matrix3=it,e.Matrix4=dn,e.MaxEquation=l,e.Mesh=Wi,e.MeshBasicMaterial=Jn,e.MeshDepthMaterial=wa,e.MeshDistanceMaterial=Sa,e.MeshLambertMaterial=Cc,e.MeshMatcapMaterial=Gc,e.MeshNormalMaterial=Lc,e.MeshPhongMaterial=Sc,e.MeshPhysicalMaterial=wc,e.MeshStandardMaterial=xc,e.MeshToonMaterial=Mc,e.MinEquation=o,e.MirroredRepeatWrapping=v,e.MixOperation=1,e.MultiplyBlending=4,e.MultiplyOperation=0,e.NearestFilter=x,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=S,e.NearestMipmapNearestFilter=w,e.NeverDepth=0,e.NeverStencilFunc=512,e.NoBlending=0,e.NoColorSpace="",e.NoToneMapping=0,e.NormalAnimationBlendMode=Ie,e.NormalBlending=1,e.NotEqualDepth=7,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=Zc,e.Object3D=Zn,e.ObjectLoader=Lh,e.ObjectSpaceNormalMap=1,e.OctahedronBufferGeometry=oc,e.OctahedronGeometry=oc,e.OneFactor=201,e.OneMinusDstAlphaFactor=207,e.OneMinusDstColorFactor=209,e.OneMinusSrcAlphaFactor=h,e.OneMinusSrcColorFactor=203,e.OrthographicCamera=ps,e.PCFShadowMap=1,e.PCFSoftShadowMap=2,e.PMREMGenerator=Ss,e.ParametricGeometry=hu,e.Path=fl,e.PerspectiveCamera=Bi,e.Plane=Qi,e.PlaneBufferGeometry=is,e.PlaneGeometry=is,e.PlaneHelper=Kd,e.PointLight=ph,e.PointLightHelper=Xd,e.Points=ko,e.PointsMaterial=Po,e.PolarGridHelper=Zd,e.PolyhedronBufferGeometry=wl,e.PolyhedronGeometry=wl,e.PositionalAudio=Jh,e.PropertyBinding=rd,e.PropertyMixer=qh,e.QuadraticBezierCurve=hl,e.QuadraticBezierCurve3=dl,e.Quaternion=_t,e.QuaternionKeyframeTrack=Nc,e.QuaternionLinearInterpolant=Pc,e.REVISION=i,e.RGBADepthPacking=Ze,e.RGBAFormat=H,e.RGBAIntegerFormat=j,e.RGBA_ASTC_10x10_Format=be,e.RGBA_ASTC_10x5_Format=fe,e.RGBA_ASTC_10x6_Format=ge,e.RGBA_ASTC_10x8_Format=ye,e.RGBA_ASTC_12x10_Format=ve,e.RGBA_ASTC_12x12_Format=xe,e.RGBA_ASTC_4x4_Format=oe,e.RGBA_ASTC_5x4_Format=le,e.RGBA_ASTC_5x5_Format=ce,e.RGBA_ASTC_6x5_Format=he,e.RGBA_ASTC_6x6_Format=de,e.RGBA_ASTC_8x5_Format=ue,e.RGBA_ASTC_8x6_Format=pe,e.RGBA_ASTC_8x8_Format=me,e.RGBA_BPTC_Format=we,e.RGBA_ETC2_EAC_Format=ae,e.RGBA_PVRTC_2BPPV1_Format=ie,e.RGBA_PVRTC_4BPPV1_Format=ne,e.RGBA_S3TC_DXT1_Format=Q,e.RGBA_S3TC_DXT3_Format=q,e.RGBA_S3TC_DXT5_Format=$,e.RGBFormat=V,e.RGB_ETC1_Format=se,e.RGB_ETC2_Format=re,e.RGB_PVRTC_2BPPV1_Format=te,e.RGB_PVRTC_4BPPV1_Format=ee,e.RGB_S3TC_DXT1_Format=J,e.RGFormat=Y,e.RGIntegerFormat=K,e.RawShaderMaterial=vc,e.Ray=hn,e.Raycaster=pd,e.RectAreaLight=yh,e.RedFormat=U,e.RedIntegerFormat=O,e.ReinhardToneMapping=2,e.RepeatWrapping=y,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=102,e.RingBufferGeometry=lc,e.RingGeometry=lc,e.SRGBColorSpace=Pe,e.Scene=Va,e.ShaderChunk=ss,e.ShaderLib=as,e.ShaderMaterial=Di,e.ShadowMaterial=bc,e.Shape=Rl,e.ShapeBufferGeometry=cc,e.ShapeGeometry=cc,e.ShapePath=eu,e.ShapeUtils=tc,e.ShortType=A,e.Skeleton=vo,e.SkeletonHelper=Rd,e.SkinnedMesh=mo,e.SmoothShading=2,e.SoonSpace=QM,e.Source=wt,e.Sphere=tn,e.SphereBufferGeometry=hc,e.SphereGeometry=hc,e.Spherical=gd,e.SphericalHarmonics3=bh,e.SplineCurve=ul,e.SpotLight=lh,e.SpotLightHelper=Ld,e.Sprite=io,e.SpriteMaterial=Ba,e.SrcAlphaFactor=c,e.SrcAlphaSaturateFactor=210,e.SrcColorFactor=202,e.StaticCopyUsage=35046,e.StaticDrawUsage=He,e.StaticReadUsage=35045,e.StereoCamera=Ph,e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=Vc,e.SubtractEquation=101,e.SubtractiveBlending=3,e.TOUCH=r,e.TangentSpaceNormalMap=0,e.TetrahedronBufferGeometry=dc,e.TetrahedronGeometry=dc,e.TextGeometry=du,e.Texture=Lt,e.TextureLoader=eh,e.TorusBufferGeometry=uc,e.TorusGeometry=uc,e.TorusKnotBufferGeometry=pc,e.TorusKnotGeometry=pc,e.Triangle=Yn,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeBufferGeometry=mc,e.TubeGeometry=mc,e.UVMapping=d,e.Uint16BufferAttribute=si,e.Uint32BufferAttribute=ai,e.Uint8BufferAttribute=ti,e.Uint8ClampedBufferAttribute=ni,e.Uniform=hd,e.UniformsLib=rs,e.UniformsUtils=Hi,e.UnsignedByteType=T,e.UnsignedInt248Type=P,e.UnsignedIntType=_,e.UnsignedShort4444Type=W,e.UnsignedShort5551Type=Z,e.UnsignedShortType=X,e.VSMShadowMap=3,e.Vector2=nt,e.Vector3=zt,e.Vector4=Ct,e.VectorKeyframeTrack=Hc,e.VideoTexture=Fo,e.WebGL1Renderer=Za,e.WebGL3DRenderTarget=Xt,e.WebGLArrayRenderTarget=Rt,e.WebGLCubeRenderTarget=Yi,e.WebGLMultipleRenderTargets=It,e.WebGLMultisampleRenderTarget=fu,e.WebGLRenderTarget=Gt,e.WebGLRenderer=Wa,e.WebGLUtils=Ga,e.WireframeGeometry=fc,e.WrapAroundEnding=Xe,e.ZeroCurvatureEnding=Re,e.ZeroFactor=200,e.ZeroSlopeEnding=Ae,e.ZeroStencilOp=0,e._SRGBAFormat=ke,e.default=QM,e.sRGBEncoding=Ee,Object.defineProperty(e,"__esModule",{value:!0})}));
|