From f0e38483222b2b252cf2d81b2713a2cca942e061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E5=A4=A7=E8=83=86?= <1101282782@qq.com> Date: Thu, 13 Nov 2025 16:39:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/public/sdk/YJEarth.min.js | 4 +- src/renderer/public/sdk/custom/css/index.css | 51 ++++++++-- src/renderer/src/assets/img/mouse.png | Bin 0 -> 561 bytes .../setPup/components/graphLabelManage.vue | 71 +++++++++---- .../setPup/components/modelManage.vue | 74 ++++++++++---- .../setPup/components/photoManage.vue | 1 + .../components/leftSide/leftSideSecond.vue | 30 +++++- .../components/propertyBox/CircleViewShed.vue | 95 ++++++++++++++++-- .../views/components/propertyBox/CutFill.vue | 80 +++++++++++++-- 9 files changed, 328 insertions(+), 78 deletions(-) create mode 100644 src/renderer/src/assets/img/mouse.png diff --git a/src/renderer/public/sdk/YJEarth.min.js b/src/renderer/public/sdk/YJEarth.min.js index d7ba6ad..0e75544 100644 --- a/src/renderer/public/sdk/YJEarth.min.js +++ b/src/renderer/public/sdk/YJEarth.min.js @@ -1,4 +1,4 @@ -/*! update time: 2025/11/12 15:01:31*/!function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=22)}([function(e,t,i){var n=i(23)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,i){var n=i(18);function o(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=Array(t);ie.length)&&(t=e.length);for(var i=0,n=Array(t);i>8&255]+hd[e>>16&255]+hd[e>>24&255]+"-"+hd[255&t]+hd[t>>8&255]+"-"+hd[t>>16&15|64]+hd[t>>24&255]+"-"+hd[63&i|128]+hd[i>>8&255]+"-"+hd[i>>16&255]+hd[i>>24&255]+hd[255&n]+hd[n>>8&255]+hd[n>>16&255]+hd[n>>24&255]).toLowerCase()}function md(e,t,i){return Math.max(t,Math.min(i,e))}function fd(e,t){return(e%t+t)%t}function vd(e,t,i){return(1-i)*e+i*t}function gd(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function yd(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}var bd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e),e.prototype.isVector2=!0,this.x=t,this.y=i}),[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(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}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var i=this.dot(e)/t;return Math.acos(md(i,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var i=Math.cos(t),n=Math.sin(t),o=this.x-e.x,s=this.y-e.y;return this.x=o*i-s*n+e.x,this.y=o*n+s*i+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:case"end":return e.stop()}}),e,this)}))}])}(),Cd=function(){return x()((function e(t,i,n,o,s,a,r,l,c){k()(this,e),e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,i,n,o,s,a,r,l,c)}),[{key:"set",value:function(e,t,i,n,o,s,a,r,l){var c=this.elements;return c[0]=e,c[1]=n,c[2]=a,c[3]=t,c[4]=o,c[5]=r,c[6]=i,c[7]=s,c[8]=l,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}},{key:"extractBasis",value:function(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var 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}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var i=e.elements,n=t.elements,o=this.elements,s=i[0],a=i[3],r=i[6],l=i[1],c=i[4],u=i[7],h=i[2],p=i[5],d=i[8],m=n[0],f=n[3],v=n[6],g=n[1],y=n[4],b=n[7],C=n[2],w=n[5],k=n[8];return o[0]=s*m+a*g+r*C,o[3]=s*f+a*y+r*w,o[6]=s*v+a*b+r*k,o[1]=l*m+c*g+u*C,o[4]=l*f+c*y+u*w,o[7]=l*v+c*b+u*k,o[2]=h*m+p*g+d*C,o[5]=h*f+p*y+d*w,o[8]=h*v+p*b+d*k,this}},{key:"multiplyScalar",value:function(e){var 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}},{key:"determinant",value:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],r=e[6],l=e[7],c=e[8];return t*s*c-t*a*l-i*o*c+i*a*r+n*o*l-n*s*r}},{key:"invert",value:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],r=e[6],l=e[7],c=e[8],u=c*s-a*l,h=a*r-c*o,p=l*o-s*r,d=t*u+i*h+n*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var m=1/d;return e[0]=u*m,e[1]=(n*l-c*i)*m,e[2]=(a*i-n*s)*m,e[3]=h*m,e[4]=(c*t-n*r)*m,e[5]=(n*o-a*t)*m,e[6]=p*m,e[7]=(i*r-l*t)*m,e[8]=(s*t-i*o)*m,this}},{key:"transpose",value:function(){var e,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}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var 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}},{key:"setUvTransform",value:function(e,t,i,n,o,s,a){var r=Math.cos(o),l=Math.sin(o);return this.set(i*r,i*l,-i*(r*s+l*a)+s+e,-n*l,n*r,-n*(-l*s+r*a)+a+t,0,0,1),this}},{key:"scale",value:function(e,t){return this.premultiply(wd.makeScale(e,t)),this}},{key:"rotate",value:function(e){return this.premultiply(wd.makeRotation(-e)),this}},{key:"translate",value:function(e,t){return this.premultiply(wd.makeTranslation(e,t)),this}},{key:"makeTranslation",value:function(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}},{key:"makeRotation",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}},{key:"makeScale",value:function(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}},{key:"equals",value:function(e){for(var t=this.elements,i=e.elements,n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<9;i++)this.elements[i]=e[i+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}])}(),wd=new Cd;function kd(e){for(var t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function _d(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}var xd={};function Sd(e){e in xd||(xd[e]=!0,console.warn(e))}var Ed,Pd=(new Cd).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Dd=(new Cd).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Md=C()(C()(C()(C()({},ed,{transfer:nd,primaries:sd,toReference:function(e){return e},fromReference:function(e){return e}}),$p,{transfer:od,primaries:sd,toReference:function(e){return e.convertSRGBToLinear()},fromReference:function(e){return e.convertLinearToSRGB()}}),id,{transfer:nd,primaries:"p3",toReference:function(e){return e.applyMatrix3(Dd)},fromReference:function(e){return e.applyMatrix3(Pd)}}),td,{transfer:od,primaries:"p3",toReference:function(e){return e.convertSRGBToLinear().applyMatrix3(Dd)},fromReference:function(e){return e.applyMatrix3(Pd).convertLinearToSRGB()}}),Td=new Set([ed,id]),Od={enabled:!0,_workingColorSpace:ed,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!Td.has(e))throw new Error('Unsupported working color space, "'.concat(e,'".'));this._workingColorSpace=e},convert:function(e,t,i){if(!1===this.enabled||t===i||!t||!i)return e;var n=Md[t].toReference;return(0,Md[i].fromReference)(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return Md[e].primaries},getTransfer:function(e){return""===e?nd:Md[e].transfer}};function Nd(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Bd(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Ad=function(){return x()((function e(){k()(this,e)}),null,[{key:"getDataURL",value:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Ed&&(Ed=_d("canvas")),Ed.width=e.width,Ed.height=e.height;var i=Ed.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Ed}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")}},{key:"sRGBToLinear",value:function(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var t=_d("canvas");t.width=e.width,t.height=e.height;var i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);for(var n=i.getImageData(0,0,e.width,e.height),o=n.data,s=0;s0&&void 0!==arguments[0]?arguments[0]:null;k()(this,e),this.isSource=!0,Object.defineProperty(this,"id",{value:Ld++}),this.uuid=dd(),this.data=t,this.dataReady=!0,this.version=0}),[{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];var i={uuid:this.uuid,url:""},n=this.data;if(null!==n){var o;if(Array.isArray(n)){o=[];for(var s=0,a=n.length;s0&&void 0!==arguments[0]?arguments[0]:t.DEFAULT_IMAGE,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1001,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1001,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1006,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1008,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1023,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1009,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:t.DEFAULT_ANISOTROPY,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"";return k()(this,t),(e=qp(this,t)).isTexture=!0,Object.defineProperty(Yp()(e),"id",{value:Rd++}),e.uuid=dd(),e.name="",e.source=new Id(i),e.mipmaps=[],e.mapping=n,e.channel=0,e.wrapS=o,e.wrapT=s,e.magFilter=a,e.minFilter=r,e.anisotropy=u,e.format=l,e.internalFormat=null,e.type=c,e.offset=new bd(0,0),e.repeat=new bd(1,1),e.center=new bd(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new Cd,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.colorSpace=h,e.userData={},e.version=0,e.onUpdate=null,e.isRenderTargetTexture=!1,e.pmremVersion=0,e}return wn()(t,e),x()(t,[{key:"image",get:function(){return this.source.data},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.source.data=e}},{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,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.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002: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 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002: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}},{key:"needsUpdate",set:function(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}},{key:"needsPMREMUpdate",set:function(e){!0===e&&this.pmremVersion++}}])}(ud);zd.DEFAULT_IMAGE=null,zd.DEFAULT_MAPPING=300,zd.DEFAULT_ANISOTROPY=1;var Fd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,e),e.prototype.isVector4=!0,this.x=t,this.y=i,this.z=n,this.w=o}),[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(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)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(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}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(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}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,i=this.y,n=this.z,o=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*n+s[12]*o,this.y=s[1]*t+s[5]*i+s[9]*n+s[13]*o,this.z=s[2]*t+s[6]*i+s[10]*n+s[14]*o,this.w=s[3]*t+s[7]*i+s[11]*n+s[15]*o,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var 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}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,i,n,o,s=.01,a=.1,r=e.elements,l=r[0],c=r[4],u=r[8],h=r[1],p=r[5],d=r[9],m=r[2],f=r[6],v=r[10];if(Math.abs(c-h)y&&g>b?gb?y1&&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}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:return e.next=6,this.z;case 6:return e.next=8,this.w;case 8:case"end":return e.stop()}}),e,this)}))}])}(),Hd=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,t),(e=qp(this,t,[null])).isDataArrayTexture=!0,e.image={data:i,width:n,height:o,depth:s},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return wn()(t,e),x()(t)}(zd),Vd=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,t),(e=qp(this,t,[null])).isData3DTexture=!0,e.image={data:i,width:n,height:o,depth:s},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return wn()(t,e),x()(t)}(zd),Gd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,e),this.isQuaternion=!0,this._x=t,this._y=i,this._z=n,this._w=o}),[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e._x,n=e._y,o=e._z,s=e._order,a=Math.cos,r=Math.sin,l=a(i/2),c=a(n/2),u=a(o/2),h=r(i/2),p=r(n/2),d=r(o/2);switch(s){case"XYZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"YXZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"ZXY":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"ZYX":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"YZX":this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d;break;case"XZY":this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,i=t[0],n=t[4],o=t[8],s=t[1],a=t[5],r=t[9],l=t[2],c=t[6],u=t[10],h=i+a+u;if(h>0){var p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(c-r)*p,this._y=(o-l)*p,this._z=(s-n)*p}else if(i>a&&i>u){var d=2*Math.sqrt(1+i-a-u);this._w=(c-r)/d,this._x=.25*d,this._y=(n+s)/d,this._z=(o+l)/d}else if(a>u){var m=2*Math.sqrt(1+a-i-u);this._w=(o-l)/m,this._x=(n+s)/m,this._y=.25*m,this._z=(r+c)/m}else{var f=2*Math.sqrt(1+u-i-a);this._w=(s-n)/f,this._x=(o+l)/f,this._y=(r+c)/f,this._z=.25*f}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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=i),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(md(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var i=this.angleTo(e);if(0===i)return this;var n=Math.min(1,t/i);return this.slerp(e,n),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var 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}},{key:"multiply",value:function(e){return this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var i=e._x,n=e._y,o=e._z,s=e._w,a=t._x,r=t._y,l=t._z,c=t._w;return this._x=i*c+s*a+n*l-o*r,this._y=n*c+s*r+o*a-i*l,this._z=o*c+s*l+i*r-n*a,this._w=s*c-i*a-n*r-o*l,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,n=this._y,o=this._z,s=this._w,a=s*e._w+i*e._x+n*e._y+o*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=s,this._x=i,this._y=n,this._z=o,this;var r=1-a*a;if(r<=Number.EPSILON){var l=1-t;return this._w=l*s+t*this._w,this._x=l*i+t*this._x,this._y=l*n+t*this._y,this._z=l*o+t*this._z,this.normalize(),this}var c=Math.sqrt(r),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,p=Math.sin(t*u)/c;return this._w=s*h+this._w*p,this._x=i*h+this._x*p,this._y=n*h+this._y*p,this._z=o*h+this._z*p,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,i){return this.copy(e).slerp(t,i)}},{key:"random",value:function(){var e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),o=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),o*Math.sin(t),o*Math.cos(t))}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var 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}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}},{key:"toJSON",value:function(){return this.toArray()}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._x;case 2:return e.next=4,this._y;case 4:return e.next=6,this._z;case 6:return e.next=8,this._w;case 8:case"end":return e.stop()}}),e,this)}))}],[{key:"slerpFlat",value:function(e,t,i,n,o,s,a){var r=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3],h=o[s+0],p=o[s+1],d=o[s+2],m=o[s+3];if(0===a)return e[t+0]=r,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===a)return e[t+0]=h,e[t+1]=p,e[t+2]=d,void(e[t+3]=m);if(u!==m||r!==h||l!==p||c!==d){var f=1-a,v=r*h+l*p+c*d+u*m,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var b=Math.sqrt(y),C=Math.atan2(b,v*g);f=Math.sin(f*C)/b,a=Math.sin(a*C)/b}var w=a*g;if(r=r*f+h*w,l=l*f+p*w,c=c*f+d*w,u=u*f+m*w,f===1-a){var k=1/Math.sqrt(r*r+l*l+c*c+u*u);r*=k,l*=k,c*=k,u*=k}}e[t]=r,e[t+1]=l,e[t+2]=c,e[t+3]=u}},{key:"multiplyQuaternionsFlat",value:function(e,t,i,n,o,s){var a=i[n],r=i[n+1],l=i[n+2],c=i[n+3],u=o[s],h=o[s+1],p=o[s+2],d=o[s+3];return e[t]=a*d+c*u+r*p-l*h,e[t+1]=r*d+c*h+l*u-a*p,e[t+2]=l*d+c*p+a*h-r*u,e[t+3]=c*d-a*u-r*h-l*p,e}}])}(),Wd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;k()(this,e),e.prototype.isVector3=!0,this.x=t,this.y=i,this.z=n}),[{key:"set",value:function(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(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)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return this.applyQuaternion(Yd.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(Yd.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.elements;return this.x=o[0]*t+o[3]*i+o[6]*n,this.y=o[1]*t+o[4]*i+o[7]*n,this.z=o[2]*t+o[5]*i+o[8]*n,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.elements,s=1/(o[3]*t+o[7]*i+o[11]*n+o[15]);return this.x=(o[0]*t+o[4]*i+o[8]*n+o[12])*s,this.y=(o[1]*t+o[5]*i+o[9]*n+o[13])*s,this.z=(o[2]*t+o[6]*i+o[10]*n+o[14])*s,this}},{key:"applyQuaternion",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.x,s=e.y,a=e.z,r=e.w,l=2*(s*n-a*i),c=2*(a*t-o*n),u=2*(o*i-s*t);return this.x=t+r*l+s*u-a*c,this.y=i+r*c+a*l-o*u,this.z=n+r*u+o*c-s*l,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n,this.y=o[1]*t+o[5]*i+o[9]*n,this.z=o[2]*t+o[6]*i+o[10]*n,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(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}},{key:"max",value:function(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}},{key:"clamp",value:function(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}},{key:"clampScalar",value:function(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}},{key:"clampLength",value:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(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}},{key:"lerpVectors",value:function(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}},{key:"cross",value:function(e){return this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var i=e.x,n=e.y,o=e.z,s=t.x,a=t.y,r=t.z;return this.x=n*r-o*a,this.y=o*s-i*r,this.z=i*a-n*s,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}},{key:"projectOnPlane",value:function(e){return Ud.copy(this).projectOnVector(e),this.sub(Ud)}},{key:"reflect",value:function(e){return this.sub(Ud.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var i=this.dot(e)/t;return Math.acos(md(i,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,i){var n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"setFromEuler",value:function(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}},{key:"setFromColor",value:function(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var 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}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}},{key:"randomDirection",value:function(){var e=Math.random()*Math.PI*2,t=2*Math.random()-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:return e.next=6,this.z;case 6:case"end":return e.stop()}}),e,this)}))}])}(),Ud=new Wd,Yd=new Gd,Jd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd(1/0,1/0,1/0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd(-1/0,-1/0,-1/0);k()(this,e),this.isBox3=!0,this.min=t,this.max=i}),[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){this.makeEmpty();for(var t=0,i=e.length;t1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);var i=e.geometry;if(void 0!==i){var n=i.getAttribute("position");if(!0===t&&void 0!==n&&!0!==e.isInstancedMesh)for(var o=0,s=n.count;othis.max.x||e.ythis.max.y||e.zthis.max.z)}},{key:"containsBox",value:function(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}},{key:"getParameter",value:function(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))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,Xd),Xd.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(nm),om.subVectors(this.max,nm),Kd.subVectors(e.a,nm),Qd.subVectors(e.b,nm),$d.subVectors(e.c,nm),em.subVectors(Qd,Kd),tm.subVectors($d,Qd),im.subVectors(Kd,$d);var t=[0,-em.z,em.y,0,-tm.z,tm.y,0,-im.z,im.y,em.z,0,-em.x,tm.z,0,-tm.x,im.z,0,-im.x,-em.y,em.x,0,-tm.y,tm.x,0,-im.y,im.x,0];return!!rm(t,Kd,Qd,$d,om)&&(!!rm(t=[1,0,0,0,1,0,0,0,1],Kd,Qd,$d,om)&&(sm.crossVectors(em,tm),rm(t=[sm.x,sm.y,sm.z],Kd,Qd,$d,om)))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return this.clampPoint(e,Xd).distanceTo(e)}},{key:"getBoundingSphere",value:function(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(Xd).length()),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(qd[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),qd[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),qd[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),qd[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),qd[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),qd[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),qd[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),qd[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(qd)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}])}(),qd=[new Wd,new Wd,new Wd,new Wd,new Wd,new Wd,new Wd,new Wd],Xd=new Wd,Zd=new Jd,Kd=new Wd,Qd=new Wd,$d=new Wd,em=new Wd,tm=new Wd,im=new Wd,nm=new Wd,om=new Wd,sm=new Wd,am=new Wd;function rm(e,t,i,n,o){for(var s=0,a=e.length-3;s<=a;s+=3){am.fromArray(e,s);var r=o.x*Math.abs(am.x)+o.y*Math.abs(am.y)+o.z*Math.abs(am.z),l=t.dot(am),c=i.dot(am),u=n.dot(am);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>r)return!1}return!0}var lm=new Jd,cm=new Wd,um=new Wd,hm=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;k()(this,e),this.isSphere=!0,this.center=t,this.radius=i}),[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var i=this.center;void 0!==t?i.copy(t):lm.setFromPoints(e).getCenter(i);for(var n=0,o=0,s=e.length;othis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;cm.subVectors(e,this.center);var t=cm.lengthSq();if(t>this.radius*this.radius){var i=Math.sqrt(t),n=.5*(i-this.radius);this.center.addScaledVector(cm,n/i),this.radius+=n}return this}},{key:"union",value:function(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(um.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(cm.copy(e.center).add(um)),this.expandByPoint(cm.copy(e.center).sub(um))),this)}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),pm=new Wd,dm=new Wd,mm=new Wd,fm=new Wd,vm=new Wd,gm=new Wd,ym=new Wd,bm=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd(0,0,-1);k()(this,e),this.origin=t,this.direction=i}),[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,pm)),this}},{key:"closestPointToPoint",value:function(e,t){t.subVectors(e,this.origin);var i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=pm.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(pm.copy(this.origin).addScaledVector(this.direction,t),pm.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,i,n){dm.copy(e).add(t).multiplyScalar(.5),mm.copy(t).sub(e).normalize(),fm.copy(this.origin).sub(dm);var o,s,a,r,l=.5*e.distanceTo(t),c=-this.direction.dot(mm),u=fm.dot(this.direction),h=-fm.dot(mm),p=fm.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(s=c*u-h,r=l*d,(o=c*h-u)>=0)if(s>=-r)if(s<=r){var m=1/d;a=(o*=m)*(o+c*(s*=m)+2*u)+s*(c*o+s+2*h)+p}else s=l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*h)+p;else s=-l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*h)+p;else s<=-r?a=-(o=Math.max(0,-(-c*l+u)))*o+(s=o>0?-l:Math.min(Math.max(-l,-h),l))*(s+2*h)+p:s<=r?(o=0,a=(s=Math.min(Math.max(-l,-h),l))*(s+2*h)+p):a=-(o=Math.max(0,-(c*l+u)))*o+(s=o>0?l:Math.min(Math.max(-l,-h),l))*(s+2*h)+p;else s=c>0?-l:l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*h)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,o),n&&n.copy(dm).addScaledVector(mm,s),a}},{key:"intersectSphere",value:function(e,t){pm.subVectors(e.center,this.origin);var i=pm.dot(this.direction),n=pm.dot(pm)-i*i,o=e.radius*e.radius;if(n>o)return null;var s=Math.sqrt(o-n),a=i-s,r=i+s;return r<0?null:a<0?this.at(r,t):this.at(a,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}},{key:"intersectPlane",value:function(e,t){var i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var i,n,o,s,a,r,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(i=(e.min.x-h.x)*l,n=(e.max.x-h.x)*l):(i=(e.max.x-h.x)*l,n=(e.min.x-h.x)*l),c>=0?(o=(e.min.y-h.y)*c,s=(e.max.y-h.y)*c):(o=(e.max.y-h.y)*c,s=(e.min.y-h.y)*c),i>s||o>n?null:((o>i||isNaN(i))&&(i=o),(s=0?(a=(e.min.z-h.z)*u,r=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,r=(e.min.z-h.z)*u),i>r||a>n?null:((a>i||i!=i)&&(i=a),(r=0?i:n,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,pm)}},{key:"intersectTriangle",value:function(e,t,i,n,o){vm.subVectors(t,e),gm.subVectors(i,e),ym.crossVectors(vm,gm);var s,a=this.direction.dot(ym);if(a>0){if(n)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}fm.subVectors(this.origin,e);var r=s*this.direction.dot(gm.crossVectors(fm,gm));if(r<0)return null;var l=s*this.direction.dot(vm.cross(fm));if(l<0)return null;if(r+l>a)return null;var c=-s*fm.dot(ym);return c<0?null:this.at(c/a,o)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),Cm=function(){function e(t,i,n,o,s,a,r,l,c,u,h,p,d,m,f,v){k()(this,e),e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,i,n,o,s,a,r,l,c,u,h,p,d,m,f,v)}return x()(e,[{key:"set",value:function(e,t,i,n,o,s,a,r,l,c,u,h,p,d,m,f){var v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=o,v[5]=s,v[9]=a,v[13]=r,v[2]=l,v[6]=c,v[10]=u,v[14]=h,v[3]=p,v[7]=d,v[11]=m,v[15]=f,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}},{key:"setFromMatrix3",value:function(e){var 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}},{key:"extractBasis",value:function(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,i=e.elements,n=1/wm.setFromMatrixColumn(e,0).length(),o=1/wm.setFromMatrixColumn(e,1).length(),s=1/wm.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*o,t[5]=i[5]*o,t[6]=i[6]*o,t[7]=0,t[8]=i[8]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){var t=this.elements,i=e.x,n=e.y,o=e.z,s=Math.cos(i),a=Math.sin(i),r=Math.cos(n),l=Math.sin(n),c=Math.cos(o),u=Math.sin(o);if("XYZ"===e.order){var h=s*c,p=s*u,d=a*c,m=a*u;t[0]=r*c,t[4]=-r*u,t[8]=l,t[1]=p+d*l,t[5]=h-m*l,t[9]=-a*r,t[2]=m-h*l,t[6]=d+p*l,t[10]=s*r}else if("YXZ"===e.order){var f=r*c,v=r*u,g=l*c,y=l*u;t[0]=f+y*a,t[4]=g*a-v,t[8]=s*l,t[1]=s*u,t[5]=s*c,t[9]=-a,t[2]=v*a-g,t[6]=y+f*a,t[10]=s*r}else if("ZXY"===e.order){var b=r*c,C=r*u,w=l*c,k=l*u;t[0]=b-k*a,t[4]=-s*u,t[8]=w+C*a,t[1]=C+w*a,t[5]=s*c,t[9]=k-b*a,t[2]=-s*l,t[6]=a,t[10]=s*r}else if("ZYX"===e.order){var _=s*c,x=s*u,S=a*c,E=a*u;t[0]=r*c,t[4]=S*l-x,t[8]=_*l+E,t[1]=r*u,t[5]=E*l+_,t[9]=x*l-S,t[2]=-l,t[6]=a*r,t[10]=s*r}else if("YZX"===e.order){var P=s*r,D=s*l,M=a*r,T=a*l;t[0]=r*c,t[4]=T-P*u,t[8]=M*u+D,t[1]=u,t[5]=s*c,t[9]=-a*c,t[2]=-l*c,t[6]=D*u+M,t[10]=P-T*u}else if("XZY"===e.order){var O=s*r,N=s*l,B=a*r,A=a*l;t[0]=r*c,t[4]=-u,t[8]=l*c,t[1]=O*u+A,t[5]=s*c,t[9]=N*u-B,t[2]=B*u-N,t[6]=a*c,t[10]=A*u+O}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(_m,e,xm)}},{key:"lookAt",value:function(e,t,i){var n=this.elements;return Pm.subVectors(e,t),0===Pm.lengthSq()&&(Pm.z=1),Pm.normalize(),Sm.crossVectors(i,Pm),0===Sm.lengthSq()&&(1===Math.abs(i.z)?Pm.x+=1e-4:Pm.z+=1e-4,Pm.normalize(),Sm.crossVectors(i,Pm)),Sm.normalize(),Em.crossVectors(Pm,Sm),n[0]=Sm.x,n[4]=Em.x,n[8]=Pm.x,n[1]=Sm.y,n[5]=Em.y,n[9]=Pm.y,n[2]=Sm.z,n[6]=Em.z,n[10]=Pm.z,this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var i=e.elements,n=t.elements,o=this.elements,s=i[0],a=i[4],r=i[8],l=i[12],c=i[1],u=i[5],h=i[9],p=i[13],d=i[2],m=i[6],f=i[10],v=i[14],g=i[3],y=i[7],b=i[11],C=i[15],w=n[0],k=n[4],_=n[8],x=n[12],S=n[1],E=n[5],P=n[9],D=n[13],M=n[2],T=n[6],O=n[10],N=n[14],B=n[3],A=n[7],L=n[11],I=n[15];return o[0]=s*w+a*S+r*M+l*B,o[4]=s*k+a*E+r*T+l*A,o[8]=s*_+a*P+r*O+l*L,o[12]=s*x+a*D+r*N+l*I,o[1]=c*w+u*S+h*M+p*B,o[5]=c*k+u*E+h*T+p*A,o[9]=c*_+u*P+h*O+p*L,o[13]=c*x+u*D+h*N+p*I,o[2]=d*w+m*S+f*M+v*B,o[6]=d*k+m*E+f*T+v*A,o[10]=d*_+m*P+f*O+v*L,o[14]=d*x+m*D+f*N+v*I,o[3]=g*w+y*S+b*M+C*B,o[7]=g*k+y*E+b*T+C*A,o[11]=g*_+y*P+b*O+C*L,o[15]=g*x+y*D+b*N+C*I,this}},{key:"multiplyScalar",value:function(e){var 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}},{key:"determinant",value:function(){var e=this.elements,t=e[0],i=e[4],n=e[8],o=e[12],s=e[1],a=e[5],r=e[9],l=e[13],c=e[2],u=e[6],h=e[10],p=e[14];return e[3]*(+o*r*u-n*l*u-o*a*h+i*l*h+n*a*p-i*r*p)+e[7]*(+t*r*p-t*l*h+o*s*h-n*s*p+n*l*c-o*r*c)+e[11]*(+t*l*u-t*a*p-o*s*u+i*s*p+o*a*c-i*l*c)+e[15]*(-n*a*c-t*r*u+t*a*h+n*s*u-i*s*h+i*r*c)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,i){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],r=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11],d=e[12],m=e[13],f=e[14],v=e[15],g=u*f*l-m*h*l+m*r*p-a*f*p-u*r*v+a*h*v,y=d*h*l-c*f*l-d*r*p+s*f*p+c*r*v-s*h*v,b=c*m*l-d*u*l+d*a*p-s*m*p-c*a*v+s*u*v,C=d*u*r-c*m*r-d*a*h+s*m*h+c*a*f-s*u*f,w=t*g+i*y+n*b+o*C;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var k=1/w;return e[0]=g*k,e[1]=(m*h*o-u*f*o-m*n*p+i*f*p+u*n*v-i*h*v)*k,e[2]=(a*f*o-m*r*o+m*n*l-i*f*l-a*n*v+i*r*v)*k,e[3]=(u*r*o-a*h*o-u*n*l+i*h*l+a*n*p-i*r*p)*k,e[4]=y*k,e[5]=(c*f*o-d*h*o+d*n*p-t*f*p-c*n*v+t*h*v)*k,e[6]=(d*r*o-s*f*o-d*n*l+t*f*l+s*n*v-t*r*v)*k,e[7]=(s*h*o-c*r*o+c*n*l-t*h*l-s*n*p+t*r*p)*k,e[8]=b*k,e[9]=(d*u*o-c*m*o-d*i*p+t*m*p+c*i*v-t*u*v)*k,e[10]=(s*m*o-d*a*o+d*i*l-t*m*l-s*i*v+t*a*v)*k,e[11]=(c*a*o-s*u*o-c*i*l+t*u*l+s*i*p-t*a*p)*k,e[12]=C*k,e[13]=(c*m*n-d*u*n+d*i*h-t*m*h-c*i*f+t*u*f)*k,e[14]=(d*a*n-s*m*n-d*i*r+t*m*r+s*i*f-t*a*f)*k,e[15]=(s*u*n-c*a*n+c*i*r-t*u*r-s*i*h+t*a*h)*k,this}},{key:"scale",value:function(e){var t=this.elements,i=e.x,n=e.y,o=e.z;return t[0]*=i,t[4]*=n,t[8]*=o,t[1]*=i,t[5]*=n,t[9]*=o,t[2]*=i,t[6]*=n,t[10]*=o,t[3]*=i,t[7]*=n,t[11]*=o,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}},{key:"makeTranslation",value:function(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var i=Math.cos(t),n=Math.sin(t),o=1-i,s=e.x,a=e.y,r=e.z,l=o*s,c=o*a;return this.set(l*s+i,l*a-n*r,l*r+n*a,0,l*a+n*r,c*a+i,c*r-n*s,0,l*r-n*a,c*r+n*s,o*r*r+i,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,i,n,o,s){return this.set(1,i,o,0,e,1,s,0,t,n,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,i){var n=this.elements,o=t._x,s=t._y,a=t._z,r=t._w,l=o+o,c=s+s,u=a+a,h=o*l,p=o*c,d=o*u,m=s*c,f=s*u,v=a*u,g=r*l,y=r*c,b=r*u,C=i.x,w=i.y,k=i.z;return n[0]=(1-(m+v))*C,n[1]=(p+b)*C,n[2]=(d-y)*C,n[3]=0,n[4]=(p-b)*w,n[5]=(1-(h+v))*w,n[6]=(f+g)*w,n[7]=0,n[8]=(d+y)*k,n[9]=(f-g)*k,n[10]=(1-(h+m))*k,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}},{key:"decompose",value:function(e,t,i){var n=this.elements,o=wm.set(n[0],n[1],n[2]).length(),s=wm.set(n[4],n[5],n[6]).length(),a=wm.set(n[8],n[9],n[10]).length();this.determinant()<0&&(o=-o),e.x=n[12],e.y=n[13],e.z=n[14],km.copy(this);var r=1/o,l=1/s,c=1/a;return km.elements[0]*=r,km.elements[1]*=r,km.elements[2]*=r,km.elements[4]*=l,km.elements[5]*=l,km.elements[6]*=l,km.elements[8]*=c,km.elements[9]*=c,km.elements[10]*=c,t.setFromRotationMatrix(km),i.x=o,i.y=s,i.z=a,this}},{key:"makePerspective",value:function(e,t,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=2*o/(t-e),h=2*o/(i-n),p=(t+e)/(t-e),d=(i+n)/(i-n);if(l===ld)a=-(s+o)/(s-o),r=-2*s*o/(s-o);else{if(l!==cd)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);a=-s/(s-o),r=-s*o/(s-o)}return c[0]=u,c[4]=0,c[8]=p,c[12]=0,c[1]=0,c[5]=h,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=a,c[14]=r,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}},{key:"makeOrthographic",value:function(e,t,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=1/(t-e),h=1/(i-n),p=1/(s-o),d=(t+e)*u,m=(i+n)*h;if(l===ld)a=(s+o)*p,r=-2*p;else{if(l!==cd)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);a=o*p,r=-1*p}return c[0]=2*u,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*h,c[9]=0,c[13]=-m,c[2]=0,c[6]=0,c[10]=r,c[14]=-a,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,i=e.elements,n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<16;i++)this.elements[i]=e[i+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}])}(),wm=new Wd,km=new Cm,_m=new Wd(0,0,0),xm=new Wd(1,1,1),Sm=new Wd,Em=new Wd,Pm=new Wd,Dm=new Cm,Mm=new Gd,Tm=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DEFAULT_ORDER;k()(this,e),this.isEuler=!0,this._x=t,this._y=i,this._z=n,this._order=o}),[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e.elements,o=n[0],s=n[4],a=n[8],r=n[1],l=n[5],c=n[9],u=n[2],h=n[6],p=n[10];switch(t){case"XYZ":this._y=Math.asin(md(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-md(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(r,l)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(md(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(r,o));break;case"ZYX":this._y=Math.asin(-md(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(r,o)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(md(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-md(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,i){return Dm.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Dm,t,i)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(e){return Mm.setFromEuler(this),this.setFromQuaternion(Mm,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(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}},{key:"toArray",value:function(){var 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}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._x;case 2:return e.next=4,this._y;case 4:return e.next=6,this._z;case 6:return e.next=8,this._order;case 8:case"end":return e.stop()}}),e,this)}))}])}();Tm.DEFAULT_ORDER="XYZ";var Om=function(){return x()((function e(){k()(this,e),this.mask=1}),[{key:"set",value:function(e){this.mask=(1<>>0}},{key:"enable",value:function(e){this.mask|=1<1){for(var t=0;t1){for(var t=0;t2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&i.push(this);for(var n=this.children,o=0,s=n.length;o0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map((function(e){return{boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}})),n.maxGeometryCount=this._maxGeometryCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(e),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=o(e.geometries,this.geometry);var s=this.geometry.parameters;if(void 0!==s&&void 0!==s.shapes){var a=s.shapes;if(Array.isArray(a))for(var r=0,l=a.length;r0){n.children=[];for(var d=0;d0){n.animations=[];for(var m=0;m0&&(i.geometries=v),g.length>0&&(i.materials=g),y.length>0&&(i.textures=y),b.length>0&&(i.images=b),C.length>0&&(i.shapes=C),w.length>0&&(i.skeletons=w),k.length>0&&(i.animations=k),_.length>0&&(i.nodes=_)}return i.object=n,i;function x(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var 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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,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.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new Wd,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Wd;k()(this,e),this.a=t,this.b=i,this.c=n}return x()(e,[{key:"set",value:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}},{key:"setFromPointsAndIndices",value:function(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}},{key:"setFromAttributeAndIndices",value:function(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return qm.subVectors(this.c,this.b),Xm.subVectors(this.a,this.b),.5*qm.cross(Xm).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,i){return e.getBarycoord(t,this.a,this.b,this.c,i)}},{key:"getInterpolation",value:function(t,i,n,o,s){return e.getInterpolation(t,this.a,this.b,this.c,i,n,o,s)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){var i,n,o=this.a,s=this.b,a=this.c;Qm.subVectors(s,o),$m.subVectors(a,o),tf.subVectors(e,o);var r=Qm.dot(tf),l=$m.dot(tf);if(r<=0&&l<=0)return t.copy(o);nf.subVectors(e,s);var c=Qm.dot(nf),u=$m.dot(nf);if(c>=0&&u<=c)return t.copy(s);var h=r*u-c*l;if(h<=0&&r>=0&&c<=0)return i=r/(r-c),t.copy(o).addScaledVector(Qm,i);of.subVectors(e,a);var p=Qm.dot(of),d=$m.dot(of);if(d>=0&&p<=d)return t.copy(a);var m=p*l-r*d;if(m<=0&&l>=0&&d<=0)return n=l/(l-d),t.copy(o).addScaledVector($m,n);var f=c*d-p*u;if(f<=0&&u-c>=0&&p-d>=0)return ef.subVectors(a,s),n=(u-c)/(u-c+(p-d)),t.copy(s).addScaledVector(ef,n);var v=1/(f+m+h);return i=m*v,n=h*v,t.copy(o).addScaledVector(Qm,i).addScaledVector($m,n)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,i,n){n.subVectors(i,t),qm.subVectors(e,t),n.cross(qm);var o=n.lengthSq();return o>0?n.multiplyScalar(1/Math.sqrt(o)):n.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,i,n,o){qm.subVectors(n,t),Xm.subVectors(i,t),Zm.subVectors(e,t);var s=qm.dot(qm),a=qm.dot(Xm),r=qm.dot(Zm),l=Xm.dot(Xm),c=Xm.dot(Zm),u=s*l-a*a;if(0===u)return o.set(0,0,0),null;var h=1/u,p=(l*r-a*c)*h,d=(s*c-a*r)*h;return o.set(1-p-d,d,p)}},{key:"containsPoint",value:function(e,t,i,n){return null!==this.getBarycoord(e,t,i,n,Km)&&Km.x>=0&&Km.y>=0&&Km.x+Km.y<=1}},{key:"getInterpolation",value:function(e,t,i,n,o,s,a,r){return null===this.getBarycoord(e,t,i,n,Km)?(r.x=0,r.y=0,"z"in r&&(r.z=0),"w"in r&&(r.w=0),null):(r.setScalar(0),r.addScaledVector(o,Km.x),r.addScaledVector(s,Km.y),r.addScaledVector(a,Km.z),r)}},{key:"isFrontFacing",value:function(e,t,i,n){return qm.subVectors(i,t),Xm.subVectors(e,t),qm.cross(Xm).dot(n)<0}}])}(),af={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},rf={h:0,s:0,l:0},lf={h:0,s:0,l:0};function cf(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}var uf=function(){return x()((function e(t,i,n){return k()(this,e),this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,i,n)}),[{key:"set",value:function(e,t,i){if(void 0===t&&void 0===i){var n=e;n&&n.isColor?this.copy(n):"number"==typeof n?this.setHex(n):"string"==typeof n&&this.setStyle(n)}else this.setRGB(e,t,i);return this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,Od.toWorkingColorSpace(this,t),this}},{key:"setRGB",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Od.workingColorSpace;return this.r=e,this.g=t,this.b=i,Od.toWorkingColorSpace(this,n),this}},{key:"setHSL",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Od.workingColorSpace;if(e=fd(e,1),t=md(t,0,1),i=md(i,0,1),0===t)this.r=this.g=this.b=i;else{var o=i<=.5?i*(1+t):i+t-i*t,s=2*i-o;this.r=cf(s,o,e+1/3),this.g=cf(s,o,e),this.b=cf(s,o,e-1/3)}return Od.toWorkingColorSpace(this,n),this}},{key:"setStyle",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p;function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){var o,s=t[1],a=t[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,i);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,i);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,i);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){var r=t[1],l=r.length;if(3===l)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,i);if(6===l)return this.setHex(parseInt(r,16),i);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,i);return this}},{key:"setColorName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p,i=af[e.toLowerCase()];return void 0!==i?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copySRGBToLinear",value:function(e){return this.r=Nd(e.r),this.g=Nd(e.g),this.b=Nd(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=Bd(e.r),this.g=Bd(e.g),this.b=Bd(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$p;return Od.fromWorkingColorSpace(hf.copy(this),e),65536*Math.round(md(255*hf.r,0,255))+256*Math.round(md(255*hf.g,0,255))+Math.round(md(255*hf.b,0,255))}},{key:"getHexString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$p;return("000000"+this.getHex(e).toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Od.workingColorSpace;Od.fromWorkingColorSpace(hf.copy(this),t);var i,n,o=hf.r,s=hf.g,a=hf.b,r=Math.max(o,s,a),l=Math.min(o,s,a),c=(l+r)/2;if(l===r)i=0,n=0;else{var u=r-l;switch(n=c<=.5?u/(r+l):u/(2-r-l),r){case o:i=(s-a)/u+(s1&&void 0!==arguments[1]?arguments[1]:Od.workingColorSpace;return Od.fromWorkingColorSpace(hf.copy(this),t),e.r=hf.r,e.g=hf.g,e.b=hf.b,e}},{key:"getStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$p;Od.fromWorkingColorSpace(hf.copy(this),e);var t=hf.r,i=hf.g,n=hf.b;return e!==$p?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(i.toFixed(3)," ").concat(n.toFixed(3),")"):"rgb(".concat(Math.round(255*t),",").concat(Math.round(255*i),",").concat(Math.round(255*n),")")}},{key:"offsetHSL",value:function(e,t,i){return this.getHSL(rf),this.setHSL(rf.h+e,rf.s+t,rf.l+i)}},{key:"add",value:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}},{key:"addColors",value:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}},{key:"addScalar",value:function(e){return this.r+=e,this.g+=e,this.b+=e,this}},{key:"sub",value:function(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}},{key:"multiply",value:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}},{key:"multiplyScalar",value:function(e){return this.r*=e,this.g*=e,this.b*=e,this}},{key:"lerp",value:function(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}},{key:"lerpColors",value:function(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}},{key:"lerpHSL",value:function(e,t){this.getHSL(rf),e.getHSL(lf);var i=vd(rf.h,lf.h,t),n=vd(rf.s,lf.s,t),o=vd(rf.l,lf.l,t);return this.setHSL(i,n,o),this}},{key:"setFromVector3",value:function(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}},{key:"applyMatrix3",value:function(e){var t=this.r,i=this.g,n=this.b,o=e.elements;return this.r=o[0]*t+o[3]*i+o[6]*n,this.g=o[1]*t+o[4]*i+o[7]*n,this.b=o[2]*t+o[5]*i+o[8]*n,this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}},{key:"fromArray",value:function(e){var 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}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.r;case 2:return e.next=4,this.g;case 4:return e.next=6,this.b;case 6:case"end":return e.stop()}}),e,this)}))}])}(),hf=new uf;uf.NAMES=af;var pf=0,df=function(e){function t(){var e;return k()(this,t),(e=qp(this,t)).isMaterial=!0,Object.defineProperty(Yp()(e),"id",{value:pf++}),e.uuid=dd(),e.name="",e.type="Material",e.blending=1,e.side=0,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.alphaHash=!1,e.blendSrc=204,e.blendDst=205,e.blendEquation=100,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.blendColor=new uf(0,0,0),e.blendAlpha=0,e.depthFunc=3,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=ad,e.stencilZFail=ad,e.stencilZPass=ad,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.forceSinglePass=!1,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e._alphaTest=0,e}return wn()(t,e),x()(t,[{key:"alphaTest",get:function(){return this._alphaTest},set:function(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}},{key:"onBuild",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i){var n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:console.warn("THREE.Material: '".concat(t,"' is not a property of THREE.").concat(this.type,"."))}else console.warn("THREE.Material: parameter '".concat(t,"' has value of undefined."))}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ad&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ad&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ad&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){var o=n(e.textures),s=n(e.images);o.length>0&&(i.textures=o),s.length>0&&(i.images=s)}return i}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,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;var t=e.clippingPlanes,i=null;if(null!==t){var n=t.length;i=new Array(n);for(var o=0;o!==n;++o)i[o]=t[o].clone()}return this.clippingPlanes=i,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.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}])}(ud),mf=function(e){function t(e){var i;return k()(this,t),(i=qp(this,t)).isMeshBasicMaterial=!0,i.type="MeshBasicMaterial",i.color=new uf(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.alphaMap=null,i.envMap=null,i.envMapRotation=new Tm,i.combine=0,i.reflectivity=1,i.refractionRatio=.98,i.wireframe=!1,i.wireframeLinewidth=1,i.wireframeLinecap="round",i.wireframeLinejoin="round",i.fog=!0,i.setValues(e),i}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([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.envMapRotation.copy(e.envMapRotation),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}}])}(df);!function(){for(var e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),n=new Uint32Array(512),o=new Uint32Array(512),s=0;s<256;++s){var a=s-127;a<-27?(n[s]=0,n[256|s]=32768,o[s]=24,o[256|s]=24):a<-14?(n[s]=1024>>-a-14,n[256|s]=1024>>-a-14|32768,o[s]=-a-1,o[256|s]=-a-1):a<=15?(n[s]=a+15<<10,n[256|s]=a+15<<10|32768,o[s]=13,o[256|s]=13):a<128?(n[s]=31744,n[256|s]=64512,o[s]=24,o[256|s]=24):(n[s]=31744,n[256|s]=64512,o[s]=13,o[256|s]=13)}for(var r=new Uint32Array(2048),l=new Uint32Array(64),c=new Uint32Array(64),u=1;u<1024;++u){for(var h=u<<13,p=0;0==(8388608&h);)h<<=1,p-=8388608;h&=-8388609,p+=947912704,r[u]=h|p}for(var d=1024;d<2048;++d)r[d]=939524096+(d-1024<<13);for(var m=1;m<31;++m)l[m]=m<<23;l[31]=1199570944,l[32]=2147483648;for(var f=33;f<63;++f)l[f]=2147483648+(f-32<<23);l[63]=3347054592;for(var v=1;v<64;++v)32!==v&&(c[v]=1024)}();var ff=new Wd,vf=new bd,gf=function(){return x()((function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(k()(this,e),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=i,this.count=void 0!==t?t.length/i:0,this.normalized=n,this.usage=rd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=1015,this.version=0}),[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"updateRange",get:function(){return Sd("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"addUpdateRange",value:function(e,t){this.updateRanges.push({start:e,count:t})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(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.gpuType=e.gpuType,this}},{key:"copyAt",value:function(e,t,i){e*=this.itemSize,i*=t.itemSize;for(var n=0,o=this.itemSize;n1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"getComponent",value:function(e,t){var i=this.array[e*this.itemSize+t];return this.normalized&&(i=gd(i,this.array)),i}},{key:"setComponent",value:function(e,t,i){return this.normalized&&(i=yd(i,this.array)),this.array[e*this.itemSize+t]=i,this}},{key:"getX",value:function(e){var t=this.array[e*this.itemSize];return this.normalized&&(t=gd(t,this.array)),t}},{key:"setX",value:function(e,t){return this.normalized&&(t=yd(t,this.array)),this.array[e*this.itemSize]=t,this}},{key:"getY",value:function(e){var t=this.array[e*this.itemSize+1];return this.normalized&&(t=gd(t,this.array)),t}},{key:"setY",value:function(e,t){return this.normalized&&(t=yd(t,this.array)),this.array[e*this.itemSize+1]=t,this}},{key:"getZ",value:function(e){var t=this.array[e*this.itemSize+2];return this.normalized&&(t=gd(t,this.array)),t}},{key:"setZ",value:function(e,t){return this.normalized&&(t=yd(t,this.array)),this.array[e*this.itemSize+2]=t,this}},{key:"getW",value:function(e){var t=this.array[e*this.itemSize+3];return this.normalized&&(t=gd(t,this.array)),t}},{key:"setW",value:function(e,t){return this.normalized&&(t=yd(t,this.array)),this.array[e*this.itemSize+3]=t,this}},{key:"setXY",value:function(e,t,i){return e*=this.itemSize,this.normalized&&(t=yd(t,this.array),i=yd(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}},{key:"setXYZ",value:function(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=yd(t,this.array),i=yd(i,this.array),n=yd(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}},{key:"setXYZW",value:function(e,t,i,n,o){return e*=this.itemSize,this.normalized&&(t=yd(t,this.array),i=yd(i,this.array),n=yd(n,this.array),o=yd(o,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=o,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var 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!==rd&&(e.usage=this.usage),e}}])}(),yf=function(e){function t(e,i,n){return k()(this,t),qp(this,t,[new Uint16Array(e),i,n])}return wn()(t,e),x()(t)}(gf),bf=function(e){function t(e,i,n){return k()(this,t),qp(this,t,[new Uint32Array(e),i,n])}return wn()(t,e),x()(t)}(gf),Cf=function(e){function t(e,i,n){return k()(this,t),qp(this,t,[new Float32Array(e),i,n])}return wn()(t,e),x()(t)}(gf),wf=0,kf=new Cm,_f=new Jm,xf=new Wd,Sf=new Jd,Ef=new Jd,Pf=new Wd,Df=function(e){function t(){var e;return k()(this,t),(e=qp(this,t)).isBufferGeometry=!0,Object.defineProperty(Yp()(e),"id",{value:wf++}),e.uuid=dd(),e.name="",e.type="BufferGeometry",e.index=null,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e}return wn()(t,e),x()(t,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(kd(e)?bf:yf)(e,1):this.index=e,this}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,t){return this.attributes[e]=t,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:i})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,t){this.drawRange.start=e,this.drawRange.count=t}},{key:"applyMatrix4",value:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var n=(new Cd).getNormalMatrix(e);i.applyNormalMatrix(n),i.needsUpdate=!0}var o=this.attributes.tangent;return void 0!==o&&(o.transformDirection(e),o.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(e){return kf.makeRotationFromQuaternion(e),this.applyMatrix4(kf),this}},{key:"rotateX",value:function(e){return kf.makeRotationX(e),this.applyMatrix4(kf),this}},{key:"rotateY",value:function(e){return kf.makeRotationY(e),this.applyMatrix4(kf),this}},{key:"rotateZ",value:function(e){return kf.makeRotationZ(e),this.applyMatrix4(kf),this}},{key:"translate",value:function(e,t,i){return kf.makeTranslation(e,t,i),this.applyMatrix4(kf),this}},{key:"scale",value:function(e,t,i){return kf.makeScale(e,t,i),this.applyMatrix4(kf),this}},{key:"lookAt",value:function(e){return _f.lookAt(e),_f.updateMatrix(),this.applyMatrix4(_f.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(xf).negate(),this.translate(xf.x,xf.y,xf.z),this}},{key:"setFromPoints",value:function(e){for(var t=[],i=0,n=e.length;i0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};var n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var o=this.attributes;for(var s in o){var a=o[s];e.data.attributes[s]=a.toJSON(e.data)}var r={},l=!1;for(var c in this.morphAttributes){for(var u=this.morphAttributes[c],h=[],p=0,d=u.length;p0&&(r[c]=h,l=!0)}l&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;f.length>0&&(e.data.groups=JSON.parse(JSON.stringify(f)));var v=this.boundingSphere;return null!==v&&(e.data.boundingSphere={center:v.center.toArray(),radius:v.radius}),e}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone(t));var n=e.attributes;for(var o in n){var s=n[o];this.setAttribute(o,s.clone(t))}var a=e.morphAttributes;for(var r in a){for(var l=[],c=a[r],u=0,h=c.length;u0&&void 0!==arguments[0]?arguments[0]:new Df,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mf;return k()(this,t),(e=qp(this,t)).isMesh=!0,e.type="Mesh",e.geometry=i,e.material=n,e.updateMorphTargets(),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e,i){return Jp(t,"copy",this,3)([e,i]),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){var i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var n=0,o=i.length;nMath.pow(e.far-e.near,2))return}Mf.copy(o).invert(),Tf.copy(e.ray).applyMatrix4(Mf),null!==i.boundingBox&&!1===Tf.intersectsBox(i.boundingBox)||this._computeIntersections(e,t,Tf)}}},{key:"_computeIntersections",value:function(e,t,i){var n,o=this.geometry,s=this.material,a=o.index,r=o.attributes.position,l=o.attributes.uv,c=o.attributes.uv1,u=o.attributes.normal,h=o.groups,p=o.drawRange;if(null!==a)if(Array.isArray(s))for(var d=0,m=h.length;di.far?null:{distance:l,point:Uf.clone(),object:e}}(e,t,i,n,Bf,Af,Lf,Wf);if(u){o&&(Rf.fromBufferAttribute(o,r),zf.fromBufferAttribute(o,l),Ff.fromBufferAttribute(o,c),u.uv=sf.getInterpolation(Wf,Bf,Af,Lf,Rf,zf,Ff,new bd)),s&&(Rf.fromBufferAttribute(s,r),zf.fromBufferAttribute(s,l),Ff.fromBufferAttribute(s,c),u.uv1=sf.getInterpolation(Wf,Bf,Af,Lf,Rf,zf,Ff,new bd)),a&&(Hf.fromBufferAttribute(a,r),Vf.fromBufferAttribute(a,l),Gf.fromBufferAttribute(a,c),u.normal=sf.getInterpolation(Wf,Bf,Af,Lf,Hf,Vf,Gf,new Wd),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));var h={a:r,b:l,c:c,normal:new Wd,materialIndex:0};sf.getNormal(Bf,Af,Lf,h.normal),u.face=h}return u}var qf=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;k()(this,t),(e=qp(this,t)).type="BoxGeometry",e.parameters={width:i,height:n,depth:o,widthSegments:s,heightSegments:a,depthSegments:r};var l=e;s=Math.floor(s),a=Math.floor(a),r=Math.floor(r);var c=[],u=[],h=[],p=[],d=0,m=0;function f(e,t,i,n,o,s,a,r,f,v,g){for(var y=s/f,b=a/v,C=s/2,w=a/2,k=r/2,_=f+1,x=v+1,S=0,E=0,P=new Wd,D=0;D0?1:-1,h.push(P.x,P.y,P.z),p.push(T/f),p.push(1-D/v),S+=1}for(var N=0;N0&&void 0!==arguments[0]?arguments[0]:new Wd(1,0,0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e),this.isPlane=!0,this.normal=t,this.constant=i}),[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,i){var n=$f.subVectors(i,t).cross(ev.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}},{key:"intersectLine",value:function(e,t){var i=e.delta($f),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var o=-(e.start.dot(this.normal)+this.constant)/n;return o<0||o>1?null:t.copy(e.start).addScaledVector(i,o)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var i=t||tv.getNormalMatrix(e),n=this.coplanarPoint($f).applyMatrix4(e),o=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(o),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),nv=new hm,ov=new Wd,sv=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new iv,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iv,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new iv,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new iv,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new iv,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new iv;k()(this,e),this.planes=[t,i,n,o,s,a]}),[{key:"set",value:function(e,t,i,n,o,s){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(n),a[4].copy(o),a[5].copy(s),this}},{key:"copy",value:function(e){for(var t=this.planes,i=0;i<6;i++)t[i].copy(e.planes[i]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=this.planes,n=e.elements,o=n[0],s=n[1],a=n[2],r=n[3],l=n[4],c=n[5],u=n[6],h=n[7],p=n[8],d=n[9],m=n[10],f=n[11],v=n[12],g=n[13],y=n[14],b=n[15];if(i[0].setComponents(r-o,h-l,f-p,b-v).normalize(),i[1].setComponents(r+o,h+l,f+p,b+v).normalize(),i[2].setComponents(r+s,h+c,f+d,b+g).normalize(),i[3].setComponents(r-s,h-c,f-d,b-g).normalize(),i[4].setComponents(r-a,h-u,f-m,b-y).normalize(),t===ld)i[5].setComponents(r+a,h+u,f+m,b+y).normalize();else{if(t!==cd)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);i[5].setComponents(a,u,m,y).normalize()}return this}},{key:"intersectsObject",value:function(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),nv.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{var t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),nv.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(nv)}},{key:"intersectsSprite",value:function(e){return nv.center.set(0,0,0),nv.radius=.7071067811865476,nv.applyMatrix4(e.matrixWorld),this.intersectsSphere(nv)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,i=e.center,n=-e.radius,o=0;o<6;o++)if(t[o].distanceToPoint(i)0?e.max.x:e.min.x,ov.y=n.normal.y>0?e.max.y:e.min.y,ov.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(ov)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}();var av=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,t),(e=qp(this,t)).type="PlaneGeometry",e.parameters={width:i,height:n,widthSegments:o,heightSegments:s};for(var a=i/2,r=n/2,l=Math.floor(o),c=Math.floor(s),u=l+1,h=c+1,p=i/l,d=n/c,m=[],f=[],v=[],g=[],y=0;y 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\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 v ) { return dot( v, vec3( 0.3333333 ) ); }\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};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\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 luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, 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}\nvec3 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} // validated",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\thighp vec2 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 cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_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 ), cubeUV_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_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 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, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\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, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\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\tuniform mat3 envMapRotation;\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 ) || defined( LAMBERT )\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 ) || defined( LAMBERT )\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:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * 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#ifdef 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, envMapRotation * 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\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\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\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\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 ( LEGACY_LIGHTS )\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#else\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#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, 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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\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\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\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( ( material.ior - 1.0 ) / ( material.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, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).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_DISPERSION\n\tmaterial.dispersion = dispersion;\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, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).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_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\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\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\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}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.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\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\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\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, 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( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, 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:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\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, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\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, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\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 ], geometryNormal );\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, vLightMapUv );\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( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\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\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\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\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_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\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, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\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\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\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 = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).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( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\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 USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.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 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\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",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\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}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\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 depth, const in float near, const in float far ) {\n\treturn depth * ( 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 depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - 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_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\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, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#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\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\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\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\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#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\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:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\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, vSpotLightCoord[ 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\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\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, vSpecularMapUv );\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 saturate( 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}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\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\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\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 lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\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 dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\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;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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, vLightMapUv );\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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\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_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},lv={common:{diffuse:{value:new uf(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Cd},alphaMap:{value:null},alphaMapTransform:{value:new Cd},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Cd}},envmap:{envMap:{value:null},envMapRotation:{value:new Cd},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Cd}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Cd}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Cd},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Cd},normalScale:{value:new bd(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Cd},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Cd}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Cd}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Cd}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new uf(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 uf(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Cd},alphaTest:{value:0},uvTransform:{value:new Cd}},sprite:{diffuse:{value:new uf(16777215)},opacity:{value:1},center:{value:new bd(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Cd},alphaMap:{value:null},alphaMapTransform:{value:new Cd},alphaTest:{value:0}}},cv={basic:{uniforms:Zf([lv.common,lv.specularmap,lv.envmap,lv.aomap,lv.lightmap,lv.fog]),vertexShader:rv.meshbasic_vert,fragmentShader:rv.meshbasic_frag},lambert:{uniforms:Zf([lv.common,lv.specularmap,lv.envmap,lv.aomap,lv.lightmap,lv.emissivemap,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.fog,lv.lights,{emissive:{value:new uf(0)}}]),vertexShader:rv.meshlambert_vert,fragmentShader:rv.meshlambert_frag},phong:{uniforms:Zf([lv.common,lv.specularmap,lv.envmap,lv.aomap,lv.lightmap,lv.emissivemap,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.fog,lv.lights,{emissive:{value:new uf(0)},specular:{value:new uf(1118481)},shininess:{value:30}}]),vertexShader:rv.meshphong_vert,fragmentShader:rv.meshphong_frag},standard:{uniforms:Zf([lv.common,lv.envmap,lv.aomap,lv.lightmap,lv.emissivemap,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.roughnessmap,lv.metalnessmap,lv.fog,lv.lights,{emissive:{value:new uf(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:rv.meshphysical_vert,fragmentShader:rv.meshphysical_frag},toon:{uniforms:Zf([lv.common,lv.aomap,lv.lightmap,lv.emissivemap,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.gradientmap,lv.fog,lv.lights,{emissive:{value:new uf(0)}}]),vertexShader:rv.meshtoon_vert,fragmentShader:rv.meshtoon_frag},matcap:{uniforms:Zf([lv.common,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.fog,{matcap:{value:null}}]),vertexShader:rv.meshmatcap_vert,fragmentShader:rv.meshmatcap_frag},points:{uniforms:Zf([lv.points,lv.fog]),vertexShader:rv.points_vert,fragmentShader:rv.points_frag},dashed:{uniforms:Zf([lv.common,lv.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:rv.linedashed_vert,fragmentShader:rv.linedashed_frag},depth:{uniforms:Zf([lv.common,lv.displacementmap]),vertexShader:rv.depth_vert,fragmentShader:rv.depth_frag},normal:{uniforms:Zf([lv.common,lv.bumpmap,lv.normalmap,lv.displacementmap,{opacity:{value:1}}]),vertexShader:rv.meshnormal_vert,fragmentShader:rv.meshnormal_frag},sprite:{uniforms:Zf([lv.sprite,lv.fog]),vertexShader:rv.sprite_vert,fragmentShader:rv.sprite_frag},background:{uniforms:{uvTransform:{value:new Cd},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:rv.background_vert,fragmentShader:rv.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Cd}},vertexShader:rv.backgroundCube_vert,fragmentShader:rv.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:rv.cube_vert,fragmentShader:rv.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:rv.equirect_vert,fragmentShader:rv.equirect_frag},distanceRGBA:{uniforms:Zf([lv.common,lv.displacementmap,{referencePosition:{value:new Wd},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:rv.distanceRGBA_vert,fragmentShader:rv.distanceRGBA_frag},shadow:{uniforms:Zf([lv.lights,lv.fog,{color:{value:new uf(0)},opacity:{value:1}}]),vertexShader:rv.shadow_vert,fragmentShader:rv.shadow_frag}};cv.physical={uniforms:Zf([cv.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Cd},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Cd},clearcoatNormalScale:{value:new bd(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Cd},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Cd},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Cd},sheen:{value:0},sheenColor:{value:new uf(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Cd},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Cd},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Cd},transmissionSamplerSize:{value:new bd},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Cd},attenuationDistance:{value:0},attenuationColor:{value:new uf(0)},specularColor:{value:new uf(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Cd},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Cd},anisotropyVector:{value:new bd},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Cd}}]),vertexShader:rv.meshphysical_vert,fragmentShader:rv.meshphysical_frag};new Tm,new Cm;var uv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return k()(this,t),(e=qp(this,t)).isOrthographicCamera=!0,e.type="OrthographicCamera",e.zoom=1,e.view=null,e.left=i,e.right=n,e.top=o,e.bottom=s,e.near=a,e.far=r,e.updateProjectionMatrix(),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e,i){return Jp(t,"copy",this,3)([e,i]),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}},{key:"setViewOffset",value:function(e,t,i,n,o,s){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=i,this.view.offsetY=n,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,o=i-e,s=i+e,a=n+t,r=n-t;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s=(o+=l*this.view.offsetX)+l*this.view.width,r=(a-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,r,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var i=Jp(t,"toJSON",this,3)([e]);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,null!==this.view&&(i.object.view=Object.assign({},this.view)),i}}])}(Kf),hv=(new uv,new uf,(1+Math.sqrt(5))/2),pv=1/hv;new Wd(-hv,pv,0),new Wd(hv,pv,0),new Wd(-pv,0,hv),new Wd(pv,0,hv),new Wd(0,hv,-pv),new Wd(0,hv,pv),new Wd(-1,1,-1),new Wd(1,1,-1),new Wd(-1,1,1),new Wd(1,1,1);var dv=function(e){function t(e,i,n,o,s,a,r,l,c,u){var h;if(k()(this,t),1026!==(u=void 0!==u?u:1026)&&1027!==u)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===n&&1026===u&&(n=Xp),void 0===n&&1027===u&&(n=Zp),(h=qp(this,t,[null,o,s,a,r,l,u,n,c])).isDepthTexture=!0,h.image={width:e,height:i},h.magFilter=void 0!==r?r:1003,h.minFilter=void 0!==l?l:1003,h.flipY=!1,h.generateMipmaps=!1,h.compareFunction=null,h}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.compareFunction=e.compareFunction,this}},{key:"toJSON",value:function(e){var i=Jp(t,"toJSON",this,3)([e]);return null!==this.compareFunction&&(i.compareFunction=this.compareFunction),i}}])}(zd),mv=(new zd,new dv(1,1));mv.compareFunction=515;new Hd,new Vd,new Qf,new Float32Array(16),new Float32Array(9),new Float32Array(4);new Map;new Tm,new Cm;new Wd,new Wd,new Wd,new Wd,new bd,new bd,new Cm,new Wd,new Wd,new Wd,new bd,new bd,new bd;new Wd,new Wd,new Wd,new Fd,new Fd,new Wd,new Cm,new Wd,new hm,new Cm,new bm,new Cm,new Cm,new Cm,new Cm,new Jd,new Cm,new Yf,new hm;var fv=function(){return x()((function e(){k()(this,e),this.index=0,this.pool=[],this.list=[]}),[{key:"push",value:function(e,t){var i=this.pool,n=this.list;this.index>=i.length&&i.push({start:-1,count:-1,z:-1});var o=i[this.index];n.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t}},{key:"reset",value:function(){this.list.length=0,this.index=0}}])}();new Cm,new Cm,new Cm,new Cm,new sv,new Jd,new hm,new Wd,new fv,new Yf;new Wd,new Wd,new Cm,new bm,new hm,new Wd,new Wd;new Wd,new Wd,new Cm,new bm,new hm,new Wd;var vv=function(){return x()((function e(){k()(this,e),this.type="Curve",this.arcLengthDivisions=200}),[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(e,t){var i=this.getUtoTmapping(e);return this.getPoint(i,t)}},{key:"getPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(){var 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;var t,i=[],n=this.getPoint(0),o=0;i.push(0);for(var s=1;s<=e;s++)o+=(t=this.getPoint(s/e)).distanceTo(n),i.push(o),n=t;return this.cacheArcLengths=i,i}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e,t){var i,n=this.getLengths(),o=0,s=n.length;i=t||e*n[s-1];for(var a,r=0,l=s-1;r<=l;)if((a=n[o=Math.floor(r+(l-r)/2)]-i)<0)r=o+1;else{if(!(a>0)){l=o;break}l=o-1}if(n[o=l]===i)return o/(s-1);var c=n[o];return(o+(i-c)/(n[o+1]-c))/(s-1)}},{key:"getTangent",value:function(e,t){var i=1e-4,n=e-i,o=e+i;n<0&&(n=0),o>1&&(o=1);var s=this.getPoint(n),a=this.getPoint(o),r=t||(s.isVector2?new bd:new Wd);return r.copy(a).sub(s).normalize(),r}},{key:"getTangentAt",value:function(e,t){var i=this.getUtoTmapping(e);return this.getTangent(i,t)}},{key:"computeFrenetFrames",value:function(e,t){for(var i=new Wd,n=[],o=[],s=[],a=new Wd,r=new Cm,l=0;l<=e;l++){var c=l/e;n[l]=this.getTangentAt(c,new Wd)}o[0]=new Wd,s[0]=new Wd;var u=Number.MAX_VALUE,h=Math.abs(n[0].x),p=Math.abs(n[0].y),d=Math.abs(n[0].z);h<=u&&(u=h,i.set(1,0,0)),p<=u&&(u=p,i.set(0,1,0)),d<=u&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),o[0].crossVectors(n[0],a),s[0].crossVectors(n[0],o[0]);for(var m=1;m<=e;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(n[m-1],n[m]),a.length()>Number.EPSILON){a.normalize();var f=Math.acos(md(n[m-1].dot(n[m]),-1,1));o[m].applyMatrix4(r.makeRotationAxis(a,f))}s[m].crossVectors(n[m],o[m])}if(!0===t){var v=Math.acos(md(o[0].dot(o[e]),-1,1));v/=e,n[0].dot(a.crossVectors(o[0],o[e]))>0&&(v=-v);for(var g=1;g<=e;g++)o[g].applyMatrix4(r.makeRotationAxis(n[g],v*g)),s[g].crossVectors(n[g],o[g])}return{tangents:n,normals:o,binormals:s}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}])}(),gv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return k()(this,t),(e=qp(this,t)).isEllipseCurve=!0,e.type="EllipseCurve",e.aX=i,e.aY=n,e.xRadius=o,e.yRadius=s,e.aStartAngle=a,e.aEndAngle=r,e.aClockwise=l,e.aRotation=c,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t,n=2*Math.PI,o=this.aEndAngle-this.aStartAngle,s=Math.abs(o)n;)o-=n;o0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return k()(this,t),(e=qp(this,t)).isCatmullRomCurve3=!0,e.type="CatmullRomCurve3",e.points=i,e.closed=n,e.curveType=o,e.tension=s,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,o=n,s=this.points,a=s.length,r=(a-(this.closed?0:1))*e,l=Math.floor(r),c=r-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/a)+1)*a:0===c&&l===a-1&&(l=a-2,c=1),this.closed||l>0?t=s[(l-1)%a]:(Cv.subVectors(s[0],s[1]).add(s[0]),t=Cv);var u=s[l%a],h=s[(l+1)%a];if(this.closed||l+20&&void 0!==arguments[0]?arguments[0]:new bd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new bd,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new bd;return k()(this,t),(e=qp(this,t)).isCubicBezierCurve=!0,e.type="CubicBezierCurve",e.v0=i,e.v1=n,e.v2=o,e.v3=s,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(Pv(e,n.x,o.x,s.x,a.x),Pv(e,n.y,o.y,s.y,a.y)),i}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}])}(vv),Mv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Wd,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Wd;return k()(this,t),(e=qp(this,t)).isCubicBezierCurve3=!0,e.type="CubicBezierCurve3",e.v0=i,e.v1=n,e.v2=o,e.v3=s,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,i=t,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(Pv(e,n.x,o.x,s.x,a.x),Pv(e,n.y,o.y,s.y,a.y),Pv(e,n.z,o.z,s.z,a.z)),i}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}])}(vv),Tv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd;return k()(this,t),(e=qp(this,t)).isLineCurve=!0,e.type="LineCurve",e.v1=i,e.v2=n,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd;return t.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,t){return this.getTangent(e,t)}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vv),Ov=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd;return k()(this,t),(e=qp(this,t)).isLineCurve3=!0,e.type="LineCurve3",e.v1=i,e.v2=n,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd;return t.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,t){return this.getTangent(e,t)}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vv),Nv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new bd;return k()(this,t),(e=qp(this,t)).isQuadraticBezierCurve=!0,e.type="QuadraticBezierCurve",e.v0=i,e.v1=n,e.v2=o,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t,n=this.v0,o=this.v1,s=this.v2;return i.set(Ev(e,n.x,o.x,s.x),Ev(e,n.y,o.y,s.y)),i}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vv),Bv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Wd;return k()(this,t),(e=qp(this,t)).isQuadraticBezierCurve3=!0,e.type="QuadraticBezierCurve3",e.v0=i,e.v1=n,e.v2=o,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,i=t,n=this.v0,o=this.v1,s=this.v2;return i.set(Ev(e,n.x,o.x,s.x),Ev(e,n.y,o.y,s.y),Ev(e,n.z,o.z,s.z)),i}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vv),Av=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return k()(this,t),(e=qp(this,t)).isSplineCurve=!0,e.type="SplineCurve",e.points=i,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t,n=this.points,o=(n.length-1)*e,s=Math.floor(o),a=o-s,r=n[0===s?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return i.set(Sv(a,r.x,l.x,c.x,u.x),Sv(a,r.y,l.y,c.y,u.y)),i}},{key:"copy",value:function(e){Jp(t,"copy",this,3)([e]),this.points=[];for(var i=0,n=e.points.length;i0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.currentPoint.fromArray(e.currentPoint),this}}])}(function(e){function t(){var e;return k()(this,t),(e=qp(this,t)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return wn()(t,e),x()(t,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){var i=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Lv[i](t,e))}return this}},{key:"getPoint",value:function(e,t){for(var i=e*this.getLength(),n=this.getCurveLengths(),o=0;o=i){var s=n[o]-i,a=this.curves[o],r=a.getLength(),l=0===r?0:1-s/r;return a.getPointAt(l,t)}o++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,i=0,n=this.curves.length;i0&&void 0!==arguments[0]?arguments[0]:40,t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}},{key:"getPoints",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,i=[],n=0,o=this.curves;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},{key:"copy",value:function(e){Jp(t,"copy",this,3)([e]),this.curves=[];for(var i=0,n=e.curves.length;i0&&void 0!==arguments[0]?arguments[0]:[new bd(0,-.5),new bd(.5,0),new bd(0,.5)],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="LatheGeometry",e.parameters={points:i,segments:n,phiStart:o,phiLength:s},n=Math.floor(n),s=md(s,0,2*Math.PI);for(var a=[],r=[],l=[],c=[],u=[],h=1/n,p=new Wd,d=new bd,m=new Wd,f=new Wd,v=new Wd,g=0,y=0,b=0;b<=i.length-1;b++)switch(b){case 0:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,v.copy(m),m.normalize(),c.push(m.x,m.y,m.z);break;case i.length-1:c.push(v.x,v.y,v.z);break;default:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,f.copy(m),m.x+=v.x,m.y+=v.y,m.z+=v.z,m.normalize(),c.push(m.x,m.y,m.z),v.copy(f)}for(var C=0;C<=n;C++)for(var w=o+C*h*s,_=Math.sin(w),x=Math.cos(w),S=0;S<=i.length-1;S++){p.x=i[S].x*_,p.y=i[S].y,p.z=i[S].x*x,r.push(p.x,p.y,p.z),d.x=C/n,d.y=S/(i.length-1),l.push(d.x,d.y);var E=c[3*S+0]*_,P=c[3*S+1],D=c[3*S+0]*x;u.push(E,P,D)}for(var M=0;M0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;k()(this,t);var a=new Iv;return a.absarc(0,-n/2,i,1.5*Math.PI,0),a.absarc(0,n/2,i,0,.5*Math.PI),(e=qp(this,t,[a.getPoints(o),s])).type="CapsuleGeometry",e.parameters={radius:i,length:n,capSegments:o,radialSegments:s},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.length,e.capSegments,e.radialSegments)}}])}(jv),zv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="CircleGeometry",e.parameters={radius:i,segments:n,thetaStart:o,thetaLength:s},n=Math.max(3,n);var a=[],r=[],l=[],c=[],u=new Wd,h=new bd;r.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(var p=0,d=3;p<=n;p++,d+=3){var m=o+p/n*s;u.x=i*Math.cos(m),u.y=i*Math.sin(m),r.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(r[d]/i+1)/2,h.y=(r[d+1]/i+1)/2,c.push(h.x,h.y)}for(var f=1;f<=n;f++)a.push(f,f+1,0);return e.setIndex(a),e.setAttribute("position",new Cf(r,3)),e.setAttribute("normal",new Cf(l,3)),e.setAttribute("uv",new Cf(c,2)),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.segments,e.thetaStart,e.thetaLength)}}])}(Df),Fv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="CylinderGeometry",e.parameters={radiusTop:i,radiusBottom:n,height:o,radialSegments:s,heightSegments:a,openEnded:r,thetaStart:l,thetaLength:c};var u=e;s=Math.floor(s),a=Math.floor(a);var h=[],p=[],d=[],m=[],f=0,v=[],g=o/2,y=0;function b(e){for(var t=f,o=new bd,a=new Wd,r=0,v=!0===e?i:n,b=!0===e?1:-1,C=1;C<=s;C++)p.push(0,g*b,0),d.push(0,b,0),m.push(.5,.5),f++;for(var w=f,k=0;k<=s;k++){var _=k/s*c+l,x=Math.cos(_),S=Math.sin(_);a.x=v*S,a.y=g*b,a.z=v*x,p.push(a.x,a.y,a.z),d.push(0,b,0),o.x=.5*x+.5,o.y=.5*S*b+.5,m.push(o.x,o.y),f++}for(var E=0;E0&&b(!0),n>0&&b(!1)),e.setIndex(h),e.setAttribute("position",new Cf(p,3)),e.setAttribute("normal",new Cf(d,3)),e.setAttribute("uv",new Cf(m,2)),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}])}(Df),Hv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return k()(this,t),(e=qp(this,t,[0,i,n,o,s,a,r,l])).type="ConeGeometry",e.parameters={radius:i,height:n,radialSegments:o,heightSegments:s,openEnded:a,thetaStart:r,thetaLength:l},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}])}(Fv),Vv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;k()(this,t),(e=qp(this,t)).type="PolyhedronGeometry",e.parameters={vertices:i,indices:n,radius:o,detail:s};var a=[],r=[];function l(e,t,i,n){for(var o=n+1,s=[],a=0;a<=o;a++){s[a]=[];for(var r=e.clone().lerp(i,a/o),l=t.clone().lerp(i,a/o),u=o-a,h=0;h<=u;h++)s[a][h]=0===h&&a===o?r:r.clone().lerp(l,h/u)}for(var p=0;p.9&&s<.1&&(t<.2&&(r[e+0]+=1),i<.2&&(r[e+2]+=1),n<.2&&(r[e+4]+=1))}}()}(),e.setAttribute("position",new Cf(a,3)),e.setAttribute("normal",new Cf(a.slice(),3)),e.setAttribute("uv",new Cf(r,2)),0===s?e.computeVertexNormals():e.normalizeNormals(),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.vertices,e.indices,e.radius,e.details)}}])}(Df),Gv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t);var o=(1+Math.sqrt(5))/2,s=1/o;return(e=qp(this,t,[[-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,-s,-o,0,-s,o,0,s,-o,0,s,o,-s,-o,0,-s,o,0,s,-o,0,s,o,0,-o,0,-s,o,0,-s,-o,0,s,o,0,s],[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],i,n])).type="DodecahedronGeometry",e.parameters={radius:i,detail:n},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Vv),Wv=new Wd,Uv=new Wd,Yv=new Wd,Jv=new sf,qv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(k()(this,t),(e=qp(this,t)).type="EdgesGeometry",e.parameters={geometry:i,thresholdAngle:n},null!==i){for(var o=4,s=Math.pow(10,o),a=Math.cos(pd*n),r=i.getIndex(),l=i.getAttribute("position"),c=r?r.count:l.count,u=[0,0,0],h=["a","b","c"],p=new Array(3),d={},m=[],f=0;f0)for(s=t;s=t;s-=n)a=gg(s,e[s],e[s+1],a);return a&&hg(a,a.next)&&(yg(a),a=a.next),a}function Kv(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!hg(n,n.next)&&0!==ug(n.prev,n,n.next))n=n.next;else{if(yg(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function Qv(e,t,i,n,o,s,a){if(e){!a&&s&&function(e,t,i,n){var o=e;do{0===o.z&&(o.z=ag(o.x,o.y,t,i,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,i,n,o,s,a,r,l,c=1;do{for(i=e,e=null,s=null,a=0;i;){for(a++,n=i,r=0,t=0;t0||l>0&&n;)0!==r&&(0===l||!n||i.z<=n.z)?(o=i,i=i.nextZ,r--):(o=n,n=n.nextZ,l--),s?s.nextZ=o:e=o,o.prevZ=s,s=o;i=n}s.nextZ=null,c*=2}while(a>1)}(o)}(e,n,o,s);for(var r,l,c=e;e.prev!==e.next;)if(r=e.prev,l=e.next,s?eg(e,n,o,s):$v(e))t.push(r.i/i|0),t.push(e.i/i|0),t.push(l.i/i|0),yg(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Qv(e=tg(Kv(e),t,i),t,i,n,o,s,2):2===a&&ig(e,t,i,n,o,s):Qv(Kv(e),t,i,n,o,s,1);break}}}function $v(e){var t=e.prev,i=e,n=e.next;if(ug(t,i,n)>=0)return!1;for(var o=t.x,s=i.x,a=n.x,r=t.y,l=i.y,c=n.y,u=os?o>a?o:a:s>a?s:a,d=r>l?r>c?r:c:l>c?l:c,m=n.next;m!==t;){if(m.x>=u&&m.x<=p&&m.y>=h&&m.y<=d&&lg(o,r,s,l,a,c,m.x,m.y)&&ug(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function eg(e,t,i,n){var o=e.prev,s=e,a=e.next;if(ug(o,s,a)>=0)return!1;for(var r=o.x,l=s.x,c=a.x,u=o.y,h=s.y,p=a.y,d=rl?r>c?r:c:l>c?l:c,v=u>h?u>p?u:p:h>p?h:p,g=ag(d,m,t,i,n),y=ag(f,v,t,i,n),b=e.prevZ,C=e.nextZ;b&&b.z>=g&&C&&C.z<=y;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&lg(r,u,l,h,c,p,b.x,b.y)&&ug(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&lg(r,u,l,h,c,p,C.x,C.y)&&ug(C.prev,C,C.next)>=0)return!1;C=C.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&lg(r,u,l,h,c,p,b.x,b.y)&&ug(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;C&&C.z<=y;){if(C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&lg(r,u,l,h,c,p,C.x,C.y)&&ug(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function tg(e,t,i){var n=e;do{var o=n.prev,s=n.next.next;!hg(o,s)&&pg(o,n,n.next,s)&&fg(o,s)&&fg(s,o)&&(t.push(o.i/i|0),t.push(n.i/i|0),t.push(s.i/i|0),yg(n),yg(n.next),n=e=s),n=n.next}while(n!==e);return Kv(n)}function ig(e,t,i,n,o,s){var a=e;do{for(var r=a.next.next;r!==a.prev;){if(a.i!==r.i&&cg(a,r)){var l=vg(a,r);return a=Kv(a,a.next),l=Kv(l,l.next),Qv(a,t,i,n,o,s,0),void Qv(l,t,i,n,o,s,0)}r=r.next}a=a.next}while(a!==e)}function ng(e,t){return e.x-t.x}function og(e,t){var i=function(e,t){var i,n=t,o=-1/0,s=e.x,a=e.y;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var r=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(r<=s&&r>o&&(o=r,i=n.x=n.x&&n.x>=u&&s!==n.x&&lg(ai.x||n.x===i.x&&sg(i,n)))&&(i=n,p=l)),n=n.next}while(n!==c);return i}(e,t);if(!i)return t;var n=vg(i,e);return Kv(n,n.next),Kv(i,i.next)}function sg(e,t){return ug(e.prev,e,t.prev)<0&&ug(t.next,e,e.next)<0}function ag(e,t,i,n,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function rg(e){var t=e,i=e;do{(t.x=(e-a)*(s-r)&&(e-a)*(n-r)>=(i-a)*(t-r)&&(i-a)*(s-r)>=(o-a)*(n-r)}function cg(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&pg(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(fg(e,t)&&fg(t,e)&&function(e,t){var i=e,n=!1,o=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&o<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(ug(e.prev,e,t.prev)||ug(e,t.prev,t))||hg(e,t)&&ug(e.prev,e,e.next)>0&&ug(t.prev,t,t.next)>0)}function ug(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function hg(e,t){return e.x===t.x&&e.y===t.y}function pg(e,t,i,n){var o=mg(ug(e,t,i)),s=mg(ug(e,t,n)),a=mg(ug(i,n,e)),r=mg(ug(i,n,t));return o!==s&&a!==r||!(0!==o||!dg(e,i,t))||!(0!==s||!dg(e,n,t))||!(0!==a||!dg(i,e,n))||!(0!==r||!dg(i,t,n))}function dg(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function mg(e){return e>0?1:e<0?-1:0}function fg(e,t){return ug(e.prev,e,e.next)<0?ug(e,t,e.next)>=0&&ug(e,e.prev,t)>=0:ug(e,t,e.prev)<0||ug(e,e.next,t)<0}function vg(e,t){var i=new bg(e.i,e.x,e.y),n=new bg(t.i,t.x,t.y),o=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=o,o.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function gg(e,t,i,n){var o=new bg(e,t,i);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function yg(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 bg(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Cg=function(){function e(){k()(this,e)}return x()(e,null,[{key:"area",value:function(e){for(var t=e.length,i=0,n=t-1,o=0;o2&&void 0!==arguments[2]?arguments[2]:2,u=t&&t.length,h=u?t[0]*c:e.length,p=Zv(e,0,h,c,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(e,t,i,n){var o,s,a,r=[];for(o=0,s=t.length;o80*c){i=o=e[0],n=s=e[1];for(var m=c;mo&&(o=a),r>s&&(s=r);l=0!==(l=Math.max(o-i,s-n))?32767/l:0}return Qv(p,d,c,i,n,l,0),d}(i,n),l=0;l2&&e[t-1].equals(e[0])&&e.pop()}function kg(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new Xv([new bd(.5,.5),new bd(-.5,.5),new bd(-.5,-.5),new bd(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),(e=qp(this,t)).type="ExtrudeGeometry",e.parameters={shapes:i,options:n},i=Array.isArray(i)?i:[i];for(var o=e,s=[],a=[],r=0,l=i.length;rNumber.EPSILON){var p=Math.sqrt(u),d=Math.sqrt(l*l+c*c),m=t.x-r/p,f=t.y+a/p,v=((i.x-c/d-m)*c-(i.y+l/d-f)*l)/(a*c-r*l),g=(n=m+a*v-e.x)*n+(o=f+r*v-e.y)*o;if(g<=2)return new bd(n,o);s=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(r)===Math.sign(c)&&(y=!0),y?(n=-r,o=a,s=Math.sqrt(u)):(n=a,o=r,s=Math.sqrt(u/2))}return new bd(n/s,o/s)}for(var j=[],R=0,z=M.length,F=z-1,H=R+1;R=0;ge--){for(var ye=ge/y,be=f*Math.cos(ye*Math.PI/2),Ce=v*Math.sin(ye*Math.PI/2)+g,we=0,ke=M.length;we=0;){var n=i,o=i-1;o<0&&(o=e.length-1);for(var s=0,a=p+2*y;s0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t);var o=(1+Math.sqrt(5))/2;return(e=qp(this,t,[[-1,o,0,1,o,0,-1,-o,0,1,-o,0,0,-1,o,0,1,o,0,-1,-o,0,1,-o,o,0,-1,o,0,1,-o,0,-1,-o,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],i,n])).type="IcosahedronGeometry",e.parameters={radius:i,detail:n},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Vv),Eg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,t),(e=qp(this,t,[[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],i,n])).type="OctahedronGeometry",e.parameters={radius:i,detail:n},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Vv),Pg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="RingGeometry",e.parameters={innerRadius:i,outerRadius:n,thetaSegments:o,phiSegments:s,thetaStart:a,thetaLength:r},o=Math.max(3,o);for(var l=[],c=[],u=[],h=[],p=i,d=(n-i)/(s=Math.max(1,s)),m=new Wd,f=new bd,v=0;v<=s;v++){for(var g=0;g<=o;g++){var y=a+g/o*r;m.x=p*Math.cos(y),m.y=p*Math.sin(y),c.push(m.x,m.y,m.z),u.push(0,0,1),f.x=(m.x/n+1)/2,f.y=(m.y/n+1)/2,h.push(f.x,f.y)}p+=d}for(var b=0;b0&&void 0!==arguments[0]?arguments[0]:new Xv([new bd(0,.5),new bd(-.5,-.5),new bd(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;k()(this,t),(e=qp(this,t)).type="ShapeGeometry",e.parameters={shapes:i,curveSegments:n};var o=[],s=[],a=[],r=[],l=0,c=0;if(!1===Array.isArray(i))h(i);else for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;k()(this,t),(e=qp(this,t)).type="SphereGeometry",e.parameters={radius:i,widthSegments:n,heightSegments:o,phiStart:s,phiLength:a,thetaStart:r,thetaLength:l},n=Math.max(3,Math.floor(n)),o=Math.max(2,Math.floor(o));for(var c=Math.min(r+l,Math.PI),u=0,h=[],p=new Wd,d=new Wd,m=[],f=[],v=[],g=[],y=0;y<=o;y++){var b=[],C=y/o,w=0;0===y&&0===r?w=.5/n:y===o&&c===Math.PI&&(w=-.5/n);for(var _=0;_<=n;_++){var x=_/n;p.x=-i*Math.cos(s+x*a)*Math.sin(r+C*l),p.y=i*Math.cos(r+C*l),p.z=i*Math.sin(s+x*a)*Math.sin(r+C*l),f.push(p.x,p.y,p.z),d.copy(p).normalize(),v.push(d.x,d.y,d.z),g.push(x+w,1-C),b.push(u++)}h.push(b)}for(var S=0;S0)&&m.push(P,D,T),(S!==o-1||c0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,t),(e=qp(this,t,[[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],i,n])).type="TetrahedronGeometry",e.parameters={radius:i,detail:n},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Vv),Og=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="TorusGeometry",e.parameters={radius:i,tube:n,radialSegments:o,tubularSegments:s,arc:a},o=Math.floor(o),s=Math.floor(s);for(var r=[],l=[],c=[],u=[],h=new Wd,p=new Wd,d=new Wd,m=0;m<=o;m++)for(var f=0;f<=s;f++){var v=f/s*a,g=m/o*Math.PI*2;p.x=(i+n*Math.cos(g))*Math.cos(v),p.y=(i+n*Math.cos(g))*Math.sin(v),p.z=n*Math.sin(g),l.push(p.x,p.y,p.z),h.x=i*Math.cos(v),h.y=i*Math.sin(v),d.subVectors(p,h).normalize(),c.push(d.x,d.y,d.z),u.push(f/s),u.push(m/o)}for(var y=1;y<=o;y++)for(var b=1;b<=s;b++){var C=(s+1)*y+b-1,w=(s+1)*(y-1)+b-1,_=(s+1)*(y-1)+b,x=(s+1)*y+b;r.push(C,w,x),r.push(w,_,x)}return e.setIndex(r),e.setAttribute("position",new Cf(l,3)),e.setAttribute("normal",new Cf(c,3)),e.setAttribute("uv",new Cf(u,2)),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}])}(Df),Ng=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;k()(this,t),(e=qp(this,t)).type="TorusKnotGeometry",e.parameters={radius:i,tube:n,tubularSegments:o,radialSegments:s,p:a,q:r},o=Math.floor(o),s=Math.floor(s);for(var l=[],c=[],u=[],h=[],p=new Wd,d=new Wd,m=new Wd,f=new Wd,v=new Wd,g=new Wd,y=new Wd,b=0;b<=o;++b){var C=b/o*a*Math.PI*2;N(C,a,r,i,m),N(C+.01,a,r,i,f),g.subVectors(f,m),y.addVectors(f,m),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize();for(var w=0;w<=s;++w){var _=w/s*Math.PI*2,x=-n*Math.cos(_),S=n*Math.sin(_);p.x=m.x+(x*y.x+S*v.x),p.y=m.y+(x*y.y+S*v.y),p.z=m.z+(x*y.z+S*v.z),c.push(p.x,p.y,p.z),d.subVectors(p,m).normalize(),u.push(d.x,d.y,d.z),h.push(b/o),h.push(w/s)}}for(var E=1;E<=o;E++)for(var P=1;P<=s;P++){var D=(s+1)*(E-1)+(P-1),M=(s+1)*E+(P-1),T=(s+1)*E+P,O=(s+1)*(E-1)+P;l.push(D,M,O),l.push(M,T,O)}function N(e,t,i,n,o){var s=Math.cos(e),a=Math.sin(e),r=i/t*e,l=Math.cos(r);o.x=n*(2+l)*.5*s,o.y=n*(2+l)*a*.5,o.z=n*Math.sin(r)*.5}return e.setIndex(l),e.setAttribute("position",new Cf(c,3)),e.setAttribute("normal",new Cf(u,3)),e.setAttribute("uv",new Cf(h,2)),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}])}(Df),Bg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Bv(new Wd(-1,-1,0),new Wd(-1,1,0),new Wd(1,1,0)),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];k()(this,t),(e=qp(this,t)).type="TubeGeometry",e.parameters={path:i,tubularSegments:n,radius:o,radialSegments:s,closed:a};var r=i.computeFrenetFrames(n,a);e.tangents=r.tangents,e.normals=r.normals,e.binormals=r.binormals;var l=new Wd,c=new Wd,u=new bd,h=new Wd,p=[],d=[],m=[],f=[];function v(e){h=i.getPointAt(e/n,h);for(var t=r.normals[e],a=r.binormals[e],u=0;u<=s;u++){var m=u/s*Math.PI*2,f=Math.sin(m),v=-Math.cos(m);c.x=v*t.x+f*a.x,c.y=v*t.y+f*a.y,c.z=v*t.z+f*a.z,c.normalize(),d.push(c.x,c.y,c.z),l.x=h.x+o*c.x,l.y=h.y+o*c.y,l.z=h.z+o*c.z,p.push(l.x,l.y,l.z)}}return function(){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:null;if(k()(this,t),(e=qp(this,t)).type="WireframeGeometry",e.parameters={geometry:i},null!==i){var n=[],o=new Set,s=new Wd,a=new Wd;if(null!==i.index){var r=i.attributes.position,l=i.index,c=i.groups;0===c.length&&(c=[{start:0,count:l.count,materialIndex:0}]);for(var u=0,h=c.length;u=o)break e;var r=t[1];e=(o=t[--i-1]))break t}s=i,i=0}for(;i>>1;et;)--s;if(++s,0!==o||s!==n){o>=s&&(o=(s=Math.max(s,1))-1);var a=this.getValueSize();this.times=i.slice(o,s),this.values=this.values.slice(o*a,s*a)}return this}},{key:"validate",value:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var i=this.times,n=this.values,o=i.length;0===o&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var s=null,a=0;a!==o;a++){var r=i[a];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,r),e=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,r,s),e=!1;break}s=r}if(void 0!==n&&jg(n))for(var l=0,c=n.length;l!==c;++l){var u=n[l];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,u),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),n=2302===this.getInterpolation(),o=e.length-1,s=1,a=1;a0){e[s]=e[o];for(var g=o*i,y=s*i,b=0;b!==i;++b)t[y+b]=t[g+b];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*i)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=this.times.slice(),t=this.values.slice(),i=new(0,this.constructor)(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}],[{key:"toJSON",value:function(e){var t,i=e.constructor;if(i.toJSON!==this.toJSON)t=i.toJSON(e);else{t={name:e.name,times:Ig(e.times,Array),values:Ig(e.values,Array)};var n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t}}])}();Vg.prototype.TimeBufferType=Float32Array,Vg.prototype.ValueBufferType=Float32Array,Vg.prototype.DefaultInterpolation=2301;var Gg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);Gg.prototype.ValueTypeName="bool",Gg.prototype.ValueBufferType=Array,Gg.prototype.DefaultInterpolation=2300,Gg.prototype.InterpolantFactoryMethodLinear=void 0,Gg.prototype.InterpolantFactoryMethodSmooth=void 0;var Wg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);Wg.prototype.ValueTypeName="color";var Ug=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);Ug.prototype.ValueTypeName="number";var Yg=function(e){function t(e,i,n,o){return k()(this,t),qp(this,t,[e,i,n,o])}return wn()(t,e),x()(t,[{key:"interpolate_",value:function(e,t,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=(i-t)/(n-t),l=e*a,c=l+a;l!==c;l+=4)Gd.slerpFlat(o,0,s,l-a,s,l,r);return o}}])}(Rg),Jg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t,[{key:"InterpolantFactoryMethodLinear",value:function(e){return new Yg(this.times,this.values,this.getValueSize(),e)}}])}(Vg);Jg.prototype.ValueTypeName="quaternion",Jg.prototype.DefaultInterpolation=2301,Jg.prototype.InterpolantFactoryMethodSmooth=void 0;var qg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);qg.prototype.ValueTypeName="string",qg.prototype.ValueBufferType=Array,qg.prototype.DefaultInterpolation=2300,qg.prototype.InterpolantFactoryMethodLinear=void 0,qg.prototype.InterpolantFactoryMethodSmooth=void 0;var Xg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);Xg.prototype.ValueTypeName="vector";var Zg=x()((function e(t,i,n){k()(this,e);var o,s=this,a=!1,r=0,l=0,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=i,this.onError=n,this.itemStart=function(e){l++,!1===a&&void 0!==s.onStart&&s.onStart(e,r,l),a=!0},this.itemEnd=function(e){r++,void 0!==s.onProgress&&s.onProgress(e,r,l),r===l&&(a=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(e){void 0!==s.onError&&s.onError(e)},this.resolveURL=function(e){return o?o(e):e},this.setURLModifier=function(e){return o=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){var t=c.indexOf(e);return-1!==t&&c.splice(t,2),this},this.getHandler=function(e){for(var t=0,i=c.length;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function cy(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),i=uy(this,t,[e,n]);var s="\n importScripts('".concat(i.getSourceRootPath(),"/3rdparty/turf.min.js');\n self.addEventListener('message', function (e) {\n let features = []\n eval(e.data.code);\n self.postMessage(features);\n }, false);\n "),a="data:text/javascript;charset=utf-8,"+encodeURIComponent(s);if(i._worker=new Worker(a),i.options.angle=i.options.angle||0,i.loaded=!1,i.ismove=!1,i._loadEvent=void 0,i._loaded=!1,i.options.position.lat>83.5&&(i.options.position.lat=83.5),i.options.position.lat<-83.5&&(i.options.position.lat=-83.5),i.options.show=!n.show&&!1!==n.show||n.show,i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.flipe=n.flipe||{},i.options.flipe.x=i.options.flipe.x||!1,i.options.flipe.y=i.options.flipe.y||!1,i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attributeType=n.attributeType||"richText",n.text=n.text||{},i.options.text={value:n.text.value||"",show:!n.text.show&&!1!==n.text.show||n.text.show,position:n.text.position,fontSize:n.text.fontSize||0===n.text.fontSize?n.text.fontSize:20,color:n.text.color||"#ffffff",scaleByDistance:n.text.scaleByDistance||!1,near:n.text.near||0===n.text.near?n.text.near:2e3,far:n.text.far||0===n.text.far?n.text.far:1e5},i.options.text.position){var r=turf.point([i.options.position.lng,i.options.position.lat]),l=turf.point([i.options.text.position.lng,i.options.text.position.lat]),c=turf.distance(r,l,{units:"kilometers"}),u=turf.rhumbBearing(r,l);i._textToCenter={distance:c,angle:u}}return i.hierarchys=[],i._elms={},i.Dialog=o,i._isdrag=!1,i._EventBinding=new Ln,i.sdk.entityMap.get(i.options.id)?gn()(i):(i.sdk.addIncetance(i.options.id,i),i.picking=!0,i.options.show&&Qe(0,i.options.id),i._entityArray=[],i.init(),i)}return wn()(t,e),x()(t,[{key:"type",get:function(){return"GroundSvg"}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"name",get:function(){return this.options.name},set:function(e){this.options.name=e,this._elms.name&&this._elms.name.forEach((function(t){t.value=e}))}},{key:"show",get:function(){return this.options.show},set:function(e){var i,n,o,s,a,r;"boolean"==typeof e?(this.options.text&&this.options.text.show&&this.text&&(this.showView&&3!=this.showView?this.text.show=!1:this.text.show=e),i=t,n="show",o=e,s=this,a=1,r=1,Lp()(bn()(r?i.prototype:i),n,o,s,a)):console.error("参数必须为boolean")}},{key:"position",get:function(){return this.options.position},set:function(e){var t=this;if(this.options.position=e,this.options.position.lat>83.5&&(this.options.position.lat=83.5),this.options.position.lat<-83.5&&(this.options.position.lat=-83.5),this._update(),this._textToCenter){var i=turf.point([this.options.position.lng,this.options.position.lat]),n=turf.destination(i,this._textToCenter.distance,this._textToCenter.angle,{units:"kilometers"}).geometry.coordinates;this.getClampToHeight({lng:n[0],lat:n[1]}).then((function(e){var i=[n[0],n[1],e];t.text&&(t.text.position=i)}))}}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e,this.options.color)for(var i=0;i0&&0===i&&(this.options.angle=360),this._elms.angle&&this._elms.angle.forEach((function(e){e.value=t.options.angle})),this._update()}},{key:"scale",get:function(){return this.options.scale},set:function(e){this.options.scale.x=e.x,this.options.scale.y=e.y,this._elms&&(this._elms.xRange&&(this._elms.xRange.value=this.options.scale.x),this._elms.yRange&&(this._elms.yRange.value=this.options.scale.y),this._elms.xInput&&(this._elms.xInput.value=this.options.scale.x),this._elms.yInput&&(this._elms.yInput.value=this.options.scale.y)),this._update()}},{key:"flipeY",get:function(){return this.options.flipe.y},set:function(e){"boolean"==typeof e?(this.options.flipe.y=e,this._update()):console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(e){"boolean"==typeof e?(this.options.flipe.x=e,this._update()):console.error("参数必须为boolean")}},{key:"textValue",get:function(){return this.options.text.value},set:function(e){this.options.text.value=e,this.text?this.text.text=e:t.createText(this),this._elms.textValue&&this._elms.textValue.forEach((function(t){t.value=e}))}},{key:"textShow",get:function(){return this.options.text.show},set:function(e){var t=this;this.options.text.show=e,this.show?(this.showView&&3!=this.showView?this.text&&(this.text.show=!1):this.text&&(this.text.show=e),this.options.text.position&&setTimeout((function(){t.options.text.position.alt?t.text&&(t.text.position=[t.options.text.position.lng,t.options.text.position.lat,t.options.text.position.alt]):t.getClampToHeight({lng:t.options.text.position.lng,lat:t.options.text.position.lat}).then((function(e){t.text&&(t.text.position=[t.options.text.position.lng,t.options.text.position.lat,e])}))}),0)):this.text&&(this.text.show=!1),this._elms.textShow&&this._elms.textShow.forEach((function(t){t.checked=e}))}},{key:"textColor",get:function(){return this.options.text.color},set:function(e){var t=this;this.options.text.color=e,this.text&&(this.text.color=e),this._elms.textColor&&this._elms.textColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.textColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.textColor=e},clear:function(){t.textColor="rgba(255,255,255,1)"}});t._elms.textColor[i]=n}))}},{key:"textFontSize",get:function(){return this.options.text.fontSize},set:function(e){this.options.text.fontSize=e,this.text&&(this.text.fontSize=e,this.text.pixelOffset=e),this._elms.textFontSize&&this._elms.textFontSize.forEach((function(t){t.value=e}))}},{key:"textScaleByDistance",get:function(){return this.options.text.scaleByDistance},set:function(e){this.options.text.scaleByDistance=e,this.text&&(this.text.scaleByDistance=e),this._elms.textScaleByDistance&&this._elms.textScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"textNear",get:function(){return this.options.text.near},set:function(e){var t=e;t>this.textFar&&(t=this.textFar),this.options.text.near=t,this.text&&(this.text.near=t),this._elms.textNear&&this._elms.textNear.forEach((function(e){e.value=t}))}},{key:"textFar",get:function(){return this.options.text.far},set:function(e){var t=e;t-1?t[i].style.display="block":t[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(e){var t=this;if(this.options.attribute.link.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
'+this.options.attribute.link.content[s].url+'
\n
\n \n \n
\n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={linkEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.link.content;case 2:t.attributeLink=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
\n \n
\n
\n \n
\n
\n \n \n
',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(cS[E]&&(w=S[E]),k(k=Math.abs(k))&&(k=w);var P=k,D=4e3/(k=k*(10/3)*100)/5;P*=D;for(var M=0;M=Number(e.target.min))&&(m.scale={x:t,y:m.scale.y})})),h.addEventListener("blur",(function(e){var t=e.target.value;t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t=Number(e.target.min))&&(m.scale={x:m.scale.x,y:t})})),d.addEventListener("blur",(function(e){var t=e.target.value;t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t-360&&b<-90||b<360&&b>90)&&(b+=180,B=!0),((C=M-T)>-360&&C<-90||C<360&&C>90)&&(C+=180,A=!0),B&&A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#ff0000")):B?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=Math.abs(f)/3.5,i.scale.y=Math.abs(v)/3.5,e.abrupt("break",102);case 57:return T=(turf.rhumbBearing(E,turf.point(_[2]))+360-i.angle)%360,(C=M-T)>-360&&C<-90||C<360&&C>90?(C+=180,i.pointEntityCollection.values[2].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[8].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[2].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[8].point.color=Cesium.Color.fromCssColorString("#00ff0a")),m=Math.PI/180*C,v=Math.cos(m)*N*2,i.scale.y=v/3.5,e.abrupt("break",102);case 64:return O=(turf.rhumbBearing(E,turf.point(_[6]))+360-i.angle)%360,T=(turf.rhumbBearing(E,turf.point(_[2]))+360-i.angle)%360,((b=M-O)>-360&&b<-90||b<360&&b>90)&&(b+=180,B=!0),((C=M-T)>-360&&C<-90||C<360&&C>90)&&(C+=180,A=!0),B&&A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):B?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=Math.abs(f)/3.5,i.scale.y=Math.abs(v)/3.5,e.abrupt("break",102);case 78:return O=(turf.rhumbBearing(E,turf.point(_[4]))+360-i.angle)%360,(b=M-O)>-360&&b<-90||b<360&&b>90?(b+=180,i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#ff0000")),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,e.abrupt("break",102);case 85:return u.lat>83.5&&(u.lat=83.5),u.lat<-83.5&&(u.lat=-83.5),i.position={lng:u.lng,lat:u.lat},L=u.lng-c.lng,I=u.lat-c.lat,i.bbox[0]=i.bbox[0]+L,i.bbox[1]=i.bbox[1]+I,i.bbox[2]=i.bbox[2]+L,i.bbox[3]=i.bbox[3]+I,e.abrupt("break",102);case 95:return O=(turf.rhumbBearing(E,turf.point(_[6]))+360-i.angle)%360,(b=M-O)>-360&&b<-90||b<360&&b>90?(b+=180,i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#ff0000")),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,e.abrupt("break",102);case 102:h=h/(n/2)*100,p=p/(s/2)*100,(j=ry({},i.scale)).x=j.x+h,j.y=j.y-p,j.y>200&&(j.y=200),j.y<.001&&(j.y=.001),j.x>200&&(j.x=200),j.x<.001&&(j.x=.001),i.scale=ry({},j),e.next=141;break;case 114:R=i.sdk.viewer.scene.drillPick(t.endPosition),F=0;case 116:if(!(F90&&(c+=180);var h=[c,u],p=turf.point(h),d=turf.rhumbDestination(p,o[s][r].distance,o[s][r].angle,{units:"kilometers"}),m=A()(d.geometry.coordinates);m[2]=10,a.push((l=Cesium.Cartesian3).fromDegrees.apply(l,A()(m)))}0===s?i.positions=a:n.push(a)}return i.holes=n,i}}},{key:"_updateGeojson",value:function(e,t,i){if(this._loaded){var n=Math.abs(this.bbox[0]-this.bbox[2]),o=Math.abs(this.bbox[1]-this.bbox[3]);if("object"===N()(e[0]))for(var s=0;so[2]&&(t=o[0],o[0]=o[2],o[2]=t),o[1]>o[3]&&(t=o[1],o[1]=o[3],o[3]=t);for(var c=[],u=JSON.parse(JSON.stringify(this.geojson)),h=function(t){for(var i=0;i=0;t--)this.sdk.viewer.entities.remove(this.entity.values[t]);return this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=14,Mt(this.sdk,this.options.id);case 14:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(e){this.options.attribute.link.content.push({name:"链接",url:e}),this.attributeLink=this.options.attribute.link.content}},{key:"openRichTextEditor",value:function(e){var t=this;Wn.open(this.options.id,this.options.name,this.options.richTextContent),Wn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"setPosition",value:function(e){if(e){this.ismove=!0;var t={};t.lng=e.position.lng,t.lat=e.position.lat,this.position=t}else this.ismove=!1;this._update()}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=m.length>0&&void 0!==m[0]?m[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(fi(0),oi(this.sdk),si(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=24;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),(l=ry({},this.options.position)).hasOwnProperty("alt")){e.next=17;break}return e.next=16,this.getClampToHeight(l);case 16:l.alt=e.sent;case 17:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=37;break;case 24:c=[],u=0;case 26:if(!(u=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function dy(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),i=my(this,t,[e,n]),YJ.RoutePlanningArrays.push(i),i.options.width=n.width||4,i.options.color=n.color||"#ff0000",i.options.gps=n.gps||!1,i.Dialog=o,i._elms={},i.start={lng:null,lat:null},i.end={lng:null,lat:null},i.tools=new bi(e),i.init(),i}return wn()(t,e),x()(t,[{key:"init",value:function(){var e=this;this.startEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-start"),!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity.show=!1:this.startEntity.show=!0,this.startEntity.position=new Cesium.CallbackProperty((function(){var t=e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.startLng,e.startLat));return e.clickCallBack({start:t,end:e.endEntity.position}),t}),!1),this.startEntity.billboard={image:this.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.endEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-end"),!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity.show=!1:this.endEntity.show=!0,this.endEntity.position=new Cesium.CallbackProperty((function(){var t=e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.endLng,e.endLat));return e.clickCallBack({start:e.startEntity.position,end:t}),t}),!1),this.endEntity.billboard={image:this.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.edit(!0),this.clear()}},{key:"onEnd",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"startLng",get:function(){return this.start.lng},set:function(e){this.start.lng=e,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLng&&this._elms.startLng.forEach((function(t){t.value=e}))}},{key:"startLat",get:function(){return this.start.lat},set:function(e){this.start.lat=e,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLat&&this._elms.startLat.forEach((function(t){t.value=e}))}},{key:"endLng",get:function(){return this.end.lng},set:function(e){this.end.lng=e,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLng&&this._elms.endLng.forEach((function(t){t.value=e}))}},{key:"endLat",get:function(){return this.end.lat},set:function(e){this.end.lat=e,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLat&&this._elms.endLat.forEach((function(t){t.value=e}))}},{key:"edit",value:(i=o()(a.a.mark((function e(i){var n,o,s,r=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),i?(this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),document.getElementById("routeQuery").addEventListener("click",(function(){!r.startLng&&0!==r.startLng||!r.startLat&&0!==r.startLat||!r.endLng&&0!==r.endLng||!r.endLat&&0!==r.endLat?r.tools.message({type:"warning",text:"请先设置起点和终点坐标!"}):(!r.startEntity&&(r.startEntity=r.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return r.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(r.startLng,r.startLat))}),!1),billboard:{image:r.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),r.startEntity.show=!0,!r.endEntity&&(r.endEntity=r.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return r.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(r.endLng,r.endLat))}),!1),billboard:{image:r.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),r.endEntity.show=!0,r.Dialog.queryCallBack&&r.Dialog.queryCallBack({start:[r.startLng,r.startLat],end:[r.endLng,r.endLat]}))})),document.getElementById("clearRoute").addEventListener("click",(function(){r.clear()})),document.getElementsByTagName("head")[0].appendChild(this._element_style),n=document.getElementsByClassName("RoutePlanning")[0],this.options.gps&&((o=document.createElement("button")).innerHTML="当前位置",o.style.marginLeft="10px",o.setAttribute("data-is","start"),o.addEventListener("click",(function(e){r.getLocateCurrent(e)})),n.getElementsByClassName("start-col")[0].appendChild(o),n._element.body.getElementsByClassName("end-pick-btn")[0].style.marginRight="91px"),s=n.getElementsByTagName("*"),t.EventBinding(this,s)):(this._element_style&&(document.getElementsByTagName("head")[0].removeChild(this._element_style),this._element_style=null),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"clear",value:function(){this.startEntity&&(this.sdk.viewer.entities.remove(this.startEntity),this.startEntity=null),this.endEntity&&(this.sdk.viewer.entities.remove(this.endEntity),this.endEntity=null),this.entity&&(this.sdk.viewer.entities.remove(this.entity),this.entity=null),this.startExtensionEntity&&(this.sdk.viewer.entities.remove(this.startExtensionEntity),this.startExtensionEntity=null),this.endExtensionEntity&&(this.sdk.viewer.entities.remove(this.endExtensionEntity),this.endExtensionEntity=null)}},{key:"destroy",value:function(){this.clear(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"getLocateCurrent",value:function(e){var t=this;this.reconnecting&&this.reconnecting.close(),this.options.host=this.options.host||p();var i;i=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+i),this.reconnecting.onopen=function(i){t.reconnecting.onmessage=function(i){t.data=JSON.parse(i.data),t.data&&t.data.rmc&&(t.reconnecting.close(),"start"===e.srcElement.getAttribute("data-is")?(t.startLng=t.data.rmc.lng,t.startLat=t.data.rmc.lat,!t.startEntity&&(t.startEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.startLng,t.startLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.startEntity.show=!0):(t.endLng=t.data.rmc.lng,t.endLat=t.data.rmc.lat,!t.endEntity&&(t.endEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.endLng,t.endLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.endEntity.show=!0))}}}},{key:"createRoute",value:function(e){for(var t=[],i=0;i=500?(t.tip&&t.tip.destroy(),t.event&&t.event.destroy()):i(0,n)}))}))}},{key:"pickEndPos",value:function(e){var t=this;this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=new Q("左键选择终点坐标,右键取消",this.sdk),this.event=new K(this.sdk),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(i,n){var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.endLng=o.lng,t.endLat=o.lat,e(o),!t.endEntity&&(t.endEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.endLng,t.endLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.endEntity.show=!0,t.tip&&t.tip.destroy(),t.event&&t.event.destroy()})),this.event.mouse_right((function(e,i){t.tip&&t.tip.destroy(),t.event&&t.event.destroy()}))}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=py(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i
').concat(s[t].properties.fid,"
")),s[t].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='
').concat(s[t].properties[o],"
"));e+=i=i+n+""}return e},e.next=8,new J(t.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return fy=e.sent,e.next=11,fy.init();case 11:for(y in l=A()(t.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'',h='
',p='
',d="",m='',f='
',v="",g=1,"fid"in t.geojson.features[0].properties&&(d+=''),v+=''),m+=''),g++),t.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+=''),v+=''),m+='"),g++);'
暂无数据
',h=h+(p=p+(d+='')+(m+="")+"
fid
').concat(y,"
")+(f=f+(v+="")+(""+c+"")+'
暂无数据
')+"",u.innerHTML=''+h+'',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",fy.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(e){C.scrollLeft=e.target.scrollLeft})),fy._element.title.style.height="40px",fy._element.body.style.width="65%",fy._element.body.style.height="80%",fy._element.content.style.height="calc(100% - 40px)",fy._element.content.style.overflow="hidden",fy._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),Un(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(e){n=e,s=l.slice(o*(n-1),o*n);var t=r();u.getElementsByTagName("tbody")[0].innerHTML=t,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var e=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c
').concat(n[t].properties.fid,"
")),n[t].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='
').concat(n[t].properties[s],"
"));e+=i=i+o+""}return e},s=!1,r=0;case 5:if(!(r',h='
',p="",d='',m='
',f="",v=1,"fid"in t.geojson.features[0].properties&&(p+=''),f+=''),d+=''),v++),t.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(p+=''),f+=''),d+='"),v++);if(y='\n \n \n '.concat((u=u+(h=h+(p+='')+(d+="")+"
fid
').concat(g,"
")+(m=m+(f+="")+(""+l+"")+"")+"")+'',"\n \n "),n[0].content&&n[0].content.richTextContent&&(b='\n \n '.concat(n[0].content.richTextContent,"\n \n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C\n \n \n '),y+=k;for(y+="",c.innerHTML=y,by.contentAppChild(c),new In("shp-list-id-tabs"),(_=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",_.style.display="flex",_.style.flexDirection="column",_.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",x=_.getElementsByClassName("DIV-cy-tab-content-pane"),S=0;S=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function _y(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Ey(this,t,[e,n])).viewer=e.viewer,i.options.path?(i.options.fileName=n.fileName||"未命名对象",i.options.field=n.field||"id",i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i):(i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),gn()(i))}return wn()(t,e),x()(t,[{key:"show",get:function(){return this.options.show},set:function(e){this.setShow(e)}},{key:"on",value:function(){if(this.options.path)return this.init()}},{key:"init",value:(r=o()(a.a.mark((function e(){var i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="",this.options.host=this.options.host||p(),i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/vector/load":this.options.host+"/yjearth4.0/api/v1/vector/load",i+="?path="+this.options.path,e.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 6:if(200!==(n=e.sent).status){e.next=19;break}return e.next=10,n.json();case 10:if(200!==(o=e.sent).code&&0!==o.code){e.next=18;break}return this.data=o.data,e.next=15,this.formatData();case 15:return e.abrupt("return",t.create(this));case 18:return e.abrupt("return",console.error(o.message));case 19:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"formatData",value:(s=o()(a.a.mark((function e(){var t,i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){if(e.data){var o;(o=i.list).push.apply(o,A()(e.data));for(var s=0;s0&&void 0!==p[0]&&p[0],i=p.length>1&&void 0!==p[1]?p[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=25;break}return e.next=7,new _n(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){h.fileName=h.fileName.trim(),h.fileName||(h.fileName="未命名对象"),h.originalOptions.fileName=h.fileName,h.originalOptions.field=h.field,h._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:h.options.id,fileName:h.originalOptions.fileName,field:h.originalOptions.field})},closeCallBack:function(){h.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:for(c in this._DialogObject=e.sent,n='\n
\n
\n 文件名称:\n \n
\n
\n
\n
\n 名称字段选择:\n \n
\n
\n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.fileName,s.addEventListener("input",(function(){h.options.fileName=s.value})),r=o.getElementsByClassName("input-select")[0],l="",this.geojson.features[0].properties)u='"),l+=u;r.innerHTML=l,r.value=this.options.field,r.addEventListener("input",(function(){h.options.field=r.value})),this._elms.fileName=s,this._elms.field=r,e.next=26;break;case 25:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 26:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"editById",value:(i=o()(a.a.mark((function e(){var t,i,n,s,r,l,c,u,h,p,d,m,f,v,g,y,b=this,C=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.length>0&&void 0!==C[0]&&C[0],i=C.length>1?C[1]:void 0,n=C.length>2&&void 0!==C[2]?C[2]:{},this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),s="",!t){e.next=48;break}l={},c=0;case 8:if(!(c\n
\n 内容类型:\n \n
\n \n \n
\n 编辑内容:\n
\n \n
\n
\n
\n 编辑内容:\n \n \n
\n
\n
\n
\n
\n
\n
操作
\n
设备名称
\n
设备类型
\n
设备IP
\n
设备端口
\n
用户名
\n
密码
\n
\n
\n \n
\n
\n

暂无数据

\n
\n
\n
\n
\n
    \n
    \n
    \n ',(h=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(h),h.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",p=h.getElementsByClassName("attribute-select")[0],d=h.getElementsByClassName("link_add_btn")[0],m=h.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v-1?f[v].style.display="block":f[v].style.display="none";p.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=p.value;for(var e=0;e-1?f[e].style.display="block":f[e].style.display="none"})),d.addEventListener("click",o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接",url:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),b._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",b.setAttributeLinkById(i,b._DialogObject.attribute.link.content)):n.clickAddLink&&n.clickAddLink(i);case 1:case"end":return e.stop()}}),e)})))),m.addEventListener("click",(function(){Wn.open(i,i,b._DialogObject.attribute.richTextContent),Wn.primaryCallBack=function(e){b._DialogObject.attribute.richTextContent=e}})),g=h.getElementsByClassName("camera-name")[0],y=h.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){s=g.value})),this.cameraSelect&&this.cameraSelect(s),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(s)})),e.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"editContentById",value:function(e,t){for(var i=0;i0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l\n
    '+this._DialogObject.attribute.link.content[l].url+'
    \n
    \n \n \n
    \n ',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var h=r.getElementsByClassName("tr"),p={linkEdit:(i=o()(a.a.mark((function t(i){var o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.setAttributeLinkById(e,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function e(t){var o,s,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==t){e.next=33;break}r[t].innerHTML='\n
    \n \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n \n \n
    ',(o=r[t].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[t].getElementsByTagName("button"),l=0;case 8:if(!(l1&&void 0!==arguments[1]?arguments[1]:{};if(e){for(var i=0;i0){Un(o,t.data.total,10,1,(function(t){i.cameraSelect&&i.cameraSelect(e,t)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(e){var o='\n
    \n
    \n \n 绑定\n
    \n
    ').concat(t.data.list[e].cameraName,'
    \n
    ').concat(n[t.data.list[e].type],'
    \n
    ').concat(t.data.list[e].ip,'
    \n
    ').concat(t.data.list[e].port,'
    \n
    ').concat(t.data.list[e].userName,'
    \n
    ').concat(t.data.list[e].passWord,"
    \n
    "),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(t.data.list[e]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==t.data.list[e].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;l0){var l=turf.featureCollection(i),c=turf.envelope(l);c&&c.bbox&&4==c.bbox.length&&(e.range={max_x:c.bbox[2],max_y:c.bbox[3],min_x:c.bbox[0],min_y:c.bbox[1]})}}},{key:"createPoints",value:function(e,t){if(t){for(var i=new Cesium.PointPrimitiveCollection({scene:e.viewer.scene}),n=0;n0&&e.entity.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineColorAppearance}))}}},{key:"createPolygons",value:function(e,t){if(t){for(var i=[],n=0;n0){var c=new Cesium.GroundPrimitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})});e.entity.add(c)}}}},{key:"createTableContent",value:function(e){for(var t="",i=0;i
    ').concat(e.currentData[i].attr[s],"
    ");t+=n=n+o+""}return t}}]);var i,n,s,r}($n);function My(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Ty(e){for(var t=1;t
    ').concat(s[t].properties.fid,"
    ")),s[t].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='
    ').concat(s[t].properties[o],"
    "));e+=i=i+n+""}return e},e.next=8,new J(t.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return Py=e.sent,e.next=11,Py.init();case 11:for(y in l=A()(t.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'',h='
    ',p='
    ',d="",m='',f='
    ',v="",g=1,"fid"in t.geojson.features[0].properties&&(d+=''),v+=''),m+=''),g++),t.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+=''),v+=''),m+='"),g++);'
    暂无数据
    ',h=h+(p=p+(d+='')+(m+="")+"
    fid
    ').concat(y,"
    ")+(f=f+(v+="")+(""+c+"")+'
    暂无数据
    ')+"",u.innerHTML=''+h+'',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",Py.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(e){C.scrollLeft=e.target.scrollLeft})),Py._element.title.style.height="40px",Py._element.body.style.width="65%",Py._element.body.style.height="80%",Py._element.content.style.height="calc(100% - 40px)",Py._element.content.style.overflow="hidden",Py._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),Un(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(e){n=e,s=l.slice(o*(n-1),o*n);var t=r();u.getElementsByTagName("tbody")[0].innerHTML=t,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var e=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c
    ').concat(n[t].properties.fid,"
    ")),n[t].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='
    ').concat(n[t].properties[s],"
    "));e+=i=i+o+""}return e},s=!1,r=0;case 5:if(!(r',h='
    ',p="",d='',m='
    ',f="",v=1,"fid"in t.geojson.features[0].properties&&(p+=''),f+=''),d+=''),v++),t.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(p+=''),f+=''),d+='"),v++);if(y='\n \n \n '.concat((u=u+(h=h+(p+='')+(d+="")+"
    fid
    ').concat(g,"
    ")+(m=m+(f+="")+(""+l+"")+"")+"")+'',"\n \n "),n[0].content&&n[0].content.richTextContent&&(b='\n \n '.concat(n[0].content.richTextContent,"\n \n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C\n \n \n '),y+=k;for(y+="",c.innerHTML=y,Oy.contentAppChild(c),new In("shp-list-id-tabs"),(_=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",_.style.display="flex",_.style.flexDirection="column",_.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",x=_.getElementsByClassName("DIV-cy-tab-content-pane"),S=0;S=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ly(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),zy(i=Ry(this,t,[e,n]),Wy,void 0),zy(i,Uy,!1),zy(i,Yy,[]),i.viewer=e.viewer,!i.options.path)return i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),gn()(i);for(var s in i.colors=Gy,i.options.headTables=n.headTables||[],i.options.name=n.name||"未命名对象",i.options.path.endsWith(".kml")||(i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.opacity=n.opacity||0===n.opacity?n.opacity:1),i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i.sdk.addIncetance(i.options.id,i),i.disaster_type_colors=Gy[i.options.disaster_type]?jy({},Gy[i.options.disaster_type]):void 0,i.disaster_type_colors)i.disaster_type_colors[s]=i.cmykToRgb(i.disaster_type_colors[s]);return i}return wn()(t,e),x()(t,[{key:"type",get:function(){return"vector"}},{key:"show",get:function(){return this.options.show},set:function(e){this.setShow(e)}},{key:"opacity",get:function(){return this.options.opacity},set:function(e){this.options.opacity=e,this.entity&&this.entity.entities.values.forEach((function(t){t.point&&(t.point.color=t.point.color._value.withAlpha(e)),t.polygon&&(t.polygon.material=t.polygon.material.color._value.withAlpha(e)),t.polyline&&(t.polyline.material=t.polyline.material.color._value.withAlpha(e))}))}},{key:"on",value:function(){if(this.sdk&&this.viewer&&this.options.path)return this.init()}},{key:"init",value:(l=o()(a.a.mark((function e(){var i=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=o()(a.a.mark((function e(n,o){var s,r,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.options.host=i.options.host||p(),s=i.options.host+"/gdal/import",(r=new FormData).append("path",i.options.path),e.next=7,fetch(s,{method:"post",headers:{Authorization:m()},body:r});case 7:if(l=e.sent,console.log("response",l),200!==l.status){e.next=21;break}return e.next=12,l.arrayBuffer();case 12:return c=e.sent,u=new Uint8Array(c),h=i.decompressGzip(u),0===i.data.length&&(i.data=JSON.parse(h)),console.log("this.data",i.data),e.next=19,i.formatData();case 19:t.create(i),n();case 21:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return l.apply(this,arguments)})},{key:"formatData",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=[],i=function(e,t,n){if(e)if(Array.isArray(e)){for(var o=!1,s=0;s0&&void 0!==w[0]&&w[0],i=w.length>1&&void 0!==w[1]?w[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=74;break}return e.next=7,new _n(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){C.name=C.name.trim(),C.name||(C.name="未命名对象"),C.originalOptions.name=C.name,C.originalOptions.field=C.field,C._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:C.options.id,name:C.originalOptions.name,field:C.originalOptions.field})},closeCallBack:function(){C.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:this._DialogObject=e.sent,n='\n
    \n
    \n 文件名称:\n \n
    \n
    \n
    \n
    \n 名称字段选择:\n
    \n
    \n
    \n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.name,s.addEventListener("input",(function(){C.options.name=s.value})),r=[],e.t0=a.a.keys(this.geojson.features[0].properties);case 17:if((e.t1=e.t0()).done){e.next=31;break}l=e.t1.value,c=l,u=0;case 21:if(!(u').concat(g,""),f+=b,e.next=52;break;case 67:m.innerHTML=f,m.value=this.options.field,m.addEventListener("input",(function(){C.options.field=m.value})),this._elms.name=s,this._elms.field=m,e.next=75;break;case 74:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 75:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"editContentById",value:function(e,t){for(var i=0;i0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l\n
    '+this._DialogObject.attribute.link.content[l].url+'
    \n
    \n \n \n
    \n ',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var h=r.getElementsByClassName("tr"),p={linkEdit:(i=o()(a.a.mark((function t(i){var o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.setAttributeLinkById(e,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function e(t){var o,s,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==t){e.next=33;break}r[t].innerHTML='\n
    \n \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n \n \n
    ',(o=r[t].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[t].getElementsByTagName("button"),l=0;case 8:if(!(l1&&void 0!==m[1]?m[1]:{},fi(0),oi(this.sdk),si(this.sdk),!t){e.next=14;break}n=a.a.mark((function e(n){var o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d.geojson.features[n].id===t&&("Point"===d.geojson.features[n].geometry.type?d.getClampToHeight({lng:d.geojson.features[n].geometry.coordinates[0],lat:d.geojson.features[n].geometry.coordinates[1]}).then((function(e){d.sdk.viewer.camera.flyTo({orientation:i.orientation,destination:Cesium.Cartesian3.fromDegrees(d.geojson.features[n].geometry.coordinates[0],d.geojson.features[n].geometry.coordinates[1],e+(i.height||500))})})):(o=d.geojson.features[n].geometry.range)&&(s=[],d.getClampToHeight({lng:o[0],lat:o[1]}).then((function(e){var t=Cesium.Cartesian3.fromDegrees(o[0],o[1],e);s.push(t.x,t.y,t.z),d.getClampToHeight({lng:o[2],lat:o[3]}).then((function(e){var t=Cesium.Cartesian3.fromDegrees(o[2],o[3],e);s.push(t.x,t.y,t.z);var n=Cesium.BoundingSphere.fromVertices(s);d.sdk.viewer.camera.flyToBoundingSphere(n,{offset:i.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}))}))));case 1:case"end":return e.stop()}}),e)})),o=0;case 7:if(!(oo&&(o=l),s+=16}s=s+10+5*(n.length-1),o+=30,t.width=o,t.height=s;var c=i.createLinearGradient(0,0,o,s);return i.fillStyle=c,i.fillRect(0,0,o,s),i.fillStyle="#ffffff",i.font="16px YaHei",i.strokeStyle="#000000",i.strokeText(n,15,16*n.length+6.25+5*n.length),i.fillText(n,15,16*n.length+6.25+n.length-5),i.moveTo(o/2,s),i.stroke(),i.closePath(),t.toDataURL()}},{key:"createTableContent",value:function(e){for(var t="",i=0;i
    ').concat(e.currentData[i].attr[s],"
    ");t+=n=n+o+""}return t}}]);var i,n,s,r,l}($n);function qy(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Xy(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),(i=Zy(this,t,[e,n])).options.text=n.text||"未命名对象";for(var s=i.options.text.split("\n"),a=0;a80&&(s[a]=s[a].slice(0,80-s[a].length));if(s.length>70&&s.splice(70-s.length),i.options.text=s.join("\n"),i.options.show=!n.show&&!1!==n.show||n.show,i.options.angle=n.angle||0,i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.color=n.color||"#FFC107",i.options.position=n.position,delete i.options.name,!i.options.position&&i.options.positions){var r=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return Math.atan2(n,i)};i.options.position={lng:(i.options.positions[0].lng+i.options.positions[1].lng)/2,lat:(i.options.positions[0].lat+i.options.positions[1].lat)/2};var l=turf.point([i.options.positions[0].lng,i.options.positions[0].lat]),c=turf.point([i.options.positions[1].lng,i.options.positions[1].lat]),u={units:"miles"},h=turf.rhumbDistance(l,c,u),p=r([i.options.positions[0].lng,i.options.positions[0].lat],[i.options.positions[1].lng,i.options.positions[1].lat]);i.options.angle=(360+Cesium.Math.toDegrees(p))%360;var d=1e-4*Math.abs(Math.cos(Math.PI/180*i.options.position.lat)),m=i.getcanvas(),f=m.height/m.width,v=i.options.position.lng-1e-4/f,g=i.options.position.lat-d,y=i.options.position.lng+1e-4/f,b=i.options.position.lat+d,C=(g+b)/2,w=turf.point([v,C]),_=turf.point([y,C]),x=turf.rhumbDistance(w,_,u),S=Cesium.Math.toRadians(i.options.position.lat);x*=1+Math.abs(Math.sin(p)*Math.tan(S)*Math.sin(S)*Math.sin(S)),i.options.scale=h/x}return i.duration=5e4,i.entity,i._positionEditing=!1,i.Dialog=o,i._EventBinding=new Ln,i._elms={},i.previous={position:Xy({},i.options.position)},i.event=new K(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return wn()(t,e),x()(t,[{key:"lng",get:function(){return this.options.position.lng},set:function(e){this.options.position.lng=e,this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(e){this.options.position.lat=e,this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"name",get:function(){}},{key:"text",get:function(){return this.options.text},set:function(e){var t=this;this.options.text=e;for(var i=this.options.text.split("\n"),n=0;n80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),i[n]=i[n].slice(0,80-i[n].length)}if(i.length>70){i.splice(70-i.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=i.join("\n"),this.entity){var o=this.getcanvas(),s=o.height/o.width;this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:o.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this.entity.rectangle.coordinates=new Cesium.CallbackProperty((function(){var e,i=Math.abs(Math.cos(Math.PI/180*t.options.position.lat))*(1e-4*t.options.scale),n=[t.options.position.lng-1e-4*t.options.scale/s,t.options.position.lat-i,t.options.position.lng+1e-4*t.options.scale/s,t.options.position.lat+i];return(e=Cesium.Rectangle).fromDegrees.apply(e,n)}),!1)}this._elms.text&&this._elms.text.forEach((function(e){e.value=t.options.text}))}},{key:"angle",get:function(){return this.options.angle},set:function(e){this.options.angle=Number(e),this._elms.angle&&this._elms.angle.forEach((function(t){t.value=e}))}},{key:"scale",get:function(){return this.options.scale},set:function(e){this.options.scale=Number(e),this._elms.scale&&this._elms.scale.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=Number(e);var t=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:t.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e}))}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e;var i=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:i.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"create",value:function(){var e=this,t=this.getcanvas(),i=t.height/t.width;this.entity=this.sdk.viewer.entities.add({id:this.options.id,show:this.options.show,rectangle:{coordinates:new Cesium.CallbackProperty((function(){var t,n=Math.abs(Math.cos(Math.PI/180*e.options.position.lat))*(1e-4*e.options.scale),o=[e.options.position.lng-1e-4*e.options.scale/i,e.options.position.lat-n,e.options.position.lng+1e-4*e.options.scale/i,e.options.position.lat+n];return(t=Cesium.Rectangle).fromDegrees.apply(t,o)}),!1),material:new Cesium.CustomMaterialSource({image:t.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(e.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(e.options.angle)}),!1)}}),"cesium-viewer 2d"===this.sdk.viewer._element.className&&(this.entity.rectangle.height=10),Mt(this.sdk,this.options.id),this.options.show&&Qe(0,this.options.id)}},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n,o,s=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=18;break}return e.next=6,new _n(this.sdk,this.originalOptions,{title:"贴地文字属性",left:"180px",top:"100px",confirmCallBack:function(e){s.text=s.text.trim(),s.text||(s.text="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Mt(s.sdk,s.options.id),at(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.positionEditing=!1,s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(e){s.show=e,s.Dialog.showCallBack&&s.Dialog.showCallBack()},translationalCallBack:function(){s.positionEditing=!s.positionEditing}},!0);case 6:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-text",(i=document.createElement("div")).innerHTML='\n \n
    \n
    \n
    \n 名称\n \n
    \n
    \n 颜色\n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n 经度\n \n
    \n
    \n 纬度\n \n
    \n
    \n
    \n \n
    \n
    \n
    \n 旋转角度\n \n
    \n \n °\n \n
    \n
    \n
    \n
    \n
    \n 调整大小\n \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n 滚动速度\n \n
    \n \n \n
    \n
    \n
    \n
    \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,o=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),this._elms.color=[o],e.next=19;break;case 18:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(e){var t=this;this.sdk&&this.sdk.viewer&&this.entity&&(this._positionEditing=e,this.previous={position:Xy({},this.options.position)},!0===e?(this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.lng=t.previous.position.lng,t.lat=t.previous.position.lat,t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.lng=t.previous.position.lng,t.lat=t.previous.position.lat,t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=e.lng,t.lat=e.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1}}))}))):(this._positionEditingCallback&&(this._positionEditingCallback(),this._positionEditingCallback=null),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy()))}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=b.length>0&&void 0!==b[0]?b[0]:{},i=this.getcanvas(),n=i.height/i.width,fi(0),oi(this.sdk),si(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(o={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},s=this.options.customView.relativePosition.lng,r=this.options.customView.relativePosition.lat,l=this.options.customView.relativePosition.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),u={lng:0,lat:0},this.options.position?u=Xy({},this.options.position):this.options.positions?u=Xy({},this.options.positions[0]):this.options.center?u=Xy({},this.options.center):this.options.start?u=Xy({},this.options.start):(this.options.hasOwnProperty("lng")&&(u.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(u.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(u.alt=this.options.alt)),u.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(u);case 17:u.alt=e.sent;case 18:s=this.options.customView.relativePosition.lng+u.lng,r=this.options.customView.relativePosition.lat+u.lat,l=this.options.customView.relativePosition.alt+u.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),this.sdk.viewer.camera.flyTo({destination:c,orientation:o}),e.next=34;break;case 25:return h=Math.abs(Math.cos(Math.PI/180*this.options.position.lat))*(1e-4*this.options.scale),p=[[this.options.position.lng-1e-4*this.options.scale/n,this.options.position.lat-h],[this.options.position.lng+1e-4*this.options.scale/n,this.options.position.lat+h]],e.next=29,this.getClampToHeight(this.options.position);case 29:for(d=e.sent,m=[],f=0;f80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),(n=Qy(this,t,[e,i])).options.text=i.text||"未命名对象";for(var s=n.options.text.split("\n"),a=0;a80&&(s[a]=s[a].slice(0,80-s[a].length));return s.length>70&&s.splice(70-s.length),n.options.text=s.join("\n"),n.options.color=i.color||"#FFC107",n.options.positions=i.positions,n.options.speed=i.speed||0===i.speed?i.speed:1,n.options.show=!i.show&&!1!==i.show||i.show,n.nodePoints=[],n.entity,delete n.options.name,n.extrudedHeight,n._EventBinding=new Ln,n.Dialog=o,n._elms={},n.sdk.addIncetance(n.options.id,n),t.create(n),n}return wn()(t,e),x()(t,[{key:"name",get:function(){}},{key:"text",get:function(){return this.options.text},set:function(e){this.options.text=e;for(var t=this.options.text.split("\n"),i=0;i80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),t[i]=t[i].slice(0,80-t[i].length)}if(t.length>70){t.splice(70-t.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=t.join("\n"),this.entity){for(var n=this.options.positions,o=[],s=[],a=[],r=this.getMaterial(),l=this.computeDistance2(n),c=this.aspectRatio?l/this.aspectRatio:0,u=0;u\n
    \n
    \n
    \n 名称\n \n
    \n
    \n 颜色\n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n 滚动速度\n \n \n
    \n
    \n
    \n \n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],e.next=19;break;case 18:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.text=this.originalOptions.text,this.color=this.originalOptions.color,this.speed=this.originalOptions.speed;for(var e=this.options.positions,t=[],i=[],n=[],o=this.computeDistance2(e),s=this.aspectRatio?o/this.aspectRatio:0,a=0;a80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s0&&void 0!==arguments[0]?arguments[0]:function(){};if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),this._nodeEditCallback=t,this.tip=new Q("请选择一个顶点,右键取消",this.sdk),this.event=new K(this.sdk),this.nodePoints=[];for(var o=this.options.positions,s=[],a=[],r=[],l=this.computeDistance2(o),c=this.aspectRatio?l/this.aspectRatio:0,u=0;u=500?d(o,i):p(o,i)}))}));for(var m=0;m2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=ib(this,t)).sdk=e,n.viwer=e.viewer,n.options=tb({},i),n.options.host=i.host||p(),n.options.name=i.name||"未命名对象",n.options.show=!i.show&&!1!==i.show||i.show,"number"==typeof i.scale?(n.options.scale={},n.options.scale.x=i.scale,n.options.scale.y=i.scale,n.options.scale.z=i.scale):(n.options.scale=i.scale||{},n.options.scale.x=n.options.scale.x||0===n.options.scale.x?n.options.scale.x:1,n.options.scale.y=n.options.scale.y||0===n.options.scale.y?n.options.scale.y:1,n.options.scale.z=n.options.scale.z||0===n.options.scale.z?n.options.scale.z:1),n.primitive=null,n._loadEvent=void 0,n._loaded=!1,n._elms={},n.Dialog=o,n._EventBinding=new Ln,t.setDefaultValue(n),n.requestResource(),n.ControllerObject=new Qo(n.sdk,{position:tb({},n.options.position),rotate:{x:(360+n.options.roll%360)%360,y:(360+-n.options.pitch%360)%360,z:(360+-n.options.heading%360)%360}}),n.ControllerObject.controllerCallBack=n.controllerCallBack,n.HeadingPitchRollCallBack=n.Dialog.HeadingPitchRollCallBack,n}return wn()(t,e),x()(t,[{key:"requestResource",value:function(){this.addResource().then((function(e){}))}},{key:"addResource",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this).options.xmlURL=t.options.objUrl.replace(".obj",".xml"),""===t.options.xmlURL){e.next=34;break}return e.next=5,fetch(t.options.xmlURL);case 5:if(!(i=e.sent).ok){e.next=32;break}return e.next=9,i.text();case 9:return n=e.sent,o=new DOMParser,s=o.parseFromString(n,"text/xml"),r=s.getElementsByTagName("Position")[0].textContent.split(","),l=s.getElementsByTagName("Crs")[0].textContent,c=t.convert([{x:r[0],y:r[1],z:r[2]}],l,"EPSG:4326"),t.options.position=t.options.position||{lng:c.points[0].x,lat:c.points[0].y,alt:c.points[0].z},t.ControllerObject.position=t.options.position,u=t.viwer.scene,h=Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt),p=Cesium.Transforms.headingPitchRollToFixedFrame(h,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(.85),Cesium.Math.toRadians(0),Cesium.Math.toRadians(0))),e.next=22,window.objLoader.Load(t.options.objUrl);case 22:(d=e.sent).show=t.options.show,d.modelMatrix=p,d.setFlvVideo(t.options.videoUrl),u.primitives.add(d),t.primitive=d,t.controllerCallBack({rotate:{x:t.options.roll,y:-t.options.pitch,z:-t.options.heading},position:tb({},t.options.position)}),this.loaded=!0,this._loaded=!0,this._loadEvent&&this._loadEvent();case 32:e.next=36;break;case 34:return console.error("请填写xml路径"),e.abrupt("return");case 36:if(""!==t.options.objUrl){e.next=39;break}return console.error("请填写obj模型路径"),e.abrupt("return");case 39:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.length>0&&void 0!==h[0]?h[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(fi(0),oi(this.sdk),si(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=tb({},this.options.position):this.options.positions?l=tb({},this.options.positions[0]):this.options.center?l=tb({},this.options.center):this.options.start?l=tb({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=28;break;case 25:c=100*Math.tan(60),u=c/111319.55,this.sdk.viewer.camera.flyTo({destination:new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat-u,this.options.position.alt+100),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 28:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=this,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h.length>0&&void 0!==h[0]&&h[0],t=!1,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),e.next=6,new _n(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){u.name=u.name.trim(),u.name||(u.name="未命名对象"),u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},rotateCallBack:function(){u.rotationEditing?u.rotationEditing=!1:u.rotationEditing=!0},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 6:for(this._DialogObject=e.sent,(i=document.createElement("div")).style.width="448px",i.innerHTML='\n \n
    \n
    \n
    \n 名称\n \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n 经度\n \n
    \n
    \n 海拔高度\n
    \n \n m\n \n
    \n
    \n
    \n
    \n
    \n 纬度\n \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n 缩放\n
    \n \n 是否等比例缩放\n
    \n
    \n
    \n \n \n
    \n \n ',this._DialogObject.contentAppChild(i),n=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),o=this._DialogObject._element.content.getElementsByClassName("equal")[0],s=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],n.checked=t,n.addEventListener("change",(function(e){(t=e.target.checked)?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex")})),(r=o.getElementsByTagName("input"))[0].value=this.scaleX,r[1].value=this.scaleX,r[0].addEventListener("input",(function(e){u.scaleX=e.target.value,u.scaleY=e.target.value,u.scaleZ=e.target.value})),r[1].addEventListener("input",(function(e){u.scaleX=e.target.value,u.scaleY=e.target.value,u.scaleZ=e.target.value})),t?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex"),setTimeout((function(){if(u._DialogObject._element.foot){var e=u._DialogObject._element.foot.getElementsByClassName("rotate")[0];e&&(e.style.position="absolute",e.style.left="100px")}}),0),l=i.getElementsByTagName("*"),c=0;c1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),this.sdk=t,this.options=cb({},i),this.options.show=!i.show&&!1!==i.show||i.show,this.options.host=this.options.host||p(),this.objModelObject=[],this._loaded=!1,this._loadEvent=void 0,this.on()}),[{key:"show",get:function(){return this.options.show},set:function(e){var t=this;if("boolean"==typeof e){this.options.show=e;for(var i=function(i){t.objModelObject[i].load((function(){t.objModelObject[i].show=e}))},n=0;n1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),mb(i=db(this,t,[e,n]),yb,void 0),i.options.id=n.id||i.randomString(),i.options.name=n.name||"漫游路径",i.options.points=n.points||[],i.options.repeat&&(i.options.repeat=Number(i.options.repeat)),i.Dialog=o,i}return wn()(t,e),x()(t,[{key:"repeat",get:function(){return this.options.repeat},set:function(e){if(this.options.repeat!=Number(e)&&(this.options.repeat=Number(e),this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)){var t=this._DialogObject._element.content.querySelector("input[name='repeat']");t.checked=e===1/0,this.Dialog.changeRepeatStateCallBack&&this.Dialog.changeRepeatStateCallBack(t.checked)}}},{key:"edit",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this,n=this.sdk.viewer,o=0,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=44;break}return s=function(e){var t=l.getElementsByClassName("tr");t.length>0&&(t[t.length-1].querySelector("input[name='time']").disabled=void 0);var s=l.getElementsByClassName("tr active")[0];s&&(s.className="tr");var a=document.createElement("div");a.className="tr active",a.innerHTML='\n
    视点'.concat(u+1,'
    \n
    \n \n
    \n
    \n
    \n '),a.addEventListener("click",(function(e){if(e.target.parentNode===a){var i=l.getElementsByClassName("tr active")[0];i&&(i.className="tr"),a.className="tr active";for(var n=0;nn+1?(o--,t[o-1].className="tr active"):o==n+1&&(t.length==n&&(o-=1),0!=t.length&&(t[o-1].className="tr active")),t.length>0){var s=t[t.length-1].querySelector("input[name='time']");s.disabled="disabled",s.value=0}break}})),p.addEventListener("input",(function(t){f.checked=!1,e.duration=Number(p.value),e.duration<0&&(e.duration=0)})),p.addEventListener("blur",(function(){p.value=Number(Number(p.value).toFixed(2)),p.value<0&&(p.value=0)})),l.insertBefore(a,t[o]),o++,t[t.length-1].querySelector("input[name='time']").disabled="disabled"},e.next=8,new J(n._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){g.cease()}});case 8:return this._DialogObject=e.sent,e.next=11,this._DialogObject.init();case 11:for((r=document.createElement("div")).className="fly-roam",r.innerHTML='\n \n
    \n
    \n
    \n 名称\n \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n \n 设置总时长\n
    \n \n 秒(s)\n \n
    \n
    \n
    \n \n 是否循环播放\n
    \n
    \n
    \n \n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    序号
    \n
    时长(s)
    \n
    操作
    \n
    \n
    \n
    \n
    \n
    \n

    暂无数据

    \n
    \n
    \n
    \n
    \n \n ',this._DialogObject.contentAppChild(r),r.getElementsByTagName("*"),l=r.getElementsByClassName("table-body")[0],c=r.getElementsByClassName("table-empty")[0],u=0,h=new Proxy([],{set:function(e,t,i){return e[t]=i,e.length>0?c.style.display="none":c.style.display="flex",!0}}),u=0;u0&&g.flyTo(0)})),r.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var e={duration:0,position:g.cartesian3Towgs84(n.camera.position,n),orientation:{heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll}};h.splice(o,0,e),g.options.points.splice(o,0,e),s(e),u++})),r.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(o){var e=g.cartesian3Towgs84(n.camera.position,n);g.options.points[o-1].position=h[o-1].position=e,g.options.points[o-1].orientation=h[o-1].orientation={heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll},g.message({text:"操作成功"})}})),m=r.querySelector("input[name='totalTime']"),f=r.querySelector("input[name='isTotalTime']"),v=r.querySelector("input[name='repeat']"),f.addEventListener("change",(function(){var e=l.getElementsByClassName("tr");if(f.checked&&e.length>0){for(var t=Number((Number(m.value)/(e.length-1)).toFixed(2)),i=0;i0){for(var t=Number((Number(m.value)/(e.length-1)).toFixed(2)),i=0;i0&&void 0!==arguments[0]?arguments[0]:0;fi(0);var i=this,n=this.options.points,s=this.repeat;oi(i.sdk);var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0;vb(yb,e)&&vb(yb,e).destroy();var l=e;fb(yb,e,new Cesium.ScreenSpaceEventHandler(l.sdk.viewer.canvas)),vb(yb,e).setInputAction((function(t){e.cease()}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var c,u=l.sdk.viewer;fi(0),u.camera.cancelFlight(),u.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n[t].position.lng,n[t].position.lat,n[t].position.alt),orientation:n[t].orientation,duration:i?n[t-1].duration:.5,maximumHeight:n[t].position.alt,complete:(c=o()(a.a.mark((function i(){return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:t++,e.repeat===1/0?s=1/0:s===1/0&&(s=e.repeat),t<=n.length-1?r(t,!0):s?(s--,r(0)):vb(yb,e)&&vb(yb,e).destroy();case 3:case"end":return i.stop()}}),i)}))),function(){return c.apply(this,arguments)}),easingFunction:i?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})};r(t)}},{key:"cease",value:function(){this.sdk&&this.sdk.viewer&&this.sdk.viewer.camera.cancelFlight(),vb(yb,this)&&vb(yb,this).destroy()}},{key:"remove",value:function(){this._DialogObject&&this._DialogObject.close?(this._DialogObject.close(),this._DialogObject=null):this.cease()}}]);var i}($n);function Cb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var wb=function(){return x()((function e(t,i,n){k()(this,e),this.options=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"move",t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:90,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("move"===e){var o=turf.point([this.options.position.lng,this.options.position.lat]),s=Cesium.Math.toDegrees(this.hpr.heading),a=s+i,r={units:"degrees"},l=turf.destination(o,t,a,r).geometry.coordinates;this.position=Cesium.Cartesian3.fromDegrees(l[0],l[1],this.options.position.alt+this.options.normalHeight),this.options.position.lng=l[0],this.options.position.lat=l[1],this.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(l[0],l[1],this.viewer.camera.positionCartographic.height)})}"update"===e&&(this.position=t,this.options.videoUrl&&this.updatePolygonPosition()),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"syncHpr",value:function(){if(this.viewer1){var e=this.options.position,t=e.lng,i=e.lat,n=e.alt,o=-this.hpr.pitch-Cesium.Math.toRadians(-90);this.viewer1.camera.setView({destination:Cesium.Cartesian3.fromDegrees(t,i,n+this.options.normalHeight),orientation:{heading:this.hpr.heading+Cesium.Math.toRadians(-90),pitch:o,roll:this.hpr.roll}})}}},{key:"updateFrustumHPR",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.head,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.pitch,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";function s(e){return e*Math.PI/180}"alone"==o?(this.hpr.heading=s(e),this.hpr.pitch=s(t),this.hpr.roll=s(i)):(this.hpr.heading=Cesium.Math.negativePiToPi(e),this.hpr.pitch=Cesium.Math.negativePiToPi(t),this.hpr.roll=Cesium.Math.negativePiToPi(i)),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"updateFrustumAttributes",value:function(){if(this.position&&this.hpr){var e=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr);if(e)try{var t=new Cesium.FrustumOutlineGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(e,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(e,new Cesium.Matrix3))}),i=new Cesium.PolylineColorAppearance({translucent:!1}),n=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW),o=new Cesium.FrustumGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(e,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(e,new Cesium.Matrix3))}),s=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.YELLOW.withAlpha(.5)}),translucent:!0}),a=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED.withAlpha(.5));this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:t,attributes:{color:n}}),appearance:i,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumOutline),this.currentFrustumFilled=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:a}}),appearance:s,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumFilled)}catch(e){console.error("Error in drawFrustum:",e)}else console.error("Transform generation failed.")}else console.error("Position or HPR is not defined:",this.position,this.hpr)}},{key:"updateFrustumNearFar",value:function(e,t){this.frustum.near=e,this.frustum.far=t,this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"updateFrustumFov",value:function(e){this.frustum.fov=Cesium.Math.toRadians(e),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"show",get:function(){return this.options.show},set:function(e){"boolean"==typeof e&&(this.options.show=e,this.currentFrustumOutline.show=e,this.currentFrustumFilled.show=e)}},{key:"remove",value:function(){document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("keyup",this.keyupHandler),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.videoEntity&&this.viewer.entities.remove(this.videoEntity)}}],[{key:"setDefaultValue",value:function(e){var t;e.options.position=e.options.position||{},e.options.fov=e.options.fov||30,e.options.aspectRatio=e.options.aspectRatio||1,e.options.near=e.options.near||1,e.options.far=e.options.far||120,e.options.heading=e.options.heading||0,e.options.pitch=e.options.pitch||90,e.options.roll=e.options.roll||0,e.options.show=null===(t=e.options.show)||void 0===t||t,e.options.videoUrl=e.options.videoUrl||"",e.options.index=e.options.index||0,e.options.arr=e.options.arr||[],e.options.normalHeight=e.options.normalHeight||100}}]);var e,t}();function kb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var _b=function(){return x()((function e(t,i){k()(this,e),this.options=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;k()(this,e),this.options=Sb({},t),this.viewer=i,this.viewer1=n,this.entity=null,this.frustum=null,this.billordPointLineMaps=[],this.index=0,this.positions=[],e.setDefaultValue(this),this.create()}),[{key:"create",value:function(){var e=this;if(!(this.options.positions.length<2)){var t=this.options.frustumShow;this.entity=this.viewer.entities.add({show:this.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){for(var t=[],i=0;ithis.options.positions.length-1||this.index<0){var t=this.index>0?"已选中最后一个航点":"已选中第一个航点";alert(t)}else for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=Pb(this,t,[e,n])).options.tipText=n.tipText?n.tipText:"左键确定,右键结束;",i}return wn()(t,e),x()(t,[{key:"start",value:function(e){var t=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Q(this.options.tipText,this.sdk),this.event=new K(this.sdk),this.isEntity=!1,this.event.mouse_left((function(n,o){t.end();var s=t.cartesian3Towgs84(i||o,t.viewer),a=t.viewer.scene.pick(n.position);Cesium.defined(a)&&Cesium.defined(a.id)&&a.id.id===window.airportEntity.options.id&&(t.isEntity=!0),e(null,s,t.isEntity)})),this.event.mouse_right((function(i,n){t.end(),e(!1)})),this.event.mouse_move((function(e,n){i=n,t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;t.event.gesture_pinck_end((function(){if(new Date-s>=500)t.end(),e(!1);else{t.end();var n=t.cartesian3Towgs84(i||o,t.viewer);e(null,n)}}))}))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip.destroy()}}])}(ha);function Mb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Tb(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Ob(this,t,[e,n])).viewer=i.sdk.viewer,i.options.name=n.name||"飞线",i.options.pointNumber=n.pointNumber||200,i.options.height=n.height||200,i.options.heightDifference=n.heightDifference||3e3,i.options.width=n.width||2,i.options.duration=n.duration||10,i.options.color=n.color||"rgba(255,255,255,1)",i.options.lineBackAlpha=n.lineBackAlpha||.05,i.options.positions=n.positions||[],i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new Ln,i._elms={},i.positionArea=[],i.positions=[],i.sdk.addIncetance(i.options.id,i),t.drawLine(i),i}return wn()(t,e),x()(t,[{key:"getRandomPointsInCesiumPolygon",value:function(e,t){var i=[],n=[],o=[];e.forEach((function(e){i.push(e.lng),n.push(e.lat),o.push([e.lng,e.lat])})),o.push([o[0][0],o[0][1]]);for(var s=Math.min.apply(Math,i),a=Math.max.apply(Math,i),r=Math.min.apply(Math,n),l=Math.max.apply(Math,n),c=[];c.length0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=19;break}return e.next=7,new _n(this.sdk,this.originalOptions,{title:"飞线属性",left:"180px",top:"100px",confirmCallBack:function(e){s.name=s.name.trim(),s.name||(s.name="飞线"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Mt(s.sdk,s.options.id),at(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(e){s.show=e,s.Dialog.showCallBack&&s.Dialog.showCallBack()}},!0);case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" flow-line-surface",(i=document.createElement("div")).innerHTML='\n \n
    \n
    \n
    \n 名称\n \n
    \n
    \n 颜色\n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n 飞线数量\n
    \n \n \n
    \n
    \n
    \n 飞线宽度\n
    \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n\n
    \n 飞线高度\n
    \n \n \n
    \n
    \n
    \n 飞线高度差\n
    \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n 单次运动时长(s)\n
    \n \n \n
    \n
    \n
    \n 轨迹透明度\n
    \n \n \n
    \n
    \n
    \n
    \n \n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("flowLine-color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],e.next=19;break;case 19:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.name=this.originalOptions.name,this.pointNumber=this.originalOptions.pointNumber,this.height=this.originalOptions.height,this.heightDifference=this.originalOptions.heightDifference,this.width=this.originalOptions.width,this.duration=this.originalOptions.duration,this.color=this.originalOptions.color,this.lineBackAlpha=this.originalOptions.lineBackAlpha)}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p.length>0&&void 0!==p[0]&&p[0],fi(0),oi(this.sdk),si(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Tb({},this.options.position):this.options.positions?r=Tb({},this.options.positions[0]):this.options.center?r=Tb({},this.options.center):this.options.start?r=Tb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t});else{for(l=[],c=0;c=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ab(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i=Number(t.target.min))&&(i=i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&iNumber(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i0&&t[o].addEventListener(e,(function(t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),this.viewer=t.viewer,this.options=Fb({},i),this.sdk=Fb({},t);var o=new Date;o.setHours(0,0,0,0),this.options.time=i.time,this.options.hour=i.hour,this.options.speed=i.speed||1e3,this.options.darkness=i.darkness||.4,this.options.softShadow=i.softShadow||!0,this.options.show=!0===i.show,this.Dialog=n,this.timeLine,this._EventBinding=new Ib,this._elms={},e.start(this)}),[{key:"darkness",get:function(){return this.options.darkness},set:function(e){this.options.darkness=e,this.viewer.shadowMap.darkness=1-this.options.darkness,this._elms.darkness&&this._elms.darkness.forEach((function(t){t.value=e}))}},{key:"time",get:function(){return this.options.time},set:function(e){this.options.time=e;var t=(new Date).setHours(0,0,0,0);this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t))}},{key:"timeBar",set:function(e){var t=this.time+" "+e;this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t)),this.viewer.scene.requestRender()}},{key:"realTime",set:function(e){var t=new Date;this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(t)}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=e,this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e})),this.viewer.clock.multiplier=this.options.speed}},{key:"softShadow",get:function(){return this.options.softShadow},set:function(e){this.options.softShadow=e,this.viewer.shadowMap.softShadows=this.options.softShadow}},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=l.length>0&&void 0!==l[0]&&l[0],i=new bi,this.originalOptions=i.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t&&(n=this,this.timeLine=new Rb(this.sdk,this.options.speed),this.timeLine.moveComplay((function(e){var t=n.time+" "+e;n.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t)),n.viewer.scene.requestRender()})),s=contentElm.getElementsByClassName("sunshine-date")[0],o=jeDate(s,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(e){this.time=e.val;var t=(new Date).setHours(0,0,0,0);n.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t)),n.timeLine.updateTime(t)}}),this.time?o.setValue(this.time):(o.nowBtn&&o.nowBtn(),this.time=o.getValue()),r=contentElm.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.color=[o]);case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.time=this.originalOptions.time,this.speed=this.originalOptions.speed,this.darkness=this.originalOptions.darkness)}},{key:"flyTo",value:(t=o()(a.a.mark((function e(){var t=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!(t.length>0&&void 0!==t[0])||t[0];case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:(e=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.viewer.scene.globe.enableLighting=!1,this.viewer.shadows=!1,this.viewer.clock.multiplier=1,this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date),this.entity=null,this.timeLine&&this.timeLine.clear(),this.viewer.shadowMap.cascadesEnabled=!1,this.viewer.shadowMap.size=1024,this.viewer.shadowMap.numberOfCascades=3,this.viewer.shadowMap._lightCamera,this.viewer.shadowMap.normalOffset=!1,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=14,Mt(this.sdk,this.options.id);case 14:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"start",value:function(e){var t;e.viewer.scene.globe.enableLighting=!0,e.viewer.shadows=!0,e.viewer.scene.globe.enableLighting=!0,e.viewer.terrainShadows=Cesium.ShadowMode.RECEIVE_ONLY,e.viewer.shadowMap.darkness=1-e.options.darkness,e.options.time&&e.options.hour?t=new Date(e.options.time+" "+e.options.hour):(t=new Date).setHours(0,0,0,0),e.viewer.clock.currentTime=Cesium.JulianDate.fromDate(t),e.viewer.clock.multiplier=e.options.speed,e.viewer.shadowMap.softShadows=e.options.softShadow,e.viewer.shadowMap.cascadesEnabled=!0,e.viewer.shadowMap.size=2048,e.viewer.shadowMap.numberOfCascades=4,e.viewer.shadowMap.maximumDistance=5e3;var i=e.viewer.shadowMap._lightCamera;i.frustum.near=.1,i.frustum.far=1e4,e.viewer.shadowMap.normalOffset=!0}}]);var e,t,i}();function Vb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Gb(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t,i){for(var n=[],o=[],s=[],a=0;am&&m>-1.001)o.push(v);else{var C=[];C[0]=v[1],C[1]=v[2],C[2]=v[3],C[3]=v[0],o.push(C)}},r=0;r2&&void 0!==arguments[2]?arguments[2]:.01;if(!t.width||!t.height)throw new Error("Texture size must contain width and height in pixels");for(var n=Cesium.PolygonGeometry.createGeometry(new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(e),vertexFormat:Cesium.VertexFormat.POSITION_ONLY})),o=0,s=n.indices,a=n.attributes.position.values,r=0;r0)return Cesium.Cartesian3.fromDegrees(u.features[0].geometry.coordinates[0],u.features[0].geometry.coordinates[1])}},{key:"getLonLat",value:function(e){var t=Cesium.Cartographic.fromCartesian(e);return{lon:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude)}}},{key:"createLineBufferPolygon",value:function(e,t,i){for(var n=[],o=0;o0?n.unshift(Cesium.Cartesian3.add(s,u,new Cesium.Cartesian3)):i<0&&n.push(Cesium.Cartesian3.add(s,u,new Cesium.Cartesian3))}return n}},{key:"calculateAangle",value:function(e){function t(e,t){var i=Math.PI/180,n=e.y*i,o=t.y*i,s=e.x*i,a=t.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=e[0],n=e[1],o=e[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:t(s,a),angle2:t(s,r)}}},{key:"carRoadWidth",get:function(){return this.options.carRoadWidth},set:function(e){this.options.carRoadWidth=e,t.create(this)}},{key:"sideWidth",get:function(){return this.options.sideWidth},set:function(e){this.options.sideWidth=e,t.create(this)}},{key:"edit",value:(s=o()(a.a.mark((function e(){var t,i,n,o=this,s=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]&&s[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=17;break}return e.next=7,new _n(this.sdk,this.originalOptions,{title:"道路属性",left:"180px",top:"100px",confirmCallBack:function(e){o.name=o.name.trim(),o.name||(o.name="道路"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(o.originalOptions),Mt(o.sdk,o.options.id),at(o.sdk,o.options.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},closeCallBack:function(){o.reset(),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(e){o.show=e,o.Dialog.showCallBack&&o.Dialog.showCallBack()}},!0);case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" road-surface",(i=document.createElement("div")).innerHTML='\n \n
    \n
    \n
    \n 名称\n \n
    \n
    \n 道路类型\n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n 车道宽度\n
    \n \n \n
    \n
    \n
    \n 人行道宽度\n
    \n \n \n
    \n
    \n
    \n
    \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,e.next=17;break;case 17:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.name=this.originalOptions.name,this.carRoadWidth=this.originalOptions.carRoadWidth,this.sideWidth=this.originalOptions.sideWidth,this.positions=this.originalOptions.positions,this.roadImage=this.originalOptions.roadImage,this.sideImage=this.originalOptions.sideImage)}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p.length>0&&void 0!==p[0]&&p[0],fi(0),oi(this.sdk),si(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Gb({},this.options.position):this.options.positions?r=Gb({},this.options.positions[0]):this.options.center?r=Gb({},this.options.center):this.options.start?r=Gb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t});else{for(l=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k()(this,t),(i=qb(this,t,[e,n])).options.position=n.position||[],i.options.text=n.text||"",i.options.show=!n.show&&!1!==n.show||n.show,i.clickTextDom=void 0,i.handler=void 0,i.textDom=void 0,i.create(i),i.sdk.addIncetance(i.options.id,i),i.callback=o,i}return wn()(t,e),x()(t,[{key:"type",get:function(){return"TextBox"}},{key:"create",value:(h=o()(a.a.mark((function e(t){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.sdk.viewer,(n=document.createElement("span")).id=t.options.id,n.className="popup-textarea",n.style.zIndex=1,(o=document.createElement("textarea")).className="textarea",o.value=t.options.text,o.rows=6,o.style.resize="none",n.appendChild(o),!t.options.show&&(n.style.display="none"),i.cesiumWidget.container.appendChild(n),s=Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt),t.handler=function(){var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.scene,s);if(e){var t=1*n.clientWidth,o=1*n.clientHeight;n.style.left="".concat(e.x-t/2,"px"),n.style.top="".concat(e.y-o,"px")}},i.scene.postRender.addEventListener(t.handler),t.textDom=n;case 17:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)})},{key:"isClick",value:(u=o()(a.a.mark((function e(t,i){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.clickCallBack({position:t},i,null);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"setHandeler",value:(c=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this,(n=this.sdk.viewer.scene.pickPosition(new Cesium.Cartesian2(t.x,t.y)))||(o=this.sdk.viewer.camera.getPickRay(new Cesium.Cartesian2(t.x,t.y)),n=this.sdk.viewer.scene.globe.pick(o,this.sdk.viewer.scene)),!Cesium.defined(n)){e.next=15;break}return i.sdk.viewer.scene.postRender.removeEventListener(i.handler),s=Cesium.Cartographic.fromCartesian(n),r=Cesium.Math.toDegrees(s.longitude),l=Cesium.Math.toDegrees(s.latitude),e.next=10,i.getClampToHeight({lng:r,lat:l});case 10:e.sent,i.position={lng:r,lat:l,alt:s.height},c=Cesium.Cartesian3.fromDegrees(r,l,s.height),i.handler=function(){var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.sdk.viewer.scene,c);if(e){var t=1*i.textDom.clientWidth,n=1*i.textDom.clientHeight;i.textDom.style.left="".concat(e.x-t/2,"px"),i.textDom.style.top="".concat(e.y-n,"px")}},i.sdk.viewer.scene.postRender.addEventListener(i.handler);case 15:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"getwords",value:(l=o()(a.a.mark((function e(t){var i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.options.text=t,this.callback(this.options),i=Ht(),n=i.sdkP,this.sdk===n&&n?Mt(this.sdk,this.options.id):n?(n.entityMap.get(this.options.id).text=t,n.entityMap.get(this.options.id).twoToThree(this.options.position)):n||Mt(this.sdk,this.options.id);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"twoToThree",value:(r=o()(a.a.mark((function e(t){var i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i=this).sdk.viewer.scene.postRender.removeEventListener(i.handler),n=Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),i.handler=function(){var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.sdk.viewer.scene,n);if(e){var t=1*i.textDom.clientWidth,o=1*i.textDom.clientHeight;i.textDom.style.left="".concat(e.x-t/2,"px"),i.textDom.style.top="".concat(e.y-o,"px")}},i.sdk.viewer.scene.postRender.addEventListener(i.handler);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"returnFun",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.handler);case 1:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"text",get:function(){return this.options.text},set:function(e){this.options.text=e,this.textDom.querySelector("textarea").value=e,this.callback(this.options)}},{key:"onClick",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"show",get:function(){return this.options.show},set:function(e){this.options.show=e,this.textDom&&(this.textDom.style.display=e?"block":"none"),Mt(this.sdk,this.options.id)}},{key:"position",get:function(){return this.options.position},set:function(e){this.options.position=e}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.length>0&&void 0!==h[0]&&h[0],fi(0),oi(this.sdk),si(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation?(t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Jb({},this.options.position):this.options.position?r=Jb({},this.options.position[0]):this.options.center?r=Jb({},this.options.center):this.options.start?r=Jb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t})):(l=[],c=Cesium.Cartesian3.fromDegrees(this.position.lng,this.position.lat,this.position.alt),l.push(c.x,c.y,c.z),u=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(u,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}}));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.handler&&(this.sdk.viewer.scene.postRender.removeEventListener(this.handler),this.handler=void 0),this.textDom&&this.textDom.parentNode&&this.sdk.viewer.cesiumWidget.container.removeChild(this.textDom),e.next=4,this.sdk.removeIncetance(this.options.id);case 4:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}]);var i,n,s,r,l,c,u,h}($n);function Zb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Kb(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};k()(this,t),(i=Qb(this,t,[e,n])).viewer=i.sdk.viewer,i.options.name=n.name||"批量模型",i.options.type=n.type||"面",i.options.url=n.url||"",i.options.spacing=1*n.spacing||50,i.options.positions=n.positions||[],i.options.show=!n.show&&!1!==n.show||n.show,i.callback=o,i.Dialog=s,i._EventBinding=new Ln,i._elms={},i.pointArr=[],i.sdk.addIncetance(i.options.id,i);var a=new bi(e);if(i.options.spacing<0||1*n.spacing==0)return a.message({type:"warning",text:"请输入正确的间距!"}),gn()(i);if(n.type&&null!=n.spacing||"点"==n.type){var r;switch(n.type){case"点":r=new Kr(i.sdk);break;case"线":r=new Ur(i.sdk);break;case"面":r=new Xr(i.sdk)}r&&r.start((function(e,o){if(i.options.positions=o,"面"==n.type){var s=o.map((function(e){return Cesium.Cartesian3.fromDegrees(e.lng,e.lat)})),r=Cesium.Cartesian3.distance(s[0],s[1]),l=Cesium.Cartesian3.distance(s[1],s[2]);if(r/i.options.spacing*(l/i.options.spacing)>100)return void a.message({type:"warning",text:"数量大于100,请重新绘制"})}else if("线"==n.type){for(var c=o.map((function(e){return Cesium.Cartesian3.fromDegrees(e.lng,e.lat)})),u=0,h=0;h100)return void a.message({type:"warning",text:"数量大于100,请重新绘制"})}(i.options.positions.length||i.options.positions.lng)&&t.computeDis(i)}))}else i.edit(!0);return i}return wn()(t,e),x()(t,[{key:"linePoint",value:(u=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],o=[],s=0;case 3:if(!(s0&&void 0!==h[0]&&h[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=33;break}return e.next=7,new _n(this.sdk,this.originalOptions,{title:"默认模型参数设置",left:"180px",top:"100px",confirmCallBack:function(e){var i;switch(u.name=u.name.trim(),u.name||(u.name="飞线"),u.options.type){case"点":i=new Kr(u.sdk);break;case"线":i=new Ur(u.sdk);break;case"面":i=new Xr(u.sdk)}i&&i.start((function(e,i){u.options.positions=i,(u.options.positions.length||u.options.positions.lng)&&t.computeDis(u)})),u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions),Mt(u.sdk,u.options.id),at(u.sdk,u.options.id)},closeCallBack:function(){u.reset(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"重置",event:["click",function(){u.reset()}]}]},!0);case 7:if(this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" flow-line-surface",(n=document.createElement("div")).innerHTML='\n \n
    \n
    \n
    \n 添加方式\n
    \n
    \n
    \n 间距\n
    \n \n \n \n
    \n
    \n
    \n
    \n \n ',this._DialogObject.contentAppChild(n),o=n.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,s=[{name:"点",value:"点"},{name:"线",value:"线"},{name:"面",value:"面"}],!(r=q(this._DialogObject._element.content.getElementsByClassName("add-type-box")[0],".add-type"))){e.next=31;break}r.legp_search(s),l=this._DialogObject._element.content.getElementsByClassName("add-type")[0].getElementsByTagName("input")[0],this._elms.type=[l],l.value=this.options.type,c=0;case 23:if(!(c0&&void 0!==p[0]&&p[0],fi(0),oi(this.sdk),si(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Kb({},this.options.position):this.options.positions?r=Kb({},this.options.positions[0]):this.options.center?r=Kb({},this.options.center):this.options.start?r=Kb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t});else if(l=[],this.options.positions.length>0){for(c=0;c0&&void 0!==arguments[0]?arguments[0]:{isc:!1,excel:!1,flv:!1,rtsp:!1,hls:!1,host:"",username:"",password:"",token:""};return new Promise((function(t,i){var n=f(),o=["/custom/css/index.css","/arrow/algorithm.js","/arrow/plotUtil.js","/3rdparty/turf.min.js","/3rdparty/fabric.min.js","/3rdparty/proj4.js","/3rdparty/pako.min.js","/3rdparty/heatmap.js","/3rdparty/tween.umd.js","/Cesium/Cesium.js","/Cesium/Widgets/widgets.css","/3rdparty/ewPlugins.min.js","/3rdparty/wangeditor/index.js","/3rdparty/wangeditor/style.css","/3rdparty/html2canvas.min.js","/3rdparty/kriging.js","/3rdparty/echarts.min.js","/3rdparty/clipboard.min.js","/3rdparty/libgif.js","/3rdparty/liveplayer/liveplayer-element.min.js","/3rdparty/jedate/jedate.min.js","/3rdparty/jedate/skin/jedate.css"];window.YJSDK3rdpartyResourceAddress=n+"/3rdparty",e.ws&&o.push("/3rdparty/reconnecting-websocket.js"),(e.flv||e.rtsp)&&o.push("/3rdparty/flv.min.js");var s=document.createElement("script");s.setAttribute("type","module"),s.textContent="\n import * as THREE from '".concat(n,"/3rdparty/three/three.module.min.js';\n window.THREE = THREE\n "),document.querySelector("html").appendChild(s);var a=document.createElement("script");a.setAttribute("type","module"),a.textContent="\n import { SVGLoader } from '".concat(n,"/3rdparty/three/jsm/loaders/SVGLoader.js';\n window.SVGLoader = SVGLoader\n "),document.querySelector("html").appendChild(a);var r=[];o.forEach((function(e){var t;e.endsWith(".js")?((t=document.createElement("script")).setAttribute("type","text/javascript"),t.setAttribute("src",n+e)):((t=document.createElement("link")).setAttribute("rel","stylesheet"),t.setAttribute("href",n+e)),document.querySelector("html").appendChild(t);var i=new Promise((function(e,i){t.onload=function(){e()}})).then((function(e){return e}));r.push(i)})),Promise.all(r).then((function(i){var o,s;(o=document.createElement("script")).setAttribute("type","text/javascript"),o.setAttribute("src",n+"/3rdparty/viewerCesiumNavigationMixin.min.js"),document.querySelector("html").appendChild(o),o.onload=function(){h(e.host),e.username?c(e).then((function(e){t()})):(d(e.token),t())},(s=document.createElement("script")).setAttribute("type","text/javascript"),s.setAttribute("src",n+"/3rdparty/CesiumHeatmap.js"),document.querySelector("html").appendChild(s)})).catch((function(e){i(e)}))}))},Obj:{ArcgisWXImagery:Ml,ArcgisBLUEImagery:Tl,ArcgisLWImagery:Ol,GDLWImagery:Al,GDWXImagery:Ll,GDSLImagery:Il,Tileset:Kl,BIM:lc,Layer:Bc,Layer3rdparty:Lc,Terrain:Yc,Flame:tu,Smoke:uu,Fountain:bu,Spout:Eu,WaterSurface:hp,CircleDiffuse:yo,CircleObject:hh,EllipseObject:yh,RadarScan:Do,RadarScanStereoscopic:Zh,SectorObject:np,WallStereoscopic:Sh,WallRealStereoscopic:Nh,KML:sp,GeoJson:rp,BillboardObject:zo,PolygonObject:Wo,PolyhedronObject:Au,AssembleObject:zu,AttackArrowObject:Yu,PincerArrowObject:Ku,StraightArrowObject:oh,PolylineObject:is,CurvelineObject:Hh,Explosion:Uh,Model:wc,Model2:Mc,TrajectoryMotion:Cp,TrajectoryMotionObject:Op,Graffiti:Bp,GroundImage:Hp,GroundSvg:hy,RoutePlanning:vy,Shp:Dy,Vector:Jy,GroundText:Ky,StandText:$y,RichText:Wn,LocateCurrent:ra,LoadObjModel:nb,Heatmap:pb,FlyRoam:bb,newAirLine:Eb,FRUSTUN:wb,Dialog:_n,FlowLine:Nb,Road2:Ub,TextBox:Xb,BatchModel:$b},YJEarth:hn,Tools:bi,Proj:R,Global:{getCurrentView:function(e){var t=new bi,i=e.viewer;return JSON.parse(JSON.stringify({position:t.cartesian3Towgs84(i.camera.position,i),orientation:{heading:Cesium.Math.toDegrees(i.camera.heading),pitch:Cesium.Math.toDegrees(i.camera.pitch),roll:Cesium.Math.toDegrees(i.camera.roll)}}))},setDefaultView:function(e,t){var i=e.viewer;t?i.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:t.destination||{},orientation:t.orientation||{}}:(i.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2))},switchCluster:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e.viewer,n=0;n=0;n--)t.removeChild(i[n]);ms=0,fs=0},flyTo:ys,setRepeat:function(e){ms!=Number(e)&&(ms=Number(e),fs=ms)},cease:bs},flyTo:Kt,efflect:{rain:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Cs&&e.viewer.scene.postProcessStages.remove(Cs),t&&(Cs=new Cesium.PostProcessStage({name:"rain",fragmentShader:xs,uniforms:{tiltAngle:-.4,rainSize:.3,rainWidth:40,rainSpeed:100}}),e.viewer.scene.postProcessStages.add(Cs))},snow:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];ws&&e.viewer.scene.postProcessStages.remove(ws),t&&(ws=new Cesium.PostProcessStage({name:"snow",fragmentShader:Ss,uniforms:{snowSize:2,snowSpeed:60}}),e.viewer.scene.postProcessStages.add(ws))},fog:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];ks&&e.viewer.scene.postProcessStages.remove(ks),t&&(ks=new Cesium.PostProcessStage({name:"fog",fragmentShader:Es,uniforms:{visibility:.2,fogColor:Cesium.Color.WHITE}}),e.viewer.scene.postProcessStages.add(ks))},nightVision:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_s&&e.viewer.scene.postProcessStages.remove(_s),t&&(_s=Cesium.PostProcessStageLibrary.createNightVisionStage(),e.viewer.scene.postProcessStages.add(_s))},skyStarry:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.viewer.scene.skyAtmosphere.show=!t},illumination:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.viewer.shadows=t,e.viewer._shadows=t},Sunshine:Hb},CameraController:$t,CesiumContainer:ei,setBillboardDefaultUrl:ti,getBillboardDefaultUrl:ii,multiViewportMode:{on:function(e){return St.apply(this,arguments)},off:Et,get2DView:Rt,getSdk:Ht},MouseCoordinate:function(e,t){if(e&&e.viewer){ps=e,(ds=Ht().sdkD)||(ds=rt().sdkD);var i=new bi(e),n=e.proj;if(t){var o=function(){us=requestAnimationFrame(o),r()};rs&&rs.destroy(),ls&&(ls.destroy(),ls=void 0),rs=new K(e),hs=null;var s,a={x:"",y:"",z:""};cs?s=cs:((s=document.createElement("div")).style.position="absolute",s.style["z-index"]=777,s.style.color="#ff0000",s.style.left="0px",s.style.top="0px",s.style.width="100%",s.style.height="100%",s.style["font-size"]="12px",s.style["pointer-events"]="none",s.style.background="url(".concat(i.getSourceRootPath(),"/img/cross.png) no-repeat 100% 100%"),s.style["background-size"]="200% 200%",cs=s),e.viewer.container.appendChild(s),rs.mouse_move((function(t,i){ps=e,hs=function(e){for(var t=1;t

    经度:").concat(d.lng.toFixed(6),"°

    维度:").concat(d.lat.toFixed(6),"°

    海拔:").concat(d.alt.toFixed(2)," m

    ");break;case"度分":s.innerHTML="

    经度:").concat(n.degreesToDMS(d.lng,!0),"

    维度:").concat(n.degreesToDMS(d.lat,!0),"

    海拔:").concat(d.alt.toFixed(2)," m

    ");break;case"度分秒":s.innerHTML="

    经度:").concat(n.degreesToDMS(d.lng,!1),"

    维度:").concat(n.degreesToDMS(d.lat,!1),"

    海拔:").concat(d.alt.toFixed(2)," m

    ")}else{var v=i.convert([{x:d.lng,y:d.lat,z:d.alt}],"EPSG:4326",function(e,t){var i;switch(e){case"EPSG:32601":var n=Math.round((t.lng+180)/6+1);i=t.lat>0?"EPSG:"+(i=32600+n):"EPSG:"+(i=32700+n);break;case"EPSG:4534":i="EPSG:"+(i=Math.round(t.lng/3)-25+4534);break;case"EPSG:4513":i="EPSG:"+(i=Math.round(t.lng/3)-25+4513);break;case"EPSG:4502":var o=Math.floor(t.lng/6)+31;o<13&&(o=13),o>23&&(o=23),i="EPSG:"+(i=o-13+4502);break;case"EPSG:4491":var s=Math.floor(t.lng/6)+31;s<13&&(s=13),s>23&&(s=23),i="EPSG:"+(i=s-13+4491)}return i}(m,d));a=v.points[0],s.innerHTML="

    x:").concat(a.x.toFixed(6),"

    y:").concat(a.y.toFixed(6),"

    z:").concat(a.z.toFixed(6),"

    ")}}else{var g=ui();s.innerHTML="EPSG:4326"===g?"

    经度:-

    维度:-

    海拔:-

    "):"

    x:-

    y:-

    z:-

    ")}}}};o()}else rs&&rs.destroy(),ls&&(ls.destroy(),ls=void 0),cs&&(e.viewer.container.removeChild(cs),cs=void 0),us&&cancelAnimationFrame(us)}},MouseRightMenu:ne,setGroundCover:function(e,t){Jt=!!t,function(e){if(!e)return;for(var t=0;t经度:".concat(Number(s.lng.toFixed(6)),"° \n 纬度:").concat(Number(s.lat.toFixed(6)),"° \n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ");break;case"度分":i.innerHTML="\n 经度:".concat(o.degreesToDMS(s.lng,!0),"\n 纬度:").concat(o.degreesToDMS(s.lat,!0),"\n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ");break;case"度分秒":i.innerHTML="\n 经度:".concat(o.degreesToDMS(s.lng,!1),"\n 纬度:").concat(o.degreesToDMS(s.lat,!1),"\n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ")}else{var a=o.convert([{x:s.lng,y:s.lat,z:s.alt}],"EPSG:4326",hi(Ut,s));i.innerHTML="\n x:".concat(Number(a.points[0].x.toFixed(6)),'\n y:').concat(Number(a.points[0].y.toFixed(6)),'\n z:').concat(Number(a.points[0].z.toFixed(6)),"\n ")}}}},getDMS:pi,setDMS:function(e,t){if("EPSG:4326"===Ut&&(Yt=t,e&&e.viewer&&e.viewer._element)){var i=e.viewer._element.getElementsByClassName("cesium-info")[0];if(Wt&&i){var n=new bi,o=e.proj,s=n.cartesian3Towgs84(Wt,e.viewer);switch(t){case"度":i.innerHTML="\n 经度:".concat(Number(s.lng.toFixed(6)),"° \n 纬度:").concat(Number(s.lat.toFixed(6)),"° \n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ");break;case"度分":i.innerHTML="\n 经度:".concat(o.degreesToDMS(s.lng,!0),"\n 纬度:").concat(o.degreesToDMS(s.lat,!0),"\n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ");break;case"度分秒":i.innerHTML="\n 经度:".concat(o.degreesToDMS(s.lng,!1),"\n 纬度:").concat(o.degreesToDMS(s.lat,!1),"\n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ")}o.degreesToDMS(s.lng,!0)}}},DTH:mn,cameraChanged:function(e,t){var i=new bi;return e.viewer.camera.changed.addEventListener((function(n){t({position:i.cartesian3Towgs84(e.viewer.camera.position,e.viewer),orientation:{heading:e.viewer.camera.heading,pitch:e.viewer.camera.pitch,roll:e.viewer.camera.roll}})}))},setMaximumRequestsPerServer:function(e){"number"==typeof e&&(Cesium.RequestScheduler.maximumRequestsPerServer=e)},setKeyboardEventActive:function(e,t){e&&(e.viewer._disableKeyboardEvent=!t)},setSkin:function(e){document.documentElement.style.setProperty("--color-sdk-base","rgba(0, 55, 55, 1)")},getTheme:function(){return te},setTheme:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=Array.from(te[e].keys());t.forEach((function(t){document.documentElement.style.setProperty(t,te[e].get(t))}))},getCesiumManageIndexexDBState:di,setCesiumManageIndexexDBState:mi,getCesiumIndexedDBMaxSize:function(){var e=Number(Number(localStorage.getItem("IndexedDBMaxSize")).toFixed(0));return(isNaN(e)||e<1073741824)&&(e=1073741824),e},setCesiumIndexedDBMaxSize:function(e){var t=Number(Number(e).toFixed(0));(isNaN(t)||t<1073741824)&&(t=1073741824),Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.SetIndexedDBMaxSize(t),localStorage.setItem("IndexedDBMaxSize",t)},getCesiumIndexedDBCurrentSize:function(){return Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.GetIndexedDBCurrentSize()},enablePerspective:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t||0==t||(t=1),e.viewer.scene.globe.translucency.frontFaceAlpha=t},closeRotateAround:oi,SheetIndexStatusSwitch:Ne,SheetIndexShangeScale:Be,splitScreen:{on:function(e){return qe.apply(this,arguments)},off:Xe,setActiveId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(We=Array.isArray(e)?e:[e],Ve&&He){var t=Ve.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],i=Ve.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];if(e&&0!==e.length){if(t&&i){t.style.display="none",i.style.display="none";for(var n=0,o=0,s=0;s16360){var i=e.viewer.camera.positionCartographic;Kt(e,{position:{lng:Cesium.Math.toDegrees(i.longitude),lat:Cesium.Math.toDegrees(i.latitude),alt:16360}},.5)}Qs(e)}else $s(e)},ContourReset:function(){Bs=19,Ls=10,Is="#ffd000",js=!0,Rs=2.5,zs="#43cf7c",Fs=!0,Hs=1.8,Vs="#ff0000",Gs=!1,Ws=1,Us="#64b6d9",Ys=!1,Js=1,qs="#d084d1"}},Measure:{GetMeasureStatus:function(){return YJ.Measure[eC]},SetMeasureStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];YJ.Measure[eC]=e},Clear:function(){YJ.Measure.Measures.forEach((function(e){e.destroy()})),YJ.Measure.Measures=[]},Measures:[],MeasureDistance:lr,MeasureProjectionDistance:dr,MeasureSlopeDistance:yr,MeasureTyArea:_r,MeasureTdArea:Dr,MeasureTriangle:Or,MeasureLocation:Ar,MeasureHeight:jr,MeasureAngle:Fr,MeasureAzimuth:Gr},Draw:{DrawPolyline:Ur,DrawPolygon:fa,DrawPoint:Kr,DrawCircle:$r,DrawElliptic:tl,DrawAttackArrow:nl,DrawPincerArrow:sl,DrawStraightArrow:ll,DrawRect:ul,DrawAssemble:dl,DrawSector:fl,DrawTakeOff:Db,DrawThreeRect:Xr},Analysis:{Clear:function(){YJ.Analysis.AnalysesResults.forEach((function(e){e.destroy()}))},CutFillAnalysis:va,Submerge:Ca,ViewShed:xa,CircleViewShed:Na,SlopeAspect:Ia,Profile:Ra,Visibility:Fa,Contour:Ha,Section:Ua,TerrainExcavation:qa,Flat:$a,AnalysesResults:[],SectionResults:[],ClearSection:function(){YJ.Analysis.SectionResults.forEach((function(e){e.destroy()}))}},CoordTransform:bl,RoutePlanningArrays:[],ClearAllRoutePlanning:function(){YJ.RoutePlanningArrays.forEach((function(e){e.destroy()})),YJ.RoutePlanningArrays=[]}},window.YJ.Obj.LoadObjModel=rb,window.YJ.Obj.BatchLoadObjModel=ub)}]); \ No newline at end of file + */()?Reflect.construct(t,i||[],bn()(e).constructor):t.apply(e,i))}var Xp=1014,Zp=1020,Kp=2400,Qp=2401,$p="srgb",ed="srgb-linear",td="display-p3",id="display-p3-linear",nd="linear",od="srgb",sd="rec709",ad=7680,rd=35044,ld=2e3,cd=2001,ud=function(){return x()((function e(){k()(this,e)}),[{key:"addEventListener",value:function(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)}},{key:"hasEventListener",value:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)}},{key:"removeEventListener",value:function(e,t){if(void 0!==this._listeners){var i=this._listeners[e];if(void 0!==i){var n=i.indexOf(t);-1!==n&&i.splice(n,1)}}}},{key:"dispatchEvent",value:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var i=t.slice(0),n=0,o=i.length;n>8&255]+hd[e>>16&255]+hd[e>>24&255]+"-"+hd[255&t]+hd[t>>8&255]+"-"+hd[t>>16&15|64]+hd[t>>24&255]+"-"+hd[63&i|128]+hd[i>>8&255]+"-"+hd[i>>16&255]+hd[i>>24&255]+hd[255&n]+hd[n>>8&255]+hd[n>>16&255]+hd[n>>24&255]).toLowerCase()}function md(e,t,i){return Math.max(t,Math.min(i,e))}function fd(e,t){return(e%t+t)%t}function vd(e,t,i){return(1-i)*e+i*t}function gd(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function yd(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}var bd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e),e.prototype.isVector2=!0,this.x=t,this.y=i}),[{key:"width",get:function(){return this.x},set:function(e){this.x=e}},{key:"height",get:function(){return this.y},set:function(e){this.y=e}},{key:"set",value:function(e,t){return this.x=e,this.y=t,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"applyMatrix3",value:function(e){var t=this.x,i=this.y,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6],this.y=n[1]*t+n[4]*i+n[7],this}},{key:"min",value:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}},{key:"max",value:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}},{key:"clamp",value:function(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}},{key:"clampScalar",value:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}},{key:"clampLength",value:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y}},{key:"cross",value:function(e){return this.x*e.y-this.y*e.x}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"angle",value:function(){return Math.atan2(-this.y,-this.x)+Math.PI}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var i=this.dot(e)/t;return Math.acos(md(i,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"lerpVectors",value:function(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}},{key:"rotateAround",value:function(e,t){var i=Math.cos(t),n=Math.sin(t),o=this.x-e.x,s=this.y-e.y;return this.x=o*i-s*n+e.x,this.y=o*n+s*i+e.y,this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:case"end":return e.stop()}}),e,this)}))}])}(),Cd=function(){return x()((function e(t,i,n,o,s,a,r,l,c){k()(this,e),e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,i,n,o,s,a,r,l,c)}),[{key:"set",value:function(e,t,i,n,o,s,a,r,l){var c=this.elements;return c[0]=e,c[1]=n,c[2]=a,c[3]=t,c[4]=o,c[5]=r,c[6]=i,c[7]=s,c[8]=l,this}},{key:"identity",value:function(){return this.set(1,0,0,0,1,0,0,0,1),this}},{key:"copy",value:function(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],this}},{key:"extractBasis",value:function(e,t,i){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}},{key:"setFromMatrix4",value:function(e){var 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}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var i=e.elements,n=t.elements,o=this.elements,s=i[0],a=i[3],r=i[6],l=i[1],c=i[4],u=i[7],h=i[2],p=i[5],d=i[8],m=n[0],f=n[3],v=n[6],g=n[1],y=n[4],b=n[7],C=n[2],w=n[5],k=n[8];return o[0]=s*m+a*g+r*C,o[3]=s*f+a*y+r*w,o[6]=s*v+a*b+r*k,o[1]=l*m+c*g+u*C,o[4]=l*f+c*y+u*w,o[7]=l*v+c*b+u*k,o[2]=h*m+p*g+d*C,o[5]=h*f+p*y+d*w,o[8]=h*v+p*b+d*k,this}},{key:"multiplyScalar",value:function(e){var 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}},{key:"determinant",value:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],r=e[6],l=e[7],c=e[8];return t*s*c-t*a*l-i*o*c+i*a*r+n*o*l-n*s*r}},{key:"invert",value:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],r=e[6],l=e[7],c=e[8],u=c*s-a*l,h=a*r-c*o,p=l*o-s*r,d=t*u+i*h+n*p;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);var m=1/d;return e[0]=u*m,e[1]=(n*l-c*i)*m,e[2]=(a*i-n*s)*m,e[3]=h*m,e[4]=(c*t-n*r)*m,e[5]=(n*o-a*t)*m,e[6]=p*m,e[7]=(i*r-l*t)*m,e[8]=(s*t-i*o)*m,this}},{key:"transpose",value:function(){var e,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}},{key:"getNormalMatrix",value:function(e){return this.setFromMatrix4(e).invert().transpose()}},{key:"transposeIntoArray",value:function(e){var 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}},{key:"setUvTransform",value:function(e,t,i,n,o,s,a){var r=Math.cos(o),l=Math.sin(o);return this.set(i*r,i*l,-i*(r*s+l*a)+s+e,-n*l,n*r,-n*(-l*s+r*a)+a+t,0,0,1),this}},{key:"scale",value:function(e,t){return this.premultiply(wd.makeScale(e,t)),this}},{key:"rotate",value:function(e){return this.premultiply(wd.makeRotation(-e)),this}},{key:"translate",value:function(e,t){return this.premultiply(wd.makeTranslation(e,t)),this}},{key:"makeTranslation",value:function(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}},{key:"makeRotation",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,i,t,0,0,0,1),this}},{key:"makeScale",value:function(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}},{key:"equals",value:function(e){for(var t=this.elements,i=e.elements,n=0;n<9;n++)if(t[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<9;i++)this.elements[i]=e[i+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}},{key:"clone",value:function(){return(new this.constructor).fromArray(this.elements)}}])}(),wd=new Cd;function kd(e){for(var t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function _d(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}var xd={};function Sd(e){e in xd||(xd[e]=!0,console.warn(e))}var Ed,Pd=(new Cd).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Dd=(new Cd).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Md=C()(C()(C()(C()({},ed,{transfer:nd,primaries:sd,toReference:function(e){return e},fromReference:function(e){return e}}),$p,{transfer:od,primaries:sd,toReference:function(e){return e.convertSRGBToLinear()},fromReference:function(e){return e.convertLinearToSRGB()}}),id,{transfer:nd,primaries:"p3",toReference:function(e){return e.applyMatrix3(Dd)},fromReference:function(e){return e.applyMatrix3(Pd)}}),td,{transfer:od,primaries:"p3",toReference:function(e){return e.convertSRGBToLinear().applyMatrix3(Dd)},fromReference:function(e){return e.applyMatrix3(Pd).convertLinearToSRGB()}}),Td=new Set([ed,id]),Od={enabled:!0,_workingColorSpace:ed,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(e){if(!Td.has(e))throw new Error('Unsupported working color space, "'.concat(e,'".'));this._workingColorSpace=e},convert:function(e,t,i){if(!1===this.enabled||t===i||!t||!i)return e;var n=Md[t].toReference;return(0,Md[i].fromReference)(n(e))},fromWorkingColorSpace:function(e,t){return this.convert(e,this._workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this._workingColorSpace)},getPrimaries:function(e){return Md[e].primaries},getTransfer:function(e){return""===e?nd:Md[e].transfer}};function Nd(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Bd(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}var Ad=function(){return x()((function e(){k()(this,e)}),null,[{key:"getDataURL",value:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;var t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Ed&&(Ed=_d("canvas")),Ed.width=e.width,Ed.height=e.height;var i=Ed.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),t=Ed}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")}},{key:"sRGBToLinear",value:function(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var t=_d("canvas");t.width=e.width,t.height=e.height;var i=t.getContext("2d");i.drawImage(e,0,0,e.width,e.height);for(var n=i.getImageData(0,0,e.width,e.height),o=n.data,s=0;s0&&void 0!==arguments[0]?arguments[0]:null;k()(this,e),this.isSource=!0,Object.defineProperty(this,"id",{value:Ld++}),this.uuid=dd(),this.data=t,this.dataReady=!0,this.version=0}),[{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];var i={uuid:this.uuid,url:""},n=this.data;if(null!==n){var o;if(Array.isArray(n)){o=[];for(var s=0,a=n.length;s0&&void 0!==arguments[0]?arguments[0]:t.DEFAULT_IMAGE,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.DEFAULT_MAPPING,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1001,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1001,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1006,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1008,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1023,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1009,u=arguments.length>8&&void 0!==arguments[8]?arguments[8]:t.DEFAULT_ANISOTROPY,h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"";return k()(this,t),(e=qp(this,t)).isTexture=!0,Object.defineProperty(Yp()(e),"id",{value:Rd++}),e.uuid=dd(),e.name="",e.source=new Id(i),e.mipmaps=[],e.mapping=n,e.channel=0,e.wrapS=o,e.wrapT=s,e.magFilter=a,e.minFilter=r,e.anisotropy=u,e.format=l,e.internalFormat=null,e.type=c,e.offset=new bd(0,0),e.repeat=new bd(1,1),e.center=new bd(0,0),e.rotation=0,e.matrixAutoUpdate=!0,e.matrix=new Cd,e.generateMipmaps=!0,e.premultiplyAlpha=!1,e.flipY=!0,e.unpackAlignment=4,e.colorSpace=h,e.userData={},e.version=0,e.onUpdate=null,e.isRenderTargetTexture=!1,e.pmremVersion=0,e}return wn()(t,e),x()(t,[{key:"image",get:function(){return this.source.data},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.source.data=e}},{key:"updateMatrix",value:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,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.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),t||(e.textures[this.uuid]=i),i}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"transformUv",value:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002: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 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002: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}},{key:"needsUpdate",set:function(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}},{key:"needsPMREMUpdate",set:function(e){!0===e&&this.pmremVersion++}}])}(ud);zd.DEFAULT_IMAGE=null,zd.DEFAULT_MAPPING=300,zd.DEFAULT_ANISOTROPY=1;var Fd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,e),e.prototype.isVector4=!0,this.x=t,this.y=i,this.z=n,this.w=o}),[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(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)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(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}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(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}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var t=this.x,i=this.y,n=this.z,o=this.w,s=e.elements;return this.x=s[0]*t+s[4]*i+s[8]*n+s[12]*o,this.y=s[1]*t+s[5]*i+s[9]*n+s[13]*o,this.z=s[2]*t+s[6]*i+s[10]*n+s[14]*o,this.w=s[3]*t+s[7]*i+s[11]*n+s[15]*o,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var 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}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,i,n,o,s=.01,a=.1,r=e.elements,l=r[0],c=r[4],u=r[8],h=r[1],p=r[5],d=r[9],m=r[2],f=r[6],v=r[10];if(Math.abs(c-h)y&&g>b?gb?y1&&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}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:return e.next=6,this.z;case 6:return e.next=8,this.w;case 8:case"end":return e.stop()}}),e,this)}))}])}(),Hd=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,t),(e=qp(this,t,[null])).isDataArrayTexture=!0,e.image={data:i,width:n,height:o,depth:s},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return wn()(t,e),x()(t)}(zd),Vd=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return k()(this,t),(e=qp(this,t,[null])).isData3DTexture=!0,e.image={data:i,width:n,height:o,depth:s},e.magFilter=1003,e.minFilter=1003,e.wrapR=1001,e.generateMipmaps=!1,e.flipY=!1,e.unpackAlignment=1,e}return wn()(t,e),x()(t)}(zd),Gd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,e),this.isQuaternion=!0,this._x=t,this._y=i,this._z=n,this._w=o}),[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}},{key:"set",value:function(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._w)}},{key:"copy",value:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}},{key:"setFromEuler",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e._x,n=e._y,o=e._z,s=e._order,a=Math.cos,r=Math.sin,l=a(i/2),c=a(n/2),u=a(o/2),h=r(i/2),p=r(n/2),d=r(o/2);switch(s){case"XYZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"YXZ":this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"ZXY":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d;break;case"ZYX":this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d;break;case"YZX":this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d;break;case"XZY":this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===t&&this._onChangeCallback(),this}},{key:"setFromAxisAngle",value:function(e,t){var i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=e.elements,i=t[0],n=t[4],o=t[8],s=t[1],a=t[5],r=t[9],l=t[2],c=t[6],u=t[10],h=i+a+u;if(h>0){var p=.5/Math.sqrt(h+1);this._w=.25/p,this._x=(c-r)*p,this._y=(o-l)*p,this._z=(s-n)*p}else if(i>a&&i>u){var d=2*Math.sqrt(1+i-a-u);this._w=(c-r)/d,this._x=.25*d,this._y=(n+s)/d,this._z=(o+l)/d}else if(a>u){var m=2*Math.sqrt(1+a-i-u);this._w=(o-l)/m,this._x=(n+s)/m,this._y=.25*m,this._z=(r+c)/m}else{var f=2*Math.sqrt(1+u-i-a);this._w=(s-n)/f,this._x=(o+l)/f,this._y=(r+c)/f,this._z=.25*f}return this._onChangeCallback(),this}},{key:"setFromUnitVectors",value:function(e,t){var i=e.dot(t)+1;return iMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(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=i),this.normalize()}},{key:"angleTo",value:function(e){return 2*Math.acos(Math.abs(md(this.dot(e),-1,1)))}},{key:"rotateTowards",value:function(e,t){var i=this.angleTo(e);if(0===i)return this;var n=Math.min(1,t/i);return this.slerp(e,n),this}},{key:"identity",value:function(){return this.set(0,0,0,1)}},{key:"invert",value:function(){return this.conjugate()}},{key:"conjugate",value:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}},{key:"dot",value:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}},{key:"lengthSq",value:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}},{key:"length",value:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}},{key:"normalize",value:function(){var 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}},{key:"multiply",value:function(e){return this.multiplyQuaternions(this,e)}},{key:"premultiply",value:function(e){return this.multiplyQuaternions(e,this)}},{key:"multiplyQuaternions",value:function(e,t){var i=e._x,n=e._y,o=e._z,s=e._w,a=t._x,r=t._y,l=t._z,c=t._w;return this._x=i*c+s*a+n*l-o*r,this._y=n*c+s*r+o*a-i*l,this._z=o*c+s*l+i*r-n*a,this._w=s*c-i*a-n*r-o*l,this._onChangeCallback(),this}},{key:"slerp",value:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,n=this._y,o=this._z,s=this._w,a=s*e._w+i*e._x+n*e._y+o*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=s,this._x=i,this._y=n,this._z=o,this;var r=1-a*a;if(r<=Number.EPSILON){var l=1-t;return this._w=l*s+t*this._w,this._x=l*i+t*this._x,this._y=l*n+t*this._y,this._z=l*o+t*this._z,this.normalize(),this}var c=Math.sqrt(r),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,p=Math.sin(t*u)/c;return this._w=s*h+this._w*p,this._x=i*h+this._x*p,this._y=n*h+this._y*p,this._z=o*h+this._z*p,this._onChangeCallback(),this}},{key:"slerpQuaternions",value:function(e,t,i){return this.copy(e).slerp(t,i)}},{key:"random",value:function(){var e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),o=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),o*Math.sin(t),o*Math.cos(t))}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}},{key:"fromArray",value:function(e){var 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}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}},{key:"toJSON",value:function(){return this.toArray()}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._x;case 2:return e.next=4,this._y;case 4:return e.next=6,this._z;case 6:return e.next=8,this._w;case 8:case"end":return e.stop()}}),e,this)}))}],[{key:"slerpFlat",value:function(e,t,i,n,o,s,a){var r=i[n+0],l=i[n+1],c=i[n+2],u=i[n+3],h=o[s+0],p=o[s+1],d=o[s+2],m=o[s+3];if(0===a)return e[t+0]=r,e[t+1]=l,e[t+2]=c,void(e[t+3]=u);if(1===a)return e[t+0]=h,e[t+1]=p,e[t+2]=d,void(e[t+3]=m);if(u!==m||r!==h||l!==p||c!==d){var f=1-a,v=r*h+l*p+c*d+u*m,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var b=Math.sqrt(y),C=Math.atan2(b,v*g);f=Math.sin(f*C)/b,a=Math.sin(a*C)/b}var w=a*g;if(r=r*f+h*w,l=l*f+p*w,c=c*f+d*w,u=u*f+m*w,f===1-a){var k=1/Math.sqrt(r*r+l*l+c*c+u*u);r*=k,l*=k,c*=k,u*=k}}e[t]=r,e[t+1]=l,e[t+2]=c,e[t+3]=u}},{key:"multiplyQuaternionsFlat",value:function(e,t,i,n,o,s){var a=i[n],r=i[n+1],l=i[n+2],c=i[n+3],u=o[s],h=o[s+1],p=o[s+2],d=o[s+3];return e[t]=a*d+c*u+r*p-l*h,e[t+1]=r*d+c*h+l*u-a*p,e[t+2]=l*d+c*p+a*h-r*u,e[t+3]=c*d-a*u-r*h-l*p,e}}])}(),Wd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;k()(this,e),e.prototype.isVector3=!0,this.x=t,this.y=i,this.z=n}),[{key:"set",value:function(e,t,i){return void 0===i&&(i=this.z),this.x=e,this.y=t,this.z=i,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(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)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"applyEuler",value:function(e){return this.applyQuaternion(Yd.setFromEuler(e))}},{key:"applyAxisAngle",value:function(e,t){return this.applyQuaternion(Yd.setFromAxisAngle(e,t))}},{key:"applyMatrix3",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.elements;return this.x=o[0]*t+o[3]*i+o[6]*n,this.y=o[1]*t+o[4]*i+o[7]*n,this.z=o[2]*t+o[5]*i+o[8]*n,this}},{key:"applyNormalMatrix",value:function(e){return this.applyMatrix3(e).normalize()}},{key:"applyMatrix4",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.elements,s=1/(o[3]*t+o[7]*i+o[11]*n+o[15]);return this.x=(o[0]*t+o[4]*i+o[8]*n+o[12])*s,this.y=(o[1]*t+o[5]*i+o[9]*n+o[13])*s,this.z=(o[2]*t+o[6]*i+o[10]*n+o[14])*s,this}},{key:"applyQuaternion",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.x,s=e.y,a=e.z,r=e.w,l=2*(s*n-a*i),c=2*(a*t-o*n),u=2*(o*i-s*t);return this.x=t+r*l+s*u-a*c,this.y=i+r*c+a*l-o*u,this.z=n+r*u+o*c-s*l,this}},{key:"project",value:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}},{key:"unproject",value:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}},{key:"transformDirection",value:function(e){var t=this.x,i=this.y,n=this.z,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n,this.y=o[1]*t+o[5]*i+o[9]*n,this.z=o[2]*t+o[6]*i+o[10]*n,this.normalize()}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"min",value:function(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}},{key:"max",value:function(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}},{key:"clamp",value:function(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}},{key:"clampScalar",value:function(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}},{key:"clampLength",value:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))}},{key:"floor",value:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}},{key:"ceil",value:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}},{key:"round",value:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}},{key:"roundToZero",value:function(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(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}},{key:"lerpVectors",value:function(e,t,i){return this.x=e.x+(t.x-e.x)*i,this.y=e.y+(t.y-e.y)*i,this.z=e.z+(t.z-e.z)*i,this}},{key:"cross",value:function(e){return this.crossVectors(this,e)}},{key:"crossVectors",value:function(e,t){var i=e.x,n=e.y,o=e.z,s=t.x,a=t.y,r=t.z;return this.x=n*r-o*a,this.y=o*s-i*r,this.z=i*a-n*s,this}},{key:"projectOnVector",value:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var i=e.dot(this)/t;return this.copy(e).multiplyScalar(i)}},{key:"projectOnPlane",value:function(e){return Ud.copy(this).projectOnVector(e),this.sub(Ud)}},{key:"reflect",value:function(e){return this.sub(Ud.copy(e).multiplyScalar(2*this.dot(e)))}},{key:"angleTo",value:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var i=this.dot(e)/t;return Math.acos(md(i,-1,1))}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceToSquared(e))}},{key:"distanceToSquared",value:function(e){var t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n}},{key:"manhattanDistanceTo",value:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}},{key:"setFromSpherical",value:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}},{key:"setFromSphericalCoords",value:function(e,t,i){var n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this}},{key:"setFromCylindrical",value:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}},{key:"setFromCylindricalCoords",value:function(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}},{key:"setFromMatrixScale",value:function(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=n,this}},{key:"setFromMatrixColumn",value:function(e,t){return this.fromArray(e.elements,4*t)}},{key:"setFromMatrix3Column",value:function(e,t){return this.fromArray(e.elements,3*t)}},{key:"setFromEuler",value:function(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}},{key:"setFromColor",value:function(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}},{key:"fromArray",value:function(e){var 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}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}},{key:"randomDirection",value:function(){var e=Math.random()*Math.PI*2,t=2*Math.random()-1,i=Math.sqrt(1-t*t);return this.x=i*Math.cos(e),this.y=t,this.z=i*Math.sin(e),this}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:return e.next=6,this.z;case 6:case"end":return e.stop()}}),e,this)}))}])}(),Ud=new Wd,Yd=new Gd,Jd=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd(1/0,1/0,1/0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd(-1/0,-1/0,-1/0);k()(this,e),this.isBox3=!0,this.min=t,this.max=i}),[{key:"set",value:function(e,t){return this.min.copy(e),this.max.copy(t),this}},{key:"setFromArray",value:function(e){this.makeEmpty();for(var t=0,i=e.length;t1&&void 0!==arguments[1]&&arguments[1];return this.makeEmpty(),this.expandByObject(e,t)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.min.copy(e.min),this.max.copy(e.max),this}},{key:"makeEmpty",value:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}},{key:"isEmpty",value:function(){return this.max.x1&&void 0!==arguments[1]&&arguments[1];e.updateWorldMatrix(!1,!1);var i=e.geometry;if(void 0!==i){var n=i.getAttribute("position");if(!0===t&&void 0!==n&&!0!==e.isInstancedMesh)for(var o=0,s=n.count;othis.max.x||e.ythis.max.y||e.zthis.max.z)}},{key:"containsBox",value:function(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}},{key:"getParameter",value:function(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))}},{key:"intersectsBox",value:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}},{key:"intersectsSphere",value:function(e){return this.clampPoint(e.center,Xd),Xd.distanceToSquared(e.center)<=e.radius*e.radius}},{key:"intersectsPlane",value:function(e){var t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=-e.constant&&i>=-e.constant}},{key:"intersectsTriangle",value:function(e){if(this.isEmpty())return!1;this.getCenter(nm),om.subVectors(this.max,nm),Kd.subVectors(e.a,nm),Qd.subVectors(e.b,nm),$d.subVectors(e.c,nm),em.subVectors(Qd,Kd),tm.subVectors($d,Qd),im.subVectors(Kd,$d);var t=[0,-em.z,em.y,0,-tm.z,tm.y,0,-im.z,im.y,em.z,0,-em.x,tm.z,0,-tm.x,im.z,0,-im.x,-em.y,em.x,0,-tm.y,tm.x,0,-im.y,im.x,0];return!!rm(t,Kd,Qd,$d,om)&&(!!rm(t=[1,0,0,0,1,0,0,0,1],Kd,Qd,$d,om)&&(sm.crossVectors(em,tm),rm(t=[sm.x,sm.y,sm.z],Kd,Qd,$d,om)))}},{key:"clampPoint",value:function(e,t){return t.copy(e).clamp(this.min,this.max)}},{key:"distanceToPoint",value:function(e){return this.clampPoint(e,Xd).distanceTo(e)}},{key:"getBoundingSphere",value:function(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(Xd).length()),e}},{key:"intersect",value:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}},{key:"union",value:function(e){return this.min.min(e.min),this.max.max(e.max),this}},{key:"applyMatrix4",value:function(e){return this.isEmpty()||(qd[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),qd[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),qd[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),qd[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),qd[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),qd[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),qd[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),qd[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(qd)),this}},{key:"translate",value:function(e){return this.min.add(e),this.max.add(e),this}},{key:"equals",value:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}])}(),qd=[new Wd,new Wd,new Wd,new Wd,new Wd,new Wd,new Wd,new Wd],Xd=new Wd,Zd=new Jd,Kd=new Wd,Qd=new Wd,$d=new Wd,em=new Wd,tm=new Wd,im=new Wd,nm=new Wd,om=new Wd,sm=new Wd,am=new Wd;function rm(e,t,i,n,o){for(var s=0,a=e.length-3;s<=a;s+=3){am.fromArray(e,s);var r=o.x*Math.abs(am.x)+o.y*Math.abs(am.y)+o.z*Math.abs(am.z),l=t.dot(am),c=i.dot(am),u=n.dot(am);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>r)return!1}return!0}var lm=new Jd,cm=new Wd,um=new Wd,hm=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;k()(this,e),this.isSphere=!0,this.center=t,this.radius=i}),[{key:"set",value:function(e,t){return this.center.copy(e),this.radius=t,this}},{key:"setFromPoints",value:function(e,t){var i=this.center;void 0!==t?i.copy(t):lm.setFromPoints(e).getCenter(i);for(var n=0,o=0,s=e.length;othis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}},{key:"getBoundingBox",value:function(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}},{key:"applyMatrix4",value:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},{key:"translate",value:function(e){return this.center.add(e),this}},{key:"expandByPoint",value:function(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;cm.subVectors(e,this.center);var t=cm.lengthSq();if(t>this.radius*this.radius){var i=Math.sqrt(t),n=.5*(i-this.radius);this.center.addScaledVector(cm,n/i),this.radius+=n}return this}},{key:"union",value:function(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(um.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(cm.copy(e.center).add(um)),this.expandByPoint(cm.copy(e.center).sub(um))),this)}},{key:"equals",value:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),pm=new Wd,dm=new Wd,mm=new Wd,fm=new Wd,vm=new Wd,gm=new Wd,ym=new Wd,bm=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd(0,0,-1);k()(this,e),this.origin=t,this.direction=i}),[{key:"set",value:function(e,t){return this.origin.copy(e),this.direction.copy(t),this}},{key:"copy",value:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}},{key:"at",value:function(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}},{key:"lookAt",value:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this}},{key:"recast",value:function(e){return this.origin.copy(this.at(e,pm)),this}},{key:"closestPointToPoint",value:function(e,t){t.subVectors(e,this.origin);var i=t.dot(this.direction);return i<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,i)}},{key:"distanceToPoint",value:function(e){return Math.sqrt(this.distanceSqToPoint(e))}},{key:"distanceSqToPoint",value:function(e){var t=pm.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(pm.copy(this.origin).addScaledVector(this.direction,t),pm.distanceToSquared(e))}},{key:"distanceSqToSegment",value:function(e,t,i,n){dm.copy(e).add(t).multiplyScalar(.5),mm.copy(t).sub(e).normalize(),fm.copy(this.origin).sub(dm);var o,s,a,r,l=.5*e.distanceTo(t),c=-this.direction.dot(mm),u=fm.dot(this.direction),h=-fm.dot(mm),p=fm.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(s=c*u-h,r=l*d,(o=c*h-u)>=0)if(s>=-r)if(s<=r){var m=1/d;a=(o*=m)*(o+c*(s*=m)+2*u)+s*(c*o+s+2*h)+p}else s=l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*h)+p;else s=-l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*h)+p;else s<=-r?a=-(o=Math.max(0,-(-c*l+u)))*o+(s=o>0?-l:Math.min(Math.max(-l,-h),l))*(s+2*h)+p:s<=r?(o=0,a=(s=Math.min(Math.max(-l,-h),l))*(s+2*h)+p):a=-(o=Math.max(0,-(c*l+u)))*o+(s=o>0?l:Math.min(Math.max(-l,-h),l))*(s+2*h)+p;else s=c>0?-l:l,a=-(o=Math.max(0,-(c*s+u)))*o+s*(s+2*h)+p;return i&&i.copy(this.origin).addScaledVector(this.direction,o),n&&n.copy(dm).addScaledVector(mm,s),a}},{key:"intersectSphere",value:function(e,t){pm.subVectors(e.center,this.origin);var i=pm.dot(this.direction),n=pm.dot(pm)-i*i,o=e.radius*e.radius;if(n>o)return null;var s=Math.sqrt(o-n),a=i-s,r=i+s;return r<0?null:a<0?this.at(r,t):this.at(a,t)}},{key:"intersectsSphere",value:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}},{key:"distanceToPlane",value:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null}},{key:"intersectPlane",value:function(e,t){var i=this.distanceToPlane(e);return null===i?null:this.at(i,t)}},{key:"intersectsPlane",value:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}},{key:"intersectBox",value:function(e,t){var i,n,o,s,a,r,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(i=(e.min.x-h.x)*l,n=(e.max.x-h.x)*l):(i=(e.max.x-h.x)*l,n=(e.min.x-h.x)*l),c>=0?(o=(e.min.y-h.y)*c,s=(e.max.y-h.y)*c):(o=(e.max.y-h.y)*c,s=(e.min.y-h.y)*c),i>s||o>n?null:((o>i||isNaN(i))&&(i=o),(s=0?(a=(e.min.z-h.z)*u,r=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,r=(e.min.z-h.z)*u),i>r||a>n?null:((a>i||i!=i)&&(i=a),(r=0?i:n,t)))}},{key:"intersectsBox",value:function(e){return null!==this.intersectBox(e,pm)}},{key:"intersectTriangle",value:function(e,t,i,n,o){vm.subVectors(t,e),gm.subVectors(i,e),ym.crossVectors(vm,gm);var s,a=this.direction.dot(ym);if(a>0){if(n)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}fm.subVectors(this.origin,e);var r=s*this.direction.dot(gm.crossVectors(fm,gm));if(r<0)return null;var l=s*this.direction.dot(vm.cross(fm));if(l<0)return null;if(r+l>a)return null;var c=-s*fm.dot(ym);return c<0?null:this.at(c/a,o)}},{key:"applyMatrix4",value:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}},{key:"equals",value:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),Cm=function(){function e(t,i,n,o,s,a,r,l,c,u,h,p,d,m,f,v){k()(this,e),e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,i,n,o,s,a,r,l,c,u,h,p,d,m,f,v)}return x()(e,[{key:"set",value:function(e,t,i,n,o,s,a,r,l,c,u,h,p,d,m,f){var v=this.elements;return v[0]=e,v[4]=t,v[8]=i,v[12]=n,v[1]=o,v[5]=s,v[9]=a,v[13]=r,v[2]=l,v[6]=c,v[10]=u,v[14]=h,v[3]=p,v[7]=d,v[11]=m,v[15]=f,this}},{key:"identity",value:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}},{key:"clone",value:function(){return(new e).fromArray(this.elements)}},{key:"copy",value:function(e){var t=this.elements,i=e.elements;return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],this}},{key:"copyPosition",value:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this}},{key:"setFromMatrix3",value:function(e){var 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}},{key:"extractBasis",value:function(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}},{key:"makeBasis",value:function(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this}},{key:"extractRotation",value:function(e){var t=this.elements,i=e.elements,n=1/wm.setFromMatrixColumn(e,0).length(),o=1/wm.setFromMatrixColumn(e,1).length(),s=1/wm.setFromMatrixColumn(e,2).length();return t[0]=i[0]*n,t[1]=i[1]*n,t[2]=i[2]*n,t[3]=0,t[4]=i[4]*o,t[5]=i[5]*o,t[6]=i[6]*o,t[7]=0,t[8]=i[8]*s,t[9]=i[9]*s,t[10]=i[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromEuler",value:function(e){var t=this.elements,i=e.x,n=e.y,o=e.z,s=Math.cos(i),a=Math.sin(i),r=Math.cos(n),l=Math.sin(n),c=Math.cos(o),u=Math.sin(o);if("XYZ"===e.order){var h=s*c,p=s*u,d=a*c,m=a*u;t[0]=r*c,t[4]=-r*u,t[8]=l,t[1]=p+d*l,t[5]=h-m*l,t[9]=-a*r,t[2]=m-h*l,t[6]=d+p*l,t[10]=s*r}else if("YXZ"===e.order){var f=r*c,v=r*u,g=l*c,y=l*u;t[0]=f+y*a,t[4]=g*a-v,t[8]=s*l,t[1]=s*u,t[5]=s*c,t[9]=-a,t[2]=v*a-g,t[6]=y+f*a,t[10]=s*r}else if("ZXY"===e.order){var b=r*c,C=r*u,w=l*c,k=l*u;t[0]=b-k*a,t[4]=-s*u,t[8]=w+C*a,t[1]=C+w*a,t[5]=s*c,t[9]=k-b*a,t[2]=-s*l,t[6]=a,t[10]=s*r}else if("ZYX"===e.order){var _=s*c,x=s*u,S=a*c,E=a*u;t[0]=r*c,t[4]=S*l-x,t[8]=_*l+E,t[1]=r*u,t[5]=E*l+_,t[9]=x*l-S,t[2]=-l,t[6]=a*r,t[10]=s*r}else if("YZX"===e.order){var P=s*r,D=s*l,M=a*r,T=a*l;t[0]=r*c,t[4]=T-P*u,t[8]=M*u+D,t[1]=u,t[5]=s*c,t[9]=-a*c,t[2]=-l*c,t[6]=D*u+M,t[10]=P-T*u}else if("XZY"===e.order){var O=s*r,N=s*l,B=a*r,A=a*l;t[0]=r*c,t[4]=-u,t[8]=l*c,t[1]=O*u+A,t[5]=s*c,t[9]=N*u-B,t[2]=B*u-N,t[6]=a*c,t[10]=A*u+O}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}},{key:"makeRotationFromQuaternion",value:function(e){return this.compose(_m,e,xm)}},{key:"lookAt",value:function(e,t,i){var n=this.elements;return Pm.subVectors(e,t),0===Pm.lengthSq()&&(Pm.z=1),Pm.normalize(),Sm.crossVectors(i,Pm),0===Sm.lengthSq()&&(1===Math.abs(i.z)?Pm.x+=1e-4:Pm.z+=1e-4,Pm.normalize(),Sm.crossVectors(i,Pm)),Sm.normalize(),Em.crossVectors(Pm,Sm),n[0]=Sm.x,n[4]=Em.x,n[8]=Pm.x,n[1]=Sm.y,n[5]=Em.y,n[9]=Pm.y,n[2]=Sm.z,n[6]=Em.z,n[10]=Pm.z,this}},{key:"multiply",value:function(e){return this.multiplyMatrices(this,e)}},{key:"premultiply",value:function(e){return this.multiplyMatrices(e,this)}},{key:"multiplyMatrices",value:function(e,t){var i=e.elements,n=t.elements,o=this.elements,s=i[0],a=i[4],r=i[8],l=i[12],c=i[1],u=i[5],h=i[9],p=i[13],d=i[2],m=i[6],f=i[10],v=i[14],g=i[3],y=i[7],b=i[11],C=i[15],w=n[0],k=n[4],_=n[8],x=n[12],S=n[1],E=n[5],P=n[9],D=n[13],M=n[2],T=n[6],O=n[10],N=n[14],B=n[3],A=n[7],L=n[11],I=n[15];return o[0]=s*w+a*S+r*M+l*B,o[4]=s*k+a*E+r*T+l*A,o[8]=s*_+a*P+r*O+l*L,o[12]=s*x+a*D+r*N+l*I,o[1]=c*w+u*S+h*M+p*B,o[5]=c*k+u*E+h*T+p*A,o[9]=c*_+u*P+h*O+p*L,o[13]=c*x+u*D+h*N+p*I,o[2]=d*w+m*S+f*M+v*B,o[6]=d*k+m*E+f*T+v*A,o[10]=d*_+m*P+f*O+v*L,o[14]=d*x+m*D+f*N+v*I,o[3]=g*w+y*S+b*M+C*B,o[7]=g*k+y*E+b*T+C*A,o[11]=g*_+y*P+b*O+C*L,o[15]=g*x+y*D+b*N+C*I,this}},{key:"multiplyScalar",value:function(e){var 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}},{key:"determinant",value:function(){var e=this.elements,t=e[0],i=e[4],n=e[8],o=e[12],s=e[1],a=e[5],r=e[9],l=e[13],c=e[2],u=e[6],h=e[10],p=e[14];return e[3]*(+o*r*u-n*l*u-o*a*h+i*l*h+n*a*p-i*r*p)+e[7]*(+t*r*p-t*l*h+o*s*h-n*s*p+n*l*c-o*r*c)+e[11]*(+t*l*u-t*a*p-o*s*u+i*s*p+o*a*c-i*l*c)+e[15]*(-n*a*c-t*r*u+t*a*h+n*s*u-i*s*h+i*r*c)}},{key:"transpose",value:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}},{key:"setPosition",value:function(e,t,i){var n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=t,n[14]=i),this}},{key:"invert",value:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],o=e[3],s=e[4],a=e[5],r=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11],d=e[12],m=e[13],f=e[14],v=e[15],g=u*f*l-m*h*l+m*r*p-a*f*p-u*r*v+a*h*v,y=d*h*l-c*f*l-d*r*p+s*f*p+c*r*v-s*h*v,b=c*m*l-d*u*l+d*a*p-s*m*p-c*a*v+s*u*v,C=d*u*r-c*m*r-d*a*h+s*m*h+c*a*f-s*u*f,w=t*g+i*y+n*b+o*C;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var k=1/w;return e[0]=g*k,e[1]=(m*h*o-u*f*o-m*n*p+i*f*p+u*n*v-i*h*v)*k,e[2]=(a*f*o-m*r*o+m*n*l-i*f*l-a*n*v+i*r*v)*k,e[3]=(u*r*o-a*h*o-u*n*l+i*h*l+a*n*p-i*r*p)*k,e[4]=y*k,e[5]=(c*f*o-d*h*o+d*n*p-t*f*p-c*n*v+t*h*v)*k,e[6]=(d*r*o-s*f*o-d*n*l+t*f*l+s*n*v-t*r*v)*k,e[7]=(s*h*o-c*r*o+c*n*l-t*h*l-s*n*p+t*r*p)*k,e[8]=b*k,e[9]=(d*u*o-c*m*o-d*i*p+t*m*p+c*i*v-t*u*v)*k,e[10]=(s*m*o-d*a*o+d*i*l-t*m*l-s*i*v+t*a*v)*k,e[11]=(c*a*o-s*u*o-c*i*l+t*u*l+s*i*p-t*a*p)*k,e[12]=C*k,e[13]=(c*m*n-d*u*n+d*i*h-t*m*h-c*i*f+t*u*f)*k,e[14]=(d*a*n-s*m*n-d*i*r+t*m*r+s*i*f-t*a*f)*k,e[15]=(s*u*n-c*a*n+c*i*r-t*u*r-s*i*h+t*a*h)*k,this}},{key:"scale",value:function(e){var t=this.elements,i=e.x,n=e.y,o=e.z;return t[0]*=i,t[4]*=n,t[8]*=o,t[1]*=i,t[5]*=n,t[9]*=o,t[2]*=i,t[6]*=n,t[10]*=o,t[3]*=i,t[7]*=n,t[11]*=o,this}},{key:"getMaxScaleOnAxis",value:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,n))}},{key:"makeTranslation",value:function(e,t,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this}},{key:"makeRotationX",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this}},{key:"makeRotationY",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this}},{key:"makeRotationZ",value:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this}},{key:"makeRotationAxis",value:function(e,t){var i=Math.cos(t),n=Math.sin(t),o=1-i,s=e.x,a=e.y,r=e.z,l=o*s,c=o*a;return this.set(l*s+i,l*a-n*r,l*r+n*a,0,l*a+n*r,c*a+i,c*r-n*s,0,l*r-n*a,c*r+n*s,o*r*r+i,0,0,0,0,1),this}},{key:"makeScale",value:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this}},{key:"makeShear",value:function(e,t,i,n,o,s){return this.set(1,i,o,0,e,1,s,0,t,n,1,0,0,0,0,1),this}},{key:"compose",value:function(e,t,i){var n=this.elements,o=t._x,s=t._y,a=t._z,r=t._w,l=o+o,c=s+s,u=a+a,h=o*l,p=o*c,d=o*u,m=s*c,f=s*u,v=a*u,g=r*l,y=r*c,b=r*u,C=i.x,w=i.y,k=i.z;return n[0]=(1-(m+v))*C,n[1]=(p+b)*C,n[2]=(d-y)*C,n[3]=0,n[4]=(p-b)*w,n[5]=(1-(h+v))*w,n[6]=(f+g)*w,n[7]=0,n[8]=(d+y)*k,n[9]=(f-g)*k,n[10]=(1-(h+m))*k,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}},{key:"decompose",value:function(e,t,i){var n=this.elements,o=wm.set(n[0],n[1],n[2]).length(),s=wm.set(n[4],n[5],n[6]).length(),a=wm.set(n[8],n[9],n[10]).length();this.determinant()<0&&(o=-o),e.x=n[12],e.y=n[13],e.z=n[14],km.copy(this);var r=1/o,l=1/s,c=1/a;return km.elements[0]*=r,km.elements[1]*=r,km.elements[2]*=r,km.elements[4]*=l,km.elements[5]*=l,km.elements[6]*=l,km.elements[8]*=c,km.elements[9]*=c,km.elements[10]*=c,t.setFromRotationMatrix(km),i.x=o,i.y=s,i.z=a,this}},{key:"makePerspective",value:function(e,t,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=2*o/(t-e),h=2*o/(i-n),p=(t+e)/(t-e),d=(i+n)/(i-n);if(l===ld)a=-(s+o)/(s-o),r=-2*s*o/(s-o);else{if(l!==cd)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);a=-s/(s-o),r=-s*o/(s-o)}return c[0]=u,c[4]=0,c[8]=p,c[12]=0,c[1]=0,c[5]=h,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=a,c[14]=r,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}},{key:"makeOrthographic",value:function(e,t,i,n,o,s){var a,r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2e3,c=this.elements,u=1/(t-e),h=1/(i-n),p=1/(s-o),d=(t+e)*u,m=(i+n)*h;if(l===ld)a=(s+o)*p,r=-2*p;else{if(l!==cd)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);a=o*p,r=-1*p}return c[0]=2*u,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*h,c[9]=0,c[13]=-m,c[2]=0,c[6]=0,c[10]=r,c[14]=-a,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}},{key:"equals",value:function(e){for(var t=this.elements,i=e.elements,n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0}},{key:"fromArray",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=0;i<16;i++)this.elements[i]=e[i+t];return this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}}])}(),wm=new Wd,km=new Cm,_m=new Wd(0,0,0),xm=new Wd(1,1,1),Sm=new Wd,Em=new Wd,Pm=new Wd,Dm=new Cm,Mm=new Gd,Tm=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.DEFAULT_ORDER;k()(this,e),this.isEuler=!0,this._x=t,this._y=i,this._z=n,this._order=o}),[{key:"x",get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}},{key:"set",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._order;return this._x=e,this._y=t,this._z=i,this._order=n,this._onChangeCallback(),this}},{key:"clone",value:function(){return new this.constructor(this._x,this._y,this._z,this._order)}},{key:"copy",value:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}},{key:"setFromRotationMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e.elements,o=n[0],s=n[4],a=n[8],r=n[1],l=n[5],c=n[9],u=n[2],h=n[6],p=n[10];switch(t){case"XYZ":this._y=Math.asin(md(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-md(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(r,l)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(md(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(r,o));break;case"ZYX":this._y=Math.asin(-md(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(h,p),this._z=Math.atan2(r,o)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(md(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-md(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===i&&this._onChangeCallback(),this}},{key:"setFromQuaternion",value:function(e,t,i){return Dm.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Dm,t,i)}},{key:"setFromVector3",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._order;return this.set(e.x,e.y,e.z,t)}},{key:"reorder",value:function(e){return Mm.setFromEuler(this),this.setFromQuaternion(Mm,e)}},{key:"equals",value:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}},{key:"fromArray",value:function(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}},{key:"toArray",value:function(){var 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}},{key:"_onChange",value:function(e){return this._onChangeCallback=e,this}},{key:"_onChangeCallback",value:function(){}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._x;case 2:return e.next=4,this._y;case 4:return e.next=6,this._z;case 6:return e.next=8,this._order;case 8:case"end":return e.stop()}}),e,this)}))}])}();Tm.DEFAULT_ORDER="XYZ";var Om=function(){return x()((function e(){k()(this,e),this.mask=1}),[{key:"set",value:function(e){this.mask=(1<>>0}},{key:"enable",value:function(e){this.mask|=1<1){for(var t=0;t1){for(var t=0;t2&&void 0!==arguments[2]?arguments[2]:[];this[e]===t&&i.push(this);for(var n=this.children,o=0,s=n.length;o0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),n.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(n.type="BatchedMesh",n.perObjectFrustumCulled=this.perObjectFrustumCulled,n.sortObjects=this.sortObjects,n.drawRanges=this._drawRanges,n.reservedRanges=this._reservedRanges,n.visibility=this._visibility,n.active=this._active,n.bounds=this._bounds.map((function(e){return{boxInitialized:e.boxInitialized,boxMin:e.box.min.toArray(),boxMax:e.box.max.toArray(),sphereInitialized:e.sphereInitialized,sphereRadius:e.sphere.radius,sphereCenter:e.sphere.center.toArray()}})),n.maxGeometryCount=this._maxGeometryCount,n.maxVertexCount=this._maxVertexCount,n.maxIndexCount=this._maxIndexCount,n.geometryInitialized=this._geometryInitialized,n.geometryCount=this._geometryCount,n.matricesTexture=this._matricesTexture.toJSON(e),null!==this.boundingSphere&&(n.boundingSphere={center:n.boundingSphere.center.toArray(),radius:n.boundingSphere.radius}),null!==this.boundingBox&&(n.boundingBox={min:n.boundingBox.min.toArray(),max:n.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(n.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=o(e.geometries,this.geometry);var s=this.geometry.parameters;if(void 0!==s&&void 0!==s.shapes){var a=s.shapes;if(Array.isArray(a))for(var r=0,l=a.length;r0){n.children=[];for(var d=0;d0){n.animations=[];for(var m=0;m0&&(i.geometries=v),g.length>0&&(i.materials=g),y.length>0&&(i.textures=y),b.length>0&&(i.images=b),C.length>0&&(i.shapes=C),w.length>0&&(i.skeletons=w),k.length>0&&(i.animations=k),_.length>0&&(i.nodes=_)}return i.object=n,i;function x(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}}},{key:"clone",value:function(e){return(new this.constructor).copy(this,e)}},{key:"copy",value:function(e){var 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.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,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.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new Wd,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Wd;k()(this,e),this.a=t,this.b=i,this.c=n}return x()(e,[{key:"set",value:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this}},{key:"setFromPointsAndIndices",value:function(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this}},{key:"setFromAttributeAndIndices",value:function(e,t,i,n){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,n),this}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}},{key:"getArea",value:function(){return qm.subVectors(this.c,this.b),Xm.subVectors(this.a,this.b),.5*qm.cross(Xm).length()}},{key:"getMidpoint",value:function(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}},{key:"getNormal",value:function(t){return e.getNormal(this.a,this.b,this.c,t)}},{key:"getPlane",value:function(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}},{key:"getBarycoord",value:function(t,i){return e.getBarycoord(t,this.a,this.b,this.c,i)}},{key:"getInterpolation",value:function(t,i,n,o,s){return e.getInterpolation(t,this.a,this.b,this.c,i,n,o,s)}},{key:"containsPoint",value:function(t){return e.containsPoint(t,this.a,this.b,this.c)}},{key:"isFrontFacing",value:function(t){return e.isFrontFacing(this.a,this.b,this.c,t)}},{key:"intersectsBox",value:function(e){return e.intersectsTriangle(this)}},{key:"closestPointToPoint",value:function(e,t){var i,n,o=this.a,s=this.b,a=this.c;Qm.subVectors(s,o),$m.subVectors(a,o),tf.subVectors(e,o);var r=Qm.dot(tf),l=$m.dot(tf);if(r<=0&&l<=0)return t.copy(o);nf.subVectors(e,s);var c=Qm.dot(nf),u=$m.dot(nf);if(c>=0&&u<=c)return t.copy(s);var h=r*u-c*l;if(h<=0&&r>=0&&c<=0)return i=r/(r-c),t.copy(o).addScaledVector(Qm,i);of.subVectors(e,a);var p=Qm.dot(of),d=$m.dot(of);if(d>=0&&p<=d)return t.copy(a);var m=p*l-r*d;if(m<=0&&l>=0&&d<=0)return n=l/(l-d),t.copy(o).addScaledVector($m,n);var f=c*d-p*u;if(f<=0&&u-c>=0&&p-d>=0)return ef.subVectors(a,s),n=(u-c)/(u-c+(p-d)),t.copy(s).addScaledVector(ef,n);var v=1/(f+m+h);return i=m*v,n=h*v,t.copy(o).addScaledVector(Qm,i).addScaledVector($m,n)}},{key:"equals",value:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}],[{key:"getNormal",value:function(e,t,i,n){n.subVectors(i,t),qm.subVectors(e,t),n.cross(qm);var o=n.lengthSq();return o>0?n.multiplyScalar(1/Math.sqrt(o)):n.set(0,0,0)}},{key:"getBarycoord",value:function(e,t,i,n,o){qm.subVectors(n,t),Xm.subVectors(i,t),Zm.subVectors(e,t);var s=qm.dot(qm),a=qm.dot(Xm),r=qm.dot(Zm),l=Xm.dot(Xm),c=Xm.dot(Zm),u=s*l-a*a;if(0===u)return o.set(0,0,0),null;var h=1/u,p=(l*r-a*c)*h,d=(s*c-a*r)*h;return o.set(1-p-d,d,p)}},{key:"containsPoint",value:function(e,t,i,n){return null!==this.getBarycoord(e,t,i,n,Km)&&Km.x>=0&&Km.y>=0&&Km.x+Km.y<=1}},{key:"getInterpolation",value:function(e,t,i,n,o,s,a,r){return null===this.getBarycoord(e,t,i,n,Km)?(r.x=0,r.y=0,"z"in r&&(r.z=0),"w"in r&&(r.w=0),null):(r.setScalar(0),r.addScaledVector(o,Km.x),r.addScaledVector(s,Km.y),r.addScaledVector(a,Km.z),r)}},{key:"isFrontFacing",value:function(e,t,i,n){return qm.subVectors(i,t),Xm.subVectors(e,t),qm.cross(Xm).dot(n)<0}}])}(),af={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},rf={h:0,s:0,l:0},lf={h:0,s:0,l:0};function cf(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}var uf=function(){return x()((function e(t,i,n){return k()(this,e),this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,i,n)}),[{key:"set",value:function(e,t,i){if(void 0===t&&void 0===i){var n=e;n&&n.isColor?this.copy(n):"number"==typeof n?this.setHex(n):"string"==typeof n&&this.setStyle(n)}else this.setRGB(e,t,i);return this}},{key:"setScalar",value:function(e){return this.r=e,this.g=e,this.b=e,this}},{key:"setHex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p;return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,Od.toWorkingColorSpace(this,t),this}},{key:"setRGB",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Od.workingColorSpace;return this.r=e,this.g=t,this.b=i,Od.toWorkingColorSpace(this,n),this}},{key:"setHSL",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Od.workingColorSpace;if(e=fd(e,1),t=md(t,0,1),i=md(i,0,1),0===t)this.r=this.g=this.b=i;else{var o=i<=.5?i*(1+t):i+t-i*t,s=2*i-o;this.r=cf(s,o,e+1/3),this.g=cf(s,o,e),this.b=cf(s,o,e-1/3)}return Od.toWorkingColorSpace(this,n),this}},{key:"setStyle",value:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p;function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(t=/^(\w+)\(([^\)]*)\)/.exec(e)){var o,s=t[1],a=t[2];switch(s){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,i);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,i);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,i);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(t=/^\#([A-Fa-f\d]+)$/.exec(e)){var r=t[1],l=r.length;if(3===l)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,i);if(6===l)return this.setHex(parseInt(r,16),i);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,i);return this}},{key:"setColorName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p,i=af[e.toLowerCase()];return void 0!==i?this.setHex(i,t):console.warn("THREE.Color: Unknown color "+e),this}},{key:"clone",value:function(){return new this.constructor(this.r,this.g,this.b)}},{key:"copy",value:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}},{key:"copySRGBToLinear",value:function(e){return this.r=Nd(e.r),this.g=Nd(e.g),this.b=Nd(e.b),this}},{key:"copyLinearToSRGB",value:function(e){return this.r=Bd(e.r),this.g=Bd(e.g),this.b=Bd(e.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}},{key:"getHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$p;return Od.fromWorkingColorSpace(hf.copy(this),e),65536*Math.round(md(255*hf.r,0,255))+256*Math.round(md(255*hf.g,0,255))+Math.round(md(255*hf.b,0,255))}},{key:"getHexString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$p;return("000000"+this.getHex(e).toString(16)).slice(-6)}},{key:"getHSL",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Od.workingColorSpace;Od.fromWorkingColorSpace(hf.copy(this),t);var i,n,o=hf.r,s=hf.g,a=hf.b,r=Math.max(o,s,a),l=Math.min(o,s,a),c=(l+r)/2;if(l===r)i=0,n=0;else{var u=r-l;switch(n=c<=.5?u/(r+l):u/(2-r-l),r){case o:i=(s-a)/u+(s1&&void 0!==arguments[1]?arguments[1]:Od.workingColorSpace;return Od.fromWorkingColorSpace(hf.copy(this),t),e.r=hf.r,e.g=hf.g,e.b=hf.b,e}},{key:"getStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$p;Od.fromWorkingColorSpace(hf.copy(this),e);var t=hf.r,i=hf.g,n=hf.b;return e!==$p?"color(".concat(e," ").concat(t.toFixed(3)," ").concat(i.toFixed(3)," ").concat(n.toFixed(3),")"):"rgb(".concat(Math.round(255*t),",").concat(Math.round(255*i),",").concat(Math.round(255*n),")")}},{key:"offsetHSL",value:function(e,t,i){return this.getHSL(rf),this.setHSL(rf.h+e,rf.s+t,rf.l+i)}},{key:"add",value:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}},{key:"addColors",value:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}},{key:"addScalar",value:function(e){return this.r+=e,this.g+=e,this.b+=e,this}},{key:"sub",value:function(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}},{key:"multiply",value:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}},{key:"multiplyScalar",value:function(e){return this.r*=e,this.g*=e,this.b*=e,this}},{key:"lerp",value:function(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}},{key:"lerpColors",value:function(e,t,i){return this.r=e.r+(t.r-e.r)*i,this.g=e.g+(t.g-e.g)*i,this.b=e.b+(t.b-e.b)*i,this}},{key:"lerpHSL",value:function(e,t){this.getHSL(rf),e.getHSL(lf);var i=vd(rf.h,lf.h,t),n=vd(rf.s,lf.s,t),o=vd(rf.l,lf.l,t);return this.setHSL(i,n,o),this}},{key:"setFromVector3",value:function(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}},{key:"applyMatrix3",value:function(e){var t=this.r,i=this.g,n=this.b,o=e.elements;return this.r=o[0]*t+o[3]*i+o[6]*n,this.g=o[1]*t+o[4]*i+o[7]*n,this.b=o[2]*t+o[5]*i+o[8]*n,this}},{key:"equals",value:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}},{key:"fromArray",value:function(e){var 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}},{key:"toArray",value:function(){var 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}},{key:"fromBufferAttribute",value:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}},{key:"toJSON",value:function(){return this.getHex()}},{key:Symbol.iterator,value:a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.r;case 2:return e.next=4,this.g;case 4:return e.next=6,this.b;case 6:case"end":return e.stop()}}),e,this)}))}])}(),hf=new uf;uf.NAMES=af;var pf=0,df=function(e){function t(){var e;return k()(this,t),(e=qp(this,t)).isMaterial=!0,Object.defineProperty(Yp()(e),"id",{value:pf++}),e.uuid=dd(),e.name="",e.type="Material",e.blending=1,e.side=0,e.vertexColors=!1,e.opacity=1,e.transparent=!1,e.alphaHash=!1,e.blendSrc=204,e.blendDst=205,e.blendEquation=100,e.blendSrcAlpha=null,e.blendDstAlpha=null,e.blendEquationAlpha=null,e.blendColor=new uf(0,0,0),e.blendAlpha=0,e.depthFunc=3,e.depthTest=!0,e.depthWrite=!0,e.stencilWriteMask=255,e.stencilFunc=519,e.stencilRef=0,e.stencilFuncMask=255,e.stencilFail=ad,e.stencilZFail=ad,e.stencilZPass=ad,e.stencilWrite=!1,e.clippingPlanes=null,e.clipIntersection=!1,e.clipShadows=!1,e.shadowSide=null,e.colorWrite=!0,e.precision=null,e.polygonOffset=!1,e.polygonOffsetFactor=0,e.polygonOffsetUnits=0,e.dithering=!1,e.alphaToCoverage=!1,e.premultipliedAlpha=!1,e.forceSinglePass=!1,e.visible=!0,e.toneMapped=!0,e.userData={},e.version=0,e._alphaTest=0,e}return wn()(t,e),x()(t,[{key:"alphaTest",get:function(){return this._alphaTest},set:function(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}},{key:"onBuild",value:function(){}},{key:"onBeforeRender",value:function(){}},{key:"onBeforeCompile",value:function(){}},{key:"customProgramCacheKey",value:function(){return this.onBeforeCompile.toString()}},{key:"setValues",value:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i){var n=this[t];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[t]=i:console.warn("THREE.Material: '".concat(t,"' is not a property of THREE.").concat(this.type,"."))}else console.warn("THREE.Material: parameter '".concat(t,"' has value of undefined."))}}},{key:"toJSON",value:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function n(e){var t=[];for(var i in e){var n=e[i];delete n.metadata,t.push(n)}return t}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ad&&(i.stencilFail=this.stencilFail),this.stencilZFail!==ad&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==ad&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),t){var o=n(e.textures),s=n(e.images);o.length>0&&(i.textures=o),s.length>0&&(i.images=s)}return i}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(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.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,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;var t=e.clippingPlanes,i=null;if(null!==t){var n=t.length;i=new Array(n);for(var o=0;o!==n;++o)i[o]=t[o].clone()}return this.clippingPlanes=i,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.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"})}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}}])}(ud),mf=function(e){function t(e){var i;return k()(this,t),(i=qp(this,t)).isMeshBasicMaterial=!0,i.type="MeshBasicMaterial",i.color=new uf(16777215),i.map=null,i.lightMap=null,i.lightMapIntensity=1,i.aoMap=null,i.aoMapIntensity=1,i.specularMap=null,i.alphaMap=null,i.envMap=null,i.envMapRotation=new Tm,i.combine=0,i.reflectivity=1,i.refractionRatio=.98,i.wireframe=!1,i.wireframeLinewidth=1,i.wireframeLinecap="round",i.wireframeLinejoin="round",i.fog=!0,i.setValues(e),i}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([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.envMapRotation.copy(e.envMapRotation),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}}])}(df);!function(){for(var e=new ArrayBuffer(4),t=new Float32Array(e),i=new Uint32Array(e),n=new Uint32Array(512),o=new Uint32Array(512),s=0;s<256;++s){var a=s-127;a<-27?(n[s]=0,n[256|s]=32768,o[s]=24,o[256|s]=24):a<-14?(n[s]=1024>>-a-14,n[256|s]=1024>>-a-14|32768,o[s]=-a-1,o[256|s]=-a-1):a<=15?(n[s]=a+15<<10,n[256|s]=a+15<<10|32768,o[s]=13,o[256|s]=13):a<128?(n[s]=31744,n[256|s]=64512,o[s]=24,o[256|s]=24):(n[s]=31744,n[256|s]=64512,o[s]=13,o[256|s]=13)}for(var r=new Uint32Array(2048),l=new Uint32Array(64),c=new Uint32Array(64),u=1;u<1024;++u){for(var h=u<<13,p=0;0==(8388608&h);)h<<=1,p-=8388608;h&=-8388609,p+=947912704,r[u]=h|p}for(var d=1024;d<2048;++d)r[d]=939524096+(d-1024<<13);for(var m=1;m<31;++m)l[m]=m<<23;l[31]=1199570944,l[32]=2147483648;for(var f=33;f<63;++f)l[f]=2147483648+(f-32<<23);l[63]=3347054592;for(var v=1;v<64;++v)32!==v&&(c[v]=1024)}();var ff=new Wd,vf=new bd,gf=function(){return x()((function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(k()(this,e),Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=i,this.count=void 0!==t?t.length/i:0,this.normalized=n,this.usage=rd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=1015,this.version=0}),[{key:"onUploadCallback",value:function(){}},{key:"needsUpdate",set:function(e){!0===e&&this.version++}},{key:"updateRange",get:function(){return Sd("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}},{key:"setUsage",value:function(e){return this.usage=e,this}},{key:"addUpdateRange",value:function(e,t){this.updateRanges.push({start:e,count:t})}},{key:"clearUpdateRanges",value:function(){this.updateRanges.length=0}},{key:"copy",value:function(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.gpuType=e.gpuType,this}},{key:"copyAt",value:function(e,t,i){e*=this.itemSize,i*=t.itemSize;for(var n=0,o=this.itemSize;n1&&void 0!==arguments[1]?arguments[1]:0;return this.array.set(e,t),this}},{key:"getComponent",value:function(e,t){var i=this.array[e*this.itemSize+t];return this.normalized&&(i=gd(i,this.array)),i}},{key:"setComponent",value:function(e,t,i){return this.normalized&&(i=yd(i,this.array)),this.array[e*this.itemSize+t]=i,this}},{key:"getX",value:function(e){var t=this.array[e*this.itemSize];return this.normalized&&(t=gd(t,this.array)),t}},{key:"setX",value:function(e,t){return this.normalized&&(t=yd(t,this.array)),this.array[e*this.itemSize]=t,this}},{key:"getY",value:function(e){var t=this.array[e*this.itemSize+1];return this.normalized&&(t=gd(t,this.array)),t}},{key:"setY",value:function(e,t){return this.normalized&&(t=yd(t,this.array)),this.array[e*this.itemSize+1]=t,this}},{key:"getZ",value:function(e){var t=this.array[e*this.itemSize+2];return this.normalized&&(t=gd(t,this.array)),t}},{key:"setZ",value:function(e,t){return this.normalized&&(t=yd(t,this.array)),this.array[e*this.itemSize+2]=t,this}},{key:"getW",value:function(e){var t=this.array[e*this.itemSize+3];return this.normalized&&(t=gd(t,this.array)),t}},{key:"setW",value:function(e,t){return this.normalized&&(t=yd(t,this.array)),this.array[e*this.itemSize+3]=t,this}},{key:"setXY",value:function(e,t,i){return e*=this.itemSize,this.normalized&&(t=yd(t,this.array),i=yd(i,this.array)),this.array[e+0]=t,this.array[e+1]=i,this}},{key:"setXYZ",value:function(e,t,i,n){return e*=this.itemSize,this.normalized&&(t=yd(t,this.array),i=yd(i,this.array),n=yd(n,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this}},{key:"setXYZW",value:function(e,t,i,n,o){return e*=this.itemSize,this.normalized&&(t=yd(t,this.array),i=yd(i,this.array),n=yd(n,this.array),o=yd(o,this.array)),this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=o,this}},{key:"onUpload",value:function(e){return this.onUploadCallback=e,this}},{key:"clone",value:function(){return new this.constructor(this.array,this.itemSize).copy(this)}},{key:"toJSON",value:function(){var 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!==rd&&(e.usage=this.usage),e}}])}(),yf=function(e){function t(e,i,n){return k()(this,t),qp(this,t,[new Uint16Array(e),i,n])}return wn()(t,e),x()(t)}(gf),bf=function(e){function t(e,i,n){return k()(this,t),qp(this,t,[new Uint32Array(e),i,n])}return wn()(t,e),x()(t)}(gf),Cf=function(e){function t(e,i,n){return k()(this,t),qp(this,t,[new Float32Array(e),i,n])}return wn()(t,e),x()(t)}(gf),wf=0,kf=new Cm,_f=new Jm,xf=new Wd,Sf=new Jd,Ef=new Jd,Pf=new Wd,Df=function(e){function t(){var e;return k()(this,t),(e=qp(this,t)).isBufferGeometry=!0,Object.defineProperty(Yp()(e),"id",{value:wf++}),e.uuid=dd(),e.name="",e.type="BufferGeometry",e.index=null,e.attributes={},e.morphAttributes={},e.morphTargetsRelative=!1,e.groups=[],e.boundingBox=null,e.boundingSphere=null,e.drawRange={start:0,count:1/0},e.userData={},e}return wn()(t,e),x()(t,[{key:"getIndex",value:function(){return this.index}},{key:"setIndex",value:function(e){return Array.isArray(e)?this.index=new(kd(e)?bf:yf)(e,1):this.index=e,this}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setAttribute",value:function(e,t){return this.attributes[e]=t,this}},{key:"deleteAttribute",value:function(e){return delete this.attributes[e],this}},{key:"hasAttribute",value:function(e){return void 0!==this.attributes[e]}},{key:"addGroup",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.groups.push({start:e,count:t,materialIndex:i})}},{key:"clearGroups",value:function(){this.groups=[]}},{key:"setDrawRange",value:function(e,t){this.drawRange.start=e,this.drawRange.count=t}},{key:"applyMatrix4",value:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var n=(new Cd).getNormalMatrix(e);i.applyNormalMatrix(n),i.needsUpdate=!0}var o=this.attributes.tangent;return void 0!==o&&(o.transformDirection(e),o.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}},{key:"applyQuaternion",value:function(e){return kf.makeRotationFromQuaternion(e),this.applyMatrix4(kf),this}},{key:"rotateX",value:function(e){return kf.makeRotationX(e),this.applyMatrix4(kf),this}},{key:"rotateY",value:function(e){return kf.makeRotationY(e),this.applyMatrix4(kf),this}},{key:"rotateZ",value:function(e){return kf.makeRotationZ(e),this.applyMatrix4(kf),this}},{key:"translate",value:function(e,t,i){return kf.makeTranslation(e,t,i),this.applyMatrix4(kf),this}},{key:"scale",value:function(e,t,i){return kf.makeScale(e,t,i),this.applyMatrix4(kf),this}},{key:"lookAt",value:function(e){return _f.lookAt(e),_f.updateMatrix(),this.applyMatrix4(_f.matrix),this}},{key:"center",value:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(xf).negate(),this.translate(xf.x,xf.y,xf.z),this}},{key:"setFromPoints",value:function(e){for(var t=[],i=0,n=e.length;i0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};var n=this.index;null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var o=this.attributes;for(var s in o){var a=o[s];e.data.attributes[s]=a.toJSON(e.data)}var r={},l=!1;for(var c in this.morphAttributes){for(var u=this.morphAttributes[c],h=[],p=0,d=u.length;p0&&(r[c]=h,l=!0)}l&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);var f=this.groups;f.length>0&&(e.data.groups=JSON.parse(JSON.stringify(f)));var v=this.boundingSphere;return null!==v&&(e.data.boundingSphere={center:v.center.toArray(),radius:v.radius}),e}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;var t={};this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone(t));var n=e.attributes;for(var o in n){var s=n[o];this.setAttribute(o,s.clone(t))}var a=e.morphAttributes;for(var r in a){for(var l=[],c=a[r],u=0,h=c.length;u0&&void 0!==arguments[0]?arguments[0]:new Df,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new mf;return k()(this,t),(e=qp(this,t)).isMesh=!0,e.type="Mesh",e.geometry=i,e.material=n,e.updateMorphTargets(),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e,i){return Jp(t,"copy",this,3)([e,i]),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}},{key:"updateMorphTargets",value:function(){var e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){var i=e[t[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var n=0,o=i.length;nMath.pow(e.far-e.near,2))return}Mf.copy(o).invert(),Tf.copy(e.ray).applyMatrix4(Mf),null!==i.boundingBox&&!1===Tf.intersectsBox(i.boundingBox)||this._computeIntersections(e,t,Tf)}}},{key:"_computeIntersections",value:function(e,t,i){var n,o=this.geometry,s=this.material,a=o.index,r=o.attributes.position,l=o.attributes.uv,c=o.attributes.uv1,u=o.attributes.normal,h=o.groups,p=o.drawRange;if(null!==a)if(Array.isArray(s))for(var d=0,m=h.length;di.far?null:{distance:l,point:Uf.clone(),object:e}}(e,t,i,n,Bf,Af,Lf,Wf);if(u){o&&(Rf.fromBufferAttribute(o,r),zf.fromBufferAttribute(o,l),Ff.fromBufferAttribute(o,c),u.uv=sf.getInterpolation(Wf,Bf,Af,Lf,Rf,zf,Ff,new bd)),s&&(Rf.fromBufferAttribute(s,r),zf.fromBufferAttribute(s,l),Ff.fromBufferAttribute(s,c),u.uv1=sf.getInterpolation(Wf,Bf,Af,Lf,Rf,zf,Ff,new bd)),a&&(Hf.fromBufferAttribute(a,r),Vf.fromBufferAttribute(a,l),Gf.fromBufferAttribute(a,c),u.normal=sf.getInterpolation(Wf,Bf,Af,Lf,Hf,Vf,Gf,new Wd),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));var h={a:r,b:l,c:c,normal:new Wd,materialIndex:0};sf.getNormal(Bf,Af,Lf,h.normal),u.face=h}return u}var qf=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;k()(this,t),(e=qp(this,t)).type="BoxGeometry",e.parameters={width:i,height:n,depth:o,widthSegments:s,heightSegments:a,depthSegments:r};var l=e;s=Math.floor(s),a=Math.floor(a),r=Math.floor(r);var c=[],u=[],h=[],p=[],d=0,m=0;function f(e,t,i,n,o,s,a,r,f,v,g){for(var y=s/f,b=a/v,C=s/2,w=a/2,k=r/2,_=f+1,x=v+1,S=0,E=0,P=new Wd,D=0;D0?1:-1,h.push(P.x,P.y,P.z),p.push(T/f),p.push(1-D/v),S+=1}for(var N=0;N0&&void 0!==arguments[0]?arguments[0]:new Wd(1,0,0),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,e),this.isPlane=!0,this.normal=t,this.constant=i}),[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,i){var n=$f.subVectors(i,t).cross(ev.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(n,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}},{key:"intersectLine",value:function(e,t){var i=e.delta($f),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var o=-(e.start.dot(this.normal)+this.constant)/n;return o<0||o>1?null:t.copy(e.start).addScaledVector(i,o)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var i=t||tv.getNormalMatrix(e),n=this.coplanarPoint($f).applyMatrix4(e),o=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(o),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),nv=new hm,ov=new Wd,sv=function(){return x()((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new iv,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new iv,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new iv,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new iv,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new iv,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new iv;k()(this,e),this.planes=[t,i,n,o,s,a]}),[{key:"set",value:function(e,t,i,n,o,s){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(n),a[4].copy(o),a[5].copy(s),this}},{key:"copy",value:function(e){for(var t=this.planes,i=0;i<6;i++)t[i].copy(e.planes[i]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=this.planes,n=e.elements,o=n[0],s=n[1],a=n[2],r=n[3],l=n[4],c=n[5],u=n[6],h=n[7],p=n[8],d=n[9],m=n[10],f=n[11],v=n[12],g=n[13],y=n[14],b=n[15];if(i[0].setComponents(r-o,h-l,f-p,b-v).normalize(),i[1].setComponents(r+o,h+l,f+p,b+v).normalize(),i[2].setComponents(r+s,h+c,f+d,b+g).normalize(),i[3].setComponents(r-s,h-c,f-d,b-g).normalize(),i[4].setComponents(r-a,h-u,f-m,b-y).normalize(),t===ld)i[5].setComponents(r+a,h+u,f+m,b+y).normalize();else{if(t!==cd)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);i[5].setComponents(a,u,m,y).normalize()}return this}},{key:"intersectsObject",value:function(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),nv.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{var t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),nv.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(nv)}},{key:"intersectsSprite",value:function(e){return nv.center.set(0,0,0),nv.radius=.7071067811865476,nv.applyMatrix4(e.matrixWorld),this.intersectsSphere(nv)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,i=e.center,n=-e.radius,o=0;o<6;o++)if(t[o].distanceToPoint(i)0?e.max.x:e.min.x,ov.y=n.normal.y>0?e.max.y:e.min.y,ov.z=n.normal.z>0?e.max.z:e.min.z,n.distanceToPoint(ov)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}();var av=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;k()(this,t),(e=qp(this,t)).type="PlaneGeometry",e.parameters={width:i,height:n,widthSegments:o,heightSegments:s};for(var a=i/2,r=n/2,l=Math.floor(o),c=Math.floor(s),u=l+1,h=c+1,p=i/l,d=n/c,m=[],f=[],v=[],g=[],y=0;y 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\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 v ) { return dot( v, vec3( 0.3333333 ) ); }\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};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\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 luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, 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}\nvec3 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} // validated",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\thighp vec2 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 cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_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 ), cubeUV_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_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 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, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\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, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\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\tuniform mat3 envMapRotation;\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 ) || defined( LAMBERT )\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 ) || defined( LAMBERT )\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:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * 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#ifdef 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, envMapRotation * 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\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\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\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\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 ( LEGACY_LIGHTS )\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#else\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#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, 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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\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\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\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( ( material.ior - 1.0 ) / ( material.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, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).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_DISPERSION\n\tmaterial.dispersion = dispersion;\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, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).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_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\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\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\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}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.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\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\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\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, 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( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, 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:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\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, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\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, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\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 ], geometryNormal );\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, vLightMapUv );\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( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\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\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\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\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_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\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, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\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\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\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 = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).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( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\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 USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.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 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\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",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\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}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\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 depth, const in float near, const in float far ) {\n\treturn depth * ( 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 depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - 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_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\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, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#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\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\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\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\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#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\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:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\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, vSpotLightCoord[ 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\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\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, vSpecularMapUv );\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 saturate( 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}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\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\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\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 lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\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 dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t\n\t\t#else\n\t\t\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\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;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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, vLightMapUv );\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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\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_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n}"},lv={common:{diffuse:{value:new uf(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Cd},alphaMap:{value:null},alphaMapTransform:{value:new Cd},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Cd}},envmap:{envMap:{value:null},envMapRotation:{value:new Cd},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Cd}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Cd}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Cd},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Cd},normalScale:{value:new bd(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Cd},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Cd}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Cd}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Cd}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new uf(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 uf(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Cd},alphaTest:{value:0},uvTransform:{value:new Cd}},sprite:{diffuse:{value:new uf(16777215)},opacity:{value:1},center:{value:new bd(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Cd},alphaMap:{value:null},alphaMapTransform:{value:new Cd},alphaTest:{value:0}}},cv={basic:{uniforms:Zf([lv.common,lv.specularmap,lv.envmap,lv.aomap,lv.lightmap,lv.fog]),vertexShader:rv.meshbasic_vert,fragmentShader:rv.meshbasic_frag},lambert:{uniforms:Zf([lv.common,lv.specularmap,lv.envmap,lv.aomap,lv.lightmap,lv.emissivemap,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.fog,lv.lights,{emissive:{value:new uf(0)}}]),vertexShader:rv.meshlambert_vert,fragmentShader:rv.meshlambert_frag},phong:{uniforms:Zf([lv.common,lv.specularmap,lv.envmap,lv.aomap,lv.lightmap,lv.emissivemap,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.fog,lv.lights,{emissive:{value:new uf(0)},specular:{value:new uf(1118481)},shininess:{value:30}}]),vertexShader:rv.meshphong_vert,fragmentShader:rv.meshphong_frag},standard:{uniforms:Zf([lv.common,lv.envmap,lv.aomap,lv.lightmap,lv.emissivemap,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.roughnessmap,lv.metalnessmap,lv.fog,lv.lights,{emissive:{value:new uf(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:rv.meshphysical_vert,fragmentShader:rv.meshphysical_frag},toon:{uniforms:Zf([lv.common,lv.aomap,lv.lightmap,lv.emissivemap,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.gradientmap,lv.fog,lv.lights,{emissive:{value:new uf(0)}}]),vertexShader:rv.meshtoon_vert,fragmentShader:rv.meshtoon_frag},matcap:{uniforms:Zf([lv.common,lv.bumpmap,lv.normalmap,lv.displacementmap,lv.fog,{matcap:{value:null}}]),vertexShader:rv.meshmatcap_vert,fragmentShader:rv.meshmatcap_frag},points:{uniforms:Zf([lv.points,lv.fog]),vertexShader:rv.points_vert,fragmentShader:rv.points_frag},dashed:{uniforms:Zf([lv.common,lv.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:rv.linedashed_vert,fragmentShader:rv.linedashed_frag},depth:{uniforms:Zf([lv.common,lv.displacementmap]),vertexShader:rv.depth_vert,fragmentShader:rv.depth_frag},normal:{uniforms:Zf([lv.common,lv.bumpmap,lv.normalmap,lv.displacementmap,{opacity:{value:1}}]),vertexShader:rv.meshnormal_vert,fragmentShader:rv.meshnormal_frag},sprite:{uniforms:Zf([lv.sprite,lv.fog]),vertexShader:rv.sprite_vert,fragmentShader:rv.sprite_frag},background:{uniforms:{uvTransform:{value:new Cd},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:rv.background_vert,fragmentShader:rv.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Cd}},vertexShader:rv.backgroundCube_vert,fragmentShader:rv.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:rv.cube_vert,fragmentShader:rv.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:rv.equirect_vert,fragmentShader:rv.equirect_frag},distanceRGBA:{uniforms:Zf([lv.common,lv.displacementmap,{referencePosition:{value:new Wd},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:rv.distanceRGBA_vert,fragmentShader:rv.distanceRGBA_frag},shadow:{uniforms:Zf([lv.lights,lv.fog,{color:{value:new uf(0)},opacity:{value:1}}]),vertexShader:rv.shadow_vert,fragmentShader:rv.shadow_frag}};cv.physical={uniforms:Zf([cv.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Cd},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Cd},clearcoatNormalScale:{value:new bd(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Cd},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Cd},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Cd},sheen:{value:0},sheenColor:{value:new uf(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Cd},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Cd},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Cd},transmissionSamplerSize:{value:new bd},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Cd},attenuationDistance:{value:0},attenuationColor:{value:new uf(0)},specularColor:{value:new uf(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Cd},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Cd},anisotropyVector:{value:new bd},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Cd}}]),vertexShader:rv.meshphysical_vert,fragmentShader:rv.meshphysical_frag};new Tm,new Cm;var uv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2e3;return k()(this,t),(e=qp(this,t)).isOrthographicCamera=!0,e.type="OrthographicCamera",e.zoom=1,e.view=null,e.left=i,e.right=n,e.top=o,e.bottom=s,e.near=a,e.far=r,e.updateProjectionMatrix(),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e,i){return Jp(t,"copy",this,3)([e,i]),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}},{key:"setViewOffset",value:function(e,t,i,n,o,s){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=i,this.view.offsetY=n,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2,o=i-e,s=i+e,a=n+t,r=n-t;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s=(o+=l*this.view.offsetX)+l*this.view.width,r=(a-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(o,s,a,r,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var i=Jp(t,"toJSON",this,3)([e]);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,null!==this.view&&(i.object.view=Object.assign({},this.view)),i}}])}(Kf),hv=(new uv,new uf,(1+Math.sqrt(5))/2),pv=1/hv;new Wd(-hv,pv,0),new Wd(hv,pv,0),new Wd(-pv,0,hv),new Wd(pv,0,hv),new Wd(0,hv,-pv),new Wd(0,hv,pv),new Wd(-1,1,-1),new Wd(1,1,-1),new Wd(-1,1,1),new Wd(1,1,1);var dv=function(e){function t(e,i,n,o,s,a,r,l,c,u){var h;if(k()(this,t),1026!==(u=void 0!==u?u:1026)&&1027!==u)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");return void 0===n&&1026===u&&(n=Xp),void 0===n&&1027===u&&(n=Zp),(h=qp(this,t,[null,o,s,a,r,l,u,n,c])).isDepthTexture=!0,h.image={width:e,height:i},h.magFilter=void 0!==r?r:1003,h.minFilter=void 0!==l?l:1003,h.flipY=!1,h.generateMipmaps=!1,h.compareFunction=null,h}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.compareFunction=e.compareFunction,this}},{key:"toJSON",value:function(e){var i=Jp(t,"toJSON",this,3)([e]);return null!==this.compareFunction&&(i.compareFunction=this.compareFunction),i}}])}(zd),mv=(new zd,new dv(1,1));mv.compareFunction=515;new Hd,new Vd,new Qf,new Float32Array(16),new Float32Array(9),new Float32Array(4);new Map;new Tm,new Cm;new Wd,new Wd,new Wd,new Wd,new bd,new bd,new Cm,new Wd,new Wd,new Wd,new bd,new bd,new bd;new Wd,new Wd,new Wd,new Fd,new Fd,new Wd,new Cm,new Wd,new hm,new Cm,new bm,new Cm,new Cm,new Cm,new Cm,new Jd,new Cm,new Yf,new hm;var fv=function(){return x()((function e(){k()(this,e),this.index=0,this.pool=[],this.list=[]}),[{key:"push",value:function(e,t){var i=this.pool,n=this.list;this.index>=i.length&&i.push({start:-1,count:-1,z:-1});var o=i[this.index];n.push(o),this.index++,o.start=e.start,o.count=e.count,o.z=t}},{key:"reset",value:function(){this.list.length=0,this.index=0}}])}();new Cm,new Cm,new Cm,new Cm,new sv,new Jd,new hm,new Wd,new fv,new Yf;new Wd,new Wd,new Cm,new bm,new hm,new Wd,new Wd;new Wd,new Wd,new Cm,new bm,new hm,new Wd;var vv=function(){return x()((function e(){k()(this,e),this.type="Curve",this.arcLengthDivisions=200}),[{key:"getPoint",value:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}},{key:"getPointAt",value:function(e,t){var i=this.getUtoTmapping(e);return this.getPoint(i,t)}},{key:"getPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}},{key:"getSpacedPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t=[],i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}},{key:"getLength",value:function(){var e=this.getLengths();return e[e.length-1]}},{key:"getLengths",value:function(){var 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;var t,i=[],n=this.getPoint(0),o=0;i.push(0);for(var s=1;s<=e;s++)o+=(t=this.getPoint(s/e)).distanceTo(n),i.push(o),n=t;return this.cacheArcLengths=i,i}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.getLengths()}},{key:"getUtoTmapping",value:function(e,t){var i,n=this.getLengths(),o=0,s=n.length;i=t||e*n[s-1];for(var a,r=0,l=s-1;r<=l;)if((a=n[o=Math.floor(r+(l-r)/2)]-i)<0)r=o+1;else{if(!(a>0)){l=o;break}l=o-1}if(n[o=l]===i)return o/(s-1);var c=n[o];return(o+(i-c)/(n[o+1]-c))/(s-1)}},{key:"getTangent",value:function(e,t){var i=1e-4,n=e-i,o=e+i;n<0&&(n=0),o>1&&(o=1);var s=this.getPoint(n),a=this.getPoint(o),r=t||(s.isVector2?new bd:new Wd);return r.copy(a).sub(s).normalize(),r}},{key:"getTangentAt",value:function(e,t){var i=this.getUtoTmapping(e);return this.getTangent(i,t)}},{key:"computeFrenetFrames",value:function(e,t){for(var i=new Wd,n=[],o=[],s=[],a=new Wd,r=new Cm,l=0;l<=e;l++){var c=l/e;n[l]=this.getTangentAt(c,new Wd)}o[0]=new Wd,s[0]=new Wd;var u=Number.MAX_VALUE,h=Math.abs(n[0].x),p=Math.abs(n[0].y),d=Math.abs(n[0].z);h<=u&&(u=h,i.set(1,0,0)),p<=u&&(u=p,i.set(0,1,0)),d<=u&&i.set(0,0,1),a.crossVectors(n[0],i).normalize(),o[0].crossVectors(n[0],a),s[0].crossVectors(n[0],o[0]);for(var m=1;m<=e;m++){if(o[m]=o[m-1].clone(),s[m]=s[m-1].clone(),a.crossVectors(n[m-1],n[m]),a.length()>Number.EPSILON){a.normalize();var f=Math.acos(md(n[m-1].dot(n[m]),-1,1));o[m].applyMatrix4(r.makeRotationAxis(a,f))}s[m].crossVectors(n[m],o[m])}if(!0===t){var v=Math.acos(md(o[0].dot(o[e]),-1,1));v/=e,n[0].dot(a.crossVectors(o[0],o[e]))>0&&(v=-v);for(var g=1;g<=e;g++)o[g].applyMatrix4(r.makeRotationAxis(n[g],v*g)),s[g].crossVectors(n[g],o[g])}return{tangents:n,normals:o,binormals:s}}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"copy",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}},{key:"toJSON",value:function(){var e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}},{key:"fromJSON",value:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}])}(),gv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0;return k()(this,t),(e=qp(this,t)).isEllipseCurve=!0,e.type="EllipseCurve",e.aX=i,e.aY=n,e.xRadius=o,e.yRadius=s,e.aStartAngle=a,e.aEndAngle=r,e.aClockwise=l,e.aRotation=c,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t,n=2*Math.PI,o=this.aEndAngle-this.aStartAngle,s=Math.abs(o)n;)o-=n;o0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"centripetal",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5;return k()(this,t),(e=qp(this,t)).isCatmullRomCurve3=!0,e.type="CatmullRomCurve3",e.points=i,e.closed=n,e.curveType=o,e.tension=s,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,o=n,s=this.points,a=s.length,r=(a-(this.closed?0:1))*e,l=Math.floor(r),c=r-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/a)+1)*a:0===c&&l===a-1&&(l=a-2,c=1),this.closed||l>0?t=s[(l-1)%a]:(Cv.subVectors(s[0],s[1]).add(s[0]),t=Cv);var u=s[l%a],h=s[(l+1)%a];if(this.closed||l+20&&void 0!==arguments[0]?arguments[0]:new bd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new bd,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new bd;return k()(this,t),(e=qp(this,t)).isCubicBezierCurve=!0,e.type="CubicBezierCurve",e.v0=i,e.v1=n,e.v2=o,e.v3=s,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(Pv(e,n.x,o.x,s.x,a.x),Pv(e,n.y,o.y,s.y,a.y)),i}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}])}(vv),Mv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Wd,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Wd;return k()(this,t),(e=qp(this,t)).isCubicBezierCurve3=!0,e.type="CubicBezierCurve3",e.v0=i,e.v1=n,e.v2=o,e.v3=s,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,i=t,n=this.v0,o=this.v1,s=this.v2,a=this.v3;return i.set(Pv(e,n.x,o.x,s.x,a.x),Pv(e,n.y,o.y,s.y,a.y),Pv(e,n.z,o.z,s.z,a.z)),i}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}])}(vv),Tv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd;return k()(this,t),(e=qp(this,t)).isLineCurve=!0,e.type="LineCurve",e.v1=i,e.v2=n,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd;return t.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,t){return this.getTangent(e,t)}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vv),Ov=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd;return k()(this,t),(e=qp(this,t)).isLineCurve3=!0,e.type="LineCurve3",e.v1=i,e.v2=n,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,i=t;return 1===e?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}},{key:"getPointAt",value:function(e,t){return this.getPoint(e,t)}},{key:"getTangent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd;return t.subVectors(this.v2,this.v1).normalize()}},{key:"getTangentAt",value:function(e,t){return this.getTangent(e,t)}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vv),Nv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new bd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new bd;return k()(this,t),(e=qp(this,t)).isQuadraticBezierCurve=!0,e.type="QuadraticBezierCurve",e.v0=i,e.v1=n,e.v2=o,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t,n=this.v0,o=this.v1,s=this.v2;return i.set(Ev(e,n.x,o.x,s.x),Ev(e,n.y,o.y,s.y)),i}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vv),Bv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Wd,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Wd;return k()(this,t),(e=qp(this,t)).isQuadraticBezierCurve3=!0,e.type="QuadraticBezierCurve3",e.v0=i,e.v1=n,e.v2=o,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Wd,i=t,n=this.v0,o=this.v1,s=this.v2;return i.set(Ev(e,n.x,o.x,s.x),Ev(e,n.y,o.y,s.y),Ev(e,n.z,o.z,s.z)),i}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}])}(vv),Av=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return k()(this,t),(e=qp(this,t)).isSplineCurve=!0,e.type="SplineCurve",e.points=i,e}return wn()(t,e),x()(t,[{key:"getPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new bd,i=t,n=this.points,o=(n.length-1)*e,s=Math.floor(o),a=o-s,r=n[0===s?s:s-1],l=n[s],c=n[s>n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return i.set(Sv(a,r.x,l.x,c.x,u.x),Sv(a,r.y,l.y,c.y,u.y)),i}},{key:"copy",value:function(e){Jp(t,"copy",this,3)([e]),this.points=[];for(var i=0,n=e.points.length;i0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this}},{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.currentPoint.copy(e.currentPoint),this}},{key:"toJSON",value:function(){var e=Jp(t,"toJSON",this,3)([]);return e.currentPoint=this.currentPoint.toArray(),e}},{key:"fromJSON",value:function(e){return Jp(t,"fromJSON",this,3)([e]),this.currentPoint.fromArray(e.currentPoint),this}}])}(function(e){function t(){var e;return k()(this,t),(e=qp(this,t)).type="CurvePath",e.curves=[],e.autoClose=!1,e}return wn()(t,e),x()(t,[{key:"add",value:function(e){this.curves.push(e)}},{key:"closePath",value:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){var i=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Lv[i](t,e))}return this}},{key:"getPoint",value:function(e,t){for(var i=e*this.getLength(),n=this.getCurveLengths(),o=0;o=i){var s=n[o]-i,a=this.curves[o],r=a.getLength(),l=0===r?0:1-s/r;return a.getPointAt(l,t)}o++}return null}},{key:"getLength",value:function(){var e=this.getCurveLengths();return e[e.length-1]}},{key:"updateArcLengths",value:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}},{key:"getCurveLengths",value:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,i=0,n=this.curves.length;i0&&void 0!==arguments[0]?arguments[0]:40,t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}},{key:"getPoints",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,i=[],n=0,o=this.curves;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},{key:"copy",value:function(e){Jp(t,"copy",this,3)([e]),this.curves=[];for(var i=0,n=e.curves.length;i0&&void 0!==arguments[0]?arguments[0]:[new bd(0,-.5),new bd(.5,0),new bd(0,.5)],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="LatheGeometry",e.parameters={points:i,segments:n,phiStart:o,phiLength:s},n=Math.floor(n),s=md(s,0,2*Math.PI);for(var a=[],r=[],l=[],c=[],u=[],h=1/n,p=new Wd,d=new bd,m=new Wd,f=new Wd,v=new Wd,g=0,y=0,b=0;b<=i.length-1;b++)switch(b){case 0:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,v.copy(m),m.normalize(),c.push(m.x,m.y,m.z);break;case i.length-1:c.push(v.x,v.y,v.z);break;default:g=i[b+1].x-i[b].x,y=i[b+1].y-i[b].y,m.x=1*y,m.y=-g,m.z=0*y,f.copy(m),m.x+=v.x,m.y+=v.y,m.z+=v.z,m.normalize(),c.push(m.x,m.y,m.z),v.copy(f)}for(var C=0;C<=n;C++)for(var w=o+C*h*s,_=Math.sin(w),x=Math.cos(w),S=0;S<=i.length-1;S++){p.x=i[S].x*_,p.y=i[S].y,p.z=i[S].x*x,r.push(p.x,p.y,p.z),d.x=C/n,d.y=S/(i.length-1),l.push(d.x,d.y);var E=c[3*S+0]*_,P=c[3*S+1],D=c[3*S+0]*x;u.push(E,P,D)}for(var M=0;M0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;k()(this,t);var a=new Iv;return a.absarc(0,-n/2,i,1.5*Math.PI,0),a.absarc(0,n/2,i,0,.5*Math.PI),(e=qp(this,t,[a.getPoints(o),s])).type="CapsuleGeometry",e.parameters={radius:i,length:n,capSegments:o,radialSegments:s},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.length,e.capSegments,e.radialSegments)}}])}(jv),zv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="CircleGeometry",e.parameters={radius:i,segments:n,thetaStart:o,thetaLength:s},n=Math.max(3,n);var a=[],r=[],l=[],c=[],u=new Wd,h=new bd;r.push(0,0,0),l.push(0,0,1),c.push(.5,.5);for(var p=0,d=3;p<=n;p++,d+=3){var m=o+p/n*s;u.x=i*Math.cos(m),u.y=i*Math.sin(m),r.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(r[d]/i+1)/2,h.y=(r[d+1]/i+1)/2,c.push(h.x,h.y)}for(var f=1;f<=n;f++)a.push(f,f+1,0);return e.setIndex(a),e.setAttribute("position",new Cf(r,3)),e.setAttribute("normal",new Cf(l,3)),e.setAttribute("uv",new Cf(c,2)),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.segments,e.thetaStart,e.thetaLength)}}])}(Df),Fv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:32,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="CylinderGeometry",e.parameters={radiusTop:i,radiusBottom:n,height:o,radialSegments:s,heightSegments:a,openEnded:r,thetaStart:l,thetaLength:c};var u=e;s=Math.floor(s),a=Math.floor(a);var h=[],p=[],d=[],m=[],f=0,v=[],g=o/2,y=0;function b(e){for(var t=f,o=new bd,a=new Wd,r=0,v=!0===e?i:n,b=!0===e?1:-1,C=1;C<=s;C++)p.push(0,g*b,0),d.push(0,b,0),m.push(.5,.5),f++;for(var w=f,k=0;k<=s;k++){var _=k/s*c+l,x=Math.cos(_),S=Math.sin(_);a.x=v*S,a.y=g*b,a.z=v*x,p.push(a.x,a.y,a.z),d.push(0,b,0),o.x=.5*x+.5,o.y=.5*S*b+.5,m.push(o.x,o.y),f++}for(var E=0;E0&&b(!0),n>0&&b(!1)),e.setIndex(h),e.setAttribute("position",new Cf(p,3)),e.setAttribute("normal",new Cf(d,3)),e.setAttribute("uv",new Cf(m,2)),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}])}(Df),Hv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:2*Math.PI;return k()(this,t),(e=qp(this,t,[0,i,n,o,s,a,r,l])).type="ConeGeometry",e.parameters={radius:i,height:n,radialSegments:o,heightSegments:s,openEnded:a,thetaStart:r,thetaLength:l},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}])}(Fv),Vv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;k()(this,t),(e=qp(this,t)).type="PolyhedronGeometry",e.parameters={vertices:i,indices:n,radius:o,detail:s};var a=[],r=[];function l(e,t,i,n){for(var o=n+1,s=[],a=0;a<=o;a++){s[a]=[];for(var r=e.clone().lerp(i,a/o),l=t.clone().lerp(i,a/o),u=o-a,h=0;h<=u;h++)s[a][h]=0===h&&a===o?r:r.clone().lerp(l,h/u)}for(var p=0;p.9&&s<.1&&(t<.2&&(r[e+0]+=1),i<.2&&(r[e+2]+=1),n<.2&&(r[e+4]+=1))}}()}(),e.setAttribute("position",new Cf(a,3)),e.setAttribute("normal",new Cf(a.slice(),3)),e.setAttribute("uv",new Cf(r,2)),0===s?e.computeVertexNormals():e.normalizeNormals(),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.vertices,e.indices,e.radius,e.details)}}])}(Df),Gv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t);var o=(1+Math.sqrt(5))/2,s=1/o;return(e=qp(this,t,[[-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,-s,-o,0,-s,o,0,s,-o,0,s,o,-s,-o,0,-s,o,0,s,-o,0,s,o,0,-o,0,-s,o,0,-s,-o,0,s,o,0,s],[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],i,n])).type="DodecahedronGeometry",e.parameters={radius:i,detail:n},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Vv),Wv=new Wd,Uv=new Wd,Yv=new Wd,Jv=new sf,qv=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(k()(this,t),(e=qp(this,t)).type="EdgesGeometry",e.parameters={geometry:i,thresholdAngle:n},null!==i){for(var o=4,s=Math.pow(10,o),a=Math.cos(pd*n),r=i.getIndex(),l=i.getAttribute("position"),c=r?r.count:l.count,u=[0,0,0],h=["a","b","c"],p=new Array(3),d={},m=[],f=0;f0)for(s=t;s=t;s-=n)a=gg(s,e[s],e[s+1],a);return a&&hg(a,a.next)&&(yg(a),a=a.next),a}function Kv(e,t){if(!e)return e;t||(t=e);var i,n=e;do{if(i=!1,n.steiner||!hg(n,n.next)&&0!==ug(n.prev,n,n.next))n=n.next;else{if(yg(n),(n=t=n.prev)===n.next)break;i=!0}}while(i||n!==t);return t}function Qv(e,t,i,n,o,s,a){if(e){!a&&s&&function(e,t,i,n){var o=e;do{0===o.z&&(o.z=ag(o.x,o.y,t,i,n)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,i,n,o,s,a,r,l,c=1;do{for(i=e,e=null,s=null,a=0;i;){for(a++,n=i,r=0,t=0;t0||l>0&&n;)0!==r&&(0===l||!n||i.z<=n.z)?(o=i,i=i.nextZ,r--):(o=n,n=n.nextZ,l--),s?s.nextZ=o:e=o,o.prevZ=s,s=o;i=n}s.nextZ=null,c*=2}while(a>1)}(o)}(e,n,o,s);for(var r,l,c=e;e.prev!==e.next;)if(r=e.prev,l=e.next,s?eg(e,n,o,s):$v(e))t.push(r.i/i|0),t.push(e.i/i|0),t.push(l.i/i|0),yg(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Qv(e=tg(Kv(e),t,i),t,i,n,o,s,2):2===a&&ig(e,t,i,n,o,s):Qv(Kv(e),t,i,n,o,s,1);break}}}function $v(e){var t=e.prev,i=e,n=e.next;if(ug(t,i,n)>=0)return!1;for(var o=t.x,s=i.x,a=n.x,r=t.y,l=i.y,c=n.y,u=os?o>a?o:a:s>a?s:a,d=r>l?r>c?r:c:l>c?l:c,m=n.next;m!==t;){if(m.x>=u&&m.x<=p&&m.y>=h&&m.y<=d&&lg(o,r,s,l,a,c,m.x,m.y)&&ug(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function eg(e,t,i,n){var o=e.prev,s=e,a=e.next;if(ug(o,s,a)>=0)return!1;for(var r=o.x,l=s.x,c=a.x,u=o.y,h=s.y,p=a.y,d=rl?r>c?r:c:l>c?l:c,v=u>h?u>p?u:p:h>p?h:p,g=ag(d,m,t,i,n),y=ag(f,v,t,i,n),b=e.prevZ,C=e.nextZ;b&&b.z>=g&&C&&C.z<=y;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&lg(r,u,l,h,c,p,b.x,b.y)&&ug(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&lg(r,u,l,h,c,p,C.x,C.y)&&ug(C.prev,C,C.next)>=0)return!1;C=C.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=f&&b.y>=m&&b.y<=v&&b!==o&&b!==a&&lg(r,u,l,h,c,p,b.x,b.y)&&ug(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;C&&C.z<=y;){if(C.x>=d&&C.x<=f&&C.y>=m&&C.y<=v&&C!==o&&C!==a&&lg(r,u,l,h,c,p,C.x,C.y)&&ug(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function tg(e,t,i){var n=e;do{var o=n.prev,s=n.next.next;!hg(o,s)&&pg(o,n,n.next,s)&&fg(o,s)&&fg(s,o)&&(t.push(o.i/i|0),t.push(n.i/i|0),t.push(s.i/i|0),yg(n),yg(n.next),n=e=s),n=n.next}while(n!==e);return Kv(n)}function ig(e,t,i,n,o,s){var a=e;do{for(var r=a.next.next;r!==a.prev;){if(a.i!==r.i&&cg(a,r)){var l=vg(a,r);return a=Kv(a,a.next),l=Kv(l,l.next),Qv(a,t,i,n,o,s,0),void Qv(l,t,i,n,o,s,0)}r=r.next}a=a.next}while(a!==e)}function ng(e,t){return e.x-t.x}function og(e,t){var i=function(e,t){var i,n=t,o=-1/0,s=e.x,a=e.y;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var r=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(r<=s&&r>o&&(o=r,i=n.x=n.x&&n.x>=u&&s!==n.x&&lg(ai.x||n.x===i.x&&sg(i,n)))&&(i=n,p=l)),n=n.next}while(n!==c);return i}(e,t);if(!i)return t;var n=vg(i,e);return Kv(n,n.next),Kv(i,i.next)}function sg(e,t){return ug(e.prev,e,t.prev)<0&&ug(t.next,e,e.next)<0}function ag(e,t,i,n,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*o|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function rg(e){var t=e,i=e;do{(t.x=(e-a)*(s-r)&&(e-a)*(n-r)>=(i-a)*(t-r)&&(i-a)*(s-r)>=(o-a)*(n-r)}function cg(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&pg(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(e,t)&&(fg(e,t)&&fg(t,e)&&function(e,t){var i=e,n=!1,o=(e.x+t.x)/2,s=(e.y+t.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&o<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==e);return n}(e,t)&&(ug(e.prev,e,t.prev)||ug(e,t.prev,t))||hg(e,t)&&ug(e.prev,e,e.next)>0&&ug(t.prev,t,t.next)>0)}function ug(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function hg(e,t){return e.x===t.x&&e.y===t.y}function pg(e,t,i,n){var o=mg(ug(e,t,i)),s=mg(ug(e,t,n)),a=mg(ug(i,n,e)),r=mg(ug(i,n,t));return o!==s&&a!==r||!(0!==o||!dg(e,i,t))||!(0!==s||!dg(e,n,t))||!(0!==a||!dg(i,e,n))||!(0!==r||!dg(i,t,n))}function dg(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function mg(e){return e>0?1:e<0?-1:0}function fg(e,t){return ug(e.prev,e,e.next)<0?ug(e,t,e.next)>=0&&ug(e,e.prev,t)>=0:ug(e,t,e.prev)<0||ug(e,e.next,t)<0}function vg(e,t){var i=new bg(e.i,e.x,e.y),n=new bg(t.i,t.x,t.y),o=e.next,s=t.prev;return e.next=t,t.prev=e,i.next=o,o.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function gg(e,t,i,n){var o=new bg(e,t,i);return n?(o.next=n.next,o.prev=n,n.next.prev=o,n.next=o):(o.prev=o,o.next=o),o}function yg(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 bg(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Cg=function(){function e(){k()(this,e)}return x()(e,null,[{key:"area",value:function(e){for(var t=e.length,i=0,n=t-1,o=0;o2&&void 0!==arguments[2]?arguments[2]:2,u=t&&t.length,h=u?t[0]*c:e.length,p=Zv(e,0,h,c,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(e,t,i,n){var o,s,a,r=[];for(o=0,s=t.length;o80*c){i=o=e[0],n=s=e[1];for(var m=c;mo&&(o=a),r>s&&(s=r);l=0!==(l=Math.max(o-i,s-n))?32767/l:0}return Qv(p,d,c,i,n,l,0),d}(i,n),l=0;l2&&e[t-1].equals(e[0])&&e.pop()}function kg(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:new Xv([new bd(.5,.5),new bd(-.5,.5),new bd(-.5,-.5),new bd(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k()(this,t),(e=qp(this,t)).type="ExtrudeGeometry",e.parameters={shapes:i,options:n},i=Array.isArray(i)?i:[i];for(var o=e,s=[],a=[],r=0,l=i.length;rNumber.EPSILON){var p=Math.sqrt(u),d=Math.sqrt(l*l+c*c),m=t.x-r/p,f=t.y+a/p,v=((i.x-c/d-m)*c-(i.y+l/d-f)*l)/(a*c-r*l),g=(n=m+a*v-e.x)*n+(o=f+r*v-e.y)*o;if(g<=2)return new bd(n,o);s=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(r)===Math.sign(c)&&(y=!0),y?(n=-r,o=a,s=Math.sqrt(u)):(n=a,o=r,s=Math.sqrt(u/2))}return new bd(n/s,o/s)}for(var j=[],R=0,z=M.length,F=z-1,H=R+1;R=0;ge--){for(var ye=ge/y,be=f*Math.cos(ye*Math.PI/2),Ce=v*Math.sin(ye*Math.PI/2)+g,we=0,ke=M.length;we=0;){var n=i,o=i-1;o<0&&(o=e.length-1);for(var s=0,a=p+2*y;s0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;k()(this,t);var o=(1+Math.sqrt(5))/2;return(e=qp(this,t,[[-1,o,0,1,o,0,-1,-o,0,1,-o,0,0,-1,o,0,1,o,0,-1,-o,0,1,-o,o,0,-1,o,0,1,-o,0,-1,-o,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],i,n])).type="IcosahedronGeometry",e.parameters={radius:i,detail:n},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Vv),Eg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,t),(e=qp(this,t,[[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],i,n])).type="OctahedronGeometry",e.parameters={radius:i,detail:n},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Vv),Pg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.5,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:32,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="RingGeometry",e.parameters={innerRadius:i,outerRadius:n,thetaSegments:o,phiSegments:s,thetaStart:a,thetaLength:r},o=Math.max(3,o);for(var l=[],c=[],u=[],h=[],p=i,d=(n-i)/(s=Math.max(1,s)),m=new Wd,f=new bd,v=0;v<=s;v++){for(var g=0;g<=o;g++){var y=a+g/o*r;m.x=p*Math.cos(y),m.y=p*Math.sin(y),c.push(m.x,m.y,m.z),u.push(0,0,1),f.x=(m.x/n+1)/2,f.y=(m.y/n+1)/2,h.push(f.x,f.y)}p+=d}for(var b=0;b0&&void 0!==arguments[0]?arguments[0]:new Xv([new bd(0,.5),new bd(-.5,-.5),new bd(.5,-.5)]),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;k()(this,t),(e=qp(this,t)).type="ShapeGeometry",e.parameters={shapes:i,curveSegments:n};var o=[],s=[],a=[],r=[],l=0,c=0;if(!1===Array.isArray(i))h(i);else for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;k()(this,t),(e=qp(this,t)).type="SphereGeometry",e.parameters={radius:i,widthSegments:n,heightSegments:o,phiStart:s,phiLength:a,thetaStart:r,thetaLength:l},n=Math.max(3,Math.floor(n)),o=Math.max(2,Math.floor(o));for(var c=Math.min(r+l,Math.PI),u=0,h=[],p=new Wd,d=new Wd,m=[],f=[],v=[],g=[],y=0;y<=o;y++){var b=[],C=y/o,w=0;0===y&&0===r?w=.5/n:y===o&&c===Math.PI&&(w=-.5/n);for(var _=0;_<=n;_++){var x=_/n;p.x=-i*Math.cos(s+x*a)*Math.sin(r+C*l),p.y=i*Math.cos(r+C*l),p.z=i*Math.sin(s+x*a)*Math.sin(r+C*l),f.push(p.x,p.y,p.z),d.copy(p).normalize(),v.push(d.x,d.y,d.z),g.push(x+w,1-C),b.push(u++)}h.push(b)}for(var S=0;S0)&&m.push(P,D,T),(S!==o-1||c0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return k()(this,t),(e=qp(this,t,[[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],i,n])).type="TetrahedronGeometry",e.parameters={radius:i,detail:n},e}return wn()(t,e),x()(t,null,[{key:"fromJSON",value:function(e){return new t(e.radius,e.detail)}}])}(Vv),Og=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:12,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:48,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;k()(this,t),(e=qp(this,t)).type="TorusGeometry",e.parameters={radius:i,tube:n,radialSegments:o,tubularSegments:s,arc:a},o=Math.floor(o),s=Math.floor(s);for(var r=[],l=[],c=[],u=[],h=new Wd,p=new Wd,d=new Wd,m=0;m<=o;m++)for(var f=0;f<=s;f++){var v=f/s*a,g=m/o*Math.PI*2;p.x=(i+n*Math.cos(g))*Math.cos(v),p.y=(i+n*Math.cos(g))*Math.sin(v),p.z=n*Math.sin(g),l.push(p.x,p.y,p.z),h.x=i*Math.cos(v),h.y=i*Math.sin(v),d.subVectors(p,h).normalize(),c.push(d.x,d.y,d.z),u.push(f/s),u.push(m/o)}for(var y=1;y<=o;y++)for(var b=1;b<=s;b++){var C=(s+1)*y+b-1,w=(s+1)*(y-1)+b-1,_=(s+1)*(y-1)+b,x=(s+1)*y+b;r.push(C,w,x),r.push(w,_,x)}return e.setIndex(r),e.setAttribute("position",new Cf(l,3)),e.setAttribute("normal",new Cf(c,3)),e.setAttribute("uv",new Cf(u,2)),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}])}(Df),Ng=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:64,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:3;k()(this,t),(e=qp(this,t)).type="TorusKnotGeometry",e.parameters={radius:i,tube:n,tubularSegments:o,radialSegments:s,p:a,q:r},o=Math.floor(o),s=Math.floor(s);for(var l=[],c=[],u=[],h=[],p=new Wd,d=new Wd,m=new Wd,f=new Wd,v=new Wd,g=new Wd,y=new Wd,b=0;b<=o;++b){var C=b/o*a*Math.PI*2;N(C,a,r,i,m),N(C+.01,a,r,i,f),g.subVectors(f,m),y.addVectors(f,m),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize();for(var w=0;w<=s;++w){var _=w/s*Math.PI*2,x=-n*Math.cos(_),S=n*Math.sin(_);p.x=m.x+(x*y.x+S*v.x),p.y=m.y+(x*y.y+S*v.y),p.z=m.z+(x*y.z+S*v.z),c.push(p.x,p.y,p.z),d.subVectors(p,m).normalize(),u.push(d.x,d.y,d.z),h.push(b/o),h.push(w/s)}}for(var E=1;E<=o;E++)for(var P=1;P<=s;P++){var D=(s+1)*(E-1)+(P-1),M=(s+1)*E+(P-1),T=(s+1)*E+P,O=(s+1)*(E-1)+P;l.push(D,M,O),l.push(M,T,O)}function N(e,t,i,n,o){var s=Math.cos(e),a=Math.sin(e),r=i/t*e,l=Math.cos(r);o.x=n*(2+l)*.5*s,o.y=n*(2+l)*a*.5,o.z=n*Math.sin(r)*.5}return e.setIndex(l),e.setAttribute("position",new Cf(c,3)),e.setAttribute("normal",new Cf(u,3)),e.setAttribute("uv",new Cf(h,2)),e}return wn()(t,e),x()(t,[{key:"copy",value:function(e){return Jp(t,"copy",this,3)([e]),this.parameters=Object.assign({},e.parameters),this}}],[{key:"fromJSON",value:function(e){return new t(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}])}(Df),Bg=function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Bv(new Wd(-1,-1,0),new Wd(-1,1,0),new Wd(1,1,0)),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];k()(this,t),(e=qp(this,t)).type="TubeGeometry",e.parameters={path:i,tubularSegments:n,radius:o,radialSegments:s,closed:a};var r=i.computeFrenetFrames(n,a);e.tangents=r.tangents,e.normals=r.normals,e.binormals=r.binormals;var l=new Wd,c=new Wd,u=new bd,h=new Wd,p=[],d=[],m=[],f=[];function v(e){h=i.getPointAt(e/n,h);for(var t=r.normals[e],a=r.binormals[e],u=0;u<=s;u++){var m=u/s*Math.PI*2,f=Math.sin(m),v=-Math.cos(m);c.x=v*t.x+f*a.x,c.y=v*t.y+f*a.y,c.z=v*t.z+f*a.z,c.normalize(),d.push(c.x,c.y,c.z),l.x=h.x+o*c.x,l.y=h.y+o*c.y,l.z=h.z+o*c.z,p.push(l.x,l.y,l.z)}}return function(){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:null;if(k()(this,t),(e=qp(this,t)).type="WireframeGeometry",e.parameters={geometry:i},null!==i){var n=[],o=new Set,s=new Wd,a=new Wd;if(null!==i.index){var r=i.attributes.position,l=i.index,c=i.groups;0===c.length&&(c=[{start:0,count:l.count,materialIndex:0}]);for(var u=0,h=c.length;u=o)break e;var r=t[1];e=(o=t[--i-1]))break t}s=i,i=0}for(;i>>1;et;)--s;if(++s,0!==o||s!==n){o>=s&&(o=(s=Math.max(s,1))-1);var a=this.getValueSize();this.times=i.slice(o,s),this.values=this.values.slice(o*a,s*a)}return this}},{key:"validate",value:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var i=this.times,n=this.values,o=i.length;0===o&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var s=null,a=0;a!==o;a++){var r=i[a];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,r),e=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,r,s),e=!1;break}s=r}if(void 0!==n&&jg(n))for(var l=0,c=n.length;l!==c;++l){var u=n[l];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,u),e=!1;break}}return e}},{key:"optimize",value:function(){for(var e=this.times.slice(),t=this.values.slice(),i=this.getValueSize(),n=2302===this.getInterpolation(),o=e.length-1,s=1,a=1;a0){e[s]=e[o];for(var g=o*i,y=s*i,b=0;b!==i;++b)t[y+b]=t[g+b];++s}return s!==e.length?(this.times=e.slice(0,s),this.values=t.slice(0,s*i)):(this.times=e,this.values=t),this}},{key:"clone",value:function(){var e=this.times.slice(),t=this.values.slice(),i=new(0,this.constructor)(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}],[{key:"toJSON",value:function(e){var t,i=e.constructor;if(i.toJSON!==this.toJSON)t=i.toJSON(e);else{t={name:e.name,times:Ig(e.times,Array),values:Ig(e.values,Array)};var n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t}}])}();Vg.prototype.TimeBufferType=Float32Array,Vg.prototype.ValueBufferType=Float32Array,Vg.prototype.DefaultInterpolation=2301;var Gg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);Gg.prototype.ValueTypeName="bool",Gg.prototype.ValueBufferType=Array,Gg.prototype.DefaultInterpolation=2300,Gg.prototype.InterpolantFactoryMethodLinear=void 0,Gg.prototype.InterpolantFactoryMethodSmooth=void 0;var Wg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);Wg.prototype.ValueTypeName="color";var Ug=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);Ug.prototype.ValueTypeName="number";var Yg=function(e){function t(e,i,n,o){return k()(this,t),qp(this,t,[e,i,n,o])}return wn()(t,e),x()(t,[{key:"interpolate_",value:function(e,t,i,n){for(var o=this.resultBuffer,s=this.sampleValues,a=this.valueSize,r=(i-t)/(n-t),l=e*a,c=l+a;l!==c;l+=4)Gd.slerpFlat(o,0,s,l-a,s,l,r);return o}}])}(Rg),Jg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t,[{key:"InterpolantFactoryMethodLinear",value:function(e){return new Yg(this.times,this.values,this.getValueSize(),e)}}])}(Vg);Jg.prototype.ValueTypeName="quaternion",Jg.prototype.DefaultInterpolation=2301,Jg.prototype.InterpolantFactoryMethodSmooth=void 0;var qg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);qg.prototype.ValueTypeName="string",qg.prototype.ValueBufferType=Array,qg.prototype.DefaultInterpolation=2300,qg.prototype.InterpolantFactoryMethodLinear=void 0,qg.prototype.InterpolantFactoryMethodSmooth=void 0;var Xg=function(e){function t(){return k()(this,t),qp(this,t,arguments)}return wn()(t,e),x()(t)}(Vg);Xg.prototype.ValueTypeName="vector";var Zg=x()((function e(t,i,n){k()(this,e);var o,s=this,a=!1,r=0,l=0,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=i,this.onError=n,this.itemStart=function(e){l++,!1===a&&void 0!==s.onStart&&s.onStart(e,r,l),a=!0},this.itemEnd=function(e){r++,void 0!==s.onProgress&&s.onProgress(e,r,l),r===l&&(a=!1,void 0!==s.onLoad&&s.onLoad())},this.itemError=function(e){void 0!==s.onError&&s.onError(e)},this.resolveURL=function(e){return o?o(e):e},this.setURLModifier=function(e){return o=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){var t=c.indexOf(e);return-1!==t&&c.splice(t,2),this},this.getHandler=function(e){for(var t=0,i=c.length;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function cy(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),i=uy(this,t,[e,n]);var s="\n importScripts('".concat(i.getSourceRootPath(),"/3rdparty/turf.min.js');\n self.addEventListener('message', function (e) {\n let features = []\n eval(e.data.code);\n self.postMessage(features);\n }, false);\n "),a="data:text/javascript;charset=utf-8,"+encodeURIComponent(s);if(i._worker=new Worker(a),i.options.angle=i.options.angle||0,i.loaded=!1,i.ismove=!1,i._loadEvent=void 0,i._loaded=!1,i.options.position.lat>83.5&&(i.options.position.lat=83.5),i.options.position.lat<-83.5&&(i.options.position.lat=-83.5),i.options.show=!n.show&&!1!==n.show||n.show,i.options.scale=n.scale||{},i.options.scale.x=i.options.scale.x||0===i.options.scale.x?i.options.scale.x:1,i.options.scale.y=i.options.scale.y||0===i.options.scale.y?i.options.scale.y:1,i.options.flipe=n.flipe||{},i.options.flipe.x=i.options.flipe.x||!1,i.options.flipe.y=i.options.flipe.y||!1,i.options.attribute=n.attribute||{},i.options.attribute.link=i.options.attribute.link||{},i.options.attribute.link.content=i.options.attribute.link.content||[],i.options.attributeType=n.attributeType||"richText",n.text=n.text||{},i.options.text={value:n.text.value||"",show:!n.text.show&&!1!==n.text.show||n.text.show,position:n.text.position,fontSize:n.text.fontSize||0===n.text.fontSize?n.text.fontSize:20,color:n.text.color||"#ffffff",scaleByDistance:n.text.scaleByDistance||!1,near:n.text.near||0===n.text.near?n.text.near:2e3,far:n.text.far||0===n.text.far?n.text.far:1e5},i.options.text.position){var r=turf.point([i.options.position.lng,i.options.position.lat]),l=turf.point([i.options.text.position.lng,i.options.text.position.lat]),c=turf.distance(r,l,{units:"kilometers"}),u=turf.rhumbBearing(r,l);i._textToCenter={distance:c,angle:u}}return i.hierarchys=[],i._elms={},i.Dialog=o,i._isdrag=!1,i._EventBinding=new Ln,i.sdk.entityMap.get(i.options.id)?gn()(i):(i.sdk.addIncetance(i.options.id,i),i.picking=!0,i.options.show&&Qe(0,i.options.id),i._entityArray=[],i.init(),i)}return wn()(t,e),x()(t,[{key:"type",get:function(){return"GroundSvg"}},{key:"attributeSelect",get:function(){return[{name:"富文本",value:"富文本",key:"richText"},{name:"链接",value:"链接",key:"link"}]}},{key:"name",get:function(){return this.options.name},set:function(e){this.options.name=e,this._elms.name&&this._elms.name.forEach((function(t){t.value=e}))}},{key:"show",get:function(){return this.options.show},set:function(e){var i,n,o,s,a,r;"boolean"==typeof e?(this.options.text&&this.options.text.show&&this.text&&(this.showView&&3!=this.showView?this.text.show=!1:this.text.show=e),i=t,n="show",o=e,s=this,a=1,r=1,Lp()(bn()(r?i.prototype:i),n,o,s,a)):console.error("参数必须为boolean")}},{key:"position",get:function(){return this.options.position},set:function(e){var t=this;if(this.options.position=e,this.options.position.lat>83.5&&(this.options.position.lat=83.5),this.options.position.lat<-83.5&&(this.options.position.lat=-83.5),this._update(),this._textToCenter){var i=turf.point([this.options.position.lng,this.options.position.lat]),n=turf.destination(i,this._textToCenter.distance,this._textToCenter.angle,{units:"kilometers"}).geometry.coordinates;this.getClampToHeight({lng:n[0],lat:n[1]}).then((function(e){var i=[n[0],n[1],e];t.text&&(t.text.position=i)}))}}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;if(this.options.color=e,this.options.color)for(var i=0;i0&&0===i&&(this.options.angle=360),this._elms.angle&&this._elms.angle.forEach((function(e){e.value=t.options.angle})),this._update()}},{key:"scale",get:function(){return this.options.scale},set:function(e){this.options.scale.x=e.x,this.options.scale.y=e.y,this._elms&&(this._elms.xRange&&(this._elms.xRange.value=this.options.scale.x),this._elms.yRange&&(this._elms.yRange.value=this.options.scale.y),this._elms.xInput&&(this._elms.xInput.value=this.options.scale.x),this._elms.yInput&&(this._elms.yInput.value=this.options.scale.y)),this._update()}},{key:"flipeY",get:function(){return this.options.flipe.y},set:function(e){"boolean"==typeof e?(this.options.flipe.y=e,this._update()):console.error("参数必须为boolean")}},{key:"flipeX",get:function(){return this.options.flipe.x},set:function(e){"boolean"==typeof e?(this.options.flipe.x=e,this._update()):console.error("参数必须为boolean")}},{key:"textValue",get:function(){return this.options.text.value},set:function(e){this.options.text.value=e,this.text?this.text.text=e:t.createText(this),this._elms.textValue&&this._elms.textValue.forEach((function(t){t.value=e}))}},{key:"textShow",get:function(){return this.options.text.show},set:function(e){var t=this;this.options.text.show=e,this.show?(this.showView&&3!=this.showView?this.text&&(this.text.show=!1):this.text&&(this.text.show=e),this.options.text.position&&setTimeout((function(){t.options.text.position.alt?t.text&&(t.text.position=[t.options.text.position.lng,t.options.text.position.lat,t.options.text.position.alt]):t.getClampToHeight({lng:t.options.text.position.lng,lat:t.options.text.position.lat}).then((function(e){t.text&&(t.text.position=[t.options.text.position.lng,t.options.text.position.lat,e])}))}),0)):this.text&&(this.text.show=!1),this._elms.textShow&&this._elms.textShow.forEach((function(t){t.checked=e}))}},{key:"textColor",get:function(){return this.options.text.color},set:function(e){var t=this;this.options.text.color=e,this.text&&(this.text.color=e),this._elms.textColor&&this._elms.textColor.forEach((function(e,i){var n=new YJColorPicker({el:e.el,size:"mini",alpha:!0,defaultColor:t.textColor,disabled:!1,openPickerAni:"opacity",sure:function(e){t.textColor=e},clear:function(){t.textColor="rgba(255,255,255,1)"}});t._elms.textColor[i]=n}))}},{key:"textFontSize",get:function(){return this.options.text.fontSize},set:function(e){this.options.text.fontSize=e,this.text&&(this.text.fontSize=e,this.text.pixelOffset=e),this._elms.textFontSize&&this._elms.textFontSize.forEach((function(t){t.value=e}))}},{key:"textScaleByDistance",get:function(){return this.options.text.scaleByDistance},set:function(e){this.options.text.scaleByDistance=e,this.text&&(this.text.scaleByDistance=e),this._elms.textScaleByDistance&&this._elms.textScaleByDistance.forEach((function(t){t.checked=e}))}},{key:"textNear",get:function(){return this.options.text.near},set:function(e){var t=e;t>this.textFar&&(t=this.textFar),this.options.text.near=t,this.text&&(this.text.near=t),this._elms.textNear&&this._elms.textNear.forEach((function(e){e.value=t}))}},{key:"textFar",get:function(){return this.options.text.far},set:function(e){var t=e;t-1?t[i].style.display="block":t[i].style.display="none"}},{key:"attributeLink",get:function(){return this.options.attribute.link.content},set:function(e){var t=this;if(this.options.attribute.link.content=e,this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content&&0!=this._DialogObject._element.content.getElementsByClassName("attribute-content-link").length){var i=this._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],n=i.getElementsByClassName("table-body")[0];n.innerHTML="",this.options.attribute.link.content.length>0?i.getElementsByClassName("table-empty")[0].style.display="none":i.getElementsByClassName("table-empty")[0].style.display="flex";for(var s=0;s\n
    '+this.options.attribute.link.content[s].url+'
    \n
    \n \n \n
    \n ',l=document.createRange().createContextualFragment(r);n.appendChild(l)}for(var c,u=n.getElementsByClassName("tr"),h={linkEdit:(c=o()(a.a.mark((function e(i){var n,o,s,r,l;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.options.attribute.link.content;case 2:t.attributeLink=e.sent,n=t._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],o=n.getElementsByClassName("table-body")[0],s=o.getElementsByClassName("tr"),r=a.a.mark((function e(n){var o,r,l,c,u,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==n){e.next=36;break}o=s[n].offsetHeight,s[n].innerHTML='\n
    \n \n
    \n
    \n \n
    \n
    \n \n \n
    ',s[n].getElementsByClassName("link-edit")[0].style.height=o-10+"px",(r=s[n].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].name,r[1].getElementsByClassName("input")[0].value=t.options.attribute.link.content[i].url,l=s[n].getElementsByTagName("button"),c=0;case 11:if(!(cS[E]&&(w=S[E]),k(k=Math.abs(k))&&(k=w);var P=k,D=4e3/(k=k*(10/3)*100)/5;P*=D;for(var M=0;M=Number(e.target.min))&&(m.scale={x:t,y:m.scale.y})})),h.addEventListener("blur",(function(e){var t=e.target.value;t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t=Number(e.target.min))&&(m.scale={x:m.scale.x,y:t})})),d.addEventListener("blur",(function(e){var t=e.target.value;t=Number(t),e.target.max&&t>Number(e.target.max)&&(t=Number(e.target.max)),e.target.min&&t-360&&b<-90||b<360&&b>90)&&(b+=180,B=!0),((C=M-T)>-360&&C<-90||C<360&&C>90)&&(C+=180,A=!0),B&&A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#ff0000")):B?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=Math.abs(f)/3.5,i.scale.y=Math.abs(v)/3.5,e.abrupt("break",102);case 57:return T=(turf.rhumbBearing(E,turf.point(_[2]))+360-i.angle)%360,(C=M-T)>-360&&C<-90||C<360&&C>90?(C+=180,i.pointEntityCollection.values[2].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[8].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[2].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[8].point.color=Cesium.Color.fromCssColorString("#00ff0a")),m=Math.PI/180*C,v=Math.cos(m)*N*2,i.scale.y=v/3.5,e.abrupt("break",102);case 64:return O=(turf.rhumbBearing(E,turf.point(_[6]))+360-i.angle)%360,T=(turf.rhumbBearing(E,turf.point(_[2]))+360-i.angle)%360,((b=M-O)>-360&&b<-90||b<360&&b>90)&&(b+=180,B=!0),((C=M-T)>-360&&C<-90||C<360&&C>90)&&(C+=180,A=!0),B&&A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):B?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")):A?(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[1].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[3].point.color=Cesium.Color.fromCssColorString("#ff0000"),i.pointEntityCollection.values[7].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[9].point.color=Cesium.Color.fromCssColorString("#00ff0a")),d=Math.PI/180*b,m=Math.PI/180*C,f=Math.cos(d)*N*2,v=Math.cos(m)*N*2,i.scale.x=Math.abs(f)/3.5,i.scale.y=Math.abs(v)/3.5,e.abrupt("break",102);case 78:return O=(turf.rhumbBearing(E,turf.point(_[4]))+360-i.angle)%360,(b=M-O)>-360&&b<-90||b<360&&b>90?(b+=180,i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#ff0000")),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,e.abrupt("break",102);case 85:return u.lat>83.5&&(u.lat=83.5),u.lat<-83.5&&(u.lat=-83.5),i.position={lng:u.lng,lat:u.lat},L=u.lng-c.lng,I=u.lat-c.lat,i.bbox[0]=i.bbox[0]+L,i.bbox[1]=i.bbox[1]+I,i.bbox[2]=i.bbox[2]+L,i.bbox[3]=i.bbox[3]+I,e.abrupt("break",102);case 95:return O=(turf.rhumbBearing(E,turf.point(_[6]))+360-i.angle)%360,(b=M-O)>-360&&b<-90||b<360&&b>90?(b+=180,i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#ff0000")):(i.pointEntityCollection.values[4].point.color=Cesium.Color.fromCssColorString("#00ff0a"),i.pointEntityCollection.values[6].point.color=Cesium.Color.fromCssColorString("#ff0000")),d=Math.PI/180*b,f=Math.cos(d)*N*2,i.scale.x=f/3.5,e.abrupt("break",102);case 102:h=h/(n/2)*100,p=p/(s/2)*100,(j=ry({},i.scale)).x=j.x+h,j.y=j.y-p,j.y>200&&(j.y=200),j.y<.001&&(j.y=.001),j.x>200&&(j.x=200),j.x<.001&&(j.x=.001),i.scale=ry({},j),e.next=141;break;case 114:R=i.sdk.viewer.scene.drillPick(t.endPosition),F=0;case 116:if(!(F90&&(c+=180);var h=[c,u],p=turf.point(h),d=turf.rhumbDestination(p,o[s][r].distance,o[s][r].angle,{units:"kilometers"}),m=A()(d.geometry.coordinates);m[2]=10,a.push((l=Cesium.Cartesian3).fromDegrees.apply(l,A()(m)))}0===s?i.positions=a:n.push(a)}return i.holes=n,i}}},{key:"_updateGeojson",value:function(e,t,i){if(this._loaded){var n=Math.abs(this.bbox[0]-this.bbox[2]),o=Math.abs(this.bbox[1]-this.bbox[3]);if("object"===N()(e[0]))for(var s=0;so[2]&&(t=o[0],o[0]=o[2],o[2]=t),o[1]>o[3]&&(t=o[1],o[1]=o[3],o[3]=t);for(var c=[],u=JSON.parse(JSON.stringify(this.geojson)),h=function(t){for(var i=0;i=0;t--)this.sdk.viewer.entities.remove(this.entity.values[t]);return this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=14,Mt(this.sdk,this.options.id);case 14:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"_addLink",value:function(){this._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(this.options.attribute.link.content.push({name:"链接",url:this._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),this._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",this.attributeLink=this.options.attribute.link.content):this.Dialog.clickAddLink&&this.Dialog.clickAddLink()}},{key:"addAttributeLink",value:function(e){this.options.attribute.link.content.push({name:"链接",url:e}),this.attributeLink=this.options.attribute.link.content}},{key:"openRichTextEditor",value:function(e){var t=this;Wn.open(this.options.id,this.options.name,this.options.richTextContent),Wn.primaryCallBack=function(e){t.options.richTextContent=e}}},{key:"setPosition",value:function(e){if(e){this.ismove=!0;var t={};t.lng=e.position.lng,t.lat=e.position.lat,this.position=t}else this.ismove=!1;this._update()}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=m.length>0&&void 0!==m[0]?m[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(fi(0),oi(this.sdk),si(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=24;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),(l=ry({},this.options.position)).hasOwnProperty("alt")){e.next=17;break}return e.next=16,this.getClampToHeight(l);case 16:l.alt=e.sent;case 17:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=37;break;case 24:c=[],u=0;case 26:if(!(u=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function dy(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),i=my(this,t,[e,n]),YJ.RoutePlanningArrays.push(i),i.options.width=n.width||4,i.options.color=n.color||"#ff0000",i.options.gps=n.gps||!1,i.Dialog=o,i._elms={},i.start={lng:null,lat:null},i.end={lng:null,lat:null},i.tools=new bi(e),i.init(),i}return wn()(t,e),x()(t,[{key:"init",value:function(){var e=this;this.startEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-start"),!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity.show=!1:this.startEntity.show=!0,this.startEntity.position=new Cesium.CallbackProperty((function(){var t=e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.startLng,e.startLat));return e.clickCallBack({start:t,end:e.endEntity.position}),t}),!1),this.startEntity.billboard={image:this.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.endEntity=this.sdk.viewer.entities.getOrCreateEntity("YJ-route-planning-end"),!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity.show=!1:this.endEntity.show=!0,this.endEntity.position=new Cesium.CallbackProperty((function(){var t=e.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(e.endLng,e.endLat));return e.clickCallBack({start:e.startEntity.position,end:t}),t}),!1),this.endEntity.billboard={image:this.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32},this.edit(!0),this.clear()}},{key:"onEnd",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"startLng",get:function(){return this.start.lng},set:function(e){this.start.lng=e,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLng&&this._elms.startLng.forEach((function(t){t.value=e}))}},{key:"startLat",get:function(){return this.start.lat},set:function(e){this.start.lat=e,!this.start||!this.start.lng&&0!==this.start.lng||!this.start.lat&&0!==this.start.lat?this.startEntity&&(this.startEntity.show=!1):this.startEntity&&(this.startEntity.show=!0),this._elms.startLat&&this._elms.startLat.forEach((function(t){t.value=e}))}},{key:"endLng",get:function(){return this.end.lng},set:function(e){this.end.lng=e,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLng&&this._elms.endLng.forEach((function(t){t.value=e}))}},{key:"endLat",get:function(){return this.end.lat},set:function(e){this.end.lat=e,!this.end||!this.end.lng&&0!==this.end.lng||!this.end.lat&&0!==this.end.lat?this.endEntity&&(this.endEntity.show=!1):this.endEntity&&(this.endEntity.show=!0),this._elms.endLat&&this._elms.endLat.forEach((function(t){t.value=e}))}},{key:"edit",value:(i=o()(a.a.mark((function e(i){var n,o,s,r=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.originalOptions=this.deepCopyObj(this.options),this._element_style=null,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),i?(this._element_style=document.createElement("style"),this._element_style.type="text/css",this._element_style.setAttribute("data-name","YJ_style_dialog"),document.getElementById("routeQuery").addEventListener("click",(function(){!r.startLng&&0!==r.startLng||!r.startLat&&0!==r.startLat||!r.endLng&&0!==r.endLng||!r.endLat&&0!==r.endLat?r.tools.message({type:"warning",text:"请先设置起点和终点坐标!"}):(!r.startEntity&&(r.startEntity=r.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return r.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(r.startLng,r.startLat))}),!1),billboard:{image:r.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),r.startEntity.show=!0,!r.endEntity&&(r.endEntity=r.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return r.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(r.endLng,r.endLat))}),!1),billboard:{image:r.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),r.endEntity.show=!0,r.Dialog.queryCallBack&&r.Dialog.queryCallBack({start:[r.startLng,r.startLat],end:[r.endLng,r.endLat]}))})),document.getElementById("clearRoute").addEventListener("click",(function(){r.clear()})),document.getElementsByTagName("head")[0].appendChild(this._element_style),n=document.getElementsByClassName("RoutePlanning")[0],this.options.gps&&((o=document.createElement("button")).innerHTML="当前位置",o.style.marginLeft="10px",o.setAttribute("data-is","start"),o.addEventListener("click",(function(e){r.getLocateCurrent(e)})),n.getElementsByClassName("start-col")[0].appendChild(o),n._element.body.getElementsByClassName("end-pick-btn")[0].style.marginRight="91px"),s=n.getElementsByTagName("*"),t.EventBinding(this,s)):(this._element_style&&(document.getElementsByTagName("head")[0].removeChild(this._element_style),this._element_style=null),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"clear",value:function(){this.startEntity&&(this.sdk.viewer.entities.remove(this.startEntity),this.startEntity=null),this.endEntity&&(this.sdk.viewer.entities.remove(this.endEntity),this.endEntity=null),this.entity&&(this.sdk.viewer.entities.remove(this.entity),this.entity=null),this.startExtensionEntity&&(this.sdk.viewer.entities.remove(this.startExtensionEntity),this.startExtensionEntity=null),this.endExtensionEntity&&(this.sdk.viewer.entities.remove(this.endExtensionEntity),this.endExtensionEntity=null)}},{key:"destroy",value:function(){this.clear(),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null)}},{key:"getLocateCurrent",value:function(e){var t=this;this.reconnecting&&this.reconnecting.close(),this.options.host=this.options.host||p();var i;i=this.options.host+"/yjearth4.0/api/v1/gps/state",this.reconnecting=new ReconnectingWebSocket("ws://"+i),this.reconnecting.onopen=function(i){t.reconnecting.onmessage=function(i){t.data=JSON.parse(i.data),t.data&&t.data.rmc&&(t.reconnecting.close(),"start"===e.srcElement.getAttribute("data-is")?(t.startLng=t.data.rmc.lng,t.startLat=t.data.rmc.lat,!t.startEntity&&(t.startEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.startLng,t.startLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/start.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.startEntity.show=!0):(t.endLng=t.data.rmc.lng,t.endLat=t.data.rmc.lat,!t.endEntity&&(t.endEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.endLng,t.endLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.endEntity.show=!0))}}}},{key:"createRoute",value:function(e){for(var t=[],i=0;i=500?(t.tip&&t.tip.destroy(),t.event&&t.event.destroy()):i(0,n)}))}))}},{key:"pickEndPos",value:function(e){var t=this;this.tip&&this.tip.destroy(),this.event&&this.event.destroy(),this.tip=new Q("左键选择终点坐标,右键取消",this.sdk),this.event=new K(this.sdk),this.event.mouse_move((function(e,i){t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(i,n){var o=t.cartesian3Towgs84(n,t.sdk.viewer);t.endLng=o.lng,t.endLat=o.lat,e(o),!t.endEntity&&(t.endEntity=t.viewer.entities.add(new Cesium.Entity({position:new Cesium.CallbackProperty((function(){return t.sdk.viewer.scene.clampToHeight(new Cesium.Cartesian3.fromDegrees(t.endLng,t.endLat))}),!1),billboard:{image:t.getSourceRootPath()+"/img/end.png",verticalOrigin:Cesium.VerticalOrigin.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY,width:32,height:32}}))),t.endEntity.show=!0,t.tip&&t.tip.destroy(),t.event&&t.event.destroy()})),this.event.mouse_right((function(e,i){t.tip&&t.tip.destroy(),t.event&&t.event.destroy()}))}},{key:"flicker",value:function(){}}],[{key:"EventBinding",value:function(e,t){for(var i=function(){var i=[],o=!1,s=[];if(!t[n]||!t[n].attributes)return 1;var a,r=py(t[n].attributes);try{var l=function(){var r=a.value;switch(r.name){case"@model":o=!0,"checkbox"==t[n].type?(i.push((function(t){e[r.value]=t.target.checked})),t[n].checked=e[r.value]):(i.push((function(t){var i=t.target.value;"number"==t.target.type?"."==t.data||"-"==t.data&&!t.target.value||(i=Number(i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i
    ').concat(s[t].properties.fid,"
    ")),s[t].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='
    ').concat(s[t].properties[o],"
    "));e+=i=i+n+""}return e},e.next=8,new J(t.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return fy=e.sent,e.next=11,fy.init();case 11:for(y in l=A()(t.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'',h='
    ',p='
    ',d="",m='',f='
    ',v="",g=1,"fid"in t.geojson.features[0].properties&&(d+=''),v+=''),m+=''),g++),t.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+=''),v+=''),m+='"),g++);'
    暂无数据
    ',h=h+(p=p+(d+='')+(m+="")+"
    fid
    ').concat(y,"
    ")+(f=f+(v+="")+(""+c+"")+'
    暂无数据
    ')+"",u.innerHTML=''+h+'',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",fy.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(e){C.scrollLeft=e.target.scrollLeft})),fy._element.title.style.height="40px",fy._element.body.style.width="65%",fy._element.body.style.height="80%",fy._element.content.style.height="calc(100% - 40px)",fy._element.content.style.overflow="hidden",fy._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),Un(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(e){n=e,s=l.slice(o*(n-1),o*n);var t=r();u.getElementsByTagName("tbody")[0].innerHTML=t,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var e=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c
    ').concat(n[t].properties.fid,"
    ")),n[t].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='
    ').concat(n[t].properties[s],"
    "));e+=i=i+o+""}return e},s=!1,r=0;case 5:if(!(r',h='
    ',p="",d='',m='
    ',f="",v=1,"fid"in t.geojson.features[0].properties&&(p+=''),f+=''),d+=''),v++),t.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(p+=''),f+=''),d+='"),v++);if(y='\n \n \n '.concat((u=u+(h=h+(p+='')+(d+="")+"
    fid
    ').concat(g,"
    ")+(m=m+(f+="")+(""+l+"")+"")+"")+'',"\n \n "),n[0].content&&n[0].content.richTextContent&&(b='\n \n '.concat(n[0].content.richTextContent,"\n \n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C\n \n \n '),y+=k;for(y+="",c.innerHTML=y,by.contentAppChild(c),new In("shp-list-id-tabs"),(_=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",_.style.display="flex",_.style.flexDirection="column",_.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",x=_.getElementsByClassName("DIV-cy-tab-content-pane"),S=0;S=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function _y(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Ey(this,t,[e,n])).viewer=e.viewer,i.options.path?(i.options.fileName=n.fileName||"未命名对象",i.options.field=n.field||"id",i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i):(i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),gn()(i))}return wn()(t,e),x()(t,[{key:"show",get:function(){return this.options.show},set:function(e){this.setShow(e)}},{key:"on",value:function(){if(this.options.path)return this.init()}},{key:"init",value:(r=o()(a.a.mark((function e(){var i,n,o;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i="",this.options.host=this.options.host||p(),i=this.options.host.endsWith("yjearth4.0")?this.options.host+"/api/v1/vector/load":this.options.host+"/yjearth4.0/api/v1/vector/load",i+="?path="+this.options.path,e.next=6,fetch(i,{method:"get",headers:{"Content-Type":"application/json",token:m(),Authorization:"Bearer "+m()}});case 6:if(200!==(n=e.sent).status){e.next=19;break}return e.next=10,n.json();case 10:if(200!==(o=e.sent).code&&0!==o.code){e.next=18;break}return this.data=o.data,e.next=15,this.formatData();case 15:return e.abrupt("return",t.create(this));case 18:return e.abrupt("return",console.error(o.message));case 19:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"formatData",value:(s=o()(a.a.mark((function e(){var t,i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){if(e.data){var o;(o=i.list).push.apply(o,A()(e.data));for(var s=0;s0&&void 0!==p[0]&&p[0],i=p.length>1&&void 0!==p[1]?p[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=25;break}return e.next=7,new _n(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){h.fileName=h.fileName.trim(),h.fileName||(h.fileName="未命名对象"),h.originalOptions.fileName=h.fileName,h.originalOptions.field=h.field,h._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:h.options.id,fileName:h.originalOptions.fileName,field:h.originalOptions.field})},closeCallBack:function(){h.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:for(c in this._DialogObject=e.sent,n='\n
    \n
    \n 文件名称:\n \n
    \n
    \n
    \n
    \n 名称字段选择:\n \n
    \n
    \n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.fileName,s.addEventListener("input",(function(){h.options.fileName=s.value})),r=o.getElementsByClassName("input-select")[0],l="",this.geojson.features[0].properties)u='"),l+=u;r.innerHTML=l,r.value=this.options.field,r.addEventListener("input",(function(){h.options.field=r.value})),this._elms.fileName=s,this._elms.field=r,e.next=26;break;case 25:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 26:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"editById",value:(i=o()(a.a.mark((function e(){var t,i,n,s,r,l,c,u,h,p,d,m,f,v,g,y,b=this,C=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.length>0&&void 0!==C[0]&&C[0],i=C.length>1?C[1]:void 0,n=C.length>2&&void 0!==C[2]?C[2]:{},this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),s="",!t){e.next=48;break}l={},c=0;case 8:if(!(c\n
    \n 内容类型:\n \n
    \n \n \n
    \n 编辑内容:\n
    \n \n
    \n
    \n
    \n 编辑内容:\n \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    操作
    \n
    设备名称
    \n
    设备类型
    \n
    设备IP
    \n
    设备端口
    \n
    用户名
    \n
    密码
    \n
    \n
    \n \n
    \n
    \n

    暂无数据

    \n
    \n
    \n
    \n
    \n
      \n
      \n
      \n ',(h=document.createElement("div")).innerHTML=u,this._DialogObject.contentAppChild(h),h.getElementsByTagName("*"),this._DialogObject._element.body.style.width="600px",p=h.getElementsByClassName("attribute-select")[0],d=h.getElementsByClassName("link_add_btn")[0],m=h.getElementsByClassName("open-richText-btn")[0],f=this._DialogObject._element.content.getElementsByClassName("attribute-content"),v=0;v-1?f[v].style.display="block":f[v].style.display="none";p.addEventListener("change",(function(){b._DialogObject.attribute.attributeType=p.value;for(var e=0;e-1?f[e].style.display="block":f[e].style.display="none"})),d.addEventListener("click",o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value?(b._DialogObject.attribute.link.content.push({name:"链接",url:b._DialogObject._element.content.getElementsByClassName("link_add")[0].value}),b._DialogObject._element.content.getElementsByClassName("link_add")[0].value="",b.setAttributeLinkById(i,b._DialogObject.attribute.link.content)):n.clickAddLink&&n.clickAddLink(i);case 1:case"end":return e.stop()}}),e)})))),m.addEventListener("click",(function(){Wn.open(i,i,b._DialogObject.attribute.richTextContent),Wn.primaryCallBack=function(e){b._DialogObject.attribute.richTextContent=e}})),g=h.getElementsByClassName("camera-name")[0],y=h.getElementsByClassName("camera-select")[0],g.addEventListener("input",(function(){s=g.value})),this.cameraSelect&&this.cameraSelect(s),y.addEventListener("click",(function(){b.cameraSelect&&b.cameraSelect(s)})),e.next=49;break;case 48:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 49:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"editContentById",value:function(e,t){for(var i=0;i0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l\n
      '+this._DialogObject.attribute.link.content[l].url+'
      \n
      \n \n \n
      \n ',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var h=r.getElementsByClassName("tr"),p={linkEdit:(i=o()(a.a.mark((function t(i){var o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.setAttributeLinkById(e,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function e(t){var o,s,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==t){e.next=33;break}r[t].innerHTML='\n
      \n \n
      \n
      \n
      \n \n \n
      \n
      \n
      \n \n \n
      ',(o=r[t].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[t].getElementsByTagName("button"),l=0;case 8:if(!(l1&&void 0!==arguments[1]?arguments[1]:{};if(e){for(var i=0;i0){Un(o,t.data.total,10,1,(function(t){i.cameraSelect&&i.cameraSelect(e,t)})),s.getElementsByClassName("table-empty")[0].style.display="none",a.style.display="inline-flex";for(var r=function(e){var o='\n
      \n
      \n \n 绑定\n
      \n
      ').concat(t.data.list[e].cameraName,'
      \n
      ').concat(n[t.data.list[e].type],'
      \n
      ').concat(t.data.list[e].ip,'
      \n
      ').concat(t.data.list[e].port,'
      \n
      ').concat(t.data.list[e].userName,'
      \n
      ').concat(t.data.list[e].passWord,"
      \n
      "),s=document.createRange().createContextualFragment(o),r=s.querySelector('input[type="checkbox"]');r.addEventListener("change",(function(){if(r.checked)i._DialogObject.attribute.camera.push(t.data.list[e]);else{var n=i._DialogObject.attribute.camera.filter((function(i){return i.ID!==t.data.list[e].ID}));i._DialogObject.attribute.camera=n}})),a.appendChild(s);for(var l=0;l0){var l=turf.featureCollection(i),c=turf.envelope(l);c&&c.bbox&&4==c.bbox.length&&(e.range={max_x:c.bbox[2],max_y:c.bbox[3],min_x:c.bbox[0],min_y:c.bbox[1]})}}},{key:"createPoints",value:function(e,t){if(t){for(var i=new Cesium.PointPrimitiveCollection({scene:e.viewer.scene}),n=0;n0&&e.entity.add(new Cesium.GroundPolylinePrimitive({geometryInstances:i,appearance:new Cesium.PolylineColorAppearance}))}}},{key:"createPolygons",value:function(e,t){if(t){for(var i=[],n=0;n0){var c=new Cesium.GroundPrimitive({geometryInstances:i,appearance:new Cesium.PerInstanceColorAppearance({translucent:!0,closed:!1})});e.entity.add(c)}}}},{key:"createTableContent",value:function(e){for(var t="",i=0;i
      ').concat(e.currentData[i].attr[s],"
      ");t+=n=n+o+""}return t}}]);var i,n,s,r}($n);function My(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Ty(e){for(var t=1;t
      ').concat(s[t].properties.fid,"
      ")),s[t].properties)"id"!==o&&"ID"!==o&&"fid"!==o&&(n+='
      ').concat(s[t].properties[o],"
      "));e+=i=i+n+""}return e},e.next=8,new J(t.viewer._container,{title:"",left:"17%",top:"100px"});case 8:return Py=e.sent,e.next=11,Py.init();case 11:for(y in l=A()(t.geojson.features),i=l.length,s=l.slice(o*(n-1),o*n),c=r(),(u=document.createElement("div")).style.height="100%",'',h='
      ',p='
      ',d="",m='',f='
      ',v="",g=1,"fid"in t.geojson.features[0].properties&&(d+=''),v+=''),m+=''),g++),t.geojson.features[0].properties)"id"!==y&&"ID"!==y&&"fid"!==y&&(d+=''),v+=''),m+='"),g++);'
      暂无数据
      ',h=h+(p=p+(d+='')+(m+="")+"
      fid
      ').concat(y,"
      ")+(f=f+(v+="")+(""+c+"")+'
      暂无数据
      ')+"",u.innerHTML=''+h+'',b=u.getElementsByClassName("el-table__empty-block")[0],0==s.length?b.style.display="flex":b.style.display="none",Py.contentAppChild(u),C=u.getElementsByClassName("el-table__header-wrapper")[0],(w=u.getElementsByClassName("el-table__body-wrapper")[0]).addEventListener("scroll",(function(e){C.scrollLeft=e.target.scrollLeft})),Py._element.title.style.height="40px",Py._element.body.style.width="65%",Py._element.body.style.height="80%",Py._element.content.style.height="calc(100% - 40px)",Py._element.content.style.overflow="hidden",Py._element.foot.style.display="none",w.style.height="calc(100% - ".concat(C.offsetHeight,"px)"),Un(k=u.getElementsByClassName("pagination")[0],i,o,n,(function(e){n=e,s=l.slice(o*(n-1),o*n);var t=r();u.getElementsByTagName("tbody")[0].innerHTML=t,0==s.length?b.style.display="flex":b.style.display="none"})),_=function(){for(var e=u.getElementsByClassName("search-box")[0].getElementsByTagName("input")[0],a=[],c=0;c
      ').concat(n[t].properties.fid,"
      ")),n[t].properties)"id"!==s&&"ID"!==s&&"fid"!==s&&(o+='
      ').concat(n[t].properties[s],"
      "));e+=i=i+o+""}return e},s=!1,r=0;case 5:if(!(r',h='
      ',p="",d='',m='
      ',f="",v=1,"fid"in t.geojson.features[0].properties&&(p+=''),f+=''),d+=''),v++),t.geojson.features[0].properties)"id"!==g&&"ID"!==g&&"fid"!==g&&(p+=''),f+=''),d+='"),v++);if(y='\n \n \n '.concat((u=u+(h=h+(p+='')+(d+="")+"
      fid
      ').concat(g,"
      ")+(m=m+(f+="")+(""+l+"")+"")+"")+'',"\n \n "),n[0].content&&n[0].content.richTextContent&&(b='\n \n '.concat(n[0].content.richTextContent,"\n \n "),y+=b),n[0].content&&n[0].content.link&&n[0].content.link.content&&n[0].content.link.content.length>0)for(C=0;C\n \n \n '),y+=k;for(y+="",c.innerHTML=y,Oy.contentAppChild(c),new In("shp-list-id-tabs"),(_=c.getElementsByClassName("DIV-cy-tabs")[0]).style.height="100%",_.style.display="flex",_.style.flexDirection="column",_.getElementsByClassName("DIV-cy-tab-content")[0].style.flex="1",x=_.getElementsByClassName("DIV-cy-tab-content-pane"),S=0;S=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ly(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(k()(this,t),zy(i=Ry(this,t,[e,n]),Wy,void 0),zy(i,Uy,!1),zy(i,Yy,[]),i.viewer=e.viewer,!i.options.path)return i.error="未提供路径!",window.ELEMENT&&(window.ELEMENT.Message.closeAll(),window.ELEMENT.Message({message:i.error,type:"warning",duration:1500})),console.warn(i.error),gn()(i);for(var s in i.colors=Gy,i.options.headTables=n.headTables||[],i.options.name=n.name||"未命名对象",i.options.path.endsWith(".kml")||(i.options.color=n.color||"rgba(0,255,184,0.5)",i.options.opacity=n.opacity||0===n.opacity?n.opacity:1),i.options.show=!n.show&&!1!==n.show||n.show,i.total=0,i.page=1,i.pageSize=20,i.currentData=[],i.data=[],i.list=[],i.imgEntity=[],i.Dialog=o,i._elms={},i.sdk.addIncetance(i.options.id,i),i.disaster_type_colors=Gy[i.options.disaster_type]?jy({},Gy[i.options.disaster_type]):void 0,i.disaster_type_colors)i.disaster_type_colors[s]=i.cmykToRgb(i.disaster_type_colors[s]);return i}return wn()(t,e),x()(t,[{key:"type",get:function(){return"vector"}},{key:"show",get:function(){return this.options.show},set:function(e){this.setShow(e)}},{key:"opacity",get:function(){return this.options.opacity},set:function(e){this.options.opacity=e,this.entity&&this.entity.entities.values.forEach((function(t){t.point&&(t.point.color=t.point.color._value.withAlpha(e)),t.polygon&&(t.polygon.material=t.polygon.material.color._value.withAlpha(e)),t.polyline&&(t.polyline.material=t.polyline.material.color._value.withAlpha(e))}))}},{key:"on",value:function(){if(this.sdk&&this.viewer&&this.options.path)return this.init()}},{key:"init",value:(l=o()(a.a.mark((function e(){var i=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=o()(a.a.mark((function e(n,o){var s,r,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.options.host=i.options.host||p(),s=i.options.host+"/gdal/import",(r=new FormData).append("path",i.options.path),e.next=7,fetch(s,{method:"post",headers:{Authorization:m()},body:r});case 7:if(l=e.sent,console.log("response",l),200!==l.status){e.next=21;break}return e.next=12,l.arrayBuffer();case 12:return c=e.sent,u=new Uint8Array(c),h=i.decompressGzip(u),0===i.data.length&&(i.data=JSON.parse(h)),console.log("this.data",i.data),e.next=19,i.formatData();case 19:t.create(i),n();case 21:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(){return l.apply(this,arguments)})},{key:"formatData",value:(r=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=[],i=function(e,t,n){if(e)if(Array.isArray(e)){for(var o=!1,s=0;s0&&void 0!==w[0]&&w[0],i=w.length>1&&void 0!==w[1]?w[1]:{},this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=74;break}return e.next=7,new _n(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){C.name=C.name.trim(),C.name||(C.name="未命名对象"),C.originalOptions.name=C.name,C.originalOptions.field=C.field,C._DialogObject.close(),i.confirmCallBack&&i.confirmCallBack({id:C.options.id,name:C.originalOptions.name,field:C.originalOptions.field})},closeCallBack:function(){C.reset(),i.closeCallBack&&i.closeCallBack()}});case 7:this._DialogObject=e.sent,n='\n
      \n
      \n 文件名称:\n \n
      \n
      \n
      \n
      \n 名称字段选择:\n
      \n
      \n
      \n ',(o=document.createElement("div")).innerHTML=n,this._DialogObject.contentAppChild(o),(s=o.getElementsByClassName("flie-name")[0]).value=this.options.name,s.addEventListener("input",(function(){C.options.name=s.value})),r=[],e.t0=a.a.keys(this.geojson.features[0].properties);case 17:if((e.t1=e.t0()).done){e.next=31;break}l=e.t1.value,c=l,u=0;case 21:if(!(u').concat(g,""),f+=b,e.next=52;break;case 67:m.innerHTML=f,m.value=this.options.field,m.addEventListener("input",(function(){C.options.field=m.value})),this._elms.name=s,this._elms.field=m,e.next=75;break;case 74:this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null);case 75:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"editContentById",value:function(e,t){for(var i=0;i0?s.getElementsByClassName("table-empty")[0].style.display="none":s.getElementsByClassName("table-empty")[0].style.display="flex";for(var l=0;l\n
      '+this._DialogObject.attribute.link.content[l].url+'
      \n
      \n \n \n
      \n ',u=document.createRange().createContextualFragment(c);r.appendChild(u)}for(var h=r.getElementsByClassName("tr"),p={linkEdit:(i=o()(a.a.mark((function t(i){var o,s,r,l,c;return a.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.setAttributeLinkById(e,n._DialogObject.attribute.link.content);case 2:o=n._DialogObject._element.content.getElementsByClassName("attribute-content-link")[1].getElementsByClassName("table")[0],s=o.getElementsByClassName("table-body")[0],r=s.getElementsByClassName("tr"),l=a.a.mark((function e(t){var o,s,l,c,u,h;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i!==t){e.next=33;break}r[t].innerHTML='\n
      \n \n
      \n
      \n
      \n \n \n
      \n
      \n
      \n \n \n
      ',(o=r[t].getElementsByClassName("td"))[0].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].name,o[1].getElementsByClassName("input")[0].value=n._DialogObject.attribute.link.content[i].url,s=r[t].getElementsByTagName("button"),l=0;case 8:if(!(l1&&void 0!==m[1]?m[1]:{},fi(0),oi(this.sdk),si(this.sdk),!t){e.next=14;break}n=a.a.mark((function e(n){var o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:d.geojson.features[n].id===t&&("Point"===d.geojson.features[n].geometry.type?d.getClampToHeight({lng:d.geojson.features[n].geometry.coordinates[0],lat:d.geojson.features[n].geometry.coordinates[1]}).then((function(e){d.sdk.viewer.camera.flyTo({orientation:i.orientation,destination:Cesium.Cartesian3.fromDegrees(d.geojson.features[n].geometry.coordinates[0],d.geojson.features[n].geometry.coordinates[1],e+(i.height||500))})})):(o=d.geojson.features[n].geometry.range)&&(s=[],d.getClampToHeight({lng:o[0],lat:o[1]}).then((function(e){var t=Cesium.Cartesian3.fromDegrees(o[0],o[1],e);s.push(t.x,t.y,t.z),d.getClampToHeight({lng:o[2],lat:o[3]}).then((function(e){var t=Cesium.Cartesian3.fromDegrees(o[2],o[3],e);s.push(t.x,t.y,t.z);var n=Cesium.BoundingSphere.fromVertices(s);d.sdk.viewer.camera.flyToBoundingSphere(n,{offset:i.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-90),roll:Cesium.Math.toRadians(0)}})}))}))));case 1:case"end":return e.stop()}}),e)})),o=0;case 7:if(!(oo&&(o=l),s+=16}s=s+10+5*(n.length-1),o+=30,t.width=o,t.height=s;var c=i.createLinearGradient(0,0,o,s);return i.fillStyle=c,i.fillRect(0,0,o,s),i.fillStyle="#ffffff",i.font="16px YaHei",i.strokeStyle="#000000",i.strokeText(n,15,16*n.length+6.25+5*n.length),i.fillText(n,15,16*n.length+6.25+n.length-5),i.moveTo(o/2,s),i.stroke(),i.closePath(),t.toDataURL()}},{key:"createTableContent",value:function(e){for(var t="",i=0;i
      ').concat(e.currentData[i].attr[s],"
      ");t+=n=n+o+""}return t}}]);var i,n,s,r,l}($n);function qy(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Xy(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),(i=Zy(this,t,[e,n])).options.text=n.text||"未命名对象";for(var s=i.options.text.split("\n"),a=0;a80&&(s[a]=s[a].slice(0,80-s[a].length));if(s.length>70&&s.splice(70-s.length),i.options.text=s.join("\n"),i.options.show=!n.show&&!1!==n.show||n.show,i.options.angle=n.angle||0,i.options.scale=n.scale||0===n.scale?n.scale:1,i.options.speed=n.speed||0===n.speed?n.speed:1,i.options.color=n.color||"#FFC107",i.options.position=n.position,delete i.options.name,!i.options.position&&i.options.positions){var r=function(e,t){var i=t[0]-e[0],n=t[1]-e[1];return Math.atan2(n,i)};i.options.position={lng:(i.options.positions[0].lng+i.options.positions[1].lng)/2,lat:(i.options.positions[0].lat+i.options.positions[1].lat)/2};var l=turf.point([i.options.positions[0].lng,i.options.positions[0].lat]),c=turf.point([i.options.positions[1].lng,i.options.positions[1].lat]),u={units:"miles"},h=turf.rhumbDistance(l,c,u),p=r([i.options.positions[0].lng,i.options.positions[0].lat],[i.options.positions[1].lng,i.options.positions[1].lat]);i.options.angle=(360+Cesium.Math.toDegrees(p))%360;var d=1e-4*Math.abs(Math.cos(Math.PI/180*i.options.position.lat)),m=i.getcanvas(),f=m.height/m.width,v=i.options.position.lng-1e-4/f,g=i.options.position.lat-d,y=i.options.position.lng+1e-4/f,b=i.options.position.lat+d,C=(g+b)/2,w=turf.point([v,C]),_=turf.point([y,C]),x=turf.rhumbDistance(w,_,u),S=Cesium.Math.toRadians(i.options.position.lat);x*=1+Math.abs(Math.sin(p)*Math.tan(S)*Math.sin(S)*Math.sin(S)),i.options.scale=h/x}return i.duration=5e4,i.entity,i._positionEditing=!1,i.Dialog=o,i._EventBinding=new Ln,i._elms={},i.previous={position:Xy({},i.options.position)},i.event=new K(i.sdk),i.sdk.addIncetance(i.options.id,i),i.create(),i}return wn()(t,e),x()(t,[{key:"lng",get:function(){return this.options.position.lng},set:function(e){this.options.position.lng=e,this._elms.lng&&this._elms.lng.forEach((function(t){t.value=e}))}},{key:"lat",get:function(){return this.options.position.lat},set:function(e){this.options.position.lat=e,this._elms.lat&&this._elms.lat.forEach((function(t){t.value=e}))}},{key:"name",get:function(){}},{key:"text",get:function(){return this.options.text},set:function(e){var t=this;this.options.text=e;for(var i=this.options.text.split("\n"),n=0;n80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),i[n]=i[n].slice(0,80-i[n].length)}if(i.length>70){i.splice(70-i.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=i.join("\n"),this.entity){var o=this.getcanvas(),s=o.height/o.width;this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:o.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this.entity.rectangle.coordinates=new Cesium.CallbackProperty((function(){var e,i=Math.abs(Math.cos(Math.PI/180*t.options.position.lat))*(1e-4*t.options.scale),n=[t.options.position.lng-1e-4*t.options.scale/s,t.options.position.lat-i,t.options.position.lng+1e-4*t.options.scale/s,t.options.position.lat+i];return(e=Cesium.Rectangle).fromDegrees.apply(e,n)}),!1)}this._elms.text&&this._elms.text.forEach((function(e){e.value=t.options.text}))}},{key:"angle",get:function(){return this.options.angle},set:function(e){this.options.angle=Number(e),this._elms.angle&&this._elms.angle.forEach((function(t){t.value=e}))}},{key:"scale",get:function(){return this.options.scale},set:function(e){this.options.scale=Number(e),this._elms.scale&&this._elms.scale.forEach((function(t){t.value=e}))}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=Number(e);var t=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:t.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e}))}},{key:"color",get:function(){return this.options.color},set:function(e){var t=this;this.options.color=e;var i=this.getcanvas();this.entity.rectangle.material=new Cesium.CustomMaterialSource({image:i.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),this._elms.color&&this._elms.color.forEach((function(i,n){var o=new YJColorPicker({el:i.el,size:"mini",alpha:!0,defaultColor:e,disabled:!1,openPickerAni:"opacity",sure:function(e){t.color=e},clear:function(){t.color="rgba(255,255,255,1)"}});t._elms.color[n]=o}))}},{key:"create",value:function(){var e=this,t=this.getcanvas(),i=t.height/t.width;this.entity=this.sdk.viewer.entities.add({id:this.options.id,show:this.options.show,rectangle:{coordinates:new Cesium.CallbackProperty((function(){var t,n=Math.abs(Math.cos(Math.PI/180*e.options.position.lat))*(1e-4*e.options.scale),o=[e.options.position.lng-1e-4*e.options.scale/i,e.options.position.lat-n,e.options.position.lng+1e-4*e.options.scale/i,e.options.position.lat+n];return(t=Cesium.Rectangle).fromDegrees.apply(t,o)}),!1),material:new Cesium.CustomMaterialSource({image:t.toDataURL("image/png"),color:this.options.color,repeat:new Cesium.Cartesian2(1,1),duration:this.duration/this.options.speed,fltr:!1,is2D:this.sdk.viewer.scene.mode===Cesium.SceneMode.SCENE2D}),rotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(e.options.angle)}),!1),stRotation:new Cesium.CallbackProperty((function(){return Cesium.Math.toRadians(e.options.angle)}),!1)}}),"cesium-viewer 2d"===this.sdk.viewer._element.className&&(this.entity.rectangle.height=10),Mt(this.sdk,this.options.id),this.options.show&&Qe(0,this.options.id)}},{key:"edit",value:(s=o()(a.a.mark((function e(t){var i,n,o,s=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=18;break}return e.next=6,new _n(this.sdk,this.originalOptions,{title:"贴地文字属性",left:"180px",top:"100px",confirmCallBack:function(e){s.text=s.text.trim(),s.text||(s.text="未命名对象"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Mt(s.sdk,s.options.id),at(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.positionEditing=!1,s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(e){s.show=e,s.Dialog.showCallBack&&s.Dialog.showCallBack()},translationalCallBack:function(){s.positionEditing=!s.positionEditing}},!0);case 6:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" ground-text",(i=document.createElement("div")).innerHTML='\n \n
      \n
      \n
      \n 名称\n \n
      \n
      \n 颜色\n
      \n
      \n
      \n
      \n \n
      \n
      \n
      \n 经度\n \n
      \n
      \n 纬度\n \n
      \n
      \n
      \n \n
      \n
      \n
      \n 旋转角度\n \n
      \n \n °\n \n
      \n
      \n
      \n
      \n
      \n 调整大小\n \n
      \n \n \n
      \n
      \n
      \n
      \n
      \n 滚动速度\n \n
      \n \n \n
      \n
      \n
      \n
      \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,o=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),this._elms.color=[o],e.next=19;break;case 18:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"positionEditing",get:function(){return this._positionEditing},set:function(e){var t=this;this.sdk&&this.sdk.viewer&&this.entity&&(this._positionEditing=e,this.previous={position:Xy({},this.options.position)},!0===e?(this.tip&&this.tip.destroy(),this.tip=new Q("点击鼠标左键确认,右键取消",this.sdk),this.event.mouse_move((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.tip.setPosition(i,e.endPosition.x,e.endPosition.y)})),this.event.mouse_left((function(e,i){var n=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=n.lng,t.lat=n.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1})),this.event.mouse_right((function(e,i){t.lng=t.previous.position.lng,t.lat=t.previous.position.lat,t.positionEditing=!1})),this.event.gesture_pinck_start((function(e,i){var n=new Date;t.event.gesture_pinck_end((function(){if(new Date-n>=500)t.lng=t.previous.position.lng,t.lat=t.previous.position.lat,t.positionEditing=!1;else{var e=t.cartesian3Towgs84(i,t.sdk.viewer);t.lng=e.lng,t.lat=e.lat,t.event.mouse_move((function(){})),t.event.mouse_left((function(){})),t.event.mouse_right((function(){})),t.event.gesture_pinck_start((function(){})),t.event.gesture_pinck_end((function(){})),t.positionEditing=!1}}))}))):(this._positionEditingCallback&&(this._positionEditingCallback(),this._positionEditingCallback=null),this.event&&(this.event.mouse_move((function(){})),this.event.mouse_left((function(){})),this.event.mouse_right((function(){})),this.event.gesture_pinck_start((function(){})),this.event.gesture_pinck_end((function(){}))),this.tip&&this.tip.destroy()))}},{key:"openPositionEditing",value:function(e){this.positionEditing=!0,this._positionEditingCallback=e}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d,m,f,v,g,y,b=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=b.length>0&&void 0!==b[0]?b[0]:{},i=this.getcanvas(),n=i.height/i.width,fi(0),oi(this.sdk),si(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(o={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},s=this.options.customView.relativePosition.lng,r=this.options.customView.relativePosition.lat,l=this.options.customView.relativePosition.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),u={lng:0,lat:0},this.options.position?u=Xy({},this.options.position):this.options.positions?u=Xy({},this.options.positions[0]):this.options.center?u=Xy({},this.options.center):this.options.start?u=Xy({},this.options.start):(this.options.hasOwnProperty("lng")&&(u.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(u.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(u.alt=this.options.alt)),u.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(u);case 17:u.alt=e.sent;case 18:s=this.options.customView.relativePosition.lng+u.lng,r=this.options.customView.relativePosition.lat+u.lat,l=this.options.customView.relativePosition.alt+u.alt,c=Cesium.Cartesian3.fromDegrees(s,r,l),this.sdk.viewer.camera.flyTo({destination:c,orientation:o}),e.next=34;break;case 25:return h=Math.abs(Math.cos(Math.PI/180*this.options.position.lat))*(1e-4*this.options.scale),p=[[this.options.position.lng-1e-4*this.options.scale/n,this.options.position.lat-h],[this.options.position.lng+1e-4*this.options.scale/n,this.options.position.lat+h]],e.next=29,this.getClampToHeight(this.options.position);case 29:for(d=e.sent,m=[],f=0;f80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s2&&void 0!==arguments[2]?arguments[2]:{};k()(this,t),(n=Qy(this,t,[e,i])).options.text=i.text||"未命名对象";for(var s=n.options.text.split("\n"),a=0;a80&&(s[a]=s[a].slice(0,80-s[a].length));return s.length>70&&s.splice(70-s.length),n.options.text=s.join("\n"),n.options.color=i.color||"#FFC107",n.options.positions=i.positions,n.options.speed=i.speed||0===i.speed?i.speed:1,n.options.show=!i.show&&!1!==i.show||i.show,n.nodePoints=[],n.entity,delete n.options.name,n.extrudedHeight,n._EventBinding=new Ln,n.Dialog=o,n._elms={},n.sdk.addIncetance(n.options.id,n),t.create(n),n}return wn()(t,e),x()(t,[{key:"name",get:function(){}},{key:"text",get:function(){return this.options.text},set:function(e){this.options.text=e;for(var t=this.options.text.split("\n"),i=0;i80){window.ELEMENT&&window.ELEMENT.Message({message:"行超过80个字符,请按回车(Enter)后,继续输入",type:"warning",duration:1e3}),t[i]=t[i].slice(0,80-t[i].length)}if(t.length>70){t.splice(70-t.length);window.ELEMENT&&window.ELEMENT.Message({message:"超过最大输入字符",type:"warning",duration:1e3})}if(this.options.text=t.join("\n"),this.entity){for(var n=this.options.positions,o=[],s=[],a=[],r=this.getMaterial(),l=this.computeDistance2(n),c=this.aspectRatio?l/this.aspectRatio:0,u=0;u\n
      \n
      \n
      \n 名称\n \n
      \n
      \n 颜色\n
      \n
      \n
      \n
      \n \n
      \n
      \n
      \n 滚动速度\n \n \n
      \n
      \n
      \n \n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],e.next=19;break;case 18:this._DialogObject&&this._DialogObject.remove&&(this._DialogObject.remove(),this._DialogObject=null);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"reset",value:function(){if(this.entity){this.options=this.deepCopyObj(this.originalOptions),this.text=this.originalOptions.text,this.color=this.originalOptions.color,this.speed=this.originalOptions.speed;for(var e=this.options.positions,t=[],i=[],n=[],o=this.computeDistance2(e),s=this.aspectRatio?o/this.aspectRatio:0,a=0;a80&&(i[n]=i[n].slice(0,80-i[n].length));i.length>70&&i.splice(70-i.length),this.options.text=i.join("\n");for(var o=0,s=0;s0&&void 0!==arguments[0]?arguments[0]:function(){};if(YJ.Measure.GetMeasureStatus())t("上一次测量未结束");else{var i,n;YJ.Measure.SetMeasureStatus(!0),this._nodeEditCallback=t,this.tip=new Q("请选择一个顶点,右键取消",this.sdk),this.event=new K(this.sdk),this.nodePoints=[];for(var o=this.options.positions,s=[],a=[],r=[],l=this.computeDistance2(o),c=this.aspectRatio?l/this.aspectRatio:0,u=0;u=500?d(o,i):p(o,i)}))}));for(var m=0;m2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(n=ib(this,t)).sdk=e,n.viwer=e.viewer,n.options=tb({},i),n.options.host=i.host||p(),n.options.name=i.name||"未命名对象",n.options.show=!i.show&&!1!==i.show||i.show,"number"==typeof i.scale?(n.options.scale={},n.options.scale.x=i.scale,n.options.scale.y=i.scale,n.options.scale.z=i.scale):(n.options.scale=i.scale||{},n.options.scale.x=n.options.scale.x||0===n.options.scale.x?n.options.scale.x:1,n.options.scale.y=n.options.scale.y||0===n.options.scale.y?n.options.scale.y:1,n.options.scale.z=n.options.scale.z||0===n.options.scale.z?n.options.scale.z:1),n.primitive=null,n._loadEvent=void 0,n._loaded=!1,n._elms={},n.Dialog=o,n._EventBinding=new Ln,t.setDefaultValue(n),n.requestResource(),n.ControllerObject=new Qo(n.sdk,{position:tb({},n.options.position),rotate:{x:(360+n.options.roll%360)%360,y:(360+-n.options.pitch%360)%360,z:(360+-n.options.heading%360)%360}}),n.ControllerObject.controllerCallBack=n.controllerCallBack,n.HeadingPitchRollCallBack=n.Dialog.HeadingPitchRollCallBack,n}return wn()(t,e),x()(t,[{key:"requestResource",value:function(){this.addResource().then((function(e){}))}},{key:"addResource",value:(s=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p,d;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this).options.xmlURL=t.options.objUrl.replace(".obj",".xml"),""===t.options.xmlURL){e.next=34;break}return e.next=5,fetch(t.options.xmlURL);case 5:if(!(i=e.sent).ok){e.next=32;break}return e.next=9,i.text();case 9:return n=e.sent,o=new DOMParser,s=o.parseFromString(n,"text/xml"),r=s.getElementsByTagName("Position")[0].textContent.split(","),l=s.getElementsByTagName("Crs")[0].textContent,c=t.convert([{x:r[0],y:r[1],z:r[2]}],l,"EPSG:4326"),t.options.position=t.options.position||{lng:c.points[0].x,lat:c.points[0].y,alt:c.points[0].z},t.ControllerObject.position=t.options.position,u=t.viwer.scene,h=Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt),p=Cesium.Transforms.headingPitchRollToFixedFrame(h,new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(.85),Cesium.Math.toRadians(0),Cesium.Math.toRadians(0))),e.next=22,window.objLoader.Load(t.options.objUrl);case 22:(d=e.sent).show=t.options.show,d.modelMatrix=p,d.setFlvVideo(t.options.videoUrl),u.primitives.add(d),t.primitive=d,t.controllerCallBack({rotate:{x:t.options.roll,y:-t.options.pitch,z:-t.options.heading},position:tb({},t.options.position)}),this.loaded=!0,this._loaded=!0,this._loadEvent&&this._loadEvent();case 32:e.next=36;break;case 34:return console.error("请填写xml路径"),e.abrupt("return");case 36:if(""!==t.options.objUrl){e.next=39;break}return console.error("请填写obj模型路径"),e.abrupt("return");case 39:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=h.length>0&&void 0!==h[0]?h[0]:{},!this._error){e.next=3;break}return e.abrupt("return");case 3:if(fi(0),oi(this.sdk),si(this.sdk),!(this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)){e.next=25;break}if(i={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},n=this.options.customView.relativePosition.lng,o=this.options.customView.relativePosition.lat,s=this.options.customView.relativePosition.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),l={lng:0,lat:0},this.options.position?l=tb({},this.options.position):this.options.positions?l=tb({},this.options.positions[0]):this.options.center?l=tb({},this.options.center):this.options.start?l=tb({},this.options.start):(this.options.hasOwnProperty("lng")&&(l.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(l.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(l.alt=this.options.alt)),l.hasOwnProperty("alt")){e.next=18;break}return e.next=17,this.getClampToHeight(l);case 17:l.alt=e.sent;case 18:n=this.options.customView.relativePosition.lng+l.lng,o=this.options.customView.relativePosition.lat+l.lat,s=this.options.customView.relativePosition.alt+l.alt,r=Cesium.Cartesian3.fromDegrees(n,o,s),this.sdk.viewer.camera.flyTo({destination:r,orientation:i}),e.next=28;break;case 25:c=100*Math.tan(60),u=c/111319.55,this.sdk.viewer.camera.flyTo({destination:new Cesium.Cartesian3.fromDegrees(this.options.position.lng,this.options.position.lat-u,this.options.position.alt+100),orientation:t.orientation||{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-60),roll:Cesium.Math.toRadians(0)}});case 28:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u=this,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h.length>0&&void 0!==h[0]&&h[0],t=!1,this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),e.next=6,new _n(this.sdk,this.options,{title:"编辑属性",left:"180px",top:"100px",confirmCallBack:function(e){u.name=u.name.trim(),u.name||(u.name="未命名对象"),u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions)},resetCallBack:function(){u.reset(),u.Dialog.resetCallBack&&u.Dialog.resetCallBack()},removeCallBack:function(){u.Dialog.removeCallBack&&u.Dialog.removeCallBack()},closeCallBack:function(){u.reset(),u.positionEditing=!1,u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},rotateCallBack:function(){u.rotationEditing?u.rotationEditing=!1:u.rotationEditing=!0},translationalCallBack:function(){u.positionEditing?u.positionEditing=!1:u.positionEditing=!0}},!0);case 6:for(this._DialogObject=e.sent,(i=document.createElement("div")).style.width="448px",i.innerHTML='\n \n
      \n
      \n
      \n 名称\n \n
      \n
      \n
      \n
      \n
      \n \n
      \n
      \n
      \n 经度\n \n
      \n
      \n 海拔高度\n
      \n \n m\n \n
      \n
      \n
      \n
      \n
      \n 纬度\n \n
      \n
      \n
      \n
      \n
      \n \n
      \n
      \n
      \n 缩放\n
      \n \n 是否等比例缩放\n
      \n
      \n
      \n \n \n
      \n \n ',this._DialogObject.contentAppChild(i),n=this._DialogObject._element.content.getElementsByClassName("checkbox-box")[0].querySelector("input"),o=this._DialogObject._element.content.getElementsByClassName("equal")[0],s=this._DialogObject._element.content.getElementsByClassName("no-equal")[0],n.checked=t,n.addEventListener("change",(function(e){(t=e.target.checked)?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex")})),(r=o.getElementsByTagName("input"))[0].value=this.scaleX,r[1].value=this.scaleX,r[0].addEventListener("input",(function(e){u.scaleX=e.target.value,u.scaleY=e.target.value,u.scaleZ=e.target.value})),r[1].addEventListener("input",(function(e){u.scaleX=e.target.value,u.scaleY=e.target.value,u.scaleZ=e.target.value})),t?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex"),setTimeout((function(){if(u._DialogObject._element.foot){var e=u._DialogObject._element.foot.getElementsByClassName("rotate")[0];e&&(e.style.position="absolute",e.style.left="100px")}}),0),l=i.getElementsByTagName("*"),c=0;c1&&void 0!==arguments[1]?arguments[1]:{};k()(this,e),this.sdk=t,this.options=cb({},i),this.options.show=!i.show&&!1!==i.show||i.show,this.options.host=this.options.host||p(),this.objModelObject=[],this._loaded=!1,this._loadEvent=void 0,this.on()}),[{key:"show",get:function(){return this.options.show},set:function(e){var t=this;if("boolean"==typeof e){this.options.show=e;for(var i=function(i){t.objModelObject[i].load((function(){t.objModelObject[i].show=e}))},n=0;n1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),mb(i=db(this,t,[e,n]),yb,void 0),i.options.id=n.id||i.randomString(),i.options.name=n.name||"漫游路径",i.options.points=n.points||[],i.options.repeat&&(i.options.repeat=Number(i.options.repeat)),i.Dialog=o,i}return wn()(t,e),x()(t,[{key:"repeat",get:function(){return this.options.repeat},set:function(e){if(this.options.repeat!=Number(e)&&(this.options.repeat=Number(e),this._DialogObject&&this._DialogObject._element&&this._DialogObject._element.content)){var t=this._DialogObject._element.content.querySelector("input[name='repeat']");t.checked=e===1/0,this.Dialog.changeRepeatStateCallBack&&this.Dialog.changeRepeatStateCallBack(t.checked)}}},{key:"edit",value:(i=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c,u,h,p,d,m,f,v,g=this;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this,n=this.sdk.viewer,o=0,this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=44;break}return s=function(e){var t=l.getElementsByClassName("tr");t.length>0&&(t[t.length-1].querySelector("input[name='time']").disabled=void 0);var s=l.getElementsByClassName("tr active")[0];s&&(s.className="tr");var a=document.createElement("div");a.className="tr active",a.innerHTML='\n
      视点'.concat(u+1,'
      \n
      \n \n
      \n
      \n
      \n '),a.addEventListener("click",(function(e){if(e.target.parentNode===a){var i=l.getElementsByClassName("tr active")[0];i&&(i.className="tr"),a.className="tr active";for(var n=0;nn+1?(o--,t[o-1].className="tr active"):o==n+1&&(t.length==n&&(o-=1),0!=t.length&&(t[o-1].className="tr active")),t.length>0){var s=t[t.length-1].querySelector("input[name='time']");s.disabled="disabled",s.value=0}break}})),p.addEventListener("input",(function(t){f.checked=!1,e.duration=Number(p.value),e.duration<0&&(e.duration=0)})),p.addEventListener("blur",(function(){p.value=Number(Number(p.value).toFixed(2)),p.value<0&&(p.value=0)})),l.insertBefore(a,t[o]),o++,t[t.length-1].querySelector("input[name='time']").disabled="disabled"},e.next=8,new J(n._container,{title:"飞行漫游",left:"180px",top:"100px",closeCallBack:function(){g.cease()}});case 8:return this._DialogObject=e.sent,e.next=11,this._DialogObject.init();case 11:for((r=document.createElement("div")).className="fly-roam",r.innerHTML='\n \n
      \n
      \n
      \n 名称\n \n
      \n
      \n
      \n
      \n \n
      \n
      \n
      \n \n 设置总时长\n
      \n \n 秒(s)\n \n
      \n
      \n
      \n \n 是否循环播放\n
      \n
      \n
      \n \n
      \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n \n
      \n
      \n
      \n
      \n
      \n
      序号
      \n
      时长(s)
      \n
      操作
      \n
      \n
      \n
      \n
      \n
      \n

      暂无数据

      \n
      \n
      \n
      \n
      \n \n ',this._DialogObject.contentAppChild(r),r.getElementsByTagName("*"),l=r.getElementsByClassName("table-body")[0],c=r.getElementsByClassName("table-empty")[0],u=0,h=new Proxy([],{set:function(e,t,i){return e[t]=i,e.length>0?c.style.display="none":c.style.display="flex",!0}}),u=0;u0&&g.flyTo(0)})),r.getElementsByClassName("add-point")[0].addEventListener("click",(function(){var e={duration:0,position:g.cartesian3Towgs84(n.camera.position,n),orientation:{heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll}};h.splice(o,0,e),g.options.points.splice(o,0,e),s(e),u++})),r.getElementsByClassName("modify-point")[0].addEventListener("click",(function(){if(o){var e=g.cartesian3Towgs84(n.camera.position,n);g.options.points[o-1].position=h[o-1].position=e,g.options.points[o-1].orientation=h[o-1].orientation={heading:n.camera.heading,pitch:n.camera.pitch,roll:n.camera.roll},g.message({text:"操作成功"})}})),m=r.querySelector("input[name='totalTime']"),f=r.querySelector("input[name='isTotalTime']"),v=r.querySelector("input[name='repeat']"),f.addEventListener("change",(function(){var e=l.getElementsByClassName("tr");if(f.checked&&e.length>0){for(var t=Number((Number(m.value)/(e.length-1)).toFixed(2)),i=0;i0){for(var t=Number((Number(m.value)/(e.length-1)).toFixed(2)),i=0;i0&&void 0!==arguments[0]?arguments[0]:0;fi(0);var i=this,n=this.options.points,s=this.repeat;oi(i.sdk);var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0;vb(yb,e)&&vb(yb,e).destroy();var l=e;fb(yb,e,new Cesium.ScreenSpaceEventHandler(l.sdk.viewer.canvas)),vb(yb,e).setInputAction((function(t){e.cease()}),Cesium.ScreenSpaceEventType.RIGHT_CLICK);var c,u=l.sdk.viewer;fi(0),u.camera.cancelFlight(),u.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n[t].position.lng,n[t].position.lat,n[t].position.alt),orientation:n[t].orientation,duration:i?n[t-1].duration:.5,maximumHeight:n[t].position.alt,complete:(c=o()(a.a.mark((function i(){return a.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:t++,e.repeat===1/0?s=1/0:s===1/0&&(s=e.repeat),t<=n.length-1?r(t,!0):s?(s--,r(0)):vb(yb,e)&&vb(yb,e).destroy();case 3:case"end":return i.stop()}}),i)}))),function(){return c.apply(this,arguments)}),easingFunction:i?Cesium.EasingFunction.LINEAR_NONE:Cesium.EasingFunction.EXPONENTIAL_OUT})};r(t)}},{key:"cease",value:function(){this.sdk&&this.sdk.viewer&&this.sdk.viewer.camera.cancelFlight(),vb(yb,this)&&vb(yb,this).destroy()}},{key:"remove",value:function(){this._DialogObject&&this._DialogObject.close?(this._DialogObject.close(),this._DialogObject=null):this.cease()}}]);var i}($n);function Cb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var wb=function(){return x()((function e(t,i,n){k()(this,e),this.options=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"move",t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:90,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("move"===e){var o=turf.point([this.options.position.lng,this.options.position.lat]),s=Cesium.Math.toDegrees(this.hpr.heading),a=s+i,r={units:"degrees"},l=turf.destination(o,t,a,r).geometry.coordinates;this.position=Cesium.Cartesian3.fromDegrees(l[0],l[1],this.options.position.alt+this.options.normalHeight),this.options.position.lng=l[0],this.options.position.lat=l[1],this.viewer.camera.setView({destination:Cesium.Cartesian3.fromDegrees(l[0],l[1],this.viewer.camera.positionCartographic.height)})}"update"===e&&(this.position=t,this.options.videoUrl&&this.updatePolygonPosition()),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"syncHpr",value:function(){if(this.viewer1){var e=this.options.position,t=e.lng,i=e.lat,n=e.alt,o=-this.hpr.pitch-Cesium.Math.toRadians(-90);this.viewer1.camera.setView({destination:Cesium.Cartesian3.fromDegrees(t,i,n+this.options.normalHeight),orientation:{heading:this.hpr.heading+Cesium.Math.toRadians(-90),pitch:o,roll:this.hpr.roll}})}}},{key:"updateFrustumHPR",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.head,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.pitch,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";function s(e){return e*Math.PI/180}"alone"==o?(this.hpr.heading=s(e),this.hpr.pitch=s(t),this.hpr.roll=s(i)):(this.hpr.heading=Cesium.Math.negativePiToPi(e),this.hpr.pitch=Cesium.Math.negativePiToPi(t),this.hpr.roll=Cesium.Math.negativePiToPi(i)),n&&(this.syncHpr(),this.updateFrustumAttributes())}},{key:"updateFrustumAttributes",value:function(){if(this.position&&this.hpr){var e=Cesium.Transforms.headingPitchRollToFixedFrame(this.position,this.hpr);if(e)try{var t=new Cesium.FrustumOutlineGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(e,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(e,new Cesium.Matrix3))}),i=new Cesium.PolylineColorAppearance({translucent:!1}),n=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.YELLOW),o=new Cesium.FrustumGeometry({frustum:this.frustum,origin:Cesium.Matrix4.getTranslation(e,new Cesium.Cartesian3),orientation:Cesium.Quaternion.fromRotationMatrix(Cesium.Matrix4.getRotation(e,new Cesium.Matrix3))}),s=new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.YELLOW.withAlpha(.5)}),translucent:!0}),a=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED.withAlpha(.5));this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:t,attributes:{color:n}}),appearance:i,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumOutline),this.currentFrustumFilled=new Cesium.Primitive({geometryInstances:new Cesium.GeometryInstance({geometry:o,attributes:{color:a}}),appearance:s,asynchronous:!1,show:this.options.show}),this.viewer.scene.primitives.add(this.currentFrustumFilled)}catch(e){console.error("Error in drawFrustum:",e)}else console.error("Transform generation failed.")}else console.error("Position or HPR is not defined:",this.position,this.hpr)}},{key:"updateFrustumNearFar",value:function(e,t){this.frustum.near=e,this.frustum.far=t,this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"updateFrustumFov",value:function(e){this.frustum.fov=Cesium.Math.toRadians(e),this.drawFrustumOutline(),this.drawFrustumFilled()}},{key:"show",get:function(){return this.options.show},set:function(e){"boolean"==typeof e&&(this.options.show=e,this.currentFrustumOutline.show=e,this.currentFrustumFilled.show=e)}},{key:"remove",value:function(){document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("keyup",this.keyupHandler),this.currentFrustumFilled&&this.viewer.scene.primitives.remove(this.currentFrustumFilled),this.currentFrustumOutline&&this.viewer.scene.primitives.remove(this.currentFrustumOutline),this.videoEntity&&this.viewer.entities.remove(this.videoEntity)}}],[{key:"setDefaultValue",value:function(e){var t;e.options.position=e.options.position||{},e.options.fov=e.options.fov||30,e.options.aspectRatio=e.options.aspectRatio||1,e.options.near=e.options.near||1,e.options.far=e.options.far||120,e.options.heading=e.options.heading||0,e.options.pitch=e.options.pitch||90,e.options.roll=e.options.roll||0,e.options.show=null===(t=e.options.show)||void 0===t||t,e.options.videoUrl=e.options.videoUrl||"",e.options.index=e.options.index||0,e.options.arr=e.options.arr||[],e.options.normalHeight=e.options.normalHeight||100}}]);var e,t}();function kb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}var _b=function(){return x()((function e(t,i){k()(this,e),this.options=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;k()(this,e),this.options=Sb({},t),this.viewer=i,this.viewer1=n,this.entity=null,this.frustum=null,this.billordPointLineMaps=[],this.index=0,this.positions=[],e.setDefaultValue(this),this.create()}),[{key:"create",value:function(){var e=this;if(!(this.options.positions.length<2)){var t=this.options.frustumShow;this.entity=this.viewer.entities.add({show:this.options.show,polyline:{positions:new Cesium.CallbackProperty((function(){for(var t=[],i=0;ithis.options.positions.length-1||this.index<0){var t=this.index>0?"已选中最后一个航点":"已选中第一个航点";alert(t)}else for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return k()(this,t),(i=Pb(this,t,[e,n])).options.tipText=n.tipText?n.tipText:"左键确定,右键结束;",i}return wn()(t,e),x()(t,[{key:"start",value:function(e){var t=this;if(YJ.Measure.GetMeasureStatus())e("上一次测量未结束");else{var i=void 0;YJ.Measure.SetMeasureStatus(!0),this.tip=new Q(this.options.tipText,this.sdk),this.event=new K(this.sdk),this.isEntity=!1,this.event.mouse_left((function(n,o){t.end();var s=t.cartesian3Towgs84(i||o,t.viewer),a=t.viewer.scene.pick(n.position);Cesium.defined(a)&&Cesium.defined(a.id)&&a.id.id===window.airportEntity.options.id&&(t.isEntity=!0),e(null,s,t.isEntity)})),this.event.mouse_right((function(i,n){t.end(),e(!1)})),this.event.mouse_move((function(e,n){i=n,t.tip.setPosition(n,e.endPosition.x,e.endPosition.y)})),this.event.gesture_pinck_start((function(n,o){var s=new Date;t.event.gesture_pinck_end((function(){if(new Date-s>=500)t.end(),e(!1);else{t.end();var n=t.cartesian3Towgs84(i||o,t.viewer);e(null,n)}}))}))}}},{key:"end",value:function(){YJ.Measure.SetMeasureStatus(!1),this.event.destroy(),this.tip.destroy()}}])}(ha);function Mb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Tb(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return k()(this,t),(i=Ob(this,t,[e,n])).viewer=i.sdk.viewer,i.options.name=n.name||"飞线",i.options.pointNumber=n.pointNumber||200,i.options.height=n.height||200,i.options.heightDifference=n.heightDifference||3e3,i.options.width=n.width||2,i.options.duration=n.duration||10,i.options.color=n.color||"rgba(255,255,255,1)",i.options.lineBackAlpha=n.lineBackAlpha||.05,i.options.positions=n.positions||[],i.options.show=!n.show&&!1!==n.show||n.show,i.Dialog=o,i._EventBinding=new Ln,i._elms={},i.positionArea=[],i.positions=[],i.sdk.addIncetance(i.options.id,i),t.drawLine(i),i}return wn()(t,e),x()(t,[{key:"getRandomPointsInCesiumPolygon",value:function(e,t){var i=[],n=[],o=[];e.forEach((function(e){i.push(e.lng),n.push(e.lat),o.push([e.lng,e.lat])})),o.push([o[0][0],o[0][1]]);for(var s=Math.min.apply(Math,i),a=Math.max.apply(Math,i),r=Math.min.apply(Math,n),l=Math.max.apply(Math,n),c=[];c.length0&&void 0!==r[0]&&r[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=19;break}return e.next=7,new _n(this.sdk,this.originalOptions,{title:"飞线属性",left:"180px",top:"100px",confirmCallBack:function(e){s.name=s.name.trim(),s.name||(s.name="飞线"),s.originalOptions=s.deepCopyObj(s.options),s._DialogObject.close(),s.Dialog.confirmCallBack&&s.Dialog.confirmCallBack(s.originalOptions),Mt(s.sdk,s.options.id),at(s.sdk,s.options.id)},resetCallBack:function(){s.reset(),s.Dialog.resetCallBack&&s.Dialog.resetCallBack()},removeCallBack:function(){s.Dialog.removeCallBack&&s.Dialog.removeCallBack()},closeCallBack:function(){s.reset(),s.Dialog.closeCallBack&&s.Dialog.closeCallBack()},showCallBack:function(e){s.show=e,s.Dialog.showCallBack&&s.Dialog.showCallBack()}},!0);case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" flow-line-surface",(i=document.createElement("div")).innerHTML='\n \n
      \n
      \n
      \n 名称\n \n
      \n
      \n 颜色\n
      \n
      \n
      \n
      \n \n
      \n
      \n
      \n 飞线数量\n
      \n \n \n
      \n
      \n
      \n 飞线宽度\n
      \n \n \n
      \n
      \n
      \n
      \n
      \n
      \n\n
      \n 飞线高度\n
      \n \n \n
      \n
      \n
      \n 飞线高度差\n
      \n \n \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n 单次运动时长(s)\n
      \n \n \n
      \n
      \n
      \n 轨迹透明度\n
      \n \n \n
      \n
      \n
      \n
      \n \n ',this._DialogObject.contentAppChild(i),n=new YJColorPicker({el:i.getElementsByClassName("flowLine-color")[0],size:"mini",alpha:!0,defaultColor:this.color,disabled:!1,openPickerAni:"opacity",sure:function(e){s.color=e},clear:function(){s.color="rgba(255,255,255,1)"}}),o=i.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,this._elms.color=[n],e.next=19;break;case 19:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.name=this.originalOptions.name,this.pointNumber=this.originalOptions.pointNumber,this.height=this.originalOptions.height,this.heightDifference=this.originalOptions.heightDifference,this.width=this.originalOptions.width,this.duration=this.originalOptions.duration,this.color=this.originalOptions.color,this.lineBackAlpha=this.originalOptions.lineBackAlpha)}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p.length>0&&void 0!==p[0]&&p[0],fi(0),oi(this.sdk),si(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Tb({},this.options.position):this.options.positions?r=Tb({},this.options.positions[0]):this.options.center?r=Tb({},this.options.center):this.options.start?r=Tb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t});else{for(l=[],c=0;c=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}function Ab(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i=Number(t.target.min))&&(i=i),t.target.max&&i>Number(t.target.max)&&(i=Number(t.target.max)),t.target.min&&iNumber(t.target.max)&&(i=Number(t.target.max)),t.target.min&&i0&&t[o].addEventListener(e,(function(t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};k()(this,e),this.viewer=t.viewer,this.options=Fb({},i),this.sdk=Fb({},t);var o=new Date;o.setHours(0,0,0,0),this.options.time=i.time,this.options.hour=i.hour,this.options.speed=i.speed||1e3,this.options.darkness=i.darkness||.4,this.options.softShadow=i.softShadow||!0,this.options.show=!0===i.show,this.Dialog=n,this.timeLine,this._EventBinding=new Ib,this._elms={},e.start(this)}),[{key:"darkness",get:function(){return this.options.darkness},set:function(e){this.options.darkness=e,this.viewer.shadowMap.darkness=1-this.options.darkness,this._elms.darkness&&this._elms.darkness.forEach((function(t){t.value=e}))}},{key:"time",get:function(){return this.options.time},set:function(e){this.options.time=e;var t=(new Date).setHours(0,0,0,0);this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t))}},{key:"timeBar",set:function(e){var t=this.time+" "+e;this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t)),this.viewer.scene.requestRender()}},{key:"realTime",set:function(e){var t=new Date;this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(t)}},{key:"speed",get:function(){return this.options.speed},set:function(e){this.options.speed=e,this._elms.speed&&this._elms.speed.forEach((function(t){t.value=e})),this.viewer.clock.multiplier=this.options.speed}},{key:"softShadow",get:function(){return this.options.softShadow},set:function(e){this.options.softShadow=e,this.viewer.shadowMap.softShadows=this.options.softShadow}},{key:"edit",value:(i=o()(a.a.mark((function e(){var t,i,n,o,s,r,l=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=l.length>0&&void 0!==l[0]&&l[0],i=new bi,this.originalOptions=i.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),t&&(n=this,this.timeLine=new Rb(this.sdk,this.options.speed),this.timeLine.moveComplay((function(e){var t=n.time+" "+e;n.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t)),n.viewer.scene.requestRender()})),s=contentElm.getElementsByClassName("sunshine-date")[0],o=jeDate(s,{format:"YYYY-MM-DD",isinitVal:!0,isClear:!1,donefun:function(e){this.time=e.val;var t=(new Date).setHours(0,0,0,0);n.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(t)),n.timeLine.updateTime(t)}}),this.time?o.setValue(this.time):(o.nowBtn&&o.nowBtn(),this.time=o.getValue()),r=contentElm.getElementsByTagName("*"),this._EventBinding.on(this,r),this._elms=this._EventBinding.element,this._elms.color=[o]);case 5:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.time=this.originalOptions.time,this.speed=this.originalOptions.speed,this.darkness=this.originalOptions.darkness)}},{key:"flyTo",value:(t=o()(a.a.mark((function e(){var t=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:!(t.length>0&&void 0!==t[0])||t[0];case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"remove",value:(e=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.viewer.scene.globe.enableLighting=!1,this.viewer.shadows=!1,this.viewer.clock.multiplier=1,this.viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date),this.entity=null,this.timeLine&&this.timeLine.clear(),this.viewer.shadowMap.cascadesEnabled=!1,this.viewer.shadowMap.size=1024,this.viewer.shadowMap.numberOfCascades=3,this.viewer.shadowMap._lightCamera,this.viewer.shadowMap.normalOffset=!1,this._DialogObject&&!this._DialogObject.isDestroy&&(this._DialogObject.close(),this._DialogObject=null),e.next=14,Mt(this.sdk,this.options.id);case 14:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"flicker",value:function(){}}],[{key:"start",value:function(e){var t;e.viewer.scene.globe.enableLighting=!0,e.viewer.shadows=!0,e.viewer.scene.globe.enableLighting=!0,e.viewer.terrainShadows=Cesium.ShadowMode.RECEIVE_ONLY,e.viewer.shadowMap.darkness=1-e.options.darkness,e.options.time&&e.options.hour?t=new Date(e.options.time+" "+e.options.hour):(t=new Date).setHours(0,0,0,0),e.viewer.clock.currentTime=Cesium.JulianDate.fromDate(t),e.viewer.clock.multiplier=e.options.speed,e.viewer.shadowMap.softShadows=e.options.softShadow,e.viewer.shadowMap.cascadesEnabled=!0,e.viewer.shadowMap.size=2048,e.viewer.shadowMap.numberOfCascades=4,e.viewer.shadowMap.maximumDistance=5e3;var i=e.viewer.shadowMap._lightCamera;i.frustum.near=.1,i.frustum.far=1e4,e.viewer.shadowMap.normalOffset=!0}}]);var e,t,i}();function Vb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Gb(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t,i){for(var n=[],o=[],s=[],a=0;am&&m>-1.001)o.push(v);else{var C=[];C[0]=v[1],C[1]=v[2],C[2]=v[3],C[3]=v[0],o.push(C)}},r=0;r2&&void 0!==arguments[2]?arguments[2]:.01;if(!t.width||!t.height)throw new Error("Texture size must contain width and height in pixels");for(var n=Cesium.PolygonGeometry.createGeometry(new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(e),vertexFormat:Cesium.VertexFormat.POSITION_ONLY})),o=0,s=n.indices,a=n.attributes.position.values,r=0;r0)return Cesium.Cartesian3.fromDegrees(u.features[0].geometry.coordinates[0],u.features[0].geometry.coordinates[1])}},{key:"getLonLat",value:function(e){var t=Cesium.Cartographic.fromCartesian(e);return{lon:Cesium.Math.toDegrees(t.longitude),lat:Cesium.Math.toDegrees(t.latitude)}}},{key:"createLineBufferPolygon",value:function(e,t,i){for(var n=[],o=0;o0?n.unshift(Cesium.Cartesian3.add(s,u,new Cesium.Cartesian3)):i<0&&n.push(Cesium.Cartesian3.add(s,u,new Cesium.Cartesian3))}return n}},{key:"calculateAangle",value:function(e){function t(e,t){var i=Math.PI/180,n=e.y*i,o=t.y*i,s=e.x*i,a=t.x*i,r=Math.sin(a-s)*Math.cos(o),l=Math.cos(n)*Math.sin(o)-Math.sin(n)*Math.cos(o)*Math.cos(a-s),c=Math.atan2(r,l)%(2*Math.PI);return 360-(450-(180*c/Math.PI<0?360+180*c/Math.PI:180*c/Math.PI)-90)%360}var i=e[0],n=e[1],o=e[2],s={x:i.lng,y:i.lat},a={x:n.lng,y:n.lat},r={x:o.lng,y:o.lat};return{angle1:t(s,a),angle2:t(s,r)}}},{key:"carRoadWidth",get:function(){return this.options.carRoadWidth},set:function(e){this.options.carRoadWidth=e,t.create(this)}},{key:"sideWidth",get:function(){return this.options.sideWidth},set:function(e){this.options.sideWidth=e,t.create(this)}},{key:"edit",value:(s=o()(a.a.mark((function e(){var t,i,n,o=this,s=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]&&s[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!t){e.next=17;break}return e.next=7,new _n(this.sdk,this.originalOptions,{title:"道路属性",left:"180px",top:"100px",confirmCallBack:function(e){o.name=o.name.trim(),o.name||(o.name="道路"),o.originalOptions=o.deepCopyObj(o.options),o._DialogObject.close(),o.Dialog.confirmCallBack&&o.Dialog.confirmCallBack(o.originalOptions),Mt(o.sdk,o.options.id),at(o.sdk,o.options.id)},resetCallBack:function(){o.reset(),o.Dialog.resetCallBack&&o.Dialog.resetCallBack()},closeCallBack:function(){o.reset(),o.Dialog.closeCallBack&&o.Dialog.closeCallBack()},showCallBack:function(e){o.show=e,o.Dialog.showCallBack&&o.Dialog.showCallBack()}},!0);case 7:this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" road-surface",(i=document.createElement("div")).innerHTML='\n \n
      \n
      \n
      \n 名称\n \n
      \n
      \n 道路类型\n
      \n
      \n
      \n
      \n \n
      \n
      \n
      \n 车道宽度\n
      \n \n \n
      \n
      \n
      \n 人行道宽度\n
      \n \n \n
      \n
      \n
      \n
      \n \n ',this._DialogObject.contentAppChild(i),n=i.getElementsByTagName("*"),this._EventBinding.on(this,n),this._elms=this._EventBinding.element,e.next=17;break;case 17:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"reset",value:function(){this.viewer.entities.getById(this.options.id)&&(this.name=this.originalOptions.name,this.carRoadWidth=this.originalOptions.carRoadWidth,this.sideWidth=this.originalOptions.sideWidth,this.positions=this.originalOptions.positions,this.roadImage=this.originalOptions.roadImage,this.sideImage=this.originalOptions.sideImage)}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h,p=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p.length>0&&void 0!==p[0]&&p[0],fi(0),oi(this.sdk),si(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Gb({},this.options.position):this.options.positions?r=Gb({},this.options.positions[0]):this.options.center?r=Gb({},this.options.center):this.options.start?r=Gb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t});else{for(l=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return k()(this,t),(i=qb(this,t,[e,n])).options.position=n.position||[],i.options.text=n.text||"",i.options.show=!n.show&&!1!==n.show||n.show,i.clickTextDom=void 0,i.handler=void 0,i.textDom=void 0,i.create(i),i.sdk.addIncetance(i.options.id,i),i.callback=o,i}return wn()(t,e),x()(t,[{key:"type",get:function(){return"TextBox"}},{key:"create",value:(h=o()(a.a.mark((function e(t){var i,n,o,s;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=t.sdk.viewer,(n=document.createElement("span")).id=t.options.id,n.className="popup-textarea",n.style.zIndex=1,(o=document.createElement("textarea")).className="textarea",o.value=t.options.text,o.rows=6,o.style.resize="none",n.appendChild(o),!t.options.show&&(n.style.display="none"),i.cesiumWidget.container.appendChild(n),s=Cesium.Cartesian3.fromDegrees(t.options.position.lng,t.options.position.lat,t.options.position.alt),t.handler=function(){var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.scene,s);if(e){var t=1*n.clientWidth,o=1*n.clientHeight;n.style.left="".concat(e.x-t/2,"px"),n.style.top="".concat(e.y-o,"px")}},i.scene.postRender.addEventListener(t.handler),t.textDom=n;case 17:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)})},{key:"isClick",value:(u=o()(a.a.mark((function e(t,i){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.clickCallBack({position:t},i,null);case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"setHandeler",value:(c=o()(a.a.mark((function e(t){var i,n,o,s,r,l,c;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this,(n=this.sdk.viewer.scene.pickPosition(new Cesium.Cartesian2(t.x,t.y)))||(o=this.sdk.viewer.camera.getPickRay(new Cesium.Cartesian2(t.x,t.y)),n=this.sdk.viewer.scene.globe.pick(o,this.sdk.viewer.scene)),!Cesium.defined(n)){e.next=15;break}return i.sdk.viewer.scene.postRender.removeEventListener(i.handler),s=Cesium.Cartographic.fromCartesian(n),r=Cesium.Math.toDegrees(s.longitude),l=Cesium.Math.toDegrees(s.latitude),e.next=10,i.getClampToHeight({lng:r,lat:l});case 10:e.sent,i.position={lng:r,lat:l,alt:s.height},c=Cesium.Cartesian3.fromDegrees(r,l,s.height),i.handler=function(){var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.sdk.viewer.scene,c);if(e){var t=1*i.textDom.clientWidth,n=1*i.textDom.clientHeight;i.textDom.style.left="".concat(e.x-t/2,"px"),i.textDom.style.top="".concat(e.y-n,"px")}},i.sdk.viewer.scene.postRender.addEventListener(i.handler);case 15:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"getwords",value:(l=o()(a.a.mark((function e(t){var i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.options.text=t,this.callback(this.options),i=Ht(),n=i.sdkP,this.sdk===n&&n?Mt(this.sdk,this.options.id):n?(n.entityMap.get(this.options.id).text=t,n.entityMap.get(this.options.id).twoToThree(this.options.position)):n||Mt(this.sdk,this.options.id);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"twoToThree",value:(r=o()(a.a.mark((function e(t){var i,n;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(i=this).sdk.viewer.scene.postRender.removeEventListener(i.handler),n=Cesium.Cartesian3.fromDegrees(t.lng,t.lat,t.alt),i.handler=function(){var e=Cesium.SceneTransforms.wgs84ToWindowCoordinates(i.sdk.viewer.scene,n);if(e){var t=1*i.textDom.clientWidth,o=1*i.textDom.clientHeight;i.textDom.style.left="".concat(e.x-t/2,"px"),i.textDom.style.top="".concat(e.y-o,"px")}},i.sdk.viewer.scene.postRender.addEventListener(i.handler);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"returnFun",value:(s=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.handler);case 1:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"text",get:function(){return this.options.text},set:function(e){this.options.text=e,this.textDom.querySelector("textarea").value=e,this.callback(this.options)}},{key:"onClick",get:function(){return this.clickCallBack},set:function(e){e&&"function"!=typeof e?console.error("val:",e,"不是一个function"):this.clickCallBack=e}},{key:"show",get:function(){return this.options.show},set:function(e){this.options.show=e,this.textDom&&(this.textDom.style.display=e?"block":"none"),Mt(this.sdk,this.options.id)}},{key:"position",get:function(){return this.options.position},set:function(e){this.options.position=e}},{key:"flyTo",value:(n=o()(a.a.mark((function e(){var t,i,n,o,s,r,l,c,u,h=arguments;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h.length>0&&void 0!==h[0]&&h[0],fi(0),oi(this.sdk),si(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation?(t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Jb({},this.options.position):this.options.position?r=Jb({},this.options.position[0]):this.options.center?r=Jb({},this.options.center):this.options.start?r=Jb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t})):(l=[],c=Cesium.Cartesian3.fromDegrees(this.position.lng,this.position.lat,this.position.alt),l.push(c.x,c.y,c.z),u=Cesium.BoundingSphere.fromVertices(l),this.viewer.camera.flyToBoundingSphere(u,{offset:{heading:Cesium.Math.toRadians(0),pitch:Cesium.Math.toRadians(-20),roll:Cesium.Math.toRadians(0)}}));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"remove",value:(i=o()(a.a.mark((function e(){return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.handler&&(this.sdk.viewer.scene.postRender.removeEventListener(this.handler),this.handler=void 0),this.textDom&&this.textDom.parentNode&&this.sdk.viewer.cesiumWidget.container.removeChild(this.textDom),e.next=4,this.sdk.removeIncetance(this.options.id);case 4:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"flicker",value:function(){}}]);var i,n,s,r,l,c,u,h}($n);function Zb(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function Kb(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};k()(this,t),(i=Qb(this,t,[e,n])).viewer=i.sdk.viewer,i.options.name=n.name||"批量模型",i.options.type=n.type||"面",i.options.url=n.url||"",i.options.spacing=1*n.spacing||50,i.options.positions=n.positions||[],i.options.show=!n.show&&!1!==n.show||n.show,i.callback=o,i.Dialog=s,i._EventBinding=new Ln,i._elms={},i.pointArr=[],i.sdk.addIncetance(i.options.id,i);var a=new bi(e);if(i.options.spacing<0||1*n.spacing==0)return a.message({type:"warning",text:"请输入正确的间距!"}),gn()(i);if(n.type&&null!=n.spacing||"点"==n.type){var r;switch(n.type){case"点":r=new Kr(i.sdk);break;case"线":r=new Ur(i.sdk);break;case"面":r=new Xr(i.sdk)}r&&r.start((function(e,o){if(i.options.positions=o,"面"==n.type){var s=o.map((function(e){return Cesium.Cartesian3.fromDegrees(e.lng,e.lat)})),r=Cesium.Cartesian3.distance(s[0],s[1]),l=Cesium.Cartesian3.distance(s[1],s[2]);if(r/i.options.spacing*(l/i.options.spacing)>100)return void a.message({type:"warning",text:"数量大于100,请重新绘制"})}else if("线"==n.type){for(var c=o.map((function(e){return Cesium.Cartesian3.fromDegrees(e.lng,e.lat)})),u=0,h=0;h100)return void a.message({type:"warning",text:"数量大于100,请重新绘制"})}(i.options.positions.length||i.options.positions.lng)&&t.computeDis(i)}))}else i.edit(!0);return i}return wn()(t,e),x()(t,[{key:"linePoint",value:(u=o()(a.a.mark((function e(t,i){var n,o,s,r,l,c,u,h,p,d,m,f,v,g;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],o=[],s=0;case 3:if(!(s0&&void 0!==h[0]&&h[0],this.originalOptions=this.deepCopyObj(this.options),this._DialogObject&&this._DialogObject.close&&(this._DialogObject.close(),this._DialogObject=null),!i){e.next=33;break}return e.next=7,new _n(this.sdk,this.originalOptions,{title:"默认模型参数设置",left:"180px",top:"100px",confirmCallBack:function(e){var i;switch(u.name=u.name.trim(),u.name||(u.name="飞线"),u.options.type){case"点":i=new Kr(u.sdk);break;case"线":i=new Ur(u.sdk);break;case"面":i=new Xr(u.sdk)}i&&i.start((function(e,i){u.options.positions=i,(u.options.positions.length||u.options.positions.lng)&&t.computeDis(u)})),u.originalOptions=u.deepCopyObj(u.options),u._DialogObject.close(),u.Dialog.confirmCallBack&&u.Dialog.confirmCallBack(u.originalOptions),Mt(u.sdk,u.options.id),at(u.sdk,u.options.id)},closeCallBack:function(){u.reset(),u.Dialog.closeCallBack&&u.Dialog.closeCallBack()},addFootElm:[{tagName:"button",className:"flipe-over-y",innerHTML:"重置",event:["click",function(){u.reset()}]}]},!0);case 7:if(this._DialogObject=e.sent,this._DialogObject._element.body.className=this._DialogObject._element.body.className+" flow-line-surface",(n=document.createElement("div")).innerHTML='\n \n
      \n
      \n
      \n 添加方式\n
      \n
      \n
      \n 间距\n
      \n \n \n \n
      \n
      \n
      \n
      \n \n ',this._DialogObject.contentAppChild(n),o=n.getElementsByTagName("*"),this._EventBinding.on(this,o),this._elms=this._EventBinding.element,s=[{name:"点",value:"点"},{name:"线",value:"线"},{name:"面",value:"面"}],!(r=q(this._DialogObject._element.content.getElementsByClassName("add-type-box")[0],".add-type"))){e.next=31;break}r.legp_search(s),l=this._DialogObject._element.content.getElementsByClassName("add-type")[0].getElementsByTagName("input")[0],this._elms.type=[l],l.value=this.options.type,c=0;case 23:if(!(c0&&void 0!==p[0]&&p[0],fi(0),oi(this.sdk),si(this.sdk),this.options.customView&&this.options.customView.relativePosition&&this.options.customView.orientation)t={heading:Cesium.Math.toRadians(this.options.customView.orientation.heading||0),pitch:Cesium.Math.toRadians(this.options.customView.orientation.pitch||-60),roll:Cesium.Math.toRadians(this.options.customView.orientation.roll||0)},i=this.options.customView.relativePosition.lng,n=this.options.customView.relativePosition.lat,o=this.options.customView.relativePosition.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),r={lng:0,lat:0},this.options.position?r=Kb({},this.options.position):this.options.positions?r=Kb({},this.options.positions[0]):this.options.center?r=Kb({},this.options.center):this.options.start?r=Kb({},this.options.start):(this.options.hasOwnProperty("lng")&&(r.lng=this.options.lng),this.options.hasOwnProperty("lat")&&(r.lat=this.options.lat),this.options.hasOwnProperty("alt")&&(r.alt=this.options.alt)),i=this.options.customView.relativePosition.lng+r.lng,n=this.options.customView.relativePosition.lat+r.lat,o=this.options.customView.relativePosition.alt+r.alt,s=Cesium.Cartesian3.fromDegrees(i,n,o),this.sdk.viewer.camera.flyTo({destination:s,orientation:t});else if(l=[],this.options.positions.length>0){for(c=0;c0&&void 0!==arguments[0]?arguments[0]:{isc:!1,excel:!1,flv:!1,rtsp:!1,hls:!1,host:"",username:"",password:"",token:""};return new Promise((function(t,i){var n=f(),o=["/custom/css/index.css","/arrow/algorithm.js","/arrow/plotUtil.js","/3rdparty/turf.min.js","/3rdparty/fabric.min.js","/3rdparty/proj4.js","/3rdparty/pako.min.js","/3rdparty/heatmap.js","/3rdparty/tween.umd.js","/Cesium/Cesium.js","/Cesium/Widgets/widgets.css","/3rdparty/ewPlugins.min.js","/3rdparty/wangeditor/index.js","/3rdparty/wangeditor/style.css","/3rdparty/html2canvas.min.js","/3rdparty/kriging.js","/3rdparty/echarts.min.js","/3rdparty/clipboard.min.js","/3rdparty/libgif.js","/3rdparty/liveplayer/liveplayer-element.min.js","/3rdparty/jedate/jedate.min.js","/3rdparty/jedate/skin/jedate.css"];window.YJSDK3rdpartyResourceAddress=n+"/3rdparty",e.ws&&o.push("/3rdparty/reconnecting-websocket.js"),(e.flv||e.rtsp)&&o.push("/3rdparty/flv.min.js");var s=document.createElement("script");s.setAttribute("type","module"),s.textContent="\n import * as THREE from '".concat(n,"/3rdparty/three/three.module.min.js';\n window.THREE = THREE\n "),document.querySelector("html").appendChild(s);var a=document.createElement("script");a.setAttribute("type","module"),a.textContent="\n import { SVGLoader } from '".concat(n,"/3rdparty/three/jsm/loaders/SVGLoader.js';\n window.SVGLoader = SVGLoader\n "),document.querySelector("html").appendChild(a);var r=[];o.forEach((function(e){var t;e.endsWith(".js")?((t=document.createElement("script")).setAttribute("type","text/javascript"),t.setAttribute("src",n+e)):((t=document.createElement("link")).setAttribute("rel","stylesheet"),t.setAttribute("href",n+e)),document.querySelector("html").appendChild(t);var i=new Promise((function(e,i){t.onload=function(){e()}})).then((function(e){return e}));r.push(i)})),Promise.all(r).then((function(i){var o,s;(o=document.createElement("script")).setAttribute("type","text/javascript"),o.setAttribute("src",n+"/3rdparty/viewerCesiumNavigationMixin.min.js"),document.querySelector("html").appendChild(o),o.onload=function(){h(e.host),e.username?c(e).then((function(e){t()})):(d(e.token),t())},(s=document.createElement("script")).setAttribute("type","text/javascript"),s.setAttribute("src",n+"/3rdparty/CesiumHeatmap.js"),document.querySelector("html").appendChild(s)})).catch((function(e){i(e)}))}))},Obj:{ArcgisWXImagery:Ml,ArcgisBLUEImagery:Tl,ArcgisLWImagery:Ol,GDLWImagery:Al,GDWXImagery:Ll,GDSLImagery:Il,Tileset:Kl,BIM:lc,Layer:Bc,Layer3rdparty:Lc,Terrain:Yc,Flame:tu,Smoke:uu,Fountain:bu,Spout:Eu,WaterSurface:hp,CircleDiffuse:yo,CircleObject:hh,EllipseObject:yh,RadarScan:Do,RadarScanStereoscopic:Zh,SectorObject:np,WallStereoscopic:Sh,WallRealStereoscopic:Nh,KML:sp,GeoJson:rp,BillboardObject:zo,PolygonObject:Wo,PolyhedronObject:Au,AssembleObject:zu,AttackArrowObject:Yu,PincerArrowObject:Ku,StraightArrowObject:oh,PolylineObject:is,CurvelineObject:Hh,Explosion:Uh,Model:wc,Model2:Mc,TrajectoryMotion:Cp,TrajectoryMotionObject:Op,Graffiti:Bp,GroundImage:Hp,GroundSvg:hy,RoutePlanning:vy,Shp:Dy,Vector:Jy,GroundText:Ky,StandText:$y,RichText:Wn,LocateCurrent:ra,LoadObjModel:nb,Heatmap:pb,FlyRoam:bb,newAirLine:Eb,FRUSTUN:wb,Dialog:_n,FlowLine:Nb,Road2:Ub,TextBox:Xb,BatchModel:$b},YJEarth:hn,Tools:bi,Proj:R,Global:{getCurrentView:function(e){var t=new bi,i=e.viewer;return JSON.parse(JSON.stringify({position:t.cartesian3Towgs84(i.camera.position,i),orientation:{heading:Cesium.Math.toDegrees(i.camera.heading),pitch:Cesium.Math.toDegrees(i.camera.pitch),roll:Cesium.Math.toDegrees(i.camera.roll)}}))},setDefaultView:function(e,t){var i=e.viewer;t?i.CAMERA_DEFAULT_VIEW_RECTANGLE={destination:t.destination||{},orientation:t.orientation||{}}:(i.CAMERA_DEFAULT_VIEW_RECTANGLE=void 0,Cesium.Camera.DEFAULT_VIEW_RECTANGLE=Cesium.Rectangle.fromDegrees(89.5,10.4,110.4,61.2))},switchCluster:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e.viewer,n=0;n=0;n--)t.removeChild(i[n]);ms=0,fs=0},flyTo:ys,setRepeat:function(e){ms!=Number(e)&&(ms=Number(e),fs=ms)},cease:bs},flyTo:Kt,efflect:{rain:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Cs&&e.viewer.scene.postProcessStages.remove(Cs),t&&(Cs=new Cesium.PostProcessStage({name:"rain",fragmentShader:xs,uniforms:{tiltAngle:-.4,rainSize:.3,rainWidth:40,rainSpeed:100}}),e.viewer.scene.postProcessStages.add(Cs))},snow:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];ws&&e.viewer.scene.postProcessStages.remove(ws),t&&(ws=new Cesium.PostProcessStage({name:"snow",fragmentShader:Ss,uniforms:{snowSize:2,snowSpeed:60}}),e.viewer.scene.postProcessStages.add(ws))},fog:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];ks&&e.viewer.scene.postProcessStages.remove(ks),t&&(ks=new Cesium.PostProcessStage({name:"fog",fragmentShader:Es,uniforms:{visibility:.2,fogColor:Cesium.Color.WHITE}}),e.viewer.scene.postProcessStages.add(ks))},nightVision:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_s&&e.viewer.scene.postProcessStages.remove(_s),t&&(_s=Cesium.PostProcessStageLibrary.createNightVisionStage(),e.viewer.scene.postProcessStages.add(_s))},skyStarry:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.viewer.scene.skyAtmosphere.show=!t},illumination:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.viewer.shadows=t,e.viewer._shadows=t},Sunshine:Hb},CameraController:$t,CesiumContainer:ei,setBillboardDefaultUrl:ti,getBillboardDefaultUrl:ii,multiViewportMode:{on:function(e){return St.apply(this,arguments)},off:Et,get2DView:Rt,getSdk:Ht},MouseCoordinate:function(e,t){if(e&&e.viewer){ps=e,(ds=Ht().sdkD)||(ds=rt().sdkD);var i=new bi(e),n=e.proj;if(t){var o=function(){us=requestAnimationFrame(o),r()};rs&&rs.destroy(),ls&&(ls.destroy(),ls=void 0),rs=new K(e),hs=null;var s,a={x:"",y:"",z:""};cs?s=cs:((s=document.createElement("div")).style.position="absolute",s.style["z-index"]=777,s.style.color="#ffffff",s.style.left="0px",s.style.top="0px",s.style.width="100%",s.style.height="100%",s.style["font-size"]="12px",s.style["pointer-events"]="none",s.style.background="url(".concat(i.getSourceRootPath(),"/img/cross.png) no-repeat 100% 100%"),s.style["background-size"]="200% 200%",cs=s),e.viewer.container.appendChild(s),rs.mouse_move((function(t,i){ps=e,hs=function(e){for(var t=1;t

      经度:").concat(d.lng.toFixed(6),"°

      维度:").concat(d.lat.toFixed(6),"°

      海拔:").concat(d.alt.toFixed(2)," m

      ");break;case"度分":s.innerHTML="

      经度:").concat(n.degreesToDMS(d.lng,!0),"

      维度:").concat(n.degreesToDMS(d.lat,!0),"

      海拔:").concat(d.alt.toFixed(2)," m

      ");break;case"度分秒":s.innerHTML="

      经度:").concat(n.degreesToDMS(d.lng,!1),"

      维度:").concat(n.degreesToDMS(d.lat,!1),"

      海拔:").concat(d.alt.toFixed(2)," m

      ")}else{var v=i.convert([{x:d.lng,y:d.lat,z:d.alt}],"EPSG:4326",function(e,t){var i;switch(e){case"EPSG:32601":var n=Math.round((t.lng+180)/6+1);i=t.lat>0?"EPSG:"+(i=32600+n):"EPSG:"+(i=32700+n);break;case"EPSG:4534":i="EPSG:"+(i=Math.round(t.lng/3)-25+4534);break;case"EPSG:4513":i="EPSG:"+(i=Math.round(t.lng/3)-25+4513);break;case"EPSG:4502":var o=Math.floor(t.lng/6)+31;o<13&&(o=13),o>23&&(o=23),i="EPSG:"+(i=o-13+4502);break;case"EPSG:4491":var s=Math.floor(t.lng/6)+31;s<13&&(s=13),s>23&&(s=23),i="EPSG:"+(i=s-13+4491)}return i}(m,d));a=v.points[0],s.innerHTML="

      x:").concat(a.x.toFixed(6),"

      y:").concat(a.y.toFixed(6),"

      z:").concat(a.z.toFixed(6),"

      ")}}else{var g=ui();s.innerHTML="EPSG:4326"===g?"

      经度:-

      维度:-

      海拔:-

      "):"

      x:-

      y:-

      z:-

      ")}}}};o()}else rs&&rs.destroy(),ls&&(ls.destroy(),ls=void 0),cs&&(e.viewer.container.removeChild(cs),cs=void 0),us&&cancelAnimationFrame(us)}},MouseRightMenu:ne,setGroundCover:function(e,t){Jt=!!t,function(e){if(!e)return;for(var t=0;t经度:".concat(Number(s.lng.toFixed(6)),"° \n 纬度:").concat(Number(s.lat.toFixed(6)),"° \n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ");break;case"度分":i.innerHTML="\n 经度:".concat(o.degreesToDMS(s.lng,!0),"\n 纬度:").concat(o.degreesToDMS(s.lat,!0),"\n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ");break;case"度分秒":i.innerHTML="\n 经度:".concat(o.degreesToDMS(s.lng,!1),"\n 纬度:").concat(o.degreesToDMS(s.lat,!1),"\n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ")}else{var a=o.convert([{x:s.lng,y:s.lat,z:s.alt}],"EPSG:4326",hi(Ut,s));i.innerHTML="\n x:".concat(Number(a.points[0].x.toFixed(6)),'\n y:').concat(Number(a.points[0].y.toFixed(6)),'\n z:').concat(Number(a.points[0].z.toFixed(6)),"\n ")}}}},getDMS:pi,setDMS:function(e,t){if("EPSG:4326"===Ut&&(Yt=t,e&&e.viewer&&e.viewer._element)){var i=e.viewer._element.getElementsByClassName("cesium-info")[0];if(Wt&&i){var n=new bi,o=e.proj,s=n.cartesian3Towgs84(Wt,e.viewer);switch(t){case"度":i.innerHTML="\n 经度:".concat(Number(s.lng.toFixed(6)),"° \n 纬度:").concat(Number(s.lat.toFixed(6)),"° \n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ");break;case"度分":i.innerHTML="\n 经度:".concat(o.degreesToDMS(s.lng,!0),"\n 纬度:").concat(o.degreesToDMS(s.lat,!0),"\n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ");break;case"度分秒":i.innerHTML="\n 经度:".concat(o.degreesToDMS(s.lng,!1),"\n 纬度:").concat(o.degreesToDMS(s.lat,!1),"\n 海拔高度:").concat(Number(s.alt.toFixed(2)),"米\n ")}o.degreesToDMS(s.lng,!0)}}},DTH:mn,cameraChanged:function(e,t){var i=new bi;return e.viewer.camera.changed.addEventListener((function(n){t({position:i.cartesian3Towgs84(e.viewer.camera.position,e.viewer),orientation:{heading:e.viewer.camera.heading,pitch:e.viewer.camera.pitch,roll:e.viewer.camera.roll}})}))},setMaximumRequestsPerServer:function(e){"number"==typeof e&&(Cesium.RequestScheduler.maximumRequestsPerServer=e)},setKeyboardEventActive:function(e,t){e&&(e.viewer._disableKeyboardEvent=!t)},setSkin:function(e){document.documentElement.style.setProperty("--color-sdk-base","rgba(0, 55, 55, 1)")},getTheme:function(){return te},setTheme:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=Array.from(te[e].keys());t.forEach((function(t){document.documentElement.style.setProperty(t,te[e].get(t))}))},getCesiumManageIndexexDBState:di,setCesiumManageIndexexDBState:mi,getCesiumIndexedDBMaxSize:function(){var e=Number(Number(localStorage.getItem("IndexedDBMaxSize")).toFixed(0));return(isNaN(e)||e<1073741824)&&(e=1073741824),e},setCesiumIndexedDBMaxSize:function(e){var t=Number(Number(e).toFixed(0));(isNaN(t)||t<1073741824)&&(t=1073741824),Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.SetIndexedDBMaxSize(t),localStorage.setItem("IndexedDBMaxSize",t)},getCesiumIndexedDBCurrentSize:function(){return Cesium.ManageIndexedDB&&Cesium.ManageIndexedDB.GetIndexedDBCurrentSize()},enablePerspective:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t||0==t||(t=1),e.viewer.scene.globe.translucency.frontFaceAlpha=t},closeRotateAround:oi,SheetIndexStatusSwitch:Ne,SheetIndexShangeScale:Be,splitScreen:{on:function(e){return qe.apply(this,arguments)},off:Xe,setActiveId:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(We=Array.isArray(e)?e:[e],Ve&&He){var t=Ve.viewer._element.getElementsByClassName("YJ-custom-checkbox-left")[0],i=Ve.viewer._element.getElementsByClassName("YJ-custom-checkbox-right")[0];if(e&&0!==e.length){if(t&&i){t.style.display="none",i.style.display="none";for(var n=0,o=0,s=0;s16360){var i=e.viewer.camera.positionCartographic;Kt(e,{position:{lng:Cesium.Math.toDegrees(i.longitude),lat:Cesium.Math.toDegrees(i.latitude),alt:16360}},.5)}Qs(e)}else $s(e)},ContourReset:function(){Bs=19,Ls=10,Is="#ffd000",js=!0,Rs=2.5,zs="#43cf7c",Fs=!0,Hs=1.8,Vs="#ff0000",Gs=!1,Ws=1,Us="#64b6d9",Ys=!1,Js=1,qs="#d084d1"}},Measure:{GetMeasureStatus:function(){return YJ.Measure[eC]},SetMeasureStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];YJ.Measure[eC]=e},Clear:function(){YJ.Measure.Measures.forEach((function(e){e.destroy()})),YJ.Measure.Measures=[]},Measures:[],MeasureDistance:lr,MeasureProjectionDistance:dr,MeasureSlopeDistance:yr,MeasureTyArea:_r,MeasureTdArea:Dr,MeasureTriangle:Or,MeasureLocation:Ar,MeasureHeight:jr,MeasureAngle:Fr,MeasureAzimuth:Gr},Draw:{DrawPolyline:Ur,DrawPolygon:fa,DrawPoint:Kr,DrawCircle:$r,DrawElliptic:tl,DrawAttackArrow:nl,DrawPincerArrow:sl,DrawStraightArrow:ll,DrawRect:ul,DrawAssemble:dl,DrawSector:fl,DrawTakeOff:Db,DrawThreeRect:Xr},Analysis:{Clear:function(){YJ.Analysis.AnalysesResults.forEach((function(e){e.destroy()}))},CutFillAnalysis:va,Submerge:Ca,ViewShed:xa,CircleViewShed:Na,SlopeAspect:Ia,Profile:Ra,Visibility:Fa,Contour:Ha,Section:Ua,TerrainExcavation:qa,Flat:$a,AnalysesResults:[],SectionResults:[],ClearSection:function(){YJ.Analysis.SectionResults.forEach((function(e){e.destroy()}))}},CoordTransform:bl,RoutePlanningArrays:[],ClearAllRoutePlanning:function(){YJ.RoutePlanningArrays.forEach((function(e){e.destroy()})),YJ.RoutePlanningArrays=[]}},window.YJ.Obj.LoadObjModel=rb,window.YJ.Obj.BatchLoadObjModel=ub)}]); \ No newline at end of file diff --git a/src/renderer/public/sdk/custom/css/index.css b/src/renderer/public/sdk/custom/css/index.css index fe9901d..23e7778 100644 --- a/src/renderer/public/sdk/custom/css/index.css +++ b/src/renderer/public/sdk/custom/css/index.css @@ -161,7 +161,7 @@ background: rgba(var(--color-sdk-base-rgb), 0.2); border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5); display: flex; - justify-content: center; + justify-content: flex-start; align-items: center; padding: 5px 16px 4px 16px; color: #ffffff; @@ -448,7 +448,6 @@ .YJ-custom-base-dialog>.content .table { background-color: #ffffff00; color: #000; - font-size: 12px; } .YJ-custom-base-dialog>.content .table { @@ -476,6 +475,9 @@ border-top: none; } +.YJ-custom-base-dialog>.content .attribute-content-link .table .tr, +.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr {} + .YJ-custom-base-dialog>.content .table .table-empty { display: flex; align-items: center; @@ -552,6 +554,8 @@ background-color: rgba(var(--color-sdk-base-rgb), 0.1); } +.YJ-custom-base-dialog>.content .table .table-body .tr:last-child {} + .YJ-custom-base-dialog>.content .table .tr .th, .YJ-custom-base-dialog>.content .table .tr .td { flex: 1; @@ -569,7 +573,40 @@ justify-content: center; } +.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .th:nth-child(1), +.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td:nth-child(1), +.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .th:nth-child(1), +.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(1) { + width: 164px; + flex: 0 0 164px; +} +.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .th:nth-child(2), +.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td:nth-child(2), +.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .th:nth-child(2), +.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(2) { + width: 226px; + flex: 0 0 226px; +} + +.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .th:nth-child(3), +.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td:nth-child(3), +.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .th:nth-child(3), +.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(3) { + flex: 0 0 150px; + width: 150px; + justify-content: center; +} + +.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td .input-group .input, +.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td .input-group .input { + border-radius: 5px 0 0 5px; +} + +.YJ-custom-base-dialog>.content .attribute-content-materials .table .tr .th:nth-child(1), +.YJ-custom-base-dialog>.content .attribute-content-materials .table .tr .td:nth-child(1) { + flex: 0 0 60px; +} .YJ-custom-base-dialog>.content .table .tr .td .link-edit { min-height: 32px; @@ -584,8 +621,6 @@ border-right: none; } -<<<<<<< Updated upstream -======= .YJ-custom-base-dialog>.content .table.camera-table { overflow-x: auto; } @@ -648,7 +683,6 @@ min-width: 74px; } ->>>>>>> Stashed changes .YJ-custom-base-dialog>.content select>option { color: #000; } @@ -1171,9 +1205,9 @@ line-height: 28px; } -/* .YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button.ew-color-clear { +.YJ-custom-base-dialog .ew-color-picker .ew-color-dropbtngroup button.ew-color-clear { margin-right: 8px; -} */ +} .YJ-custom-base-dialog .ew-color-picker-box { border-width: 4px; @@ -1735,8 +1769,6 @@ top: 10px; } -<<<<<<< Updated upstream -======= /* 点标注 */ .YJ-custom-base-dialog.billboard-object>.content { width: 590px; @@ -1789,7 +1821,6 @@ height: auto; } ->>>>>>> Stashed changes /* 富文本 */ .richText-box { position: absolute; diff --git a/src/renderer/src/assets/img/mouse.png b/src/renderer/src/assets/img/mouse.png new file mode 100644 index 0000000000000000000000000000000000000000..ed5243989caa8355fe7c163aeace55671e9baa5f GIT binary patch literal 561 zcmV-10?z%3P)Px#1am@3R0s$N2z&@+hyVZq+et)0R7i>Cma%TzFc5~n1RgsGh`e>|bm)*if!QZW z0x(cP?5_~9%gtA-$KfU%g3|gzLR_98bdjye;)oQhKIClq_0HI>BxDUqCIzL7v z4etN-bp-qlteS9h^EVg^7`47GFAMJ~YYV_{YcR)J7>^T_TDB}#R|#ilr_F@cdHw4m zS&E&Q{S)H!hrm}kn+JC8^vm( z2}QEH;unkicXAcssiHYL$hWD?kRZd(G)?{bTtUT#8F}UuTDQ|siT;nC(yTF^e!mxiYpBjx!?a{`T}(}Zbp1Ac4}xit z#_P2w(2!lN1-z=-SicPpkqqbVI%x_)0Yk(@p>^JHr0K&RsWOAs_nx+G*Wf?m^Sm-X zafris{D-o9Je;(Wuzqnk_ltI8Hm5A-y>(!`EljWD>?(|J%x1TIXx|%y^YgF7^t~r1 zZ^2kaksJXEk?WmJx96qsLL}q)`P
      - - - 选择军标库 - +
      + + + 选择军标库 + - + + 创建军标库 + +
      + + - - 创建军标库 - +
      @@ -47,6 +58,7 @@ @node-drag-over="handleDragOver" @node-drag-end="handleDragEnd" @node-drop="handleDrop" + :filter-node-method="filterNode" >