From 3765b9b195d8bdda25a982272045edd30de70b05 Mon Sep 17 00:00:00 2001 From: 06wj <06wj@163.com> Date: Wed, 6 May 2020 13:09:55 +0800 Subject: [PATCH] publish 1.14.0 --- README.md | 4 +- README_ZH.md | 4 +- build/Hilo3d.js | 6 +- build/Hilo3d.single.js | 4 +- build/math.single.js | 4 +- docs/AmbientLight.html | 6 +- docs/Animation.html | 6 +- docs/AnimationStates.html | 162 +++++++++++++++++-- docs/AreaLight.html | 6 +- docs/AxisHelper.html | 6 +- docs/AxisNetHelper.html | 6 +- docs/BasicLoader.html | 6 +- docs/BasicMaterial.html | 6 +- docs/BoxGeometry.html | 6 +- docs/Buffer.html | 6 +- docs/Cache.html | 6 +- docs/Camera.html | 6 +- docs/CameraHelper.html | 6 +- docs/Class.html | 6 +- docs/Color.html | 6 +- docs/CubeTexture.html | 6 +- docs/CubeTextureLoader.html | 6 +- docs/DataTexture.html | 6 +- docs/DirectionalLight.html | 6 +- docs/Euler.html | 6 +- docs/EulerNotifier.html | 6 +- docs/EventMixin.html | 6 +- docs/Fog.html | 6 +- docs/Framebuffer.html | 6 +- docs/Frustum.html | 6 +- docs/GLTFLoader.html | 6 +- docs/GLTFParser.html | 6 +- docs/Geometry.html | 6 +- docs/GeometryData.html | 175 ++++++++++++++++++++- docs/GeometryMaterial.html | 6 +- docs/HDRLoader.html | 6 +- docs/IGLTFExtensionHandler.html | 6 +- docs/KTXLoader.html | 6 +- docs/LazyTexture.html | 6 +- docs/Light.html | 6 +- docs/LightManager.html | 6 +- docs/LoadQueue.html | 6 +- docs/Loader.html | 6 +- docs/Material.html | 6 +- docs/Matrix3.html | 6 +- docs/Matrix4.html | 6 +- docs/Matrix4Notifier.html | 6 +- docs/Mesh.html | 6 +- docs/MeshPicker.html | 6 +- docs/MorphGeometry.html | 6 +- docs/Node.html | 6 +- docs/OrthographicCamera.html | 6 +- docs/PBRMaterial.html | 6 +- docs/PerspectiveCamera.html | 6 +- docs/Plane.html | 6 +- docs/PlaneGeometry.html | 6 +- docs/PointLight.html | 6 +- docs/Program.html | 6 +- docs/Quaternion.html | 6 +- docs/Ray.html | 6 +- docs/RenderInfo.html | 6 +- docs/RenderList.html | 6 +- docs/Shader.html | 6 +- docs/ShaderMaterial.html | 6 +- docs/ShaderMaterialLoader.html | 6 +- docs/SkinedMesh.html | 6 +- docs/SphereGeometry.html | 6 +- docs/SphericalHarmonics3.html | 6 +- docs/SpotLight.html | 6 +- docs/Stage.html | 6 +- docs/Texture.html | 6 +- docs/TextureLoader.html | 6 +- docs/Ticker.html | 6 +- docs/Tween.html | 6 +- docs/Vector2.html | 6 +- docs/Vector3.html | 6 +- docs/Vector3Notifier.html | 6 +- docs/Vector4.html | 6 +- docs/VertexArrayObject.html | 6 +- docs/WebGLRenderer.html | 6 +- docs/WebGLResourceManager.html | 6 +- docs/WebGLState.html | 6 +- docs/WebGLSupport.html | 6 +- docs/animation_Animation.js.html | 6 +- docs/animation_AnimationStates.js.html | 36 ++++- docs/camera_Camera.js.html | 6 +- docs/camera_OrthographicCamera.js.html | 6 +- docs/camera_PerspectiveCamera.js.html | 6 +- docs/capabilities.html | 6 +- docs/constants_index.js.html | 6 +- docs/core_Class.js.html | 6 +- docs/core_EventMixin.js.html | 6 +- docs/core_Fog.js.html | 6 +- docs/core_Mesh.js.html | 6 +- docs/core_Node.js.html | 6 +- docs/core_SkinedMesh.js.html | 6 +- docs/core_Stage.js.html | 6 +- docs/core_Tween.js.html | 6 +- docs/extensions.html | 6 +- docs/geometry_BoxGeometry.js.html | 6 +- docs/geometry_Geometry.js.html | 6 +- docs/geometry_GeometryData.js.html | 20 ++- docs/geometry_MorphGeometry.js.html | 6 +- docs/geometry_PlaneGeometry.js.html | 6 +- docs/geometry_SphereGeometry.js.html | 6 +- docs/glType.html | 6 +- docs/global.html | 6 +- docs/helper_AxisHelper.js.html | 6 +- docs/helper_AxisNetHelper.js.html | 6 +- docs/helper_CameraHelper.js.html | 6 +- docs/index.html | 12 +- docs/light_AmbientLight.js.html | 6 +- docs/light_AreaLight.js.html | 6 +- docs/light_DirectionalLight.js.html | 6 +- docs/light_Light.js.html | 6 +- docs/light_LightManager.js.html | 6 +- docs/light_LightShadow.js.html | 6 +- docs/light_PointLight.js.html | 6 +- docs/light_SpotLight.js.html | 6 +- docs/loader_BasicLoader.js.html | 6 +- docs/loader_CubeTextureLoader.js.html | 6 +- docs/loader_GLTFExtensions.js.html | 6 +- docs/loader_GLTFLoader.js.html | 6 +- docs/loader_GLTFParser.js.html | 8 +- docs/loader_HDRLoader.js.html | 6 +- docs/loader_KTXLoader.js.html | 6 +- docs/loader_LoadCache.js.html | 6 +- docs/loader_LoadQueue.js.html | 6 +- docs/loader_Loader.js.html | 6 +- docs/loader_ShaderMaterialLoader.js.html | 6 +- docs/loader_TextureLoader.js.html | 6 +- docs/log.html | 6 +- docs/material_BasicMaterial.js.html | 6 +- docs/material_GeometryMaterial.js.html | 6 +- docs/material_Material.js.html | 6 +- docs/material_PBRMaterial.js.html | 6 +- docs/material_ShaderMaterial.js.html | 6 +- docs/material_semantic.js.html | 6 +- docs/math.html | 6 +- docs/math_Color.js.html | 6 +- docs/math_Euler.js.html | 6 +- docs/math_EulerNotifier.js.html | 6 +- docs/math_Frustum.js.html | 6 +- docs/math_Matrix3.js.html | 6 +- docs/math_Matrix4.js.html | 6 +- docs/math_Matrix4Notifier.js.html | 6 +- docs/math_Plane.js.html | 6 +- docs/math_Quaternion.js.html | 6 +- docs/math_Ray.js.html | 6 +- docs/math_Sphere.js.html | 6 +- docs/math_SphericalHarmonics3.js.html | 6 +- docs/math_Vector2.js.html | 6 +- docs/math_Vector3.js.html | 6 +- docs/math_Vector3Notifier.js.html | 6 +- docs/math_Vector4.js.html | 6 +- docs/math_math.js.html | 6 +- docs/renderer_Buffer.js.html | 6 +- docs/renderer_Framebuffer.js.html | 6 +- docs/renderer_Program.js.html | 6 +- docs/renderer_RenderInfo.js.html | 6 +- docs/renderer_RenderList.js.html | 6 +- docs/renderer_VertexArrayObject.js.html | 6 +- docs/renderer_WebGLRenderer.js.html | 6 +- docs/renderer_WebGLResourceManager.js.html | 6 +- docs/renderer_WebGLState.js.html | 6 +- docs/renderer_capabilities.js.html | 6 +- docs/renderer_extensions.js.html | 6 +- docs/renderer_glType.js.html | 6 +- docs/semantic.html | 6 +- docs/shader_Shader.js.html | 6 +- docs/texture_CubeTexture.js.html | 6 +- docs/texture_DataTexture.js.html | 6 +- docs/texture_LazyTexture.js.html | 6 +- docs/texture_Texture.js.html | 6 +- docs/utils_Cache.js.html | 6 +- docs/utils_MeshPicker.js.html | 6 +- docs/utils_Ticker.js.html | 6 +- docs/utils_WebGLSupport.js.html | 6 +- docs/utils_log.js.html | 6 +- package.json | 2 +- 180 files changed, 1236 insertions(+), 209 deletions(-) diff --git a/README.md b/README.md index f7c6a338..e40ef2b6 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ English | [简体中文](./README_ZH.md) * use script tag from a [cdn][cdn-url] ``` - + ``` ### Documentation @@ -119,4 +119,4 @@ English | [简体中文](./README_ZH.md) [size-image]:https://img.badgesize.io/hiloteam/hilo3d/master/build/Hilo3d.js.svg?compression=gzip&style=flat-square [ci-url]:https://github.com/hiloteam/Hilo3d/actions?query=workflow%3A%22npm+test%22+branch%3Adev [ci-image]:https://img.shields.io/github/workflow/status/hiloteam/Hilo3d/npm%20test?style=flat-square -[cdn-url]: https://g.alicdn.com/hilo/Hilo3d/1.13.47/Hilo3d.js +[cdn-url]: https://g.alicdn.com/hilo/Hilo3d/1.14.0/Hilo3d.js diff --git a/README_ZH.md b/README_ZH.md index d99b88e2..7b33663f 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -23,7 +23,7 @@ * 使用 script 标签加载 [cdn][cdn-url] ``` - + ``` ### 文档 @@ -120,4 +120,4 @@ [size-image]:https://img.badgesize.io/hiloteam/hilo3d/master/build/Hilo3d.js.svg?compression=gzip&style=flat-square [ci-url]:https://github.com/hiloteam/Hilo3d/actions?query=workflow%3A%22npm+test%22+branch%3Adev [ci-image]:https://img.shields.io/github/workflow/status/hiloteam/Hilo3d/npm%20test?style=flat-square -[cdn-url]: https://g.alicdn.com/hilo/Hilo3d/1.13.47/Hilo3d.js +[cdn-url]: https://g.alicdn.com/hilo/Hilo3d/1.14.0/Hilo3d.js diff --git a/build/Hilo3d.js b/build/Hilo3d.js index a2ee8b78..f194be87 100644 --- a/build/Hilo3d.js +++ b/build/Hilo3d.js @@ -1,5 +1,5 @@ /*! - * Hilo3d 1.13.47 + * Hilo3d 1.14.0 * Copyright (c) 2017-present Alibaba Group Holding Ltd. * @license MIT */ @@ -31,9 +31,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=function(t){e.ARRAY_TYPE=t},e.toRadian=function(t){return t*r},e.equals=function(t,e){return Math.abs(t-e)<=i*Math.max(1,Math.abs(t),Math.abs(e))};var i=e.EPSILON=1e-6;e.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,e.RANDOM=Math.random;var r=Math.PI/180},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.len=e.sqrDist=e.dist=e.div=e.mul=e.sub=void 0,e.create=r,e.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.fromValues=function(t,e,n,r){var s=new i.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=n,s[3]=r,s},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.set=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=s,e.multiply=a,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},e.normalize=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*n+i*i+r*r+s*s;return a>0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=i*a,t[2]=r*a,t[3]=s*a),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=a+i*(n[2]-a),t[3]=o+i*(n[3]-o),t},e.random=function(t,e){var n,r,s,a,o,u;e=e||1;do{o=(n=2*i.RANDOM()-1)*n+(r=2*i.RANDOM()-1)*r}while(o>=1);do{u=(s=2*i.RANDOM()-1)*s+(a=2*i.RANDOM()-1)*a}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*r,t[2]=e*s*c,t[3]=e*a*c,t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*s+n[12]*a,t[1]=n[1]*i+n[5]*r+n[9]*s+n[13]*a,t[2]=n[2]*i+n[6]*r+n[10]*s+n[14]*a,t[3]=n[3]*i+n[7]*r+n[11]*s+n[15]*a,t},e.transformQuat=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2],c=n[3],h=c*i+o*s-u*r,f=c*r+u*i-a*s,l=c*s+a*r-o*i,d=-a*i-o*r-u*s;return t[0]=h*c+d*-a+f*-u-l*-o,t[1]=f*c+d*-o+l*-a-h*-u,t[2]=l*c+d*-u+h*-o-f*-a,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(n*n+i*i+r*r+s*s)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return n*n+i*i+r*r+s*s}function h(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.sqrt(e*e+n*n+i*i+r*r)}function f(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.len=h,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=4),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;u1?0:r<-1?Math.PI:Math.acos(r)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=e[0],o=e[1],u=e[2];return Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-u)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(3);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function a(t,e,n){var r=new i.ARRAY_TYPE(3);return r[0]=t,r[1]=e,r[2]=n,r}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(n*n+i*i+r*r)}function f(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}function l(t){var e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i}function d(t,e){var n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function m(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=h,e.sqrDist=f,e.len=s,e.sqrLen=l,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=3),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;ui.EPSILON?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=h,e.rotateX=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+a*o,t[1]=r*u+s*o,t[2]=s*u-r*o,t[3]=a*u-i*o,t},e.rotateY=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u-s*o,t[1]=r*u+a*o,t[2]=s*u+i*o,t[3]=a*u-r*o,t},e.rotateZ=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+r*o,t[1]=r*u-i*o,t[2]=s*u+a*o,t[3]=a*u-s*o,t},e.calculateW=function(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t},e.slerp=f,e.random=function(t){var e=i.RANDOM(),n=i.RANDOM(),r=i.RANDOM(),s=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*n),t[1]=s*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*n+i*i+r*r+s*s,o=a?1/a:0;return t[0]=-n*o,t[1]=-i*o,t[2]=-r*o,t[3]=s*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,i){var r=.5*Math.PI/180;e*=r,n*=r,i*=r;var s=Math.sin(e),a=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(i),h=Math.cos(i);return t[0]=s*u*h-a*o*c,t[1]=a*o*h+s*u*c,t[2]=a*u*c-s*o*h,t[3]=a*u*h+s*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var i=o(n(0)),r=o(n(5)),s=o(n(2)),a=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function h(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*h+a*o+r*c-s*u,t[1]=r*h+a*u+s*o-i*c,t[2]=s*h+a*c+i*u-r*o,t[3]=a*h-i*o-r*u-s*c,t}function f(t,e,n,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=n[0],h=n[1],f=n[2],l=n[3],d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return(m=s*c+a*h+o*f+u*l)<0&&(m=-m,c=-c,h=-h,f=-f,l=-l),1-m>i.EPSILON?(d=Math.acos(m),_=Math.sin(d),p=Math.sin((1-r)*d)/_,g=Math.sin(r*d)/_):(p=1-r,g=r),t[0]=p*s+g*c,t[1]=p*a+g*h,t[2]=p*o+g*f,t[3]=p*u+g*l,t}function l(t,e){var n=e[0]+e[4]+e[8],i=void 0;if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,a=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*a+a]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*s+a]-e[3*a+s])*i,t[s]=(e[3*s+r]+e[3*r+s])*i,t[a]=(e[3*a+r]+e[3*r+a])*i}return t}e.clone=a.clone,e.fromValues=a.fromValues,e.copy=a.copy,e.set=a.set,e.add=a.add,e.mul=h,e.scale=a.scale,e.dot=a.dot,e.lerp=a.lerp;var d=e.length=a.length,m=(e.len=d,e.squaredLength=a.squaredLength),_=(e.sqrLen=m,e.normalize=a.normalize);e.exactEquals=a.exactEquals,e.equals=a.equals,e.rotationTo=function(){var t=s.create(),e=s.fromValues(1,0,0),n=s.fromValues(0,1,0);return function(i,r,a){var o=s.dot(r,a);return o<-.999999?(s.cross(t,e,r),s.len(t)<1e-6&&s.cross(t,n,r),s.normalize(t,t),c(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(s.cross(t,r,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,_(i,i))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,i,r,s,a,o){return f(t,i,a,o),f(e,r,s,o),f(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=r.create();return function(e,n,i,r){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=r[0],t[4]=r[1],t[7]=r[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],_(e,l(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(16);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,r,s,a,o,u,c,h,f,l,d,m,_,p){var g=new i.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=s,g[5]=a,g[6]=o,g[7]=u,g[8]=c,g[9]=h,g[10]=f,g[11]=l,g[12]=d,g[13]=m,g[14]=_,g[15]=p,g},e.set=function(t,e,n,i,r,s,a,o,u,c,h,f,l,d,m,_,p){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t[9]=h,t[10]=f,t[11]=l,t[12]=d,t[13]=m,t[14]=_,t[15]=p,t},e.identity=r,e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],s=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=r,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,E=n*u-r*a,T=n*c-s*a,M=i*u-r*o,A=i*c-s*o,I=r*c-s*u,L=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-E*y+T*R+M*S-A*O+I*L;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(r*y-i*x-s*R)*N,t[2]=(_*I-p*A+g*M)*N,t[3]=(l*A-f*I-d*M)*N,t[4]=(u*S-a*x-c*O)*N,t[5]=(n*x-r*S+s*O)*N,t[6]=(p*T-m*I-g*E)*N,t[7]=(h*I-l*T+d*E)*N,t[8]=(a*y-o*S+c*L)*N,t[9]=(i*S-n*y-s*L)*N,t[10]=(m*A-_*T+g*v)*N,t[11]=(f*T-h*A-d*v)*N,t[12]=(o*O-a*R-u*L)*N,t[13]=(n*R-i*O+r*L)*N,t[14]=(_*E-m*M-p*v)*N,t[15]=(h*M-f*E+l*v)*N,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15];return t[0]=o*(l*g-d*p)-f*(u*g-c*p)+_*(u*d-c*l),t[1]=-(i*(l*g-d*p)-f*(r*g-s*p)+_*(r*d-s*l)),t[2]=i*(u*g-c*p)-o*(r*g-s*p)+_*(r*c-s*u),t[3]=-(i*(u*d-c*l)-o*(r*d-s*l)+f*(r*c-s*u)),t[4]=-(a*(l*g-d*p)-h*(u*g-c*p)+m*(u*d-c*l)),t[5]=n*(l*g-d*p)-h*(r*g-s*p)+m*(r*d-s*l),t[6]=-(n*(u*g-c*p)-a*(r*g-s*p)+m*(r*c-s*u)),t[7]=n*(u*d-c*l)-a*(r*d-s*l)+h*(r*c-s*u),t[8]=a*(f*g-d*_)-h*(o*g-c*_)+m*(o*d-c*f),t[9]=-(n*(f*g-d*_)-h*(i*g-s*_)+m*(i*d-s*f)),t[10]=n*(o*g-c*_)-a*(i*g-s*_)+m*(i*c-s*o),t[11]=-(n*(o*d-c*f)-a*(i*d-s*f)+h*(i*c-s*o)),t[12]=-(a*(f*p-l*_)-h*(o*p-u*_)+m*(o*l-u*f)),t[13]=n*(f*p-l*_)-h*(i*p-r*_)+m*(i*l-r*f),t[14]=-(n*(o*p-u*_)-a*(i*p-r*_)+m*(i*u-r*o)),t[15]=n*(o*l-u*f)-a*(i*l-r*f)+h*(i*u-r*o),t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8],h=t[9],f=t[10],l=t[11],d=t[12],m=t[13],_=t[14],p=t[15];return(e*a-n*s)*(f*p-l*_)-(e*o-i*s)*(h*p-l*m)+(e*u-r*s)*(h*_-f*m)+(n*o-i*a)*(c*p-l*d)-(n*u-r*a)*(c*_-f*d)+(i*u-r*o)*(c*m-h*d)},e.multiply=s,e.translate=function(t,e,n){var i=n[0],r=n[1],s=n[2],a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],u=e[2],c=e[3],h=e[4],f=e[5],l=e[6],d=e[7],m=e[8],_=e[9],p=e[10],g=e[11],t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=h,t[5]=f,t[6]=l,t[7]=d,t[8]=m,t[9]=_,t[10]=p,t[11]=g,t[12]=a*i+h*r+m*s+e[12],t[13]=o*i+f*r+_*s+e[13],t[14]=u*i+l*r+p*s+e[14],t[15]=c*i+d*r+g*s+e[15]),t},e.scale=function(t,e,n){var i=n[0],r=n[1],s=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,r){var s,a,o,u,c,h,f,l,d,m,_,p,g,v,E,T,M,A,I,L,O,S,R,y,x=r[0],N=r[1],b=r[2],w=Math.sqrt(x*x+N*N+b*b);return w0?(n[0]=2*(c*u+l*r+h*o-f*s)/d,n[1]=2*(h*u+l*s+f*r-c*o)/d,n[2]=2*(f*u+l*o+c*s-h*r)/d):(n[0]=2*(c*u+l*r+h*o-f*s),n[1]=2*(h*u+l*s+f*r-c*o),n[2]=2*(f*u+l*o+c*s-h*r)),a(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[4],a=e[5],o=e[6],u=e[8],c=e[9],h=e[10];return t[0]=Math.sqrt(n*n+i*i+r*r),t[1]=Math.sqrt(s*s+a*a+o*o),t[2]=Math.sqrt(u*u+c*c+h*h),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],i=0;return n>0?(i=2*Math.sqrt(n+1),t[3]=.25*i,t[0]=(e[6]-e[9])/i,t[1]=(e[8]-e[2])/i,t[2]=(e[1]-e[4])/i):e[0]>e[5]&&e[0]>e[10]?(i=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/i,t[0]=.25*i,t[1]=(e[1]+e[4])/i,t[2]=(e[8]+e[2])/i):e[5]>e[10]?(i=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/i,t[0]=(e[1]+e[4])/i,t[1]=.25*i,t[2]=(e[6]+e[9])/i):(i=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/i,t[0]=(e[8]+e[2])/i,t[1]=(e[6]+e[9])/i,t[2]=.25*i),t},e.fromRotationTranslationScale=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3],u=r+r,c=s+s,h=a+a,f=r*u,l=r*c,d=r*h,m=s*c,_=s*h,p=a*h,g=o*u,v=o*c,E=o*h,T=i[0],M=i[1],A=i[2];return t[0]=(1-(m+p))*T,t[1]=(l+E)*T,t[2]=(d-v)*T,t[3]=0,t[4]=(l-E)*M,t[5]=(1-(f+p))*M,t[6]=(_+g)*M,t[7]=0,t[8]=(d+v)*A,t[9]=(_-g)*A,t[10]=(1-(f+m))*A,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,i,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=s+s,h=a+a,f=o+o,l=s*c,d=s*h,m=s*f,_=a*h,p=a*f,g=o*f,v=u*c,E=u*h,T=u*f,M=i[0],A=i[1],I=i[2],L=r[0],O=r[1],S=r[2],R=(1-(_+g))*M,y=(d+T)*M,x=(m-E)*M,N=(d-T)*A,b=(1-(l+g))*A,w=(p+v)*A,C=(m+E)*I,P=(p-v)*I,H=(1-(l+_))*I;return t[0]=R,t[1]=y,t[2]=x,t[3]=0,t[4]=N,t[5]=b,t[6]=w,t[7]=0,t[8]=C,t[9]=P,t[10]=H,t[11]=0,t[12]=n[0]+L-(R*L+N*O+C*S),t[13]=n[1]+O-(y*L+b*O+P*S),t[14]=n[2]+S-(x*L+w*O+H*S),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[1]=h+g,t[2]=l-p,t[3]=0,t[4]=h-g,t[5]=1-c-m,t[6]=d+_,t[7]=0,t[8]=l+p,t[9]=d-_,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,i,r,s,a){var o=1/(n-e),u=1/(r-i),c=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(r+i)*u,t[10]=(a+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*c,t[15]=0,t},e.perspective=function(t,e,n,i,r){var s=1/Math.tan(e/2),a=void 0;return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(a=1/(i-r),t[10]=(r+i)*a,t[14]=2*r*i*a):(t[10]=-1,t[14]=-2*i),t},e.perspectiveFromFieldOfView=function(t,e,n,i){var r=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+o),c=2/(r+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-o)*u*.5,t[9]=(r-s)*c*.5,t[10]=i/(n-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*n/(n-i),t[15]=0,t},e.ortho=function(t,e,n,i,r,s,a){var o=1/(e-n),u=1/(i-r),c=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(r+i)*u,t[14]=(a+s)*c,t[15]=1,t},e.lookAt=function(t,e,n,s){var a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=e[0],g=e[1],v=e[2],E=s[0],T=s[1],M=s[2],A=n[0],I=n[1],L=n[2];return Math.abs(p-A)0&&(h*=d=1/Math.sqrt(d),f*=d,l*=d);var m=u*l-c*f,_=c*h-o*l,p=o*f-u*h;return(d=m*m+_*_+p*p)>0&&(m*=d=1/Math.sqrt(d),_*=d,p*=d),t[0]=m,t[1]=_,t[2]=p,t[3]=0,t[4]=f*p-l*_,t[5]=l*m-h*p,t[6]=h*_-f*m,t[7]=0,t[8]=h,t[9]=f,t[10]=l,t[11]=0,t[12]=r,t[13]=s,t[14]=a,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t[9]=e[9]+n[9]*i,t[10]=e[10]+n[10]*i,t[11]=e[11]+n[11]*i,t[12]=e[12]+n[12]*i,t[13]=e[13]+n[13]*i,t[14]=e[14]+n[14]*i,t[15]=e[15]+n[15]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=t[9],d=t[10],m=t[11],_=t[12],p=t[13],g=t[14],v=t[15],E=e[0],T=e[1],M=e[2],A=e[3],I=e[4],L=e[5],O=e[6],S=e[7],R=e[8],y=e[9],x=e[10],N=e[11],b=e[12],w=e[13],C=e[14],P=e[15];return Math.abs(n-E)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(E))&&Math.abs(r-T)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(T))&&Math.abs(s-M)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(a-A)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(o-I)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(u-L)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(L))&&Math.abs(c-O)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(h-S)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-R)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(R))&&Math.abs(l-y)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(d-x)<=i.EPSILON*Math.max(1,Math.abs(d),Math.abs(x))&&Math.abs(m-N)<=i.EPSILON*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(_-b)<=i.EPSILON*Math.max(1,Math.abs(_),Math.abs(b))&&Math.abs(p-w)<=i.EPSILON*Math.max(1,Math.abs(p),Math.abs(w))&&Math.abs(g-C)<=i.EPSILON*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(v-P)<=i.EPSILON*Math.max(1,Math.abs(v),Math.abs(P))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function s(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],_=e[12],p=e[13],g=e[14],v=e[15],E=n[0],T=n[1],M=n[2],A=n[3];return t[0]=E*i+T*o+M*f+A*_,t[1]=E*r+T*u+M*l+A*p,t[2]=E*s+T*c+M*d+A*g,t[3]=E*a+T*h+M*m+A*v,E=n[4],T=n[5],M=n[6],A=n[7],t[4]=E*i+T*o+M*f+A*_,t[5]=E*r+T*u+M*l+A*p,t[6]=E*s+T*c+M*d+A*g,t[7]=E*a+T*h+M*m+A*v,E=n[8],T=n[9],M=n[10],A=n[11],t[8]=E*i+T*o+M*f+A*_,t[9]=E*r+T*u+M*l+A*p,t[10]=E*s+T*c+M*d+A*g,t[11]=E*a+T*h+M*m+A*v,E=n[12],T=n[13],M=n[14],A=n[15],t[12]=E*i+T*o+M*f+A*_,t[13]=E*r+T*u+M*l+A*p,t[14]=E*s+T*c+M*d+A*g,t[15]=E*a+T*h+M*m+A*v,t}function a(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=i+i,u=r+r,c=s+s,h=i*o,f=i*u,l=i*c,d=r*u,m=r*c,_=s*c,p=a*o,g=a*u,v=a*c;return t[0]=1-(d+_),t[1]=f+v,t[2]=l-g,t[3]=0,t[4]=f-v,t[5]=1-(h+_),t[6]=m+p,t[7]=0,t[8]=l+g,t[9]=m-p,t[10]=1-(h+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=s,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(9);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new i.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,r,s,a,o,u,c){var h=new i.ARRAY_TYPE(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=r,h[4]=s,h[5]=a,h[6]=o,h[7]=u,h[8]=c,h},e.set=function(t,e,n,i,r,s,a,o,u,c){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=h*a-o*c,l=-h*s+o*u,d=c*s-a*u,m=n*f+i*l+r*d;return m?(m=1/m,t[0]=f*m,t[1]=(-h*i+r*c)*m,t[2]=(o*i-r*a)*m,t[3]=l*m,t[4]=(h*n-r*u)*m,t[5]=(-o*n+r*s)*m,t[6]=d*m,t[7]=(-c*n+i*u)*m,t[8]=(a*n-i*s)*m,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-o*c,t[1]=r*c-i*h,t[2]=i*o-r*a,t[3]=o*u-s*h,t[4]=n*h-r*u,t[5]=r*s-n*o,t[6]=s*c-a*u,t[7]=i*u-n*c,t[8]=n*a-i*s,t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8];return e*(c*s-a*u)+n*(-c*r+a*o)+i*(u*r-s*o)},e.multiply=r,e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=l*i+d*a+c,t[7]=l*r+d*o+h,t[8]=l*s+d*u+f,t},e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=Math.sin(n),d=Math.cos(n);return t[0]=d*i+l*a,t[1]=d*r+l*o,t[2]=d*s+l*u,t[3]=d*a-l*i,t[4]=d*o-l*r,t[5]=d*u-l*s,t[6]=c,t[7]=h,t[8]=f,t},e.scale=function(t,e,n){var i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[3]=h-g,t[6]=l+p,t[1]=h+g,t[4]=1-c-m,t[7]=d-_,t[2]=l-p,t[5]=d+_,t[8]=1-c-f,t},e.normalFromMat4=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,E=n*u-r*a,T=n*c-s*a,M=i*u-r*o,A=i*c-s*o,I=r*c-s*u,L=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-E*y+T*R+M*S-A*O+I*L;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(u*S-a*x-c*O)*N,t[2]=(a*y-o*S+c*L)*N,t[3]=(r*y-i*x-s*R)*N,t[4]=(n*x-r*S+s*O)*N,t[5]=(i*S-n*y-s*L)*N,t[6]=(_*I-p*A+g*M)*N,t[7]=(p*T-m*I-g*E)*N,t[8]=(m*A-_*T+g*v)*N,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=e[0],d=e[1],m=e[2],_=e[3],p=e[4],g=e[5],v=e[6],E=e[7],T=e[8];return Math.abs(n-l)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-d)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(s-m)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-_)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-p)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(u-g)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-v)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-E)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(f-T)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(T))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1],m=n[2],_=n[3],p=n[4],g=n[5],v=n[6],E=n[7],T=n[8];return t[0]=l*i+d*a+m*c,t[1]=l*r+d*o+m*h,t[2]=l*s+d*u+m*f,t[3]=_*i+p*a+g*c,t[4]=_*r+p*o+g*h,t[5]=_*s+p*u+g*f,t[6]=v*i+E*a+T*c,t[7]=v*r+E*o+T*h,t[8]=v*s+E*u+T*f,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=r,e.clone=function(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new i.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=s,e.multiply=a,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],i=e[1],r=n*n+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},e.lerp=function(t,e,n,i){var r=e[0],s=e[1];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t},e.random=function(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t},e.transformMat2d=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},e.transformMat3=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t},e.rotate=function(t,e,n,i){var r=e[0]-n[0],s=e[1]-n[1],a=Math.sin(i),o=Math.cos(i);return t[0]=r*o-s*a+n[0],t[1]=r*a+s*o+n[1],t},e.angle=function(t,e){var n=t[0],i=t[1],r=e[0],s=e[1],a=n*n+i*i;a>0&&(a=1/Math.sqrt(a));var o=r*r+s*s;o>0&&(o=1/Math.sqrt(o));var u=(n*r+i*s)*a*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],r=t[1],s=e[0],a=e[1];return Math.abs(n-s)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(2);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1];return n*n+i*i}function h(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function f(t){var e=t[0],n=t[1];return e*e+n*n}e.len=h,e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=2),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;u0){n=Math.sqrt(n);var i=e[0]/n,r=e[1]/n,s=e[2]/n,a=e[3]/n,o=e[4],u=e[5],c=e[6],h=e[7],f=i*o+r*u+s*c+a*h;t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=(o-i*f)/n,t[5]=(u-r*f)/n,t[6]=(c-s*f)/n,t[7]=(h-a*f)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=e[0],l=e[1],d=e[2],m=e[3],_=e[4],p=e[5],g=e[6],v=e[7];return Math.abs(n-f)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-l)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(s-d)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-m)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(o-_)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(u-p)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))&&Math.abs(c-g)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(h-v)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))};var i=a(n(0)),r=a(n(3)),s=a(n(4));function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var i=.5*n[0],r=.5*n[1],s=.5*n[2],a=e[0],o=e[1],u=e[2],c=e[3];return t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=i*c+r*u-s*o,t[5]=r*c+s*a-i*u,t[6]=s*c+i*o-r*a,t[7]=-i*a-r*o-s*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[4],u=n[5],c=n[6],h=n[7],f=e[4],l=e[5],d=e[6],m=e[7],_=n[0],p=n[1],g=n[2],v=n[3];return t[0]=i*v+a*_+r*g-s*p,t[1]=r*v+a*p+s*_-i*g,t[2]=s*v+a*g+i*p-r*_,t[3]=a*v-i*_-r*p-s*g,t[4]=i*h+a*o+r*c-s*u+f*v+m*_+l*g-d*p,t[5]=r*h+a*u+s*o-i*c+l*v+m*p+d*_-f*g,t[6]=s*h+a*c+i*u-r*o+d*v+m*g+f*p-l*_,t[7]=a*h-i*o-r*u-s*c+m*v-f*_-l*p-d*g,t}e.getReal=r.copy,e.setReal=r.copy,e.mul=c;var h=e.dot=r.dot,f=e.length=r.length,l=(e.len=f,e.squaredLength=r.squaredLength);e.sqrLen=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(6);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,r,s,a){var o=new i.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o[4]=s,o[5]=a,o},e.set=function(t,e,n,i,r,s,a){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=n*s-i*r;return u?(u=1/u,t[0]=s*u,t[1]=-i*u,t[2]=-r*u,t[3]=n*u,t[4]=(r*o-s*a)*u,t[5]=(i*a-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=Math.sin(n),h=Math.cos(n);return t[0]=i*h+s*c,t[1]=r*h+a*c,t[2]=i*-c+s*h,t[3]=r*-c+a*h,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i*c,t[1]=r*c,t[2]=s*h,t[3]=a*h,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=i*c+s*h+o,t[5]=r*c+a*h+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=e[0],h=e[1],f=e[2],l=e[3],d=e[4],m=e[5];return Math.abs(n-c)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(r-h)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(s-f)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-l)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-d)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-m)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1],f=n[2],l=n[3],d=n[4],m=n[5];return t[0]=i*c+s*h,t[1]=r*c+a*h,t[2]=i*f+s*l,t[3]=r*f+a*l,t[4]=i*d+s*m+o,t[5]=r*d+a*m+u,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,r){var s=new i.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=n,s[3]=r,s},e.set=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*s-r*i;return a?(a=1/a,t[0]=s*a,t[1]=-i*a,t[2]=-r*a,t[3]=n*a,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+s*o,t[1]=r*u+a*o,t[2]=i*-o+s*u,t[3]=r*-o+a*u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1];return t[0]=i*o,t[1]=r*o,t[2]=s*u,t[3]=a*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,i){return t[2]=i[2]/i[0],n[0]=i[0],n[1]=i[1],n[3]=i[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=s,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*o+s*u,t[1]=r*o+a*u,t[2]=i*c+s*h,t[3]=r*c+a*h,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var i=d(n(0)),r=d(n(9)),s=d(n(8)),a=d(n(5)),o=d(n(4)),u=d(n(3)),c=d(n(7)),h=d(n(6)),f=d(n(2)),l=d(n(1));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=i,e.mat2=r,e.mat2d=s,e.mat3=a,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=h,e.vec3=f,e.vec4=l}])},function(t,e,n){"use strict";var i=n(19),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i={};n.r(i),n.d(i,"POSITION",(function(){return u})),n.d(i,"NORMAL",(function(){return c})),n.d(i,"DEPTH",(function(){return h})),n.d(i,"DISTANCE",(function(){return f}));var r=n(35),s=n.n(r).a,a=n(36),o=n.n(a).a,u="POSITION",c="NORMAL",h="DEPTH",f="DISTANCE",l={webgl:s,webglExtensions:o,Hilo:i};Object.assign(l,s,o,i);e.a=l},function(t,e,n){"use strict";var i={},r={_cache:i,level:3,LEVEL_LOG:3,LEVEL_WARN:2,LEVEL_ERROR:1,LEVEL_NONE:0,log:function(){return this.level>=3&&console.log.apply(console,arguments),this},warn:function(){return this.level>=2&&console.warn.apply(console,arguments),this},error:function(){return this.level>=1&&console.error.apply(console,arguments),this},logOnce:function(t){return i["log_"+t]||(i["log_"+t]=!0,this.log.apply(this,Array.prototype.slice.call(arguments,1))),this},warnOnce:function(t){return i["warn_"+t]||(i["warn_"+t]=!0,this.warn.apply(this,Array.prototype.slice.call(arguments,1))),this},errorOnce:function(t){return i["error_"+t]||(i["error_"+t]=!0,this.error.apply(this,Array.prototype.slice.call(arguments,1))),this}};e.a=r},function(t,e,n){"use strict";n.r(e),n.d(e,"each",(function(){return p})),n.d(e,"getRelativePath",(function(){return d})),n.d(e,"convertUint8ArrayToString",(function(){return m})),n.d(e,"getExtension",(function(){return _})),n.d(e,"getIndexFromSortedArray",(function(){return g})),n.d(e,"insertToSortedArray",(function(){return v})),n.d(e,"padLeft",(function(){return E})),n.d(e,"getTypedArrayClass",(function(){return I})),n.d(e,"copyArrayData",(function(){return L})),n.d(e,"isStrOrNumber",(function(){return O})),n.d(e,"getTypedArrayGLType",(function(){return T})),n.d(e,"getBlobUrl",(function(){return y})),n.d(e,"isBlobUrl",(function(){return S})),n.d(e,"revokeBlobUrl",(function(){return R})),n.d(e,"isArrayLike",(function(){return x})),n.d(e,"getElementRect",(function(){return N})),n.d(e,"serialRun",(function(){return b})),n.d(e,"hasOwnProperty",(function(){return w}));var i=n(3),r=n(2);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a,o=r.a.BYTE,u=r.a.UNSIGNED_BYTE,c=r.a.SHORT,h=r.a.UNSIGNED_SHORT,f=r.a.UNSIGNED_INT,l=r.a.FLOAT;function d(t,e){if(/^(?:http|blob|data:|\/)/.test(e))return e;var n;for(t=t.replace(/\/[^/]*?$/,"").split("/"),e=e.split("/"),n=0;n>1,a=n(t[s],e);if(0===a)return[s,s];a<0?i=s+1:r=s-1}return i>r?[r,i]:[i,r]}function v(t,e,n){var i=g(t,e,n);t.splice(i[1],0,e)}function E(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?h:t instanceof Uint32Array?f:l}var M,A,I=(s(M={},o,Int8Array),s(M,u,Uint8Array),s(M,c,Int16Array),s(M,h,Uint16Array),s(M,f,Uint32Array),s(M,l,Float32Array),A=M,function(t){return A[t]||Float32Array});function L(t,e,n,i,r){if(t&&e){e.isGeometryData&&(e=e.data);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,i){return t.then((function(){return e(n,i)}))}),Promise.resolve())}function w(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec3.round(this.elements,this.elements),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},random:function(t){return i.vec3.random(this.elements,t),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i,r={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(i=0,function(t){var e=++i;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=r},function(t,e,n){"use strict";var i,r=n(0),s=n(1),a=n(5),o=n(10),u=new a.a,c=new a.a,h=s.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=r.mat4.create()},copy:function(t){return r.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this},identity:function(){return r.mat4.identity(this.elements),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,i){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],h=n[1],f=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=h*m-f*d,g=f*l-o*m,v=o*d-h*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=h*m-f*d)*p+(g=f*l-(o+=1e-7)*m)*g+(v=o*d-h*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new h),this.determinant()<0&&(n.x*=-1),i.copy(this),u.inverse(n),i.scale(u),t.fromMat4(i),r&&r.set(0,0,0),this}});h.prototype.sub=h.prototype.subtract,h.prototype.mul=h.prototype.multiply,e.a=h},function(t,e,n){"use strict";var i=n(1),r=n(12),s=n(4),a=i.a.create({Extends:r.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;a.superclass.constructor.call(this,t,e,n,i)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(s.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(s.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=a},function(t,e,n){"use strict";var i=n(37),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i=n(0),r=n(11),s=n(1),a=n(9),o=new r.a,u=s.a.create({Mixes:a.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=i.quat.fromValues(t,e,n,r)},copy:function(t,e){return i.quat.copy(this.elements,t.elements),e||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=this.elements;return i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],n||this.fire("update"),this},set:function(t,e,n,r,s){return i.quat.set(this.elements,t,e,n,r),s||this.fire("update"),this},identity:function(t){return i.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,e,n){return i.quat.rotationTo(this.elements,t.elements,e.elements),n||this.fire("update"),this},setAxes:function(t,e,n,r){return i.quat.setAxes(this.elements,t.elements,e.elements,n.elements),r||this.fire("update"),this},setAxisAngle:function(t,e,n){return i.quat.setAxisAngle(this.elements,t.elements,e),n||this.fire("update"),this},getAxisAngle:function(t){return i.quat.getAxisAngle(t.elements,this.elements)},add:function(t,e){return i.quat.add(this.elements,this.elements,t.elements),e||this.fire("update"),this},multiply:function(t,e){return i.quat.multiply(this.elements,this.elements,t.elements),e||this.fire("update"),this},premultiply:function(t,e){return i.quat.multiply(this.elements,t.elements,this.elements),e||this.fire("update"),this},scale:function(t,e){return i.quat.scale(this.elements,this.elements,t),e||this.fire("update"),this},rotateX:function(t,e){return i.quat.rotateX(this.elements,this.elements,t),e||this.fire("update"),this},rotateY:function(t,e){return i.quat.rotateY(this.elements,this.elements,t),e||this.fire("update"),this},rotateZ:function(t,e){return i.quat.rotateZ(this.elements,this.elements,t),e||this.fire("update"),this},calculateW:function(t){return i.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return i.quat.dot(this.elements,t.elements)},lerp:function(t,e,n){return i.quat.lerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},slerp:function(t,e,n){return i.quat.slerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},sqlerp:function(t,e,n,r,s,a){return i.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,r.elements,s),a||this.fire("update"),this},invert:function(t){return i.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return i.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return i.quat.length(this.elements)},squaredLength:function(){return i.quat.squaredLength(this.elements)},normalize:function(t){return i.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,e){return i.quat.fromMat3(this.elements,t.elements),e||this.fire("update"),this},fromMat4:function(t,e){return o.fromMat4(t),this.fromMat3(o,e),this},exactEquals:function(t){return i.quat.exactEquals(this.elements,t.elements)},equals:function(t){return i.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,i=.5*t.y,r=.5*t.z,s=t.order||"ZYX",a=Math.sin(n),o=Math.cos(n),u=Math.sin(i),c=Math.cos(i),h=Math.sin(r),f=Math.cos(r),l=this.elements;return"XYZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"YXZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"ZXY"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"ZYX"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"YZX"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f-a*u*h):"XZY"===s&&(l[0]=a*c*f-o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f+a*u*h),e||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});u.prototype.mul=u.prototype.multiply,u.prototype.len=u.prototype.length,u.prototype.sqrLen=u.prototype.squaredLength,e.a=u},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=i.mat3.create()},copy:function(t){return i.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)n[i]=t[e+i];return this},set:function(t,e,n,r,s,a,o,u,c){return i.mat3.set(this.elements,t,e,n,r,s,a,o,u,c),this},identity:function(){return i.mat3.identity(this.elements),this},transpose:function(){return i.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return i.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return i.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return i.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return i.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return i.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return i.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return i.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return i.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return i.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,i,r){var s=Math.cos(t),a=Math.sin(t);return this.set(i*s,-r*a,0,i*a,r*s,0,e,n,1),this}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,e.a=r},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=i.vec4.fromValues(t,e,n,r)},copy:function(t){return i.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,r){return i.vec4.set(this.elements,t,e,n,r),this},add:function(t,e){return e||(e=t,t=this),i.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec4.ceil(this.elements,this.elements),this},floor:function(){return i.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec4.round(this.elements,this.elements),this},scale:function(t){return i.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec4.squaredDistance(t.elements,e.elements)},length:function(){return i.vec4.length(this.elements)},squaredLength:function(){return i.vec4.squaredLength(this.elements)},negate:function(){return i.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec4.inverse(this.elements,t.elements),this},normalize:function(){return i.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return i.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return i.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return i.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i=n(1),r=n(6),s=n(7),a=n(3),o=new s.a,u=r.a.DEG2RAD,c=r.a.RAD2DEG,h=i.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,i=n[0],s=n[1],o=n[2],u=n[4],c=n[5],h=n[6],f=n[8],l=n[9],d=n[10];e=e||this.order,this.order=e;var m=r.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-u,i)):(this.elements[0]=Math.atan2(h,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(f,d),this.elements[2]=Math.atan2(s,c)):(this.elements[1]=Math.atan2(-o,i),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[1]=Math.atan2(-o,d),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(s,i))):"ZYX"===e?(this.elements[1]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(h,d),this.elements[2]=Math.atan2(s,i)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(m(s,-1,1)),Math.abs(s)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-o,i)):(this.elements[0]=0,this.elements[1]=Math.atan2(f,d))):"XZY"===e?(this.elements[2]=Math.asin(-m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(h,c),this.elements[1]=Math.atan2(f,i)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):a.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=h},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=i.vec2.fromValues(t,e)},copy:function(t){return i.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return i.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),i.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec2.ceil(this.elements,this.elements),this},floor:function(){return i.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec2.round(this.elements,this.elements),this},scale:function(t){return i.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec2.squaredDistance(t.elements,e.elements)},length:function(){return i.vec2.length(this.elements)},squaredLength:function(){return i.vec2.squaredLength(this.elements)},negate:function(){return i.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec2.inverse(this.elements,t.elements),this},normalize:function(){return i.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return i.vec2.random(this.elements,t),this},transformMat3:function(t){return i.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e){t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){function i(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.indices=e,this.mode=n,this.attrs=[],this.attrIndexMap={}}return r(t,null,[{key:"cp",value:function(t){return t}},{key:"minus",value:function(t,e){return t-e}},{key:"plus",value:function(t,e){return t+e}},{key:"pp",value:function(t,e,n,i){return i-e-n+t}},{key:"depp",value:function(t,e,n,i){return e+n-t+i}},{key:"ATTR",get:function(){return a}},{key:"ATTR_NAME_ID",get:function(){return u}}]),r(t,[{key:"getAttrLength",value:function(){return this.attrs[0].data.length/this.attrs[0].itemCount}},{key:"attrIdToName",value:function(t){return o[t]||"OTHER"}},{key:"addAttr",value:function(t,e,n){a[t]?(this.attrIndexMap[t]=this.attrs.length,n||(n=f[t])):n||(n=1),this.attrs.push({name:t,itemCount:n,data:e})}},{key:"getAttr",value:function(t){if(this.attrIndexMap[t])return this.attrs[this.attrIndexMap[t]];for(var e=this.attrs.length-1;e>=0;e--){var n=this.attrs[e];if(n.name===t)return n}}},{key:"cal",value:function(t,e,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),s=3;s=0;c--)o[u+c]=n.apply(null,r.map((function(t){return a[t*i.itemCount+c]})))}))}},{key:"quantize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attrs.forEach((function(e){if("JOINT"!==e.name&&0!=t[e.name]){var n=s.encode(e.data,t[e.name]||12);e.quantizationBit=n.quantizationBit,e.min=n.min,e.max=n.max,e.data=n.data}}))}},{key:"dequantize",value:function(){this.attrs.forEach((function(t){t.quantizationBit&&(t.data=s.decode(t.data,t.quantizationBit,t.min,t.max))}))}},{key:"convertTypedArray",value:function(){!this.indices||this.indices instanceof Array||(this.indices=Array.from(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array||t.data instanceof Float32Array||(t.data=Array.from(t.data))}))}},{key:"clearEBAttrs",value:function(){delete this.clers,delete this.holes,delete this.handles}},{key:"convertToTypedArray",value:function(){this.indices instanceof Array&&(this.getAttrLength()>65535?this.indices=new Uint32Array(this.indices):this.indices=new Uint16Array(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array&&(t.data=new Float32Array(t.data))}))}},{key:"prepareToWorkerSend",value:function(){return this.clearEBAttrs(),this.convertToTypedArray(),this.getAllBuffers()}},{key:"clone",value:function(){var e=new t(Array.from(this.indices),this.mode);return Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=Array.from(e.data),e})),e}},{key:"cloneStruct",value:function(){var e=new t;return e.mode=this.mode,this.indices&&(e.indices=[]),Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=[],e})),e}},{key:"toHilo3dGeometry",value:function(t,e){var n=e||new t.Geometry;return this.indices&&(this.indices.BYTES_PER_ELEMENT?n.indices=new t.GeometryData(this.indices,1):this.getAttrLength()>65535?n.indices=new t.GeometryData(new Uint32Array(this.indices),1):n.indices=new t.GeometryData(new Uint16Array(this.indices),1)),this.attrs.forEach((function(e){var i=c[e.name];i&&(e.data.BYTES_PER_ELEMENT?n[i]=new t.GeometryData(e.data,e.itemCount):n[i]=new t.GeometryData(new Float32Array(e.data),e.itemCount))})),n}},{key:"getAllBuffers",value:function(){var t=[];return this.indices.BYTES_PER_ELEMENT&&t.push(this.indices.buffer),this.attrs.forEach((function(e){e.data&&e.data.BYTES_PER_ELEMENT&&t.push(e.data.buffer)})),t}}],[{key:"fromGLTFPrimitive",value:function(e){var n=new t(e.indices,e.mode),i=e.attributes,r=0;for(var s in i.POSITION&&(r=i.POSITION.length/3),i)if(a[s]){var o=f[a[s]];r&&(o=i[s].length/r),n.addAttr(a[s],i[s],o)}else console.warn("Dont support attribute",s);return n}},{key:"fromHilo3dGeometry",value:function(e){var n=new t(e.indices.data,e.mode);for(var i in h)e[i]&&n.addAttr(h[i],e[i].data,e[i].size);return n}}]),t}();t.exports=l},function(t,e){var n={};function i(t){return n[t]||(n[t]=Math.pow(2,t)-1),n[t]}t.exports={cal:function(t,e,n,r){var s=i(r),a=n-e;return Math.round((t-e)/a*s)},encode:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=t.length,r=i(e),s=1/0,a=-1/0,o=0;o1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,a=t.length,o=i(s),u=r-n||1,c=0;c1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=t.length,a=i(e),o=r-n,u=new Float32Array(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,i=t.length,r=0;r1&&void 0!==arguments[1]?arguments[1]:0;return t instanceof Uint8Array&&(e=t.byteOffset,t=t.buffer),function(t){return new u[t.type](t).decompress()}(function(t,e){var n=new Uint8Array(t,e,4);if(65!==n[0]||77!==n[1]||67!==n[2])throw new Error("The file is not AMC format!");var i=c[n[3]].read(t,e+4);return i.geometry.type=n[3],i.geometry}(t,e))}var f,l=null,d=null;function m(t,e){return!l&&o()?(l=new a({wasmURL:t,memPages:e}),d=l.init()):d||Promise.resolve()}function _(t,e,n){if(l||m(e,n),!l||!l.isReady)return h(t);try{return l.decompress(t)}catch(e){return console.warn("wasm decompress error",e),h(t)}}var p=null;function g(t){return t=t||"https://g.alicdn.com/hilo/amc/0.1.27/worker.js",p||(!1===f||"undefined"==typeof Worker?Promise.reject("dont support web worker"):p=/^(?:http|blob|data:|\/\/)/.test(t)?new Promise((function(e,n){var i=new XMLHttpRequest;i.addEventListener("load",(function(){if("undefined"==typeof URL||"undefined"==typeof Blob)f=new Worker("data:application/javascript, ".concat(this.responseText));else{var t=URL.createObjectURL(new Blob([this.responseText]));f=new Worker(t)}f.onerror=function(t){console.log("web worker error",t),f=!1,n(t)},e(f)})),i.addEventListener("error",(function(t){return n(t)})),i.open("get",t,!0),i.send()})):new Promise((function(e,n){(f=new Worker(t)).onerror=function(t){console.log("web worker init error",t),f=!1,n(t)},e(f)})))}var v=0;function E(t,e,n,r){return e=e&&o(),t=new Uint8Array(t),g(r).then((function(r){return new Promise((function(s,a){var o=v++,u=function(e){if(e.data.id===o)if(r.removeEventListener("message",u),u=null,e.data.data){var n=e.data.data;n.constructor=i,n.__proto__=i.prototype,s(n)}else s(h(t))};r.addEventListener("message",u),r.postMessage({id:o,data:t,useWASM:e,wasmURL:n},[t.buffer])}))})).catch((function(i){return e?_(t,n):h(t)}))}t.exports={initWASM:m,initWorker:g,decompress:function(t,e,n){var i=o();return!i||t.byteLength>1048576?E(t,i,e,n):i?Promise.resolve(_(t,e)):Promise.resolve(h(t))},decompressWithJS:h,decompressWithWASM:_,decompressWithWorker:E,destory:function(){f&&(f.terminate(),f=null,p=null),l&&(l=null,d=null)}}},function(t,e,n){function i(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;n-=2)e[t[n]]=t[n-1]}},{key:"mapBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex,r=this.currentVertex-n+1,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i,i=r,e[this.prevCorner(t[s])]=r++;this.currentVertex-=n}},{key:"mapHoleBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex-n+1,r=i,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i++,e[this.prevCorner(t[s])]=s?i:r;this.currentVertex-=n}},{key:"fixNegativeIndex",value:function(t){for(var e=t,n=this.indices;n[t]<0;){if(e===-n[-n[t]]||n[t]===n[-n[t]]){console.warn("dead loop bug!!"),n[s]=0;break}n[t]=n[-n[t]]}}},{key:"fixIndicesAndReadVertice",value:function(){for(var t,e=this.indices,n=this.handlesMap,i=this.clers,r=i.length,s=-1,a=[],u=0,c=0;u1&&void 0!==arguments[1]?arguments[1]:-1;if(!this.readedVertexMap[t]&&(this.readedVertexMap[t]=1,!this.noParallelogramPrediction)){var n=this.indices,i=this.geometry;-1===e?void 0!==this.lastReadVertexIndex&&i.cal(i,t,a.plus,this.lastReadVertexIndex,t):i.cal(i,t,a.depp,n[e],n[this.prevCorner(e)],n[this.nextCorner(e)],t),this.lastReadVertexIndex=t}}},{key:"markCorner",value:function(t,e){var n=this.indices;void 0===n[this.nextCorner(t)]&&(n[this.nextCorner(t)]=-this.prevCorner(e[0])),void 0===n[this.prevCorner(t)]&&(n[this.prevCorner(t)]=-this.nextCorner(e[e.length-1]))}},{key:"onFaceC",value:function(t){var e=this.indices,n=3*this.currentFace,i=this.currentVertex--;e[n]=i;var r=t.pop();return e[this.nextCorner(r)]=i,e[this.prevCorner(r)]=-this.nextCorner(t[t.length-1]),r=t.shift(),e[this.prevCorner(r)]=i,e[this.nextCorner(r)]=-this.prevCorner(t[0]),t.push(n),t}},{key:"onFaceL",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.unshift(e+2),t.push(e),t}},{key:"onFaceF",value:function(t,e){return t&&this.mapBoundary(t),this.onFaceE(null,e)}},{key:"onFaceE",value:function(t,e){var n=3*this.currentFace;return t&&e.push(t),[n+2,n+1,n]}},{key:"onFaceR",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.push(e+1,e),t}},{key:"onHandleEnd",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=this.handlesMap[this.currentFace],a=e.splice(0,t);return e.shift(),n.push(a),i[this.nextCorner(s)]=-(r+1),i[this.prevCorner(s)]=-this.nextCorner(a[a.length-1]),i[r]=-this.prevCorner(a[0]),e.push(r),e}},{key:"onHandleStart",value:function(t,e){for(var n,r=this.indices,s=3*this.currentFace,a=this.handlesMap[this.currentFace],o=e.length-1;o>=0;o--){var u=e[o].indexOf(a);if(u>=0){var c,h=(n=e.splice(o,1)[0]).splice(0,u);n.shift(),(c=n).push.apply(c,i(h));break}}return r[this.nextCorner(a)]=-(s+1),r[this.prevCorner(a)]=-this.nextCorner(n[n.length-1]),r[s]=-this.prevCorner(t[0]),(t=n.concat(t)).push(s),t}},{key:"onFaceS",value:function(t,e,n){var i=this.handlesMap,r=this.indices,s=3*this.currentFace;if(i[this.currentFace]){this.markCorner(t.pop(),t);var a=t.indexOf(i[this.currentFace]);t=a>=0?this.onHandleEnd(a,t,n):this.onHandleStart(t,n)}else{var o=t.pop();this.markCorner(o,t),r[s]=-this.nextCorner(o);var u=e.pop();this.markCorner(u.pop(),u),(t=u.concat(t)).push(s)}return t}},{key:"onFaceM",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=t.splice(0,this.holes[this.currentHole--]);this.mapHoleBoundary(s);var a=i[this.prevCorner(s[0])];i[r]=a;var o=t.pop();return i[this.prevCorner(o)]=-this.nextCorner(t[t.length-1]),i[this.nextCorner(o)]=a,o=t.shift(),i[this.prevCorner(o)]=a,i[this.nextCorner(o)]=-this.prevCorner(t[0]),t.push(r),t}},{key:"decompress",value:function(){this.readedVertexMap=new Uint8Array(this.vertexCount);var t=this.faceCount,e=this.indices=new Array(3*t);this.currentFace=t-1,this.currentVertex=this.vertexCount-1,this.currentHole=this.holes.length-1;for(var n,i=this.clers,r=[],s=[];this.currentFace>=0;){var a="onFace"+u[i[this.currentFace]];this[a]?n=this[a](n,r,s):console.warn("has no ".concat(a)),this.currentFace--}return this.mapBoundary(n),this.fixIndicesAndReadVertice(this.indices),this.geometry.indices=e,this.geometry.dequantize(),this.geometry}},{key:"_onDecompressFace",value:function(t,e){this.onDecompressFace&&this.onDecompressFace(t,e)}}])&&r(e.prototype,n),t}();t.exports=c},function(t,e){var n={C:0,R:1,L:2,S:3,E:4,M:5,F:6},i=[];for(var r in n)i[n[r]]=r;n.map=i,t.exports=n},function(t,e,n){var i=n(0);function r(t,e,n,i){return new t(e.slice(n,n+i*t.BYTES_PER_ELEMENT))}t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t),s=new i,a=function(t,e){var n={};return n.version=t.getUint8(e++),n.faceCount=t.getUint32(e,!0),e+=4,n.vertexCount=t.getUint32(e,!0),e+=4,n.attrCount=t.getUint8(e++),n.noParallelogramPrediction=t.getUint8(e++),n.holesCount=t.getUint16(e,!0),e+=2,n.handlesCount=t.getUint16(e,!0),e+=2,n.headerBytes=15,n}(n,e);return e+=a.headerBytes,s.mode="CLERS",e=function(t,e,n,i){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wasmURL=e.wasmURL||"https://ossgw.alicdn.com/tmall-c3/tmx/70b8d82ccf33e97a124e54c2d6a3e0c7.wasm",this.memPages=e.memPages||256,this.memPages<256&&(this.memPages=256),this.isReady=!1}var e,n;return e=t,(n=[{key:"initASMJS",value:function(){this.isReady=!0,this.dv=new DataView(HEAP8.buffer),this.heap8=HEAP8,this.ins={exports:{__Z7AMCinitj:Module.__Z7AMCinitj,__Z12AMDecompressv:Module.__Z12AMDecompressv}}}},{key:"init",value:function(){var t=this,e=this.memory=new WebAssembly.Memory({initial:this.memPages});this.dv=new DataView(e.buffer);var n=this.heap8=new Uint8Array(e.buffer),i={global:{NaN:5,Infinity:6},env:{memoryBase:0,memory:e,_malloc:function(){return 2097152},_memset:function(t,e,i){return n.fill(e,t,t+i),t},_printf:function(t,e){for(var i=t;n[i];)i++;var r=String.fromCharCode.apply(String,function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e65536?new Uint32Array(d):new Uint16Array(d);var m=new r(d);return h.forEach((function(t){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t,3),i=n[0],r=n[1],s=n[2],a=new Float32Array(e.buffer.slice(s,s+u*r*4));m.addAttr(m.attrIdToName(i),a,r)})),m}}])&&i(e.prototype,n),t}();t.exports=s},function(t,e){var n;t.exports=function(){return void 0===n&&(n=function(){if("undefined"==typeof WebAssembly||"undefined"==typeof fetch||function(){if(!/iPad|iPhone|iPod/i.test(navigator.userAgent))return!1;if(/OS (\d+)_(\d+)_?(\d+)?/i.test(navigator.userAgent)){var t=Number(RegExp.$1),e=Number(RegExp.$2);if(11===t&&e>=3||t>11)return!1}return!0}())return!1;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)}catch(t){return console.log("err while check WebAssembly",t),!1}}()),n}}])},function(t,e,n){"use strict";var i=n(38),r=n.n(i),s=n(1),a=n(5),o=s.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new r.a,this.origin=t.origin||new a.a(0,0,0),this.direction=t.direction||new a.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,i,r){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,i,r)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,i,r)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,i){return n.squaredDistance(t[e])-n.squaredDistance(i[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new a.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var i=n(0),r=n(1),s=n(9),a=n(5),o=r.a.create({Mixes:s.a,Extends:a.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.fire("update"),this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this.fire("update"),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this.fire("update"),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this.fire("update"),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this.fire("update"),this},round:function(){return i.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.fire("update"),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this.fire("update"),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this.fire("update"),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},random:function(t){return i.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this.fire("update"),this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});e.a=o},function(t,e){t.exports="#define GLSLIFY 1\n#define HILO_FRONT_SIDE 1028\n#define HILO_BACK_SIDE 1029\n#define HILO_FRONT_AND_BACK_SIDE 1032\n#define HILO_PI 3.141592653589793\n#define HILO_INVERSE_PI 0.3183098861837907"},function(t,e){var n=function(){var t,e,n=function(t){var e,n,r={};for(e in t)n=t[e],i.hasOwnProperty(e)?i[e].call(this,n):r[e]=n;s(this.prototype,r)},i={Extends:function(t){var e=this.prototype,n=r(t.prototype);s(this,t),s(n,e),n.constructor=this,this.prototype=n,this.superclass=t.prototype},Mixes:function(t){t instanceof Array||(t=[t]);for(var e,n=this.prototype;e=t.shift();)s(n,e.prototype||e)},Statics:function(t){s(this,t)}},r=function(){if(Object.__proto__)return function(t){return{__proto__:t}};var t=function(){};return function(e){return t.prototype=e,new t}}(),s=function(t){for(var n=1,i=arguments.length;n0&&void 0!==arguments[0]?arguments[0]:new r.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,i){return this.normal.set(t,e,n),this.distance=i,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new r.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=s},function(t,e,n){"use strict";var i=n(1),r=n(5),s=new r.a,a=i.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new r.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this.fire("update"),this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this.fire("update"),this},identity:function(){return r.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this.fire("update"),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this.fire("update"),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,e,n,i,s){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),s||this.fire("update"),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this.fire("update"),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this.fire("update"),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.fire("update"),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this.fire("update"),this},lookAt:function(t,e,n){return t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},targetTo:function(t,e,n){t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],u=n[1],c=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=u*m-c*d,g=c*l-o*m,v=o*d-u*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=u*m-c*d)*p+(g=c*l-(o+=1e-7)*m)*g+(v=o*d-u*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this.fire("update"),this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new u.a),this.determinant()<0&&(n.x*=-1),i.copy(this),h.inverse(n),i.scale(h),t.fromMat4(i),r&&r.set(0,0,0),this}});e.a=l},function(t,e,n){"use strict";var i=n(1),r=n(9),s=n(6),a=n(13),o=s.a.DEG2RAD,u=s.a.RAD2DEG,c=i.a.create({Mixes:r.a,Extends:a.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a.a.call(this,t,e,n)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*u,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*u,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*u,this.fire("update")}}});e.a=c},function(t,e,n){"use strict";var i=n(1),r=n(20),s=i.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new r.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],u=n[5],c=n[6],h=n[7],f=n[8],l=n[9],d=n[10],m=n[11],_=n[12],p=n[13],g=n[14],v=n[15];return e[0].set(a-i,h-o,m-f,v-_).normalize(),e[1].set(a+i,h+o,m+f,v+_).normalize(),e[2].set(a+r,h+u,m+l,v+p).normalize(),e[3].set(a-r,h-u,m-l,v-p).normalize(),e[4].set(a-s,h-c,m-d,v-g).normalize(),e[5].set(a+s,h+c,m+d,v+g).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)-1&&a.splice(h,1)}}return 0==a.length&&delete s[i],!0}return!1}},r=n(19).create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),s=window.Event;if(s){var a=s.prototype,o=a.stopImmediatePropagation;a.stopImmediatePropagation=function(){o&&o.call(this),this._stopped=!0}}t.exports=i},function(t,e,n){var i=n(94),r=n(96),s=n(97),a=n(100),o=n(34),u=[[0,0,0],[0,0,0],[0,0,0]],c=[0,0,0];function h(t,e){this.origin=t||[0,0,0],this.direction=e||[0,0,-1]}t.exports=h,h.prototype.set=function(t,e){this.origin=t,this.direction=e},h.prototype.copy=function(t){o(this.origin,t.origin),o(this.direction,t.direction)},h.prototype.clone=function(){var t=new h;return t.copy(this),t},h.prototype.intersectsSphere=function(t,e){return s(c,this.origin,this.direction,t,e)},h.prototype.intersectsPlane=function(t,e){return r(c,this.origin,this.direction,t,e)},h.prototype.intersectsTriangle=function(t){return i(c,this.origin,this.direction,t)},h.prototype.intersectsBox=function(t){return a(c,this.origin,this.direction,t)},h.prototype.intersectsTriangleCell=function(t,e){var n=t[0],i=t[1],r=t[2];return u[0]=e[n],u[1]=e[i],u[2]=e[r],this.intersectsTriangle(u)}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_COLOR\n varying vec4 v_color;\n#endif\n\n#ifdef HILO_USE_HDR\n uniform float u_exposure;\n#endif\n\n#ifdef HILO_GAMMA_CORRECTION\n uniform float u_gammaFactor;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_TEXCOORD0\n varying vec2 v_texcoord0;\n#endif\n\n#ifdef HILO_HAS_TEXCOORD1\n varying vec2 v_texcoord1;\n#endif\n\n#if defined(HILO_HAS_TEXCOORD0) || defined(HILO_HAS_TEXCOORD1)\n #if defined(HILO_HAS_TEXCOORD0) && defined(HILO_HAS_TEXCOORD1)\n #define HILO_SAMPLER_2D hiloSampler2D\n // https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Opaque_types\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) hiloTexture2D(HILO_SAMPLER_2D.texture, HILO_SAMPLER_2D.uv)\n struct hiloSampler2D{\n sampler2D texture;\n int uv; \n };\n \n vec4 hiloTexture2D(sampler2D texture, int uv){\n if(uv == 0){\n return texture2D(texture, v_texcoord0);\n }\n else{\n return texture2D(texture, v_texcoord1);\n }\n }\n #else\n #ifdef HILO_HAS_TEXCOORD1\n #define HILO_V_TEXCOORD v_texcoord1\n #else\n #define HILO_V_TEXCOORD v_texcoord0\n #endif\n #define HILO_SAMPLER_2D sampler2D\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) texture2D(HILO_SAMPLER_2D, HILO_V_TEXCOORD)\n #endif\n#endif\n\n\n#ifdef HILO_DIFFUSE_CUBE_MAP\n varying vec3 v_position;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_NORMAL\n varying vec3 v_normal;\n #ifdef HILO_NORMAL_MAP\n uniform HILO_SAMPLER_2D u_normalMap;\n varying mat3 v_TBN;\n \n #ifdef HILO_NORMAL_MAP_SCALE\n uniform float u_normalMapScale;\n #endif\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#if defined(HILO_HAS_LIGHT) || defined(HILO_HAS_FRAG_POS)\n varying vec3 v_fragPos;\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n#ifdef HILO_DIRECTIONAL_LIGHTS\n uniform vec3 u_directionalLightsColor[HILO_DIRECTIONAL_LIGHTS];\n uniform vec3 u_directionalLightsInfo[HILO_DIRECTIONAL_LIGHTS];\n #ifdef HILO_DIRECTIONAL_LIGHTS_SMC\n uniform sampler2D u_directionalLightsShadowMap[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowMapSize[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform mat4 u_directionalLightSpaceMatrix[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowBias[HILO_DIRECTIONAL_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_SPOT_LIGHTS\n uniform vec3 u_spotLightsPos[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsDir[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsColor[HILO_SPOT_LIGHTS];\n uniform vec2 u_spotLightsCutoffs[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsInfo[HILO_SPOT_LIGHTS];\n uniform float u_spotLightsRange[HILO_SPOT_LIGHTS];\n #ifdef HILO_SPOT_LIGHTS_SMC\n uniform sampler2D u_spotLightsShadowMap[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowMapSize[HILO_SPOT_LIGHTS_SMC];\n uniform mat4 u_spotLightSpaceMatrix[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowBias[HILO_SPOT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_POINT_LIGHTS\n uniform vec3 u_pointLightsPos[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsColor[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsInfo[HILO_POINT_LIGHTS];\n uniform float u_pointLightsRange[HILO_POINT_LIGHTS];\n #ifdef HILO_POINT_LIGHTS_SMC\n uniform samplerCube u_pointLightsShadowMap[HILO_POINT_LIGHTS_SMC];\n uniform mat4 u_pointLightSpaceMatrix[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightsShadowBias[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightCamera[HILO_POINT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_AREA_LIGHTS\n uniform vec3 u_areaLightsPos[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsColor[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsWidth[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsHeight[HILO_AREA_LIGHTS];\n uniform sampler2D u_areaLightsLtcTexture1;\n uniform sampler2D u_areaLightsLtcTexture2;\n\n "+n(113)+"\n#endif\n\n#ifdef HILO_AMBIENT_LIGHTS\n uniform vec3 u_ambientLightsColor;\n#endif\n\n"+n(64)+"\n"+n(65)+"\n"+n(66)+"\n"+n(67)+"\n"+n(68)},function(t,e){t.exports="#define GLSLIFY 1\nvec4 textureEnvMap(sampler2D texture, vec3 position){\n return texture2D(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI));\n}\n\nvec4 textureEnvMap(samplerCube texture, vec3 position){\n return textureCube(texture, position);\n}\n\n#ifdef HILO_USE_SHADER_TEXTURE_LOD\n vec4 textureEnvMapLod(sampler2D texture, vec3 position, float lod){\n return texture2DLodEXT(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI), lod);\n }\n\n vec4 textureEnvMapLod(samplerCube texture, vec3 position, float lod){\n return textureCubeLodEXT(texture, position, lod);\n }\n#endif\n\n"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_TRANSPARENCY_MAP\n uniform HILO_SAMPLER_2D u_transparency;\n#else\n uniform float u_transparency;\n#endif\n\n#ifdef HILO_ALPHA_CUTOFF\n uniform float u_alphaCutoff;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_FOG\n varying float v_dist;\n uniform vec4 u_fogColor;\n \n #ifdef HILO_FOG_LINEAR\n uniform vec2 u_fogInfo;\n #else\n uniform float u_fogInfo;\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_NORMAL_MAP\n vec3 normal = HILO_TEXTURE_2D(u_normalMap).rgb * 2.0 - 1.0;\n #ifdef HILO_NORMAL_MAP_SCALE\n normal.xy *= u_normalMapScale;\n #endif\n normal = normalize(v_TBN * normal);\n#elif defined(HILO_HAS_NORMAL)\n vec3 normal = normalize(v_normal);\n#else\n vec3 normal = vec3(0, 0, 1);\n#endif\n\n#if HILO_SIDE == HILO_BACK_SIDE\n normal = -normal;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_LIGHT\n #if HILO_SIDE == HILO_FRONT_AND_BACK_SIDE\n normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\nfloat transparency = 1.0;\n#ifdef HILO_TRANSPARENCY_MAP\n transparency = HILO_TEXTURE_2D(u_transparency).r;\n#else\n transparency = u_transparency;\n#endif\ncolor.a *= transparency;\n#ifdef HILO_ALPHA_CUTOFF\n if (color.a < u_alphaCutoff) {\n discard;\n } else {\n color.a = 1.0;\n }\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n#ifdef HILO_IGNORE_TRANSPARENT\ncolor.a = 1.0;\n#endif\n\n#ifdef HILO_USE_HDR\n color.rgb = vec3(1.0) - exp(-color.rgb * u_exposure);\n#endif\n\n#ifdef HILO_GAMMA_CORRECTION\n color.rgb = pow(color.rgb, vec3(1.0 / u_gammaFactor));\n#endif\n\n"+n(73)+"\n\n#ifdef HILO_PREMULTIPLY_ALPHA\n color.rgb *= color.a;\n#endif\n\ngl_FragColor = color;"},function(t,e){t.exports="#define GLSLIFY 1\n"},function(t,e){t.exports="#ifdef GL_ES\nprecision HILO_MAX_VERTEX_PRECISION float;\n#define GLSLIFY 1\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(40)+"\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(62)+"\n"+n(44)+"\n"+n(69)+"\n"+n(46)+"\n"+n(47)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 diffuse = vec4(0., 0., 0., 1.);\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(48)+"\n "+n(49)+"\n "+n(71)+"\n "+n(72)+"\n "+n(50)+"\n "+n(51)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(52)+"\n"+n(18)+"\n"+n(53)+"\n\nattribute vec3 a_position;\nuniform mat4 u_modelViewProjectionMatrix;\n\n"+n(74)+"\n"+n(75)+"\n"+n(76)+"\n"+n(77)+"\n"+n(78)+"\n"+n(79)+"\n"+n(80)+"\n"+n(81)+"\nvoid main(void) {\n vec4 pos = vec4(a_position, 1.0);\n #ifdef HILO_HAS_TEXCOORD0\n vec2 uv = a_texcoord0;\n #endif\n #ifdef HILO_HAS_TEXCOORD1\n vec2 uv1 = a_texcoord1;\n #endif\n #ifdef HILO_HAS_NORMAL\n vec3 normal = a_normal;\n #endif\n\n #ifdef HILO_NORMAL_MAP\n vec4 tangent = a_tangent;\n #endif\n\n "+n(82)+"\n "+n(83)+"\n "+n(84)+"\n "+n(85)+"\n "+n(86)+"\n "+n(87)+"\n "+n(88)+"\n\n gl_Position = u_modelViewProjectionMatrix * pos;\n\n "+n(89)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n#if defined(HILO_VERTEX_TYPE_POSITION)\n varying vec3 v_fragPos;\n#elif defined(HILO_VERTEX_TYPE_NORMAL)\n varying vec3 v_normal;\n#elif defined(HILO_VERTEX_TYPE_DEPTH)\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n uniform float u_cameraType;\n#elif defined(HILO_VERTEX_TYPE_DISTANCE)\n "+n(90)+"\n\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n varying vec3 v_fragPos;\n#endif\n\nvec4 transformDataToColor(vec3 data){\n #ifdef HILO_WRITE_ORIGIN_DATA\n return vec4(data, 1.0);\n #else\n return vec4(data * 0.5 + 0.5, 1.0);\n #endif\n}\n\n"+n(29)+"\n\nvoid main(void) {\n #if defined(HILO_VERTEX_TYPE_POSITION)\n gl_FragColor = transformDataToColor(v_fragPos);\n #elif defined(HILO_VERTEX_TYPE_NORMAL)\n gl_FragColor = transformDataToColor(v_normal);\n #elif defined(HILO_VERTEX_TYPE_DEPTH)\n float z;\n #ifdef HILO_WRITE_ORIGIN_DATA\n z = gl_FragCoord.z;\n #else\n // OrthographicCamera\n if(u_cameraType < 1.0){\n z = gl_FragCoord.z;\n }\n // PerspectiveCamera\n else{\n z = gl_FragCoord.z * 2.0 - 1.0;\n z = (2.0 * u_cameraNear * u_cameraFar) / (u_cameraFar + u_cameraNear - z * (u_cameraFar - u_cameraNear));\n }\n #endif\n gl_FragColor = vec4(z, z, z, 1.0);\n #elif defined(HILO_VERTEX_TYPE_DISTANCE)\n float distance = length(v_fragPos);\n #ifdef HILO_WRITE_ORIGIN_DATA\n gl_FragColor = vec4(distance, distance, distance, 1.0);\n #else\n gl_FragColor = packFloat((distance - u_cameraNear)/(u_cameraFar - u_cameraNear));\n #endif\n #endif\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(40)+"\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(91)+"\n"+n(44)+"\n"+n(46)+"\n"+n(47)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(48)+"\n "+n(49)+"\n "+n(93)+"\n "+n(51)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\nvarying vec2 v_texcoord0;\nuniform sampler2D u_diffuse;\n\nvoid main(void) { \n gl_FragColor = texture2D(u_diffuse, v_texcoord0);\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(52)+"\n"+n(18)+"\n"+n(53)+"\n\nattribute vec2 a_position;\nattribute vec2 a_texcoord0;\nvarying vec2 v_texcoord0;\n\n\nvoid main(void) {\n vec4 pos = vec4(a_position, 0.0, 1.0);\n gl_Position = pos;\n v_texcoord0 = a_texcoord0;\n}"},function(t,e){var n=function(){var t=navigator.userAgent,e=document,n=window,i=e.documentElement,r={iphone:/iphone/i.test(t),ipad:/ipad/i.test(t),ipod:/ipod/i.test(t),ios:/iphone|ipad|ipod/i.test(t),android:/android/i.test(t),webkit:/webkit/i.test(t),chrome:/chrome/i.test(t),safari:/safari/i.test(t),firefox:/firefox/i.test(t),ie:/msie/i.test(t),opera:/opera/i.test(t),supportTouch:"ontouchstart"in n,supportCanvas:null!=e.createElement("canvas").getContext,supportStorage:!1,supportOrientation:"orientation"in n||"orientation"in n.screen,supportDeviceMotion:"ondevicemotion"in n};try{localStorage.setItem("hilo","hilo"),localStorage.removeItem("hilo"),r.supportStorage=!0}catch(t){}var s=r.jsVendor=r.webkit?"webkit":r.firefox?"webkit":r.opera?"o":r.ie?"ms":"",a=r.cssVendor="-"+s+"-",o=e.createElement("div"),u=o.style,c=null!=u[s+"Transform"],h=null!=u[s+"Perspective"];h&&(o.id="test3d",(u=e.createElement("style")).textContent="@media ("+a+"transform-3d){#test3d{height:3px}}",e.head.appendChild(u),i.appendChild(o),h=3==o.offsetHeight,e.head.removeChild(u),i.removeChild(o)),r.supportTransform=c,r.supportTransform3D=h;var f=r.supportTouch,l=f?"touchstart":"mousedown",d=f?"touchmove":"mousemove",m=f?"touchend":"mouseup";return r.POINTER_START=l,r.POINTER_MOVE=d,r.POINTER_END=m,r}();t.exports=n},function(t,e,n){var i=n(19),r=function(){function t(){return+new Date}return i.create({constructor:function(t,e,n,i){var r=this;for(var s in r.target=t,r._startTime=0,r._seekTime=0,r._pausedTime=0,r._pausedStartTime=0,r._reverseFlag=1,r._repeatCount=0,3==arguments.length&&(i=n,n=e,e=null),i)r[s]=i[s];r._fromProps=e,r._toProps=n,!i.duration&&i.time&&(r.duration=i.time||0,r.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,isComplete:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var n=this.target,i=t||e,r=this._fromProps={},s=this._toProps={};for(var a in t=t||n,e=e||n,i)s[a]=e[a]||0,n[a]=r[a]=t[a]||0;return this},start:function(){var e=this;return e._startTime=t()+e.delay,e._seekTime=0,e._pausedTime=0,e._reverseFlag=1,e._repeatCount=0,e.paused=!1,e.isStart=!1,e.isComplete=!1,r.add(e),e},stop:function(){return r.remove(this),this},pause:function(){return this.paused=!0,this._pausedStartTime=t(),this},resume:function(){var e=this;return e.paused=!1,e._pausedStartTime&&(e._pausedTime+=t()-e._pausedStartTime),e._pausedStartTime=0,e},seek:function(e,n){var i=this,s=t();return i._startTime=s,i._seekTime=e,i._pausedTime=0,void 0!==n&&(i.paused=n),i._update(s,!0),r.add(i),i},link:function(t){var e,n,i=t.delay,s=this._startTime;return"string"==typeof i&&(e=0==i.indexOf("+"),n=0==i.indexOf("-"),i=e||n?Number(i.substr(1))*(e?1:-1):Number(i)),t.delay=i,t._startTime=e||n?s+this.duration+i:s+i,this._next=t,r.remove(t),t},_render:function(t){var e,n=this.target,i=this._fromProps;for(e in i)n[e]=i[e]+(this._toProps[e]-i[e])*t},_update:function(e,n){var i=this;if(!i.paused||n){if(i.isComplete)return!0;var s=e-i._startTime-i._pausedTime+i._seekTime;if(!(s<0)){var a,o=s/i.duration;o=o<=0?0:o>=1?1:o;var u=i.ease?i.ease(o):o;i.reverse&&i.isStart&&(i._reverseFlag<0&&(o=1-o,u=1-u),o<1e-7&&(i.repeat>0&&i._repeatCount++>=i.repeat||0==i.repeat&&!i.loop?!0:(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1))),i.isStart||(i.setProps(i._fromProps,i._toProps),i.isStart=!0,i.onStart&&i.onStart.call(i,i)),i.time=s,i._render(u),(a=i.onUpdate)&&a.call(i,u,i),o>=1&&(i.reverse?(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1):i.loop||i.repeat>0&&i._repeatCount++0&&h<=e?(c._render(o),c.time=s,r.add(c)):i.isComplete&&(h<0||h>e)&&c.start()}return i.isComplete?((a=i.onComplete)&&a.call(i,i),!0):void 0}}},Statics:{_tweens:[],tick:function(){var e,n,i=r._tweens,s=i.length;for(n=0;n-1&&i.splice(e,1);else for(e=0;el)return null;i(h,u,a);var m=r(n,h);if(m<0||d+m>l)return null;var _=r(o,h)/l;return t[0]=e[0]+_*n[0],t[1]=e[1]+_*n[1],t[2]=e[2]+_*n[2],t}},function(t,e){t.exports=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2];return t[0]=r*u-s*o,t[1]=s*a-i*u,t[2]=i*o-r*a,t}},function(t,e,n){var i=n(27),r=n(32),s=n(33),a=n(34);t.exports=function(t,e,n,u,c){var h=i(n,u);if(0!==h){var f=-(i(e,u)+c)/h;return f<0?null:(s(o,n,f),r(t,e,o))}return i(u,e)+c===0?a(t,e):null};var o=[0,0,0]},function(t,e,n){var i=n(98),r=n(27),s=n(31),a=n(99),o=n(33),u=n(32),c=[0,0,0];t.exports=function(t,e,n,h,f){s(c,h,e);var l=r(n,c);if(l<0)return null;a(c,e,n,l);var d=i(h,c),m=f*f;if(d>m)return null;return o(t,n,l-Math.sqrt(m-d)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}},function(t,e){t.exports=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}},function(t,e){function n(t,e,n){for(var i=t.length,r=-1/0,s=1/0,a=0;au){var c=o;o=u,u=c}if(us)return 1/0;o>r&&(r=o),us?1/0:r}t.exports=function(t,e,i,r){var s=n(e,i,r);if(s===1/0)t=null;else{t=t||[];for(var a=0;a0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=i*a,t[2]=r*a,t[3]=s*a),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=a+i*(n[2]-a),t[3]=o+i*(n[3]-o),t},e.random=function(t,e){var n,r,s,a,o,u;e=e||1;do{o=(n=2*i.RANDOM()-1)*n+(r=2*i.RANDOM()-1)*r}while(o>=1);do{u=(s=2*i.RANDOM()-1)*s+(a=2*i.RANDOM()-1)*a}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*r,t[2]=e*s*c,t[3]=e*a*c,t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*s+n[12]*a,t[1]=n[1]*i+n[5]*r+n[9]*s+n[13]*a,t[2]=n[2]*i+n[6]*r+n[10]*s+n[14]*a,t[3]=n[3]*i+n[7]*r+n[11]*s+n[15]*a,t},e.transformQuat=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2],c=n[3],h=c*i+o*s-u*r,f=c*r+u*i-a*s,l=c*s+a*r-o*i,d=-a*i-o*r-u*s;return t[0]=h*c+d*-a+f*-u-l*-o,t[1]=f*c+d*-o+l*-a-h*-u,t[2]=l*c+d*-u+h*-o-f*-a,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(n*n+i*i+r*r+s*s)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return n*n+i*i+r*r+s*s}function h(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.sqrt(e*e+n*n+i*i+r*r)}function f(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.len=h,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=4),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;u1?0:r<-1?Math.PI:Math.acos(r)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=e[0],o=e[1],u=e[2];return Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-u)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(3);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function a(t,e,n){var r=new i.ARRAY_TYPE(3);return r[0]=t,r[1]=e,r[2]=n,r}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(n*n+i*i+r*r)}function f(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}function l(t){var e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i}function d(t,e){var n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function m(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=h,e.sqrDist=f,e.len=s,e.sqrLen=l,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=3),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;ui.EPSILON?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=h,e.rotateX=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+a*o,t[1]=r*u+s*o,t[2]=s*u-r*o,t[3]=a*u-i*o,t},e.rotateY=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u-s*o,t[1]=r*u+a*o,t[2]=s*u+i*o,t[3]=a*u-r*o,t},e.rotateZ=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+r*o,t[1]=r*u-i*o,t[2]=s*u+a*o,t[3]=a*u-s*o,t},e.calculateW=function(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t},e.slerp=f,e.random=function(t){var e=i.RANDOM(),n=i.RANDOM(),r=i.RANDOM(),s=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*n),t[1]=s*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*n+i*i+r*r+s*s,o=a?1/a:0;return t[0]=-n*o,t[1]=-i*o,t[2]=-r*o,t[3]=s*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,i){var r=.5*Math.PI/180;e*=r,n*=r,i*=r;var s=Math.sin(e),a=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(i),h=Math.cos(i);return t[0]=s*u*h-a*o*c,t[1]=a*o*h+s*u*c,t[2]=a*u*c-s*o*h,t[3]=a*u*h+s*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var i=o(n(0)),r=o(n(5)),s=o(n(2)),a=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function h(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*h+a*o+r*c-s*u,t[1]=r*h+a*u+s*o-i*c,t[2]=s*h+a*c+i*u-r*o,t[3]=a*h-i*o-r*u-s*c,t}function f(t,e,n,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=n[0],h=n[1],f=n[2],l=n[3],d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return(m=s*c+a*h+o*f+u*l)<0&&(m=-m,c=-c,h=-h,f=-f,l=-l),1-m>i.EPSILON?(d=Math.acos(m),_=Math.sin(d),p=Math.sin((1-r)*d)/_,g=Math.sin(r*d)/_):(p=1-r,g=r),t[0]=p*s+g*c,t[1]=p*a+g*h,t[2]=p*o+g*f,t[3]=p*u+g*l,t}function l(t,e){var n=e[0]+e[4]+e[8],i=void 0;if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,a=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*a+a]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*s+a]-e[3*a+s])*i,t[s]=(e[3*s+r]+e[3*r+s])*i,t[a]=(e[3*a+r]+e[3*r+a])*i}return t}e.clone=a.clone,e.fromValues=a.fromValues,e.copy=a.copy,e.set=a.set,e.add=a.add,e.mul=h,e.scale=a.scale,e.dot=a.dot,e.lerp=a.lerp;var d=e.length=a.length,m=(e.len=d,e.squaredLength=a.squaredLength),_=(e.sqrLen=m,e.normalize=a.normalize);e.exactEquals=a.exactEquals,e.equals=a.equals,e.rotationTo=function(){var t=s.create(),e=s.fromValues(1,0,0),n=s.fromValues(0,1,0);return function(i,r,a){var o=s.dot(r,a);return o<-.999999?(s.cross(t,e,r),s.len(t)<1e-6&&s.cross(t,n,r),s.normalize(t,t),c(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(s.cross(t,r,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,_(i,i))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,i,r,s,a,o){return f(t,i,a,o),f(e,r,s,o),f(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=r.create();return function(e,n,i,r){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=r[0],t[4]=r[1],t[7]=r[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],_(e,l(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(16);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,r,s,a,o,u,c,h,f,l,d,m,_,p){var g=new i.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=s,g[5]=a,g[6]=o,g[7]=u,g[8]=c,g[9]=h,g[10]=f,g[11]=l,g[12]=d,g[13]=m,g[14]=_,g[15]=p,g},e.set=function(t,e,n,i,r,s,a,o,u,c,h,f,l,d,m,_,p){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t[9]=h,t[10]=f,t[11]=l,t[12]=d,t[13]=m,t[14]=_,t[15]=p,t},e.identity=r,e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],s=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=r,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,E=n*u-r*a,T=n*c-s*a,M=i*u-r*o,A=i*c-s*o,I=r*c-s*u,L=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-E*y+T*R+M*S-A*O+I*L;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(r*y-i*x-s*R)*N,t[2]=(_*I-p*A+g*M)*N,t[3]=(l*A-f*I-d*M)*N,t[4]=(u*S-a*x-c*O)*N,t[5]=(n*x-r*S+s*O)*N,t[6]=(p*T-m*I-g*E)*N,t[7]=(h*I-l*T+d*E)*N,t[8]=(a*y-o*S+c*L)*N,t[9]=(i*S-n*y-s*L)*N,t[10]=(m*A-_*T+g*v)*N,t[11]=(f*T-h*A-d*v)*N,t[12]=(o*O-a*R-u*L)*N,t[13]=(n*R-i*O+r*L)*N,t[14]=(_*E-m*M-p*v)*N,t[15]=(h*M-f*E+l*v)*N,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15];return t[0]=o*(l*g-d*p)-f*(u*g-c*p)+_*(u*d-c*l),t[1]=-(i*(l*g-d*p)-f*(r*g-s*p)+_*(r*d-s*l)),t[2]=i*(u*g-c*p)-o*(r*g-s*p)+_*(r*c-s*u),t[3]=-(i*(u*d-c*l)-o*(r*d-s*l)+f*(r*c-s*u)),t[4]=-(a*(l*g-d*p)-h*(u*g-c*p)+m*(u*d-c*l)),t[5]=n*(l*g-d*p)-h*(r*g-s*p)+m*(r*d-s*l),t[6]=-(n*(u*g-c*p)-a*(r*g-s*p)+m*(r*c-s*u)),t[7]=n*(u*d-c*l)-a*(r*d-s*l)+h*(r*c-s*u),t[8]=a*(f*g-d*_)-h*(o*g-c*_)+m*(o*d-c*f),t[9]=-(n*(f*g-d*_)-h*(i*g-s*_)+m*(i*d-s*f)),t[10]=n*(o*g-c*_)-a*(i*g-s*_)+m*(i*c-s*o),t[11]=-(n*(o*d-c*f)-a*(i*d-s*f)+h*(i*c-s*o)),t[12]=-(a*(f*p-l*_)-h*(o*p-u*_)+m*(o*l-u*f)),t[13]=n*(f*p-l*_)-h*(i*p-r*_)+m*(i*l-r*f),t[14]=-(n*(o*p-u*_)-a*(i*p-r*_)+m*(i*u-r*o)),t[15]=n*(o*l-u*f)-a*(i*l-r*f)+h*(i*u-r*o),t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8],h=t[9],f=t[10],l=t[11],d=t[12],m=t[13],_=t[14],p=t[15];return(e*a-n*s)*(f*p-l*_)-(e*o-i*s)*(h*p-l*m)+(e*u-r*s)*(h*_-f*m)+(n*o-i*a)*(c*p-l*d)-(n*u-r*a)*(c*_-f*d)+(i*u-r*o)*(c*m-h*d)},e.multiply=s,e.translate=function(t,e,n){var i=n[0],r=n[1],s=n[2],a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],u=e[2],c=e[3],h=e[4],f=e[5],l=e[6],d=e[7],m=e[8],_=e[9],p=e[10],g=e[11],t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=h,t[5]=f,t[6]=l,t[7]=d,t[8]=m,t[9]=_,t[10]=p,t[11]=g,t[12]=a*i+h*r+m*s+e[12],t[13]=o*i+f*r+_*s+e[13],t[14]=u*i+l*r+p*s+e[14],t[15]=c*i+d*r+g*s+e[15]),t},e.scale=function(t,e,n){var i=n[0],r=n[1],s=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,r){var s,a,o,u,c,h,f,l,d,m,_,p,g,v,E,T,M,A,I,L,O,S,R,y,x=r[0],N=r[1],b=r[2],w=Math.sqrt(x*x+N*N+b*b);return w0?(n[0]=2*(c*u+l*r+h*o-f*s)/d,n[1]=2*(h*u+l*s+f*r-c*o)/d,n[2]=2*(f*u+l*o+c*s-h*r)/d):(n[0]=2*(c*u+l*r+h*o-f*s),n[1]=2*(h*u+l*s+f*r-c*o),n[2]=2*(f*u+l*o+c*s-h*r)),a(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[4],a=e[5],o=e[6],u=e[8],c=e[9],h=e[10];return t[0]=Math.sqrt(n*n+i*i+r*r),t[1]=Math.sqrt(s*s+a*a+o*o),t[2]=Math.sqrt(u*u+c*c+h*h),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],i=0;return n>0?(i=2*Math.sqrt(n+1),t[3]=.25*i,t[0]=(e[6]-e[9])/i,t[1]=(e[8]-e[2])/i,t[2]=(e[1]-e[4])/i):e[0]>e[5]&&e[0]>e[10]?(i=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/i,t[0]=.25*i,t[1]=(e[1]+e[4])/i,t[2]=(e[8]+e[2])/i):e[5]>e[10]?(i=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/i,t[0]=(e[1]+e[4])/i,t[1]=.25*i,t[2]=(e[6]+e[9])/i):(i=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/i,t[0]=(e[8]+e[2])/i,t[1]=(e[6]+e[9])/i,t[2]=.25*i),t},e.fromRotationTranslationScale=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3],u=r+r,c=s+s,h=a+a,f=r*u,l=r*c,d=r*h,m=s*c,_=s*h,p=a*h,g=o*u,v=o*c,E=o*h,T=i[0],M=i[1],A=i[2];return t[0]=(1-(m+p))*T,t[1]=(l+E)*T,t[2]=(d-v)*T,t[3]=0,t[4]=(l-E)*M,t[5]=(1-(f+p))*M,t[6]=(_+g)*M,t[7]=0,t[8]=(d+v)*A,t[9]=(_-g)*A,t[10]=(1-(f+m))*A,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,i,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=s+s,h=a+a,f=o+o,l=s*c,d=s*h,m=s*f,_=a*h,p=a*f,g=o*f,v=u*c,E=u*h,T=u*f,M=i[0],A=i[1],I=i[2],L=r[0],O=r[1],S=r[2],R=(1-(_+g))*M,y=(d+T)*M,x=(m-E)*M,N=(d-T)*A,b=(1-(l+g))*A,w=(p+v)*A,C=(m+E)*I,P=(p-v)*I,H=(1-(l+_))*I;return t[0]=R,t[1]=y,t[2]=x,t[3]=0,t[4]=N,t[5]=b,t[6]=w,t[7]=0,t[8]=C,t[9]=P,t[10]=H,t[11]=0,t[12]=n[0]+L-(R*L+N*O+C*S),t[13]=n[1]+O-(y*L+b*O+P*S),t[14]=n[2]+S-(x*L+w*O+H*S),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[1]=h+g,t[2]=l-p,t[3]=0,t[4]=h-g,t[5]=1-c-m,t[6]=d+_,t[7]=0,t[8]=l+p,t[9]=d-_,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,i,r,s,a){var o=1/(n-e),u=1/(r-i),c=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(r+i)*u,t[10]=(a+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*c,t[15]=0,t},e.perspective=function(t,e,n,i,r){var s=1/Math.tan(e/2),a=void 0;return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(a=1/(i-r),t[10]=(r+i)*a,t[14]=2*r*i*a):(t[10]=-1,t[14]=-2*i),t},e.perspectiveFromFieldOfView=function(t,e,n,i){var r=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+o),c=2/(r+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-o)*u*.5,t[9]=(r-s)*c*.5,t[10]=i/(n-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*n/(n-i),t[15]=0,t},e.ortho=function(t,e,n,i,r,s,a){var o=1/(e-n),u=1/(i-r),c=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(r+i)*u,t[14]=(a+s)*c,t[15]=1,t},e.lookAt=function(t,e,n,s){var a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=e[0],g=e[1],v=e[2],E=s[0],T=s[1],M=s[2],A=n[0],I=n[1],L=n[2];return Math.abs(p-A)0&&(h*=d=1/Math.sqrt(d),f*=d,l*=d);var m=u*l-c*f,_=c*h-o*l,p=o*f-u*h;return(d=m*m+_*_+p*p)>0&&(m*=d=1/Math.sqrt(d),_*=d,p*=d),t[0]=m,t[1]=_,t[2]=p,t[3]=0,t[4]=f*p-l*_,t[5]=l*m-h*p,t[6]=h*_-f*m,t[7]=0,t[8]=h,t[9]=f,t[10]=l,t[11]=0,t[12]=r,t[13]=s,t[14]=a,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t[9]=e[9]+n[9]*i,t[10]=e[10]+n[10]*i,t[11]=e[11]+n[11]*i,t[12]=e[12]+n[12]*i,t[13]=e[13]+n[13]*i,t[14]=e[14]+n[14]*i,t[15]=e[15]+n[15]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=t[9],d=t[10],m=t[11],_=t[12],p=t[13],g=t[14],v=t[15],E=e[0],T=e[1],M=e[2],A=e[3],I=e[4],L=e[5],O=e[6],S=e[7],R=e[8],y=e[9],x=e[10],N=e[11],b=e[12],w=e[13],C=e[14],P=e[15];return Math.abs(n-E)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(E))&&Math.abs(r-T)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(T))&&Math.abs(s-M)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(a-A)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(o-I)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(u-L)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(L))&&Math.abs(c-O)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(h-S)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-R)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(R))&&Math.abs(l-y)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(d-x)<=i.EPSILON*Math.max(1,Math.abs(d),Math.abs(x))&&Math.abs(m-N)<=i.EPSILON*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(_-b)<=i.EPSILON*Math.max(1,Math.abs(_),Math.abs(b))&&Math.abs(p-w)<=i.EPSILON*Math.max(1,Math.abs(p),Math.abs(w))&&Math.abs(g-C)<=i.EPSILON*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(v-P)<=i.EPSILON*Math.max(1,Math.abs(v),Math.abs(P))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function s(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],_=e[12],p=e[13],g=e[14],v=e[15],E=n[0],T=n[1],M=n[2],A=n[3];return t[0]=E*i+T*o+M*f+A*_,t[1]=E*r+T*u+M*l+A*p,t[2]=E*s+T*c+M*d+A*g,t[3]=E*a+T*h+M*m+A*v,E=n[4],T=n[5],M=n[6],A=n[7],t[4]=E*i+T*o+M*f+A*_,t[5]=E*r+T*u+M*l+A*p,t[6]=E*s+T*c+M*d+A*g,t[7]=E*a+T*h+M*m+A*v,E=n[8],T=n[9],M=n[10],A=n[11],t[8]=E*i+T*o+M*f+A*_,t[9]=E*r+T*u+M*l+A*p,t[10]=E*s+T*c+M*d+A*g,t[11]=E*a+T*h+M*m+A*v,E=n[12],T=n[13],M=n[14],A=n[15],t[12]=E*i+T*o+M*f+A*_,t[13]=E*r+T*u+M*l+A*p,t[14]=E*s+T*c+M*d+A*g,t[15]=E*a+T*h+M*m+A*v,t}function a(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=i+i,u=r+r,c=s+s,h=i*o,f=i*u,l=i*c,d=r*u,m=r*c,_=s*c,p=a*o,g=a*u,v=a*c;return t[0]=1-(d+_),t[1]=f+v,t[2]=l-g,t[3]=0,t[4]=f-v,t[5]=1-(h+_),t[6]=m+p,t[7]=0,t[8]=l+g,t[9]=m-p,t[10]=1-(h+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=s,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(9);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new i.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,r,s,a,o,u,c){var h=new i.ARRAY_TYPE(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=r,h[4]=s,h[5]=a,h[6]=o,h[7]=u,h[8]=c,h},e.set=function(t,e,n,i,r,s,a,o,u,c){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=h*a-o*c,l=-h*s+o*u,d=c*s-a*u,m=n*f+i*l+r*d;return m?(m=1/m,t[0]=f*m,t[1]=(-h*i+r*c)*m,t[2]=(o*i-r*a)*m,t[3]=l*m,t[4]=(h*n-r*u)*m,t[5]=(-o*n+r*s)*m,t[6]=d*m,t[7]=(-c*n+i*u)*m,t[8]=(a*n-i*s)*m,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-o*c,t[1]=r*c-i*h,t[2]=i*o-r*a,t[3]=o*u-s*h,t[4]=n*h-r*u,t[5]=r*s-n*o,t[6]=s*c-a*u,t[7]=i*u-n*c,t[8]=n*a-i*s,t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8];return e*(c*s-a*u)+n*(-c*r+a*o)+i*(u*r-s*o)},e.multiply=r,e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=l*i+d*a+c,t[7]=l*r+d*o+h,t[8]=l*s+d*u+f,t},e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=Math.sin(n),d=Math.cos(n);return t[0]=d*i+l*a,t[1]=d*r+l*o,t[2]=d*s+l*u,t[3]=d*a-l*i,t[4]=d*o-l*r,t[5]=d*u-l*s,t[6]=c,t[7]=h,t[8]=f,t},e.scale=function(t,e,n){var i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[3]=h-g,t[6]=l+p,t[1]=h+g,t[4]=1-c-m,t[7]=d-_,t[2]=l-p,t[5]=d+_,t[8]=1-c-f,t},e.normalFromMat4=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,E=n*u-r*a,T=n*c-s*a,M=i*u-r*o,A=i*c-s*o,I=r*c-s*u,L=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-E*y+T*R+M*S-A*O+I*L;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(u*S-a*x-c*O)*N,t[2]=(a*y-o*S+c*L)*N,t[3]=(r*y-i*x-s*R)*N,t[4]=(n*x-r*S+s*O)*N,t[5]=(i*S-n*y-s*L)*N,t[6]=(_*I-p*A+g*M)*N,t[7]=(p*T-m*I-g*E)*N,t[8]=(m*A-_*T+g*v)*N,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=e[0],d=e[1],m=e[2],_=e[3],p=e[4],g=e[5],v=e[6],E=e[7],T=e[8];return Math.abs(n-l)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-d)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(s-m)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-_)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-p)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(u-g)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-v)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-E)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(f-T)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(T))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1],m=n[2],_=n[3],p=n[4],g=n[5],v=n[6],E=n[7],T=n[8];return t[0]=l*i+d*a+m*c,t[1]=l*r+d*o+m*h,t[2]=l*s+d*u+m*f,t[3]=_*i+p*a+g*c,t[4]=_*r+p*o+g*h,t[5]=_*s+p*u+g*f,t[6]=v*i+E*a+T*c,t[7]=v*r+E*o+T*h,t[8]=v*s+E*u+T*f,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=r,e.clone=function(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new i.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=s,e.multiply=a,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],i=e[1],r=n*n+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},e.lerp=function(t,e,n,i){var r=e[0],s=e[1];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t},e.random=function(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t},e.transformMat2d=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},e.transformMat3=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t},e.rotate=function(t,e,n,i){var r=e[0]-n[0],s=e[1]-n[1],a=Math.sin(i),o=Math.cos(i);return t[0]=r*o-s*a+n[0],t[1]=r*a+s*o+n[1],t},e.angle=function(t,e){var n=t[0],i=t[1],r=e[0],s=e[1],a=n*n+i*i;a>0&&(a=1/Math.sqrt(a));var o=r*r+s*s;o>0&&(o=1/Math.sqrt(o));var u=(n*r+i*s)*a*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],r=t[1],s=e[0],a=e[1];return Math.abs(n-s)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(2);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1];return n*n+i*i}function h(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function f(t){var e=t[0],n=t[1];return e*e+n*n}e.len=h,e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=2),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;u0){n=Math.sqrt(n);var i=e[0]/n,r=e[1]/n,s=e[2]/n,a=e[3]/n,o=e[4],u=e[5],c=e[6],h=e[7],f=i*o+r*u+s*c+a*h;t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=(o-i*f)/n,t[5]=(u-r*f)/n,t[6]=(c-s*f)/n,t[7]=(h-a*f)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=e[0],l=e[1],d=e[2],m=e[3],_=e[4],p=e[5],g=e[6],v=e[7];return Math.abs(n-f)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-l)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(s-d)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-m)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(o-_)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(u-p)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))&&Math.abs(c-g)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(h-v)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))};var i=a(n(0)),r=a(n(3)),s=a(n(4));function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var i=.5*n[0],r=.5*n[1],s=.5*n[2],a=e[0],o=e[1],u=e[2],c=e[3];return t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=i*c+r*u-s*o,t[5]=r*c+s*a-i*u,t[6]=s*c+i*o-r*a,t[7]=-i*a-r*o-s*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[4],u=n[5],c=n[6],h=n[7],f=e[4],l=e[5],d=e[6],m=e[7],_=n[0],p=n[1],g=n[2],v=n[3];return t[0]=i*v+a*_+r*g-s*p,t[1]=r*v+a*p+s*_-i*g,t[2]=s*v+a*g+i*p-r*_,t[3]=a*v-i*_-r*p-s*g,t[4]=i*h+a*o+r*c-s*u+f*v+m*_+l*g-d*p,t[5]=r*h+a*u+s*o-i*c+l*v+m*p+d*_-f*g,t[6]=s*h+a*c+i*u-r*o+d*v+m*g+f*p-l*_,t[7]=a*h-i*o-r*u-s*c+m*v-f*_-l*p-d*g,t}e.getReal=r.copy,e.setReal=r.copy,e.mul=c;var h=e.dot=r.dot,f=e.length=r.length,l=(e.len=f,e.squaredLength=r.squaredLength);e.sqrLen=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(6);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,r,s,a){var o=new i.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o[4]=s,o[5]=a,o},e.set=function(t,e,n,i,r,s,a){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=n*s-i*r;return u?(u=1/u,t[0]=s*u,t[1]=-i*u,t[2]=-r*u,t[3]=n*u,t[4]=(r*o-s*a)*u,t[5]=(i*a-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=Math.sin(n),h=Math.cos(n);return t[0]=i*h+s*c,t[1]=r*h+a*c,t[2]=i*-c+s*h,t[3]=r*-c+a*h,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i*c,t[1]=r*c,t[2]=s*h,t[3]=a*h,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=i*c+s*h+o,t[5]=r*c+a*h+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=e[0],h=e[1],f=e[2],l=e[3],d=e[4],m=e[5];return Math.abs(n-c)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(r-h)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(s-f)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-l)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-d)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-m)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1],f=n[2],l=n[3],d=n[4],m=n[5];return t[0]=i*c+s*h,t[1]=r*c+a*h,t[2]=i*f+s*l,t[3]=r*f+a*l,t[4]=i*d+s*m+o,t[5]=r*d+a*m+u,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,r){var s=new i.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=n,s[3]=r,s},e.set=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*s-r*i;return a?(a=1/a,t[0]=s*a,t[1]=-i*a,t[2]=-r*a,t[3]=n*a,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+s*o,t[1]=r*u+a*o,t[2]=i*-o+s*u,t[3]=r*-o+a*u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1];return t[0]=i*o,t[1]=r*o,t[2]=s*u,t[3]=a*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,i){return t[2]=i[2]/i[0],n[0]=i[0],n[1]=i[1],n[3]=i[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=s,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*o+s*u,t[1]=r*o+a*u,t[2]=i*c+s*h,t[3]=r*c+a*h,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var i=d(n(0)),r=d(n(9)),s=d(n(8)),a=d(n(5)),o=d(n(4)),u=d(n(3)),c=d(n(7)),h=d(n(6)),f=d(n(2)),l=d(n(1));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=i,e.mat2=r,e.mat2d=s,e.mat3=a,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=h,e.vec3=f,e.vec4=l}])},function(t,e,n){"use strict";var i=n(19),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i={};n.r(i),n.d(i,"POSITION",(function(){return u})),n.d(i,"NORMAL",(function(){return c})),n.d(i,"DEPTH",(function(){return h})),n.d(i,"DISTANCE",(function(){return f}));var r=n(35),s=n.n(r).a,a=n(36),o=n.n(a).a,u="POSITION",c="NORMAL",h="DEPTH",f="DISTANCE",l={webgl:s,webglExtensions:o,Hilo:i};Object.assign(l,s,o,i);e.a=l},function(t,e,n){"use strict";var i={},r={_cache:i,level:3,LEVEL_LOG:3,LEVEL_WARN:2,LEVEL_ERROR:1,LEVEL_NONE:0,log:function(){return this.level>=3&&console.log.apply(console,arguments),this},warn:function(){return this.level>=2&&console.warn.apply(console,arguments),this},error:function(){return this.level>=1&&console.error.apply(console,arguments),this},logOnce:function(t){return i["log_"+t]||(i["log_"+t]=!0,this.log.apply(this,Array.prototype.slice.call(arguments,1))),this},warnOnce:function(t){return i["warn_"+t]||(i["warn_"+t]=!0,this.warn.apply(this,Array.prototype.slice.call(arguments,1))),this},errorOnce:function(t){return i["error_"+t]||(i["error_"+t]=!0,this.error.apply(this,Array.prototype.slice.call(arguments,1))),this}};e.a=r},function(t,e,n){"use strict";n.r(e),n.d(e,"each",(function(){return p})),n.d(e,"getRelativePath",(function(){return d})),n.d(e,"convertUint8ArrayToString",(function(){return m})),n.d(e,"getExtension",(function(){return _})),n.d(e,"getIndexFromSortedArray",(function(){return g})),n.d(e,"insertToSortedArray",(function(){return v})),n.d(e,"padLeft",(function(){return E})),n.d(e,"getTypedArrayClass",(function(){return I})),n.d(e,"copyArrayData",(function(){return L})),n.d(e,"isStrOrNumber",(function(){return O})),n.d(e,"getTypedArrayGLType",(function(){return T})),n.d(e,"getBlobUrl",(function(){return y})),n.d(e,"isBlobUrl",(function(){return S})),n.d(e,"revokeBlobUrl",(function(){return R})),n.d(e,"isArrayLike",(function(){return x})),n.d(e,"getElementRect",(function(){return N})),n.d(e,"serialRun",(function(){return b})),n.d(e,"hasOwnProperty",(function(){return w}));var i=n(3),r=n(2);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a,o=r.a.BYTE,u=r.a.UNSIGNED_BYTE,c=r.a.SHORT,h=r.a.UNSIGNED_SHORT,f=r.a.UNSIGNED_INT,l=r.a.FLOAT;function d(t,e){if(/^(?:http|blob|data:|\/)/.test(e))return e;var n;for(t=t.replace(/\/[^/]*?$/,"").split("/"),e=e.split("/"),n=0;n>1,a=n(t[s],e);if(0===a)return[s,s];a<0?i=s+1:r=s-1}return i>r?[r,i]:[i,r]}function v(t,e,n){var i=g(t,e,n);t.splice(i[1],0,e)}function E(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?h:t instanceof Uint32Array?f:l}var M,A,I=(s(M={},o,Int8Array),s(M,u,Uint8Array),s(M,c,Int16Array),s(M,h,Uint16Array),s(M,f,Uint32Array),s(M,l,Float32Array),A=M,function(t){return A[t]||Float32Array});function L(t,e,n,i,r){if(t&&e){e.isGeometryData&&(e=e.data);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,i){return t.then((function(){return e(n,i)}))}),Promise.resolve())}function w(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec3.round(this.elements,this.elements),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},random:function(t){return i.vec3.random(this.elements,t),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i,r={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(i=0,function(t){var e=++i;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=r},function(t,e,n){"use strict";var i,r=n(0),s=n(1),a=n(5),o=n(10),u=new a.a,c=new a.a,h=s.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=r.mat4.create()},copy:function(t){return r.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this},identity:function(){return r.mat4.identity(this.elements),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,i){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],h=n[1],f=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=h*m-f*d,g=f*l-o*m,v=o*d-h*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=h*m-f*d)*p+(g=f*l-(o+=1e-7)*m)*g+(v=o*d-h*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new h),this.determinant()<0&&(n.x*=-1),i.copy(this),u.inverse(n),i.scale(u),t.fromMat4(i),r&&r.set(0,0,0),this}});h.prototype.sub=h.prototype.subtract,h.prototype.mul=h.prototype.multiply,e.a=h},function(t,e,n){"use strict";var i=n(1),r=n(12),s=n(4),a=i.a.create({Extends:r.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;a.superclass.constructor.call(this,t,e,n,i)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(s.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(s.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=a},function(t,e,n){"use strict";var i=n(37),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i=n(0),r=n(11),s=n(1),a=n(9),o=new r.a,u=s.a.create({Mixes:a.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=i.quat.fromValues(t,e,n,r)},copy:function(t,e){return i.quat.copy(this.elements,t.elements),e||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=this.elements;return i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],n||this.fire("update"),this},set:function(t,e,n,r,s){return i.quat.set(this.elements,t,e,n,r),s||this.fire("update"),this},identity:function(t){return i.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,e,n){return i.quat.rotationTo(this.elements,t.elements,e.elements),n||this.fire("update"),this},setAxes:function(t,e,n,r){return i.quat.setAxes(this.elements,t.elements,e.elements,n.elements),r||this.fire("update"),this},setAxisAngle:function(t,e,n){return i.quat.setAxisAngle(this.elements,t.elements,e),n||this.fire("update"),this},getAxisAngle:function(t){return i.quat.getAxisAngle(t.elements,this.elements)},add:function(t,e){return i.quat.add(this.elements,this.elements,t.elements),e||this.fire("update"),this},multiply:function(t,e){return i.quat.multiply(this.elements,this.elements,t.elements),e||this.fire("update"),this},premultiply:function(t,e){return i.quat.multiply(this.elements,t.elements,this.elements),e||this.fire("update"),this},scale:function(t,e){return i.quat.scale(this.elements,this.elements,t),e||this.fire("update"),this},rotateX:function(t,e){return i.quat.rotateX(this.elements,this.elements,t),e||this.fire("update"),this},rotateY:function(t,e){return i.quat.rotateY(this.elements,this.elements,t),e||this.fire("update"),this},rotateZ:function(t,e){return i.quat.rotateZ(this.elements,this.elements,t),e||this.fire("update"),this},calculateW:function(t){return i.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return i.quat.dot(this.elements,t.elements)},lerp:function(t,e,n){return i.quat.lerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},slerp:function(t,e,n){return i.quat.slerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},sqlerp:function(t,e,n,r,s,a){return i.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,r.elements,s),a||this.fire("update"),this},invert:function(t){return i.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return i.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return i.quat.length(this.elements)},squaredLength:function(){return i.quat.squaredLength(this.elements)},normalize:function(t){return i.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,e){return i.quat.fromMat3(this.elements,t.elements),e||this.fire("update"),this},fromMat4:function(t,e){return o.fromMat4(t),this.fromMat3(o,e),this},exactEquals:function(t){return i.quat.exactEquals(this.elements,t.elements)},equals:function(t){return i.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,i=.5*t.y,r=.5*t.z,s=t.order||"ZYX",a=Math.sin(n),o=Math.cos(n),u=Math.sin(i),c=Math.cos(i),h=Math.sin(r),f=Math.cos(r),l=this.elements;return"XYZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"YXZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"ZXY"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"ZYX"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"YZX"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f-a*u*h):"XZY"===s&&(l[0]=a*c*f-o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f+a*u*h),e||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});u.prototype.mul=u.prototype.multiply,u.prototype.len=u.prototype.length,u.prototype.sqrLen=u.prototype.squaredLength,e.a=u},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=i.mat3.create()},copy:function(t){return i.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)n[i]=t[e+i];return this},set:function(t,e,n,r,s,a,o,u,c){return i.mat3.set(this.elements,t,e,n,r,s,a,o,u,c),this},identity:function(){return i.mat3.identity(this.elements),this},transpose:function(){return i.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return i.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return i.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return i.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return i.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return i.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return i.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return i.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return i.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return i.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,i,r){var s=Math.cos(t),a=Math.sin(t);return this.set(i*s,-r*a,0,i*a,r*s,0,e,n,1),this}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,e.a=r},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=i.vec4.fromValues(t,e,n,r)},copy:function(t){return i.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,r){return i.vec4.set(this.elements,t,e,n,r),this},add:function(t,e){return e||(e=t,t=this),i.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec4.ceil(this.elements,this.elements),this},floor:function(){return i.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec4.round(this.elements,this.elements),this},scale:function(t){return i.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec4.squaredDistance(t.elements,e.elements)},length:function(){return i.vec4.length(this.elements)},squaredLength:function(){return i.vec4.squaredLength(this.elements)},negate:function(){return i.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec4.inverse(this.elements,t.elements),this},normalize:function(){return i.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return i.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return i.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return i.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i=n(1),r=n(6),s=n(7),a=n(3),o=new s.a,u=r.a.DEG2RAD,c=r.a.RAD2DEG,h=i.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,i=n[0],s=n[1],o=n[2],u=n[4],c=n[5],h=n[6],f=n[8],l=n[9],d=n[10];e=e||this.order,this.order=e;var m=r.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-u,i)):(this.elements[0]=Math.atan2(h,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(f,d),this.elements[2]=Math.atan2(s,c)):(this.elements[1]=Math.atan2(-o,i),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[1]=Math.atan2(-o,d),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(s,i))):"ZYX"===e?(this.elements[1]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(h,d),this.elements[2]=Math.atan2(s,i)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(m(s,-1,1)),Math.abs(s)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-o,i)):(this.elements[0]=0,this.elements[1]=Math.atan2(f,d))):"XZY"===e?(this.elements[2]=Math.asin(-m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(h,c),this.elements[1]=Math.atan2(f,i)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):a.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=h},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=i.vec2.fromValues(t,e)},copy:function(t){return i.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return i.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),i.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec2.ceil(this.elements,this.elements),this},floor:function(){return i.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec2.round(this.elements,this.elements),this},scale:function(t){return i.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec2.squaredDistance(t.elements,e.elements)},length:function(){return i.vec2.length(this.elements)},squaredLength:function(){return i.vec2.squaredLength(this.elements)},negate:function(){return i.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec2.inverse(this.elements,t.elements),this},normalize:function(){return i.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return i.vec2.random(this.elements,t),this},transformMat3:function(t){return i.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e){t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){function i(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.indices=e,this.mode=n,this.attrs=[],this.attrIndexMap={}}return r(t,null,[{key:"cp",value:function(t){return t}},{key:"minus",value:function(t,e){return t-e}},{key:"plus",value:function(t,e){return t+e}},{key:"pp",value:function(t,e,n,i){return i-e-n+t}},{key:"depp",value:function(t,e,n,i){return e+n-t+i}},{key:"ATTR",get:function(){return a}},{key:"ATTR_NAME_ID",get:function(){return u}}]),r(t,[{key:"getAttrLength",value:function(){return this.attrs[0].data.length/this.attrs[0].itemCount}},{key:"attrIdToName",value:function(t){return o[t]||"OTHER"}},{key:"addAttr",value:function(t,e,n){a[t]?(this.attrIndexMap[t]=this.attrs.length,n||(n=f[t])):n||(n=1),this.attrs.push({name:t,itemCount:n,data:e})}},{key:"getAttr",value:function(t){if(this.attrIndexMap[t])return this.attrs[this.attrIndexMap[t]];for(var e=this.attrs.length-1;e>=0;e--){var n=this.attrs[e];if(n.name===t)return n}}},{key:"cal",value:function(t,e,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),s=3;s=0;c--)o[u+c]=n.apply(null,r.map((function(t){return a[t*i.itemCount+c]})))}))}},{key:"quantize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attrs.forEach((function(e){if("JOINT"!==e.name&&0!=t[e.name]){var n=s.encode(e.data,t[e.name]||12);e.quantizationBit=n.quantizationBit,e.min=n.min,e.max=n.max,e.data=n.data}}))}},{key:"dequantize",value:function(){this.attrs.forEach((function(t){t.quantizationBit&&(t.data=s.decode(t.data,t.quantizationBit,t.min,t.max))}))}},{key:"convertTypedArray",value:function(){!this.indices||this.indices instanceof Array||(this.indices=Array.from(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array||t.data instanceof Float32Array||(t.data=Array.from(t.data))}))}},{key:"clearEBAttrs",value:function(){delete this.clers,delete this.holes,delete this.handles}},{key:"convertToTypedArray",value:function(){this.indices instanceof Array&&(this.getAttrLength()>65535?this.indices=new Uint32Array(this.indices):this.indices=new Uint16Array(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array&&(t.data=new Float32Array(t.data))}))}},{key:"prepareToWorkerSend",value:function(){return this.clearEBAttrs(),this.convertToTypedArray(),this.getAllBuffers()}},{key:"clone",value:function(){var e=new t(Array.from(this.indices),this.mode);return Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=Array.from(e.data),e})),e}},{key:"cloneStruct",value:function(){var e=new t;return e.mode=this.mode,this.indices&&(e.indices=[]),Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=[],e})),e}},{key:"toHilo3dGeometry",value:function(t,e){var n=e||new t.Geometry;return this.indices&&(this.indices.BYTES_PER_ELEMENT?n.indices=new t.GeometryData(this.indices,1):this.getAttrLength()>65535?n.indices=new t.GeometryData(new Uint32Array(this.indices),1):n.indices=new t.GeometryData(new Uint16Array(this.indices),1)),this.attrs.forEach((function(e){var i=c[e.name];i&&(e.data.BYTES_PER_ELEMENT?n[i]=new t.GeometryData(e.data,e.itemCount):n[i]=new t.GeometryData(new Float32Array(e.data),e.itemCount))})),n}},{key:"getAllBuffers",value:function(){var t=[];return this.indices.BYTES_PER_ELEMENT&&t.push(this.indices.buffer),this.attrs.forEach((function(e){e.data&&e.data.BYTES_PER_ELEMENT&&t.push(e.data.buffer)})),t}}],[{key:"fromGLTFPrimitive",value:function(e){var n=new t(e.indices,e.mode),i=e.attributes,r=0;for(var s in i.POSITION&&(r=i.POSITION.length/3),i)if(a[s]){var o=f[a[s]];r&&(o=i[s].length/r),n.addAttr(a[s],i[s],o)}else console.warn("Dont support attribute",s);return n}},{key:"fromHilo3dGeometry",value:function(e){var n=new t(e.indices.data,e.mode);for(var i in h)e[i]&&n.addAttr(h[i],e[i].data,e[i].size);return n}}]),t}();t.exports=l},function(t,e){var n={};function i(t){return n[t]||(n[t]=Math.pow(2,t)-1),n[t]}t.exports={cal:function(t,e,n,r){var s=i(r),a=n-e;return Math.round((t-e)/a*s)},encode:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=t.length,r=i(e),s=1/0,a=-1/0,o=0;o1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,a=t.length,o=i(s),u=r-n||1,c=0;c1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=t.length,a=i(e),o=r-n,u=new Float32Array(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,i=t.length,r=0;r1&&void 0!==arguments[1]?arguments[1]:0;return t instanceof Uint8Array&&(e=t.byteOffset,t=t.buffer),function(t){return new u[t.type](t).decompress()}(function(t,e){var n=new Uint8Array(t,e,4);if(65!==n[0]||77!==n[1]||67!==n[2])throw new Error("The file is not AMC format!");var i=c[n[3]].read(t,e+4);return i.geometry.type=n[3],i.geometry}(t,e))}var f,l=null,d=null;function m(t,e){return!l&&o()?(l=new a({wasmURL:t,memPages:e}),d=l.init()):d||Promise.resolve()}function _(t,e,n){if(l||m(e,n),!l||!l.isReady)return h(t);try{return l.decompress(t)}catch(e){return console.warn("wasm decompress error",e),h(t)}}var p=null;function g(t){return t=t||"https://g.alicdn.com/hilo/amc/0.1.27/worker.js",p||(!1===f||"undefined"==typeof Worker?Promise.reject("dont support web worker"):p=/^(?:http|blob|data:|\/\/)/.test(t)?new Promise((function(e,n){var i=new XMLHttpRequest;i.addEventListener("load",(function(){if("undefined"==typeof URL||"undefined"==typeof Blob)f=new Worker("data:application/javascript, ".concat(this.responseText));else{var t=URL.createObjectURL(new Blob([this.responseText]));f=new Worker(t)}f.onerror=function(t){console.log("web worker error",t),f=!1,n(t)},e(f)})),i.addEventListener("error",(function(t){return n(t)})),i.open("get",t,!0),i.send()})):new Promise((function(e,n){(f=new Worker(t)).onerror=function(t){console.log("web worker init error",t),f=!1,n(t)},e(f)})))}var v=0;function E(t,e,n,r){return e=e&&o(),t=new Uint8Array(t),g(r).then((function(r){return new Promise((function(s,a){var o=v++,u=function(e){if(e.data.id===o)if(r.removeEventListener("message",u),u=null,e.data.data){var n=e.data.data;n.constructor=i,n.__proto__=i.prototype,s(n)}else s(h(t))};r.addEventListener("message",u),r.postMessage({id:o,data:t,useWASM:e,wasmURL:n},[t.buffer])}))})).catch((function(i){return e?_(t,n):h(t)}))}t.exports={initWASM:m,initWorker:g,decompress:function(t,e,n){var i=o();return!i||t.byteLength>1048576?E(t,i,e,n):i?Promise.resolve(_(t,e)):Promise.resolve(h(t))},decompressWithJS:h,decompressWithWASM:_,decompressWithWorker:E,destory:function(){f&&(f.terminate(),f=null,p=null),l&&(l=null,d=null)}}},function(t,e,n){function i(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;n-=2)e[t[n]]=t[n-1]}},{key:"mapBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex,r=this.currentVertex-n+1,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i,i=r,e[this.prevCorner(t[s])]=r++;this.currentVertex-=n}},{key:"mapHoleBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex-n+1,r=i,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i++,e[this.prevCorner(t[s])]=s?i:r;this.currentVertex-=n}},{key:"fixNegativeIndex",value:function(t){for(var e=t,n=this.indices;n[t]<0;){if(e===-n[-n[t]]||n[t]===n[-n[t]]){console.warn("dead loop bug!!"),n[s]=0;break}n[t]=n[-n[t]]}}},{key:"fixIndicesAndReadVertice",value:function(){for(var t,e=this.indices,n=this.handlesMap,i=this.clers,r=i.length,s=-1,a=[],u=0,c=0;u1&&void 0!==arguments[1]?arguments[1]:-1;if(!this.readedVertexMap[t]&&(this.readedVertexMap[t]=1,!this.noParallelogramPrediction)){var n=this.indices,i=this.geometry;-1===e?void 0!==this.lastReadVertexIndex&&i.cal(i,t,a.plus,this.lastReadVertexIndex,t):i.cal(i,t,a.depp,n[e],n[this.prevCorner(e)],n[this.nextCorner(e)],t),this.lastReadVertexIndex=t}}},{key:"markCorner",value:function(t,e){var n=this.indices;void 0===n[this.nextCorner(t)]&&(n[this.nextCorner(t)]=-this.prevCorner(e[0])),void 0===n[this.prevCorner(t)]&&(n[this.prevCorner(t)]=-this.nextCorner(e[e.length-1]))}},{key:"onFaceC",value:function(t){var e=this.indices,n=3*this.currentFace,i=this.currentVertex--;e[n]=i;var r=t.pop();return e[this.nextCorner(r)]=i,e[this.prevCorner(r)]=-this.nextCorner(t[t.length-1]),r=t.shift(),e[this.prevCorner(r)]=i,e[this.nextCorner(r)]=-this.prevCorner(t[0]),t.push(n),t}},{key:"onFaceL",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.unshift(e+2),t.push(e),t}},{key:"onFaceF",value:function(t,e){return t&&this.mapBoundary(t),this.onFaceE(null,e)}},{key:"onFaceE",value:function(t,e){var n=3*this.currentFace;return t&&e.push(t),[n+2,n+1,n]}},{key:"onFaceR",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.push(e+1,e),t}},{key:"onHandleEnd",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=this.handlesMap[this.currentFace],a=e.splice(0,t);return e.shift(),n.push(a),i[this.nextCorner(s)]=-(r+1),i[this.prevCorner(s)]=-this.nextCorner(a[a.length-1]),i[r]=-this.prevCorner(a[0]),e.push(r),e}},{key:"onHandleStart",value:function(t,e){for(var n,r=this.indices,s=3*this.currentFace,a=this.handlesMap[this.currentFace],o=e.length-1;o>=0;o--){var u=e[o].indexOf(a);if(u>=0){var c,h=(n=e.splice(o,1)[0]).splice(0,u);n.shift(),(c=n).push.apply(c,i(h));break}}return r[this.nextCorner(a)]=-(s+1),r[this.prevCorner(a)]=-this.nextCorner(n[n.length-1]),r[s]=-this.prevCorner(t[0]),(t=n.concat(t)).push(s),t}},{key:"onFaceS",value:function(t,e,n){var i=this.handlesMap,r=this.indices,s=3*this.currentFace;if(i[this.currentFace]){this.markCorner(t.pop(),t);var a=t.indexOf(i[this.currentFace]);t=a>=0?this.onHandleEnd(a,t,n):this.onHandleStart(t,n)}else{var o=t.pop();this.markCorner(o,t),r[s]=-this.nextCorner(o);var u=e.pop();this.markCorner(u.pop(),u),(t=u.concat(t)).push(s)}return t}},{key:"onFaceM",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=t.splice(0,this.holes[this.currentHole--]);this.mapHoleBoundary(s);var a=i[this.prevCorner(s[0])];i[r]=a;var o=t.pop();return i[this.prevCorner(o)]=-this.nextCorner(t[t.length-1]),i[this.nextCorner(o)]=a,o=t.shift(),i[this.prevCorner(o)]=a,i[this.nextCorner(o)]=-this.prevCorner(t[0]),t.push(r),t}},{key:"decompress",value:function(){this.readedVertexMap=new Uint8Array(this.vertexCount);var t=this.faceCount,e=this.indices=new Array(3*t);this.currentFace=t-1,this.currentVertex=this.vertexCount-1,this.currentHole=this.holes.length-1;for(var n,i=this.clers,r=[],s=[];this.currentFace>=0;){var a="onFace"+u[i[this.currentFace]];this[a]?n=this[a](n,r,s):console.warn("has no ".concat(a)),this.currentFace--}return this.mapBoundary(n),this.fixIndicesAndReadVertice(this.indices),this.geometry.indices=e,this.geometry.dequantize(),this.geometry}},{key:"_onDecompressFace",value:function(t,e){this.onDecompressFace&&this.onDecompressFace(t,e)}}])&&r(e.prototype,n),t}();t.exports=c},function(t,e){var n={C:0,R:1,L:2,S:3,E:4,M:5,F:6},i=[];for(var r in n)i[n[r]]=r;n.map=i,t.exports=n},function(t,e,n){var i=n(0);function r(t,e,n,i){return new t(e.slice(n,n+i*t.BYTES_PER_ELEMENT))}t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t),s=new i,a=function(t,e){var n={};return n.version=t.getUint8(e++),n.faceCount=t.getUint32(e,!0),e+=4,n.vertexCount=t.getUint32(e,!0),e+=4,n.attrCount=t.getUint8(e++),n.noParallelogramPrediction=t.getUint8(e++),n.holesCount=t.getUint16(e,!0),e+=2,n.handlesCount=t.getUint16(e,!0),e+=2,n.headerBytes=15,n}(n,e);return e+=a.headerBytes,s.mode="CLERS",e=function(t,e,n,i){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wasmURL=e.wasmURL||"https://ossgw.alicdn.com/tmall-c3/tmx/70b8d82ccf33e97a124e54c2d6a3e0c7.wasm",this.memPages=e.memPages||256,this.memPages<256&&(this.memPages=256),this.isReady=!1}var e,n;return e=t,(n=[{key:"initASMJS",value:function(){this.isReady=!0,this.dv=new DataView(HEAP8.buffer),this.heap8=HEAP8,this.ins={exports:{__Z7AMCinitj:Module.__Z7AMCinitj,__Z12AMDecompressv:Module.__Z12AMDecompressv}}}},{key:"init",value:function(){var t=this,e=this.memory=new WebAssembly.Memory({initial:this.memPages});this.dv=new DataView(e.buffer);var n=this.heap8=new Uint8Array(e.buffer),i={global:{NaN:5,Infinity:6},env:{memoryBase:0,memory:e,_malloc:function(){return 2097152},_memset:function(t,e,i){return n.fill(e,t,t+i),t},_printf:function(t,e){for(var i=t;n[i];)i++;var r=String.fromCharCode.apply(String,function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e65536?new Uint32Array(d):new Uint16Array(d);var m=new r(d);return h.forEach((function(t){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t,3),i=n[0],r=n[1],s=n[2],a=new Float32Array(e.buffer.slice(s,s+u*r*4));m.addAttr(m.attrIdToName(i),a,r)})),m}}])&&i(e.prototype,n),t}();t.exports=s},function(t,e){var n;t.exports=function(){return void 0===n&&(n=function(){if("undefined"==typeof WebAssembly||"undefined"==typeof fetch||function(){if(!/iPad|iPhone|iPod/i.test(navigator.userAgent))return!1;if(/OS (\d+)_(\d+)_?(\d+)?/i.test(navigator.userAgent)){var t=Number(RegExp.$1),e=Number(RegExp.$2);if(11===t&&e>=3||t>11)return!1}return!0}())return!1;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)}catch(t){return console.log("err while check WebAssembly",t),!1}}()),n}}])},function(t,e,n){"use strict";var i=n(38),r=n.n(i),s=n(1),a=n(5),o=s.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new r.a,this.origin=t.origin||new a.a(0,0,0),this.direction=t.direction||new a.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,i,r){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,i,r)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,i,r)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,i){return n.squaredDistance(t[e])-n.squaredDistance(i[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new a.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var i=n(0),r=n(1),s=n(9),a=n(5),o=r.a.create({Mixes:s.a,Extends:a.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.fire("update"),this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this.fire("update"),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this.fire("update"),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this.fire("update"),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this.fire("update"),this},round:function(){return i.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.fire("update"),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this.fire("update"),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this.fire("update"),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},random:function(t){return i.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this.fire("update"),this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});e.a=o},function(t,e){t.exports="#define GLSLIFY 1\n#define HILO_FRONT_SIDE 1028\n#define HILO_BACK_SIDE 1029\n#define HILO_FRONT_AND_BACK_SIDE 1032\n#define HILO_PI 3.141592653589793\n#define HILO_INVERSE_PI 0.3183098861837907"},function(t,e){var n=function(){var t,e,n=function(t){var e,n,r={};for(e in t)n=t[e],i.hasOwnProperty(e)?i[e].call(this,n):r[e]=n;s(this.prototype,r)},i={Extends:function(t){var e=this.prototype,n=r(t.prototype);s(this,t),s(n,e),n.constructor=this,this.prototype=n,this.superclass=t.prototype},Mixes:function(t){t instanceof Array||(t=[t]);for(var e,n=this.prototype;e=t.shift();)s(n,e.prototype||e)},Statics:function(t){s(this,t)}},r=function(){if(Object.__proto__)return function(t){return{__proto__:t}};var t=function(){};return function(e){return t.prototype=e,new t}}(),s=function(t){for(var n=1,i=arguments.length;n0&&void 0!==arguments[0]?arguments[0]:new r.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,i){return this.normal.set(t,e,n),this.distance=i,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new r.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=s},function(t,e,n){"use strict";var i=n(1),r=n(5),s=new r.a,a=i.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new r.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this.fire("update"),this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this.fire("update"),this},identity:function(){return r.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this.fire("update"),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this.fire("update"),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,e,n,i,s){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),s||this.fire("update"),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this.fire("update"),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this.fire("update"),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.fire("update"),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this.fire("update"),this},lookAt:function(t,e,n){return t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},targetTo:function(t,e,n){t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],u=n[1],c=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=u*m-c*d,g=c*l-o*m,v=o*d-u*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=u*m-c*d)*p+(g=c*l-(o+=1e-7)*m)*g+(v=o*d-u*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this.fire("update"),this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new u.a),this.determinant()<0&&(n.x*=-1),i.copy(this),h.inverse(n),i.scale(h),t.fromMat4(i),r&&r.set(0,0,0),this}});e.a=l},function(t,e,n){"use strict";var i=n(1),r=n(9),s=n(6),a=n(13),o=s.a.DEG2RAD,u=s.a.RAD2DEG,c=i.a.create({Mixes:r.a,Extends:a.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a.a.call(this,t,e,n)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*u,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*u,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*u,this.fire("update")}}});e.a=c},function(t,e,n){"use strict";var i=n(1),r=n(20),s=i.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new r.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],u=n[5],c=n[6],h=n[7],f=n[8],l=n[9],d=n[10],m=n[11],_=n[12],p=n[13],g=n[14],v=n[15];return e[0].set(a-i,h-o,m-f,v-_).normalize(),e[1].set(a+i,h+o,m+f,v+_).normalize(),e[2].set(a+r,h+u,m+l,v+p).normalize(),e[3].set(a-r,h-u,m-l,v-p).normalize(),e[4].set(a-s,h-c,m-d,v-g).normalize(),e[5].set(a+s,h+c,m+d,v+g).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)-1&&a.splice(h,1)}}return 0==a.length&&delete s[i],!0}return!1}},r=n(19).create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),s=window.Event;if(s){var a=s.prototype,o=a.stopImmediatePropagation;a.stopImmediatePropagation=function(){o&&o.call(this),this._stopped=!0}}t.exports=i},function(t,e,n){var i=n(94),r=n(96),s=n(97),a=n(100),o=n(34),u=[[0,0,0],[0,0,0],[0,0,0]],c=[0,0,0];function h(t,e){this.origin=t||[0,0,0],this.direction=e||[0,0,-1]}t.exports=h,h.prototype.set=function(t,e){this.origin=t,this.direction=e},h.prototype.copy=function(t){o(this.origin,t.origin),o(this.direction,t.direction)},h.prototype.clone=function(){var t=new h;return t.copy(this),t},h.prototype.intersectsSphere=function(t,e){return s(c,this.origin,this.direction,t,e)},h.prototype.intersectsPlane=function(t,e){return r(c,this.origin,this.direction,t,e)},h.prototype.intersectsTriangle=function(t){return i(c,this.origin,this.direction,t)},h.prototype.intersectsBox=function(t){return a(c,this.origin,this.direction,t)},h.prototype.intersectsTriangleCell=function(t,e){var n=t[0],i=t[1],r=t[2];return u[0]=e[n],u[1]=e[i],u[2]=e[r],this.intersectsTriangle(u)}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_COLOR\n varying vec4 v_color;\n#endif\n\n#ifdef HILO_USE_HDR\n uniform float u_exposure;\n#endif\n\n#ifdef HILO_GAMMA_CORRECTION\n uniform float u_gammaFactor;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_TEXCOORD0\n varying vec2 v_texcoord0;\n#endif\n\n#ifdef HILO_HAS_TEXCOORD1\n varying vec2 v_texcoord1;\n#endif\n\n#if defined(HILO_HAS_TEXCOORD0) || defined(HILO_HAS_TEXCOORD1)\n #if defined(HILO_HAS_TEXCOORD0) && defined(HILO_HAS_TEXCOORD1)\n #define HILO_SAMPLER_2D hiloSampler2D\n // https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Opaque_types\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) hiloTexture2D(HILO_SAMPLER_2D.texture, HILO_SAMPLER_2D.uv)\n struct hiloSampler2D{\n sampler2D texture;\n int uv; \n };\n \n vec4 hiloTexture2D(sampler2D texture, int uv){\n if(uv == 0){\n return texture2D(texture, v_texcoord0);\n }\n else{\n return texture2D(texture, v_texcoord1);\n }\n }\n #else\n #ifdef HILO_HAS_TEXCOORD1\n #define HILO_V_TEXCOORD v_texcoord1\n #else\n #define HILO_V_TEXCOORD v_texcoord0\n #endif\n #define HILO_SAMPLER_2D sampler2D\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) texture2D(HILO_SAMPLER_2D, HILO_V_TEXCOORD)\n #endif\n#endif\n\n\n#ifdef HILO_DIFFUSE_CUBE_MAP\n varying vec3 v_position;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_NORMAL\n varying vec3 v_normal;\n #ifdef HILO_NORMAL_MAP\n uniform HILO_SAMPLER_2D u_normalMap;\n varying mat3 v_TBN;\n \n #ifdef HILO_NORMAL_MAP_SCALE\n uniform float u_normalMapScale;\n #endif\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#if defined(HILO_HAS_LIGHT) || defined(HILO_HAS_FRAG_POS)\n varying vec3 v_fragPos;\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n#ifdef HILO_DIRECTIONAL_LIGHTS\n uniform vec3 u_directionalLightsColor[HILO_DIRECTIONAL_LIGHTS];\n uniform vec3 u_directionalLightsInfo[HILO_DIRECTIONAL_LIGHTS];\n #ifdef HILO_DIRECTIONAL_LIGHTS_SMC\n uniform sampler2D u_directionalLightsShadowMap[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowMapSize[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform mat4 u_directionalLightSpaceMatrix[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowBias[HILO_DIRECTIONAL_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_SPOT_LIGHTS\n uniform vec3 u_spotLightsPos[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsDir[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsColor[HILO_SPOT_LIGHTS];\n uniform vec2 u_spotLightsCutoffs[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsInfo[HILO_SPOT_LIGHTS];\n uniform float u_spotLightsRange[HILO_SPOT_LIGHTS];\n #ifdef HILO_SPOT_LIGHTS_SMC\n uniform sampler2D u_spotLightsShadowMap[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowMapSize[HILO_SPOT_LIGHTS_SMC];\n uniform mat4 u_spotLightSpaceMatrix[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowBias[HILO_SPOT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_POINT_LIGHTS\n uniform vec3 u_pointLightsPos[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsColor[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsInfo[HILO_POINT_LIGHTS];\n uniform float u_pointLightsRange[HILO_POINT_LIGHTS];\n #ifdef HILO_POINT_LIGHTS_SMC\n uniform samplerCube u_pointLightsShadowMap[HILO_POINT_LIGHTS_SMC];\n uniform mat4 u_pointLightSpaceMatrix[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightsShadowBias[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightCamera[HILO_POINT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_AREA_LIGHTS\n uniform vec3 u_areaLightsPos[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsColor[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsWidth[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsHeight[HILO_AREA_LIGHTS];\n uniform sampler2D u_areaLightsLtcTexture1;\n uniform sampler2D u_areaLightsLtcTexture2;\n\n "+n(113)+"\n#endif\n\n#ifdef HILO_AMBIENT_LIGHTS\n uniform vec3 u_ambientLightsColor;\n#endif\n\n"+n(64)+"\n"+n(65)+"\n"+n(66)+"\n"+n(67)+"\n"+n(68)},function(t,e){t.exports="#define GLSLIFY 1\nvec4 textureEnvMap(sampler2D texture, vec3 position){\n return texture2D(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI));\n}\n\nvec4 textureEnvMap(samplerCube texture, vec3 position){\n return textureCube(texture, position);\n}\n\n#ifdef HILO_USE_SHADER_TEXTURE_LOD\n vec4 textureEnvMapLod(sampler2D texture, vec3 position, float lod){\n return texture2DLodEXT(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI), lod);\n }\n\n vec4 textureEnvMapLod(samplerCube texture, vec3 position, float lod){\n return textureCubeLodEXT(texture, position, lod);\n }\n#endif\n\n"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_TRANSPARENCY_MAP\n uniform HILO_SAMPLER_2D u_transparency;\n#else\n uniform float u_transparency;\n#endif\n\n#ifdef HILO_ALPHA_CUTOFF\n uniform float u_alphaCutoff;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_FOG\n varying float v_dist;\n uniform vec4 u_fogColor;\n \n #ifdef HILO_FOG_LINEAR\n uniform vec2 u_fogInfo;\n #else\n uniform float u_fogInfo;\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_NORMAL_MAP\n vec3 normal = HILO_TEXTURE_2D(u_normalMap).rgb * 2.0 - 1.0;\n #ifdef HILO_NORMAL_MAP_SCALE\n normal.xy *= u_normalMapScale;\n #endif\n normal = normalize(v_TBN * normal);\n#elif defined(HILO_HAS_NORMAL)\n vec3 normal = normalize(v_normal);\n#else\n vec3 normal = vec3(0, 0, 1);\n#endif\n\n#if HILO_SIDE == HILO_BACK_SIDE\n normal = -normal;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_LIGHT\n #if HILO_SIDE == HILO_FRONT_AND_BACK_SIDE\n normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\nfloat transparency = 1.0;\n#ifdef HILO_TRANSPARENCY_MAP\n transparency = HILO_TEXTURE_2D(u_transparency).r;\n#else\n transparency = u_transparency;\n#endif\ncolor.a *= transparency;\n#ifdef HILO_ALPHA_CUTOFF\n if (color.a < u_alphaCutoff) {\n discard;\n } else {\n color.a = 1.0;\n }\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n#ifdef HILO_IGNORE_TRANSPARENT\ncolor.a = 1.0;\n#endif\n\n#ifdef HILO_USE_HDR\n color.rgb = vec3(1.0) - exp(-color.rgb * u_exposure);\n#endif\n\n#ifdef HILO_GAMMA_CORRECTION\n color.rgb = pow(color.rgb, vec3(1.0 / u_gammaFactor));\n#endif\n\n"+n(73)+"\n\n#ifdef HILO_PREMULTIPLY_ALPHA\n color.rgb *= color.a;\n#endif\n\ngl_FragColor = color;"},function(t,e){t.exports="#define GLSLIFY 1\n"},function(t,e){t.exports="#ifdef GL_ES\nprecision HILO_MAX_VERTEX_PRECISION float;\n#define GLSLIFY 1\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(40)+"\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(62)+"\n"+n(44)+"\n"+n(69)+"\n"+n(46)+"\n"+n(47)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 diffuse = vec4(0., 0., 0., 1.);\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(48)+"\n "+n(49)+"\n "+n(71)+"\n "+n(72)+"\n "+n(50)+"\n "+n(51)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(52)+"\n"+n(18)+"\n"+n(53)+"\n\nattribute vec3 a_position;\nuniform mat4 u_modelViewProjectionMatrix;\n\n"+n(74)+"\n"+n(75)+"\n"+n(76)+"\n"+n(77)+"\n"+n(78)+"\n"+n(79)+"\n"+n(80)+"\n"+n(81)+"\nvoid main(void) {\n vec4 pos = vec4(a_position, 1.0);\n #ifdef HILO_HAS_TEXCOORD0\n vec2 uv = a_texcoord0;\n #endif\n #ifdef HILO_HAS_TEXCOORD1\n vec2 uv1 = a_texcoord1;\n #endif\n #ifdef HILO_HAS_NORMAL\n vec3 normal = a_normal;\n #endif\n\n #ifdef HILO_NORMAL_MAP\n vec4 tangent = a_tangent;\n #endif\n\n "+n(82)+"\n "+n(83)+"\n "+n(84)+"\n "+n(85)+"\n "+n(86)+"\n "+n(87)+"\n "+n(88)+"\n\n gl_Position = u_modelViewProjectionMatrix * pos;\n\n "+n(89)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n#if defined(HILO_VERTEX_TYPE_POSITION)\n varying vec3 v_fragPos;\n#elif defined(HILO_VERTEX_TYPE_NORMAL)\n varying vec3 v_normal;\n#elif defined(HILO_VERTEX_TYPE_DEPTH)\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n uniform float u_cameraType;\n#elif defined(HILO_VERTEX_TYPE_DISTANCE)\n "+n(90)+"\n\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n varying vec3 v_fragPos;\n#endif\n\nvec4 transformDataToColor(vec3 data){\n #ifdef HILO_WRITE_ORIGIN_DATA\n return vec4(data, 1.0);\n #else\n return vec4(data * 0.5 + 0.5, 1.0);\n #endif\n}\n\n"+n(29)+"\n\nvoid main(void) {\n #if defined(HILO_VERTEX_TYPE_POSITION)\n gl_FragColor = transformDataToColor(v_fragPos);\n #elif defined(HILO_VERTEX_TYPE_NORMAL)\n gl_FragColor = transformDataToColor(v_normal);\n #elif defined(HILO_VERTEX_TYPE_DEPTH)\n float z;\n #ifdef HILO_WRITE_ORIGIN_DATA\n z = gl_FragCoord.z;\n #else\n // OrthographicCamera\n if(u_cameraType < 1.0){\n z = gl_FragCoord.z;\n }\n // PerspectiveCamera\n else{\n z = gl_FragCoord.z * 2.0 - 1.0;\n z = (2.0 * u_cameraNear * u_cameraFar) / (u_cameraFar + u_cameraNear - z * (u_cameraFar - u_cameraNear));\n }\n #endif\n gl_FragColor = vec4(z, z, z, 1.0);\n #elif defined(HILO_VERTEX_TYPE_DISTANCE)\n float distance = length(v_fragPos);\n #ifdef HILO_WRITE_ORIGIN_DATA\n gl_FragColor = vec4(distance, distance, distance, 1.0);\n #else\n gl_FragColor = packFloat((distance - u_cameraNear)/(u_cameraFar - u_cameraNear));\n #endif\n #endif\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(40)+"\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(91)+"\n"+n(44)+"\n"+n(46)+"\n"+n(47)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(48)+"\n "+n(49)+"\n "+n(93)+"\n "+n(51)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\nvarying vec2 v_texcoord0;\nuniform sampler2D u_diffuse;\n\nvoid main(void) { \n gl_FragColor = texture2D(u_diffuse, v_texcoord0);\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(52)+"\n"+n(18)+"\n"+n(53)+"\n\nattribute vec2 a_position;\nattribute vec2 a_texcoord0;\nvarying vec2 v_texcoord0;\n\n\nvoid main(void) {\n vec4 pos = vec4(a_position, 0.0, 1.0);\n gl_Position = pos;\n v_texcoord0 = a_texcoord0;\n}"},function(t,e){var n=function(){var t=navigator.userAgent,e=document,n=window,i=e.documentElement,r={iphone:/iphone/i.test(t),ipad:/ipad/i.test(t),ipod:/ipod/i.test(t),ios:/iphone|ipad|ipod/i.test(t),android:/android/i.test(t),webkit:/webkit/i.test(t),chrome:/chrome/i.test(t),safari:/safari/i.test(t),firefox:/firefox/i.test(t),ie:/msie/i.test(t),opera:/opera/i.test(t),supportTouch:"ontouchstart"in n,supportCanvas:null!=e.createElement("canvas").getContext,supportStorage:!1,supportOrientation:"orientation"in n||"orientation"in n.screen,supportDeviceMotion:"ondevicemotion"in n};try{localStorage.setItem("hilo","hilo"),localStorage.removeItem("hilo"),r.supportStorage=!0}catch(t){}var s=r.jsVendor=r.webkit||r.firefox?"webkit":r.opera?"o":r.ie?"ms":"",a=r.cssVendor="-"+s+"-",o=e.createElement("div"),u=o.style,c=null!=u[s+"Transform"],h=null!=u[s+"Perspective"];h&&(o.id="test3d",(u=e.createElement("style")).textContent="@media ("+a+"transform-3d){#test3d{height:3px}}",e.head.appendChild(u),i.appendChild(o),h=3==o.offsetHeight,e.head.removeChild(u),i.removeChild(o)),r.supportTransform=c,r.supportTransform3D=h;var f=r.supportTouch,l=f?"touchstart":"mousedown",d=f?"touchmove":"mousemove",m=f?"touchend":"mouseup";return r.POINTER_START=l,r.POINTER_MOVE=d,r.POINTER_END=m,r}();t.exports=n},function(t,e,n){var i=n(19),r=function(){function t(){return+new Date}return i.create({constructor:function(t,e,n,i){var r=this;for(var s in r.target=t,r._startTime=0,r._seekTime=0,r._pausedTime=0,r._pausedStartTime=0,r._reverseFlag=1,r._repeatCount=0,3==arguments.length&&(i=n,n=e,e=null),i)r[s]=i[s];r._fromProps=e,r._toProps=n,!i.duration&&i.time&&(r.duration=i.time||0,r.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,isComplete:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var n=this.target,i=t||e,r=this._fromProps={},s=this._toProps={};for(var a in t=t||n,e=e||n,i)s[a]=e[a]||0,n[a]=r[a]=t[a]||0;return this},start:function(){var e=this;return e._startTime=t()+e.delay,e._seekTime=0,e._pausedTime=0,e._reverseFlag=1,e._repeatCount=0,e.paused=!1,e.isStart=!1,e.isComplete=!1,r.add(e),e},stop:function(){return r.remove(this),this},pause:function(){return this.paused=!0,this._pausedStartTime=t(),this},resume:function(){var e=this;return e.paused=!1,e._pausedStartTime&&(e._pausedTime+=t()-e._pausedStartTime),e._pausedStartTime=0,e},seek:function(e,n){var i=this,s=t();return i._startTime=s,i._seekTime=e,i._pausedTime=0,void 0!==n&&(i.paused=n),i._update(s,!0),r.add(i),i},link:function(t){var e,n,i=t.delay,s=this._startTime;return"string"==typeof i&&(e=0==i.indexOf("+"),n=0==i.indexOf("-"),i=e||n?Number(i.substr(1))*(e?1:-1):Number(i)),t.delay=i,t._startTime=e||n?s+this.duration+i:s+i,this._next=t,r.remove(t),t},_render:function(t){var e,n=this.target,i=this._fromProps;for(e in i)n[e]=i[e]+(this._toProps[e]-i[e])*t},_update:function(e,n){var i=this;if(!i.paused||n){if(i.isComplete)return!0;var s=e-i._startTime-i._pausedTime+i._seekTime;if(!(s<0)){var a,o=s/i.duration;o=o<=0?0:o>=1?1:o;var u=i.ease?i.ease(o):o;i.reverse&&i.isStart&&(i._reverseFlag<0&&(o=1-o,u=1-u),o<1e-7&&(i.repeat>0&&i._repeatCount++>=i.repeat||0==i.repeat&&!i.loop?!0:(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1))),i.isStart||(i.setProps(i._fromProps,i._toProps),i.isStart=!0,i.onStart&&i.onStart.call(i,i)),i.time=s,i._render(u),(a=i.onUpdate)&&a.call(i,u,i),o>=1&&(i.reverse?(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1):i.loop||i.repeat>0&&i._repeatCount++0&&h<=e?(c._render(o),c.time=s,r.add(c)):i.isComplete&&(h<0||h>e)&&c.start()}return i.isComplete?((a=i.onComplete)&&a.call(i,i),!0):void 0}}},Statics:{_tweens:[],tick:function(){var e,n,i=r._tweens,s=i.length;for(n=0;n-1&&i.splice(e,1);else for(e=0;el)return null;i(h,u,a);var m=r(n,h);if(m<0||d+m>l)return null;var _=r(o,h)/l;return t[0]=e[0]+_*n[0],t[1]=e[1]+_*n[1],t[2]=e[2]+_*n[2],t}},function(t,e){t.exports=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2];return t[0]=r*u-s*o,t[1]=s*a-i*u,t[2]=i*o-r*a,t}},function(t,e,n){var i=n(27),r=n(32),s=n(33),a=n(34);t.exports=function(t,e,n,u,c){var h=i(n,u);if(0!==h){var f=-(i(e,u)+c)/h;return f<0?null:(s(o,n,f),r(t,e,o))}return i(u,e)+c===0?a(t,e):null};var o=[0,0,0]},function(t,e,n){var i=n(98),r=n(27),s=n(31),a=n(99),o=n(33),u=n(32),c=[0,0,0];t.exports=function(t,e,n,h,f){s(c,h,e);var l=r(n,c);if(l<0)return null;a(c,e,n,l);var d=i(h,c),m=f*f;if(d>m)return null;return o(t,n,l-Math.sqrt(m-d)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}},function(t,e){t.exports=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}},function(t,e){function n(t,e,n){for(var i=t.length,r=-1/0,s=1/0,a=0;au){var c=o;o=u,u=c}if(us)return 1/0;o>r&&(r=o),us?1/0:r}t.exports=function(t,e,i,r){var s=n(e,i,r);if(s===1/0)t=null;else{t=t||[];for(var a=0;a0;){if(d(c)128){if(0==(u=(255&f[0])-128)||u>o-a)throw new Error("Bad scanline data");for(;u-- >0;)h[a++]=f[1]}else{if(0==(u=255&f[0])||u>o-a)throw new Error("Bad scanline data");if(h[a++]=f[1],--u>0){if(m(h,a,u)=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var i=n.slice(0),r=0,s=i.length;r=0&&e.splice(n,1)},nextTick:function(t){var e=this,n={tick:function(i){e.removeTick(n),t()}};return e.addTick(n),n},timeout:function(t,e){var n=this,i=(new Date).getTime()+e,r={tick:function(){(new Date).getTime()-i>=0&&(n.removeTick(r),t())}};return n.addTick(r),r},interval:function(t,e){var n=(new Date).getTime()+e,i={tick:function(){var i=(new Date).getTime(),r=i-n;r>=0&&(r=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(111),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(39))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,s,a,o,u=1,c={},h=!1,f=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){m(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(t){m(t.data)},i=function(t){s.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(r=f.documentElement,i=function(t){var e=f.createElement("script");e.onreadystatechange=function(){m(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(m,0,t)}:(a="setImmediate$"+Math.random()+"$",o=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&m(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",o,!1):t.attachEvent("onmessage",o),i=function(e){t.postMessage(a+e,"*")}),l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n 0.0 ? v : (0.5 * inversesqrt(max(1.0 - (x * x), 1e-7))) - v;\n return cross(v1, v2) * theta_sintheta;\n}\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 vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if (dot(lightNormal, P - rectCoords[0]) < 0.0)\n return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - (N * dot(V, N)));\n T2 = -cross(N, T1);\n mat3 mat = mInv * transpose(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n\nvec3 getAreaLight(const in vec3 diffuseColor, const in vec3 specularColor, const in float roughness, const in vec3 normal, const in vec3 viewDir, const in vec3 position, const in vec3 lightPos, const in vec3 lightColor, const in vec3 halfWidth, const in vec3 halfHeight, const in sampler2D areaLightsLtcTexture1, const in sampler2D areaLightsLtcTexture2){\n vec3 rectCoords[4];\n rectCoords[0] = (lightPos - halfWidth) - halfHeight;\n rectCoords[1] = (lightPos + halfWidth) - halfHeight;\n rectCoords[2] = (lightPos + halfWidth) + halfHeight;\n rectCoords[3] = (lightPos - halfWidth) + halfHeight;\n \n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(areaLightsLtcTexture1, uv);\n vec4 t2 = texture2D(areaLightsLtcTexture2, uv);\n\n mat3 mInv = mat3(vec3(t1.x, 0, t1.y), vec3(0, 1, 0), vec3(t1.z, 0, t1.w));\n vec3 fresnel = (specularColor * t2.x) + ((vec3(1.0) - specularColor) * t2.y);\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += ((lightColor * fresnel) * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords));\n color += ((lightColor * diffuseColor) * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords));\n return color;\n}\n\n"},function(t,e,n){"use strict";n.r(e);var i={};n.r(i),n.d(i,"ALI_amc_mesh_compression",(function(){return jn})),n.d(i,"WEB3D_quantized_attributes",(function(){return zn})),n.d(i,"HILO_animation_clips",(function(){return qn})),n.d(i,"ALI_animation_clips",(function(){return Wn})),n.d(i,"ALI_bounding_box",(function(){return Yn})),n.d(i,"KHR_materials_pbrSpecularGlossiness",(function(){return Zn})),n.d(i,"KHR_lights_punctual",(function(){return Kn})),n.d(i,"KHR_techniques_webgl",(function(){return Qn}));var r=n(4),s=n(1),a=n(9),o=n(7),u=n(22),c=n(5),h=n(17),f=n(23),l=n(10),d=n(6),m=n(3),_=new c.a(0,1,0),p=new o.a,g=s.a.create({Statics:{TRAVERSE_STOP_NONE:!1,TRAVERSE_STOP_CHILDREN:1,TRAVERSE_STOP_ALL:!0},Mixes:a.a,isNode:!0,className:"Node",name:"",animationId:"",autoUpdateWorldMatrix:!0,autoUpdateChildWorldMatrix:!0,parent:null,_quatDirty:!1,_matrixDirty:!1,needCallChildUpdate:!0,visible:!0,pointerEnabled:!0,pointerChildren:!0,useHandCursor:!1,__forceUseParentWorldMatrix:!1,constructor:function(t){var e=this;this.id=d.a.generateUUID(this.className),this.up=_.clone(),this.children=[],this.worldMatrix=new o.a,this._matrix=new u.a,this._position=new h.a(0,0,0),this._scale=new h.a(1,1,1),this._pivot=new h.a(0,0,0),this._rotation=new f.a,this._quaternion=new l.a,this._matrix.on("update",(function(){e._onMatrixUpdate()})),this._position.on("update",(function(){e._onPositionUpdate()})),this._scale.on("update",(function(){e._onScaleUpdate()})),this._pivot.on("update",(function(){e._onPivotUpdate()})),this._rotation.on("update",(function(){e._onRotationUpdate()})),this._quaternion.on("update",(function(){e._onQuaternionUpdate()})),Object.assign(this,t)},clone:function(t){var e=new this.constructor;return e.name=this.name,e.jointName=this.jointName,e.animationId=this.animationId,e.setPosition(this.x,this.y,this.z),e.setScale(this.scaleX,this.scaleY,this.scaleZ),e.setRotation(this.rotationX,this.rotationY,this.rotationZ),this.children.forEach((function(t){e.addChild(t.clone(!0))})),t||(this.anim&&(e.anim=this.anim.clone(e)),e.resetSkinedMeshRootNode()),e},setAnim:function(t){return this.anim=t,t.rootNode=this,this},resetSkinedMeshRootNode:function(){var t=this;this.traverse((function(e){e.isSkinedMesh&&e.jointNames&&(e.rootNode=t)}),!0)},getChildrenNameMap:function(){var t={};return this.traverse((function(e){t[e.name]=e;var n=e._originName;void 0===n||t[n]||(t[n]=e)}),!0),t},addChild:function(t){return t.parent&&t.removeFromParent(),t.parent=this,this.children.push(t),this},removeChild:function(t){var e=this.children.indexOf(t);return e>-1&&(this.children.splice(e,1),t.parent=null),this},addTo:function(t){return t.addChild(this),this},removeFromParent:function(){return this.parent&&this.parent.removeChild(this),this},updateMatrix:function(){return this._matrixDirty&&(this._matrixDirty=!1,this.matrixVersion++,this._matrix.fromRotationTranslationScaleOrigin(this.quaternion,this._position,this._scale,this._pivot,!0)),this},updateQuaternion:function(){return this._quatDirty&&(this._quatDirty=!1,this._quaternion.fromEuler(this._rotation,!0)),this},updateTransform:function(){return this._matrix.decompose(this._quaternion,this._position,this._scale,this._pivot),this._onQuaternionUpdate(),this._matrixDirty=!1,this},updateMatrixWorld:function(t){return this.traverse((function(e){return(e.autoUpdateWorldMatrix||t)&&(e.parent?e.__forceUseParentWorldMatrix?e.worldMatrix.copy(e.parent.worldMatrix):e.worldMatrix.multiply(e.parent.worldMatrix,e.matrix):e.worldMatrix.copy(e.matrix)),!e.autoUpdateChildWorldMatrix&&!t&&1})),this},getConcatenatedMatrix:function(t){for(var e=new o.a,n=this;n&&n!==t;n=n.parent)e.multiply(n.matrix,e);return e},_traverse:function(t,e){if(!e){var n=t(this);if(n)return n}for(var i=this.children,r=0,s=i.length;r1&&void 0!==arguments[1]&&arguments[1];return this._traverse(t,e),this},traverseBFS:function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(n=i?this.children:[this];n.length;){e=n,n=[];for(var r=0,s=e.length;r1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return this._scale.set(t,e,n),this},setPosition:function(t,e,n){return this._position.set(t,e,n),this},setRotation:function(t,e,n){return this._rotation.setDegree(t,e,n),this},setPivot:function(t,e,n){return this._pivot.set(t,e,n),this},lookAt:function(t){return this.isCamera?p.targetTo(this,t,this.up):p.targetTo(t,this,this.up),this._quaternion.fromMat4(p),this},raycast:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.visible)return null;var r=[];return this.traverse((function(n){if(i&&!n.pointerEnabled)return 1;if(n.isMesh){var s=n.raycast(t,!1);s&&(r=r.concat(s.map((function(t){return{mesh:n,point:t}}))))}return!(!i||e.pointerChildren)&&1})),r.length?(n&&t.sortPoints(r,"point"),r):null},matrix:{get:function(){return this.updateMatrix(),this._matrix},set:function(t){m.a.warnOnce("Node.matrix.set","node.matrix is readOnly.Use node.matrix.copy instead."),this._matrix.copy(t)}},position:{get:function(){return this._position},set:function(t){m.a.warnOnce("Node.position.set","node.position is readOnly.Use node.position.copy instead."),this._position.copy(t)}},x:{get:function(){return this._position.elements[0]},set:function(t){this._position.elements[0]=t,this._matrixDirty=!0}},y:{get:function(){return this._position.elements[1]},set:function(t){this._position.elements[1]=t,this._matrixDirty=!0}},z:{get:function(){return this._position.elements[2]},set:function(t){this._position.elements[2]=t,this._matrixDirty=!0}},scale:{get:function(){return this._scale},set:function(t){m.a.warnOnce("Node.scale.set","node.scale is readOnly.Use node.scale.copy instead."),this._scale.copy(t)}},scaleX:{get:function(){return this._scale.elements[0]},set:function(t){this._scale.elements[0]=t,this._matrixDirty=!0}},scaleY:{get:function(){return this._scale.elements[1]},set:function(t){this._scale.elements[1]=t,this._matrixDirty=!0}},scaleZ:{get:function(){return this._scale.elements[2]},set:function(t){this._scale.elements[2]=t,this._matrixDirty=!0}},pivot:{get:function(){return this._pivot},set:function(t){m.a.warnOnce("Node.pivot.set","node.pivot is readOnly.Use node.pivot.copy instead."),this._pivot.copy(t)}},pivotX:{get:function(){return this._pivot.elements[0]},set:function(t){this._pivot.elements[0]=t,this._matrixDirty=!0}},pivotY:{get:function(){return this._pivot.elements[1]},set:function(t){this._pivot.elements[1]=t,this._matrixDirty=!0}},pivotZ:{get:function(){return this._pivot.elements[2]},set:function(t){this._pivot.elements[2]=t,this._matrixDirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){m.a.warnOnce("Node.rotation.set","node.rotation is readOnly.Use node.rotation.copy instead."),this._rotation.copy(t)}},rotationX:{get:function(){return this._rotation.degX},set:function(t){this._rotation.degX=t}},rotationY:{get:function(){return this._rotation.degY},set:function(t){this._rotation.degY=t}},rotationZ:{get:function(){return this._rotation.degZ},set:function(t){this._rotation.degZ=t}},quaternion:{get:function(){return this.updateQuaternion(),this._quaternion},set:function(t){m.a.warnOnce("Node.quaternion.set","node.quaternion is readOnly.Use node.quaternion.copy instead."),this._quaternion.copy(t)}},matrixVersion:0,getBounds:function(t,e,n){return e?e.multiply(this.matrix):e=this.getConcatenatedMatrix(t),this.children.forEach((function(t){n=t.getBounds(null,e.clone(),n)})),this.isMesh&&(n=this.geometry.getBounds(e,n)),n},_fireMouseEvent:function(t){if(t.eventCurrentTarget=this,this.fire(t),"mousemove"===t.type){if(!this.__mouseOver){this.__mouseOver=!0;var e=Object.assign({},t);e.type="mouseover",this.fire(e)}}else"mouseout"===t.type&&(this.__mouseOver=!1);var n=this.parent;t._stopped||t._stopPropagationed||!n||n._fireMouseEvent(t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getChildrenByBaseClassName("Node");return this.off(),n.forEach((function(n){n.isMesh?n.destroy(t,e):(n.off(),n.removeFromParent())})),this.removeFromParent(),this},_onMatrixUpdate:function(){this.matrixVersion++,this.updateTransform()},_onPositionUpdate:function(){this._matrixDirty=!0},_onScaleUpdate:function(){this._matrixDirty=!0},_onPivotUpdate:function(){this._matrixDirty=!0},_onRotationUpdate:function(){this._quatDirty=!0,this._matrixDirty=!0},_onQuaternionUpdate:function(){this._rotation.fromQuat(this._quaternion),this._quatDirty=!1}}),v=n(8),E=new v.a,T=s.a.create({Extends:g,isLight:!0,className:"Light",amount:1,enabled:!0,constantAttenuation:1,linearAttenuation:0,quadraticAttenuation:0,_range:0,range:{get:function(){return this._range},set:function(t){this.constantAttenuation=1,t<=0?(this.linearAttenuation=0,this.quadraticAttenuation=0):(this.linearAttenuation=4.5/t,this.quadraticAttenuation=75/(t*t)),this._range=t}},constructor:function(t){this.color=new v.a(1,1,1),T.superclass.constructor.call(this,t)},toInfoArray:function(t,e){return t[e+0]=this.constantAttenuation,t[e+1]=this.linearAttenuation,t[e+2]=this.quadraticAttenuation,this},getRealColor:function(){return E.copy(this.color).scale(this.amount)},createShadowMap:function(t,e){}}),M=T,A=n(24),I=new o.a,L=s.a.create({Extends:g,isCamera:!0,className:"Camera",_needUpdateProjectionMatrix:!0,_isGeometryDirty:!1,constructor:function(t){this.viewMatrix=new o.a,this.projectionMatrix=new o.a,this.viewProjectionMatrix=new o.a,this._frustum=new A.a,L.superclass.constructor.call(this,t)},updateViewMatrix:function(){return this.updateMatrixWorld(!0),this.viewMatrix.invert(this.worldMatrix),this},updateProjectionMatrix:function(){},getGeometry:function(t){},updateViewProjectionMatrix:function(){return this._needUpdateProjectionMatrix&&(this.updateProjectionMatrix(),this._needUpdateProjectionMatrix=!1),this.updateViewMatrix(),this.viewProjectionMatrix.multiply(this.projectionMatrix,this.viewMatrix),this.updateFrustum(this.viewProjectionMatrix),this},getModelViewMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewMatrix,t.worldMatrix),e},getModelProjectionMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewProjectionMatrix,t.worldMatrix),e},projectVector:function(t,e,n){var i=t.clone();return i.transformMat4(this.viewProjectionMatrix),e&&n&&(i.x=(i.x+1)/2*e,i.y=n-(i.y+1)/2*n),i},unprojectVector:function(t,e,n){var i=t.clone();return e&&n&&(i.x=i.x/e*2-1,i.y=1-i.y/n*2),I.invert(this.viewProjectionMatrix),i.transformMat4(I),i},isPointVisible:function(t){return!!this._frustum.intersectsSphere({center:t,radius:0})},isMeshVisible:function(t){var e=t.geometry;if(e){var n=e.getSphereBounds(t.worldMatrix);if(this._frustum.intersectsSphere(n))return!0}return!1},updateFrustum:function(t){return this._frustum.fromMatrix(t),this}}),O=L,S=n(14),R=n(12),y=n(11),x=n(21),N={2:new S.a,3:new c.a,4:new R.a,16:new o.a},b=s.a.create({className:"GeometryData",isGeometryData:!0,size:void 0,normalized:!1,type:void 0,_isSubDirty:!1,_isAllDirty:!1,isDirty:{get:function(){return this._isSubDirty||this._isAllDirty},set:function(t){this._isAllDirty=t,!1===t&&this.clearSubData()}},bufferViewId:void 0,glBuffer:null,constructor:function(t,e,n){this.id=d.a.generateUUID(this.className),this.data=t,this.size=e,Object.assign(this,n),this.bufferViewId||(this.bufferViewId=this.id),this.size||m.a.warn("GeometryData.constructor: geometryData must set size!",this)},_stride:0,stride:{get:function(){return this._stride},set:function(t){this._stride=t,this.strideSize=0===t?0:t/this.data.BYTES_PER_ELEMENT}},strideSize:0,_offset:0,offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetSize=t/this.data.BYTES_PER_ELEMENT}},offsetSize:0,data:{set:function(t){t&&(this._data=t,this.type=Object(r.getTypedArrayGLType)(t),this.stride=this._stride,this.offset=this._offset,this._isAllDirty=!0)},get:function(){return this._data}},length:{get:function(){return this._data.length}},realLength:{get:function(){return 0===this.strideSize?this._data.length:this._data.length/this.strideSize*this.size}},getByteLength:function(){return this._data.BYTES_PER_ELEMENT*this.realLength},count:{get:function(){return 0===this.strideSize?this._data.length/this.size:this._data.length/this.strideSize}},setSubData:function(t,e){this._isSubDirty=!0,this.data.set(e,t),this.subDataList||(this.subDataList=[]);var n=e.BYTES_PER_ELEMENT*t;this.subDataList.push({byteOffset:n,data:e})},clearSubData:function(){this.subDataList&&(this.subDataList.length=0),this._isSubDirty=!1},clone:function(){var t=new b(null,1);return t.copy(this),t},copy:function(t){var e=t.data;this.data=new e.constructor(e),this.size=t.size,this.stride=t.stride,this.normalized=t.normalized,this.type=t.type,this.offset=t.offset},getOffset:function(t){var e=this.strideSize;return 0===e?t*this.size:t*e+this.offsetSize},get:function(t){var e=this.getOffset(t);return this.getByOffset(e)},set:function(t,e){var n=this.getOffset(t);return this.setByOffset(n,e),n},getByOffset:function(t){var e=this.size;return e>1?N[e].fromArray(this._data,t):this._data[t]},setByOffset:function(t,e){var n=this.size,i=this._data;n>1?e.toArray(i,t):i[t]=e,this._isAllDirty=!0},traverse:function(t){for(var e=this.count,n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(W.fromTranslation(G.set(t,e,n))),this},scale:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.transformMat4(W.fromScaling(G.set(t,e,n))),this},rotate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(W.fromQuat(Y.fromEuler({x:t*d.a.DEG2RAD,y:e*d.a.DEG2RAD,z:n*d.a.DEG2RAD}))),this},transformMat4:function(t){var e=this.vertices;if(e&&e.traverse((function(n,i,r){e.setByOffset(r,n.transformMat4(t))})),q.normalFromMat4(t),this._normals){var n=this.normals;n.traverse((function(t,e,i){n.setByOffset(i,t.transformMat3(q).normalize())}))}if(this._tangents){var i=this.tangents;i.traverse((function(t,e,n){i.setByOffset(n,t.transformMat3(q).normalize())}))}return this.isDirty=!0,this},merge:function(t,e){var n=t.vertices;if(n&&this.vertices){var i=this.vertices.count;e&&(n=t.vertices.clone()).traverse((function(t,i,r){n.setByOffset(r,t.transformMat4(e))})),this.vertices.merge(n),this.indices&&t.indices?this.indices.merge(t.indices,(function(t){return t+i})):this.indices=null}return this.uvs&&t.uvs?this.uvs.merge(t.uvs):this.uvs=null,this.uvs1&&t.uvs1?this.uvs1.merge(t.uvs1):this.uvs1=null,this.colors&&t.colors?this.colors.merge(t.colors):this.colors=null,this._normals&&(this._normals=null),this._tangents&&(this._tangents=null),this._tangents1&&(this._tangents1=null),this.isDirty=!0,this},ensureData:function(t,e,n,i){var r=this[t];if(!r||n>r.length){var s=new i(n);r?(s.set(r.data),r.data=s):this[t]=new w(s,e)}},addPoints:function(){var t=this,e=[].slice.call(arguments),n=3*(this.currentVerticesCount+e.length);this.ensureData("vertices",3,n,Float32Array);var i=this.vertices.data;return e.forEach((function(e){var n=3*t.currentVerticesCount++;i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2]})),this.currentVerticesCount-e.length},addIndices:function(){var t=this,e=[].slice.call(arguments),n=this.currentIndicesCount+e.length;this.ensureData("indices",1,n,Uint16Array);var i=this.indices.data;e.forEach((function(e){i[t.currentIndicesCount++]=e})),this._needUpdateNormals=!0},addLine:function(t,e){var n=this.addPoints(t,e);this.addIndices(n,n+1)},addFace:function(t,e,n){var i=this.addPoints(t,e,n);this.addIndices(i,i+1,i+2)},addRect:function(t,e,n,i){var r=this.addPoints(t,e,n,i);this.addIndices(r,r+1,r+2,r,r+2,r+3)},setVertexUV:function(t,e){this.ensureData("uvs",2,this.vertices.length/3*2,Float32Array);for(var n=this.uvs.data,i=0;i0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;e||(e={xMin:1/0,xMax:-1/0,yMin:1/0,yMax:-1/0,zMin:1/0,zMax:-1/0});var n=this.vertices;return n?(n.traverse((function(n){t&&n.transformMat4(t),e.xMax=Math.max(e.xMax,n.x),e.yMax=Math.max(e.yMax,n.y),e.zMax=Math.max(e.zMax,n.z),e.xMin=Math.min(e.xMin,n.x),e.yMin=Math.min(e.yMin,n.y),e.zMin=Math.min(e.zMin,n.z)})),e.width=e.xMax-e.xMin,e.height=e.yMax-e.yMin,e.depth=e.zMax-e.zMin,e.x=(e.xMin+e.xMax)/2,e.y=(e.yMin+e.yMax)/2,e.z=(e.zMin+e.zMax)/2,e):(m.a.warnOnce("geometry.getBounds","geometry has no vertices data, geometry.getBounds will return Infinity bounds."),e)},getLocalBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._localBounds&&!t||(this._localBounds=this.getBounds()),this._localBounds},getSphereBounds:function(t){this._sphereBounds||(this._sphereBounds=new x.a);var e=this._sphereBounds;return e.copy(this.getLocalSphereBounds()),t&&e.transformMat4(t),e},getLocalSphereBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._localSphereBounds||t){var e=this.getLocalBounds(t),n=new x.a({center:new c.a(e.x,e.y,e.z)}),i=this.vertices;i?n.fromGeometryData(i):(m.a.warnOnce("geometry.getLocalSphereBounds","geometry has no vertices data, geometry.getLocalSphereBounds will return Infinity bounds."),n.radius=1/0),this._localSphereBounds=n}return this._localSphereBounds},convertToNoIndices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(this.mode===P)if(this.indices){for(var e=this.indices.data,n=e.length,i=new Float32Array(n*t),s=this.uvs?new Float32Array(2*n):null,a=new Float32Array(3*n),o=this.colors?new Float32Array(this.colors.size*n):null,u=this.skinIndices?new Float32Array(4*n):null,c=this.skinWeights?new Float32Array(4*n):null,h=0;h2&&void 0!==arguments[2])||arguments[2];return(n=this.useAABBRaycast?this._aabbRaycast(t):this._raycast(t,e))&&i&&t.sortPoints(n),n},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.positionDecodeMat&&(t.QUANTIZED=1,t.POSITION_QUANTIZED=1),this.normalDecodeMat&&(t.QUANTIZED=1,t.NORMAL_QUANTIZED=1),this.uvDecodeMat&&(t.QUANTIZED=1,t.UV_QUANTIZED=1),this.uv1DecodeMat&&(t.QUANTIZED=1,t.UV1_QUANTIZED=1),this.colors&&(t.HAS_COLOR=1,t.COLOR_SIZE=this.colors.size),t},getShaderKey:function(){return void 0===this._shaderKey&&(this._shaderKey="geometry",this.isMorphGeometry?this._shaderKey+="_id_".concat(this.id):(this.colors&&(this._shaderKey+="_colors"),this.positionDecodeMat&&(this._shaderKey+="positionDecodeMat"))),this._shaderKey},getSize:function(){var t=0;for(var e in this)Object(r.hasOwnProperty)(this,e)&&this[e]&&this[e].isGeometryData&&(t+=this[e].getByteLength());return t},destroy:function(){m.a.warn("Geometry.destroy has been deprecated, use mesh.destroy(renderer) instead.")}}),K=s.a.create({Extends:O,isPerspectiveCamera:!0,className:"PerspectiveCamera",_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:null,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},_fov:50,fov:{get:function(){return this._fov},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._fov=t}},_aspect:1,aspect:{get:function(){return this._aspect},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._aspect=t}},constructor:function(t){K.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.projectionMatrix.elements,e=this.near,n=this.far,i=this.aspect,r=this.fov,s=1/Math.tan(.5*d.a.degToRad(r));if(t[0]=s/i,t[5]=s,t[11]=-1,t[15]=0,n){var a=1/(e-n);t[10]=(e+n)*a,t[14]=2*n*e*a}else t[10]=-1,t[14]=-2*e},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=Math.tan(this.fov/2*Math.PI/180),i=this.near,r=this.far,s=i*n,a=r*n,o=this.aspect*s,u=this.aspect*a,c=[-o,-s,-i],h=[o,-s,-i],f=[o,s,-i],l=[-o,s,-i],d=[-u,-a,-r],m=[u,-a,-r],_=[u,a,-r],p=[-u,a,-r];e.addRect(d,m,_,p),e.addRect(m,h,f,_),e.addRect(h,c,l,f),e.addRect(c,d,p,l),e.addRect(p,_,f,l),e.addRect(c,h,m,d),this._geometry=e}return this._geometry}}),Q=K,J=s.a.create({constructor:function(){this._cache={}},get:function(t){return this._cache[t]},getObject:function(t){return this._cache[t.__cacheId]},add:function(t,e){"object"==typeof e&&(e.__cacheId=t),this._cache[t]=e},remove:function(t){delete this._cache[t]},removeObject:function(t){delete this._cache[t.__cacheId]},removeAll:function(){this._cache={}},each:function(t){var e=this._cache;for(var n in e)t(e[n],n)}}),$={instanced:void 0,vao:void 0,texFloat:void 0,loseContext:void 0,textureFilterAnisotropic:void 0,_usedExtensions:{},_disabledExtensions:{},init:function(t){this.reset(t)},reset:function(t){this.gl=t;var e=this._usedExtensions;for(var n in e){var i=e[n];this[i]=void 0,this.get(n,i)}},use:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;this.gl?this.get(t,e):this._usedExtensions[t]=e},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this._disabledExtensions[t])return null;var n=this[e];return void 0===n&&(n=this._getExtension(t),this[e]=n),n},disable:function(t){this._disabledExtensions[t]=!0},enable:function(t){this._disabledExtensions[t]=!1},_getExtension:function(t){var e=this.gl;return e&&e.getExtension&&(e.getExtension(t)||e.getExtension("WEBKIT_"+t)||e.getExtension("MOZ_"+t))||null}};$.use("ANGLE_instanced_arrays","instanced"),$.use("OES_vertex_array_object","vao"),$.use("OES_texture_float","texFloat"),$.use("WEBGL_lose_context","loseContext"),$.use("OES_element_index_uint","uintIndices"),$.use("EXT_shader_texture_lod","shaderTextureLod"),$.use("EXT_texture_filter_anisotropic","textureFilterAnisotropic");var tt=$,et={MAX_TEXTURE_INDEX:null,MAX_PRECISION:null,MAX_VERTEX_PRECISION:null,MAX_FRAGMENT_PRECISION:null,VERTEX_TEXTURE_FLOAT:null,FRAGMENT_TEXTURE_FLOAT:null,MAX_TEXTURE_MAX_ANISOTROPY:1,init:function(t){var e=this;this.gl=t;["MAX_RENDERBUFFER_SIZE","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS","MAX_COMBINED_TEXTURE_IMAGE_UNITS"].forEach((function(t){e.get(t)})),this.MAX_TEXTURE_INDEX=this.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,this.MAX_VERTEX_PRECISION=this._getMaxSupportPrecision(t.VERTEX_SHADER),this.MAX_FRAGMENT_PRECISION=this._getMaxSupportPrecision(t.FRAGMENT_SHADER),this.MAX_PRECISION=this.getMaxPrecision(this.MAX_FRAGMENT_PRECISION,this.MAX_VERTEX_PRECISION),this.VERTEX_TEXTURE_FLOAT=!!tt.texFloat&&this.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0,this.FRAGMENT_TEXTURE_FLOAT=!!tt.texFloat,this.EXT_FRAG_DEPTH=tt.get("EXT_frag_depth"),this.SHADER_TEXTURE_LOD=!!tt.shaderTextureLod,tt.textureFilterAnisotropic&&(this.MAX_TEXTURE_MAX_ANISOTROPY=t.getParameter(tt.textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))},get:function(t){var e=this.gl,n=this[t];return void 0===n&&(n=this[t]=e.getParameter(e[t])),n},_getMaxSupportPrecision:function(t){var e=this.gl,n="lowp";if(e.getShaderPrecisionFormat)for(var i=[{name:"highp",type:e.HIGH_FLOAT},{name:"mediump",type:e.MEDIUM_FLOAT}],r=0;r0){n=s.name;break}}else n="mediump";return n},getMaxPrecision:function(t,e){return"highp"===t||"mediump"===t&&"lowp"===e?e:t}},nt=n(54),it=n.n(nt),rt=n(55),st=n.n(rt),at=n(56),ot=n.n(at),ut=n(57),ct=n.n(ut),ht=new J,ft=new J,lt=s.a.create({isShader:!0,className:"Shader",vs:"",fs:"",Statics:{commonOptions:{},shaders:{"chunk/baseDefine.glsl":n(18),"chunk/color.frag":n(40),"chunk/color.vert":n(80),"chunk/color_main.vert":n(82),"chunk/diffuse.frag":n(62),"chunk/diffuse_main.frag":n(71),"chunk/extensions.frag":n(25),"chunk/extensions.vert":n(52),"chunk/fog.frag":n(47),"chunk/fog_main.frag":n(73),"chunk/frag_color.frag":n(51),"chunk/joint.vert":n(75),"chunk/joint_main.vert":n(85),"chunk/light.frag":n(44),"chunk/lightFog.frag":n(43),"chunk/lightFog.vert":n(78),"chunk/lightFog_main.frag":n(49),"chunk/lightFog_main.vert":n(88),"chunk/logDepth.frag":n(29),"chunk/logDepth_main.frag":n(30),"chunk/logDepth.vert":n(81),"chunk/logDepth_main.vert":n(89),"chunk/morph.vert":n(79),"chunk/morph_main.vert":n(84),"chunk/normal.frag":n(42),"chunk/normal.vert":n(77),"chunk/normal_main.frag":n(48),"chunk/normal_main.vert":n(87),"chunk/pbr.frag":n(91),"chunk/pbr_main.frag":n(93),"chunk/phong.frag":n(69),"chunk/phong_main.frag":n(72),"chunk/precision.frag":n(26),"chunk/precision.vert":n(53),"chunk/transparency.frag":n(46),"chunk/transparency_main.frag":n(50),"chunk/unQuantize.vert":n(74),"chunk/unQuantize_main.vert":n(83),"chunk/uv.frag":n(41),"chunk/uv.vert":n(76),"chunk/uv_main.vert":n(86),"method/encoding.glsl":n(92),"method/getDiffuse.glsl":n(64),"method/getLightAttenuation.glsl":n(66),"method/getShadow.glsl":n(68),"method/getSpecular.glsl":n(65),"method/packFloat.glsl":n(90),"method/textureEnvMap.glsl":n(45),"method/transpose.glsl":n(63),"method/unpackFloat.glsl":n(67),"basic.frag":n(54),"basic.vert":n(55),"geometry.frag":n(56),"pbr.frag":n(57),"screen.frag":n(58),"screen.vert":n(59)},init:function(t){this.renderer=t,this.commonHeader=this._getCommonHeader(this.renderer)},cache:{get:function(){return ht}},headerCache:{get:function(){return ft}},reset:function(t){ht.removeAll()},getHeaderKey:function(t,e,n,i,r){var s="header_"+e.id+"_"+n.lightInfo.uid;return t.isSkinedMesh&&(s+="_joint"+t.jointNames.length),i&&(s+="_fog_"+i.mode),s+="_"+t.geometry.getShaderKey(),r&&(s+="_fogDepth"),s},getHeader:function(t,e,n,i,r){var s=this.getHeaderKey(t,e,n,i),a=ft.get(s);if(!a||e.isDirty){var o={};Object.assign(o,this.commonOptions);var u=e.lightType;u&&"NONE"!==u&&n.getRenderOption(o),e.getRenderOption(o),t.getRenderOption(o),i&&(o.HAS_FOG=1,i.getRenderOption(o)),r&&(o.USE_LOG_DEPTH=1,et.EXT_FRAG_DEPTH&&(o.USE_EXT_FRAG_DEPTH=1)),o.HAS_NORMAL&&o.NORMAL_MAP&&(o.HAS_TANGENT=1),o.RECEIVE_SHADOWS||(delete o.DIRECTIONAL_LIGHTS_SMC,delete o.SPOT_LIGHTS_SMC,delete o.POINT_LIGHTS_SMC),a="#define SHADER_NAME ".concat(e.className,"\n"),a+=Object.keys(o).map((function(t){return t.indexOf("HILO_CUSTUM_OPTION_")>-1?"#define ".concat(t.replace("HILO_CUSTUM_OPTION_","")," ").concat(o[t]):"#define HILO_".concat(t," ").concat(o[t])})).join("\n")+"\n",ft.add(s,a)}return a},_getCommonHeader:function(t){var e=et.getMaxPrecision(et.MAX_VERTEX_PRECISION,t.vertexPrecision),n=et.getMaxPrecision(et.MAX_FRAGMENT_PRECISION,t.fragmentPrecision),i=et.getMaxPrecision(e,n);return"\n#define HILO_MAX_PRECISION ".concat(i,"\n#define HILO_MAX_VERTEX_PRECISION ").concat(e,"\n#define HILO_MAX_FRAGMENT_PRECISION ").concat(n,"\n")},getShader:function(t,e,n,i,r,s){var a=this.getHeader(t,e,i,r,s);return e.isBasicMaterial||e.isPBRMaterial?this.getBasicShader(e,n,a):e.isShaderMaterial?this.getCustomShader(e.vs,e.fs,a,e.shaderCacheId||e.id,e.useHeaderCache):null},getBasicShader:function(t,e,n){var i="";e&&(i=(i=t.getInstancedUniforms().map((function(t){return t.name}))).join("|"));var r=t.className+":"+i;t.onBeforeCompile&&(r+=":"+(t.shaderCacheId||t.id));var s=ht.get(r);if(!s){var a="",o=st.a;if(t.isBasicMaterial?t.isGeometryMaterial?a+=ot.a:a+=it.a:t.isPBRMaterial&&(a+=ct.a),t.onBeforeCompile){var u=t.onBeforeCompile(o,a);a=u.fs,o=u.vs}if(i){var c=new RegExp("^\\s*uniform\\s+(\\w+)\\s+(".concat(i,");"),"gm");o=o.replace(c,"attribute $1 $2;")}s=this.getCustomShader(o,a,n,r,!0)}if(s){var h=this._getNumId(s);null!==h&&(t._shaderNumId=h)}return s},_getNumId:function(t){var e=t.id.match(/_(\d+)/);return e&&e[1]?parseInt(e[1],10):null},getCustomShader:function(t,e,n,i,r){var s,a=this.commonHeader;return i&&(r&&(i+=":"+n),s=ht.get(i)),s||(s=new lt({vs:a+n+t,fs:a+n+e}),i&&ht.add(i,s)),s}},alwaysUse:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){return this._isDestroyed?this:(ht.removeObject(this),this._isDestroyed=!0,this)}}),dt=lt,mt=n(59),_t=n.n(mt),pt=n(58),gt=n.n(pt),vt=[{name:"FLOAT",byteSize:4,uniformFuncName:"uniform1f",type:"Scalar",size:1},{name:"FLOAT_VEC2",byteSize:8,uniformFuncName:"uniform2f",type:"Vector",size:2},{name:"FLOAT_VEC3",byteSize:12,uniformFuncName:"uniform3f",type:"Vector",size:3},{name:"FLOAT_VEC4",byteSize:16,uniformFuncName:"uniform4f",type:"Vector",size:4},{name:"FLOAT_MAT2",byteSize:16,uniformFuncName:"uniformMatrix2fv",type:"Matrix",size:4},{name:"FLOAT_MAT3",byteSize:36,uniformFuncName:"uniformMatrix3fv",type:"Matrix",size:9},{name:"FLOAT_MAT4",byteSize:64,uniformFuncName:"uniformMatrix4fv",type:"Matrix",size:16},{name:"INT",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"INT_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"INT_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"INT_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"BOOL",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"BOOL_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"BOOL_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"BOOL_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"SAMPLER_2D",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"SAMPLER_CUBE",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1}],Et={},Tt={dict:Et,init:function(t){vt.forEach((function(e){var n,i,r=e.name,s=e.uniformFuncName,a=s+"v";"Matrix"===e.type?n=i=function(e,n){void 0!==n&&t[s](e,!1,n)}:(n=function(e,n){void 0!==n&&t[s](e,n)},i=function(e,n){t[a](e,n)}),Et[t[r]]=Object.assign(e,{glValue:t[r],uniform:n,uniformArray:i})}))},get:function(t){return Et[t]}},Mt=new J,At=s.a.create({Statics:{cache:{get:function(){return Mt}},reset:function(t){Mt.each((function(t){t.destroy()}))},getProgram:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t.id,r=Mt.get(i);return r||(r=new At({state:e,vertexShader:t.vs,fragShader:t.fs,ignoreError:n}),Mt.add(i,r)),r},getBlankProgram:function(t){var e=dt.getCustomShader("void main(){}","precision HILO_MAX_FRAGMENT_PRECISION float;void main(){gl_FragColor = vec4(0.0);}","","__hiloBlankShader");return this.getProgram(e,t,!0)}},className:"Program",isProgram:!0,fragShader:"",vertexShader:"",attributes:null,uniforms:null,program:null,gl:null,state:null,alwaysUse:!1,constructor:function(t){return this.id=d.a.generateUUID(this.className),Object.assign(this,t),this._dict={},this.attributes={},this.uniforms={},this.gl=this.state.gl,this.program=this.createProgram(),this.program?(this.initAttributes(),this.initUniforms(),this):this.ignoreError?this:At.getBlankProgram(t.state)},createProgram:function(){var t=this.gl,e=t.createProgram(),n=this.createShader(t.VERTEX_SHADER,this.vertexShader),i=this.createShader(t.FRAGMENT_SHADER,this.fragShader);if(n&&i){if(t.attachShader(e,n),t.attachShader(e,i),t.linkProgram(e),t.deleteShader(n),t.deleteShader(i),!t.getProgramParameter(e,t.LINK_STATUS)){var r=t.getProgramInfoLog(e);return m.a.error("compileProgramError: "+r,this),t.deleteProgram(e),null}return e}return null},useProgram:function(){this.state.useProgram(this.program)},createShader:function(t,e){var n=this.gl,i=n.createShader(t);if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){var r=n.getShaderInfoLog(i);return m.a.error("compileShaderError: "+r,e.split("\n").map((function(t,e){return"".concat(e+1," ").concat(t)})).join("\n")),null}return i},initAttributes:function(){for(var t=this,e=this.gl,n=this.program,i=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),r=tt.instanced,s=function(i){var s=e.getActiveAttrib(n,i),a=s.name,o=s.type,u=s.size,c=e.getAttribLocation(n,a),h=Tt.get(o),f=function(t){var n=t.type,i=void 0===n?e.FLOAT:n,r=t.normalized,s=void 0!==r&&r,a=t.stride,o=void 0===a?0:a,u=t.offset,f=void 0===u?0:u;e.vertexAttribPointer(c,h.size,i,s,o,f)},l=function(){e.enableVertexAttribArray(c)},d=function(){},m=function(t,e){t[c]=e};if(r&&(d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;r.vertexAttribDivisorANGLE(c,t)}),"Matrix"===h.type){var _=h.byteSize,p=h.size,g=Math.sqrt(p),v=4*g,E=function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;E((function(e){r.vertexAttribDivisorANGLE(e,t)}))})}t.attributes[a]={name:a,location:c,type:o,size:u,glTypeInfo:h,pointer:f,enable:l,divisor:d,addTo:m}},a=0;a1||o>1?function(t){f(c,t)}:function(e){t._dict[a]!==e&&(t._dict[a]=e,l(c,e))}})},a=0;a2&&void 0!==arguments[2]?arguments[2]:St;return this.createBuffer(t,Lt,e,n)},createBuffer:function(t,e,n,i){var r=n.bufferViewId,s=Rt.get(r);return s||(n.isDirty=!1,s=new yt(t,e,n.data,i),Rt.add(r,s),s)},createIndexBuffer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:St;return this.createBuffer(t,Ot,e,n)}},className:"Buffer",isBuffer:!0,constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:St;this.id=d.a.generateUUID(this.className),this.gl=t,this.target=e,this.usage=i,this.buffer=t.createBuffer(),n&&this.bufferData(n)},bind:function(){return this.gl.bindBuffer(this.target,this.buffer),this},bufferData:function(t){var e=this.gl,n=this.target,i=this.usage;return this.bind(),e.bufferData(n,t,i),this.data=t,this},bufferSubData:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.gl,r=this.target;return n||this.bind(),i.bufferSubData(r,t,e),this},uploadGeometryData:function(t){var e=this,n=t.subDataList;return!this.data||this.data.byteLength2&&void 0!==arguments[2]?arguments[2]:0,i=0,r=e.length;i0&&void 0!==arguments[0]?arguments[0]:1;this.bind();var e=this.gl,n=this.mode;this.useInstanced&&(this.indexBuffer?this.instancedExtension.drawElementsInstancedANGLE(n,this.vertexCount,e.UNSIGNED_SHORT,0,t):this.instancedExtension.drawArraysInstancedANGLE(n,0,this.getVertexCount(),t))},addIndexBuffer:function(t,e){this.bind();var n=this.gl,i=this.indexBuffer;return this.indexType=t.type,i?t.isDirty&&(i.uploadGeometryData(t),this.vertexCount=t.length):((i=xt.createIndexBuffer(n,t,e)).bind(),this.indexBuffer=i,this.vertexCount=t.length),i},addAttribute:function(t,e,n,i){this.bind();var r=this.gl,s=e.name,a=this[s];if(a)t.isDirty&&a.buffer.uploadGeometryData(t);else{var o=xt.createVertexBuffer(r,t,n);o.bind(),e.enable(),e.pointer(t),a={attribute:e,buffer:o,geometryData:t},this.attributes.push(a),this[s]=a,e.addTo(this.activeStates,a),i&&i(a)}return a},addInstancedAttribute:function(t,e,n){this.bind();var i=this.gl,r=t.name,s=t.glTypeInfo,a=bt.getTypedArray(Float32Array,e.length*s.size);e.forEach((function(t,e){void 0!==n(t)?bt.fillArrayData(a,n(t),e*s.size):m.a.warn("no attributeData:"+r+"-"+t.name)}));var o,u=this[r];return u?(o=u.geometryData).data=a:o=new w(a,1),this.addAttribute(o,t,i.DYNAMIC_DRAW,(function(e){t.divisor(1),e.useInstanced=!0}))},useResource:function(t,e){return this.attributes.forEach((function(n){t.useResource(n.buffer,e)})),this.indexBuffer&&t.useResource(this.indexBuffer,e),this},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){var t=this;return this._isDestroyed?this:(this.useVao&&this.vaoExtension.deleteVertexArrayOES(this.vao),this.gl=null,this.indexBuffer=null,this.attributes.forEach((function(e){t[e.name]=null})),this.attributes=null,this.activeStates=null,Ht.removeObject(this),this._isDestroyed=!0,this)}}),Ft=Dt,Ut=C.a.TEXTURE_2D,Gt=C.a.RGBA,Bt=C.a.LINEAR,Vt=C.a.NEAREST,Xt=C.a.REPEAT,jt=C.a.CLAMP_TO_EDGE,kt=C.a.UNSIGNED_BYTE,zt=new J,qt=s.a.create({Statics:{cache:{get:function(){return zt}},reset:function(t){zt.each((function(e,n){t.deleteTexture(e),zt.remove(n)}))}},isTexture:!0,className:"Texture",isImageCanRelease:!1,_isImageReleased:!1,_image:null,image:{get:function(){return this._isImageReleased&&m.a.errorOnce("Read Texture.image(".concat(this.id,")"),"Read Texture.image after image released!"),this._image},set:function(t){this._image=t,this._isImageReleased=!1}},_releaseImage:function(){this._canvasImage=null,this._canvasCtx=null,this._originImage=null,this._image=null,this.mipmaps=null,this._isImageReleased=!0},mipmaps:null,target:Ut,internalFormat:Gt,format:Gt,type:kt,width:0,height:0,border:0,magFilter:Bt,minFilter:Bt,wrapS:Xt,wrapT:Xt,name:"",premultiplyAlpha:!1,flipY:!1,compressed:!1,needUpdate:!0,needDestroy:!1,autoUpdate:!1,uv:0,anisotropic:1,origWidth:{get:function(){return this._originImage?this._originImage.width||this.width:this.image&&this.image.width||this.width}},origHeight:{get:function(){return this.originImage?this._originImage.height||this.height:this.image&&this.image.height||this.height}},useMipmap:{get:function(){return this.minFilter!==Bt&&this.minFilter!==Vt},set:function(){m.a.warn("texture.useMipmap is readOnly!")}},useRepeat:{get:function(){return this.wrapS!==jt||this.wrapT!==jt},set:function(){m.a.warn("texture.useRepeat is readOnly!")}},mipmapCount:{get:function(){return Math.floor(Math.log2(Math.max(this.width,this.height))+1)},set:function(){m.a.warn("texture.mipmapCount is readOnly!")}},constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},isImgPowerOfTwo:function(t){return d.a.isPowerOfTwo(t.width)&&d.a.isPowerOfTwo(t.height)},getSupportSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.width,i=t.height;e&&!this.isImgPowerOfTwo(t)&&(n=d.a.nextPowerOfTwo(n),i=d.a.nextPowerOfTwo(i));var r=et.MAX_TEXTURE_SIZE;return r&&(n>r&&(n=r),i>r&&(i=r)),{width:n,height:i}},resizeImgToPowerOfTwo:function(t){var e=this.getSupportSize(t,!0);return this.resizeImg(t,e.width,e.height)},resizeImg:function(t,e,n){if(t.width===e&&t.height===n)return t;var i=this._canvasImage;return i?(i.width=e,i.height=n,this._canvasCtx=i.getContext("2d")):((i=document.createElement("canvas")).width=e,i.height=n,this._canvasImage=i,this._canvasCtx=i.getContext("2d")),this._canvasCtx.drawImage(t,0,0,t.width,t.height,0,0,e,n),m.a.warnOnce("Texture.resizeImg(".concat(this.id,")"),"image size(".concat(t.width,"x").concat(t.height,") is not support. Resized to ").concat(i.width,"x").concat(i.height),t.src),this._originImage=t,i},_glUploadTexture:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.width,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.height,a=t.gl;return this.compressed?a.compressedTexImage2D(e,i,this.internalFormat,r,s,this.border,n):n&&void 0!==n.width?a.texImage2D(e,i,this.internalFormat,this.format,this.type,n):a.texImage2D(e,i,this.internalFormat,r,s,this.border,this.format,this.type,n),this},_uploadTexture:function(t){var e=this;return this.useMipmap&&this.mipmaps?this.mipmaps.forEach((function(n,i){e._glUploadTexture(t,e.target,n.data,i,n.width,n.height)})):this._glUploadTexture(t,this.target,this.image,0),this},updateTexture:function(t,e){var n=t.gl;if(this.needUpdate||this.autoUpdate){this._originImage&&this.image===this._canvasImage&&(this.image=this._originImage);var i=this.useMipmap,r=this.useRepeat;if(this.image&&!this.image.length){var s=r||i,a=this.getSupportSize(this.image,s);this.image=this.resizeImg(this.image,a.width,a.height),this.width=this.image.width,this.height=this.image.height}t.activeTexture(n.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),t.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!!this.flipY);var o=tt.textureFilterAnisotropic;o&&this.anisotropic>1&&n.texParameterf(this.target,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this.anisotropic,et.MAX_TEXTURE_MAX_ANISOTROPY)),this._uploadTexture(t),i&&(this.compressed?this.mipmaps||(m.a.warn("Compressed texture has no mipmips, changed the minFilter from ".concat(this.minFilter," to Linear!"),this),this.minFilter=Bt):n.generateMipmap(this.target)),n.texParameterf(this.target,n.TEXTURE_MAG_FILTER,this.magFilter),n.texParameterf(this.target,n.TEXTURE_MIN_FILTER,this.minFilter),n.texParameterf(this.target,n.TEXTURE_WRAP_S,this.wrapS),n.texParameterf(this.target,n.TEXTURE_WRAP_T,this.wrapT),this.needUpdate=!1}return this._needUpdateSubTexture&&(this._uploadSubTextures(t,e),this._needUpdateSubTexture=!1),this},_uploadSubTextures:function(t,e){var n=this;if(this._subTextureList&&this._subTextureList.length>0){var i=t.gl;t.activeTexture(i.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),t.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!!this.flipY),this._subTextureList.forEach((function(t){var e=t[0],r=t[1],s=t[2];i.texSubImage2D(n.target,0,e,r,n.format,n.type,s)})),this._subTextureList.length=0}},_needUpdateSubTexture:!1,_subTextureList:null,updateSubTexture:function(t,e,n){this._subTextureList||(this._subTextureList=[]),this._subTextureList.push([t,e,n]),this._needUpdateSubTexture=!0},getGLTexture:function(t){this.state=t;var e=this.gl=t.gl,n=this.id;this.needDestroy&&(this.destroy(),this.needDestroy=!1);var i=zt.get(n);return i?this.updateTexture(t,i):(i=e.createTexture(),zt.add(n,i),this.needUpdate=!0,this.updateTexture(t,i)),this.isImageCanRelease&&this._releaseImage(),i},setGLTexture:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&this.destroy(),zt.add(this.id,t),this},destroy:function(){var t=this.id,e=zt.get(t);return e&&this.gl&&(this.gl.deleteTexture(e),zt.remove(t)),this},clone:function(){var t=Object.assign({},this);return delete t.id,new this.constructor(t)}}),Wt=C.a.TEXTURE_2D,Yt=C.a.RGBA,Zt=C.a.UNSIGNED_BYTE,Kt=C.a.COLOR_ATTACHMENT0,Qt=C.a.DEPTH_STENCIL,Jt=C.a.DEPTH_TEST,$t=C.a.CULL_FACE,te=C.a.TRIANGLE_STRIP,ee=C.a.NEAREST,ne=C.a.CLAMP_TO_EDGE,ie=new J,re=s.a.create({Statics:{cache:{get:function(){return ie}},reset:function(t){ie.each((function(t){t.reset()}))},destroy:function(t){ie.each((function(t){t.destroy()}))}},className:"Framebuffer",isFramebuffer:!0,bufferInternalFormat:Qt,target:Wt,format:Yt,internalFormat:Yt,type:Zt,minFilter:ee,magFilter:ee,data:null,attachment:Kt,needRenderbuffer:!0,useVao:!0,renderer:null,texture:null,renderbuffer:null,framebuffer:null,_isInit:!1,constructor:function(t,e){this.id=d.a.generateUUID(this.className),this.renderer=t,Object.assign(this,e),this.width||(this.width=t.width),this.height||(this.height=t.height),ie.add(this.id,this)},init:function(){if(!this._isInit&&this.renderer.isInit){this._isInit=!0;var t=this.renderer;this.gl=t.gl,this.state=t.state,this.reset()}},reset:function(){this.destroyResource();var t=this.gl;this.framebuffer=t.createFramebuffer(),this.bind(),this.needRenderbuffer&&(this.renderbuffer=this.createRenderbuffer()),this.texture=this.createTexture(),this.isComplete()||m.a.warn("Framebuffer is not complete => "+t.checkFramebufferStatus(t.FRAMEBUFFER)),this.unbind()},isComplete:function(){var t=this.gl;return!(!t||t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)},bind:function(){this.init(),this._isInit&&this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this.framebuffer)},unbind:function(){if(this.init(),this._isInit){var t=this.state;t.bindFramebuffer(this.gl.FRAMEBUFFER,t.preFramebuffer)}},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new v.a(0,0,0,0);if(this._isInit){var e=this.gl;e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}},render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4?arguments[4]:void 0;if(this._isInit){var s=this.gl,a=this.state;a.disable(Jt),a.disable($t),r&&this.clear(r);var o=dt.getCustomShader(_t.a,gt.a,"","FramebufferTextureShader"),u=It.getProgram(o,a);u.useProgram();var c="".concat(t,"_").concat(e,"_").concat(n,"_").concat(i,"_").concat(u.id),h=Ft.getVao(s,c,{useVao:this.useVao,useInstanced:!1,mode:te});if(h.isDirty){h.isDirty=!1;var f=[t=2*t-1,e=1-2*e,t+(n*=2),e,t,e-(i*=2),t+n,e-i];h.addAttribute(new w(new Float32Array(f),2),u.attributes.a_position),h.addAttribute(new w(new Float32Array([0,1,1,1,0,0,1,0]),2),u.attributes.a_texcoord0)}a.activeTexture(s.TEXTURE0),a.bindTexture(s.TEXTURE_2D,this.texture.getGLTexture(a)),h.draw()}},createRenderbuffer:function(){var t=this.gl,e=this.width,n=this.height,i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,i),i},createTexture:function(){var t=this.state,e=t.gl,n=new qt({minFilter:this.minFilter,magFilter:this.magFilter,internalFormat:this.internalFormat,format:this.format,type:this.type,width:this.width,height:this.height,image:this.data,wrapS:ne,wrapT:ne}),i=n.getGLTexture(t);return e.framebufferTexture2D(e.FRAMEBUFFER,this.attachment,this.target,i,0),n},resize:function(t,e,n){(n||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this._isInit&&this.reset())},readPixels:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=Object(r.getTypedArrayClass)(this.type),a=new s(n*i*4);if(this._isInit){var o=this.gl;e=this.height-e-i,this.bind(),o.readPixels(t,e,n,i,this.format,this.type,a),this.unbind()}return a},destroy:function(){this.destroyResource(),this.gl=null,ie.removeObject(this)},destroyResource:function(){var t=this.gl;t&&(this.framebuffer&&(t.deleteFramebuffer(this.framebuffer),this.framebuffer=null),this.renderbuffer&&(t.deleteRenderbuffer(this.renderbuffer),this.renderbuffer=null),this.texture&&(this.texture.destroy(),this.texture=null))}}),se=C.a.TEXTURE_CUBE_MAP,ae=C.a.RGB,oe=C.a.LINEAR,ue=C.a.CLAMP_TO_EDGE,ce=C.a.TEXTURE_CUBE_MAP_POSITIVE_X,he=s.a.create({Extends:qt,isCubeTexture:!0,className:"CubeTexture",target:se,internalFormat:ae,format:ae,magFilter:oe,minFilter:oe,wrapS:ue,wrapT:ue,constructor:function(t){he.superclass.constructor.call(this,t),this.image=this.image||[]},_uploadTexture:function(t){var e=this,n=this.image;Array.isArray(n)&&6===n.length?(n[0]&&n[0].width&&(this.width=n[0].width,this.height=n[0].height),n.forEach((function(n,i){e._glUploadTexture(t,ce+i,n,0)}))):m.a.error("CubeTexture image must be an Array of length 6",n)},right:{get:function(){return this.image[0]},set:function(t){this.image[0]=t}},left:{get:function(){return this.image[1]},set:function(t){this.image[1]=t}},top:{get:function(){return this.image[2]},set:function(t){this.image[2]=t}},bottom:{get:function(){return this.image[3]},set:function(t){this.image[3]=t}},front:{get:function(){return this.image[4]},set:function(t){this.image[4]=t}},back:{get:function(){return this.image[5]},set:function(t){this.image[5]=t}}}),fe=he,le=C.a.TEXTURE_2D,de=C.a.RGBA,me=C.a.NEAREST,_e=C.a.CLAMP_TO_EDGE,pe=C.a.FLOAT,ge=s.a.create({Extends:qt,isDataTexture:!0,className:"DataTexture",target:le,internalFormat:de,format:de,type:pe,magFilter:me,minFilter:me,wrapS:_e,wrapT:_e,dataLength:0,resetSize:function(t){if(t!==this.dataLength){this.dataLength=t;var e=d.a.nextPowerOfTwo(t/4),n=Math.max(Math.log2(e),4),i=Math.floor(n/2),s=n-i;this.width=Math.pow(2,i),this.height=Math.pow(2,s),this.DataClass=Object(r.getTypedArrayClass)(this.type)}},data:{get:function(){return this.image},set:function(t){if(this.image!==t){this.resetSize(t.length);var e=this.width*this.height*4;e===t.length&&t instanceof this.DataClass?this.image=t:(this.image&&this.image.length===e||(this.image=new this.DataClass(e)),this.image.set(t,0)),this.needUpdate=!0}}},constructor:function(t){ge.superclass.constructor.call(this,t)}}),ve=ge;function Ee(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Te,Me,Ae,Ie,Le,Oe,Se=new c.a,Re=new y.a,ye=new o.a,xe=new Float32Array([.5,.5,.5,1]),Ne=new Float32Array([0,0]),be={state:null,camera:null,lightManager:null,fog:null,gl:null,renderer:null,blankInfo:{get:function(){}},init:function(t,e,n,i,r){Oe=this._renderer=t,Ie=this.state=e,Te=this.camera=n,Ae=this.lightManager=i,Le=this.fog=r,Me=this.gl=Ie.gl},setCamera:function(t){Te=this.camera=t},handlerColorOrTexture:function(t,e){return t&&t.isTexture?this.handlerTexture(t,e):(t&&t.isColor?t.toArray(xe):xe[0]=xe[1]=xe[2]=.5,xe)},handlerTexture:function(t,e){if(t&&t.isTexture)return this.handlerGLTexture(t.target,t.getGLTexture(Ie),e)},handlerGLTexture:function(t,e,n){if(e)return Ie.activeTexture(Me.TEXTURE0+n),Ie.bindTexture(t,e),n},handlerUV:function(t){return t&&t.isTexture&&t.uv||0},POSITION:{get:function(t,e,n){return t.geometry.vertices}},NORMAL:{get:function(t,e,n){return t.geometry.normals}},TANGENT:{get:function(t,e,n){var i=e.normalMap;if(i&&i.isTexture)return 1===Number(i.uv)?t.geometry.tangents1:t.geometry.tangents}},TEXCOORD_0:{get:function(t,e,n){if(t.geometry.uvs)return t.geometry.uvs}},TEXCOORD_1:{get:function(t,e,n){if(t.geometry.uvs1)return t.geometry.uvs1}},UVMATRIX_0:{get:function(t,e,n){if(e.uvMatrix)return e.uvMatrix.elements}},UVMATRIX_1:{get:function(t,e,n){if(e.uvMatrix1)return e.uvMatrix1.elements}},CAMERAFAR:{get:function(t,e,n){if(Te.isPerspectiveCamera)return Te.far}},CAMERANEAR:{get:function(t,e,n){if(Te.isPerspectiveCamera)return Te.near}},CAMERATYPE:{get:function(t,e,n){return Te.isPerspectiveCamera?1:0}},CAMERAPOSITION:{get:function(t,e,n){return Te.worldMatrix.getTranslation(Se).elements}},COLOR_0:{get:function(t,e,n){if(t.geometry.colors)return t.geometry.colors}},SKININDICES:{get:function(t,e,n){return t.geometry.skinIndices}},SKINWEIGHTS:{get:function(t,e,n){return t.geometry.skinWeights}},RENDERERSIZE:{get:function(t,e,n){return Ne[0]=Oe.width,Ne[1]=Oe.height,Ne}},LOCAL:{get:function(t,e,n){return t.matrix.elements},isDependMesh:!0},MODEL:{get:function(t,e,n){return t.worldMatrix.elements},isDependMesh:!0},VIEW:{get:function(t,e,n){return Te.viewMatrix.elements}},PROJECTION:{get:function(t,e,n){return Te.projectionMatrix.elements}},VIEWPROJECTION:{get:function(t,e,n){return Te.viewProjectionMatrix.elements}},MODELVIEW:{get:function(t,e,n){return Te.getModelViewMatrix(t,ye).elements},isDependMesh:!0},MODELVIEWPROJECTION:{get:function(t,e,n){return Te.getModelProjectionMatrix(t,ye).elements},isDependMesh:!0},MODELINVERSE:{get:function(t,e,n){return ye.invert(t.worldMatrix).elements},isDependMesh:!0},VIEWINVERSE:{get:function(t,e,n){return Te.worldMatrix.elements}},VIEWINVERSEINVERSETRANSPOSE:{get:function(t,e,n){return Re.normalFromMat4(Te.worldMatrix).elements}},PROJECTIONINVERSE:{get:function(t,e,n){return ye.invert(Te.projectionMatrix).elements}},MODELVIEWINVERSE:{get:function(t,e,n){return ye.invert(Te.getModelViewMatrix(t,ye)).elements},isDependMesh:!0},MODELVIEWPROJECTIONINVERSE:{get:function(t,e,n){return ye.invert(Te.getModelProjectionMatrix(t,ye)).elements},isDependMesh:!0},MODELINVERSETRANSPOSE:{get:function(t,e,n){return Re.normalFromMat4(t.worldMatrix).elements},isDependMesh:!0},MODELVIEWINVERSETRANSPOSE:{get:function(t,e,n){return Re.normalFromMat4(Te.getModelViewMatrix(t,ye)).elements},isDependMesh:!0},VIEWPORT:void 0,JOINTMATRIX:{get:function(t,e,n){if(t.isSkinedMesh)return t.getJointMat();m.a.warnOnce("semantic.JOINTMATRIX(".concat(t.id,")"),"Current mesh is not SkinedMesh!",t.id)},isDependMesh:!0,notSupportInstanced:!0},JOINTMATRIXTEXTURE:{get:function(t,e,n){if(t.isSkinedMesh)return t.updateJointMatTexture(),be.handlerTexture(t.jointMatTexture,n.textureIndex);m.a.warnOnce("semantic.JOINTMATRIXTEXTURE(".concat(t.id,")"),"Current mesh is not SkinedMesh!",t.id)},isDependMesh:!0,notSupportInstanced:!0},JOINTMATRIXTEXTURESIZE:{get:function(t,e,n){if(t.isSkinedMesh)return t.initJointMatTexture(),[t.jointMatTexture.width,t.jointMatTexture.height];m.a.warnOnce("semantic.JOINTMATRIXTEXTURESIZE(".concat(t.id,")"),"Current mesh is not SkinedMesh!",t.id)},isDependMesh:!0,notSupportInstanced:!0},NORMALMAPSCALE:{get:function(t,e,n){return e.normalMapScale}},OCCLUSIONSTRENGTH:{get:function(t,e,n){return e.occlusionStrength}},SHININESS:{get:function(t,e,n){return e.shininess}},SPECULARENVMATRIX:{get:function(t,e,n){return e.specularEnvMatrix&&e.specularEnvMap?e.specularEnvMatrix.elements:(ye.identity(),ye.elements)}},REFLECTIVITY:{get:function(t,e,n){return e.reflectivity}},REFRACTRATIO:{get:function(t,e,n){return e.refractRatio}},REFRACTIVITY:{get:function(t,e,n){return e.refractivity}},LOGDEPTH:{get:function(t,e,n){return 2/(Math.log(Te.far+1)/Math.LN2)}},AMBIENTLIGHTSCOLOR:{get:function(t,e,n){return Ae.ambientInfo}},DIRECTIONALLIGHTSCOLOR:{get:function(t,e,n){return Ae.directionalInfo.colors}},DIRECTIONALLIGHTSINFO:{get:function(t,e,n){return Ae.directionalInfo.infos}},DIRECTIONALLIGHTSSHADOWMAP:{get:function(t,e,n){return Ae.directionalInfo.shadowMap.map((function(t,e){return be.handlerTexture(t,n.textureIndex+e)}))}},DIRECTIONALLIGHTSSHADOWMAPSIZE:{get:function(t,e,n){return Ae.directionalInfo.shadowMapSize}},DIRECTIONALLIGHTSSHADOWBIAS:{get:function(t,e,n){return Ae.directionalInfo.shadowBias}},DIRECTIONALLIGHTSPACEMATRIX:{get:function(t,e,n){return Ae.directionalInfo.lightSpaceMatrix}},POINTLIGHTSPOS:{get:function(t,e,n){return Ae.pointInfo.poses}},POINTLIGHTSCOLOR:{get:function(t,e,n){return Ae.pointInfo.colors}},POINTLIGHTSINFO:{get:function(t,e,n){return Ae.pointInfo.infos}},POINTLIGHTSRANGE:{get:function(t,e,n){return Ae.pointInfo.ranges}},POINTLIGHTSSHADOWMAP:{get:function(t,e,n){return Ae.pointInfo.shadowMap.map((function(t,e){return be.handlerTexture(t,n.textureIndex+e)}))}},POINTLIGHTSSHADOWBIAS:{get:function(t,e,n){return Ae.pointInfo.shadowBias}},POINTLIGHTSPACEMATRIX:{get:function(t,e,n){return Ae.pointInfo.lightSpaceMatrix}},POINTLIGHTCAMERA:{get:function(t,e,n){return Ae.pointInfo.cameras}},SPOTLIGHTSPOS:{get:function(t,e,n){return Ae.spotInfo.poses}},SPOTLIGHTSDIR:{get:function(t,e,n){return Ae.spotInfo.dirs}},SPOTLIGHTSCOLOR:{get:function(t,e,n){return Ae.spotInfo.colors}},SPOTLIGHTSCUTOFFS:{get:function(t,e,n){return Ae.spotInfo.cutoffs}},SPOTLIGHTSINFO:{get:function(t,e,n){return Ae.spotInfo.infos}},SPOTLIGHTSRANGE:{get:function(t,e,n){return Ae.spotInfo.ranges}},SPOTLIGHTSSHADOWMAP:{get:function(t,e,n){return Ae.spotInfo.shadowMap.map((function(t,e){return be.handlerTexture(t,n.textureIndex+e)}))}},SPOTLIGHTSSHADOWMAPSIZE:{get:function(t,e,n){return Ae.spotInfo.shadowMapSize}},SPOTLIGHTSSHADOWBIAS:{get:function(t,e,n){return Ae.spotInfo.shadowBias}},SPOTLIGHTSPACEMATRIX:{get:function(t,e,n){return Ae.spotInfo.lightSpaceMatrix}},AREALIGHTSCOLOR:{get:function(t,e,n){return Ae.areaInfo.colors}},AREALIGHTSPOS:{get:function(t,e,n){return Ae.areaInfo.poses}},AREALIGHTSWIDTH:{get:function(t,e,n){return Ae.areaInfo.width}},AREALIGHTSHEIGHT:{get:function(t,e,n){return Ae.areaInfo.height}},AREALIGHTSLTCTEXTURE1:{get:function(t,e,n){return be.handlerTexture(Ae.areaInfo.ltcTexture1,n.textureIndex)}},AREALIGHTSLTCTEXTURE2:{get:function(t,e,n){return be.handlerTexture(Ae.areaInfo.ltcTexture2,n.textureIndex)}},FOGCOLOR:{get:function(t,e,n){if(Le)return Le.color.elements}},FOGINFO:{get:function(t,e,n){if(Le)return Le.getInfo()}},POSITIONDECODEMAT:{get:function(t,e,n){return t.geometry.positionDecodeMat},isDependMesh:!0},NORMALDECODEMAT:{get:function(t,e,n){return t.geometry.normalDecodeMat},isDependMesh:!0},UVDECODEMAT:{get:function(t,e,n){return t.geometry.uvDecodeMat},isDependMesh:!0},UV1DECODEMAT:{get:function(t,e,n){return t.geometry.uv1DecodeMat},isDependMesh:!0},BASECOLOR:{get:function(t,e,n){return e.baseColor.elements}},METALLIC:{get:function(t,e,n){return e.metallic}},ROUGHNESS:{get:function(t,e,n){return e.roughness}},DIFFUSEENVMAP:{get:function(t,e,n){return be.handlerTexture(e.diffuseEnvMap,n.textureIndex)}},DIFFUSEENVINTENSITY:{get:function(t,e,n){return e.diffuseEnvIntensity}},DIFFUSEENVSPHEREHARMONICS3:{get:function(t,e,n){var i=e.diffuseEnvSphereHarmonics3;if(i)return i.toArray()}},BRDFLUT:{get:function(t,e,n){return be.handlerTexture(e.brdfLUT,n.textureIndex)}},SPECULARENVMAP:{get:function(t,e,n){return be.handlerTexture(e.specularEnvMap,n.textureIndex)}},SPECULARENVINTENSITY:{get:function(t,e,n){return e.specularEnvIntensity}},SPECULARENVMAPMIPCOUNT:{get:function(t,e,n){var i=e.specularEnvMap;return i?i.mipmapCount:1}},GLOSSINESS:{get:function(t,e,n){return e.glossiness}},ALPHACUTOFF:{get:function(t,e,n){return e.alphaCutoff}},EXPOSURE:{get:function(t,e,n){return e.exposure}},GAMMAFACTOR:{get:function(t,e,n){return e.gammaFactor}},MORPHWEIGHTS:{isDependMesh:!0,notSupportInstanced:!0,get:function(t,e,n){var i=t.geometry;if(i.isMorphGeometry&&i.weights)return i.weights}}};[["POSITION","vertices"],["NORMAL","normals"],["TANGENT","tangents"]].forEach((function(t){for(var e=0;e<8;e++)be["MORPH"+t[0]+e]={get:function(t,e){return function(n,i,r){var s=n.geometry;if(s.isMorphGeometry&&s.targets&&s.targets[t]){var a=s._originalMorphIndices?s._originalMorphIndices[e]:e,o=s.targets[t][a],u="_target_".concat(t,"_").concat(e);return s[u]!==a&&o&&(o.isDirty=!0,s[u]=a),o}}}(t[1],e)}})),[["DIFFUSE","diffuse"],["SPECULAR","specular"],["EMISSION","emission"],["AMBIENT","ambient"]].forEach((function(t){var e=Ee(t,2),n=e[0],i=e[1];be[n]={get:function(t,e,n){return be.handlerColorOrTexture(e[i],n.textureIndex)}},be["".concat(n,"UV")]={get:function(t,e,n){return be.handlerUV(e[i])}}})),[["NORMALMAP","normalMap"],["PARALLAXMAP","parallaxMap"],["BASECOLORMAP","baseColorMap"],["METALLICMAP","metallicMap"],["ROUGHNESSMAP","roughnessMap"],["METALLICROUGHNESSMAP","metallicRoughnessMap"],["OCCLUSIONMAP","occlusionMap"],["SPECULARGLOSSINESSMAP","specularGlossinessMap"],["LIGHTMAP","lightMap"]].forEach((function(t){var e=Ee(t,2),n=e[0],i=e[1];be[n]={get:function(t,e,n){return be.handlerTexture(e[i],n.textureIndex)}},be["".concat(n,"UV")]={get:function(t,e,n){return be.handlerUV(e[i])}}})),[["TRANSPARENCY","transparency"]].forEach((function(t){var e=Ee(t,2),n=e[0],i=e[1];be[n]={get:function(t,e,n){var r=e[i];return r&&r.isTexture?be.handlerTexture(r,n.textureIndex):null!=r?r:1}},be["".concat(n,"UV")]={get:function(t,e,n){return be.handlerUV(e[i])}}}));var we=be,Ce=C.a.LEQUAL,Pe=C.a.BACK,He=C.a.FRONT,De=C.a.FRONT_AND_BACK,Fe=C.a.ZERO,Ue=C.a.FUNC_ADD,Ge=C.a.ONE,Be=C.a.SRC_ALPHA,Ve=C.a.ONE_MINUS_SRC_ALPHA,Xe={isBlankInfo:!0,get:function(){}},je=s.a.create({isMaterial:!0,className:"Material",shaderCacheId:null,lightType:"NONE",wireframe:!1,depthTest:!0,sampleAlphaToCoverage:!1,depthMask:!0,depthRange:[0,1],depthFunc:Ce,_cullFace:!0,normalMap:null,parallaxMap:null,normalMapScale:1,ignoreTranparent:!1,gammaCorrection:!1,usePhysicsLight:!1,isDiffuesEnvAndAmbientLightWorkTogether:!1,renderOrder:0,_premultiplyAlpha:!0,premultiplyAlpha:{get:function(){return this._premultiplyAlpha},set:function(t){this._premultiplyAlpha=t,this.transparent&&this.setDefaultTransparentBlend()}},gammaOutput:{get:function(){return m.a.warnOnce("Matrial.gammaOutput","material.gammaOutput has deprecated. Use material.gammaCorrection instead."),this.gammaCorrection},set:function(t){m.a.warnOnce("Matrial.gammaOutput","material.gammaOutput has deprecated. Use material.gammaCorrection instead."),this.gammaCorrection=t}},gammaFactor:2.2,castShadows:!0,receiveShadows:!0,uvMatrix:null,uvMatrix1:null,cullFace:{get:function(){return this._cullFace},set:function(t){this._cullFace=t,t?this.cullFaceType=this._cullFaceType:this._side=De}},_cullFaceType:Pe,cullFaceType:{get:function(){return this._cullFaceType},set:function(t){this._cullFaceType=t,this._cullFace&&(t===Pe?this._side=He:t===He&&(this._side=Pe))}},_side:He,side:{get:function(){return this._side},set:function(t){this._side!==t&&(this._side=t,t===De?this._cullFace=!1:(this._cullFace=!0,t===He?this._cullFaceType=Pe:t===Pe&&(this._cullFaceType=He)))}},blend:!1,blendEquation:Ue,blendEquationAlpha:Ue,blendSrc:Ge,blendDst:Fe,blendSrcAlpha:Ge,blendDstAlpha:Fe,isDirty:!1,transparency:1,_transparent:!1,transparent:{get:function(){return this._transparent},set:function(t){this._transparent!==t&&(this._transparent=t,t?this.setDefaultTransparentBlend():(this.blend=!1,this.depthMask=!0))}},setDefaultTransparentBlend:function(){this.blend=!0,this.depthMask=!1,this.premultiplyAlpha?(this.blendSrc=Ge,this.blendDst=Ve,this.blendSrcAlpha=Ge,this.blendDstAlpha=Ve):(this.blendSrc=Be,this.blendDst=Ve,this.blendSrcAlpha=Be,this.blendDstAlpha=Ve)},alphaCutoff:0,useHDR:!1,exposure:1,needBasicUnifroms:!0,needBasicAttributes:!0,constructor:function(t){this.id=d.a.generateUUID(this.className),this.uniforms={},this.attributes={},Object.assign(this,t),this.needBasicAttributes&&this.addBasicAttributes(),this.needBasicUnifroms&&this.addBasicUniforms()},addBasicAttributes:function(){var t=this.attributes;this._copyProps(t,{a_position:"POSITION",a_normal:"NORMAL",a_tangent:"TANGENT",a_texcoord0:"TEXCOORD_0",a_texcoord1:"TEXCOORD_1",a_color:"COLOR_0",a_skinIndices:"SKININDICES",a_skinWeights:"SKINWEIGHTS"}),["POSITION","NORMAL","TANGENT"].forEach((function(e){for(var n=e.slice(0,1)+e.slice(1).toLowerCase(),i=0;i<8;i++){var r="a_morph"+n+i;void 0===t[r]&&(t[r]="MORPH"+e+i)}}))},addBasicUniforms:function(){this._copyProps(this.uniforms,{u_modelMatrix:"MODEL",u_viewMatrix:"VIEW",u_projectionMatrix:"PROJECTION",u_modelViewMatrix:"MODELVIEW",u_modelViewProjectionMatrix:"MODELVIEWPROJECTION",u_viewInverseNormalMatrix:"VIEWINVERSEINVERSETRANSPOSE",u_normalMatrix:"MODELVIEWINVERSETRANSPOSE",u_normalWorldMatrix:"MODELINVERSETRANSPOSE",u_cameraPosition:"CAMERAPOSITION",u_rendererSize:"RENDERERSIZE",u_logDepth:"LOGDEPTH",u_ambientLightsColor:"AMBIENTLIGHTSCOLOR",u_directionalLightsColor:"DIRECTIONALLIGHTSCOLOR",u_directionalLightsInfo:"DIRECTIONALLIGHTSINFO",u_directionalLightsShadowMap:"DIRECTIONALLIGHTSSHADOWMAP",u_directionalLightsShadowMapSize:"DIRECTIONALLIGHTSSHADOWMAPSIZE",u_directionalLightsShadowBias:"DIRECTIONALLIGHTSSHADOWBIAS",u_directionalLightSpaceMatrix:"DIRECTIONALLIGHTSPACEMATRIX",u_pointLightsPos:"POINTLIGHTSPOS",u_pointLightsColor:"POINTLIGHTSCOLOR",u_pointLightsInfo:"POINTLIGHTSINFO",u_pointLightsRange:"POINTLIGHTSRANGE",u_pointLightsShadowBias:"POINTLIGHTSSHADOWBIAS",u_pointLightsShadowMap:"POINTLIGHTSSHADOWMAP",u_pointLightSpaceMatrix:"POINTLIGHTSPACEMATRIX",u_pointLightCamera:"POINTLIGHTCAMERA",u_spotLightsPos:"SPOTLIGHTSPOS",u_spotLightsDir:"SPOTLIGHTSDIR",u_spotLightsColor:"SPOTLIGHTSCOLOR",u_spotLightsCutoffs:"SPOTLIGHTSCUTOFFS",u_spotLightsInfo:"SPOTLIGHTSINFO",u_spotLightsRange:"SPOTLIGHTSRANGE",u_spotLightsShadowMap:"SPOTLIGHTSSHADOWMAP",u_spotLightsShadowMapSize:"SPOTLIGHTSSHADOWMAPSIZE",u_spotLightsShadowBias:"SPOTLIGHTSSHADOWBIAS",u_spotLightSpaceMatrix:"SPOTLIGHTSPACEMATRIX",u_areaLightsPos:"AREALIGHTSPOS",u_areaLightsColor:"AREALIGHTSCOLOR",u_areaLightsWidth:"AREALIGHTSWIDTH",u_areaLightsHeight:"AREALIGHTSHEIGHT",u_areaLightsLtcTexture1:"AREALIGHTSLTCTEXTURE1",u_areaLightsLtcTexture2:"AREALIGHTSLTCTEXTURE2",u_jointMat:"JOINTMATRIX",u_jointMatTexture:"JOINTMATRIXTEXTURE",u_jointMatTextureSize:"JOINTMATRIXTEXTURESIZE",u_positionDecodeMat:"POSITIONDECODEMAT",u_normalDecodeMat:"NORMALDECODEMAT",u_uvDecodeMat:"UVDECODEMAT",u_uv1DecodeMat:"UV1DECODEMAT",u_morphWeights:"MORPHWEIGHTS",u_normalMapScale:"NORMALMAPSCALE",u_emission:"EMISSION",u_transparency:"TRANSPARENCY",u_uvMatrix:"UVMATRIX_0",u_uvMatrix1:"UVMATRIX_1",u_fogColor:"FOGCOLOR",u_fogInfo:"FOGINFO",u_alphaCutoff:"ALPHACUTOFF",u_exposure:"EXPOSURE",u_gammaFactor:"GAMMAFACTOR"}),this.addTextureUniforms({u_normalMap:"NORMALMAP",u_parallaxMap:"PARALLAXMAP",u_emission:"EMISSION",u_transparency:"TRANSPARENCY"})},addTextureUniforms:function(t){var e={};for(var n in t){var i=t[n];e[n]=i,e["".concat(n,".texture")]=i,e["".concat(n,".uv")]="".concat(i,"UV")}this._copyProps(this.uniforms,e)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.lightType;e["LIGHT_TYPE_".concat(n)]=1,e.SIDE=this.side,"NONE"!==n&&(e.HAS_LIGHT=1),this.premultiplyAlpha&&(e.PREMULTIPLY_ALPHA=1);var i=this._textureOption.reset(e);return e.HAS_LIGHT&&(e.HAS_NORMAL=1,i.add(this.normalMap,"NORMAL_MAP",(function(){1!==t.normalMapScale&&(e.NORMAL_MAP_SCALE=1)}))),i.add(this.parallaxMap,"PARALLAX_MAP"),i.add(this.emission,"EMISSION_MAP"),i.add(this.transparency,"TRANSPARENCY_MAP"),this.ignoreTranparent&&(e.IGNORE_TRANSPARENT=1),this.alphaCutoff>0&&(e.ALPHA_CUTOFF=1),this.useHDR&&(e.USE_HDR=1),this.gammaCorrection&&(e.GAMMA_CORRECTION=1),this.receiveShadows&&(e.RECEIVE_SHADOWS=1),this.castShadows&&(e.CAST_SHADOWS=1),this.uvMatrix&&(e.UV_MATRIX=1),this.uvMatrix1&&(e.UV_MATRIX1=1),this.usePhysicsLight&&(e.USE_PHYSICS_LIGHT=1),this.isDiffuesEnvAndAmbientLightWorkTogether&&(e.IS_DIFFUESENV_AND_AMBIENTLIGHT_WORK_TOGETHER=1),i.update(),e},_textureOption:{uvTypes:null,option:null,reset:function(t){return this.option=t,this.uvTypes={},this},add:function(t,e,n){if(t&&t.isTexture){var i=this.uvTypes,r=this.option,s=t.uv||0;i[s]=1,r[e]=s,t.isCubeTexture&&(r["".concat(e,"_CUBE")]=1),n&&n(t)}return this},update:function(){var t=[0,1],e=this.uvTypes,n=this.option;for(var i in e)-1!==t.indexOf(Number(i))?n["HAS_TEXCOORD".concat(i)]=1:(m.a.warnOnce("Material._textureOption.update(".concat(i,")"),"uv_".concat(i," not support!")),n.HAS_TEXCOORD0=1);return this}},getInstancedUniforms:function(){var t=this._instancedUniforms;if(!this._instancedUniforms){var e=this.uniforms;for(var n in t=this._instancedUniforms=[],e){var i=this.getUniformInfo(n);i.isDependMesh&&!i.notSupportInstanced&&t.push({name:n,info:i})}}return t},getUniformData:function(t,e,n){return this.getUniformInfo(t).get(e,this,n)},getAttributeData:function(t,e,n){return this.getAttributeInfo(t).get(e,this,n)},getUniformInfo:function(t){return this.getInfo("uniforms",t)},getAttributeInfo:function(t){return this.getInfo("attributes",t)},getInfo:function(t,e){var n=this[t][e];return"string"==typeof n&&(n=we[n]),n&&n.get||(m.a.warnOnce("material.getInfo-"+e,"Material.getInfo: no this semantic:"+e),n=Xe),n},clone:function(){var t=new this.constructor;for(var e in this)"id"!==e&&(t[e]=this[e]);return t},destroyTextures:function(){this.getTextures().forEach((function(t){t.destroy()}))},getTextures:function(){var t=[];for(var e in this){var n=this[e];n&&n.isTexture&&t.push(n)}return t},_copyProps:function(t,e){for(var n in e)void 0===t[n]&&(t[n]=e[n])}}),ke=s.a.create({Extends:je,isBasicMaterial:!0,className:"BasicMaterial",lightType:"BLINN-PHONG",diffuse:null,ambient:null,specular:null,emission:null,specularEnvMap:null,specularEnvMatrix:null,reflectivity:0,refractRatio:0,refractivity:0,shininess:32,usedUniformVectors:11,constructor:function(t){this.diffuse=new v.a(.5,.5,.5),this.specular=new v.a(1,1,1),this.emission=new v.a(0,0,0),ke.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT",u_shininess:"SHININESS",u_reflectivity:"REFLECTIVITY",u_refractRatio:"REFRACTRATIO",u_refractivity:"REFRACTIVITY",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvMatrix:"SPECULARENVMATRIX"}),this.addTextureUniforms({u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ke.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t),n=this.lightType;"PHONG"!==n&&"BLINN-PHONG"!==n||(t.HAS_SPECULAR=1);var i=this.diffuse;return i&&i.isTexture&&(i.isCubeTexture?t.DIFFUSE_CUBE_MAP=1:e.add(this.diffuse,"DIFFUSE_MAP")),t.HAS_LIGHT&&(e.add(this.specular,"SPECULAR_MAP"),e.add(this.ambient,"AMBIENT_MAP"),e.add(this.specularEnvMap,"SPECULAR_ENV_MAP")),e.update(),t}}),ze=ke,qe=C.a.POSITION,We=C.a.NORMAL,Ye=C.a.DEPTH,Ze=C.a.DISTANCE,Ke=C.a.NONE,Qe=s.a.create({Extends:ze,isGeometryMaterial:!0,className:"GeometryMaterial",vertexType:qe,lightType:Ke,writeOriginData:!1,constructor:function(t){Qe.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_cameraFar:"CAMERAFAR",u_cameraNear:"CAMERANEAR",u_cameraType:"CAMERATYPE"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(Qe.superclass.getRenderOption.call(this,t),t["VERTEX_TYPE_".concat(this.vertexType)]=1,this.vertexType){case qe:t.HAS_FRAG_POS=1;break;case We:t.HAS_NORMAL=1;break;case Ye:break;case Ze:t.HAS_FRAG_POS=1}return this.writeOriginData&&(t.WRITE_ORIGIN_DATA=1),t}}),Je=Qe,$e=s.a.create({Extends:O,isOrthographicCamera:!0,className:"OrthographicCamera",_left:-1,left:{get:function(){return this._left},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._left=t}},_right:1,right:{get:function(){return this._right},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._right=t}},_bottom:-1,bottom:{get:function(){return this._bottom},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._bottom=t}},_top:1,top:{get:function(){return this._top},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._top=t}},_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:1,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},constructor:function(t){$e.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=[this.left,this.bottom,-this.near],i=[this.right,this.bottom,-this.near],r=[this.right,this.top,-this.near],s=[this.left,this.top,-this.near],a=[this.left,this.bottom,-this.far],o=[this.right,this.bottom,-this.far],u=[this.right,this.top,-this.far],c=[this.left,this.top,-this.far];e.addRect(a,o,u,c),e.addRect(o,i,r,u),e.addRect(i,n,s,r),e.addRect(n,a,c,s),e.addRect(c,u,r,s),e.addRect(n,i,o,a),this._geometry=e}return this._geometry}}),tn=$e,en=C.a.DEPTH,nn=C.a.BACK,rn=null,sn=new v.a(1,1,1),an=new o.a,on=function(t){return t.material.castShadows},un=s.a.create({isLightShadow:!0,className:"LightShadow",light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,cameraInfo:null,debug:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},createFramebuffer:function(){this.framebuffer||(this.framebuffer=new re(this.renderer,{width:this.width,height:this.height}),this.debug&&this.showShadowMap())},updateLightCamera:function(t){this.light.isDirectionalLight?this.updateDirectionalLightCamera(t):this.light.isSpotLight&&this.updateSpotLightCamera(t)},updateDirectionalLightCamera:function(t){var e=this.light;if(this.camera.lookAt(e.direction),this.cameraInfo)this.updateCustumCamera(this.cameraInfo);else{var n=t.getGeometry();if(n){this.camera.updateViewMatrix(),an.multiply(this.camera.viewMatrix,t.worldMatrix);var i=n.getBounds(an);this.camera.near=-i.zMax,this.camera.far=-i.zMin,this.camera.left=i.xMin,this.camera.right=i.xMax,this.camera.bottom=i.yMin,this.camera.top=i.yMax}}this.camera.updateViewMatrix()},updateCustumCamera:function(t){for(var e in t)this.camera[e]=t[e]},updateSpotLightCamera:function(t){var e=this.light;this.camera.lookAt(e.direction),this.cameraInfo?this.updateCustumCamera(this.cameraInfo):(this.camera.fov=2*e.outerCutoff,this.camera.near=.01,this.camera.far=t.far,this.camera.aspect=1),this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.light.isDirectionalLight?this.camera=new tn:this.light.isSpotLight&&(this.camera=new Q),this.camera.addTo(this.light)),this._cameraMatrixVersion!==t.matrixVersion&&(this.updateLightCamera(t),this._cameraMatrixVersion=t.matrixVersion)},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;rn||(rn=new Je({vertexType:en,side:nn,writeOriginData:!0})),n.bind(),e.state.viewport(0,0,this.width,this.height),e.clear(sn),i.updateViewProjectionMatrix(),we.setCamera(i),e.forceMaterial=rn,this.renderShadowScene(e),delete e.forceMaterial,n.unbind(),we.setCamera(t),e.viewport()},renderShadowScene:function(t){t.renderList.traverse((function(e){on(e)&&t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e.filter((function(t){return on(t)})))}))},showShadowMap:function(){var t=this;this.renderer.on("afterRender",(function(){t.framebuffer.render(0,.7,.3,.3)}))}}),cn=C.a.DISTANCE,hn=C.a.BACK,fn=C.a.TEXTURE_CUBE_MAP,ln=C.a.TEXTURE0,dn=C.a.TEXTURE_CUBE_MAP_POSITIVE_X,mn=C.a.NEAREST,_n=C.a.FRAMEBUFFER,pn=C.a.FRAMEBUFFER_COMPLETE,gn=null,vn=new v.a(0,0,0,0),En=new c.a,Tn=[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0]],Mn=function(t,e){if(t.material.castShadows){if(!t.frustumTest)return!0;if(e.isMeshVisible(t))return!0}return!1},An=s.a.create({isLightShadow:!0,className:"CubeLightShadow",Extends:un,light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,debug:!1,constructor:function(t){An.superclass.constructor.call(this,t)},createFramebuffer:function(){if(!this.framebuffer){this.framebuffer=new re(this.renderer,{target:fn,width:1024,height:1024,createTexture:function(){var t=this.state.gl,e=new fe({image:[null,null,null,null,null,null],type:this.type,format:this.format,internalFormat:this.internalFormat,magFilter:mn,minFilter:mn,width:1024,height:1024});return t.checkFramebufferStatus(_n)!==pn&&m.a.warn("Framebuffer is not complete",t.checkFramebufferStatus(_n)),e},bindTexture:function(t){t=t||0;var e=this.state,n=e.gl,i=this.texture.getGLTexture(e);e.activeTexture(ln+et.MAX_TEXTURE_INDEX),e.bindTexture(this.target,i),n.framebufferTexture2D(_n,this.attachment,dn+t,i,0)}})}},updateLightCamera:function(t){this.camera.fov=90,this.camera.near=t.near,this.camera.far=t.far,this.camera.aspect=1,this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.camera=new Q,this.updateLightCamera(t))},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;gn||(gn=new Je({vertexType:cn,side:hn,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,n.width,n.height),this.light.worldMatrix.getTranslation(i.position);for(var r=0;r<6;r++)n.bindTexture(r),En.fromArray(Tn[0],3*r).add(i.position),i.up.fromArray(Tn[1],3*r),i.lookAt(En),i.updateViewProjectionMatrix(),e.clear(vn),we.setCamera(i),e.forceMaterial=gn,this.renderShadowScene(e);i.matrix.identity(),i.updateViewProjectionMatrix(),delete e.forceMaterial,n.unbind(),we.setCamera(t),e.viewport()},renderShadowScene:function(t){var e=t.renderList,n=this.camera;e.traverse((function(e){Mn(e,n)&&t.renderMesh(e)}),(function(e){var i=e.filter((function(t){return Mn(t,n)}));t.renderInstancedMeshes(i)}))}}),In=An,Ln=s.a.create({Extends:M,isPointLight:!0,className:"PointLight",constructor:function(t){Ln.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new In({light:this,renderer:t}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))}}),On=Ln,Sn=new o.a,Rn=new c.a,yn=s.a.create({Extends:M,isDirectionalLight:!0,className:"DirectionalLight",shadow:null,constructor:function(t){this.direction=new c.a(0,0,1),yn.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new un({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return Rn.copy(this.direction).transformDirection(this.worldMatrix).normalize(),Rn},getViewDirection:function(t){var e=t.getModelViewMatrix(this,Sn);return Rn.copy(this.direction).transformDirection(e).normalize(),Rn}}),xn=yn,Nn=new o.a,bn=new c.a,wn=s.a.create({Extends:M,isSpotLight:!0,className:"SpotLight",shadow:null,_cutoffCos:.9763,_cutoff:12.5,cutoff:{get:function(){return this._cutoff},set:function(t){this._cutoff=t,this._cutoffCos=Math.cos(d.a.degToRad(t))}},_outerCutoffCos:.9537,_outerCutoff:17.5,outerCutoff:{get:function(){return this._outerCutoff},set:function(t){this._outerCutoff=t,this._outerCutoffCos=Math.cos(d.a.degToRad(t))}},constructor:function(t){this.direction=new c.a(0,0,1),wn.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new un({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return bn.copy(this.direction).transformDirection(this.worldMatrix).normalize(),bn},getViewDirection:function(t){var e=t.getModelViewMatrix(this,Nn);return bn.copy(this.direction).transformDirection(e).normalize(),bn}}),Cn=wn,Pn=s.a.create({Extends:je,isShaderMaterial:!0,className:"ShaderMaterial",vs:"",fs:"",useHeaderCache:!1,constructor:function(t){Pn.superclass.constructor.call(this,t)},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Pn.superclass.getRenderOption.call(this,t),this.getCustomRenderOption){var e=this.getCustomRenderOption({});for(var n in e)t["HILO_CUSTUM_OPTION_".concat(n)]=e[n]}return t},getCustomRenderOption:null}),Hn=Pn,Dn=n(15),Fn=n.n(Dn),Un=s.a.create({Extends:Z,isMorphGeometry:!0,className:"MorphGeometry",isStatic:!1,weights:[],targets:null,constructor:function(t){Un.superclass.constructor.call(this,t),this.weights=this.weights||[]},update:function(t,e){this.weights=t,this._originalMorphIndices=e},clone:function(){return Z.prototype.clone.call(this,{targets:this.targets,weights:this.weights})},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Un.superclass.getRenderOption.call(this,e),this.targets&&(this._maxMorphTargetCount||(this._maxMorphTargetCount=Math.floor(8/Object.keys(this.targets).length)),Object(r.each)(this.targets,(function(n,i){e.MORPH_TARGET_COUNT=Math.min(n.length,t._maxMorphTargetCount),"vertices"===i?e.MORPH_HAS_POSITION=1:"normals"===i?e.MORPH_HAS_NORMAL=1:"tangents"===i&&(e.MORPH_HAS_TANGENT=1)}))),e}}),Gn=Un,Bn={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},Vn={Geometry:Z,GeometryData:w};var Xn={_decodeTotalTime:0,wasmURL:"",workerURL:"",useWASM:!0,useWebWorker:!0,useAuto:!0,init:function(){return Xn.useAuto?Fn.a.initWASM(Xn.wasmURL,Xn.memPages):Xn.useWebWorker?Fn.a.initWorker(Xn.workerURL):Xn.useWASM?Fn.a.initWASM(Xn.wasmURL,Xn.memPages):Promise.resolve()},parse:function(t,e,n,i){var r=Date.now(),s=e.bufferViews[t.bufferView],a=Xn.wasmURL,o=Xn.workerURL,u=Xn.useAuto,c=Xn.useWASM,h=Xn.useWebWorker,f=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);function l(e){Xn._decodeTotalTime+=Date.now()-r;var n=e.toHilo3dGeometry(Vn,i.primitive._geometry);return t.targets&&(n=function(t,e,n){if(!n.isMorphGeometry){var i=new Gn;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&"id"!==r&&(i[r]=n[r]);i.targets={},n=i}for(var s=n.targets,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return t["FOG_".concat(this.mode)]=1,t}}),ti=n(16),ei=new ti.a,ni=new o.a,ii=s.a.create({Extends:g,isMesh:!0,className:"Mesh",geometry:null,material:null,useInstanced:!1,frustumTest:!0,constructor:function(t){ii.superclass.constructor.call(this,t),this._usedResourceDict={}},clone:function(t){var e=g.prototype.clone.call(this,t);return Object.assign(e,{geometry:this.geometry,material:this.material}),e},raycast:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.visible)return null;var n=this.geometry,i=this.material,r=this.worldMatrix;if(n&&i){ni.invert(r),ei.copy(t),ei.transformMat4(ni);var s=n.raycast(ei,i.side,e);if(s)return s.forEach((function(t){t.transformMat4(r)})),s}return null},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.geometry.getRenderOption(t),t},useResource:function(t){t&&(this._usedResourceDict[t.className+":"+t.id]=t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._isDestroyed)return this;this.removeFromParent();var n=t.resourceManager,i=this._usedResourceDict;for(var r in i)n.destroyIfNoRef(i[r]);return this.material&&e&&this.material.destroyTextures(),this.off(),this._usedResourceDict=null,this.geometry=null,this.material=null,this._isDestroyed=!0,this}}),ri=ii,si=new o.a,ai=new o.a,oi=s.a.create({Extends:ri,isSkinedMesh:!0,className:"SkinedMesh",_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initJointNodeList()}},jointNodeList:null,useInstanced:!1,jointMatTexture:null,frustumTest:!1,constructor:function(t){this.jointNames=[],this.inverseBindMatrices=[],oi.superclass.constructor.call(this,t)},initJointNodeList:function(){var t=this;if(this._rootNode){var e={};this._rootNode.traverse((function(t){"jointName"in t&&(e[t.jointName]=t)})),this.jointNodeList=[],this.jointNames.forEach((function(n){t.jointNodeList.push(e[n])}))}},getJointMat:function(){var t=this;if(this.jointNodeList)return this.jointMat||(this.jointMat=new Float32Array(16*this.jointNodeList.length)),this._rootNode||!this.clonedFrom?ai.invert(this.worldMatrix):ai.invert(this.clonedFrom.worldMatrix),this.jointNodeList.forEach((function(e,n){si.copy(ai),si.multiply(e.worldMatrix),si.multiply(t.inverseBindMatrices[n]),si.toArray(t.jointMat,16*n)})),this.jointMat},initJointMatTexture:function(){if(!this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture=new ve({data:t})}return this.jointMatTexture},updateJointMatTexture:function(){if(this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture.data.set(t,0),this.jointMatTexture.needUpdate=!0}else this.initJointMatTexture()},clone:function(t){var e=ri.prototype.clone.call(this,t);return Object.assign(e,{useInstanced:this.useInstanced,jointNames:this.jointNames.slice(),inverseBindMatrices:this.inverseBindMatrices.map((function(t){return t.clone()})),jointNodeList:this.jointNodeList}),e.clonedFrom=this,e},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};oi.superclass.getRenderOption.call(this,t);var e=this.jointNames.length;if(e&&(t.JOINT_COUNT=e,et.VERTEX_TEXTURE_FLOAT)){var n=(et.MAX_VERTEX_UNIFORM_VECTORS-22)/4;e>n&&(t.JOINT_MAT_MAP=1)}return t}}),ui=oi,ci=s.a.create({className:"RenderInfo",isRenderInfo:!0,constructor:function(){this.reset()},addFaceCount:function(t){this._currentFaceCount+=t},addDrawCount:function(t){this._currentDrawCount+=t},reset:function(){this.faceCount=Math.floor(this._currentFaceCount),this.drawCount=Math.floor(this._currentDrawCount),this._currentFaceCount=0,this._currentDrawCount=0}}),hi=new c.a,fi=function(t,e){var n=t.material.renderOrder,i=e.material.renderOrder;if(n!==i)return n-i;var r=t.material._shaderNumId||0,s=e.material._shaderNumId||0;return r!==s?r-s:t._sortRenderZ-e._sortRenderZ},li=function(t,e){var n=t.material.renderOrder,i=e.material.renderOrder;return n!==i?n-i:e._sortRenderZ-t._sortRenderZ},di=s.a.create({className:"RenderList",isRenderList:!0,useInstanced:!1,constructor:function(){this.opaqueList=[],this.transparentList=[],this.instancedDict={}},reset:function(){this.opaqueList.length=0,this.transparentList.length=0,this.instancedDict={}},traverse:function(t,e){this.opaqueList.forEach((function(e){t(e)}));var n=this.instancedDict;for(var i in n){var r=n[i];r.length>2&&e?e(r):r.forEach((function(e){t(e)}))}this.transparentList.forEach((function(e){t(e)}))},sort:function(){this.transparentList.sort(li),this.opaqueList.sort(fi)},addMesh:function(t,e){var n=t.material,i=t.geometry;if(n&&i){if(t.frustumTest&&!e.isMeshVisible(t))return;if(this.useInstanced&&t.useInstanced){var r=this.instancedDict,s=n.id+"_"+i.id,a=r[s];r[s]||(a=r[s]=[]),a.push(t)}else t.worldMatrix.getTranslation(hi),hi.transformMat4(e.viewProjectionMatrix),t._sortRenderZ=hi.z,n.transparent?this.transparentList.push(t):this.opaqueList.push(t)}else m.a.warnOnce("RenderList.addMesh(".concat(t.id,")"),"Mesh must have material and geometry",t)}}),mi=s.a.create({className:"WebGLState",isWebGLState:!0,systemFramebuffer:null,constructor:function(t){this.gl=t,this.reset()},reset:function(){this._dict={},this.activeTextureIndex=null,this.textureUnitDict={},this.currentFramebuffer=null,this.preFramebuffer=null,this._pixelStorei={}},enable:function(t){!0!==this._dict[t]&&(this._dict[t]=!0,this.gl.enable(t))},disable:function(t){!1!==this._dict[t]&&(this._dict[t]=!1,this.gl.disable(t))},bindFramebuffer:function(t,e){this.currentFramebuffer!==e&&(this.preFramebuffer=this.currentFramebuffer,this.currentFramebuffer=e,this.gl.bindFramebuffer(t,e))},bindSystemFramebuffer:function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,this.systemFramebuffer)},useProgram:function(t){this.set1("useProgram",t)},depthFunc:function(t){this.set1("depthFunc",t)},depthMask:function(t){this.set1("depthMask",t)},clear:function(t){this.gl.clear(t)},depthRange:function(t,e){this.set2("depthRange",t,e)},stencilFunc:function(t,e,n){this.set3("stencilFunc",t,e,n)},stencilMask:function(t){this.set1("stencilMask",t)},stencilOp:function(t,e,n){this.set3("stencilOp",t,e,n)},colorMask:function(t,e,n,i){this.set4("colorMask",t,e,n,i)},cullFace:function(t){this.set1("cullFace",t)},frontFace:function(t){this.set1("frontFace",t)},blendFuncSeparate:function(t,e,n,i){this.set4("blendFuncSeparate",t,e,n,i)},blendEquationSeparate:function(t,e){this.set2("blendEquationSeparate",t,e)},pixelStorei:function(t,e){this._pixelStorei[t]!==e&&(this._pixelStorei[t]=e,this.gl.pixelStorei(t,e))},viewport:function(t,e,n,i){this.set4("viewport",t,e,n,i)},activeTexture:function(t){this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},bindTexture:function(t,e){var n=this.getActiveTextureUnit();n[t]!==e&&(n[t]=e,this.gl.bindTexture(t,e))},getActiveTextureUnit:function(){var t=this.textureUnitDict[this.activeTextureIndex];return t||(t=this.textureUnitDict[this.activeTextureIndex]={}),t},set1:function(t,e){this._dict[t]!==e&&(this._dict[t]=e,this.gl[t](e))},set2:function(t,e,n){var i=this._dict[t];i||(i=this._dict[t]=[]),i[0]===e&&i[1]===n||(i[0]=e,i[1]=n,this.gl[t](e,n))},set3:function(t,e,n,i){var r=this._dict[t];r||(r=this._dict[t]=[]),r[0]===e&&r[1]===n&&r[2]===i||(r[0]=e,r[1]=n,r[2]=i,this.gl[t](e,n,i))},set4:function(t,e,n,i,r){var s=this._dict[t];s||(s=this._dict[t]=[]),s[0]===e&&s[1]===n&&s[2]===i&&s[3]===r||(s[0]=e,s[1]=n,s[2]=i,s[3]=r,this.gl[t](e,n,i,r))},get:function(t){return this._dict[t]}}),_i=s.a.create({className:"WebGLResourceManager",isWebGLResourceManager:!0,hasNeedDestroyResource:!1,constructor:function(t){Object.assign(this,t)},useResource:function(t,e){if(t){var n=t.className+":"+t.id;this._usedResourceDict[n]||(this._usedResourceDict[n]=t,t.useResource&&t.useResource(this,e))}return e&&e.useResource(t),this},destroyIfNoRef:function(t){return this._needDestroyDict||(this._needDestroyDict={}),t&&(this.hasNeedDestroyResource=!0,this._needDestroyDict[t.className+":"+t.id]=t),this},destroyUnsuedResource:function(){if(!this.hasNeedDestroyResource)return this;var t=this._needDestroyDict,e=this._usedResourceDict;for(var n in t)if(!e[n]){var i=t[n];i&&!i.alwaysUse&&i.destroy&&i.destroy()}return this._needDestroyDict={},this.hasNeedDestroyResource=!1,this},reset:function(){return this._usedResourceDict={},this}}),pi=new o.a,gi=new c.a,vi=new Float32Array([0,0,0]),Ei=s.a.create({isLightManager:!0,className:"LightManager",constructor:function(t){this.ambientLights=[],this.directionalLights=[],this.pointLights=[],this.spotLights=[],this.areaLights=[],this.lightInfo={AMBIENT_LIGHTS:0,POINT_LIGHTS:0,DIRECTIONAL_LIGHTS:0,SPOT_LIGHTS:0,AREA_LIGHTS:0,uid:0},Object.assign(this,t)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(r.each)(this.lightInfo,(function(n,i){if("uid"!==i&&n){e[i]=n;var r=t.getShadowMapCount(i);r&&(e[i+"_SMC"]=r)}})),e},addLight:function(t){var e=null;return t.enabled?(t.isAmbientLight?e=this.ambientLights:t.isDirectionalLight?e=this.directionalLights:t.isPointLight?e=this.pointLights:t.isSpotLight?e=this.spotLights:t.isAreaLight?e=this.areaLights:m.a.warnOnce("LightManager.addLight(".concat(t.id,")"),"Not support this light:",t),e&&(t.shadow?e.unshift(t):e.push(t)),this):this},getDirectionalInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[];this.directionalLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(e,c),o.getViewDirection(t).toArray(n,c),o.shadow&&o.lightShadow&&(i.push(o.lightShadow.framebuffer.texture),r.push(o.lightShadow.width),r.push(o.lightShadow.height),a.push(o.lightShadow.minBias,o.lightShadow.maxBias),pi.copy(t.worldMatrix),pi.premultiply(o.lightShadow.camera.viewProjectionMatrix),pi.toArray(s,16*u))}));var o={colors:new Float32Array(e),infos:new Float32Array(n)};return i.length&&(o.shadowMap=i,o.shadowMapSize=new Float32Array(r),o.shadowBias=new Float32Array(a),o.lightSpaceMatrix=new Float32Array(s)),o},getSpotInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[],c=[],h=[];this.spotLights.forEach((function(f,l){var d=3*l;f.getRealColor().toRGBArray(e,d),f.toInfoArray(n,d),f.getViewDirection(t).toArray(r,d),h.push(f.range),s.push(f._cutoffCos,f._outerCutoffCos),t.getModelViewMatrix(f,pi),pi.getTranslation(gi),gi.toArray(i,d),f.shadow&&f.lightShadow&&(a.push(f.lightShadow.framebuffer.texture),o.push(f.lightShadow.width),o.push(f.lightShadow.height),c.push(f.lightShadow.minBias,f.lightShadow.maxBias),pi.multiply(f.lightShadow.camera.viewProjectionMatrix,t.worldMatrix),pi.toArray(u,16*l))}));var f={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),dirs:new Float32Array(r),cutoffs:new Float32Array(s),ranges:new Float32Array(h)};return a.length&&(f.shadowMap=a,f.shadowMapSize=new Float32Array(o),f.shadowBias=new Float32Array(c),f.lightSpaceMatrix=new Float32Array(u)),f},getPointInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[];this.pointLights.forEach((function(c,h){var f=3*h;c.getRealColor().toRGBArray(e,f),c.toInfoArray(n,f),u.push(c.range),t.getModelViewMatrix(c,pi),pi.getTranslation(gi),gi.toArray(i,f),c.shadow&&c.lightShadow&&(r.push(c.lightShadow.framebuffer.texture),a.push(c.lightShadow.minBias,c.lightShadow.maxBias),t.worldMatrix.toArray(s,16*h),o[2*h]=c.lightShadow.camera.near,o[2*h+1]=c.lightShadow.camera.far)}));var c={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),ranges:new Float32Array(u)};return r.length&&(c.shadowMap=r,c.shadowBias=new Float32Array(a),c.lightSpaceMatrix=new Float32Array(s),c.cameras=new Float32Array(o)),c},getAreaInfo:function(t){var e,n,i=[],r=[],s=[],a=[];return this.areaLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(i,c),t.getModelViewMatrix(o,pi),pi.getTranslation(gi),gi.toArray(r,c);var h=pi.getRotation();pi.fromQuat(h),gi.set(.5*o.width,0,0),gi.transformMat4(pi),gi.toArray(s,c),gi.set(0,.5*o.height,0),gi.transformMat4(pi),gi.toArray(a,c),e=o.ltcTexture1,n=o.ltcTexture2})),{colors:new Float32Array(i),poses:new Float32Array(r),width:new Float32Array(s),height:new Float32Array(a),ltcTexture1:e,ltcTexture2:n}},getAmbientInfo:function(){return vi[0]=vi[1]=vi[2]=0,this.ambientLights.forEach((function(t){var e=t.getRealColor();vi[0]+=e.r,vi[1]+=e.g,vi[2]+=e.b})),vi[0]=Math.min(1,vi[0]),vi[1]=Math.min(1,vi[1]),vi[2]=Math.min(1,vi[2]),vi},updateInfo:function(t){var e=this.lightInfo,n=this.ambientLights,i=this.directionalLights,r=this.pointLights,s=this.spotLights,a=this.areaLights;e.AMBIENT_LIGHTS=n.length,e.POINT_LIGHTS=r.length,e.DIRECTIONAL_LIGHTS=i.length,e.SPOT_LIGHTS=s.length,e.AREA_LIGHTS=a.length;var o=function(t){return!!t.shadow};e.SHADOW_POINT_LIGHTS=r.filter(o).length,e.SHADOW_SPOT_LIGHTS=s.filter(o).length,e.SHADOW_DIRECTIONAL_LIGHTS=i.filter(o).length,e.uid=[e.AMBIENT_LIGHTS,e.POINT_LIGHTS,e.SHADOW_POINT_LIGHTS,e.DIRECTIONAL_LIGHTS,e.SHADOW_DIRECTIONAL_LIGHTS,e.SPOT_LIGHTS,e.SHADOW_SPOT_LIGHTS,e.AREA_LIGHTS].join("_"),this.directionalInfo=this.getDirectionalInfo(t),this.pointInfo=this.getPointInfo(t),this.spotInfo=this.getSpotInfo(t),this.areaInfo=this.getAreaInfo(t),this.ambientInfo=this.getAmbientInfo()},getInfo:function(){return this.lightInfo},reset:function(){this.ambientLights.length=0,this.directionalLights.length=0,this.pointLights.length=0,this.spotLights.length=0,this.areaLights.length=0},getShadowMapCount:function(t){var e=[];"POINT_LIGHTS"===t?e=this.pointLights:"DIRECTIONAL_LIGHTS"===t?e=this.directionalLights:"SPOT_LIGHTS"===t?e=this.spotLights:"AREA_LIGHTS"===t&&(e=this.spotLights);var n=0;return e.forEach((function(t){n+=t.shadow?1:0})),n},createShadowMap:function(t,e){this.directionalLights.forEach((function(n){n.createShadowMap(t,e)})),this.spotLights.forEach((function(n){n.createShadowMap(t,e)})),this.pointLights.forEach((function(n){n.createShadowMap(t,e)})),this.areaLights.forEach((function(n){n.createShadowMap(t,e)}))}}),Ti=C.a.DEPTH_TEST,Mi=C.a.SAMPLE_ALPHA_TO_COVERAGE,Ai=C.a.CULL_FACE,Ii=C.a.FRONT_AND_BACK,Li=C.a.BLEND,Oi=C.a.LINES,Si=C.a.STATIC_DRAW,Ri=C.a.DYNAMIC_DRAW,yi=s.a.create({Mixes:a.a,className:"WebGLRenderer",isWebGLRenderer:!0,gl:null,width:0,height:0,pixelRatio:1,domElement:null,useInstanced:!1,useVao:!0,alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!1,gameMode:!1,useFramebuffer:!1,framebufferOption:{},useLogDepth:!1,vertexPrecision:"highp",fragmentPrecision:"highp",fog:null,offsetX:0,offsetY:0,isInitFailed:!1,_isInit:!1,_isContextLost:!1,constructor:function(t){this.clearColor=new v.a(1,1,1),Object.assign(this,t),this.renderInfo=new ci,this.renderList=new di,this.lightManager=new Ei,this.resourceManager=new _i},resize:function(t,e,n){if(n||this.width!==t||this.height!==e){var i=this.domElement;this.width=t,this.height=e,i.width=t,i.height=e,this.framebuffer&&this.framebuffer.resize(this.width,this.height,n),this.viewport()}},setOffset:function(t,e){this.offsetX===t&&this.offsetY===e||(this.offsetX=t,this.offsetY=e,this.viewport())},viewport:function(t,e,n,i){var r=this.state,s=this.gl;r&&(void 0===t?t=this.offsetX:this.offsetX=t,void 0===e?e=this.offsetY:this.offsetY=e,void 0===n&&(n=s.drawingBufferWidth),void 0===i&&(i=s.drawingBufferHeight),r.viewport(t,e,n,i))},isInit:{get:function(){return this._isInit&&!this.isInitFailed}},onInit:function(t){var e=this;this._isInit?t(this):this.on("init",(function(){t(e)}),!0)},initContext:function(){if(!this._isInit){this._isInit=!0;try{this._initContext(),this.fire("init")}catch(t){this.isInitFailed=!0,this.fire("initFailed",t)}}},_initContext:function(){var t=this,e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat};!0===this.preserveDrawingBuffer&&(e.preserveDrawingBuffer=!0),!0===this.gameMode&&(e.gameMode=!0);var n=this.gl=this.domElement.getContext("webgl",e);n.viewport(0,0,this.width,this.height),Tt.init(n),tt.init(n),et.init(n),dt.init(this),this.state=new mi(n),tt.instanced||(this.useInstanced=!1),this.renderList.useInstanced=this.useInstanced,tt.vao||(this.useVao=!1),this.useFramebuffer&&(this.framebuffer=new re(this,Object.assign({useVao:this.useVao,width:this.width,height:this.height},this.framebufferOption))),this.domElement.addEventListener("webglcontextlost",(function(e){t._onContextLost(e)}),!1),this.domElement.addEventListener("webglcontextrestored",(function(e){t._onContextRestore(e)}),!1)},_onContextLost:function(t){this.fire("webglContextLost");var e=this.gl;this._isContextLost=!0,t.preventDefault(),It.reset(e),dt.reset(e),qt.reset(e),xt.reset(e),Ft.reset(e),this.state.reset(e),this._lastMaterial=null,this._lastProgram=null},_onContextRestore:function(t){this.fire("webglContextRestored");var e=this.gl;this._isContextLost=!1,tt.reset(e),re.reset(e)},setupDepthTest:function(t){var e=this.state;t.depthTest?(e.enable(Ti),e.depthFunc(t.depthFunc),e.depthMask(t.depthMask),e.depthRange(t.depthRange[0],t.depthRange[1])):e.disable(Ti)},setupSampleAlphaToCoverage:function(t){var e=this.state;t.sampleAlphaToCoverage?e.enable(Mi):e.disable(Mi)},setupCullFace:function(t){var e=this.state;t.cullFace&&t.cullFaceType!==Ii?(e.enable(Ai),e.cullFace(t.cullFaceType)):e.disable(Ai)},setupBlend:function(t){var e=this.state;t.blend?(e.enable(Li),e.blendFuncSeparate(t.blendSrc,t.blendDst,t.blendSrcAlpha,t.blendDstAlpha),e.blendEquationSeparate(t.blendEquation,t.blendEquationAlpha)):e.disable(Li)},setupUniforms:function(t,e,n,i){var r=this.forceMaterial||e.material;for(var s in t.uniforms){var a=r.getUniformInfo(s),o=t.uniforms[s];if(!a.isBlankInfo&&(i||a.isDependMesh&&!n)){var u=a.get(e,r,o);null!=u&&(t[s]=u)}}},setupVao:function(t,e,n){var i=n.geometry,r=i.isStatic;if(t.isDirty||!r||i.isDirty){t.isDirty=!1;var s=this.forceMaterial||n.material,a=s.attributes,o=r?Si:Ri;for(var u in a){var c=e.attributes[u];if(c){var h=s.getAttributeData(u,n,c);null!=h&&t.addAttribute(h,c,o)}}i.indices&&t.addIndexBuffer(i.indices,o),i.isDirty=!1}i.vertexCount&&(t.vertexCount=i.vertexCount)},setupMaterial:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.forceMaterial||e.material;(r.isDirty||this._lastMaterial!==r)&&(this.setupDepthTest(r),this.setupSampleAlphaToCoverage(r),this.setupCullFace(r),this.setupBlend(r),i=!0),this.setupUniforms(t,e,n,i),r.isDirty=!1,this._lastMaterial=r},setupMesh:function(t,e){var n=this.gl,i=this.state,r=this.lightManager,s=this.resourceManager,a=t.geometry,o=this.forceMaterial||t.material,u=dt.getShader(t,o,e,r,this.fog,this.useLogDepth),c=It.getProgram(u,i);c.useProgram(),this.setupMaterial(c,t,e,this._lastProgram!==c),this._lastProgram=c,t.material.wireframe&&a.mode!==Oi&&a.convertToLinesMode();var h=a.id+c.id,f=Ft.getVao(n,h,{useInstanced:e,useVao:this.useVao,mode:a.mode});return this.setupVao(f,c,t),s.useResource(f,t).useResource(u,t).useResource(c,t),{vao:f,program:c,geometry:a}},addRenderInfo:function(t,e){var n=this.renderInfo;n.addFaceCount(t),n.addDrawCount(e)},render:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.initContext(),!this.isInitFailed&&!this._isContextLost){var i=this.renderList,r=this.renderInfo,s=this.lightManager,a=this.resourceManager,o=this.state;this.fog=t.fog,s.reset(),r.reset(),i.reset(),a.reset(),we.init(this,o,e,s,this.fog),t.updateMatrixWorld(),e.updateViewProjectionMatrix(),t.traverse((function(t){return t.visible?(t.isMesh?i.addMesh(t,e):t.isLight&&s.addLight(t),g.TRAVERSE_STOP_NONE):g.TRAVERSE_STOP_CHILDREN})),i.sort(),s.createShadowMap(this,e),s.updateInfo(e),n&&this.fire("beforeRender"),this.useFramebuffer&&this.framebuffer.bind(),this.clear(),n&&this.fire("beforeRenderScene"),this.renderScene(),this.useFramebuffer&&this.renderToScreen(this.framebuffer),n&&this.fire("afterRender"),a.destroyUnsuedResource()}},renderScene:function(){var t=this;this.renderList.traverse((function(e){t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e)})),this._gameModeSumbit()},_gameModeSumbit:function(){var t=this.gl;this.gameMode&&t&&t.submit&&t.submit()},clear:function(t){var e=this.gl,n=this.state;t=t||this.clearColor,n.depthMask(!0),this._lastMaterial=null,this._lastProgram=null,e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)},clearDepth:function(){var t=this.gl;this.state.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},renderToScreen:function(t){this.state.bindSystemFramebuffer(),t.render(0,0,1,1,this.clearColor)},renderMesh:function(t){var e=this.setupMesh(t,!1).vao;e.draw(),this.addRenderInfo(e.vertexCount/3,1)},renderInstancedMeshes:function(t){var e=t[0];if(e){var n=this.forceMaterial||e.material,i=this.setupMesh(e,!0),r=i.vao,s=i.program;n.getInstancedUniforms().forEach((function(e){var n=e.name,i=e.info,a=s.attributes[n];a&&r.addInstancedAttribute(a,t,(function(t){return i.get(t)}))})),r.drawInstance(t.length),this.addRenderInfo(r.vertexCount/3*t.length,1)}},renderMultipleMeshes:function(t){var e=this;t.forEach((function(t){e.renderMesh(t)}))},releaseGLResource:function(){var t=this.gl;t&&(It.reset(t),dt.reset(t),xt.reset(t),Ft.reset(t),this.state.reset(t),qt.reset(t),re.destroy(t))}}),xi=n(60),Ni=n.n(xi).a,bi=s.a.create({Extends:g,isStage:!0,className:"Stage",renderer:null,camera:null,pixelRatio:null,offsetX:0,offsetY:0,constructor:function(t){if(t.width||(t.width=window.innerWidth),t.height||(t.height=window.innerHeight),!t.pixelRatio){var e=window.devicePixelRatio||1;e=Math.min(e,1024/Math.max(t.width,t.height),2),e=Math.max(e,1),t.pixelRatio=e}bi.superclass.constructor.call(this,t),this.initRenderer(t),m.a.log("Hilo3d version: ".concat("1.13.47"))},initRenderer:function(t){var e=this.canvas=this.createCanvas(t);this.renderer=new yi(Object.assign(t,{domElement:e})),this.resize(this.width,this.height,this.pixelRatio,!0)},createCanvas:function(t){var e;return e=t.canvas?t.canvas:document.createElement("canvas"),t.container&&t.container.appendChild(e),e},resize:function(t,e,n,i){if(void 0===n&&(n=this.pixelRatio),i||this.width!==t||this.height!==e||this.pixelRatio!==n){this.width=t,this.height=e,this.pixelRatio=n,this.rendererWidth=t*n,this.rendererHeight=e*n;var r=this.canvas;this.renderer.resize(this.rendererWidth,this.rendererHeight,i),r.style.width=this.width+"px",r.style.height=this.height+"px",this.updateDomViewport()}return this},setOffset:function(t,e){if(this.offsetX!==t||this.offsetY!==e){this.offsetX=t,this.offsetY=e;var n=this.pixelRatio;this.renderer.setOffset(t*n,e*n)}return this},viewport:function(t,e,n,i){return this.resize(n,i,this.pixelRatio,!0),this.setOffset(t,e),this},tick:function(t){return this.traverseUpdate(t),this.camera&&this.renderer.render(this,this.camera,!0),this},enableDOMEvent:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.canvas,r=this._domListener||(this._domListener=function(t){e._onDOMEvent(t)});return(t="string"==typeof t?[t]:t).forEach((function(t){n?i.addEventListener(t,r,!1):i.removeEventListener(t,r)})),this},_onDOMEvent:function(t){var e=this.canvas,n=this._eventTarget,i=t.type,r=0===i.indexOf("touch"),s=t;if(r){var a=t.touches,o=t.changedTouches;a&&a.length?s=a[0]:o&&o.length&&(s=o[0])}var u=this.domViewport||this.updateDomViewport(),c=(s.pageX||s.clientX)-u.left,h=(s.pageY||s.clientY)-u.top;t.stageX=c,t.stageY=h,t.stopPropagation=function(){this._stopPropagationed=!0};var f=this.getMeshResultAtPoint(c,h,!0),l=f.mesh;t.hitPoint=f.point;var d="mouseout"===i;if(n&&(n!==l&&(!n.contains||!n.contains(l))||d)){var m=!1;if("touchmove"===i?m="touchout":"mousemove"!==i&&!d&&l||(m="mouseout"),m){var _=Object.assign({},t);_.type=m,_.eventTarget=n,n._fireMouseEvent(_)}t.lastEventTarget=n,this._eventTarget=null}if(l&&l.pointerEnabled&&"mouseout"!==i&&(t.eventTarget=this._eventTarget=l,l._fireMouseEvent(t)),!r){var p=l&&l.pointerEnabled&&l.useHandCursor?"pointer":"";e.style.cursor=p}Ni.android&&"touchmove"===i&&t.preventDefault()},updateDomViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.domViewport=Object(r.getElementRect)(t)),e},getMeshResultAtPoint:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.camera,r=this._ray;r||(r=this._ray=new ti.a),r.fromCamera(i,t,e,this.width,this.height);var s=this.raycast(r,!0,n);if(s)return s[0];this._stageResultAtPoint||(this._stageResultAtPoint={mesh:this,point:new c.a});var a=this._stageResultAtPoint.point;return a.copy(i.unprojectVector(a.set(t,e,0),this.width,this.height)),this._stageResultAtPoint},releaseGLResource:function(){return this.renderer.releaseGLResource(),this},destroy:function(){return this.releaseGLResource(),this.traverse((function(t){t.off(),t.parent=null})),this.children.length=0,this.renderer.off(),this}}),wi=bi,Ci=n(61),Pi=n.n(Ci),Hi=n(105),Di=n.n(Hi);Pi.a.Ease=Di.a;var Fi=Pi.a,Ui=s.a.create({Extends:Z,isBoxGeometry:!0,className:"BoxGeometry",width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1,constructor:function(t){Ui.superclass.constructor.call(this,t),this.isSegments()?this.buildWithSegments():this.build()},buildWithSegments:function(){var t=this.width,e=this.height,n=this.depth,i=this.widthSegments,r=this.heightSegments,s=this.depthSegments,a=r*s*6,o=i*s*6,u=i*r*6,c=2*((r+1)*(s+1)+(i+1)*(s+1)+(i+1)*(r+1)),h=new Float32Array(3*c),f=new Float32Array(3*c),l=new Float32Array(2*c),d=new Uint16Array(2*(a+o+u));this.vertices=new w(h,3),this.normals=new w(f,3),this.uvs=new w(l,2),this.indices=new w(d,1);var m=[0,0];this.buildPlane(m,2,1,0,-1,1,n,e,t/2,s,r),this.buildPlane(m,2,1,0,1,1,n,e,-t/2,s,r),this.buildPlane(m,0,2,1,1,-1,t,n,e/2,i,s),this.buildPlane(m,0,2,1,1,1,t,n,-e/2,i,s),this.buildPlane(m,0,1,2,1,1,t,e,n/2,i,r),this.buildPlane(m,0,1,2,-1,1,t,e,-n/2,i,r)},buildPlane:function(t,e,n,i,r,s,a,o,u,c,h){for(var f=a/c,l=o/h,d=a/2,m=o/2,_=t[0],p=t[1],g=this.vertices.data,v=this.normals.data,E=this.uvs.data,T=this.indices.data,M=0;M<=h;M++)for(var A=(M*l-m)*s,I=0;I<=c;I++){if(g[3*_+e]=(I*f-d)*r,g[3*_+n]=A,g[3*_+i]=u,v[3*_+e]=0,v[3*_+n]=0,v[3*_+i]=u<0?-1:1,E[2*_]=I/c,E[2*_+1]=1-M/h,I1||this.heightSegments>1||this.depthSegments>1},setFrontUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setFrontUV!"):this.setVertexUV(32,t)},setRightUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setRightUV!"):this.setVertexUV(0,t)},setBackUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBackUV!"):this.setVertexUV(40,t)},setLeftUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setLeftUV!"):this.setVertexUV(8,t)},setTopUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setTopUV!"):this.setVertexUV(16,t)},setBottomUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBottomUV!"):this.setVertexUV(24,t)},setAllRectUV:function(t){if(this.isSegments())return m.a.warn("segmented BoxGeometry dont support setAllRectUV!"),null;for(var e=0;e<6;e++)this.setVertexUV(8*e,t);return this},_raycast:function(t,e){return Ui.superclass._raycast.call(this,t,e)}}),Gi=Ui,Bi=C.a.FRONT,Vi=C.a.BACK,Xi=[0,0,1],ji=s.a.create({Extends:Z,isPlaneGeometry:!0,className:"PlaneGeometry",width:1,height:1,widthSegments:1,heightSegments:1,constructor:function(t){ji.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.widthSegments,e=this.heightSegments,n=(t+1)*(e+1),i=this.width/t,r=this.height/e,s=new Float32Array(3*n),a=new Float32Array(3*n),o=new Float32Array(2*n),u=new Uint16Array(t*e*6),c=0,h=0;h<=e;h++)for(var f=0;f<=t;f++){var l=h*(t+1)+f;if(s[3*l]=f*i-this.width/2,s[3*l+1]=this.height/2-h*r,a[3*l]=0,a[3*l+1]=0,a[3*l+2]=1,o[2*l]=f/t,o[2*l+1]=1-h/e,h0||n<0))return null;if(e===Vi&&(i<0||n>0))return null;var r=t.intersectsPlane(Xi,0);if(r){var s=r.x,a=r.y,o=.5*this.width,u=.5*this.height;if(s>=-o&&s<=o&&a>=-u&&a<=u)return[r]}return null}}),ki=ji,zi=s.a.create({Extends:Z,isSphereGeometry:!0,className:"SphereGeometry",radius:1,heightSegments:16,widthSegments:32,constructor:function(t){zi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.radius,e=this.heightSegments,n=this.widthSegments,i=(n+1)*(e+1),r=n*e,s=new Float32Array(3*i),a=new Float32Array(4*i),o=new Float32Array(2*i),u=new Uint16Array(6*r),c=0,h=0,f=0,l=0,d=0,m=2*Math.PI,_=Math.PI,p=0;p<=e;p++)for(var g=p/e,v=_*g,E=Math.cos(v)*t,T=Math.sin(v)*t,M=0;M<=n;M++){var A=M/n,I=m*A,L=Math.cos(I),O=Math.sin(I),S=L*T,R=O*T,y=O,x=-L;if(a[f++]=y,a[f++]=0,a[f++]=x,a[f++]=1,s[h++]=S,s[h++]=E,s[h++]=R,o[l++]=A,o[l++]=g,p>0&&M>0){var N=d,b=N-1,C=b-n-1,P=N-n-1;u[c++]=C,u[c++]=P,u[c++]=N,u[c++]=C,u[c++]=N,u[c++]=b}d++}this.vertices=new w(s,3),this.indices=new w(u,1),this.uvs=new w(o,2),this.tangents=new w(a,4),this.normals=new w(new Float32Array(s),3)},_raycast:function(t,e){return zi.superclass._raycast.call(this,t,e)}}),qi=zi,Wi=[dt,It,xt,Ft,qt],Yi=function(){var t="";Wi.forEach((function(e){t+="".concat(e.prototype.className,":").concat(Object.keys(e.cache._cache).length," ")})),m.a.log(t)},Zi=s.a.create({Mixes:a.a,isLoadCache:!0,className:"LoadCache",Statics:{PENDING:1,LOADED:2,FAILED:3},enabled:!0,constructor:function(){this._files={}},update:function(t,e,n){if(this.enabled){var i={key:t,state:e,data:n};this._files[t]=i,this.fire("update",i),this.fire("update:".concat(i.key),i)}},get:function(t){return this.enabled?this._files[t]:null},remove:function(t){delete this._files[t]},clear:function(){this._files={}},wait:function(t){var e=this;return t?t.state===Zi.LOADED?Promise.resolve(t.data):t.state===Zi.FAILED?Promise.reject():new Promise((function(n,i){e.on("update:".concat(t.key),(function(t){var e=t.detail;e.state===Zi.LOADED?n(e.data):e.state===Zi.FAILED&&i(e.data)}),!0)})):Promise.reject()}}),Ki=Zi,Qi=new Ki,Ji=s.a.create({Mixes:a.a,isBasicLoader:!0,className:"BasicLoader",Statics:{_cache:Qi,enalbeCache:function(){Qi.enabled=!0},disableCache:function(){Qi.enabled=!1},deleteCache:function(t){Qi.remove(t)},clearCache:function(){Qi.clear()},cache:{get:function(){return Qi},set:function(){m.a.warn("BasicLoader.cache is readonly!")}}},load:function(t){var e=t.src,n=t.type;if(!n){var i=Object(r.getExtension)(e);/^(?:png|jpe?g|gif|webp|bmp)$/i.test(i)&&(n="img"),n||(n=t.defaultType)}return"img"===n?this.loadImg(e,t.crossOrigin):this.loadRes(e,n)},isCrossOrigin:function(t){var e=window.location,n=document.createElement("a");return n.href=t,n.hostname!==e.hostname||n.port!==e.port||n.protocol!==e.protocol},isBase64:function(t){return/^data:(.+?);base64,/.test(t)},Uint8ArrayFrom:function(t,e){if(Uint8Array.from)return Uint8Array.from(t,e);for(var n=t.length,i=new Uint8Array(n),r=0;r=300)i(new TypeError("Network request failed for ".concat(s.status)));else{var e="response"in s?s.response:s.responseText;if("json"===t.type)try{e=JSON.parse(e)}catch(t){return void i(new TypeError("JSON.parse error"+t))}n(e)}},s.onprogress=function(n){e.fire("progress",{url:t.url,loaded:n.loaded,total:n.total})},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request timed out"))},s.open(t.method||"GET",t.url,!0),"include"===t.credentials&&(s.withCredentials=!0),"buffer"===t.type&&(s.responseType="arraybuffer"),Object(r.each)(t.headers,(function(t,e){s.setRequestHeader(e,t)})),s.send(t.body||null)}))}}),$i=s.a.create({isLoader:!0,className:"Loader",maxConnections:2,Statics:{_loaderClassMap:{},_loaders:{},addLoader:function(t,e){$i._loaderClassMap[t]=e},getLoader:function(t){if(!$i._loaders[t]){var e=$i._loaderClassMap[t]?$i._loaderClassMap[t]:Ji;$i._loaders[t]=new e}return $i._loaders[t]}},load:function(t){var e=this;if(t instanceof Array)return Promise.all(t.map((function(t){return e.load(t)})));var n=t.type||Object(r.getExtension)(t.src);return $i.getLoader(n).load(t)}}),tr=$i,er=s.a.create({Extends:Ji,isCubeTextureLoader:!0,className:"CubeTextureLoader",constructor:function(){er.superclass.constructor.call(this)},load:function(t){var e,n=this;return e=t.images&&Array.isArray(t.images)?t.images:[t.right,t.left,t.top,t.bottom,t.front,t.back],Promise.all(e.map((function(e){return n.loadImg(e,t.crossOrigin)}))).then((function(e){var n=Object.assign({},t);return delete n.images,delete n.type,delete n.right,delete n.left,delete n.top,delete n.bottom,delete n.front,delete n.back,n.image=e,new fe(n)})).catch((function(t){throw m.a.error("load CubeTexture failed",t.message,t.stack),t}))}});tr.addLoader("CubeTexture",er);var nr=er,ir=s.a.create({Extends:je,isPBRMaterial:!0,className:"PBRMaterial",lightType:"PBR",gammaCorrection:!0,usePhysicsLight:!0,baseColor:null,baseColorMap:null,metallic:1,metallicMap:null,roughness:1,roughnessMap:null,metallicRoughnessMap:null,occlusionMap:null,occlusionStrength:1,isOcclusionInMetallicRoughnessMap:!1,diffuseEnvMap:null,diffuseEnvSphereHarmonics3:null,diffuseEnvIntensity:1,brdfLUT:null,specularEnvIntensity:1,specularEnv:null,emission:null,isSpecularGlossiness:!1,specular:null,glossiness:1,specularGlossinessMap:null,usedUniformVectors:11,constructor:function(t){this.baseColor=new v.a(1,1,1),this.specular=new v.a(1,1,1),ir.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_baseColor:"BASECOLOR",u_metallic:"METALLIC",u_roughness:"ROUGHNESS",u_specular:"SPECULAR",u_glossiness:"GLOSSINESS",u_brdfLUT:"BRDFLUT",u_diffuseEnvMap:"DIFFUSEENVMAP",u_diffuseEnvIntensity:"DIFFUSEENVINTENSITY",u_occlusionStrength:"OCCLUSIONSTRENGTH",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvIntensity:"SPECULARENVINTENSITY",u_specularEnvMapMipCount:"SPECULARENVMAPMIPCOUNT",u_diffuseEnvSphereHarmonics3:"DIFFUSEENVSPHEREHARMONICS3"}),this.addTextureUniforms({u_baseColorMap:"BASECOLORMAP",u_metallicMap:"METALLICMAP",u_roughnessMap:"ROUGHNESSMAP",u_metallicRoughnessMap:"METALLICROUGHNESSMAP",u_occlusionMap:"OCCLUSIONMAP",u_specularGlossinessMap:"SPECULARGLOSSINESSMAP",u_lightMap:"LIGHTMAP"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ir.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t);return e.add(this.baseColorMap,"BASE_COLOR_MAP"),e.add(this.metallicMap,"METALLIC_MAP"),e.add(this.roughnessMap,"ROUGHNESS_MAP"),e.add(this.metallicRoughnessMap,"METALLIC_ROUGHNESS_MAP"),e.add(this.diffuseEnvMap,"DIFFUSE_ENV_MAP"),e.add(this.occlusionMap,"OCCLUSION_MAP"),e.add(this.lightMap,"LIGHT_MAP"),this.brdfLUT&&(e.add(this.specularEnvMap,"SPECULAR_ENV_MAP"),et.SHADER_TEXTURE_LOD&&this.specularEnvMap&&(t.USE_SHADER_TEXTURE_LOD=1)),this.isSpecularGlossiness&&(t.PBR_SPECULAR_GLOSSINESS=1,e.add(this.specularGlossinessMap,"SPECULAR_GLOSSINESS_MAP")),this.isOcclusionInMetallicRoughnessMap&&(t.IS_OCCLUSION_MAP_IN_METALLIC_ROUGHNESS_MAP=1),1!==this.occlusionStrength&&(t.OCCLUSION_STRENGTH=1),this.diffuseEnvSphereHarmonics3&&(t.HAS_NORMAL=1,t.DIFFUSE_ENV_SPHERE_HARMONICS3=1),(this.specularEnvMap||this.diffuseEnvSphereHarmonics3||this.specularEnvMap)&&(t.NEED_WORLD_NORMAL=1),e.update(),t}}),rr=ir,sr=new Image;sr.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var ar=s.a.create({Extends:qt,Mixes:a.a,isLazyTexture:!0,className:"LazyTexture",_src:"",crossOrigin:!1,autoLoad:!0,resType:"",src:{get:function(){return this._src},set:function(t){this._src!==t&&(this._src=t,this.autoLoad&&this.load())}},constructor:function(t){t&&("crossOrigin"in t&&(this.crossOrigin=t.crossOrigin),"autoLoad"in t&&(this.autoLoad=t.autoLoad)),ar.superclass.constructor.call(this,t),this.image=this.placeHolder||sr},load:function(t){var e=this;return ar.loader=ar.loader||new tr,ar.loader.load({src:this.src,crossOrigin:this.crossOrigin,type:this.resType,defaultType:"img"}).then((function(t){t.isTexture?(Object.assign(e,t),e.needUpdate=!0,e.needDestroy=!0,e.fire("load")):(e.image=t,e.needUpdate=!0,e.fire("load"))}),(function(n){if(e.fire("error"),t)throw new Error("LazyTexture Failed ".concat(n));m.a.warn("LazyTexture Failed ".concat(n))}))},_releaseImage:function(){this._src&&"string"!=typeof this._src&&(this._src=""),ar.superclass._releaseImage.call(this)}}),or=ar,ur=n(13);function cr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var hr=new l.a,fr=new l.a,lr=new l.a,dr=new l.a,mr=new l.a,_r=new l.a,pr=new ur.a,gr=[];function vr(t,e){return t-e}var Er=s.a.create({Statics:{interpolation:{LINEAR:function(t,e,n){if(void 0===e)return t;if(t.slerp)return t.slerp(e,n);if(t.lerp)return t.lerp(e,n);if(Object(r.isArrayLike)(t)){gr.length=0;for(var i=t.length-1;i>=0;i--)gr[i]=t[i]+n*(e[i]-t[i]);return gr}return t+n*(e-t)},STEP:function(t,e,n){return t},CUBICSPLINE:function(t,e,n,i){var s=t.length/3;if(void 0===e)return 1===s?t[1]:t.slice(s,-s);var a=t[1],o=t[2],u=e[1],c=e[0];if(s>1&&(a=t.slice(s,-s),o=t.slice(-s),u=e.slice(s,-s),c=e.slice(0,s)),a.hermite)a.hermite(a,o.scale(i),u,c.scale(i),n);else if(a.sqlerp)a.sqlerp(a,o.scale(i),u,c.scale(i),n);else{Object(r.isArrayLike)(a)||(a=[a],o=[o],u=[u],c=[c]);var h=n*n,f=h*n,l=2*f-3*h+1,d=f-2*h+n,m=-2*f+3*h,_=f-h;gr.length=0;for(var p=a.length-1;p>=0;p--)gr[p]=a[p]*l+d*o[p]*i+u[p]*m+_*c[p]*i;a=gr}return a}},StateType:{TRANSLATE:"Translation",POSITION:"Translation",TRANSLATION:"Translation",SCALE:"Scale",ROTATE:"Rotation",ROTATION:"Rotation",QUATERNION:"Quaternion",WEIGHTS:"Weights"},getType:function(t){return t=String(t).toUpperCase(),Er.StateType[t]}},isAnimationStates:!0,className:"AnimationStates",nodeName:"",type:"",interpolationType:"LINEAR",constructor:function(t){this.id=d.a.generateUUID(this.className),this.keyTime=[],this.states=[],Object.assign(this,t)},findIndexByTime:function(t){return Object(r.getIndexFromSortedArray)(this.keyTime,t,vr)},getStateByIndex:function(t){var e=this.states.length/this.keyTime.length;return 1===e?this.states[t]:this.states.slice(t*e,t*e+e)},getState:function(t){var e=cr(this.findIndexByTime(t),2),n=e[0],i=e[1];if(n<0||i>=this.keyTime.length)return null;var s=this.keyTime[n],a=this.keyTime[i],o=this.getStateByIndex(n);if(n===i){var u=this.interpolation(o);return this.type===Er.StateType.ROTATION&&(u=hr.fromEuler(pr.fromArray(u))),u.elements||u}var c=this.getStateByIndex(i),h=a-s,f=(t-s)/h;this.type===Er.StateType.ROTATION?Object(r.isArrayLike)(o[0])?(o[0]=hr.fromEuler(pr.fromArray(o[0])),o[1]=fr.fromEuler(pr.fromArray(o[1])),o[2]=lr.fromEuler(pr.fromArray(o[2])),c[0]=dr.fromEuler(pr.fromArray(c[0])),c[1]=mr.fromEuler(pr.fromArray(c[1])),c[2]=_r.fromEuler(pr.fromArray(c[2]))):(o=hr.fromEuler(pr.fromArray(o)),c=fr.fromEuler(pr.fromArray(c))):this.type===Er.StateType.QUATERNION&&(Object(r.isArrayLike)(o[0])?(o[0]=hr.fromArray(o[0]),o[1]=fr.fromArray(o[1]),o[2]=lr.fromArray(o[2]),c[0]=dr.fromArray(c[0]),c[1]=mr.fromArray(c[1]),c[2]=_r.fromArray(c[2])):(o=hr.fromArray(o),c=fr.fromArray(c)));var l=this.interpolation(o,c,f,h);return l.elements||l},interpolation:function(t,e,n,i){return Er.interpolation[this.interpolationType](t,e,n,i)},updateNodeTranslation:function(t,e){t.x=e[0],t.y=e[1],t.z=e[2]},updateNodeScale:function(t,e){t.scaleX=e[0],t.scaleY=e[1],t.scaleZ=e[2]},updateNodeQuaternion:function(t,e){t.quaternion.fromArray(e)},updateNodeWeights:function(t,e){var n=this._originalWeightIndices=this._originalWeightIndices||[],i=e.length;e=e.slice();for(var r=0;re[s]){var o=e[s];e[s]=e[a],e[a]=o,o=n[s],n[s]=n[a],n[a]=o}t.traverse((function(t){t.isMesh&&t.geometry&&t.geometry.isMorphGeometry&&t.geometry.update(e,n)}))},updateNodeState:function(t,e){if(e){var n=this.type;n===Er.StateType.ROTATION&&(n=Er.StateType.QUATERNION);var i=this.getState(t);i&&this["updateNode".concat(n)](e,i)}},clone:function(){return new this.constructor({keyTime:this.keyTime,states:this.states,type:this.type,nodeName:this.nodeName})}}),Tr=Er,Mr=s.a.create({Statics:{_anims:[],tick:function(t){this._anims.forEach((function(e){return e.tick(t)}))}},Mixes:a.a,isAnimation:!0,className:"Animation",paused:!1,currentLoopCount:0,loop:1/0,currentTime:0,timeScale:1,startTime:0,endTime:0,clipStartTime:0,clipEndTime:0,nodeNameMap:null,_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initNodeNameMap()}},validAnimationIds:null,constructor:function(t){this.id=d.a.generateUUID(this.className),this.animStatesList=[],this.clips={},Object.assign(this,t),this.initClipTime()},addClip:function(t,e,n,i){this.clips[t]={start:e,end:n,animStatesList:i}},removeClip:function(t){this.clips[t]=null},getAnimStatesListTimeInfo:function(t){var e=0,n=1/0;return t.forEach((function(t){e=Math.max(t.keyTime[t.keyTime.length-1],e),n=Math.min(t.keyTime[0],n)})),{startTime:n,endTime:e}},initClipTime:function(){var t=this.getAnimStatesListTimeInfo(this.animStatesList);this.clipStartTime=t.startTime,this.clipEndTime=t.endTime},initNodeNameMap:function(){if(this._rootNode){var t=this.nodeNameMap={};this._rootNode.traverse((function(e){t[e.animationId]=e;var n=e.name;void 0===n||t[n]||(t[n]=e)}),!1)}},tick:function(t){this.paused||(this.currentTime+=t/1e3*this.timeScale,this.currentTime>=this.endTime?(this.currentLoopCount++,this.currentTime=this.endTime,this.updateAnimStates(),this.fire("loopEnd"),!this.loop||this.currentLoopCount>=this.loop?(this.stop(),this.fire("end")):this.currentTime=this.startTime):this.updateAnimStates())},updateAnimStates:function(){var t=this;return this.animStatesList.forEach((function(e){e.updateNodeState(t.currentTime,t.nodeNameMap[e.nodeName])})),this},play:function(t,e){var n;if("string"==typeof t){var i=this.clips[t];i?(n=i.start,e=i.end,i.animStatesList&&(this.animStatesList=i.animStatesList,this.initClipTime())):m.a.warn("no this animation clip name:"+t)}else n=t;void 0===n&&(n=this.clipStartTime),void 0===e&&(e=this.clipEndTime),this.endTime=Math.min(e,this.clipEndTime),this.startTime=Math.min(n,this.endTime),this.currentTime=this.startTime,this.currentLoopCount=0,this.stop(),this.paused=!1,Mr._anims.push(this)},stop:function(){this.paused=!0;var t=Mr._anims,e=t.indexOf(this);-1!==e&&t.splice(e,1)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},clone:function(t){var e=new this.constructor({rootNode:t,animStatesList:this.animStatesList,timeScale:this.timeScale,loop:this.loop,paused:this.paused,currentTime:this.currentTime,startTime:this.startTime,endTime:this.endTime,clips:this.clips});return this.paused||e.play(),e}}),Ar=Mr;function Ir(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Lr=C.a.BLEND,Or=C.a.DEPTH_TEST,Sr=C.a.CULL_FACE,Rr=C.a.FRONT,yr=C.a.BACK,xr=C.a.FRONT_AND_BACK,Nr={5120:[1,Int8Array],5121:[1,Uint8Array],5122:[2,Int16Array],5123:[2,Uint16Array],5125:[4,Uint32Array],5126:[4,Float32Array]},br={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},wr={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},Cr=s.a.create({isGLTFParser:!0,className:"GLTFParser",Statics:{MAGIC:"glTF",extensionHandlers:i,registerExtensionHandler:function(t,e){this.extensionHandlers[t]=e},unregisterExtensionHandler:function(t){this.extensionHandlers[t]&&delete this.extensionHandlers[t]}},isMultiAnim:!0,isProgressive:!1,isUnQuantizeInShader:!0,isLoadAllTextures:!1,preHandlerImageURI:null,preHandlerBufferURI:null,customMaterialCreator:null,ignoreTextureError:!1,forceCreateNewBuffer:!1,src:"",constructor:function(t,e){Object.assign(this,e),this.content=t},parse:function(t){var e=this;if(this.content instanceof ArrayBuffer){var n=this.content;if(r.convertUint8ArrayToString(new Uint8Array(n,0,4))===Cr.MAGIC)this.parseBinary(n);else{var i=r.convertUint8ArrayToString(new Uint8Array(n),!0);this.json=JSON.parse(i)}}else this.json=JSON.parse(this.content);return this.glTFVersion=parseFloat(this.json.asset.version),this.glTFVersion>=2&&(this.isGLTF2=!0),this.parseExtensionUsed(),this.loadResources(t).then((function(){return e.parseExtensions(e.json.extensions,null,{isGlobal:!0,methodName:"parseOnLoad"}),Promise.resolve()})).then((function(){return e.parseGeometries()})).then((function(){return e.parseScene()}))},parseExtensionUsed:function(){var t=this;this.extensionsUsed={},r.each(this.json.extensionsUsed,(function(e){t.extensionsUsed[e]=!0})),this.extensionsUsed.WEB3D_quantized_attributes||(this.isUnQuantizeInShader=!1)},getExtensionHandler:function(t){return this.extensionHandlers&&this.extensionHandlers[t]||Cr.extensionHandlers[t]},parseExtension:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=t[e],s=this.getExtensionHandler(e);return s&&s.parse?s.parse(r,this,n,i):n},parseExtensions:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.each(t,(function(t,r){if(!i.ignoreExtensions||!i.ignoreExtensions[r]){var s=n.getExtensionHandler(r),a=i.methodName||"parse";s&&s[a]&&(e=s[a](t,n,e,i))}})),e},isUseExtension:function(t,e){return!!(t&&t.extensions&&t.extensions[e])},parseBinary:function(t){this.isBinary=!0;var e,n=new DataView(t),i=n.getUint32(4,!0),s=n.getUint32(8,!0),a=12;if(i<2){var o=n.getUint32(a,!0);e=new Uint8Array(t,20,o),e=r.convertUint8ArrayToString(e,!0),this.json=JSON.parse(e),this.binaryBody=t.slice(20+o)}else{if(2!==i)throw new Error("Dont support glTF version ".concat(i));for(;as*r.BYTES_PER_ELEMENT)a.array=new r(a.buffer,a.byteOffset,a.byteLength/r.BYTES_PER_ELEMENT),i=new w(a.array,s,{offset:n.byteOffset||0,stride:a.byteStride,bufferViewId:a.id});else{var u,c=(n.byteOffset||0)+a.byteOffset;if(c%r.BYTES_PER_ELEMENT||this.forceCreateNewBuffer)u=new r(a.buffer.slice(c,c+o*r.BYTES_PER_ELEMENT));else u=new r(a.buffer,c,o);i=new w(u,s)}return n.sparse&&(i||(i=new w(new r(o),s)),i=this.sparseAccessorHandler(i,n.sparse)),i=this.parseExtensions(n.extensions,i,{isDecode:e,isAccessor:!0}),n.data=i,n.normalized&&(i.normalized=!0),i},getArrayByAccessor:function(t,e){var n=this.json.accessors[t];if(n.array)return n.array;var i=this.getAccessorData(t,e);if(!i.stride&&!i.offset&&1===i.size)return i.data;var r=[];return i.traverse((function(t){r.push(t.toArray?t.toArray():t)})),n.array=r,r},parseTechnique:function(t,e){var n=null;this.json.techniques&&(n=this.json.techniques[t.technique]),n&&n.states&&(n.states.enable.forEach((function(t){switch(t){case Lr:e.blend=!0;break;case Or:e.depthTest=!0;break;case Sr:e.cullFace=!0}})),r.each(n.states.functions,(function(t,n){switch(n){case"blendEquationSeparate":e.blendEquation=t[0],e.blendEquationAlpha=t[1];break;case"blendFuncSeparate":e.blendSrc=t[0],e.blendDst=t[1],e.blendSrcAlpha=t[2],e.blendDstAlpha=t[3];break;case"depthMask":e.depthMask=t[0];break;case"cullFace":e.cullFaceType=t[0];break;default:e[n]=t}})),e.cullFace?e.side=e.cullFaceType===Rr?yr:Rr:e.side=xr)},createMorphGeometry:function(t,e){var n=this,i=new Gn,s=i.targets={};return r.each(t.targets,(function(t){r.each(t,(function(t,e){var i=wr[e].name;s[i]||(s[i]=[]);var r=n.getAccessorData(t,!0);s[i].push(r)}))})),i.weights=e||new Float32Array(t.targets.length),i},handlerGeometry:function(t,e){var n=void 0===e.mode?4:e.mode;if(e.extensions){var i=this.parseExtensions(e.extensions,null,{primitive:e,isPrimitive:!0});if(i)return i.mode=n,i}t||(t=new Z({mode:n})),"indices"in e&&(t.indices=this.getAccessorData(e.indices));var r=e.attributes;for(var s in r){var a=wr[s];if(a){var o=!(this.isUnQuantizeInShader&&a.decodeMatName);t[a.name]=this.getAccessorData(r[s],o),o||(t[a.decodeMatName]=t[a.name].decodeMat,delete t[a.name].decodeMat)}else m.a.warn("Unknow attribute named ".concat(s,"!"))}return t},handlerSkinedMesh:function(t,e){if(e){var n,i=(e.jointNames||e.joints).length;e.bindShapeMatrix&&(n=(new o.a).fromArray(e.bindShapeMatrix));for(var r=this.getArrayByAccessor(e.inverseBindMatrices,!0),s=0;s0&&(i=Object.values(n)[0].animStatesList),i.length?new Ar({rootNode:this.node,animStatesList:i,validAnimationIds:s,clips:n}):null},parseScene:function(){var t=this;this.parseMaterials(),this.jointMap={},this.meshes=[],this.lights=[],this.node=new g({needCallChildUpdate:!1}),this.parseCameras();var e=this.json.scenes[this.getDefaultSceneName()];if(!e)return m.a.warn("GLTFParser:no scene!"),{node:this.node,meshes:[],cameras:[],lights:[],textures:[],materials:[]};e.nodes.forEach((function(e){return t.parseNode(e,t.node)})),this.node.resetSkinedMeshRootNode();var n={node:this.node,scene:this.node,meshes:this.meshes,json:this.json,cameras:Object.values(this.cameras),lights:this.lights,textures:Object.values(this.textures),materials:Object.values(this.materials)},i=this.parseAnimations();return i&&(this.node.setAnim(i),i.play(),n.anim=i),this.parseExtensions(e.extensions,null,{isScene:!0}),this.parseExtensions(this.json.extensions,n,{isGlobal:!0,methodName:"parseOnEnd"}),n},getDefaultSceneName:function(){return void 0!==this.defaultScene?this.defaultScene:this.json.scenes?Object.keys(this.json.scenes)[0]:null}}),Pr=Cr,Hr=s.a.create({Extends:Ji,isGLTFLoader:!0,className:"GLTFLoader",constructor:function(){Hr.superclass.constructor.call(this)},load:function(t){var e=this;return this.loadRes(t.src,"buffer").then((function(n){return new Pr(n,t).parse(e)})).catch((function(t){throw m.a.error("load gltf failed",t.message,t.stack),t}))}});tr.addLoader("gltf",Hr),tr.addLoader("glb",Hr);var Dr=Hr,Fr=n(106),Ur=n.n(Fr),Gr=C.a.RGBA,Br=C.a.NEAREST,Vr=C.a.CLAMP_TO_EDGE,Xr=C.a.FLOAT,jr=s.a.create({Extends:Ji,isHDRLoader:!0,className:"HDRLoader",constructor:function(){jr.superclass.constructor.call(this)},load:function(t){return this.loadRes(t.src,"buffer").then((function(e){try{var n=Ur()(e),i=n.shape,r=n.data,s=new qt({width:i[0],height:i[1],flipY:t.flipY||!1,image:r,type:Xr,magFilter:Br,minFilter:Br,wrapS:Vr,wrapT:Vr,internalFormat:Gr,format:Gr});return Object.assign(s,t),s}catch(t){m.a.error("HDRLoader:parse error => ",t)}return null}))}});tr.addLoader("hdr",jr);var kr=jr,zr=s.a.create({Statics:{HEADER_LEN:64,COMPRESSED_2D:0,COMPRESSED_3D:1,TEX_2D:2,TEX_3D:3},isKhronosTextureContainer:!0,className:"KhronosTextureContainer",constructor:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.arrayBuffer=t,this.baseOffset=n;var i=new Uint8Array(this.arrayBuffer,this.baseOffset,12);if(171===i[0]&&75===i[1]&&84===i[2]&&88===i[3]&&32===i[4]&&49===i[5]&&49===i[6]&&187===i[7]&&13===i[8]&&10===i[9]&&26===i[10]&&10===i[11]){var r=Uint32Array.BYTES_PER_ELEMENT,s=new DataView(this.arrayBuffer,this.baseOffset+12,13*r),a=s.getUint32(0,!0),o=67305985===a;this.glType=s.getUint32(1*r,o),this.glTypeSize=s.getUint32(2*r,o),this.glFormat=s.getUint32(3*r,o),this.glInternalFormat=s.getUint32(4*r,o),this.glBaseInternalFormat=s.getUint32(5*r,o),this.pixelWidth=s.getUint32(6*r,o),this.pixelHeight=s.getUint32(7*r,o),this.pixelDepth=s.getUint32(8*r,o),this.numberOfArrayElements=s.getUint32(9*r,o),this.numberOfFaces=s.getUint32(10*r,o),this.numberOfMipmapLevels=s.getUint32(11*r,o),this.bytesOfKeyValueData=s.getUint32(12*r,o),this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?0===this.glType?this.loadType=zr.COMPRESSED_2D:this.loadType=zr.TEX_2D:m.a.warn("number of faces expected"+e+", but found "+this.numberOfFaces):m.a.warn("texture arrays not currently supported"):m.a.warn("only 2D textures currently supported")}else m.a.error("texture missing KTX identifier")},mipmaps:function(t){for(var e=[],n=zr.HEADER_LEN+this.bytesOfKeyValueData,i=this.pixelWidth,r=this.pixelHeight,s=t?this.numberOfMipmapLevels:1,a=0;a2&&void 0!==arguments[2]?arguments[2]:0,i=new zr(e,1,n),r={compressed:0===i.glType,type:i.glType,width:i.pixelWidth,height:i.pixelHeight,internalFormat:i.glInternalFormat,format:i.glFormat,isCubemap:6===i.numberOfFaces};return i.numberOfMipmapLevels>=Math.floor(Math.log2(Math.max(r.width,r.height))+1)?(r.mipmaps=i.mipmaps(!0),r.image=r.mipmaps[0].data):(r.mipmaps=null,r.image=i.mipmaps(!1)[0].data),new qt(r)}});tr.addLoader("ktx",qr);var Wr=qr,Yr=s.a.create({Mixes:a.a,isLoadQueue:!0,className:"LoadQueue",Statics:{addLoader:function(t,e){m.a.warn("LoadQueue.addLoader is duplicated, please use Loader.addLoader"),tr.addLoader(t,e)}},constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){return t&&(t=Array.isArray(t)?t:[t],this._source=this._source.concat(t)),this},get:function(t){if(!t)return null;for(var e=this._source,n=0;n=n)this.fire("complete");else if(this._currentIndex2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=this.renderer.pixelRatio,s=[],a=this.framebuffer.readPixels(t*r,e*r,n*r,i*r),o=0;o0;){if(d(c)128){if(0==(u=(255&f[0])-128)||u>o-a)throw new Error("Bad scanline data");for(;u-- >0;)h[a++]=f[1]}else{if(0==(u=255&f[0])||u>o-a)throw new Error("Bad scanline data");if(h[a++]=f[1],--u>0){if(m(h,a,u)=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var i=n.slice(0),r=0,s=i.length;r=0&&e.splice(n,1)},nextTick:function(t){var e=this,n={tick:function(i){e.removeTick(n),t()}};return e.addTick(n),n},timeout:function(t,e){var n=this,i=(new Date).getTime()+e,r={tick:function(){(new Date).getTime()-i>=0&&(n.removeTick(r),t())}};return n.addTick(r),r},interval:function(t,e){var n=(new Date).getTime()+e,i={tick:function(){var i=(new Date).getTime(),r=i-n;r>=0&&(r=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(111),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(39))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,s,a,o,u=1,c={},h=!1,f=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){m(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((s=new MessageChannel).port1.onmessage=function(t){m(t.data)},i=function(t){s.port2.postMessage(t)}):f&&"onreadystatechange"in f.createElement("script")?(r=f.documentElement,i=function(t){var e=f.createElement("script");e.onreadystatechange=function(){m(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(m,0,t)}:(a="setImmediate$"+Math.random()+"$",o=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(a)&&m(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",o,!1):t.attachEvent("onmessage",o),i=function(e){t.postMessage(a+e,"*")}),l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n1)for(var n=1;n 0.0 ? v : (0.5 * inversesqrt(max(1.0 - (x * x), 1e-7))) - v;\n return cross(v1, v2) * theta_sintheta;\n}\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 vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if (dot(lightNormal, P - rectCoords[0]) < 0.0)\n return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - (N * dot(V, N)));\n T2 = -cross(N, T1);\n mat3 mat = mInv * transpose(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n\nvec3 getAreaLight(const in vec3 diffuseColor, const in vec3 specularColor, const in float roughness, const in vec3 normal, const in vec3 viewDir, const in vec3 position, const in vec3 lightPos, const in vec3 lightColor, const in vec3 halfWidth, const in vec3 halfHeight, const in sampler2D areaLightsLtcTexture1, const in sampler2D areaLightsLtcTexture2){\n vec3 rectCoords[4];\n rectCoords[0] = (lightPos - halfWidth) - halfHeight;\n rectCoords[1] = (lightPos + halfWidth) - halfHeight;\n rectCoords[2] = (lightPos + halfWidth) + halfHeight;\n rectCoords[3] = (lightPos - halfWidth) + halfHeight;\n \n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(areaLightsLtcTexture1, uv);\n vec4 t2 = texture2D(areaLightsLtcTexture2, uv);\n\n mat3 mInv = mat3(vec3(t1.x, 0, t1.y), vec3(0, 1, 0), vec3(t1.z, 0, t1.w));\n vec3 fresnel = (specularColor * t2.x) + ((vec3(1.0) - specularColor) * t2.y);\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += ((lightColor * fresnel) * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords));\n color += ((lightColor * diffuseColor) * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords));\n return color;\n}\n\n"},function(t,e,n){"use strict";n.r(e),n.d(e,"util",(function(){return r})),n.d(e,"GLTFExtensions",(function(){return i})),n.d(e,"Class",(function(){return s.a})),n.d(e,"EventMixin",(function(){return a.a})),n.d(e,"Fog",(function(){return ti})),n.d(e,"Mesh",(function(){return si})),n.d(e,"Node",(function(){return g})),n.d(e,"SkinedMesh",(function(){return ci})),n.d(e,"Stage",(function(){return Pi})),n.d(e,"Tween",(function(){return Gi})),n.d(e,"version",(function(){return hi})),n.d(e,"BoxGeometry",(function(){return Vi})),n.d(e,"Geometry",(function(){return Z})),n.d(e,"GeometryData",(function(){return w})),n.d(e,"MorphGeometry",(function(){return Bn})),n.d(e,"PlaneGeometry",(function(){return qi})),n.d(e,"SphereGeometry",(function(){return Yi})),n.d(e,"Camera",(function(){return O})),n.d(e,"PerspectiveCamera",(function(){return Q})),n.d(e,"OrthographicCamera",(function(){return en})),n.d(e,"Buffer",(function(){return xt})),n.d(e,"capabilities",(function(){return et})),n.d(e,"extensions",(function(){return tt})),n.d(e,"Framebuffer",(function(){return re})),n.d(e,"glType",(function(){return Tt})),n.d(e,"logGLResource",(function(){return Ki})),n.d(e,"Program",(function(){return It})),n.d(e,"RenderInfo",(function(){return fi})),n.d(e,"RenderList",(function(){return _i})),n.d(e,"VertexArrayObject",(function(){return Ft})),n.d(e,"WebGLRenderer",(function(){return Ni})),n.d(e,"WebGLResourceManager",(function(){return gi})),n.d(e,"WebGLState",(function(){return pi})),n.d(e,"BasicLoader",(function(){return tr})),n.d(e,"CubeTextureLoader",(function(){return rr})),n.d(e,"GLTFLoader",(function(){return Br})),n.d(e,"GLTFParser",(function(){return Ur})),n.d(e,"AliAMCExtension",(function(){return kn})),n.d(e,"HDRLoader",(function(){return Yr})),n.d(e,"KTXLoader",(function(){return Qr})),n.d(e,"LoadCache",(function(){return Ji})),n.d(e,"LoadQueue",(function(){return Jr})),n.d(e,"ShaderMaterialLoader",(function(){return ts})),n.d(e,"TextureLoader",(function(){return ns})),n.d(e,"Loader",(function(){return nr})),n.d(e,"Texture",(function(){return qt})),n.d(e,"LazyTexture",(function(){return cr})),n.d(e,"CubeTexture",(function(){return fe})),n.d(e,"DataTexture",(function(){return ve})),n.d(e,"Shader",(function(){return dt})),n.d(e,"BasicMaterial",(function(){return qe})),n.d(e,"GeometryMaterial",(function(){return $e})),n.d(e,"Material",(function(){return ke})),n.d(e,"PBRMaterial",(function(){return ar})),n.d(e,"semantic",(function(){return Ce})),n.d(e,"ShaderMaterial",(function(){return Dn})),n.d(e,"AxisHelper",(function(){return as})),n.d(e,"AxisNetHelper",(function(){return cs})),n.d(e,"CameraHelper",(function(){return ds})),n.d(e,"AmbientLight",(function(){return _s})),n.d(e,"AreaLight",(function(){return gs})),n.d(e,"DirectionalLight",(function(){return Nn})),n.d(e,"CubeLightShadow",(function(){return Ln})),n.d(e,"Light",(function(){return M})),n.d(e,"LightManager",(function(){return Mi})),n.d(e,"LightShadow",(function(){return cn})),n.d(e,"PointLight",(function(){return Sn})),n.d(e,"SpotLight",(function(){return Pn})),n.d(e,"Animation",(function(){return Or})),n.d(e,"AnimationStates",(function(){return Ir})),n.d(e,"MeshPicker",(function(){return Ms})),n.d(e,"Ticker",(function(){return Is})),n.d(e,"log",(function(){return m.a})),n.d(e,"Cache",(function(){return J})),n.d(e,"browser",(function(){return wi})),n.d(e,"WebGLSupport",(function(){return Ls})),n.d(e,"constants",(function(){return C.a})),n.d(e,"Color",(function(){return Os.Color})),n.d(e,"Euler",(function(){return Os.Euler})),n.d(e,"EulerNotifier",(function(){return Os.EulerNotifier})),n.d(e,"Frustum",(function(){return Os.Frustum})),n.d(e,"math",(function(){return Os.math})),n.d(e,"Matrix3",(function(){return Os.Matrix3})),n.d(e,"Matrix4",(function(){return Os.Matrix4})),n.d(e,"Matrix4Notifier",(function(){return Os.Matrix4Notifier})),n.d(e,"Plane",(function(){return Os.Plane})),n.d(e,"Quaternion",(function(){return Os.Quaternion})),n.d(e,"Ray",(function(){return Os.Ray})),n.d(e,"Sphere",(function(){return Os.Sphere})),n.d(e,"SphericalHarmonics3",(function(){return Os.SphericalHarmonics3})),n.d(e,"Vector2",(function(){return Os.Vector2})),n.d(e,"Vector3",(function(){return Os.Vector3})),n.d(e,"Vector3Notifier",(function(){return Os.Vector3Notifier})),n.d(e,"Vector4",(function(){return Os.Vector4}));var i={};n.r(i),n.d(i,"ALI_amc_mesh_compression",(function(){return kn})),n.d(i,"WEB3D_quantized_attributes",(function(){return qn})),n.d(i,"HILO_animation_clips",(function(){return Wn})),n.d(i,"ALI_animation_clips",(function(){return Yn})),n.d(i,"ALI_bounding_box",(function(){return Zn})),n.d(i,"KHR_materials_pbrSpecularGlossiness",(function(){return Kn})),n.d(i,"KHR_lights_punctual",(function(){return Qn})),n.d(i,"KHR_techniques_webgl",(function(){return Jn}));var r=n(4),s=n(1),a=n(9),o=n(7),u=n(22),c=n(5),h=n(17),f=n(23),l=n(10),d=n(6),m=n(3),_=new c.a(0,1,0),p=new o.a,g=s.a.create({Statics:{TRAVERSE_STOP_NONE:!1,TRAVERSE_STOP_CHILDREN:1,TRAVERSE_STOP_ALL:!0},Mixes:a.a,isNode:!0,className:"Node",name:"",animationId:"",autoUpdateWorldMatrix:!0,autoUpdateChildWorldMatrix:!0,parent:null,_quatDirty:!1,_matrixDirty:!1,needCallChildUpdate:!0,visible:!0,pointerEnabled:!0,pointerChildren:!0,useHandCursor:!1,__forceUseParentWorldMatrix:!1,constructor:function(t){var e=this;this.id=d.a.generateUUID(this.className),this.up=_.clone(),this.children=[],this.worldMatrix=new o.a,this._matrix=new u.a,this._position=new h.a(0,0,0),this._scale=new h.a(1,1,1),this._pivot=new h.a(0,0,0),this._rotation=new f.a,this._quaternion=new l.a,this._matrix.on("update",(function(){e._onMatrixUpdate()})),this._position.on("update",(function(){e._onPositionUpdate()})),this._scale.on("update",(function(){e._onScaleUpdate()})),this._pivot.on("update",(function(){e._onPivotUpdate()})),this._rotation.on("update",(function(){e._onRotationUpdate()})),this._quaternion.on("update",(function(){e._onQuaternionUpdate()})),Object.assign(this,t)},clone:function(t){var e=new this.constructor;return e.name=this.name,e.jointName=this.jointName,e.animationId=this.animationId,e.setPosition(this.x,this.y,this.z),e.setScale(this.scaleX,this.scaleY,this.scaleZ),e.setRotation(this.rotationX,this.rotationY,this.rotationZ),this.children.forEach((function(t){e.addChild(t.clone(!0))})),t||(this.anim&&(e.anim=this.anim.clone(e)),e.resetSkinedMeshRootNode()),e},setAnim:function(t){return this.anim=t,t.rootNode=this,this},resetSkinedMeshRootNode:function(){var t=this;this.traverse((function(e){e.isSkinedMesh&&e.jointNames&&(e.rootNode=t)}),!0)},getChildrenNameMap:function(){var t={};return this.traverse((function(e){t[e.name]=e;var n=e._originName;void 0===n||t[n]||(t[n]=e)}),!0),t},addChild:function(t){return t.parent&&t.removeFromParent(),t.parent=this,this.children.push(t),this},removeChild:function(t){var e=this.children.indexOf(t);return e>-1&&(this.children.splice(e,1),t.parent=null),this},addTo:function(t){return t.addChild(this),this},removeFromParent:function(){return this.parent&&this.parent.removeChild(this),this},updateMatrix:function(){return this._matrixDirty&&(this._matrixDirty=!1,this.matrixVersion++,this._matrix.fromRotationTranslationScaleOrigin(this.quaternion,this._position,this._scale,this._pivot,!0)),this},updateQuaternion:function(){return this._quatDirty&&(this._quatDirty=!1,this._quaternion.fromEuler(this._rotation,!0)),this},updateTransform:function(){return this._matrix.decompose(this._quaternion,this._position,this._scale,this._pivot),this._onQuaternionUpdate(),this._matrixDirty=!1,this},updateMatrixWorld:function(t){return this.traverse((function(e){return(e.autoUpdateWorldMatrix||t)&&(e.parent?e.__forceUseParentWorldMatrix?e.worldMatrix.copy(e.parent.worldMatrix):e.worldMatrix.multiply(e.parent.worldMatrix,e.matrix):e.worldMatrix.copy(e.matrix)),!e.autoUpdateChildWorldMatrix&&!t&&1})),this},getConcatenatedMatrix:function(t){for(var e=new o.a,n=this;n&&n!==t;n=n.parent)e.multiply(n.matrix,e);return e},_traverse:function(t,e){if(!e){var n=t(this);if(n)return n}for(var i=this.children,r=0,s=i.length;r1&&void 0!==arguments[1]&&arguments[1];return this._traverse(t,e),this},traverseBFS:function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(n=i?this.children:[this];n.length;){e=n,n=[];for(var r=0,s=e.length;r1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return this._scale.set(t,e,n),this},setPosition:function(t,e,n){return this._position.set(t,e,n),this},setRotation:function(t,e,n){return this._rotation.setDegree(t,e,n),this},setPivot:function(t,e,n){return this._pivot.set(t,e,n),this},lookAt:function(t){return this.isCamera?p.targetTo(this,t,this.up):p.targetTo(t,this,this.up),this._quaternion.fromMat4(p),this},raycast:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.visible)return null;var r=[];return this.traverse((function(n){if(i&&!n.pointerEnabled)return 1;if(n.isMesh){var s=n.raycast(t,!1);s&&(r=r.concat(s.map((function(t){return{mesh:n,point:t}}))))}return!(!i||e.pointerChildren)&&1})),r.length?(n&&t.sortPoints(r,"point"),r):null},matrix:{get:function(){return this.updateMatrix(),this._matrix},set:function(t){m.a.warnOnce("Node.matrix.set","node.matrix is readOnly.Use node.matrix.copy instead."),this._matrix.copy(t)}},position:{get:function(){return this._position},set:function(t){m.a.warnOnce("Node.position.set","node.position is readOnly.Use node.position.copy instead."),this._position.copy(t)}},x:{get:function(){return this._position.elements[0]},set:function(t){this._position.elements[0]=t,this._matrixDirty=!0}},y:{get:function(){return this._position.elements[1]},set:function(t){this._position.elements[1]=t,this._matrixDirty=!0}},z:{get:function(){return this._position.elements[2]},set:function(t){this._position.elements[2]=t,this._matrixDirty=!0}},scale:{get:function(){return this._scale},set:function(t){m.a.warnOnce("Node.scale.set","node.scale is readOnly.Use node.scale.copy instead."),this._scale.copy(t)}},scaleX:{get:function(){return this._scale.elements[0]},set:function(t){this._scale.elements[0]=t,this._matrixDirty=!0}},scaleY:{get:function(){return this._scale.elements[1]},set:function(t){this._scale.elements[1]=t,this._matrixDirty=!0}},scaleZ:{get:function(){return this._scale.elements[2]},set:function(t){this._scale.elements[2]=t,this._matrixDirty=!0}},pivot:{get:function(){return this._pivot},set:function(t){m.a.warnOnce("Node.pivot.set","node.pivot is readOnly.Use node.pivot.copy instead."),this._pivot.copy(t)}},pivotX:{get:function(){return this._pivot.elements[0]},set:function(t){this._pivot.elements[0]=t,this._matrixDirty=!0}},pivotY:{get:function(){return this._pivot.elements[1]},set:function(t){this._pivot.elements[1]=t,this._matrixDirty=!0}},pivotZ:{get:function(){return this._pivot.elements[2]},set:function(t){this._pivot.elements[2]=t,this._matrixDirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){m.a.warnOnce("Node.rotation.set","node.rotation is readOnly.Use node.rotation.copy instead."),this._rotation.copy(t)}},rotationX:{get:function(){return this._rotation.degX},set:function(t){this._rotation.degX=t}},rotationY:{get:function(){return this._rotation.degY},set:function(t){this._rotation.degY=t}},rotationZ:{get:function(){return this._rotation.degZ},set:function(t){this._rotation.degZ=t}},quaternion:{get:function(){return this.updateQuaternion(),this._quaternion},set:function(t){m.a.warnOnce("Node.quaternion.set","node.quaternion is readOnly.Use node.quaternion.copy instead."),this._quaternion.copy(t)}},matrixVersion:0,getBounds:function(t,e,n){return e?e.multiply(this.matrix):e=this.getConcatenatedMatrix(t),this.children.forEach((function(t){n=t.getBounds(null,e.clone(),n)})),this.isMesh&&(n=this.geometry.getBounds(e,n)),n},_fireMouseEvent:function(t){if(t.eventCurrentTarget=this,this.fire(t),"mousemove"===t.type){if(!this.__mouseOver){this.__mouseOver=!0;var e=Object.assign({},t);e.type="mouseover",this.fire(e)}}else"mouseout"===t.type&&(this.__mouseOver=!1);var n=this.parent;t._stopped||t._stopPropagationed||!n||n._fireMouseEvent(t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getChildrenByBaseClassName("Node");return this.off(),n.forEach((function(n){n.isMesh?n.destroy(t,e):(n.off(),n.removeFromParent())})),this.removeFromParent(),this},_onMatrixUpdate:function(){this.matrixVersion++,this.updateTransform()},_onPositionUpdate:function(){this._matrixDirty=!0},_onScaleUpdate:function(){this._matrixDirty=!0},_onPivotUpdate:function(){this._matrixDirty=!0},_onRotationUpdate:function(){this._quatDirty=!0,this._matrixDirty=!0},_onQuaternionUpdate:function(){this._rotation.fromQuat(this._quaternion),this._quatDirty=!1}}),v=n(8),E=new v.a,T=s.a.create({Extends:g,isLight:!0,className:"Light",amount:1,enabled:!0,constantAttenuation:1,linearAttenuation:0,quadraticAttenuation:0,_range:0,range:{get:function(){return this._range},set:function(t){this.constantAttenuation=1,t<=0?(this.linearAttenuation=0,this.quadraticAttenuation=0):(this.linearAttenuation=4.5/t,this.quadraticAttenuation=75/(t*t)),this._range=t}},constructor:function(t){this.color=new v.a(1,1,1),T.superclass.constructor.call(this,t)},toInfoArray:function(t,e){return t[e+0]=this.constantAttenuation,t[e+1]=this.linearAttenuation,t[e+2]=this.quadraticAttenuation,this},getRealColor:function(){return E.copy(this.color).scale(this.amount)},createShadowMap:function(t,e){}}),M=T,A=n(24),I=new o.a,L=s.a.create({Extends:g,isCamera:!0,className:"Camera",_needUpdateProjectionMatrix:!0,_isGeometryDirty:!1,constructor:function(t){this.viewMatrix=new o.a,this.projectionMatrix=new o.a,this.viewProjectionMatrix=new o.a,this._frustum=new A.a,L.superclass.constructor.call(this,t)},updateViewMatrix:function(){return this.updateMatrixWorld(!0),this.viewMatrix.invert(this.worldMatrix),this},updateProjectionMatrix:function(){},getGeometry:function(t){},updateViewProjectionMatrix:function(){return this._needUpdateProjectionMatrix&&(this.updateProjectionMatrix(),this._needUpdateProjectionMatrix=!1),this.updateViewMatrix(),this.viewProjectionMatrix.multiply(this.projectionMatrix,this.viewMatrix),this.updateFrustum(this.viewProjectionMatrix),this},getModelViewMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewMatrix,t.worldMatrix),e},getModelProjectionMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewProjectionMatrix,t.worldMatrix),e},projectVector:function(t,e,n){var i=t.clone();return i.transformMat4(this.viewProjectionMatrix),e&&n&&(i.x=(i.x+1)/2*e,i.y=n-(i.y+1)/2*n),i},unprojectVector:function(t,e,n){var i=t.clone();return e&&n&&(i.x=i.x/e*2-1,i.y=1-i.y/n*2),I.invert(this.viewProjectionMatrix),i.transformMat4(I),i},isPointVisible:function(t){return!!this._frustum.intersectsSphere({center:t,radius:0})},isMeshVisible:function(t){var e=t.geometry;if(e){var n=e.getSphereBounds(t.worldMatrix);if(this._frustum.intersectsSphere(n))return!0}return!1},updateFrustum:function(t){return this._frustum.fromMatrix(t),this}}),O=L,S=n(14),R=n(12),y=n(11),x=n(21),N={2:new S.a,3:new c.a,4:new R.a,16:new o.a},b=s.a.create({className:"GeometryData",isGeometryData:!0,size:void 0,normalized:!1,type:void 0,_isSubDirty:!1,_isAllDirty:!1,isDirty:{get:function(){return this._isSubDirty||this._isAllDirty},set:function(t){this._isAllDirty=t,!1===t&&this.clearSubData()}},bufferViewId:void 0,glBuffer:null,constructor:function(t,e,n){this.id=d.a.generateUUID(this.className),this.data=t,this.size=e,Object.assign(this,n),this.bufferViewId||(this.bufferViewId=this.id),this.size||m.a.warn("GeometryData.constructor: geometryData must set size!",this)},_stride:0,stride:{get:function(){return this._stride},set:function(t){this._stride=t,this.strideSize=0===t?0:t/this.data.BYTES_PER_ELEMENT}},strideSize:0,_offset:0,offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetSize=t/this.data.BYTES_PER_ELEMENT}},offsetSize:0,data:{set:function(t){t&&(this._data=t,this.type=Object(r.getTypedArrayGLType)(t),this.stride=this._stride,this.offset=this._offset,this._isAllDirty=!0)},get:function(){return this._data}},length:{get:function(){return this._data.length}},realLength:{get:function(){return 0===this.strideSize?this._data.length:this._data.length/this.strideSize*this.size}},getByteLength:function(){return this._data.BYTES_PER_ELEMENT*this.realLength},count:{get:function(){return 0===this.strideSize?this._data.length/this.size:this._data.length/this.strideSize}},setSubData:function(t,e){this._isSubDirty=!0,this.data.set(e,t),this.subDataList||(this.subDataList=[]);var n=e.BYTES_PER_ELEMENT*t;this.subDataList.push({byteOffset:n,data:e})},clearSubData:function(){this.subDataList&&(this.subDataList.length=0),this._isSubDirty=!1},clone:function(){var t=new b(null,1);return t.copy(this),t},copy:function(t){var e=t.data;this.data=new e.constructor(e),this.size=t.size,this.stride=t.stride,this.normalized=t.normalized,this.type=t.type,this.offset=t.offset},getOffset:function(t){var e=this.strideSize;return 0===e?t*this.size:t*e+this.offsetSize},get:function(t){var e=this.getOffset(t);return this.getByOffset(e)},getCopy:function(t){return this.get(t).clone()},set:function(t,e){var n=this.getOffset(t);return this.setByOffset(n,e),n},getByOffset:function(t){var e=this.size;return e>1?N[e].fromArray(this._data,t):this._data[t]},setByOffset:function(t,e){var n=this.size,i=this._data;n>1?e.toArray(i,t):i[t]=e,this._isAllDirty=!0},traverse:function(t){for(var e=this.count,n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(W.fromTranslation(G.set(t,e,n))),this},scale:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.transformMat4(W.fromScaling(G.set(t,e,n))),this},rotate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(W.fromQuat(Y.fromEuler({x:t*d.a.DEG2RAD,y:e*d.a.DEG2RAD,z:n*d.a.DEG2RAD}))),this},transformMat4:function(t){var e=this.vertices;if(e&&e.traverse((function(n,i,r){e.setByOffset(r,n.transformMat4(t))})),q.normalFromMat4(t),this._normals){var n=this.normals;n.traverse((function(t,e,i){n.setByOffset(i,t.transformMat3(q).normalize())}))}if(this._tangents){var i=this.tangents;i.traverse((function(t,e,n){i.setByOffset(n,t.transformMat3(q).normalize())}))}return this.isDirty=!0,this},merge:function(t,e){var n=t.vertices;if(n&&this.vertices){var i=this.vertices.count;e&&(n=t.vertices.clone()).traverse((function(t,i,r){n.setByOffset(r,t.transformMat4(e))})),this.vertices.merge(n),this.indices&&t.indices?this.indices.merge(t.indices,(function(t){return t+i})):this.indices=null}return this.uvs&&t.uvs?this.uvs.merge(t.uvs):this.uvs=null,this.uvs1&&t.uvs1?this.uvs1.merge(t.uvs1):this.uvs1=null,this.colors&&t.colors?this.colors.merge(t.colors):this.colors=null,this._normals&&(this._normals=null),this._tangents&&(this._tangents=null),this._tangents1&&(this._tangents1=null),this.isDirty=!0,this},ensureData:function(t,e,n,i){var r=this[t];if(!r||n>r.length){var s=new i(n);r?(s.set(r.data),r.data=s):this[t]=new w(s,e)}},addPoints:function(){var t=this,e=[].slice.call(arguments),n=3*(this.currentVerticesCount+e.length);this.ensureData("vertices",3,n,Float32Array);var i=this.vertices.data;return e.forEach((function(e){var n=3*t.currentVerticesCount++;i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2]})),this.currentVerticesCount-e.length},addIndices:function(){var t=this,e=[].slice.call(arguments),n=this.currentIndicesCount+e.length;this.ensureData("indices",1,n,Uint16Array);var i=this.indices.data;e.forEach((function(e){i[t.currentIndicesCount++]=e})),this._needUpdateNormals=!0},addLine:function(t,e){var n=this.addPoints(t,e);this.addIndices(n,n+1)},addFace:function(t,e,n){var i=this.addPoints(t,e,n);this.addIndices(i,i+1,i+2)},addRect:function(t,e,n,i){var r=this.addPoints(t,e,n,i);this.addIndices(r,r+1,r+2,r,r+2,r+3)},setVertexUV:function(t,e){this.ensureData("uvs",2,this.vertices.length/3*2,Float32Array);for(var n=this.uvs.data,i=0;i0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;e||(e={xMin:1/0,xMax:-1/0,yMin:1/0,yMax:-1/0,zMin:1/0,zMax:-1/0});var n=this.vertices;return n?(n.traverse((function(n){t&&n.transformMat4(t),e.xMax=Math.max(e.xMax,n.x),e.yMax=Math.max(e.yMax,n.y),e.zMax=Math.max(e.zMax,n.z),e.xMin=Math.min(e.xMin,n.x),e.yMin=Math.min(e.yMin,n.y),e.zMin=Math.min(e.zMin,n.z)})),e.width=e.xMax-e.xMin,e.height=e.yMax-e.yMin,e.depth=e.zMax-e.zMin,e.x=(e.xMin+e.xMax)/2,e.y=(e.yMin+e.yMax)/2,e.z=(e.zMin+e.zMax)/2,e):(m.a.warnOnce("geometry.getBounds","geometry has no vertices data, geometry.getBounds will return Infinity bounds."),e)},getLocalBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._localBounds&&!t||(this._localBounds=this.getBounds()),this._localBounds},getSphereBounds:function(t){this._sphereBounds||(this._sphereBounds=new x.a);var e=this._sphereBounds;return e.copy(this.getLocalSphereBounds()),t&&e.transformMat4(t),e},getLocalSphereBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._localSphereBounds||t){var e=this.getLocalBounds(t),n=new x.a({center:new c.a(e.x,e.y,e.z)}),i=this.vertices;i?n.fromGeometryData(i):(m.a.warnOnce("geometry.getLocalSphereBounds","geometry has no vertices data, geometry.getLocalSphereBounds will return Infinity bounds."),n.radius=1/0),this._localSphereBounds=n}return this._localSphereBounds},convertToNoIndices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(this.mode===P)if(this.indices){for(var e=this.indices.data,n=e.length,i=new Float32Array(n*t),s=this.uvs?new Float32Array(2*n):null,a=new Float32Array(3*n),o=this.colors?new Float32Array(this.colors.size*n):null,u=this.skinIndices?new Float32Array(4*n):null,c=this.skinWeights?new Float32Array(4*n):null,h=0;h2&&void 0!==arguments[2])||arguments[2];return(n=this.useAABBRaycast?this._aabbRaycast(t):this._raycast(t,e))&&i&&t.sortPoints(n),n},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.positionDecodeMat&&(t.QUANTIZED=1,t.POSITION_QUANTIZED=1),this.normalDecodeMat&&(t.QUANTIZED=1,t.NORMAL_QUANTIZED=1),this.uvDecodeMat&&(t.QUANTIZED=1,t.UV_QUANTIZED=1),this.uv1DecodeMat&&(t.QUANTIZED=1,t.UV1_QUANTIZED=1),this.colors&&(t.HAS_COLOR=1,t.COLOR_SIZE=this.colors.size),t},getShaderKey:function(){return void 0===this._shaderKey&&(this._shaderKey="geometry",this.isMorphGeometry?this._shaderKey+="_id_".concat(this.id):(this.colors&&(this._shaderKey+="_colors"),this.positionDecodeMat&&(this._shaderKey+="positionDecodeMat"))),this._shaderKey},getSize:function(){var t=0;for(var e in this)Object(r.hasOwnProperty)(this,e)&&this[e]&&this[e].isGeometryData&&(t+=this[e].getByteLength());return t},destroy:function(){m.a.warn("Geometry.destroy has been deprecated, use mesh.destroy(renderer) instead.")}}),K=s.a.create({Extends:O,isPerspectiveCamera:!0,className:"PerspectiveCamera",_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:null,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},_fov:50,fov:{get:function(){return this._fov},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._fov=t}},_aspect:1,aspect:{get:function(){return this._aspect},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._aspect=t}},constructor:function(t){K.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.projectionMatrix.elements,e=this.near,n=this.far,i=this.aspect,r=this.fov,s=1/Math.tan(.5*d.a.degToRad(r));if(t[0]=s/i,t[5]=s,t[11]=-1,t[15]=0,n){var a=1/(e-n);t[10]=(e+n)*a,t[14]=2*n*e*a}else t[10]=-1,t[14]=-2*e},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=Math.tan(this.fov/2*Math.PI/180),i=this.near,r=this.far,s=i*n,a=r*n,o=this.aspect*s,u=this.aspect*a,c=[-o,-s,-i],h=[o,-s,-i],f=[o,s,-i],l=[-o,s,-i],d=[-u,-a,-r],m=[u,-a,-r],_=[u,a,-r],p=[-u,a,-r];e.addRect(d,m,_,p),e.addRect(m,h,f,_),e.addRect(h,c,l,f),e.addRect(c,d,p,l),e.addRect(p,_,f,l),e.addRect(c,h,m,d),this._geometry=e}return this._geometry}}),Q=K,J=s.a.create({constructor:function(){this._cache={}},get:function(t){return this._cache[t]},getObject:function(t){return this._cache[t.__cacheId]},add:function(t,e){"object"==typeof e&&(e.__cacheId=t),this._cache[t]=e},remove:function(t){delete this._cache[t]},removeObject:function(t){delete this._cache[t.__cacheId]},removeAll:function(){this._cache={}},each:function(t){var e=this._cache;for(var n in e)t(e[n],n)}}),$={instanced:void 0,vao:void 0,texFloat:void 0,loseContext:void 0,textureFilterAnisotropic:void 0,_usedExtensions:{},_disabledExtensions:{},init:function(t){this.reset(t)},reset:function(t){this.gl=t;var e=this._usedExtensions;for(var n in e){var i=e[n];this[i]=void 0,this.get(n,i)}},use:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;this.gl?this.get(t,e):this._usedExtensions[t]=e},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this._disabledExtensions[t])return null;var n=this[e];return void 0===n&&(n=this._getExtension(t),this[e]=n),n},disable:function(t){this._disabledExtensions[t]=!0},enable:function(t){this._disabledExtensions[t]=!1},_getExtension:function(t){var e=this.gl;return e&&e.getExtension&&(e.getExtension(t)||e.getExtension("WEBKIT_"+t)||e.getExtension("MOZ_"+t))||null}};$.use("ANGLE_instanced_arrays","instanced"),$.use("OES_vertex_array_object","vao"),$.use("OES_texture_float","texFloat"),$.use("WEBGL_lose_context","loseContext"),$.use("OES_element_index_uint","uintIndices"),$.use("EXT_shader_texture_lod","shaderTextureLod"),$.use("EXT_texture_filter_anisotropic","textureFilterAnisotropic");var tt=$,et={MAX_TEXTURE_INDEX:null,MAX_PRECISION:null,MAX_VERTEX_PRECISION:null,MAX_FRAGMENT_PRECISION:null,VERTEX_TEXTURE_FLOAT:null,FRAGMENT_TEXTURE_FLOAT:null,MAX_TEXTURE_MAX_ANISOTROPY:1,init:function(t){var e=this;this.gl=t;["MAX_RENDERBUFFER_SIZE","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS","MAX_COMBINED_TEXTURE_IMAGE_UNITS"].forEach((function(t){e.get(t)})),this.MAX_TEXTURE_INDEX=this.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,this.MAX_VERTEX_PRECISION=this._getMaxSupportPrecision(t.VERTEX_SHADER),this.MAX_FRAGMENT_PRECISION=this._getMaxSupportPrecision(t.FRAGMENT_SHADER),this.MAX_PRECISION=this.getMaxPrecision(this.MAX_FRAGMENT_PRECISION,this.MAX_VERTEX_PRECISION),this.VERTEX_TEXTURE_FLOAT=!!tt.texFloat&&this.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0,this.FRAGMENT_TEXTURE_FLOAT=!!tt.texFloat,this.EXT_FRAG_DEPTH=tt.get("EXT_frag_depth"),this.SHADER_TEXTURE_LOD=!!tt.shaderTextureLod,tt.textureFilterAnisotropic&&(this.MAX_TEXTURE_MAX_ANISOTROPY=t.getParameter(tt.textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))},get:function(t){var e=this.gl,n=this[t];return void 0===n&&(n=this[t]=e.getParameter(e[t])),n},_getMaxSupportPrecision:function(t){var e=this.gl,n="lowp";if(e.getShaderPrecisionFormat)for(var i=[{name:"highp",type:e.HIGH_FLOAT},{name:"mediump",type:e.MEDIUM_FLOAT}],r=0;r0){n=s.name;break}}else n="mediump";return n},getMaxPrecision:function(t,e){return"highp"===t||"mediump"===t&&"lowp"===e?e:t}},nt=n(54),it=n.n(nt),rt=n(55),st=n.n(rt),at=n(56),ot=n.n(at),ut=n(57),ct=n.n(ut),ht=new J,ft=new J,lt=s.a.create({isShader:!0,className:"Shader",vs:"",fs:"",Statics:{commonOptions:{},shaders:{"chunk/baseDefine.glsl":n(18),"chunk/color.frag":n(40),"chunk/color.vert":n(80),"chunk/color_main.vert":n(82),"chunk/diffuse.frag":n(62),"chunk/diffuse_main.frag":n(71),"chunk/extensions.frag":n(25),"chunk/extensions.vert":n(52),"chunk/fog.frag":n(47),"chunk/fog_main.frag":n(73),"chunk/frag_color.frag":n(51),"chunk/joint.vert":n(75),"chunk/joint_main.vert":n(85),"chunk/light.frag":n(44),"chunk/lightFog.frag":n(43),"chunk/lightFog.vert":n(78),"chunk/lightFog_main.frag":n(49),"chunk/lightFog_main.vert":n(88),"chunk/logDepth.frag":n(29),"chunk/logDepth_main.frag":n(30),"chunk/logDepth.vert":n(81),"chunk/logDepth_main.vert":n(89),"chunk/morph.vert":n(79),"chunk/morph_main.vert":n(84),"chunk/normal.frag":n(42),"chunk/normal.vert":n(77),"chunk/normal_main.frag":n(48),"chunk/normal_main.vert":n(87),"chunk/pbr.frag":n(91),"chunk/pbr_main.frag":n(93),"chunk/phong.frag":n(69),"chunk/phong_main.frag":n(72),"chunk/precision.frag":n(26),"chunk/precision.vert":n(53),"chunk/transparency.frag":n(46),"chunk/transparency_main.frag":n(50),"chunk/unQuantize.vert":n(74),"chunk/unQuantize_main.vert":n(83),"chunk/uv.frag":n(41),"chunk/uv.vert":n(76),"chunk/uv_main.vert":n(86),"method/encoding.glsl":n(92),"method/getDiffuse.glsl":n(64),"method/getLightAttenuation.glsl":n(66),"method/getShadow.glsl":n(68),"method/getSpecular.glsl":n(65),"method/packFloat.glsl":n(90),"method/textureEnvMap.glsl":n(45),"method/transpose.glsl":n(63),"method/unpackFloat.glsl":n(67),"basic.frag":n(54),"basic.vert":n(55),"geometry.frag":n(56),"pbr.frag":n(57),"screen.frag":n(58),"screen.vert":n(59)},init:function(t){this.renderer=t,this.commonHeader=this._getCommonHeader(this.renderer)},cache:{get:function(){return ht}},headerCache:{get:function(){return ft}},reset:function(t){ht.removeAll()},getHeaderKey:function(t,e,n,i,r){var s="header_"+e.id+"_"+n.lightInfo.uid;return t.isSkinedMesh&&(s+="_joint"+t.jointNames.length),i&&(s+="_fog_"+i.mode),s+="_"+t.geometry.getShaderKey(),r&&(s+="_fogDepth"),s},getHeader:function(t,e,n,i,r){var s=this.getHeaderKey(t,e,n,i),a=ft.get(s);if(!a||e.isDirty){var o={};Object.assign(o,this.commonOptions);var u=e.lightType;u&&"NONE"!==u&&n.getRenderOption(o),e.getRenderOption(o),t.getRenderOption(o),i&&(o.HAS_FOG=1,i.getRenderOption(o)),r&&(o.USE_LOG_DEPTH=1,et.EXT_FRAG_DEPTH&&(o.USE_EXT_FRAG_DEPTH=1)),o.HAS_NORMAL&&o.NORMAL_MAP&&(o.HAS_TANGENT=1),o.RECEIVE_SHADOWS||(delete o.DIRECTIONAL_LIGHTS_SMC,delete o.SPOT_LIGHTS_SMC,delete o.POINT_LIGHTS_SMC),a="#define SHADER_NAME ".concat(e.className,"\n"),a+=Object.keys(o).map((function(t){return t.indexOf("HILO_CUSTUM_OPTION_")>-1?"#define ".concat(t.replace("HILO_CUSTUM_OPTION_","")," ").concat(o[t]):"#define HILO_".concat(t," ").concat(o[t])})).join("\n")+"\n",ft.add(s,a)}return a},_getCommonHeader:function(t){var e=et.getMaxPrecision(et.MAX_VERTEX_PRECISION,t.vertexPrecision),n=et.getMaxPrecision(et.MAX_FRAGMENT_PRECISION,t.fragmentPrecision),i=et.getMaxPrecision(e,n);return"\n#define HILO_MAX_PRECISION ".concat(i,"\n#define HILO_MAX_VERTEX_PRECISION ").concat(e,"\n#define HILO_MAX_FRAGMENT_PRECISION ").concat(n,"\n")},getShader:function(t,e,n,i,r,s){var a=this.getHeader(t,e,i,r,s);return e.isBasicMaterial||e.isPBRMaterial?this.getBasicShader(e,n,a):e.isShaderMaterial?this.getCustomShader(e.vs,e.fs,a,e.shaderCacheId||e.id,e.useHeaderCache):null},getBasicShader:function(t,e,n){var i="";e&&(i=(i=t.getInstancedUniforms().map((function(t){return t.name}))).join("|"));var r=t.className+":"+i;t.onBeforeCompile&&(r+=":"+(t.shaderCacheId||t.id));var s=ht.get(r);if(!s){var a="",o=st.a;if(t.isBasicMaterial?t.isGeometryMaterial?a+=ot.a:a+=it.a:t.isPBRMaterial&&(a+=ct.a),t.onBeforeCompile){var u=t.onBeforeCompile(o,a);a=u.fs,o=u.vs}if(i){var c=new RegExp("^\\s*uniform\\s+(\\w+)\\s+(".concat(i,");"),"gm");o=o.replace(c,"attribute $1 $2;")}s=this.getCustomShader(o,a,n,r,!0)}if(s){var h=this._getNumId(s);null!==h&&(t._shaderNumId=h)}return s},_getNumId:function(t){var e=t.id.match(/_(\d+)/);return e&&e[1]?parseInt(e[1],10):null},getCustomShader:function(t,e,n,i,r){var s,a=this.commonHeader;return i&&(r&&(i+=":"+n),s=ht.get(i)),s||(s=new lt({vs:a+n+t,fs:a+n+e}),i&&ht.add(i,s)),s}},alwaysUse:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){return this._isDestroyed||(ht.removeObject(this),this._isDestroyed=!0),this}}),dt=lt,mt=n(59),_t=n.n(mt),pt=n(58),gt=n.n(pt),vt=[{name:"FLOAT",byteSize:4,uniformFuncName:"uniform1f",type:"Scalar",size:1},{name:"FLOAT_VEC2",byteSize:8,uniformFuncName:"uniform2f",type:"Vector",size:2},{name:"FLOAT_VEC3",byteSize:12,uniformFuncName:"uniform3f",type:"Vector",size:3},{name:"FLOAT_VEC4",byteSize:16,uniformFuncName:"uniform4f",type:"Vector",size:4},{name:"FLOAT_MAT2",byteSize:16,uniformFuncName:"uniformMatrix2fv",type:"Matrix",size:4},{name:"FLOAT_MAT3",byteSize:36,uniformFuncName:"uniformMatrix3fv",type:"Matrix",size:9},{name:"FLOAT_MAT4",byteSize:64,uniformFuncName:"uniformMatrix4fv",type:"Matrix",size:16},{name:"INT",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"INT_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"INT_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"INT_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"BOOL",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"BOOL_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"BOOL_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"BOOL_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"SAMPLER_2D",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"SAMPLER_CUBE",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1}],Et={},Tt={dict:Et,init:function(t){vt.forEach((function(e){var n,i,r=e.name,s=e.uniformFuncName,a=s+"v";"Matrix"===e.type?n=i=function(e,n){void 0!==n&&t[s](e,!1,n)}:(n=function(e,n){void 0!==n&&t[s](e,n)},i=function(e,n){t[a](e,n)}),Et[t[r]]=Object.assign(e,{glValue:t[r],uniform:n,uniformArray:i})}))},get:function(t){return Et[t]}},Mt=new J,At=s.a.create({Statics:{cache:{get:function(){return Mt}},reset:function(t){Mt.each((function(t){t.destroy()}))},getProgram:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t.id,r=Mt.get(i);return r||(r=new At({state:e,vertexShader:t.vs,fragShader:t.fs,ignoreError:n}),Mt.add(i,r)),r},getBlankProgram:function(t){var e=dt.getCustomShader("void main(){}","precision HILO_MAX_FRAGMENT_PRECISION float;void main(){gl_FragColor = vec4(0.0);}","","__hiloBlankShader");return this.getProgram(e,t,!0)}},className:"Program",isProgram:!0,fragShader:"",vertexShader:"",attributes:null,uniforms:null,program:null,gl:null,state:null,alwaysUse:!1,constructor:function(t){return this.id=d.a.generateUUID(this.className),Object.assign(this,t),this._dict={},this.attributes={},this.uniforms={},this.gl=this.state.gl,this.program=this.createProgram(),this.program?(this.initAttributes(),this.initUniforms(),this):this.ignoreError?this:At.getBlankProgram(t.state)},createProgram:function(){var t=this.gl,e=t.createProgram(),n=this.createShader(t.VERTEX_SHADER,this.vertexShader),i=this.createShader(t.FRAGMENT_SHADER,this.fragShader);if(n&&i){if(t.attachShader(e,n),t.attachShader(e,i),t.linkProgram(e),t.deleteShader(n),t.deleteShader(i),!t.getProgramParameter(e,t.LINK_STATUS)){var r=t.getProgramInfoLog(e);return m.a.error("compileProgramError: "+r,this),t.deleteProgram(e),null}return e}return null},useProgram:function(){this.state.useProgram(this.program)},createShader:function(t,e){var n=this.gl,i=n.createShader(t);if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){var r=n.getShaderInfoLog(i);return m.a.error("compileShaderError: "+r,e.split("\n").map((function(t,e){return"".concat(e+1," ").concat(t)})).join("\n")),null}return i},initAttributes:function(){for(var t=this,e=this.gl,n=this.program,i=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),r=tt.instanced,s=function(i){var s=e.getActiveAttrib(n,i),a=s.name,o=s.type,u=s.size,c=e.getAttribLocation(n,a),h=Tt.get(o),f=function(t){var n=t.type,i=void 0===n?e.FLOAT:n,r=t.normalized,s=void 0!==r&&r,a=t.stride,o=void 0===a?0:a,u=t.offset,f=void 0===u?0:u;e.vertexAttribPointer(c,h.size,i,s,o,f)},l=function(){e.enableVertexAttribArray(c)},d=function(){},m=function(t,e){t[c]=e};if(r&&(d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;r.vertexAttribDivisorANGLE(c,t)}),"Matrix"===h.type){var _=h.byteSize,p=h.size,g=Math.sqrt(p),v=4*g,E=function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;E((function(e){r.vertexAttribDivisorANGLE(e,t)}))})}t.attributes[a]={name:a,location:c,type:o,size:u,glTypeInfo:h,pointer:f,enable:l,divisor:d,addTo:m}},a=0;a1||o>1?function(t){f(c,t)}:function(e){t._dict[a]!==e&&(t._dict[a]=e,l(c,e))}})},a=0;a2&&void 0!==arguments[2]?arguments[2]:St;return this.createBuffer(t,Lt,e,n)},createBuffer:function(t,e,n,i){var r=n.bufferViewId,s=Rt.get(r);return s||(n.isDirty=!1,s=new yt(t,e,n.data,i),Rt.add(r,s),s)},createIndexBuffer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:St;return this.createBuffer(t,Ot,e,n)}},className:"Buffer",isBuffer:!0,constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:St;this.id=d.a.generateUUID(this.className),this.gl=t,this.target=e,this.usage=i,this.buffer=t.createBuffer(),n&&this.bufferData(n)},bind:function(){return this.gl.bindBuffer(this.target,this.buffer),this},bufferData:function(t){var e=this.gl,n=this.target,i=this.usage;return this.bind(),e.bufferData(n,t,i),this.data=t,this},bufferSubData:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.gl,r=this.target;return n||this.bind(),i.bufferSubData(r,t,e),this},uploadGeometryData:function(t){var e=this,n=t.subDataList;return!this.data||this.data.byteLength2&&void 0!==arguments[2]?arguments[2]:0,i=0,r=e.length;i0&&void 0!==arguments[0]?arguments[0]:1;this.bind();var e=this.gl,n=this.mode;this.useInstanced&&(this.indexBuffer?this.instancedExtension.drawElementsInstancedANGLE(n,this.vertexCount,e.UNSIGNED_SHORT,0,t):this.instancedExtension.drawArraysInstancedANGLE(n,0,this.getVertexCount(),t))},addIndexBuffer:function(t,e){this.bind();var n=this.gl,i=this.indexBuffer;return this.indexType=t.type,i?t.isDirty&&(i.uploadGeometryData(t),this.vertexCount=t.length):((i=xt.createIndexBuffer(n,t,e)).bind(),this.indexBuffer=i,this.vertexCount=t.length),i},addAttribute:function(t,e,n,i){this.bind();var r=this.gl,s=e.name,a=this[s];if(a)t.isDirty&&a.buffer.uploadGeometryData(t);else{var o=xt.createVertexBuffer(r,t,n);o.bind(),e.enable(),e.pointer(t),a={attribute:e,buffer:o,geometryData:t},this.attributes.push(a),this[s]=a,e.addTo(this.activeStates,a),i&&i(a)}return a},addInstancedAttribute:function(t,e,n){this.bind();var i=this.gl,r=t.name,s=t.glTypeInfo,a=bt.getTypedArray(Float32Array,e.length*s.size);e.forEach((function(t,e){void 0!==n(t)?bt.fillArrayData(a,n(t),e*s.size):m.a.warn("no attributeData:"+r+"-"+t.name)}));var o,u=this[r];return u?(o=u.geometryData).data=a:o=new w(a,1),this.addAttribute(o,t,i.DYNAMIC_DRAW,(function(e){t.divisor(1),e.useInstanced=!0}))},useResource:function(t,e){return this.attributes.forEach((function(n){t.useResource(n.buffer,e)})),this.indexBuffer&&t.useResource(this.indexBuffer,e),this},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){var t=this;return this._isDestroyed||(this.useVao&&this.vaoExtension.deleteVertexArrayOES(this.vao),this.gl=null,this.indexBuffer=null,this.attributes.forEach((function(e){t[e.name]=null})),this.attributes=null,this.activeStates=null,Ht.removeObject(this),this._isDestroyed=!0),this}}),Ft=Dt,Ut=C.a.TEXTURE_2D,Gt=C.a.RGBA,Bt=C.a.LINEAR,Vt=C.a.NEAREST,Xt=C.a.REPEAT,jt=C.a.CLAMP_TO_EDGE,kt=C.a.UNSIGNED_BYTE,zt=new J,qt=s.a.create({Statics:{cache:{get:function(){return zt}},reset:function(t){zt.each((function(e,n){t.deleteTexture(e),zt.remove(n)}))}},isTexture:!0,className:"Texture",isImageCanRelease:!1,_isImageReleased:!1,_image:null,image:{get:function(){return this._isImageReleased&&m.a.errorOnce("Read Texture.image(".concat(this.id,")"),"Read Texture.image after image released!"),this._image},set:function(t){this._image=t,this._isImageReleased=!1}},_releaseImage:function(){this._canvasImage=null,this._canvasCtx=null,this._originImage=null,this._image=null,this.mipmaps=null,this._isImageReleased=!0},mipmaps:null,target:Ut,internalFormat:Gt,format:Gt,type:kt,width:0,height:0,border:0,magFilter:Bt,minFilter:Bt,wrapS:Xt,wrapT:Xt,name:"",premultiplyAlpha:!1,flipY:!1,compressed:!1,needUpdate:!0,needDestroy:!1,autoUpdate:!1,uv:0,anisotropic:1,origWidth:{get:function(){return this._originImage?this._originImage.width||this.width:this.image&&this.image.width||this.width}},origHeight:{get:function(){return this.originImage?this._originImage.height||this.height:this.image&&this.image.height||this.height}},useMipmap:{get:function(){return this.minFilter!==Bt&&this.minFilter!==Vt},set:function(){m.a.warn("texture.useMipmap is readOnly!")}},useRepeat:{get:function(){return this.wrapS!==jt||this.wrapT!==jt},set:function(){m.a.warn("texture.useRepeat is readOnly!")}},mipmapCount:{get:function(){return Math.floor(Math.log2(Math.max(this.width,this.height))+1)},set:function(){m.a.warn("texture.mipmapCount is readOnly!")}},constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},isImgPowerOfTwo:function(t){return d.a.isPowerOfTwo(t.width)&&d.a.isPowerOfTwo(t.height)},getSupportSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.width,i=t.height;e&&!this.isImgPowerOfTwo(t)&&(n=d.a.nextPowerOfTwo(n),i=d.a.nextPowerOfTwo(i));var r=et.MAX_TEXTURE_SIZE;return r&&(n>r&&(n=r),i>r&&(i=r)),{width:n,height:i}},resizeImgToPowerOfTwo:function(t){var e=this.getSupportSize(t,!0);return this.resizeImg(t,e.width,e.height)},resizeImg:function(t,e,n){if(t.width===e&&t.height===n)return t;var i=this._canvasImage;return i?(i.width=e,i.height=n,this._canvasCtx=i.getContext("2d")):((i=document.createElement("canvas")).width=e,i.height=n,this._canvasImage=i,this._canvasCtx=i.getContext("2d")),this._canvasCtx.drawImage(t,0,0,t.width,t.height,0,0,e,n),m.a.warnOnce("Texture.resizeImg(".concat(this.id,")"),"image size(".concat(t.width,"x").concat(t.height,") is not support. Resized to ").concat(i.width,"x").concat(i.height),t.src),this._originImage=t,i},_glUploadTexture:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.width,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.height,a=t.gl;return this.compressed?a.compressedTexImage2D(e,i,this.internalFormat,r,s,this.border,n):n&&void 0!==n.width?a.texImage2D(e,i,this.internalFormat,this.format,this.type,n):a.texImage2D(e,i,this.internalFormat,r,s,this.border,this.format,this.type,n),this},_uploadTexture:function(t){var e=this;return this.useMipmap&&this.mipmaps?this.mipmaps.forEach((function(n,i){e._glUploadTexture(t,e.target,n.data,i,n.width,n.height)})):this._glUploadTexture(t,this.target,this.image,0),this},updateTexture:function(t,e){var n=t.gl;if(this.needUpdate||this.autoUpdate){this._originImage&&this.image===this._canvasImage&&(this.image=this._originImage);var i=this.useMipmap,r=this.useRepeat;if(this.image&&!this.image.length){var s=r||i,a=this.getSupportSize(this.image,s);this.image=this.resizeImg(this.image,a.width,a.height),this.width=this.image.width,this.height=this.image.height}t.activeTexture(n.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),t.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!!this.flipY);var o=tt.textureFilterAnisotropic;o&&this.anisotropic>1&&n.texParameterf(this.target,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this.anisotropic,et.MAX_TEXTURE_MAX_ANISOTROPY)),this._uploadTexture(t),i&&(this.compressed?this.mipmaps||(m.a.warn("Compressed texture has no mipmips, changed the minFilter from ".concat(this.minFilter," to Linear!"),this),this.minFilter=Bt):n.generateMipmap(this.target)),n.texParameterf(this.target,n.TEXTURE_MAG_FILTER,this.magFilter),n.texParameterf(this.target,n.TEXTURE_MIN_FILTER,this.minFilter),n.texParameterf(this.target,n.TEXTURE_WRAP_S,this.wrapS),n.texParameterf(this.target,n.TEXTURE_WRAP_T,this.wrapT),this.needUpdate=!1}return this._needUpdateSubTexture&&(this._uploadSubTextures(t,e),this._needUpdateSubTexture=!1),this},_uploadSubTextures:function(t,e){var n=this;if(this._subTextureList&&this._subTextureList.length>0){var i=t.gl;t.activeTexture(i.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),t.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!!this.flipY),this._subTextureList.forEach((function(t){var e=t[0],r=t[1],s=t[2];i.texSubImage2D(n.target,0,e,r,n.format,n.type,s)})),this._subTextureList.length=0}},_needUpdateSubTexture:!1,_subTextureList:null,updateSubTexture:function(t,e,n){this._subTextureList||(this._subTextureList=[]),this._subTextureList.push([t,e,n]),this._needUpdateSubTexture=!0},getGLTexture:function(t){this.state=t;var e=this.gl=t.gl,n=this.id;this.needDestroy&&(this.destroy(),this.needDestroy=!1);var i=zt.get(n);return i||(i=e.createTexture(),zt.add(n,i),this.needUpdate=!0),this.updateTexture(t,i),this.isImageCanRelease&&this._releaseImage(),i},setGLTexture:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&this.destroy(),zt.add(this.id,t),this},destroy:function(){var t=this.id,e=zt.get(t);return e&&this.gl&&(this.gl.deleteTexture(e),zt.remove(t)),this},clone:function(){var t=Object.assign({},this);return delete t.id,new this.constructor(t)}}),Wt=C.a.TEXTURE_2D,Yt=C.a.RGBA,Zt=C.a.UNSIGNED_BYTE,Kt=C.a.COLOR_ATTACHMENT0,Qt=C.a.DEPTH_STENCIL,Jt=C.a.DEPTH_TEST,$t=C.a.CULL_FACE,te=C.a.TRIANGLE_STRIP,ee=C.a.NEAREST,ne=C.a.CLAMP_TO_EDGE,ie=new J,re=s.a.create({Statics:{cache:{get:function(){return ie}},reset:function(t){ie.each((function(t){t.reset()}))},destroy:function(t){ie.each((function(t){t.destroy()}))}},className:"Framebuffer",isFramebuffer:!0,bufferInternalFormat:Qt,target:Wt,format:Yt,internalFormat:Yt,type:Zt,minFilter:ee,magFilter:ee,data:null,attachment:Kt,needRenderbuffer:!0,useVao:!0,renderer:null,texture:null,renderbuffer:null,framebuffer:null,_isInit:!1,constructor:function(t,e){this.id=d.a.generateUUID(this.className),this.renderer=t,Object.assign(this,e),this.width||(this.width=t.width),this.height||(this.height=t.height),ie.add(this.id,this)},init:function(){if(!this._isInit&&this.renderer.isInit){this._isInit=!0;var t=this.renderer;this.gl=t.gl,this.state=t.state,this.reset()}},reset:function(){this.destroyResource();var t=this.gl;this.framebuffer=t.createFramebuffer(),this.bind(),this.needRenderbuffer&&(this.renderbuffer=this.createRenderbuffer()),this.texture=this.createTexture(),this.isComplete()||m.a.warn("Framebuffer is not complete => "+t.checkFramebufferStatus(t.FRAMEBUFFER)),this.unbind()},isComplete:function(){var t=this.gl;return!(!t||t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)},bind:function(){this.init(),this._isInit&&this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this.framebuffer)},unbind:function(){if(this.init(),this._isInit){var t=this.state;t.bindFramebuffer(this.gl.FRAMEBUFFER,t.preFramebuffer)}},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new v.a(0,0,0,0);if(this._isInit){var e=this.gl;e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}},render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4?arguments[4]:void 0;if(this._isInit){var s=this.gl,a=this.state;a.disable(Jt),a.disable($t),r&&this.clear(r);var o=dt.getCustomShader(_t.a,gt.a,"","FramebufferTextureShader"),u=It.getProgram(o,a);u.useProgram();var c="".concat(t,"_").concat(e,"_").concat(n,"_").concat(i,"_").concat(u.id),h=Ft.getVao(s,c,{useVao:this.useVao,useInstanced:!1,mode:te});if(h.isDirty){h.isDirty=!1;var f=[t=2*t-1,e=1-2*e,t+(n*=2),e,t,e-(i*=2),t+n,e-i];h.addAttribute(new w(new Float32Array(f),2),u.attributes.a_position),h.addAttribute(new w(new Float32Array([0,1,1,1,0,0,1,0]),2),u.attributes.a_texcoord0)}a.activeTexture(s.TEXTURE0),a.bindTexture(s.TEXTURE_2D,this.texture.getGLTexture(a)),h.draw()}},createRenderbuffer:function(){var t=this.gl,e=this.width,n=this.height,i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,i),i},createTexture:function(){var t=this.state,e=t.gl,n=new qt({minFilter:this.minFilter,magFilter:this.magFilter,internalFormat:this.internalFormat,format:this.format,type:this.type,width:this.width,height:this.height,image:this.data,wrapS:ne,wrapT:ne}),i=n.getGLTexture(t);return e.framebufferTexture2D(e.FRAMEBUFFER,this.attachment,this.target,i,0),n},resize:function(t,e,n){(n||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this._isInit&&this.reset())},readPixels:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=Object(r.getTypedArrayClass)(this.type),a=new s(n*i*4);if(this._isInit){var o=this.gl;e=this.height-e-i,this.bind(),o.readPixels(t,e,n,i,this.format,this.type,a),this.unbind()}return a},destroy:function(){this.destroyResource(),this.gl=null,ie.removeObject(this)},destroyResource:function(){var t=this.gl;t&&(this.framebuffer&&(t.deleteFramebuffer(this.framebuffer),this.framebuffer=null),this.renderbuffer&&(t.deleteRenderbuffer(this.renderbuffer),this.renderbuffer=null),this.texture&&(this.texture.destroy(),this.texture=null))}}),se=C.a.TEXTURE_CUBE_MAP,ae=C.a.RGB,oe=C.a.LINEAR,ue=C.a.CLAMP_TO_EDGE,ce=C.a.TEXTURE_CUBE_MAP_POSITIVE_X,he=s.a.create({Extends:qt,isCubeTexture:!0,className:"CubeTexture",target:se,internalFormat:ae,format:ae,magFilter:oe,minFilter:oe,wrapS:ue,wrapT:ue,constructor:function(t){he.superclass.constructor.call(this,t),this.image=this.image||[]},_uploadTexture:function(t){var e=this,n=this.image;Array.isArray(n)&&6===n.length?(n[0]&&n[0].width&&(this.width=n[0].width,this.height=n[0].height),n.forEach((function(n,i){e._glUploadTexture(t,ce+i,n,0)}))):m.a.error("CubeTexture image must be an Array of length 6",n)},right:{get:function(){return this.image[0]},set:function(t){this.image[0]=t}},left:{get:function(){return this.image[1]},set:function(t){this.image[1]=t}},top:{get:function(){return this.image[2]},set:function(t){this.image[2]=t}},bottom:{get:function(){return this.image[3]},set:function(t){this.image[3]=t}},front:{get:function(){return this.image[4]},set:function(t){this.image[4]=t}},back:{get:function(){return this.image[5]},set:function(t){this.image[5]=t}}}),fe=he,le=C.a.TEXTURE_2D,de=C.a.RGBA,me=C.a.NEAREST,_e=C.a.CLAMP_TO_EDGE,pe=C.a.FLOAT,ge=s.a.create({Extends:qt,isDataTexture:!0,className:"DataTexture",target:le,internalFormat:de,format:de,type:pe,magFilter:me,minFilter:me,wrapS:_e,wrapT:_e,dataLength:0,resetSize:function(t){if(t!==this.dataLength){this.dataLength=t;var e=d.a.nextPowerOfTwo(t/4),n=Math.max(Math.log2(e),4),i=Math.floor(n/2),s=n-i;this.width=Math.pow(2,i),this.height=Math.pow(2,s),this.DataClass=Object(r.getTypedArrayClass)(this.type)}},data:{get:function(){return this.image},set:function(t){if(this.image!==t){this.resetSize(t.length);var e=this.width*this.height*4;e===t.length&&t instanceof this.DataClass?this.image=t:(this.image&&this.image.length===e||(this.image=new this.DataClass(e)),this.image.set(t,0)),this.needUpdate=!0}}},constructor:function(t){ge.superclass.constructor.call(this,t)}}),ve=ge;function Ee(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Te(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Te(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.lightType;e["LIGHT_TYPE_".concat(n)]=1,e.SIDE=this.side,"NONE"!==n&&(e.HAS_LIGHT=1),this.premultiplyAlpha&&(e.PREMULTIPLY_ALPHA=1);var i=this._textureOption.reset(e);return e.HAS_LIGHT&&(e.HAS_NORMAL=1,i.add(this.normalMap,"NORMAL_MAP",(function(){1!==t.normalMapScale&&(e.NORMAL_MAP_SCALE=1)}))),i.add(this.parallaxMap,"PARALLAX_MAP"),i.add(this.emission,"EMISSION_MAP"),i.add(this.transparency,"TRANSPARENCY_MAP"),this.ignoreTranparent&&(e.IGNORE_TRANSPARENT=1),this.alphaCutoff>0&&(e.ALPHA_CUTOFF=1),this.useHDR&&(e.USE_HDR=1),this.gammaCorrection&&(e.GAMMA_CORRECTION=1),this.receiveShadows&&(e.RECEIVE_SHADOWS=1),this.castShadows&&(e.CAST_SHADOWS=1),this.uvMatrix&&(e.UV_MATRIX=1),this.uvMatrix1&&(e.UV_MATRIX1=1),this.usePhysicsLight&&(e.USE_PHYSICS_LIGHT=1),this.isDiffuesEnvAndAmbientLightWorkTogether&&(e.IS_DIFFUESENV_AND_AMBIENTLIGHT_WORK_TOGETHER=1),i.update(),e},_textureOption:{uvTypes:null,option:null,reset:function(t){return this.option=t,this.uvTypes={},this},add:function(t,e,n){if(t&&t.isTexture){var i=this.uvTypes,r=this.option,s=t.uv||0;i[s]=1,r[e]=s,t.isCubeTexture&&(r["".concat(e,"_CUBE")]=1),n&&n(t)}return this},update:function(){var t=[0,1],e=this.uvTypes,n=this.option;for(var i in e)-1!==t.indexOf(Number(i))?n["HAS_TEXCOORD".concat(i)]=1:(m.a.warnOnce("Material._textureOption.update(".concat(i,")"),"uv_".concat(i," not support!")),n.HAS_TEXCOORD0=1);return this}},getInstancedUniforms:function(){var t=this._instancedUniforms;if(!this._instancedUniforms){var e=this.uniforms;for(var n in t=this._instancedUniforms=[],e){var i=this.getUniformInfo(n);i.isDependMesh&&!i.notSupportInstanced&&t.push({name:n,info:i})}}return t},getUniformData:function(t,e,n){return this.getUniformInfo(t).get(e,this,n)},getAttributeData:function(t,e,n){return this.getAttributeInfo(t).get(e,this,n)},getUniformInfo:function(t){return this.getInfo("uniforms",t)},getAttributeInfo:function(t){return this.getInfo("attributes",t)},getInfo:function(t,e){var n=this[t][e];return"string"==typeof n&&(n=Ce[n]),n&&n.get||(m.a.warnOnce("material.getInfo-"+e,"Material.getInfo: no this semantic:"+e),n=je),n},clone:function(){var t=new this.constructor;for(var e in this)"id"!==e&&(t[e]=this[e]);return t},destroyTextures:function(){this.getTextures().forEach((function(t){t.destroy()}))},getTextures:function(){var t=[];for(var e in this){var n=this[e];n&&n.isTexture&&t.push(n)}return t},_copyProps:function(t,e){for(var n in e)void 0===t[n]&&(t[n]=e[n])}}),ze=s.a.create({Extends:ke,isBasicMaterial:!0,className:"BasicMaterial",lightType:"BLINN-PHONG",diffuse:null,ambient:null,specular:null,emission:null,specularEnvMap:null,specularEnvMatrix:null,reflectivity:0,refractRatio:0,refractivity:0,shininess:32,usedUniformVectors:11,constructor:function(t){this.diffuse=new v.a(.5,.5,.5),this.specular=new v.a(1,1,1),this.emission=new v.a(0,0,0),ze.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT",u_shininess:"SHININESS",u_reflectivity:"REFLECTIVITY",u_refractRatio:"REFRACTRATIO",u_refractivity:"REFRACTIVITY",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvMatrix:"SPECULARENVMATRIX"}),this.addTextureUniforms({u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ze.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t),n=this.lightType;"PHONG"!==n&&"BLINN-PHONG"!==n||(t.HAS_SPECULAR=1);var i=this.diffuse;return i&&i.isTexture&&(i.isCubeTexture?t.DIFFUSE_CUBE_MAP=1:e.add(this.diffuse,"DIFFUSE_MAP")),t.HAS_LIGHT&&(e.add(this.specular,"SPECULAR_MAP"),e.add(this.ambient,"AMBIENT_MAP"),e.add(this.specularEnvMap,"SPECULAR_ENV_MAP")),e.update(),t}}),qe=ze,We=C.a.POSITION,Ye=C.a.NORMAL,Ze=C.a.DEPTH,Ke=C.a.DISTANCE,Qe=C.a.NONE,Je=s.a.create({Extends:qe,isGeometryMaterial:!0,className:"GeometryMaterial",vertexType:We,lightType:Qe,writeOriginData:!1,constructor:function(t){Je.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_cameraFar:"CAMERAFAR",u_cameraNear:"CAMERANEAR",u_cameraType:"CAMERATYPE"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(Je.superclass.getRenderOption.call(this,t),t["VERTEX_TYPE_".concat(this.vertexType)]=1,this.vertexType){case We:t.HAS_FRAG_POS=1;break;case Ye:t.HAS_NORMAL=1;break;case Ze:break;case Ke:t.HAS_FRAG_POS=1}return this.writeOriginData&&(t.WRITE_ORIGIN_DATA=1),t}}),$e=Je,tn=s.a.create({Extends:O,isOrthographicCamera:!0,className:"OrthographicCamera",_left:-1,left:{get:function(){return this._left},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._left=t}},_right:1,right:{get:function(){return this._right},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._right=t}},_bottom:-1,bottom:{get:function(){return this._bottom},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._bottom=t}},_top:1,top:{get:function(){return this._top},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._top=t}},_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:1,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},constructor:function(t){tn.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=[this.left,this.bottom,-this.near],i=[this.right,this.bottom,-this.near],r=[this.right,this.top,-this.near],s=[this.left,this.top,-this.near],a=[this.left,this.bottom,-this.far],o=[this.right,this.bottom,-this.far],u=[this.right,this.top,-this.far],c=[this.left,this.top,-this.far];e.addRect(a,o,u,c),e.addRect(o,i,r,u),e.addRect(i,n,s,r),e.addRect(n,a,c,s),e.addRect(c,u,r,s),e.addRect(n,i,o,a),this._geometry=e}return this._geometry}}),en=tn,nn=C.a.DEPTH,rn=C.a.BACK,sn=null,an=new v.a(1,1,1),on=new o.a,un=function(t){return t.material.castShadows},cn=s.a.create({isLightShadow:!0,className:"LightShadow",light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,cameraInfo:null,debug:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},createFramebuffer:function(){this.framebuffer||(this.framebuffer=new re(this.renderer,{width:this.width,height:this.height}),this.debug&&this.showShadowMap())},updateLightCamera:function(t){this.light.isDirectionalLight?this.updateDirectionalLightCamera(t):this.light.isSpotLight&&this.updateSpotLightCamera(t)},updateDirectionalLightCamera:function(t){var e=this.light;if(this.camera.lookAt(e.direction),this.cameraInfo)this.updateCustumCamera(this.cameraInfo);else{var n=t.getGeometry();if(n){this.camera.updateViewMatrix(),on.multiply(this.camera.viewMatrix,t.worldMatrix);var i=n.getBounds(on);this.camera.near=-i.zMax,this.camera.far=-i.zMin,this.camera.left=i.xMin,this.camera.right=i.xMax,this.camera.bottom=i.yMin,this.camera.top=i.yMax}}this.camera.updateViewMatrix()},updateCustumCamera:function(t){for(var e in t)this.camera[e]=t[e]},updateSpotLightCamera:function(t){var e=this.light;this.camera.lookAt(e.direction),this.cameraInfo?this.updateCustumCamera(this.cameraInfo):(this.camera.fov=2*e.outerCutoff,this.camera.near=.01,this.camera.far=t.far,this.camera.aspect=1),this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.light.isDirectionalLight?this.camera=new en:this.light.isSpotLight&&(this.camera=new Q),this.camera.addTo(this.light)),this._cameraMatrixVersion!==t.matrixVersion&&(this.updateLightCamera(t),this._cameraMatrixVersion=t.matrixVersion)},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;sn||(sn=new $e({vertexType:nn,side:rn,writeOriginData:!0})),n.bind(),e.state.viewport(0,0,this.width,this.height),e.clear(an),i.updateViewProjectionMatrix(),Ce.setCamera(i),e.forceMaterial=sn,this.renderShadowScene(e),delete e.forceMaterial,n.unbind(),Ce.setCamera(t),e.viewport()},renderShadowScene:function(t){t.renderList.traverse((function(e){un(e)&&t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e.filter((function(t){return un(t)})))}))},showShadowMap:function(){var t=this;this.renderer.on("afterRender",(function(){t.framebuffer.render(0,.7,.3,.3)}))}}),hn=C.a.DISTANCE,fn=C.a.BACK,ln=C.a.TEXTURE_CUBE_MAP,dn=C.a.TEXTURE0,mn=C.a.TEXTURE_CUBE_MAP_POSITIVE_X,_n=C.a.NEAREST,pn=C.a.FRAMEBUFFER,gn=C.a.FRAMEBUFFER_COMPLETE,vn=null,En=new v.a(0,0,0,0),Tn=new c.a,Mn=[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0]],An=function(t,e){if(t.material.castShadows){if(!t.frustumTest)return!0;if(e.isMeshVisible(t))return!0}return!1},In=s.a.create({isLightShadow:!0,className:"CubeLightShadow",Extends:cn,light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,debug:!1,constructor:function(t){In.superclass.constructor.call(this,t)},createFramebuffer:function(){if(!this.framebuffer){this.framebuffer=new re(this.renderer,{target:ln,width:1024,height:1024,createTexture:function(){var t=this.state.gl,e=new fe({image:[null,null,null,null,null,null],type:this.type,format:this.format,internalFormat:this.internalFormat,magFilter:_n,minFilter:_n,width:1024,height:1024});return t.checkFramebufferStatus(pn)!==gn&&m.a.warn("Framebuffer is not complete",t.checkFramebufferStatus(pn)),e},bindTexture:function(t){t=t||0;var e=this.state,n=e.gl,i=this.texture.getGLTexture(e);e.activeTexture(dn+et.MAX_TEXTURE_INDEX),e.bindTexture(this.target,i),n.framebufferTexture2D(pn,this.attachment,mn+t,i,0)}})}},updateLightCamera:function(t){this.camera.fov=90,this.camera.near=t.near,this.camera.far=t.far,this.camera.aspect=1,this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.camera=new Q,this.updateLightCamera(t))},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;vn||(vn=new $e({vertexType:hn,side:fn,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,n.width,n.height),this.light.worldMatrix.getTranslation(i.position);for(var r=0;r<6;r++)n.bindTexture(r),Tn.fromArray(Mn[0],3*r).add(i.position),i.up.fromArray(Mn[1],3*r),i.lookAt(Tn),i.updateViewProjectionMatrix(),e.clear(En),Ce.setCamera(i),e.forceMaterial=vn,this.renderShadowScene(e);i.matrix.identity(),i.updateViewProjectionMatrix(),delete e.forceMaterial,n.unbind(),Ce.setCamera(t),e.viewport()},renderShadowScene:function(t){var e=t.renderList,n=this.camera;e.traverse((function(e){An(e,n)&&t.renderMesh(e)}),(function(e){var i=e.filter((function(t){return An(t,n)}));t.renderInstancedMeshes(i)}))}}),Ln=In,On=s.a.create({Extends:M,isPointLight:!0,className:"PointLight",constructor:function(t){On.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new Ln({light:this,renderer:t}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))}}),Sn=On,Rn=new o.a,yn=new c.a,xn=s.a.create({Extends:M,isDirectionalLight:!0,className:"DirectionalLight",shadow:null,constructor:function(t){this.direction=new c.a(0,0,1),xn.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new cn({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return yn.copy(this.direction).transformDirection(this.worldMatrix).normalize(),yn},getViewDirection:function(t){var e=t.getModelViewMatrix(this,Rn);return yn.copy(this.direction).transformDirection(e).normalize(),yn}}),Nn=xn,bn=new o.a,wn=new c.a,Cn=s.a.create({Extends:M,isSpotLight:!0,className:"SpotLight",shadow:null,_cutoffCos:.9763,_cutoff:12.5,cutoff:{get:function(){return this._cutoff},set:function(t){this._cutoff=t,this._cutoffCos=Math.cos(d.a.degToRad(t))}},_outerCutoffCos:.9537,_outerCutoff:17.5,outerCutoff:{get:function(){return this._outerCutoff},set:function(t){this._outerCutoff=t,this._outerCutoffCos=Math.cos(d.a.degToRad(t))}},constructor:function(t){this.direction=new c.a(0,0,1),Cn.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new cn({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return wn.copy(this.direction).transformDirection(this.worldMatrix).normalize(),wn},getViewDirection:function(t){var e=t.getModelViewMatrix(this,bn);return wn.copy(this.direction).transformDirection(e).normalize(),wn}}),Pn=Cn,Hn=s.a.create({Extends:ke,isShaderMaterial:!0,className:"ShaderMaterial",vs:"",fs:"",useHeaderCache:!1,constructor:function(t){Hn.superclass.constructor.call(this,t)},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Hn.superclass.getRenderOption.call(this,t),this.getCustomRenderOption){var e=this.getCustomRenderOption({});for(var n in e)t["HILO_CUSTUM_OPTION_".concat(n)]=e[n]}return t},getCustomRenderOption:null}),Dn=Hn,Fn=n(15),Un=n.n(Fn),Gn=s.a.create({Extends:Z,isMorphGeometry:!0,className:"MorphGeometry",isStatic:!1,weights:[],targets:null,constructor:function(t){Gn.superclass.constructor.call(this,t),this.weights=this.weights||[]},update:function(t,e){this.weights=t,this._originalMorphIndices=e},clone:function(){return Z.prototype.clone.call(this,{targets:this.targets,weights:this.weights})},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Gn.superclass.getRenderOption.call(this,e),this.targets&&(this._maxMorphTargetCount||(this._maxMorphTargetCount=Math.floor(8/Object.keys(this.targets).length)),Object(r.each)(this.targets,(function(n,i){e.MORPH_TARGET_COUNT=Math.min(n.length,t._maxMorphTargetCount),"vertices"===i?e.MORPH_HAS_POSITION=1:"normals"===i?e.MORPH_HAS_NORMAL=1:"tangents"===i&&(e.MORPH_HAS_TANGENT=1)}))),e}}),Bn=Gn,Vn={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},Xn={Geometry:Z,GeometryData:w};var jn={_decodeTotalTime:0,wasmURL:"",workerURL:"",useWASM:!0,useWebWorker:!0,useAuto:!0,init:function(){return jn.useAuto?Un.a.initWASM(jn.wasmURL,jn.memPages):jn.useWebWorker?Un.a.initWorker(jn.workerURL):jn.useWASM?Un.a.initWASM(jn.wasmURL,jn.memPages):Promise.resolve()},parse:function(t,e,n,i){var r=Date.now(),s=e.bufferViews[t.bufferView],a=jn.wasmURL,o=jn.workerURL,u=jn.useAuto,c=jn.useWASM,h=jn.useWebWorker,f=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);function l(e){jn._decodeTotalTime+=Date.now()-r;var n=e.toHilo3dGeometry(Xn,i.primitive._geometry);return t.targets&&(n=function(t,e,n){if(!n.isMorphGeometry){var i=new Bn;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&"id"!==r&&(i[r]=n[r]);i.targets={},n=i}for(var s=n.targets,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return t["FOG_".concat(this.mode)]=1,t}}),ei=n(16),ni=new ei.a,ii=new o.a,ri=s.a.create({Extends:g,isMesh:!0,className:"Mesh",geometry:null,material:null,useInstanced:!1,frustumTest:!0,constructor:function(t){ri.superclass.constructor.call(this,t),this._usedResourceDict={}},clone:function(t){var e=g.prototype.clone.call(this,t);return Object.assign(e,{geometry:this.geometry,material:this.material}),e},raycast:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.visible)return null;var n=this.geometry,i=this.material,r=this.worldMatrix;if(n&&i){ii.invert(r),ni.copy(t),ni.transformMat4(ii);var s=n.raycast(ni,i.side,e);if(s)return s.forEach((function(t){t.transformMat4(r)})),s}return null},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.geometry.getRenderOption(t),t},useResource:function(t){t&&(this._usedResourceDict[t.className+":"+t.id]=t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._isDestroyed)return this;this.removeFromParent();var n=t.resourceManager,i=this._usedResourceDict;for(var r in i)n.destroyIfNoRef(i[r]);return this.material&&e&&this.material.destroyTextures(),this.off(),this._usedResourceDict=null,this.geometry=null,this.material=null,this._isDestroyed=!0,this}}),si=ri,ai=new o.a,oi=new o.a,ui=s.a.create({Extends:si,isSkinedMesh:!0,className:"SkinedMesh",_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initJointNodeList()}},jointNodeList:null,useInstanced:!1,jointMatTexture:null,frustumTest:!1,constructor:function(t){this.jointNames=[],this.inverseBindMatrices=[],ui.superclass.constructor.call(this,t)},initJointNodeList:function(){var t=this;if(this._rootNode){var e={};this._rootNode.traverse((function(t){"jointName"in t&&(e[t.jointName]=t)})),this.jointNodeList=[],this.jointNames.forEach((function(n){t.jointNodeList.push(e[n])}))}},getJointMat:function(){var t=this;if(this.jointNodeList)return this.jointMat||(this.jointMat=new Float32Array(16*this.jointNodeList.length)),this._rootNode||!this.clonedFrom?oi.invert(this.worldMatrix):oi.invert(this.clonedFrom.worldMatrix),this.jointNodeList.forEach((function(e,n){ai.copy(oi),ai.multiply(e.worldMatrix),ai.multiply(t.inverseBindMatrices[n]),ai.toArray(t.jointMat,16*n)})),this.jointMat},initJointMatTexture:function(){if(!this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture=new ve({data:t})}return this.jointMatTexture},updateJointMatTexture:function(){if(this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture.data.set(t,0),this.jointMatTexture.needUpdate=!0}else this.initJointMatTexture()},clone:function(t){var e=si.prototype.clone.call(this,t);return Object.assign(e,{useInstanced:this.useInstanced,jointNames:this.jointNames.slice(),inverseBindMatrices:this.inverseBindMatrices.map((function(t){return t.clone()})),jointNodeList:this.jointNodeList}),e.clonedFrom=this,e},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ui.superclass.getRenderOption.call(this,t);var e=this.jointNames.length;if(e&&(t.JOINT_COUNT=e,et.VERTEX_TEXTURE_FLOAT)){var n=(et.MAX_VERTEX_UNIFORM_VECTORS-22)/4;e>n&&(t.JOINT_MAT_MAP=1)}return t}}),ci=ui,hi="1.14.0",fi=s.a.create({className:"RenderInfo",isRenderInfo:!0,constructor:function(){this.reset()},addFaceCount:function(t){this._currentFaceCount+=t},addDrawCount:function(t){this._currentDrawCount+=t},reset:function(){this.faceCount=Math.floor(this._currentFaceCount),this.drawCount=Math.floor(this._currentDrawCount),this._currentFaceCount=0,this._currentDrawCount=0}}),li=new c.a,di=function(t,e){var n=t.material.renderOrder,i=e.material.renderOrder;if(n!==i)return n-i;var r=t.material._shaderNumId||0,s=e.material._shaderNumId||0;return r!==s?r-s:t._sortRenderZ-e._sortRenderZ},mi=function(t,e){var n=t.material.renderOrder,i=e.material.renderOrder;return n!==i?n-i:e._sortRenderZ-t._sortRenderZ},_i=s.a.create({className:"RenderList",isRenderList:!0,useInstanced:!1,constructor:function(){this.opaqueList=[],this.transparentList=[],this.instancedDict={}},reset:function(){this.opaqueList.length=0,this.transparentList.length=0,this.instancedDict={}},traverse:function(t,e){this.opaqueList.forEach((function(e){t(e)}));var n=this.instancedDict;for(var i in n){var r=n[i];r.length>2&&e?e(r):r.forEach((function(e){t(e)}))}this.transparentList.forEach((function(e){t(e)}))},sort:function(){this.transparentList.sort(mi),this.opaqueList.sort(di)},addMesh:function(t,e){var n=t.material,i=t.geometry;if(n&&i){if(t.frustumTest&&!e.isMeshVisible(t))return;if(this.useInstanced&&t.useInstanced){var r=this.instancedDict,s=n.id+"_"+i.id,a=r[s];r[s]||(a=r[s]=[]),a.push(t)}else t.worldMatrix.getTranslation(li),li.transformMat4(e.viewProjectionMatrix),t._sortRenderZ=li.z,n.transparent?this.transparentList.push(t):this.opaqueList.push(t)}else m.a.warnOnce("RenderList.addMesh(".concat(t.id,")"),"Mesh must have material and geometry",t)}}),pi=s.a.create({className:"WebGLState",isWebGLState:!0,systemFramebuffer:null,constructor:function(t){this.gl=t,this.reset()},reset:function(){this._dict={},this.activeTextureIndex=null,this.textureUnitDict={},this.currentFramebuffer=null,this.preFramebuffer=null,this._pixelStorei={}},enable:function(t){!0!==this._dict[t]&&(this._dict[t]=!0,this.gl.enable(t))},disable:function(t){!1!==this._dict[t]&&(this._dict[t]=!1,this.gl.disable(t))},bindFramebuffer:function(t,e){this.currentFramebuffer!==e&&(this.preFramebuffer=this.currentFramebuffer,this.currentFramebuffer=e,this.gl.bindFramebuffer(t,e))},bindSystemFramebuffer:function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,this.systemFramebuffer)},useProgram:function(t){this.set1("useProgram",t)},depthFunc:function(t){this.set1("depthFunc",t)},depthMask:function(t){this.set1("depthMask",t)},clear:function(t){this.gl.clear(t)},depthRange:function(t,e){this.set2("depthRange",t,e)},stencilFunc:function(t,e,n){this.set3("stencilFunc",t,e,n)},stencilMask:function(t){this.set1("stencilMask",t)},stencilOp:function(t,e,n){this.set3("stencilOp",t,e,n)},colorMask:function(t,e,n,i){this.set4("colorMask",t,e,n,i)},cullFace:function(t){this.set1("cullFace",t)},frontFace:function(t){this.set1("frontFace",t)},blendFuncSeparate:function(t,e,n,i){this.set4("blendFuncSeparate",t,e,n,i)},blendEquationSeparate:function(t,e){this.set2("blendEquationSeparate",t,e)},pixelStorei:function(t,e){this._pixelStorei[t]!==e&&(this._pixelStorei[t]=e,this.gl.pixelStorei(t,e))},viewport:function(t,e,n,i){this.set4("viewport",t,e,n,i)},activeTexture:function(t){this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},bindTexture:function(t,e){var n=this.getActiveTextureUnit();n[t]!==e&&(n[t]=e,this.gl.bindTexture(t,e))},getActiveTextureUnit:function(){var t=this.textureUnitDict[this.activeTextureIndex];return t||(t=this.textureUnitDict[this.activeTextureIndex]={}),t},set1:function(t,e){this._dict[t]!==e&&(this._dict[t]=e,this.gl[t](e))},set2:function(t,e,n){var i=this._dict[t];i||(i=this._dict[t]=[]),i[0]===e&&i[1]===n||(i[0]=e,i[1]=n,this.gl[t](e,n))},set3:function(t,e,n,i){var r=this._dict[t];r||(r=this._dict[t]=[]),r[0]===e&&r[1]===n&&r[2]===i||(r[0]=e,r[1]=n,r[2]=i,this.gl[t](e,n,i))},set4:function(t,e,n,i,r){var s=this._dict[t];s||(s=this._dict[t]=[]),s[0]===e&&s[1]===n&&s[2]===i&&s[3]===r||(s[0]=e,s[1]=n,s[2]=i,s[3]=r,this.gl[t](e,n,i,r))},get:function(t){return this._dict[t]}}),gi=s.a.create({className:"WebGLResourceManager",isWebGLResourceManager:!0,hasNeedDestroyResource:!1,constructor:function(t){Object.assign(this,t)},useResource:function(t,e){if(t){var n=t.className+":"+t.id;this._usedResourceDict[n]||(this._usedResourceDict[n]=t,t.useResource&&t.useResource(this,e))}return e&&e.useResource(t),this},destroyIfNoRef:function(t){return this._needDestroyDict||(this._needDestroyDict={}),t&&(this.hasNeedDestroyResource=!0,this._needDestroyDict[t.className+":"+t.id]=t),this},destroyUnsuedResource:function(){if(!this.hasNeedDestroyResource)return this;var t=this._needDestroyDict,e=this._usedResourceDict;for(var n in t)if(!e[n]){var i=t[n];i&&!i.alwaysUse&&i.destroy&&i.destroy()}return this._needDestroyDict={},this.hasNeedDestroyResource=!1,this},reset:function(){return this._usedResourceDict={},this}}),vi=new o.a,Ei=new c.a,Ti=new Float32Array([0,0,0]),Mi=s.a.create({isLightManager:!0,className:"LightManager",constructor:function(t){this.ambientLights=[],this.directionalLights=[],this.pointLights=[],this.spotLights=[],this.areaLights=[],this.lightInfo={AMBIENT_LIGHTS:0,POINT_LIGHTS:0,DIRECTIONAL_LIGHTS:0,SPOT_LIGHTS:0,AREA_LIGHTS:0,uid:0},Object.assign(this,t)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(r.each)(this.lightInfo,(function(n,i){if("uid"!==i&&n){e[i]=n;var r=t.getShadowMapCount(i);r&&(e[i+"_SMC"]=r)}})),e},addLight:function(t){var e=null;return t.enabled?(t.isAmbientLight?e=this.ambientLights:t.isDirectionalLight?e=this.directionalLights:t.isPointLight?e=this.pointLights:t.isSpotLight?e=this.spotLights:t.isAreaLight?e=this.areaLights:m.a.warnOnce("LightManager.addLight(".concat(t.id,")"),"Not support this light:",t),e&&(t.shadow?e.unshift(t):e.push(t)),this):this},getDirectionalInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[];this.directionalLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(e,c),o.getViewDirection(t).toArray(n,c),o.shadow&&o.lightShadow&&(i.push(o.lightShadow.framebuffer.texture),r.push(o.lightShadow.width),r.push(o.lightShadow.height),a.push(o.lightShadow.minBias,o.lightShadow.maxBias),vi.copy(t.worldMatrix),vi.premultiply(o.lightShadow.camera.viewProjectionMatrix),vi.toArray(s,16*u))}));var o={colors:new Float32Array(e),infos:new Float32Array(n)};return i.length&&(o.shadowMap=i,o.shadowMapSize=new Float32Array(r),o.shadowBias=new Float32Array(a),o.lightSpaceMatrix=new Float32Array(s)),o},getSpotInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[],c=[],h=[];this.spotLights.forEach((function(f,l){var d=3*l;f.getRealColor().toRGBArray(e,d),f.toInfoArray(n,d),f.getViewDirection(t).toArray(r,d),h.push(f.range),s.push(f._cutoffCos,f._outerCutoffCos),t.getModelViewMatrix(f,vi),vi.getTranslation(Ei),Ei.toArray(i,d),f.shadow&&f.lightShadow&&(a.push(f.lightShadow.framebuffer.texture),o.push(f.lightShadow.width),o.push(f.lightShadow.height),c.push(f.lightShadow.minBias,f.lightShadow.maxBias),vi.multiply(f.lightShadow.camera.viewProjectionMatrix,t.worldMatrix),vi.toArray(u,16*l))}));var f={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),dirs:new Float32Array(r),cutoffs:new Float32Array(s),ranges:new Float32Array(h)};return a.length&&(f.shadowMap=a,f.shadowMapSize=new Float32Array(o),f.shadowBias=new Float32Array(c),f.lightSpaceMatrix=new Float32Array(u)),f},getPointInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[];this.pointLights.forEach((function(c,h){var f=3*h;c.getRealColor().toRGBArray(e,f),c.toInfoArray(n,f),u.push(c.range),t.getModelViewMatrix(c,vi),vi.getTranslation(Ei),Ei.toArray(i,f),c.shadow&&c.lightShadow&&(r.push(c.lightShadow.framebuffer.texture),a.push(c.lightShadow.minBias,c.lightShadow.maxBias),t.worldMatrix.toArray(s,16*h),o[2*h]=c.lightShadow.camera.near,o[2*h+1]=c.lightShadow.camera.far)}));var c={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),ranges:new Float32Array(u)};return r.length&&(c.shadowMap=r,c.shadowBias=new Float32Array(a),c.lightSpaceMatrix=new Float32Array(s),c.cameras=new Float32Array(o)),c},getAreaInfo:function(t){var e,n,i=[],r=[],s=[],a=[];return this.areaLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(i,c),t.getModelViewMatrix(o,vi),vi.getTranslation(Ei),Ei.toArray(r,c);var h=vi.getRotation();vi.fromQuat(h),Ei.set(.5*o.width,0,0),Ei.transformMat4(vi),Ei.toArray(s,c),Ei.set(0,.5*o.height,0),Ei.transformMat4(vi),Ei.toArray(a,c),e=o.ltcTexture1,n=o.ltcTexture2})),{colors:new Float32Array(i),poses:new Float32Array(r),width:new Float32Array(s),height:new Float32Array(a),ltcTexture1:e,ltcTexture2:n}},getAmbientInfo:function(){return Ti[0]=Ti[1]=Ti[2]=0,this.ambientLights.forEach((function(t){var e=t.getRealColor();Ti[0]+=e.r,Ti[1]+=e.g,Ti[2]+=e.b})),Ti[0]=Math.min(1,Ti[0]),Ti[1]=Math.min(1,Ti[1]),Ti[2]=Math.min(1,Ti[2]),Ti},updateInfo:function(t){var e=this.lightInfo,n=this.ambientLights,i=this.directionalLights,r=this.pointLights,s=this.spotLights,a=this.areaLights;e.AMBIENT_LIGHTS=n.length,e.POINT_LIGHTS=r.length,e.DIRECTIONAL_LIGHTS=i.length,e.SPOT_LIGHTS=s.length,e.AREA_LIGHTS=a.length;var o=function(t){return!!t.shadow};e.SHADOW_POINT_LIGHTS=r.filter(o).length,e.SHADOW_SPOT_LIGHTS=s.filter(o).length,e.SHADOW_DIRECTIONAL_LIGHTS=i.filter(o).length,e.uid=[e.AMBIENT_LIGHTS,e.POINT_LIGHTS,e.SHADOW_POINT_LIGHTS,e.DIRECTIONAL_LIGHTS,e.SHADOW_DIRECTIONAL_LIGHTS,e.SPOT_LIGHTS,e.SHADOW_SPOT_LIGHTS,e.AREA_LIGHTS].join("_"),this.directionalInfo=this.getDirectionalInfo(t),this.pointInfo=this.getPointInfo(t),this.spotInfo=this.getSpotInfo(t),this.areaInfo=this.getAreaInfo(t),this.ambientInfo=this.getAmbientInfo()},getInfo:function(){return this.lightInfo},reset:function(){this.ambientLights.length=0,this.directionalLights.length=0,this.pointLights.length=0,this.spotLights.length=0,this.areaLights.length=0},getShadowMapCount:function(t){var e=[];"POINT_LIGHTS"===t?e=this.pointLights:"DIRECTIONAL_LIGHTS"===t?e=this.directionalLights:("SPOT_LIGHTS"===t||"AREA_LIGHTS"===t)&&(e=this.spotLights);var n=0;return e.forEach((function(t){n+=t.shadow?1:0})),n},createShadowMap:function(t,e){this.directionalLights.forEach((function(n){n.createShadowMap(t,e)})),this.spotLights.forEach((function(n){n.createShadowMap(t,e)})),this.pointLights.forEach((function(n){n.createShadowMap(t,e)})),this.areaLights.forEach((function(n){n.createShadowMap(t,e)}))}}),Ai=C.a.DEPTH_TEST,Ii=C.a.SAMPLE_ALPHA_TO_COVERAGE,Li=C.a.CULL_FACE,Oi=C.a.FRONT_AND_BACK,Si=C.a.BLEND,Ri=C.a.LINES,yi=C.a.STATIC_DRAW,xi=C.a.DYNAMIC_DRAW,Ni=s.a.create({Mixes:a.a,className:"WebGLRenderer",isWebGLRenderer:!0,gl:null,width:0,height:0,pixelRatio:1,domElement:null,useInstanced:!1,useVao:!0,alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!1,gameMode:!1,useFramebuffer:!1,framebufferOption:{},useLogDepth:!1,vertexPrecision:"highp",fragmentPrecision:"highp",fog:null,offsetX:0,offsetY:0,isInitFailed:!1,_isInit:!1,_isContextLost:!1,constructor:function(t){this.clearColor=new v.a(1,1,1),Object.assign(this,t),this.renderInfo=new fi,this.renderList=new _i,this.lightManager=new Mi,this.resourceManager=new gi},resize:function(t,e,n){if(n||this.width!==t||this.height!==e){var i=this.domElement;this.width=t,this.height=e,i.width=t,i.height=e,this.framebuffer&&this.framebuffer.resize(this.width,this.height,n),this.viewport()}},setOffset:function(t,e){this.offsetX===t&&this.offsetY===e||(this.offsetX=t,this.offsetY=e,this.viewport())},viewport:function(t,e,n,i){var r=this.state,s=this.gl;r&&(void 0===t?t=this.offsetX:this.offsetX=t,void 0===e?e=this.offsetY:this.offsetY=e,void 0===n&&(n=s.drawingBufferWidth),void 0===i&&(i=s.drawingBufferHeight),r.viewport(t,e,n,i))},isInit:{get:function(){return this._isInit&&!this.isInitFailed}},onInit:function(t){var e=this;this._isInit?t(this):this.on("init",(function(){t(e)}),!0)},initContext:function(){if(!this._isInit){this._isInit=!0;try{this._initContext(),this.fire("init")}catch(t){this.isInitFailed=!0,this.fire("initFailed",t)}}},_initContext:function(){var t=this,e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat};!0===this.preserveDrawingBuffer&&(e.preserveDrawingBuffer=!0),!0===this.gameMode&&(e.gameMode=!0);var n=this.gl=this.domElement.getContext("webgl",e);n.viewport(0,0,this.width,this.height),Tt.init(n),tt.init(n),et.init(n),dt.init(this),this.state=new pi(n),tt.instanced||(this.useInstanced=!1),this.renderList.useInstanced=this.useInstanced,tt.vao||(this.useVao=!1),this.useFramebuffer&&(this.framebuffer=new re(this,Object.assign({useVao:this.useVao,width:this.width,height:this.height},this.framebufferOption))),this.domElement.addEventListener("webglcontextlost",(function(e){t._onContextLost(e)}),!1),this.domElement.addEventListener("webglcontextrestored",(function(e){t._onContextRestore(e)}),!1)},_onContextLost:function(t){this.fire("webglContextLost");var e=this.gl;this._isContextLost=!0,t.preventDefault(),It.reset(e),dt.reset(e),qt.reset(e),xt.reset(e),Ft.reset(e),this.state.reset(e),this._lastMaterial=null,this._lastProgram=null},_onContextRestore:function(t){this.fire("webglContextRestored");var e=this.gl;this._isContextLost=!1,tt.reset(e),re.reset(e)},setupDepthTest:function(t){var e=this.state;t.depthTest?(e.enable(Ai),e.depthFunc(t.depthFunc),e.depthMask(t.depthMask),e.depthRange(t.depthRange[0],t.depthRange[1])):e.disable(Ai)},setupSampleAlphaToCoverage:function(t){var e=this.state;t.sampleAlphaToCoverage?e.enable(Ii):e.disable(Ii)},setupCullFace:function(t){var e=this.state;t.cullFace&&t.cullFaceType!==Oi?(e.enable(Li),e.cullFace(t.cullFaceType)):e.disable(Li)},setupBlend:function(t){var e=this.state;t.blend?(e.enable(Si),e.blendFuncSeparate(t.blendSrc,t.blendDst,t.blendSrcAlpha,t.blendDstAlpha),e.blendEquationSeparate(t.blendEquation,t.blendEquationAlpha)):e.disable(Si)},setupUniforms:function(t,e,n,i){var r=this.forceMaterial||e.material;for(var s in t.uniforms){var a=r.getUniformInfo(s),o=t.uniforms[s];if(!a.isBlankInfo&&(i||a.isDependMesh&&!n)){var u=a.get(e,r,o);null!=u&&(t[s]=u)}}},setupVao:function(t,e,n){var i=n.geometry,r=i.isStatic;if(t.isDirty||!r||i.isDirty){t.isDirty=!1;var s=this.forceMaterial||n.material,a=s.attributes,o=r?yi:xi;for(var u in a){var c=e.attributes[u];if(c){var h=s.getAttributeData(u,n,c);null!=h&&t.addAttribute(h,c,o)}}i.indices&&t.addIndexBuffer(i.indices,o),i.isDirty=!1}i.vertexCount&&(t.vertexCount=i.vertexCount)},setupMaterial:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.forceMaterial||e.material;(r.isDirty||this._lastMaterial!==r)&&(this.setupDepthTest(r),this.setupSampleAlphaToCoverage(r),this.setupCullFace(r),this.setupBlend(r),i=!0),this.setupUniforms(t,e,n,i),r.isDirty=!1,this._lastMaterial=r},setupMesh:function(t,e){var n=this.gl,i=this.state,r=this.lightManager,s=this.resourceManager,a=t.geometry,o=this.forceMaterial||t.material,u=dt.getShader(t,o,e,r,this.fog,this.useLogDepth),c=It.getProgram(u,i);c.useProgram(),this.setupMaterial(c,t,e,this._lastProgram!==c),this._lastProgram=c,t.material.wireframe&&a.mode!==Ri&&a.convertToLinesMode();var h=a.id+c.id,f=Ft.getVao(n,h,{useInstanced:e,useVao:this.useVao,mode:a.mode});return this.setupVao(f,c,t),s.useResource(f,t).useResource(u,t).useResource(c,t),{vao:f,program:c,geometry:a}},addRenderInfo:function(t,e){var n=this.renderInfo;n.addFaceCount(t),n.addDrawCount(e)},render:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.initContext(),!this.isInitFailed&&!this._isContextLost){var i=this.renderList,r=this.renderInfo,s=this.lightManager,a=this.resourceManager,o=this.state;this.fog=t.fog,s.reset(),r.reset(),i.reset(),a.reset(),Ce.init(this,o,e,s,this.fog),t.updateMatrixWorld(),e.updateViewProjectionMatrix(),t.traverse((function(t){return t.visible?(t.isMesh?i.addMesh(t,e):t.isLight&&s.addLight(t),g.TRAVERSE_STOP_NONE):g.TRAVERSE_STOP_CHILDREN})),i.sort(),s.createShadowMap(this,e),s.updateInfo(e),n&&this.fire("beforeRender"),this.useFramebuffer&&this.framebuffer.bind(),this.clear(),n&&this.fire("beforeRenderScene"),this.renderScene(),this.useFramebuffer&&this.renderToScreen(this.framebuffer),n&&this.fire("afterRender"),a.destroyUnsuedResource()}},renderScene:function(){var t=this;this.renderList.traverse((function(e){t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e)})),this._gameModeSumbit()},_gameModeSumbit:function(){var t=this.gl;this.gameMode&&t&&t.submit&&t.submit()},clear:function(t){var e=this.gl,n=this.state;t=t||this.clearColor,n.depthMask(!0),this._lastMaterial=null,this._lastProgram=null,e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)},clearDepth:function(){var t=this.gl;this.state.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},renderToScreen:function(t){this.state.bindSystemFramebuffer(),t.render(0,0,1,1,this.clearColor)},renderMesh:function(t){var e=this.setupMesh(t,!1).vao;e.draw(),this.addRenderInfo(e.vertexCount/3,1)},renderInstancedMeshes:function(t){var e=t[0];if(e){var n=this.forceMaterial||e.material,i=this.setupMesh(e,!0),r=i.vao,s=i.program;n.getInstancedUniforms().forEach((function(e){var n=e.name,i=e.info,a=s.attributes[n];a&&r.addInstancedAttribute(a,t,(function(t){return i.get(t)}))})),r.drawInstance(t.length),this.addRenderInfo(r.vertexCount/3*t.length,1)}},renderMultipleMeshes:function(t){var e=this;t.forEach((function(t){e.renderMesh(t)}))},releaseGLResource:function(){var t=this.gl;t&&(It.reset(t),dt.reset(t),xt.reset(t),Ft.reset(t),this.state.reset(t),qt.reset(t),re.destroy(t))}}),bi=n(60),wi=n.n(bi).a,Ci=s.a.create({Extends:g,isStage:!0,className:"Stage",renderer:null,camera:null,pixelRatio:null,offsetX:0,offsetY:0,constructor:function(t){if(t.width||(t.width=window.innerWidth),t.height||(t.height=window.innerHeight),!t.pixelRatio){var e=window.devicePixelRatio||1;e=Math.min(e,1024/Math.max(t.width,t.height),2),e=Math.max(e,1),t.pixelRatio=e}Ci.superclass.constructor.call(this,t),this.initRenderer(t),m.a.log("Hilo3d version: ".concat(hi))},initRenderer:function(t){var e=this.canvas=this.createCanvas(t);this.renderer=new Ni(Object.assign(t,{domElement:e})),this.resize(this.width,this.height,this.pixelRatio,!0)},createCanvas:function(t){var e;return e=t.canvas?t.canvas:document.createElement("canvas"),t.container&&t.container.appendChild(e),e},resize:function(t,e,n,i){if(void 0===n&&(n=this.pixelRatio),i||this.width!==t||this.height!==e||this.pixelRatio!==n){this.width=t,this.height=e,this.pixelRatio=n,this.rendererWidth=t*n,this.rendererHeight=e*n;var r=this.canvas;this.renderer.resize(this.rendererWidth,this.rendererHeight,i),r.style.width=this.width+"px",r.style.height=this.height+"px",this.updateDomViewport()}return this},setOffset:function(t,e){if(this.offsetX!==t||this.offsetY!==e){this.offsetX=t,this.offsetY=e;var n=this.pixelRatio;this.renderer.setOffset(t*n,e*n)}return this},viewport:function(t,e,n,i){return this.resize(n,i,this.pixelRatio,!0),this.setOffset(t,e),this},tick:function(t){return this.traverseUpdate(t),this.camera&&this.renderer.render(this,this.camera,!0),this},enableDOMEvent:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.canvas,r=this._domListener||(this._domListener=function(t){e._onDOMEvent(t)});return(t="string"==typeof t?[t]:t).forEach((function(t){n?i.addEventListener(t,r,!1):i.removeEventListener(t,r)})),this},_onDOMEvent:function(t){var e=this.canvas,n=this._eventTarget,i=t.type,r=0===i.indexOf("touch"),s=t;if(r){var a=t.touches,o=t.changedTouches;a&&a.length?s=a[0]:o&&o.length&&(s=o[0])}var u=this.domViewport||this.updateDomViewport(),c=(s.pageX||s.clientX)-u.left,h=(s.pageY||s.clientY)-u.top;t.stageX=c,t.stageY=h,t.stopPropagation=function(){this._stopPropagationed=!0};var f=this.getMeshResultAtPoint(c,h,!0),l=f.mesh;t.hitPoint=f.point;var d="mouseout"===i;if(n&&(n!==l&&(!n.contains||!n.contains(l))||d)){var m=!1;if("touchmove"===i?m="touchout":"mousemove"!==i&&!d&&l||(m="mouseout"),m){var _=Object.assign({},t);_.type=m,_.eventTarget=n,n._fireMouseEvent(_)}t.lastEventTarget=n,this._eventTarget=null}if(l&&l.pointerEnabled&&"mouseout"!==i&&(t.eventTarget=this._eventTarget=l,l._fireMouseEvent(t)),!r){var p=l&&l.pointerEnabled&&l.useHandCursor?"pointer":"";e.style.cursor=p}wi.android&&"touchmove"===i&&t.preventDefault()},updateDomViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.domViewport=Object(r.getElementRect)(t)),e},getMeshResultAtPoint:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.camera,r=this._ray;r||(r=this._ray=new ei.a),r.fromCamera(i,t,e,this.width,this.height);var s=this.raycast(r,!0,n);if(s)return s[0];this._stageResultAtPoint||(this._stageResultAtPoint={mesh:this,point:new c.a});var a=this._stageResultAtPoint.point;return a.copy(i.unprojectVector(a.set(t,e,0),this.width,this.height)),this._stageResultAtPoint},releaseGLResource:function(){return this.renderer.releaseGLResource(),this},destroy:function(){return this.releaseGLResource(),this.traverse((function(t){t.off(),t.parent=null})),this.children.length=0,this.renderer.off(),this}}),Pi=Ci,Hi=n(61),Di=n.n(Hi),Fi=n(105),Ui=n.n(Fi);Di.a.Ease=Ui.a;var Gi=Di.a,Bi=s.a.create({Extends:Z,isBoxGeometry:!0,className:"BoxGeometry",width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1,constructor:function(t){Bi.superclass.constructor.call(this,t),this.isSegments()?this.buildWithSegments():this.build()},buildWithSegments:function(){var t=this.width,e=this.height,n=this.depth,i=this.widthSegments,r=this.heightSegments,s=this.depthSegments,a=r*s*6,o=i*s*6,u=i*r*6,c=2*((r+1)*(s+1)+(i+1)*(s+1)+(i+1)*(r+1)),h=new Float32Array(3*c),f=new Float32Array(3*c),l=new Float32Array(2*c),d=new Uint16Array(2*(a+o+u));this.vertices=new w(h,3),this.normals=new w(f,3),this.uvs=new w(l,2),this.indices=new w(d,1);var m=[0,0];this.buildPlane(m,2,1,0,-1,1,n,e,t/2,s,r),this.buildPlane(m,2,1,0,1,1,n,e,-t/2,s,r),this.buildPlane(m,0,2,1,1,-1,t,n,e/2,i,s),this.buildPlane(m,0,2,1,1,1,t,n,-e/2,i,s),this.buildPlane(m,0,1,2,1,1,t,e,n/2,i,r),this.buildPlane(m,0,1,2,-1,1,t,e,-n/2,i,r)},buildPlane:function(t,e,n,i,r,s,a,o,u,c,h){for(var f=a/c,l=o/h,d=a/2,m=o/2,_=t[0],p=t[1],g=this.vertices.data,v=this.normals.data,E=this.uvs.data,T=this.indices.data,M=0;M<=h;M++)for(var A=(M*l-m)*s,I=0;I<=c;I++){if(g[3*_+e]=(I*f-d)*r,g[3*_+n]=A,g[3*_+i]=u,v[3*_+e]=0,v[3*_+n]=0,v[3*_+i]=u<0?-1:1,E[2*_]=I/c,E[2*_+1]=1-M/h,I1||this.heightSegments>1||this.depthSegments>1},setFrontUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setFrontUV!"):this.setVertexUV(32,t)},setRightUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setRightUV!"):this.setVertexUV(0,t)},setBackUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBackUV!"):this.setVertexUV(40,t)},setLeftUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setLeftUV!"):this.setVertexUV(8,t)},setTopUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setTopUV!"):this.setVertexUV(16,t)},setBottomUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBottomUV!"):this.setVertexUV(24,t)},setAllRectUV:function(t){if(this.isSegments())return m.a.warn("segmented BoxGeometry dont support setAllRectUV!"),null;for(var e=0;e<6;e++)this.setVertexUV(8*e,t);return this},_raycast:function(t,e){return Bi.superclass._raycast.call(this,t,e)}}),Vi=Bi,Xi=C.a.FRONT,ji=C.a.BACK,ki=[0,0,1],zi=s.a.create({Extends:Z,isPlaneGeometry:!0,className:"PlaneGeometry",width:1,height:1,widthSegments:1,heightSegments:1,constructor:function(t){zi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.widthSegments,e=this.heightSegments,n=(t+1)*(e+1),i=this.width/t,r=this.height/e,s=new Float32Array(3*n),a=new Float32Array(3*n),o=new Float32Array(2*n),u=new Uint16Array(t*e*6),c=0,h=0;h<=e;h++)for(var f=0;f<=t;f++){var l=h*(t+1)+f;if(s[3*l]=f*i-this.width/2,s[3*l+1]=this.height/2-h*r,a[3*l]=0,a[3*l+1]=0,a[3*l+2]=1,o[2*l]=f/t,o[2*l+1]=1-h/e,h0||n<0))return null;if(e===ji&&(i<0||n>0))return null;var r=t.intersectsPlane(ki,0);if(r){var s=r.x,a=r.y,o=.5*this.width,u=.5*this.height;if(s>=-o&&s<=o&&a>=-u&&a<=u)return[r]}return null}}),qi=zi,Wi=s.a.create({Extends:Z,isSphereGeometry:!0,className:"SphereGeometry",radius:1,heightSegments:16,widthSegments:32,constructor:function(t){Wi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.radius,e=this.heightSegments,n=this.widthSegments,i=(n+1)*(e+1),r=n*e,s=new Float32Array(3*i),a=new Float32Array(4*i),o=new Float32Array(2*i),u=new Uint16Array(6*r),c=0,h=0,f=0,l=0,d=0,m=2*Math.PI,_=Math.PI,p=0;p<=e;p++)for(var g=p/e,v=_*g,E=Math.cos(v)*t,T=Math.sin(v)*t,M=0;M<=n;M++){var A=M/n,I=m*A,L=Math.cos(I),O=Math.sin(I),S=L*T,R=O*T,y=O,x=-L;if(a[f++]=y,a[f++]=0,a[f++]=x,a[f++]=1,s[h++]=S,s[h++]=E,s[h++]=R,o[l++]=A,o[l++]=g,p>0&&M>0){var N=d,b=N-1,C=b-n-1,P=N-n-1;u[c++]=C,u[c++]=P,u[c++]=N,u[c++]=C,u[c++]=N,u[c++]=b}d++}this.vertices=new w(s,3),this.indices=new w(u,1),this.uvs=new w(o,2),this.tangents=new w(a,4),this.normals=new w(new Float32Array(s),3)},_raycast:function(t,e){return Wi.superclass._raycast.call(this,t,e)}}),Yi=Wi,Zi=[dt,It,xt,Ft,qt],Ki=function(){var t="";Zi.forEach((function(e){t+="".concat(e.prototype.className,":").concat(Object.keys(e.cache._cache).length," ")})),m.a.log(t)},Qi=s.a.create({Mixes:a.a,isLoadCache:!0,className:"LoadCache",Statics:{PENDING:1,LOADED:2,FAILED:3},enabled:!0,constructor:function(){this._files={}},update:function(t,e,n){if(this.enabled){var i={key:t,state:e,data:n};this._files[t]=i,this.fire("update",i),this.fire("update:".concat(i.key),i)}},get:function(t){return this.enabled?this._files[t]:null},remove:function(t){delete this._files[t]},clear:function(){this._files={}},wait:function(t){var e=this;return t?t.state===Qi.LOADED?Promise.resolve(t.data):t.state===Qi.FAILED?Promise.reject():new Promise((function(n,i){e.on("update:".concat(t.key),(function(t){var e=t.detail;e.state===Qi.LOADED?n(e.data):e.state===Qi.FAILED&&i(e.data)}),!0)})):Promise.reject()}}),Ji=Qi,$i=new Ji,tr=s.a.create({Mixes:a.a,isBasicLoader:!0,className:"BasicLoader",Statics:{_cache:$i,enalbeCache:function(){$i.enabled=!0},disableCache:function(){$i.enabled=!1},deleteCache:function(t){$i.remove(t)},clearCache:function(){$i.clear()},cache:{get:function(){return $i},set:function(){m.a.warn("BasicLoader.cache is readonly!")}}},load:function(t){var e=t.src,n=t.type;if(!n){var i=Object(r.getExtension)(e);/^(?:png|jpe?g|gif|webp|bmp)$/i.test(i)&&(n="img"),n||(n=t.defaultType)}return"img"===n?this.loadImg(e,t.crossOrigin):this.loadRes(e,n)},isCrossOrigin:function(t){var e=window.location,n=document.createElement("a");return n.href=t,n.hostname!==e.hostname||n.port!==e.port||n.protocol!==e.protocol},isBase64:function(t){return/^data:(.+?);base64,/.test(t)},Uint8ArrayFrom:function(t,e){if(Uint8Array.from)return Uint8Array.from(t,e);for(var n=t.length,i=new Uint8Array(n),r=0;r=300)i(new TypeError("Network request failed for ".concat(s.status)));else{var e="response"in s?s.response:s.responseText;if("json"===t.type)try{e=JSON.parse(e)}catch(t){return void i(new TypeError("JSON.parse error"+t))}n(e)}},s.onprogress=function(n){e.fire("progress",{url:t.url,loaded:n.loaded,total:n.total})},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request timed out"))},s.open(t.method||"GET",t.url,!0),"include"===t.credentials&&(s.withCredentials=!0),"buffer"===t.type&&(s.responseType="arraybuffer"),Object(r.each)(t.headers,(function(t,e){s.setRequestHeader(e,t)})),s.send(t.body||null)}))}}),er=s.a.create({isLoader:!0,className:"Loader",maxConnections:2,Statics:{_loaderClassMap:{},_loaders:{},addLoader:function(t,e){er._loaderClassMap[t]=e},getLoader:function(t){if(!er._loaders[t]){var e=er._loaderClassMap[t]?er._loaderClassMap[t]:tr;er._loaders[t]=new e}return er._loaders[t]}},load:function(t){var e=this;if(t instanceof Array)return Promise.all(t.map((function(t){return e.load(t)})));var n=t.type||Object(r.getExtension)(t.src);return er.getLoader(n).load(t)}}),nr=er,ir=s.a.create({Extends:tr,isCubeTextureLoader:!0,className:"CubeTextureLoader",constructor:function(){ir.superclass.constructor.call(this)},load:function(t){var e,n=this;return e=t.images&&Array.isArray(t.images)?t.images:[t.right,t.left,t.top,t.bottom,t.front,t.back],Promise.all(e.map((function(e){return n.loadImg(e,t.crossOrigin)}))).then((function(e){var n=Object.assign({},t);return delete n.images,delete n.type,delete n.right,delete n.left,delete n.top,delete n.bottom,delete n.front,delete n.back,n.image=e,new fe(n)})).catch((function(t){throw m.a.error("load CubeTexture failed",t.message,t.stack),t}))}});nr.addLoader("CubeTexture",ir);var rr=ir,sr=s.a.create({Extends:ke,isPBRMaterial:!0,className:"PBRMaterial",lightType:"PBR",gammaCorrection:!0,usePhysicsLight:!0,baseColor:null,baseColorMap:null,metallic:1,metallicMap:null,roughness:1,roughnessMap:null,metallicRoughnessMap:null,occlusionMap:null,occlusionStrength:1,isOcclusionInMetallicRoughnessMap:!1,diffuseEnvMap:null,diffuseEnvSphereHarmonics3:null,diffuseEnvIntensity:1,brdfLUT:null,specularEnvIntensity:1,specularEnv:null,emission:null,isSpecularGlossiness:!1,specular:null,glossiness:1,specularGlossinessMap:null,usedUniformVectors:11,constructor:function(t){this.baseColor=new v.a(1,1,1),this.specular=new v.a(1,1,1),sr.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_baseColor:"BASECOLOR",u_metallic:"METALLIC",u_roughness:"ROUGHNESS",u_specular:"SPECULAR",u_glossiness:"GLOSSINESS",u_brdfLUT:"BRDFLUT",u_diffuseEnvMap:"DIFFUSEENVMAP",u_diffuseEnvIntensity:"DIFFUSEENVINTENSITY",u_occlusionStrength:"OCCLUSIONSTRENGTH",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvIntensity:"SPECULARENVINTENSITY",u_specularEnvMapMipCount:"SPECULARENVMAPMIPCOUNT",u_diffuseEnvSphereHarmonics3:"DIFFUSEENVSPHEREHARMONICS3"}),this.addTextureUniforms({u_baseColorMap:"BASECOLORMAP",u_metallicMap:"METALLICMAP",u_roughnessMap:"ROUGHNESSMAP",u_metallicRoughnessMap:"METALLICROUGHNESSMAP",u_occlusionMap:"OCCLUSIONMAP",u_specularGlossinessMap:"SPECULARGLOSSINESSMAP",u_lightMap:"LIGHTMAP"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};sr.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t);return e.add(this.baseColorMap,"BASE_COLOR_MAP"),e.add(this.metallicMap,"METALLIC_MAP"),e.add(this.roughnessMap,"ROUGHNESS_MAP"),e.add(this.metallicRoughnessMap,"METALLIC_ROUGHNESS_MAP"),e.add(this.diffuseEnvMap,"DIFFUSE_ENV_MAP"),e.add(this.occlusionMap,"OCCLUSION_MAP"),e.add(this.lightMap,"LIGHT_MAP"),this.brdfLUT&&(e.add(this.specularEnvMap,"SPECULAR_ENV_MAP"),et.SHADER_TEXTURE_LOD&&this.specularEnvMap&&(t.USE_SHADER_TEXTURE_LOD=1)),this.isSpecularGlossiness&&(t.PBR_SPECULAR_GLOSSINESS=1,e.add(this.specularGlossinessMap,"SPECULAR_GLOSSINESS_MAP")),this.isOcclusionInMetallicRoughnessMap&&(t.IS_OCCLUSION_MAP_IN_METALLIC_ROUGHNESS_MAP=1),1!==this.occlusionStrength&&(t.OCCLUSION_STRENGTH=1),this.diffuseEnvSphereHarmonics3&&(t.HAS_NORMAL=1,t.DIFFUSE_ENV_SPHERE_HARMONICS3=1),(this.specularEnvMap||this.diffuseEnvSphereHarmonics3||this.specularEnvMap)&&(t.NEED_WORLD_NORMAL=1),e.update(),t}}),ar=sr,or=new Image;or.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var ur=s.a.create({Extends:qt,Mixes:a.a,isLazyTexture:!0,className:"LazyTexture",_src:"",crossOrigin:!1,autoLoad:!0,resType:"",src:{get:function(){return this._src},set:function(t){this._src!==t&&(this._src=t,this.autoLoad&&this.load())}},constructor:function(t){t&&("crossOrigin"in t&&(this.crossOrigin=t.crossOrigin),"autoLoad"in t&&(this.autoLoad=t.autoLoad)),ur.superclass.constructor.call(this,t),this.image=this.placeHolder||or},load:function(t){var e=this;return ur.loader=ur.loader||new nr,ur.loader.load({src:this.src,crossOrigin:this.crossOrigin,type:this.resType,defaultType:"img"}).then((function(t){t.isTexture?(Object.assign(e,t),e.needUpdate=!0,e.needDestroy=!0,e.fire("load")):(e.image=t,e.needUpdate=!0,e.fire("load"))}),(function(n){if(e.fire("error"),t)throw new Error("LazyTexture Failed ".concat(n));m.a.warn("LazyTexture Failed ".concat(n))}))},_releaseImage:function(){this._src&&"string"!=typeof this._src&&(this._src=""),ur.superclass._releaseImage.call(this)}}),cr=ur,hr=n(13);function fr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lr(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=0;i--)Tr[i]=t[i]+n*(e[i]-t[i]);return Tr}return t+n*(e-t)},STEP:function(t,e,n){return t},CUBICSPLINE:function(t,e,n,i){var s=t.length/3;if(void 0===e)return 1===s?t[1]:t.slice(s,-s);var a=t[1],o=t[2],u=e[1],c=e[0];if(s>1&&(a=t.slice(s,-s),o=t.slice(-s),u=e.slice(s,-s),c=e.slice(0,s)),a.hermite)a.hermite(a,o.scale(i),u,c.scale(i),n);else if(a.sqlerp)a.sqlerp(a,o.scale(i),u,c.scale(i),n);else{Object(r.isArrayLike)(a)||(a=[a],o=[o],u=[u],c=[c]);var h=n*n,f=h*n,l=2*f-3*h+1,d=f-2*h+n,m=-2*f+3*h,_=f-h;Tr.length=0;for(var p=a.length-1;p>=0;p--)Tr[p]=a[p]*l+d*o[p]*i+u[p]*m+_*c[p]*i;a=Tr}return a}},StateType:{TRANSLATE:"Translation",POSITION:"Translation",TRANSLATION:"Translation",SCALE:"Scale",ROTATE:"Rotation",ROTATION:"Rotation",QUATERNION:"Quaternion",WEIGHTS:"Weights"},getType:function(t){return t=String(t).toUpperCase(),Ar.StateType[t]||Ar._extraStateHandlers.type[t]},_extraStateHandlers:{type:{},handler:{}},registerStateHandler:function(t,e){Ar._extraStateHandlers.type[String(t).toUpperCase()]=t,Ar._extraStateHandlers.handler[t]=e}},isAnimationStates:!0,className:"AnimationStates",nodeName:"",type:"",interpolationType:"LINEAR",constructor:function(t){this.id=d.a.generateUUID(this.className),this.keyTime=[],this.states=[],Object.assign(this,t)},findIndexByTime:function(t){return Object(r.getIndexFromSortedArray)(this.keyTime,t,Mr)},getStateByIndex:function(t){var e=this.states.length/this.keyTime.length;return 1===e?this.states[t]:this.states.slice(t*e,t*e+e)},getState:function(t){var e=fr(this.findIndexByTime(t),2),n=e[0],i=e[1];if(n<0||i>=this.keyTime.length)return null;var s=this.keyTime[n],a=this.keyTime[i],o=this.getStateByIndex(n);if("STEP"===this.interpolationType)return o;if(n===i){var u=this.interpolation(o);return this.type===Ar.StateType.ROTATION&&(u=dr.fromEuler(Er.fromArray(u))),u.elements||u}var c=this.getStateByIndex(i),h=a-s,f=(t-s)/h;this.type===Ar.StateType.ROTATION?Object(r.isArrayLike)(o[0])?(o[0]=dr.fromEuler(Er.fromArray(o[0])),o[1]=mr.fromEuler(Er.fromArray(o[1])),o[2]=_r.fromEuler(Er.fromArray(o[2])),c[0]=pr.fromEuler(Er.fromArray(c[0])),c[1]=gr.fromEuler(Er.fromArray(c[1])),c[2]=vr.fromEuler(Er.fromArray(c[2]))):(o=dr.fromEuler(Er.fromArray(o)),c=mr.fromEuler(Er.fromArray(c))):this.type===Ar.StateType.QUATERNION&&(Object(r.isArrayLike)(o[0])?(o[0]=dr.fromArray(o[0]),o[1]=mr.fromArray(o[1]),o[2]=_r.fromArray(o[2]),c[0]=pr.fromArray(c[0]),c[1]=gr.fromArray(c[1]),c[2]=vr.fromArray(c[2])):(o=dr.fromArray(o),c=mr.fromArray(c)));var l=this.interpolation(o,c,f,h);return l.elements||l},interpolation:function(t,e,n,i){return Ar.interpolation[this.interpolationType](t,e,n,i)},updateNodeTranslation:function(t,e){t.x=e[0],t.y=e[1],t.z=e[2]},updateNodeScale:function(t,e){t.scaleX=e[0],t.scaleY=e[1],t.scaleZ=e[2]},updateNodeQuaternion:function(t,e){t.quaternion.fromArray(e)},updateNodeWeights:function(t,e){var n=this._originalWeightIndices=this._originalWeightIndices||[],i=e.length;e=e.slice();for(var r=0;re[s]){var o=e[s];e[s]=e[a],e[a]=o,o=n[s],n[s]=n[a],n[a]=o}t.traverse((function(t){t.isMesh&&t.geometry&&t.geometry.isMorphGeometry&&t.geometry.update(e,n)}))},updateNodeState:function(t,e){if(e){var n=this.type;n===Ar.StateType.ROTATION&&(n=Ar.StateType.QUATERNION);var i=this.getState(t);if(i){var r="updateNode"+n;this[r]?this[r](e,i):Ar._extraStateHandlers.handler[n]?Ar._extraStateHandlers.handler[n].call(this,e,i):m.a.warnOnce(r,"updateNodeState failed unknow type(%s)",n)}}},clone:function(){return new this.constructor({keyTime:this.keyTime,states:this.states,type:this.type,nodeName:this.nodeName})}}),Ir=Ar,Lr=s.a.create({Statics:{_anims:[],tick:function(t){this._anims.forEach((function(e){return e.tick(t)}))}},Mixes:a.a,isAnimation:!0,className:"Animation",paused:!1,currentLoopCount:0,loop:1/0,currentTime:0,timeScale:1,startTime:0,endTime:0,clipStartTime:0,clipEndTime:0,nodeNameMap:null,_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initNodeNameMap()}},validAnimationIds:null,constructor:function(t){this.id=d.a.generateUUID(this.className),this.animStatesList=[],this.clips={},Object.assign(this,t),this.initClipTime()},addClip:function(t,e,n,i){this.clips[t]={start:e,end:n,animStatesList:i}},removeClip:function(t){this.clips[t]=null},getAnimStatesListTimeInfo:function(t){var e=0,n=1/0;return t.forEach((function(t){e=Math.max(t.keyTime[t.keyTime.length-1],e),n=Math.min(t.keyTime[0],n)})),{startTime:n,endTime:e}},initClipTime:function(){var t=this.getAnimStatesListTimeInfo(this.animStatesList);this.clipStartTime=t.startTime,this.clipEndTime=t.endTime},initNodeNameMap:function(){if(this._rootNode){var t=this.nodeNameMap={};this._rootNode.traverse((function(e){t[e.animationId]=e;var n=e.name;void 0===n||t[n]||(t[n]=e)}),!1)}},tick:function(t){this.paused||(this.currentTime+=t/1e3*this.timeScale,this.currentTime>=this.endTime?(this.currentLoopCount++,this.currentTime=this.endTime,this.updateAnimStates(),this.fire("loopEnd"),!this.loop||this.currentLoopCount>=this.loop?(this.stop(),this.fire("end")):this.currentTime=this.startTime):this.updateAnimStates())},updateAnimStates:function(){var t=this;return this.animStatesList.forEach((function(e){e.updateNodeState(t.currentTime,t.nodeNameMap[e.nodeName])})),this},play:function(t,e){var n;if("string"==typeof t){var i=this.clips[t];i?(n=i.start,e=i.end,i.animStatesList&&(this.animStatesList=i.animStatesList,this.initClipTime())):m.a.warn("no this animation clip name:"+t)}else n=t;void 0===n&&(n=this.clipStartTime),void 0===e&&(e=this.clipEndTime),this.endTime=Math.min(e,this.clipEndTime),this.startTime=Math.min(n,this.endTime),this.currentTime=this.startTime,this.currentLoopCount=0,this.stop(),this.paused=!1,Lr._anims.push(this)},stop:function(){this.paused=!0;var t=Lr._anims,e=t.indexOf(this);-1!==e&&t.splice(e,1)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},clone:function(t){var e=new this.constructor({rootNode:t,animStatesList:this.animStatesList,timeScale:this.timeScale,loop:this.loop,paused:this.paused,currentTime:this.currentTime,startTime:this.startTime,endTime:this.endTime,clips:this.clips});return this.paused||e.play(),e}}),Or=Lr;function Sr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Rr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rr(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=2&&(this.isGLTF2=!0),this.parseExtensionUsed(),this.loadResources(t).then((function(){return e.parseExtensions(e.json.extensions,null,{isGlobal:!0,methodName:"parseOnLoad"}),Promise.resolve()})).then((function(){return e.parseGeometries()})).then((function(){return e.parseScene()}))},parseExtensionUsed:function(){var t=this;this.extensionsUsed={},r.each(this.json.extensionsUsed,(function(e){t.extensionsUsed[e]=!0})),this.extensionsUsed.WEB3D_quantized_attributes||(this.isUnQuantizeInShader=!1)},getExtensionHandler:function(t){return this.extensionHandlers&&this.extensionHandlers[t]||Fr.extensionHandlers[t]},parseExtension:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=t[e],s=this.getExtensionHandler(e);return s&&s.parse?s.parse(r,this,n,i):n},parseExtensions:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.each(t,(function(t,r){if(!i.ignoreExtensions||!i.ignoreExtensions[r]){var s=n.getExtensionHandler(r),a=i.methodName||"parse";s&&s[a]&&(e=s[a](t,n,e,i))}})),e},isUseExtension:function(t,e){return!!(t&&t.extensions&&t.extensions[e])},parseBinary:function(t){this.isBinary=!0;var e,n=new DataView(t),i=n.getUint32(4,!0),s=n.getUint32(8,!0),a=12;if(i<2){var o=n.getUint32(a,!0);e=new Uint8Array(t,20,o),e=r.convertUint8ArrayToString(e,!0),this.json=JSON.parse(e),this.binaryBody=t.slice(20+o)}else{if(2!==i)throw new Error("Dont support glTF version ".concat(i));for(;as*r.BYTES_PER_ELEMENT)a.array=new r(a.buffer,a.byteOffset,a.byteLength/r.BYTES_PER_ELEMENT),i=new w(a.array,s,{offset:n.byteOffset||0,stride:a.byteStride,bufferViewId:a.id});else{var u,c=(n.byteOffset||0)+a.byteOffset;if(c%r.BYTES_PER_ELEMENT||this.forceCreateNewBuffer)u=new r(a.buffer.slice(c,c+o*r.BYTES_PER_ELEMENT));else u=new r(a.buffer,c,o);i=new w(u,s)}return n.sparse&&(i||(i=new w(new r(o),s)),i=this.sparseAccessorHandler(i,n.sparse)),i=this.parseExtensions(n.extensions,i,{isDecode:e,isAccessor:!0}),n.data=i,n.normalized&&(i.normalized=!0),i},getArrayByAccessor:function(t,e){var n=this.json.accessors[t];if(n.array)return n.array;var i=this.getAccessorData(t,e);if(!i.stride&&!i.offset&&1===i.size)return i.data;var r=[];return i.traverse((function(t){r.push(t.toArray?t.toArray():t)})),n.array=r,r},parseTechnique:function(t,e){var n=null;this.json.techniques&&(n=this.json.techniques[t.technique]),n&&n.states&&(n.states.enable.forEach((function(t){switch(t){case yr:e.blend=!0;break;case xr:e.depthTest=!0;break;case Nr:e.cullFace=!0}})),r.each(n.states.functions,(function(t,n){switch(n){case"blendEquationSeparate":e.blendEquation=t[0],e.blendEquationAlpha=t[1];break;case"blendFuncSeparate":e.blendSrc=t[0],e.blendDst=t[1],e.blendSrcAlpha=t[2],e.blendDstAlpha=t[3];break;case"depthMask":e.depthMask=t[0];break;case"cullFace":e.cullFaceType=t[0];break;default:e[n]=t}})),e.cullFace?e.side=e.cullFaceType===br?wr:br:e.side=Cr)},createMorphGeometry:function(t,e){var n=this,i=new Bn,s=i.targets={};return r.each(t.targets,(function(t){r.each(t,(function(t,e){var i=Dr[e].name;s[i]||(s[i]=[]);var r=n.getAccessorData(t,!0);s[i].push(r)}))})),i.weights=e||new Float32Array(t.targets.length),i},handlerGeometry:function(t,e){var n=void 0===e.mode?4:e.mode;if(e.extensions){var i=this.parseExtensions(e.extensions,null,{primitive:e,isPrimitive:!0});if(i)return i.mode=n,i}t||(t=new Z({mode:n})),"indices"in e&&(t.indices=this.getAccessorData(e.indices));var r=e.attributes;for(var s in r){var a=Dr[s];if(a){var o=!(this.isUnQuantizeInShader&&a.decodeMatName);t[a.name]=this.getAccessorData(r[s],o),o||(t[a.decodeMatName]=t[a.name].decodeMat,delete t[a.name].decodeMat)}else m.a.warn("Unknow attribute named ".concat(s,"!"))}return t},handlerSkinedMesh:function(t,e){if(e){var n,i=(e.jointNames||e.joints).length;e.bindShapeMatrix&&(n=(new o.a).fromArray(e.bindShapeMatrix));for(var r=this.getArrayByAccessor(e.inverseBindMatrices,!0),s=0;s0&&(i=Object.values(n)[0].animStatesList),i.length?new Or({rootNode:this.node,animStatesList:i,validAnimationIds:s,clips:n}):null},parseScene:function(){var t=this;this.parseMaterials(),this.jointMap={},this.meshes=[],this.lights=[],this.node=new g({needCallChildUpdate:!1}),this.parseCameras();var e=this.json.scenes[this.getDefaultSceneName()];if(!e)return m.a.warn("GLTFParser:no scene!"),{node:this.node,meshes:[],cameras:[],lights:[],textures:[],materials:[]};e.nodes.forEach((function(e){return t.parseNode(e,t.node)})),this.node.resetSkinedMeshRootNode();var n={node:this.node,scene:this.node,meshes:this.meshes,json:this.json,cameras:Object.values(this.cameras),lights:this.lights,textures:Object.values(this.textures),materials:Object.values(this.materials)},i=this.parseAnimations();return i&&(this.node.setAnim(i),i.play(),n.anim=i),this.parseExtensions(e.extensions,null,{isScene:!0}),this.parseExtensions(this.json.extensions,n,{isGlobal:!0,methodName:"parseOnEnd"}),n},getDefaultSceneName:function(){return void 0!==this.defaultScene?this.defaultScene:this.json.scenes?Object.keys(this.json.scenes)[0]:null}}),Ur=Fr,Gr=s.a.create({Extends:tr,isGLTFLoader:!0,className:"GLTFLoader",constructor:function(){Gr.superclass.constructor.call(this)},load:function(t){var e=this;return this.loadRes(t.src,"buffer").then((function(n){return new Ur(n,t).parse(e)})).catch((function(t){throw m.a.error("load gltf failed",t.message,t.stack),t}))}});nr.addLoader("gltf",Gr),nr.addLoader("glb",Gr);var Br=Gr,Vr=n(106),Xr=n.n(Vr),jr=C.a.RGBA,kr=C.a.NEAREST,zr=C.a.CLAMP_TO_EDGE,qr=C.a.FLOAT,Wr=s.a.create({Extends:tr,isHDRLoader:!0,className:"HDRLoader",constructor:function(){Wr.superclass.constructor.call(this)},load:function(t){return this.loadRes(t.src,"buffer").then((function(e){try{var n=Xr()(e),i=n.shape,r=n.data,s=new qt({width:i[0],height:i[1],flipY:t.flipY||!1,image:r,type:qr,magFilter:kr,minFilter:kr,wrapS:zr,wrapT:zr,internalFormat:jr,format:jr});return Object.assign(s,t),s}catch(t){m.a.error("HDRLoader:parse error => ",t)}return null}))}});nr.addLoader("hdr",Wr);var Yr=Wr,Zr=s.a.create({Statics:{HEADER_LEN:64,COMPRESSED_2D:0,COMPRESSED_3D:1,TEX_2D:2,TEX_3D:3},isKhronosTextureContainer:!0,className:"KhronosTextureContainer",constructor:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.arrayBuffer=t,this.baseOffset=n;var i=new Uint8Array(this.arrayBuffer,this.baseOffset,12);if(171===i[0]&&75===i[1]&&84===i[2]&&88===i[3]&&32===i[4]&&49===i[5]&&49===i[6]&&187===i[7]&&13===i[8]&&10===i[9]&&26===i[10]&&10===i[11]){var r=Uint32Array.BYTES_PER_ELEMENT,s=new DataView(this.arrayBuffer,this.baseOffset+12,13*r),a=s.getUint32(0,!0),o=67305985===a;this.glType=s.getUint32(1*r,o),this.glTypeSize=s.getUint32(2*r,o),this.glFormat=s.getUint32(3*r,o),this.glInternalFormat=s.getUint32(4*r,o),this.glBaseInternalFormat=s.getUint32(5*r,o),this.pixelWidth=s.getUint32(6*r,o),this.pixelHeight=s.getUint32(7*r,o),this.pixelDepth=s.getUint32(8*r,o),this.numberOfArrayElements=s.getUint32(9*r,o),this.numberOfFaces=s.getUint32(10*r,o),this.numberOfMipmapLevels=s.getUint32(11*r,o),this.bytesOfKeyValueData=s.getUint32(12*r,o),this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?0===this.glType?this.loadType=Zr.COMPRESSED_2D:this.loadType=Zr.TEX_2D:m.a.warn("number of faces expected"+e+", but found "+this.numberOfFaces):m.a.warn("texture arrays not currently supported"):m.a.warn("only 2D textures currently supported")}else m.a.error("texture missing KTX identifier")},mipmaps:function(t){for(var e=[],n=Zr.HEADER_LEN+this.bytesOfKeyValueData,i=this.pixelWidth,r=this.pixelHeight,s=t?this.numberOfMipmapLevels:1,a=0;a2&&void 0!==arguments[2]?arguments[2]:0,i=new Zr(e,1,n),r={compressed:0===i.glType,type:i.glType,width:i.pixelWidth,height:i.pixelHeight,internalFormat:i.glInternalFormat,format:i.glFormat,isCubemap:6===i.numberOfFaces};return i.numberOfMipmapLevels>=Math.floor(Math.log2(Math.max(r.width,r.height))+1)?(r.mipmaps=i.mipmaps(!0),r.image=r.mipmaps[0].data):(r.mipmaps=null,r.image=i.mipmaps(!1)[0].data),new qt(r)}});nr.addLoader("ktx",Kr);var Qr=Kr,Jr=s.a.create({Mixes:a.a,isLoadQueue:!0,className:"LoadQueue",Statics:{addLoader:function(t,e){m.a.warn("LoadQueue.addLoader is duplicated, please use Loader.addLoader"),nr.addLoader(t,e)}},constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){return t&&(t=Array.isArray(t)?t:[t],this._source=this._source.concat(t)),this},get:function(t){if(!t)return null;for(var e=this._source,n=0;n=n)this.fire("complete");else if(this._currentIndex2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=this.renderer.pixelRatio,s=[],a=this.framebuffer.readPixels(t*r,e*r,n*r,i*r),o=0;o0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=i*a,t[2]=r*a,t[3]=s*a),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=a+i*(n[2]-a),t[3]=o+i*(n[3]-o),t},e.random=function(t,e){var n,r,s,a,o,u;e=e||1;do{o=(n=2*i.RANDOM()-1)*n+(r=2*i.RANDOM()-1)*r}while(o>=1);do{u=(s=2*i.RANDOM()-1)*s+(a=2*i.RANDOM()-1)*a}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*r,t[2]=e*s*c,t[3]=e*a*c,t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*s+n[12]*a,t[1]=n[1]*i+n[5]*r+n[9]*s+n[13]*a,t[2]=n[2]*i+n[6]*r+n[10]*s+n[14]*a,t[3]=n[3]*i+n[7]*r+n[11]*s+n[15]*a,t},e.transformQuat=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2],c=n[3],h=c*i+o*s-u*r,f=c*r+u*i-a*s,l=c*s+a*r-o*i,d=-a*i-o*r-u*s;return t[0]=h*c+d*-a+f*-u-l*-o,t[1]=f*c+d*-o+l*-a-h*-u,t[2]=l*c+d*-u+h*-o-f*-a,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(n*n+i*i+r*r+s*s)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return n*n+i*i+r*r+s*s}function h(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.sqrt(e*e+n*n+i*i+r*r)}function f(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.len=h,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=4),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;u1?0:r<-1?Math.PI:Math.acos(r)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=e[0],o=e[1],u=e[2];return Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-u)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(3);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function a(t,e,n){var r=new i.ARRAY_TYPE(3);return r[0]=t,r[1]=e,r[2]=n,r}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(n*n+i*i+r*r)}function f(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}function l(t){var e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i}function d(t,e){var n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function m(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=h,e.sqrDist=f,e.len=s,e.sqrLen=l,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=3),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;ui.EPSILON?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=h,e.rotateX=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+a*o,t[1]=r*u+s*o,t[2]=s*u-r*o,t[3]=a*u-i*o,t},e.rotateY=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u-s*o,t[1]=r*u+a*o,t[2]=s*u+i*o,t[3]=a*u-r*o,t},e.rotateZ=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+r*o,t[1]=r*u-i*o,t[2]=s*u+a*o,t[3]=a*u-s*o,t},e.calculateW=function(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t},e.slerp=f,e.random=function(t){var e=i.RANDOM(),n=i.RANDOM(),r=i.RANDOM(),s=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*n),t[1]=s*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*n+i*i+r*r+s*s,o=a?1/a:0;return t[0]=-n*o,t[1]=-i*o,t[2]=-r*o,t[3]=s*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,i){var r=.5*Math.PI/180;e*=r,n*=r,i*=r;var s=Math.sin(e),a=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(i),h=Math.cos(i);return t[0]=s*u*h-a*o*c,t[1]=a*o*h+s*u*c,t[2]=a*u*c-s*o*h,t[3]=a*u*h+s*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var i=o(n(0)),r=o(n(5)),s=o(n(2)),a=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function h(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*h+a*o+r*c-s*u,t[1]=r*h+a*u+s*o-i*c,t[2]=s*h+a*c+i*u-r*o,t[3]=a*h-i*o-r*u-s*c,t}function f(t,e,n,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=n[0],h=n[1],f=n[2],l=n[3],d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return(m=s*c+a*h+o*f+u*l)<0&&(m=-m,c=-c,h=-h,f=-f,l=-l),1-m>i.EPSILON?(d=Math.acos(m),_=Math.sin(d),p=Math.sin((1-r)*d)/_,g=Math.sin(r*d)/_):(p=1-r,g=r),t[0]=p*s+g*c,t[1]=p*a+g*h,t[2]=p*o+g*f,t[3]=p*u+g*l,t}function l(t,e){var n=e[0]+e[4]+e[8],i=void 0;if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,a=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*a+a]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*s+a]-e[3*a+s])*i,t[s]=(e[3*s+r]+e[3*r+s])*i,t[a]=(e[3*a+r]+e[3*r+a])*i}return t}e.clone=a.clone,e.fromValues=a.fromValues,e.copy=a.copy,e.set=a.set,e.add=a.add,e.mul=h,e.scale=a.scale,e.dot=a.dot,e.lerp=a.lerp;var d=e.length=a.length,m=(e.len=d,e.squaredLength=a.squaredLength),_=(e.sqrLen=m,e.normalize=a.normalize);e.exactEquals=a.exactEquals,e.equals=a.equals,e.rotationTo=function(){var t=s.create(),e=s.fromValues(1,0,0),n=s.fromValues(0,1,0);return function(i,r,a){var o=s.dot(r,a);return o<-.999999?(s.cross(t,e,r),s.len(t)<1e-6&&s.cross(t,n,r),s.normalize(t,t),c(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(s.cross(t,r,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,_(i,i))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,i,r,s,a,o){return f(t,i,a,o),f(e,r,s,o),f(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=r.create();return function(e,n,i,r){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=r[0],t[4]=r[1],t[7]=r[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],_(e,l(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(16);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,r,s,a,o,u,c,h,f,l,d,m,_,p){var g=new i.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=s,g[5]=a,g[6]=o,g[7]=u,g[8]=c,g[9]=h,g[10]=f,g[11]=l,g[12]=d,g[13]=m,g[14]=_,g[15]=p,g},e.set=function(t,e,n,i,r,s,a,o,u,c,h,f,l,d,m,_,p){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t[9]=h,t[10]=f,t[11]=l,t[12]=d,t[13]=m,t[14]=_,t[15]=p,t},e.identity=r,e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],s=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=r,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,E=n*u-r*a,T=n*c-s*a,M=i*u-r*o,A=i*c-s*o,I=r*c-s*u,L=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-E*y+T*R+M*S-A*O+I*L;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(r*y-i*x-s*R)*N,t[2]=(_*I-p*A+g*M)*N,t[3]=(l*A-f*I-d*M)*N,t[4]=(u*S-a*x-c*O)*N,t[5]=(n*x-r*S+s*O)*N,t[6]=(p*T-m*I-g*E)*N,t[7]=(h*I-l*T+d*E)*N,t[8]=(a*y-o*S+c*L)*N,t[9]=(i*S-n*y-s*L)*N,t[10]=(m*A-_*T+g*v)*N,t[11]=(f*T-h*A-d*v)*N,t[12]=(o*O-a*R-u*L)*N,t[13]=(n*R-i*O+r*L)*N,t[14]=(_*E-m*M-p*v)*N,t[15]=(h*M-f*E+l*v)*N,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15];return t[0]=o*(l*g-d*p)-f*(u*g-c*p)+_*(u*d-c*l),t[1]=-(i*(l*g-d*p)-f*(r*g-s*p)+_*(r*d-s*l)),t[2]=i*(u*g-c*p)-o*(r*g-s*p)+_*(r*c-s*u),t[3]=-(i*(u*d-c*l)-o*(r*d-s*l)+f*(r*c-s*u)),t[4]=-(a*(l*g-d*p)-h*(u*g-c*p)+m*(u*d-c*l)),t[5]=n*(l*g-d*p)-h*(r*g-s*p)+m*(r*d-s*l),t[6]=-(n*(u*g-c*p)-a*(r*g-s*p)+m*(r*c-s*u)),t[7]=n*(u*d-c*l)-a*(r*d-s*l)+h*(r*c-s*u),t[8]=a*(f*g-d*_)-h*(o*g-c*_)+m*(o*d-c*f),t[9]=-(n*(f*g-d*_)-h*(i*g-s*_)+m*(i*d-s*f)),t[10]=n*(o*g-c*_)-a*(i*g-s*_)+m*(i*c-s*o),t[11]=-(n*(o*d-c*f)-a*(i*d-s*f)+h*(i*c-s*o)),t[12]=-(a*(f*p-l*_)-h*(o*p-u*_)+m*(o*l-u*f)),t[13]=n*(f*p-l*_)-h*(i*p-r*_)+m*(i*l-r*f),t[14]=-(n*(o*p-u*_)-a*(i*p-r*_)+m*(i*u-r*o)),t[15]=n*(o*l-u*f)-a*(i*l-r*f)+h*(i*u-r*o),t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8],h=t[9],f=t[10],l=t[11],d=t[12],m=t[13],_=t[14],p=t[15];return(e*a-n*s)*(f*p-l*_)-(e*o-i*s)*(h*p-l*m)+(e*u-r*s)*(h*_-f*m)+(n*o-i*a)*(c*p-l*d)-(n*u-r*a)*(c*_-f*d)+(i*u-r*o)*(c*m-h*d)},e.multiply=s,e.translate=function(t,e,n){var i=n[0],r=n[1],s=n[2],a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],u=e[2],c=e[3],h=e[4],f=e[5],l=e[6],d=e[7],m=e[8],_=e[9],p=e[10],g=e[11],t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=h,t[5]=f,t[6]=l,t[7]=d,t[8]=m,t[9]=_,t[10]=p,t[11]=g,t[12]=a*i+h*r+m*s+e[12],t[13]=o*i+f*r+_*s+e[13],t[14]=u*i+l*r+p*s+e[14],t[15]=c*i+d*r+g*s+e[15]),t},e.scale=function(t,e,n){var i=n[0],r=n[1],s=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,r){var s,a,o,u,c,h,f,l,d,m,_,p,g,v,E,T,M,A,I,L,O,S,R,y,x=r[0],N=r[1],b=r[2],C=Math.sqrt(x*x+N*N+b*b);return C0?(n[0]=2*(c*u+l*r+h*o-f*s)/d,n[1]=2*(h*u+l*s+f*r-c*o)/d,n[2]=2*(f*u+l*o+c*s-h*r)/d):(n[0]=2*(c*u+l*r+h*o-f*s),n[1]=2*(h*u+l*s+f*r-c*o),n[2]=2*(f*u+l*o+c*s-h*r)),a(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[4],a=e[5],o=e[6],u=e[8],c=e[9],h=e[10];return t[0]=Math.sqrt(n*n+i*i+r*r),t[1]=Math.sqrt(s*s+a*a+o*o),t[2]=Math.sqrt(u*u+c*c+h*h),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],i=0;return n>0?(i=2*Math.sqrt(n+1),t[3]=.25*i,t[0]=(e[6]-e[9])/i,t[1]=(e[8]-e[2])/i,t[2]=(e[1]-e[4])/i):e[0]>e[5]&&e[0]>e[10]?(i=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/i,t[0]=.25*i,t[1]=(e[1]+e[4])/i,t[2]=(e[8]+e[2])/i):e[5]>e[10]?(i=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/i,t[0]=(e[1]+e[4])/i,t[1]=.25*i,t[2]=(e[6]+e[9])/i):(i=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/i,t[0]=(e[8]+e[2])/i,t[1]=(e[6]+e[9])/i,t[2]=.25*i),t},e.fromRotationTranslationScale=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3],u=r+r,c=s+s,h=a+a,f=r*u,l=r*c,d=r*h,m=s*c,_=s*h,p=a*h,g=o*u,v=o*c,E=o*h,T=i[0],M=i[1],A=i[2];return t[0]=(1-(m+p))*T,t[1]=(l+E)*T,t[2]=(d-v)*T,t[3]=0,t[4]=(l-E)*M,t[5]=(1-(f+p))*M,t[6]=(_+g)*M,t[7]=0,t[8]=(d+v)*A,t[9]=(_-g)*A,t[10]=(1-(f+m))*A,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,i,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=s+s,h=a+a,f=o+o,l=s*c,d=s*h,m=s*f,_=a*h,p=a*f,g=o*f,v=u*c,E=u*h,T=u*f,M=i[0],A=i[1],I=i[2],L=r[0],O=r[1],S=r[2],R=(1-(_+g))*M,y=(d+T)*M,x=(m-E)*M,N=(d-T)*A,b=(1-(l+g))*A,C=(p+v)*A,P=(m+E)*I,w=(p-v)*I,H=(1-(l+_))*I;return t[0]=R,t[1]=y,t[2]=x,t[3]=0,t[4]=N,t[5]=b,t[6]=C,t[7]=0,t[8]=P,t[9]=w,t[10]=H,t[11]=0,t[12]=n[0]+L-(R*L+N*O+P*S),t[13]=n[1]+O-(y*L+b*O+w*S),t[14]=n[2]+S-(x*L+C*O+H*S),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[1]=h+g,t[2]=l-p,t[3]=0,t[4]=h-g,t[5]=1-c-m,t[6]=d+_,t[7]=0,t[8]=l+p,t[9]=d-_,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,i,r,s,a){var o=1/(n-e),u=1/(r-i),c=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(r+i)*u,t[10]=(a+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*c,t[15]=0,t},e.perspective=function(t,e,n,i,r){var s=1/Math.tan(e/2),a=void 0;return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(a=1/(i-r),t[10]=(r+i)*a,t[14]=2*r*i*a):(t[10]=-1,t[14]=-2*i),t},e.perspectiveFromFieldOfView=function(t,e,n,i){var r=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+o),c=2/(r+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-o)*u*.5,t[9]=(r-s)*c*.5,t[10]=i/(n-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*n/(n-i),t[15]=0,t},e.ortho=function(t,e,n,i,r,s,a){var o=1/(e-n),u=1/(i-r),c=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(r+i)*u,t[14]=(a+s)*c,t[15]=1,t},e.lookAt=function(t,e,n,s){var a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=e[0],g=e[1],v=e[2],E=s[0],T=s[1],M=s[2],A=n[0],I=n[1],L=n[2];return Math.abs(p-A)0&&(h*=d=1/Math.sqrt(d),f*=d,l*=d);var m=u*l-c*f,_=c*h-o*l,p=o*f-u*h;return(d=m*m+_*_+p*p)>0&&(m*=d=1/Math.sqrt(d),_*=d,p*=d),t[0]=m,t[1]=_,t[2]=p,t[3]=0,t[4]=f*p-l*_,t[5]=l*m-h*p,t[6]=h*_-f*m,t[7]=0,t[8]=h,t[9]=f,t[10]=l,t[11]=0,t[12]=r,t[13]=s,t[14]=a,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t[9]=e[9]+n[9]*i,t[10]=e[10]+n[10]*i,t[11]=e[11]+n[11]*i,t[12]=e[12]+n[12]*i,t[13]=e[13]+n[13]*i,t[14]=e[14]+n[14]*i,t[15]=e[15]+n[15]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=t[9],d=t[10],m=t[11],_=t[12],p=t[13],g=t[14],v=t[15],E=e[0],T=e[1],M=e[2],A=e[3],I=e[4],L=e[5],O=e[6],S=e[7],R=e[8],y=e[9],x=e[10],N=e[11],b=e[12],C=e[13],P=e[14],w=e[15];return Math.abs(n-E)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(E))&&Math.abs(r-T)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(T))&&Math.abs(s-M)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(a-A)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(o-I)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(u-L)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(L))&&Math.abs(c-O)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(h-S)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-R)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(R))&&Math.abs(l-y)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(d-x)<=i.EPSILON*Math.max(1,Math.abs(d),Math.abs(x))&&Math.abs(m-N)<=i.EPSILON*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(_-b)<=i.EPSILON*Math.max(1,Math.abs(_),Math.abs(b))&&Math.abs(p-C)<=i.EPSILON*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(g-P)<=i.EPSILON*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(v-w)<=i.EPSILON*Math.max(1,Math.abs(v),Math.abs(w))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function s(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],_=e[12],p=e[13],g=e[14],v=e[15],E=n[0],T=n[1],M=n[2],A=n[3];return t[0]=E*i+T*o+M*f+A*_,t[1]=E*r+T*u+M*l+A*p,t[2]=E*s+T*c+M*d+A*g,t[3]=E*a+T*h+M*m+A*v,E=n[4],T=n[5],M=n[6],A=n[7],t[4]=E*i+T*o+M*f+A*_,t[5]=E*r+T*u+M*l+A*p,t[6]=E*s+T*c+M*d+A*g,t[7]=E*a+T*h+M*m+A*v,E=n[8],T=n[9],M=n[10],A=n[11],t[8]=E*i+T*o+M*f+A*_,t[9]=E*r+T*u+M*l+A*p,t[10]=E*s+T*c+M*d+A*g,t[11]=E*a+T*h+M*m+A*v,E=n[12],T=n[13],M=n[14],A=n[15],t[12]=E*i+T*o+M*f+A*_,t[13]=E*r+T*u+M*l+A*p,t[14]=E*s+T*c+M*d+A*g,t[15]=E*a+T*h+M*m+A*v,t}function a(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=i+i,u=r+r,c=s+s,h=i*o,f=i*u,l=i*c,d=r*u,m=r*c,_=s*c,p=a*o,g=a*u,v=a*c;return t[0]=1-(d+_),t[1]=f+v,t[2]=l-g,t[3]=0,t[4]=f-v,t[5]=1-(h+_),t[6]=m+p,t[7]=0,t[8]=l+g,t[9]=m-p,t[10]=1-(h+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=s,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(9);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new i.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,r,s,a,o,u,c){var h=new i.ARRAY_TYPE(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=r,h[4]=s,h[5]=a,h[6]=o,h[7]=u,h[8]=c,h},e.set=function(t,e,n,i,r,s,a,o,u,c){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=h*a-o*c,l=-h*s+o*u,d=c*s-a*u,m=n*f+i*l+r*d;return m?(m=1/m,t[0]=f*m,t[1]=(-h*i+r*c)*m,t[2]=(o*i-r*a)*m,t[3]=l*m,t[4]=(h*n-r*u)*m,t[5]=(-o*n+r*s)*m,t[6]=d*m,t[7]=(-c*n+i*u)*m,t[8]=(a*n-i*s)*m,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-o*c,t[1]=r*c-i*h,t[2]=i*o-r*a,t[3]=o*u-s*h,t[4]=n*h-r*u,t[5]=r*s-n*o,t[6]=s*c-a*u,t[7]=i*u-n*c,t[8]=n*a-i*s,t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8];return e*(c*s-a*u)+n*(-c*r+a*o)+i*(u*r-s*o)},e.multiply=r,e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=l*i+d*a+c,t[7]=l*r+d*o+h,t[8]=l*s+d*u+f,t},e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=Math.sin(n),d=Math.cos(n);return t[0]=d*i+l*a,t[1]=d*r+l*o,t[2]=d*s+l*u,t[3]=d*a-l*i,t[4]=d*o-l*r,t[5]=d*u-l*s,t[6]=c,t[7]=h,t[8]=f,t},e.scale=function(t,e,n){var i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[3]=h-g,t[6]=l+p,t[1]=h+g,t[4]=1-c-m,t[7]=d-_,t[2]=l-p,t[5]=d+_,t[8]=1-c-f,t},e.normalFromMat4=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,E=n*u-r*a,T=n*c-s*a,M=i*u-r*o,A=i*c-s*o,I=r*c-s*u,L=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-E*y+T*R+M*S-A*O+I*L;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(u*S-a*x-c*O)*N,t[2]=(a*y-o*S+c*L)*N,t[3]=(r*y-i*x-s*R)*N,t[4]=(n*x-r*S+s*O)*N,t[5]=(i*S-n*y-s*L)*N,t[6]=(_*I-p*A+g*M)*N,t[7]=(p*T-m*I-g*E)*N,t[8]=(m*A-_*T+g*v)*N,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=e[0],d=e[1],m=e[2],_=e[3],p=e[4],g=e[5],v=e[6],E=e[7],T=e[8];return Math.abs(n-l)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-d)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(s-m)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-_)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-p)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(u-g)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-v)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-E)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(f-T)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(T))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1],m=n[2],_=n[3],p=n[4],g=n[5],v=n[6],E=n[7],T=n[8];return t[0]=l*i+d*a+m*c,t[1]=l*r+d*o+m*h,t[2]=l*s+d*u+m*f,t[3]=_*i+p*a+g*c,t[4]=_*r+p*o+g*h,t[5]=_*s+p*u+g*f,t[6]=v*i+E*a+T*c,t[7]=v*r+E*o+T*h,t[8]=v*s+E*u+T*f,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=r,e.clone=function(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new i.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=s,e.multiply=a,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],i=e[1],r=n*n+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},e.lerp=function(t,e,n,i){var r=e[0],s=e[1];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t},e.random=function(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t},e.transformMat2d=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},e.transformMat3=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t},e.rotate=function(t,e,n,i){var r=e[0]-n[0],s=e[1]-n[1],a=Math.sin(i),o=Math.cos(i);return t[0]=r*o-s*a+n[0],t[1]=r*a+s*o+n[1],t},e.angle=function(t,e){var n=t[0],i=t[1],r=e[0],s=e[1],a=n*n+i*i;a>0&&(a=1/Math.sqrt(a));var o=r*r+s*s;o>0&&(o=1/Math.sqrt(o));var u=(n*r+i*s)*a*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],r=t[1],s=e[0],a=e[1];return Math.abs(n-s)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(2);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1];return n*n+i*i}function h(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function f(t){var e=t[0],n=t[1];return e*e+n*n}e.len=h,e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=2),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;u0){n=Math.sqrt(n);var i=e[0]/n,r=e[1]/n,s=e[2]/n,a=e[3]/n,o=e[4],u=e[5],c=e[6],h=e[7],f=i*o+r*u+s*c+a*h;t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=(o-i*f)/n,t[5]=(u-r*f)/n,t[6]=(c-s*f)/n,t[7]=(h-a*f)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=e[0],l=e[1],d=e[2],m=e[3],_=e[4],p=e[5],g=e[6],v=e[7];return Math.abs(n-f)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-l)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(s-d)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-m)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(o-_)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(u-p)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))&&Math.abs(c-g)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(h-v)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))};var i=a(n(0)),r=a(n(3)),s=a(n(4));function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var i=.5*n[0],r=.5*n[1],s=.5*n[2],a=e[0],o=e[1],u=e[2],c=e[3];return t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=i*c+r*u-s*o,t[5]=r*c+s*a-i*u,t[6]=s*c+i*o-r*a,t[7]=-i*a-r*o-s*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[4],u=n[5],c=n[6],h=n[7],f=e[4],l=e[5],d=e[6],m=e[7],_=n[0],p=n[1],g=n[2],v=n[3];return t[0]=i*v+a*_+r*g-s*p,t[1]=r*v+a*p+s*_-i*g,t[2]=s*v+a*g+i*p-r*_,t[3]=a*v-i*_-r*p-s*g,t[4]=i*h+a*o+r*c-s*u+f*v+m*_+l*g-d*p,t[5]=r*h+a*u+s*o-i*c+l*v+m*p+d*_-f*g,t[6]=s*h+a*c+i*u-r*o+d*v+m*g+f*p-l*_,t[7]=a*h-i*o-r*u-s*c+m*v-f*_-l*p-d*g,t}e.getReal=r.copy,e.setReal=r.copy,e.mul=c;var h=e.dot=r.dot,f=e.length=r.length,l=(e.len=f,e.squaredLength=r.squaredLength);e.sqrLen=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(6);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,r,s,a){var o=new i.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o[4]=s,o[5]=a,o},e.set=function(t,e,n,i,r,s,a){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=n*s-i*r;return u?(u=1/u,t[0]=s*u,t[1]=-i*u,t[2]=-r*u,t[3]=n*u,t[4]=(r*o-s*a)*u,t[5]=(i*a-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=Math.sin(n),h=Math.cos(n);return t[0]=i*h+s*c,t[1]=r*h+a*c,t[2]=i*-c+s*h,t[3]=r*-c+a*h,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i*c,t[1]=r*c,t[2]=s*h,t[3]=a*h,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=i*c+s*h+o,t[5]=r*c+a*h+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=e[0],h=e[1],f=e[2],l=e[3],d=e[4],m=e[5];return Math.abs(n-c)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(r-h)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(s-f)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-l)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-d)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-m)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1],f=n[2],l=n[3],d=n[4],m=n[5];return t[0]=i*c+s*h,t[1]=r*c+a*h,t[2]=i*f+s*l,t[3]=r*f+a*l,t[4]=i*d+s*m+o,t[5]=r*d+a*m+u,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,r){var s=new i.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=n,s[3]=r,s},e.set=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*s-r*i;return a?(a=1/a,t[0]=s*a,t[1]=-i*a,t[2]=-r*a,t[3]=n*a,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+s*o,t[1]=r*u+a*o,t[2]=i*-o+s*u,t[3]=r*-o+a*u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1];return t[0]=i*o,t[1]=r*o,t[2]=s*u,t[3]=a*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,i){return t[2]=i[2]/i[0],n[0]=i[0],n[1]=i[1],n[3]=i[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=s,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*o+s*u,t[1]=r*o+a*u,t[2]=i*c+s*h,t[3]=r*c+a*h,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var i=d(n(0)),r=d(n(9)),s=d(n(8)),a=d(n(5)),o=d(n(4)),u=d(n(3)),c=d(n(7)),h=d(n(6)),f=d(n(2)),l=d(n(1));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=i,e.mat2=r,e.mat2d=s,e.mat3=a,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=h,e.vec3=f,e.vec4=l}])},function(t,e,n){"use strict";var i=n(19),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i={};n.r(i),n.d(i,"POSITION",(function(){return u})),n.d(i,"NORMAL",(function(){return c})),n.d(i,"DEPTH",(function(){return h})),n.d(i,"DISTANCE",(function(){return f}));var r=n(35),s=n.n(r).a,a=n(36),o=n.n(a).a,u="POSITION",c="NORMAL",h="DEPTH",f="DISTANCE",l={webgl:s,webglExtensions:o,Hilo:i};Object.assign(l,s,o,i);e.a=l},function(t,e,n){"use strict";var i={},r={_cache:i,level:3,LEVEL_LOG:3,LEVEL_WARN:2,LEVEL_ERROR:1,LEVEL_NONE:0,log:function(){return this.level>=3&&console.log.apply(console,arguments),this},warn:function(){return this.level>=2&&console.warn.apply(console,arguments),this},error:function(){return this.level>=1&&console.error.apply(console,arguments),this},logOnce:function(t){return i["log_"+t]||(i["log_"+t]=!0,this.log.apply(this,Array.prototype.slice.call(arguments,1))),this},warnOnce:function(t){return i["warn_"+t]||(i["warn_"+t]=!0,this.warn.apply(this,Array.prototype.slice.call(arguments,1))),this},errorOnce:function(t){return i["error_"+t]||(i["error_"+t]=!0,this.error.apply(this,Array.prototype.slice.call(arguments,1))),this}};e.a=r},function(t,e,n){"use strict";n.r(e),n.d(e,"each",(function(){return p})),n.d(e,"getRelativePath",(function(){return d})),n.d(e,"convertUint8ArrayToString",(function(){return m})),n.d(e,"getExtension",(function(){return _})),n.d(e,"getIndexFromSortedArray",(function(){return g})),n.d(e,"insertToSortedArray",(function(){return v})),n.d(e,"padLeft",(function(){return E})),n.d(e,"getTypedArrayClass",(function(){return I})),n.d(e,"copyArrayData",(function(){return L})),n.d(e,"isStrOrNumber",(function(){return O})),n.d(e,"getTypedArrayGLType",(function(){return T})),n.d(e,"getBlobUrl",(function(){return y})),n.d(e,"isBlobUrl",(function(){return S})),n.d(e,"revokeBlobUrl",(function(){return R})),n.d(e,"isArrayLike",(function(){return x})),n.d(e,"getElementRect",(function(){return N})),n.d(e,"serialRun",(function(){return b})),n.d(e,"hasOwnProperty",(function(){return C}));var i=n(3),r=n(2);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a,o=r.a.BYTE,u=r.a.UNSIGNED_BYTE,c=r.a.SHORT,h=r.a.UNSIGNED_SHORT,f=r.a.UNSIGNED_INT,l=r.a.FLOAT;function d(t,e){if(/^(?:http|blob|data:|\/)/.test(e))return e;var n;for(t=t.replace(/\/[^/]*?$/,"").split("/"),e=e.split("/"),n=0;n>1,a=n(t[s],e);if(0===a)return[s,s];a<0?i=s+1:r=s-1}return i>r?[r,i]:[i,r]}function v(t,e,n){var i=g(t,e,n);t.splice(i[1],0,e)}function E(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?h:t instanceof Uint32Array?f:l}var M,A,I=(s(M={},o,Int8Array),s(M,u,Uint8Array),s(M,c,Int16Array),s(M,h,Uint16Array),s(M,f,Uint32Array),s(M,l,Float32Array),A=M,function(t){return A[t]||Float32Array});function L(t,e,n,i,r){if(t&&e){e.isGeometryData&&(e=e.data);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,i){return t.then((function(){return e(n,i)}))}),Promise.resolve())}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec3.round(this.elements,this.elements),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},random:function(t){return i.vec3.random(this.elements,t),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i,r={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(i=0,function(t){var e=++i;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=r},function(t,e,n){"use strict";var i,r=n(0),s=n(1),a=n(5),o=n(10),u=new a.a,c=new a.a,h=s.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=r.mat4.create()},copy:function(t){return r.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this},identity:function(){return r.mat4.identity(this.elements),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,i){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],h=n[1],f=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=h*m-f*d,g=f*l-o*m,v=o*d-h*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=h*m-f*d)*p+(g=f*l-(o+=1e-7)*m)*g+(v=o*d-h*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new h),this.determinant()<0&&(n.x*=-1),i.copy(this),u.inverse(n),i.scale(u),t.fromMat4(i),r&&r.set(0,0,0),this}});h.prototype.sub=h.prototype.subtract,h.prototype.mul=h.prototype.multiply,e.a=h},function(t,e,n){"use strict";var i=n(1),r=n(12),s=n(4),a=i.a.create({Extends:r.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;a.superclass.constructor.call(this,t,e,n,i)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(s.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(s.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=a},function(t,e,n){"use strict";var i=n(37),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i=n(0),r=n(11),s=n(1),a=n(9),o=new r.a,u=s.a.create({Mixes:a.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=i.quat.fromValues(t,e,n,r)},copy:function(t,e){return i.quat.copy(this.elements,t.elements),e||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=this.elements;return i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],n||this.fire("update"),this},set:function(t,e,n,r,s){return i.quat.set(this.elements,t,e,n,r),s||this.fire("update"),this},identity:function(t){return i.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,e,n){return i.quat.rotationTo(this.elements,t.elements,e.elements),n||this.fire("update"),this},setAxes:function(t,e,n,r){return i.quat.setAxes(this.elements,t.elements,e.elements,n.elements),r||this.fire("update"),this},setAxisAngle:function(t,e,n){return i.quat.setAxisAngle(this.elements,t.elements,e),n||this.fire("update"),this},getAxisAngle:function(t){return i.quat.getAxisAngle(t.elements,this.elements)},add:function(t,e){return i.quat.add(this.elements,this.elements,t.elements),e||this.fire("update"),this},multiply:function(t,e){return i.quat.multiply(this.elements,this.elements,t.elements),e||this.fire("update"),this},premultiply:function(t,e){return i.quat.multiply(this.elements,t.elements,this.elements),e||this.fire("update"),this},scale:function(t,e){return i.quat.scale(this.elements,this.elements,t),e||this.fire("update"),this},rotateX:function(t,e){return i.quat.rotateX(this.elements,this.elements,t),e||this.fire("update"),this},rotateY:function(t,e){return i.quat.rotateY(this.elements,this.elements,t),e||this.fire("update"),this},rotateZ:function(t,e){return i.quat.rotateZ(this.elements,this.elements,t),e||this.fire("update"),this},calculateW:function(t){return i.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return i.quat.dot(this.elements,t.elements)},lerp:function(t,e,n){return i.quat.lerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},slerp:function(t,e,n){return i.quat.slerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},sqlerp:function(t,e,n,r,s,a){return i.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,r.elements,s),a||this.fire("update"),this},invert:function(t){return i.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return i.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return i.quat.length(this.elements)},squaredLength:function(){return i.quat.squaredLength(this.elements)},normalize:function(t){return i.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,e){return i.quat.fromMat3(this.elements,t.elements),e||this.fire("update"),this},fromMat4:function(t,e){return o.fromMat4(t),this.fromMat3(o,e),this},exactEquals:function(t){return i.quat.exactEquals(this.elements,t.elements)},equals:function(t){return i.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,i=.5*t.y,r=.5*t.z,s=t.order||"ZYX",a=Math.sin(n),o=Math.cos(n),u=Math.sin(i),c=Math.cos(i),h=Math.sin(r),f=Math.cos(r),l=this.elements;return"XYZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"YXZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"ZXY"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"ZYX"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"YZX"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f-a*u*h):"XZY"===s&&(l[0]=a*c*f-o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f+a*u*h),e||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});u.prototype.mul=u.prototype.multiply,u.prototype.len=u.prototype.length,u.prototype.sqrLen=u.prototype.squaredLength,e.a=u},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=i.mat3.create()},copy:function(t){return i.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)n[i]=t[e+i];return this},set:function(t,e,n,r,s,a,o,u,c){return i.mat3.set(this.elements,t,e,n,r,s,a,o,u,c),this},identity:function(){return i.mat3.identity(this.elements),this},transpose:function(){return i.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return i.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return i.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return i.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return i.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return i.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return i.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return i.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return i.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return i.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,i,r){var s=Math.cos(t),a=Math.sin(t);return this.set(i*s,-r*a,0,i*a,r*s,0,e,n,1),this}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,e.a=r},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=i.vec4.fromValues(t,e,n,r)},copy:function(t){return i.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,r){return i.vec4.set(this.elements,t,e,n,r),this},add:function(t,e){return e||(e=t,t=this),i.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec4.ceil(this.elements,this.elements),this},floor:function(){return i.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec4.round(this.elements,this.elements),this},scale:function(t){return i.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec4.squaredDistance(t.elements,e.elements)},length:function(){return i.vec4.length(this.elements)},squaredLength:function(){return i.vec4.squaredLength(this.elements)},negate:function(){return i.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec4.inverse(this.elements,t.elements),this},normalize:function(){return i.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return i.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return i.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return i.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i=n(1),r=n(6),s=n(7),a=n(3),o=new s.a,u=r.a.DEG2RAD,c=r.a.RAD2DEG,h=i.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,i=n[0],s=n[1],o=n[2],u=n[4],c=n[5],h=n[6],f=n[8],l=n[9],d=n[10];e=e||this.order,this.order=e;var m=r.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-u,i)):(this.elements[0]=Math.atan2(h,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(f,d),this.elements[2]=Math.atan2(s,c)):(this.elements[1]=Math.atan2(-o,i),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[1]=Math.atan2(-o,d),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(s,i))):"ZYX"===e?(this.elements[1]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(h,d),this.elements[2]=Math.atan2(s,i)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(m(s,-1,1)),Math.abs(s)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-o,i)):(this.elements[0]=0,this.elements[1]=Math.atan2(f,d))):"XZY"===e?(this.elements[2]=Math.asin(-m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(h,c),this.elements[1]=Math.atan2(f,i)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):a.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=h},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=i.vec2.fromValues(t,e)},copy:function(t){return i.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return i.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),i.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec2.ceil(this.elements,this.elements),this},floor:function(){return i.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec2.round(this.elements,this.elements),this},scale:function(t){return i.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec2.squaredDistance(t.elements,e.elements)},length:function(){return i.vec2.length(this.elements)},squaredLength:function(){return i.vec2.squaredLength(this.elements)},negate:function(){return i.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec2.inverse(this.elements,t.elements),this},normalize:function(){return i.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return i.vec2.random(this.elements,t),this},transformMat3:function(t){return i.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e){t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){function i(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.indices=e,this.mode=n,this.attrs=[],this.attrIndexMap={}}return r(t,null,[{key:"cp",value:function(t){return t}},{key:"minus",value:function(t,e){return t-e}},{key:"plus",value:function(t,e){return t+e}},{key:"pp",value:function(t,e,n,i){return i-e-n+t}},{key:"depp",value:function(t,e,n,i){return e+n-t+i}},{key:"ATTR",get:function(){return a}},{key:"ATTR_NAME_ID",get:function(){return u}}]),r(t,[{key:"getAttrLength",value:function(){return this.attrs[0].data.length/this.attrs[0].itemCount}},{key:"attrIdToName",value:function(t){return o[t]||"OTHER"}},{key:"addAttr",value:function(t,e,n){a[t]?(this.attrIndexMap[t]=this.attrs.length,n||(n=f[t])):n||(n=1),this.attrs.push({name:t,itemCount:n,data:e})}},{key:"getAttr",value:function(t){if(this.attrIndexMap[t])return this.attrs[this.attrIndexMap[t]];for(var e=this.attrs.length-1;e>=0;e--){var n=this.attrs[e];if(n.name===t)return n}}},{key:"cal",value:function(t,e,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),s=3;s=0;c--)o[u+c]=n.apply(null,r.map((function(t){return a[t*i.itemCount+c]})))}))}},{key:"quantize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attrs.forEach((function(e){if("JOINT"!==e.name&&0!=t[e.name]){var n=s.encode(e.data,t[e.name]||12);e.quantizationBit=n.quantizationBit,e.min=n.min,e.max=n.max,e.data=n.data}}))}},{key:"dequantize",value:function(){this.attrs.forEach((function(t){t.quantizationBit&&(t.data=s.decode(t.data,t.quantizationBit,t.min,t.max))}))}},{key:"convertTypedArray",value:function(){!this.indices||this.indices instanceof Array||(this.indices=Array.from(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array||t.data instanceof Float32Array||(t.data=Array.from(t.data))}))}},{key:"clearEBAttrs",value:function(){delete this.clers,delete this.holes,delete this.handles}},{key:"convertToTypedArray",value:function(){this.indices instanceof Array&&(this.getAttrLength()>65535?this.indices=new Uint32Array(this.indices):this.indices=new Uint16Array(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array&&(t.data=new Float32Array(t.data))}))}},{key:"prepareToWorkerSend",value:function(){return this.clearEBAttrs(),this.convertToTypedArray(),this.getAllBuffers()}},{key:"clone",value:function(){var e=new t(Array.from(this.indices),this.mode);return Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=Array.from(e.data),e})),e}},{key:"cloneStruct",value:function(){var e=new t;return e.mode=this.mode,this.indices&&(e.indices=[]),Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=[],e})),e}},{key:"toHilo3dGeometry",value:function(t,e){var n=e||new t.Geometry;return this.indices&&(this.indices.BYTES_PER_ELEMENT?n.indices=new t.GeometryData(this.indices,1):this.getAttrLength()>65535?n.indices=new t.GeometryData(new Uint32Array(this.indices),1):n.indices=new t.GeometryData(new Uint16Array(this.indices),1)),this.attrs.forEach((function(e){var i=c[e.name];i&&(e.data.BYTES_PER_ELEMENT?n[i]=new t.GeometryData(e.data,e.itemCount):n[i]=new t.GeometryData(new Float32Array(e.data),e.itemCount))})),n}},{key:"getAllBuffers",value:function(){var t=[];return this.indices.BYTES_PER_ELEMENT&&t.push(this.indices.buffer),this.attrs.forEach((function(e){e.data&&e.data.BYTES_PER_ELEMENT&&t.push(e.data.buffer)})),t}}],[{key:"fromGLTFPrimitive",value:function(e){var n=new t(e.indices,e.mode),i=e.attributes,r=0;for(var s in i.POSITION&&(r=i.POSITION.length/3),i)if(a[s]){var o=f[a[s]];r&&(o=i[s].length/r),n.addAttr(a[s],i[s],o)}else console.warn("Dont support attribute",s);return n}},{key:"fromHilo3dGeometry",value:function(e){var n=new t(e.indices.data,e.mode);for(var i in h)e[i]&&n.addAttr(h[i],e[i].data,e[i].size);return n}}]),t}();t.exports=l},function(t,e){var n={};function i(t){return n[t]||(n[t]=Math.pow(2,t)-1),n[t]}t.exports={cal:function(t,e,n,r){var s=i(r),a=n-e;return Math.round((t-e)/a*s)},encode:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=t.length,r=i(e),s=1/0,a=-1/0,o=0;o1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,a=t.length,o=i(s),u=r-n||1,c=0;c1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=t.length,a=i(e),o=r-n,u=new Float32Array(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,i=t.length,r=0;r1&&void 0!==arguments[1]?arguments[1]:0;return t instanceof Uint8Array&&(e=t.byteOffset,t=t.buffer),function(t){return new u[t.type](t).decompress()}(function(t,e){var n=new Uint8Array(t,e,4);if(65!==n[0]||77!==n[1]||67!==n[2])throw new Error("The file is not AMC format!");var i=c[n[3]].read(t,e+4);return i.geometry.type=n[3],i.geometry}(t,e))}var f,l=null,d=null;function m(t,e){return!l&&o()?(l=new a({wasmURL:t,memPages:e}),d=l.init()):d||Promise.resolve()}function _(t,e,n){if(l||m(e,n),!l||!l.isReady)return h(t);try{return l.decompress(t)}catch(e){return console.warn("wasm decompress error",e),h(t)}}var p=null;function g(t){return t=t||"https://g.alicdn.com/hilo/amc/0.1.27/worker.js",p||(!1===f||"undefined"==typeof Worker?Promise.reject("dont support web worker"):p=/^(?:http|blob|data:|\/\/)/.test(t)?new Promise((function(e,n){var i=new XMLHttpRequest;i.addEventListener("load",(function(){if("undefined"==typeof URL||"undefined"==typeof Blob)f=new Worker("data:application/javascript, ".concat(this.responseText));else{var t=URL.createObjectURL(new Blob([this.responseText]));f=new Worker(t)}f.onerror=function(t){console.log("web worker error",t),f=!1,n(t)},e(f)})),i.addEventListener("error",(function(t){return n(t)})),i.open("get",t,!0),i.send()})):new Promise((function(e,n){(f=new Worker(t)).onerror=function(t){console.log("web worker init error",t),f=!1,n(t)},e(f)})))}var v=0;function E(t,e,n,r){return e=e&&o(),t=new Uint8Array(t),g(r).then((function(r){return new Promise((function(s,a){var o=v++,u=function(e){if(e.data.id===o)if(r.removeEventListener("message",u),u=null,e.data.data){var n=e.data.data;n.constructor=i,n.__proto__=i.prototype,s(n)}else s(h(t))};r.addEventListener("message",u),r.postMessage({id:o,data:t,useWASM:e,wasmURL:n},[t.buffer])}))})).catch((function(i){return e?_(t,n):h(t)}))}t.exports={initWASM:m,initWorker:g,decompress:function(t,e,n){var i=o();return!i||t.byteLength>1048576?E(t,i,e,n):i?Promise.resolve(_(t,e)):Promise.resolve(h(t))},decompressWithJS:h,decompressWithWASM:_,decompressWithWorker:E,destory:function(){f&&(f.terminate(),f=null,p=null),l&&(l=null,d=null)}}},function(t,e,n){function i(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;n-=2)e[t[n]]=t[n-1]}},{key:"mapBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex,r=this.currentVertex-n+1,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i,i=r,e[this.prevCorner(t[s])]=r++;this.currentVertex-=n}},{key:"mapHoleBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex-n+1,r=i,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i++,e[this.prevCorner(t[s])]=s?i:r;this.currentVertex-=n}},{key:"fixNegativeIndex",value:function(t){for(var e=t,n=this.indices;n[t]<0;){if(e===-n[-n[t]]||n[t]===n[-n[t]]){console.warn("dead loop bug!!"),n[s]=0;break}n[t]=n[-n[t]]}}},{key:"fixIndicesAndReadVertice",value:function(){for(var t,e=this.indices,n=this.handlesMap,i=this.clers,r=i.length,s=-1,a=[],u=0,c=0;u1&&void 0!==arguments[1]?arguments[1]:-1;if(!this.readedVertexMap[t]&&(this.readedVertexMap[t]=1,!this.noParallelogramPrediction)){var n=this.indices,i=this.geometry;-1===e?void 0!==this.lastReadVertexIndex&&i.cal(i,t,a.plus,this.lastReadVertexIndex,t):i.cal(i,t,a.depp,n[e],n[this.prevCorner(e)],n[this.nextCorner(e)],t),this.lastReadVertexIndex=t}}},{key:"markCorner",value:function(t,e){var n=this.indices;void 0===n[this.nextCorner(t)]&&(n[this.nextCorner(t)]=-this.prevCorner(e[0])),void 0===n[this.prevCorner(t)]&&(n[this.prevCorner(t)]=-this.nextCorner(e[e.length-1]))}},{key:"onFaceC",value:function(t){var e=this.indices,n=3*this.currentFace,i=this.currentVertex--;e[n]=i;var r=t.pop();return e[this.nextCorner(r)]=i,e[this.prevCorner(r)]=-this.nextCorner(t[t.length-1]),r=t.shift(),e[this.prevCorner(r)]=i,e[this.nextCorner(r)]=-this.prevCorner(t[0]),t.push(n),t}},{key:"onFaceL",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.unshift(e+2),t.push(e),t}},{key:"onFaceF",value:function(t,e){return t&&this.mapBoundary(t),this.onFaceE(null,e)}},{key:"onFaceE",value:function(t,e){var n=3*this.currentFace;return t&&e.push(t),[n+2,n+1,n]}},{key:"onFaceR",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.push(e+1,e),t}},{key:"onHandleEnd",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=this.handlesMap[this.currentFace],a=e.splice(0,t);return e.shift(),n.push(a),i[this.nextCorner(s)]=-(r+1),i[this.prevCorner(s)]=-this.nextCorner(a[a.length-1]),i[r]=-this.prevCorner(a[0]),e.push(r),e}},{key:"onHandleStart",value:function(t,e){for(var n,r=this.indices,s=3*this.currentFace,a=this.handlesMap[this.currentFace],o=e.length-1;o>=0;o--){var u=e[o].indexOf(a);if(u>=0){var c,h=(n=e.splice(o,1)[0]).splice(0,u);n.shift(),(c=n).push.apply(c,i(h));break}}return r[this.nextCorner(a)]=-(s+1),r[this.prevCorner(a)]=-this.nextCorner(n[n.length-1]),r[s]=-this.prevCorner(t[0]),(t=n.concat(t)).push(s),t}},{key:"onFaceS",value:function(t,e,n){var i=this.handlesMap,r=this.indices,s=3*this.currentFace;if(i[this.currentFace]){this.markCorner(t.pop(),t);var a=t.indexOf(i[this.currentFace]);t=a>=0?this.onHandleEnd(a,t,n):this.onHandleStart(t,n)}else{var o=t.pop();this.markCorner(o,t),r[s]=-this.nextCorner(o);var u=e.pop();this.markCorner(u.pop(),u),(t=u.concat(t)).push(s)}return t}},{key:"onFaceM",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=t.splice(0,this.holes[this.currentHole--]);this.mapHoleBoundary(s);var a=i[this.prevCorner(s[0])];i[r]=a;var o=t.pop();return i[this.prevCorner(o)]=-this.nextCorner(t[t.length-1]),i[this.nextCorner(o)]=a,o=t.shift(),i[this.prevCorner(o)]=a,i[this.nextCorner(o)]=-this.prevCorner(t[0]),t.push(r),t}},{key:"decompress",value:function(){this.readedVertexMap=new Uint8Array(this.vertexCount);var t=this.faceCount,e=this.indices=new Array(3*t);this.currentFace=t-1,this.currentVertex=this.vertexCount-1,this.currentHole=this.holes.length-1;for(var n,i=this.clers,r=[],s=[];this.currentFace>=0;){var a="onFace"+u[i[this.currentFace]];this[a]?n=this[a](n,r,s):console.warn("has no ".concat(a)),this.currentFace--}return this.mapBoundary(n),this.fixIndicesAndReadVertice(this.indices),this.geometry.indices=e,this.geometry.dequantize(),this.geometry}},{key:"_onDecompressFace",value:function(t,e){this.onDecompressFace&&this.onDecompressFace(t,e)}}])&&r(e.prototype,n),t}();t.exports=c},function(t,e){var n={C:0,R:1,L:2,S:3,E:4,M:5,F:6},i=[];for(var r in n)i[n[r]]=r;n.map=i,t.exports=n},function(t,e,n){var i=n(0);function r(t,e,n,i){return new t(e.slice(n,n+i*t.BYTES_PER_ELEMENT))}t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t),s=new i,a=function(t,e){var n={};return n.version=t.getUint8(e++),n.faceCount=t.getUint32(e,!0),e+=4,n.vertexCount=t.getUint32(e,!0),e+=4,n.attrCount=t.getUint8(e++),n.noParallelogramPrediction=t.getUint8(e++),n.holesCount=t.getUint16(e,!0),e+=2,n.handlesCount=t.getUint16(e,!0),e+=2,n.headerBytes=15,n}(n,e);return e+=a.headerBytes,s.mode="CLERS",e=function(t,e,n,i){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wasmURL=e.wasmURL||"https://ossgw.alicdn.com/tmall-c3/tmx/70b8d82ccf33e97a124e54c2d6a3e0c7.wasm",this.memPages=e.memPages||256,this.memPages<256&&(this.memPages=256),this.isReady=!1}var e,n;return e=t,(n=[{key:"initASMJS",value:function(){this.isReady=!0,this.dv=new DataView(HEAP8.buffer),this.heap8=HEAP8,this.ins={exports:{__Z7AMCinitj:Module.__Z7AMCinitj,__Z12AMDecompressv:Module.__Z12AMDecompressv}}}},{key:"init",value:function(){var t=this,e=this.memory=new WebAssembly.Memory({initial:this.memPages});this.dv=new DataView(e.buffer);var n=this.heap8=new Uint8Array(e.buffer),i={global:{NaN:5,Infinity:6},env:{memoryBase:0,memory:e,_malloc:function(){return 2097152},_memset:function(t,e,i){return n.fill(e,t,t+i),t},_printf:function(t,e){for(var i=t;n[i];)i++;var r=String.fromCharCode.apply(String,function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e65536?new Uint32Array(d):new Uint16Array(d);var m=new r(d);return h.forEach((function(t){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t,3),i=n[0],r=n[1],s=n[2],a=new Float32Array(e.buffer.slice(s,s+u*r*4));m.addAttr(m.attrIdToName(i),a,r)})),m}}])&&i(e.prototype,n),t}();t.exports=s},function(t,e){var n;t.exports=function(){return void 0===n&&(n=function(){if("undefined"==typeof WebAssembly||"undefined"==typeof fetch||function(){if(!/iPad|iPhone|iPod/i.test(navigator.userAgent))return!1;if(/OS (\d+)_(\d+)_?(\d+)?/i.test(navigator.userAgent)){var t=Number(RegExp.$1),e=Number(RegExp.$2);if(11===t&&e>=3||t>11)return!1}return!0}())return!1;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)}catch(t){return console.log("err while check WebAssembly",t),!1}}()),n}}])},function(t,e,n){"use strict";var i=n(38),r=n.n(i),s=n(1),a=n(5),o=s.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new r.a,this.origin=t.origin||new a.a(0,0,0),this.direction=t.direction||new a.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,i,r){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,i,r)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,i,r)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,i){return n.squaredDistance(t[e])-n.squaredDistance(i[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new a.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var i=n(0),r=n(1),s=n(9),a=n(5),o=r.a.create({Mixes:s.a,Extends:a.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.fire("update"),this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this.fire("update"),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this.fire("update"),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this.fire("update"),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this.fire("update"),this},round:function(){return i.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.fire("update"),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this.fire("update"),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this.fire("update"),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},random:function(t){return i.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this.fire("update"),this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});e.a=o},function(t,e){t.exports="#define GLSLIFY 1\n#define HILO_FRONT_SIDE 1028\n#define HILO_BACK_SIDE 1029\n#define HILO_FRONT_AND_BACK_SIDE 1032\n#define HILO_PI 3.141592653589793\n#define HILO_INVERSE_PI 0.3183098861837907"},function(t,e){var n=function(){var t,e,n=function(t){var e,n,r={};for(e in t)n=t[e],i.hasOwnProperty(e)?i[e].call(this,n):r[e]=n;s(this.prototype,r)},i={Extends:function(t){var e=this.prototype,n=r(t.prototype);s(this,t),s(n,e),n.constructor=this,this.prototype=n,this.superclass=t.prototype},Mixes:function(t){t instanceof Array||(t=[t]);for(var e,n=this.prototype;e=t.shift();)s(n,e.prototype||e)},Statics:function(t){s(this,t)}},r=function(){if(Object.__proto__)return function(t){return{__proto__:t}};var t=function(){};return function(e){return t.prototype=e,new t}}(),s=function(t){for(var n=1,i=arguments.length;n0&&void 0!==arguments[0]?arguments[0]:new r.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,i){return this.normal.set(t,e,n),this.distance=i,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new r.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=s},function(t,e,n){"use strict";var i=n(1),r=n(5),s=new r.a,a=i.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new r.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this.fire("update"),this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this.fire("update"),this},identity:function(){return r.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this.fire("update"),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this.fire("update"),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,e,n,i,s){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),s||this.fire("update"),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this.fire("update"),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this.fire("update"),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.fire("update"),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this.fire("update"),this},lookAt:function(t,e,n){return t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},targetTo:function(t,e,n){t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],u=n[1],c=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=u*m-c*d,g=c*l-o*m,v=o*d-u*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=u*m-c*d)*p+(g=c*l-(o+=1e-7)*m)*g+(v=o*d-u*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this.fire("update"),this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new u.a),this.determinant()<0&&(n.x*=-1),i.copy(this),h.inverse(n),i.scale(h),t.fromMat4(i),r&&r.set(0,0,0),this}});e.a=l},function(t,e,n){"use strict";var i=n(1),r=n(9),s=n(6),a=n(13),o=s.a.DEG2RAD,u=s.a.RAD2DEG,c=i.a.create({Mixes:r.a,Extends:a.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a.a.call(this,t,e,n)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*u,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*u,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*u,this.fire("update")}}});e.a=c},function(t,e,n){"use strict";var i=n(1),r=n(20),s=i.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new r.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],u=n[5],c=n[6],h=n[7],f=n[8],l=n[9],d=n[10],m=n[11],_=n[12],p=n[13],g=n[14],v=n[15];return e[0].set(a-i,h-o,m-f,v-_).normalize(),e[1].set(a+i,h+o,m+f,v+_).normalize(),e[2].set(a+r,h+u,m+l,v+p).normalize(),e[3].set(a-r,h-u,m-l,v-p).normalize(),e[4].set(a-s,h-c,m-d,v-g).normalize(),e[5].set(a+s,h+c,m+d,v+g).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)-1&&a.splice(h,1)}}return 0==a.length&&delete s[i],!0}return!1}},r=n(19).create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),s=window.Event;if(s){var a=s.prototype,o=a.stopImmediatePropagation;a.stopImmediatePropagation=function(){o&&o.call(this),this._stopped=!0}}t.exports=i},function(t,e,n){var i=n(94),r=n(96),s=n(97),a=n(100),o=n(34),u=[[0,0,0],[0,0,0],[0,0,0]],c=[0,0,0];function h(t,e){this.origin=t||[0,0,0],this.direction=e||[0,0,-1]}t.exports=h,h.prototype.set=function(t,e){this.origin=t,this.direction=e},h.prototype.copy=function(t){o(this.origin,t.origin),o(this.direction,t.direction)},h.prototype.clone=function(){var t=new h;return t.copy(this),t},h.prototype.intersectsSphere=function(t,e){return s(c,this.origin,this.direction,t,e)},h.prototype.intersectsPlane=function(t,e){return r(c,this.origin,this.direction,t,e)},h.prototype.intersectsTriangle=function(t){return i(c,this.origin,this.direction,t)},h.prototype.intersectsBox=function(t){return a(c,this.origin,this.direction,t)},h.prototype.intersectsTriangleCell=function(t,e){var n=t[0],i=t[1],r=t[2];return u[0]=e[n],u[1]=e[i],u[2]=e[r],this.intersectsTriangle(u)}},,function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_COLOR\n varying vec4 v_color;\n#endif\n\n#ifdef HILO_USE_HDR\n uniform float u_exposure;\n#endif\n\n#ifdef HILO_GAMMA_CORRECTION\n uniform float u_gammaFactor;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_TEXCOORD0\n varying vec2 v_texcoord0;\n#endif\n\n#ifdef HILO_HAS_TEXCOORD1\n varying vec2 v_texcoord1;\n#endif\n\n#if defined(HILO_HAS_TEXCOORD0) || defined(HILO_HAS_TEXCOORD1)\n #if defined(HILO_HAS_TEXCOORD0) && defined(HILO_HAS_TEXCOORD1)\n #define HILO_SAMPLER_2D hiloSampler2D\n // https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Opaque_types\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) hiloTexture2D(HILO_SAMPLER_2D.texture, HILO_SAMPLER_2D.uv)\n struct hiloSampler2D{\n sampler2D texture;\n int uv; \n };\n \n vec4 hiloTexture2D(sampler2D texture, int uv){\n if(uv == 0){\n return texture2D(texture, v_texcoord0);\n }\n else{\n return texture2D(texture, v_texcoord1);\n }\n }\n #else\n #ifdef HILO_HAS_TEXCOORD1\n #define HILO_V_TEXCOORD v_texcoord1\n #else\n #define HILO_V_TEXCOORD v_texcoord0\n #endif\n #define HILO_SAMPLER_2D sampler2D\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) texture2D(HILO_SAMPLER_2D, HILO_V_TEXCOORD)\n #endif\n#endif\n\n\n#ifdef HILO_DIFFUSE_CUBE_MAP\n varying vec3 v_position;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_NORMAL\n varying vec3 v_normal;\n #ifdef HILO_NORMAL_MAP\n uniform HILO_SAMPLER_2D u_normalMap;\n varying mat3 v_TBN;\n \n #ifdef HILO_NORMAL_MAP_SCALE\n uniform float u_normalMapScale;\n #endif\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#if defined(HILO_HAS_LIGHT) || defined(HILO_HAS_FRAG_POS)\n varying vec3 v_fragPos;\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n#ifdef HILO_DIRECTIONAL_LIGHTS\n uniform vec3 u_directionalLightsColor[HILO_DIRECTIONAL_LIGHTS];\n uniform vec3 u_directionalLightsInfo[HILO_DIRECTIONAL_LIGHTS];\n #ifdef HILO_DIRECTIONAL_LIGHTS_SMC\n uniform sampler2D u_directionalLightsShadowMap[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowMapSize[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform mat4 u_directionalLightSpaceMatrix[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowBias[HILO_DIRECTIONAL_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_SPOT_LIGHTS\n uniform vec3 u_spotLightsPos[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsDir[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsColor[HILO_SPOT_LIGHTS];\n uniform vec2 u_spotLightsCutoffs[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsInfo[HILO_SPOT_LIGHTS];\n uniform float u_spotLightsRange[HILO_SPOT_LIGHTS];\n #ifdef HILO_SPOT_LIGHTS_SMC\n uniform sampler2D u_spotLightsShadowMap[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowMapSize[HILO_SPOT_LIGHTS_SMC];\n uniform mat4 u_spotLightSpaceMatrix[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowBias[HILO_SPOT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_POINT_LIGHTS\n uniform vec3 u_pointLightsPos[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsColor[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsInfo[HILO_POINT_LIGHTS];\n uniform float u_pointLightsRange[HILO_POINT_LIGHTS];\n #ifdef HILO_POINT_LIGHTS_SMC\n uniform samplerCube u_pointLightsShadowMap[HILO_POINT_LIGHTS_SMC];\n uniform mat4 u_pointLightSpaceMatrix[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightsShadowBias[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightCamera[HILO_POINT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_AREA_LIGHTS\n uniform vec3 u_areaLightsPos[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsColor[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsWidth[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsHeight[HILO_AREA_LIGHTS];\n uniform sampler2D u_areaLightsLtcTexture1;\n uniform sampler2D u_areaLightsLtcTexture2;\n\n "+n(113)+"\n#endif\n\n#ifdef HILO_AMBIENT_LIGHTS\n uniform vec3 u_ambientLightsColor;\n#endif\n\n"+n(64)+"\n"+n(65)+"\n"+n(66)+"\n"+n(67)+"\n"+n(68)},function(t,e){t.exports="#define GLSLIFY 1\nvec4 textureEnvMap(sampler2D texture, vec3 position){\n return texture2D(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI));\n}\n\nvec4 textureEnvMap(samplerCube texture, vec3 position){\n return textureCube(texture, position);\n}\n\n#ifdef HILO_USE_SHADER_TEXTURE_LOD\n vec4 textureEnvMapLod(sampler2D texture, vec3 position, float lod){\n return texture2DLodEXT(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI), lod);\n }\n\n vec4 textureEnvMapLod(samplerCube texture, vec3 position, float lod){\n return textureCubeLodEXT(texture, position, lod);\n }\n#endif\n\n"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_TRANSPARENCY_MAP\n uniform HILO_SAMPLER_2D u_transparency;\n#else\n uniform float u_transparency;\n#endif\n\n#ifdef HILO_ALPHA_CUTOFF\n uniform float u_alphaCutoff;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_FOG\n varying float v_dist;\n uniform vec4 u_fogColor;\n \n #ifdef HILO_FOG_LINEAR\n uniform vec2 u_fogInfo;\n #else\n uniform float u_fogInfo;\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_NORMAL_MAP\n vec3 normal = HILO_TEXTURE_2D(u_normalMap).rgb * 2.0 - 1.0;\n #ifdef HILO_NORMAL_MAP_SCALE\n normal.xy *= u_normalMapScale;\n #endif\n normal = normalize(v_TBN * normal);\n#elif defined(HILO_HAS_NORMAL)\n vec3 normal = normalize(v_normal);\n#else\n vec3 normal = vec3(0, 0, 1);\n#endif\n\n#if HILO_SIDE == HILO_BACK_SIDE\n normal = -normal;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_LIGHT\n #if HILO_SIDE == HILO_FRONT_AND_BACK_SIDE\n normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\nfloat transparency = 1.0;\n#ifdef HILO_TRANSPARENCY_MAP\n transparency = HILO_TEXTURE_2D(u_transparency).r;\n#else\n transparency = u_transparency;\n#endif\ncolor.a *= transparency;\n#ifdef HILO_ALPHA_CUTOFF\n if (color.a < u_alphaCutoff) {\n discard;\n } else {\n color.a = 1.0;\n }\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n#ifdef HILO_IGNORE_TRANSPARENT\ncolor.a = 1.0;\n#endif\n\n#ifdef HILO_USE_HDR\n color.rgb = vec3(1.0) - exp(-color.rgb * u_exposure);\n#endif\n\n#ifdef HILO_GAMMA_CORRECTION\n color.rgb = pow(color.rgb, vec3(1.0 / u_gammaFactor));\n#endif\n\n"+n(73)+"\n\n#ifdef HILO_PREMULTIPLY_ALPHA\n color.rgb *= color.a;\n#endif\n\ngl_FragColor = color;"},function(t,e){t.exports="#define GLSLIFY 1\n"},function(t,e){t.exports="#ifdef GL_ES\nprecision HILO_MAX_VERTEX_PRECISION float;\n#define GLSLIFY 1\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(40)+"\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(62)+"\n"+n(44)+"\n"+n(69)+"\n"+n(46)+"\n"+n(47)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 diffuse = vec4(0., 0., 0., 1.);\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(48)+"\n "+n(49)+"\n "+n(71)+"\n "+n(72)+"\n "+n(50)+"\n "+n(51)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(52)+"\n"+n(18)+"\n"+n(53)+"\n\nattribute vec3 a_position;\nuniform mat4 u_modelViewProjectionMatrix;\n\n"+n(74)+"\n"+n(75)+"\n"+n(76)+"\n"+n(77)+"\n"+n(78)+"\n"+n(79)+"\n"+n(80)+"\n"+n(81)+"\nvoid main(void) {\n vec4 pos = vec4(a_position, 1.0);\n #ifdef HILO_HAS_TEXCOORD0\n vec2 uv = a_texcoord0;\n #endif\n #ifdef HILO_HAS_TEXCOORD1\n vec2 uv1 = a_texcoord1;\n #endif\n #ifdef HILO_HAS_NORMAL\n vec3 normal = a_normal;\n #endif\n\n #ifdef HILO_NORMAL_MAP\n vec4 tangent = a_tangent;\n #endif\n\n "+n(82)+"\n "+n(83)+"\n "+n(84)+"\n "+n(85)+"\n "+n(86)+"\n "+n(87)+"\n "+n(88)+"\n\n gl_Position = u_modelViewProjectionMatrix * pos;\n\n "+n(89)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n#if defined(HILO_VERTEX_TYPE_POSITION)\n varying vec3 v_fragPos;\n#elif defined(HILO_VERTEX_TYPE_NORMAL)\n varying vec3 v_normal;\n#elif defined(HILO_VERTEX_TYPE_DEPTH)\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n uniform float u_cameraType;\n#elif defined(HILO_VERTEX_TYPE_DISTANCE)\n "+n(90)+"\n\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n varying vec3 v_fragPos;\n#endif\n\nvec4 transformDataToColor(vec3 data){\n #ifdef HILO_WRITE_ORIGIN_DATA\n return vec4(data, 1.0);\n #else\n return vec4(data * 0.5 + 0.5, 1.0);\n #endif\n}\n\n"+n(29)+"\n\nvoid main(void) {\n #if defined(HILO_VERTEX_TYPE_POSITION)\n gl_FragColor = transformDataToColor(v_fragPos);\n #elif defined(HILO_VERTEX_TYPE_NORMAL)\n gl_FragColor = transformDataToColor(v_normal);\n #elif defined(HILO_VERTEX_TYPE_DEPTH)\n float z;\n #ifdef HILO_WRITE_ORIGIN_DATA\n z = gl_FragCoord.z;\n #else\n // OrthographicCamera\n if(u_cameraType < 1.0){\n z = gl_FragCoord.z;\n }\n // PerspectiveCamera\n else{\n z = gl_FragCoord.z * 2.0 - 1.0;\n z = (2.0 * u_cameraNear * u_cameraFar) / (u_cameraFar + u_cameraNear - z * (u_cameraFar - u_cameraNear));\n }\n #endif\n gl_FragColor = vec4(z, z, z, 1.0);\n #elif defined(HILO_VERTEX_TYPE_DISTANCE)\n float distance = length(v_fragPos);\n #ifdef HILO_WRITE_ORIGIN_DATA\n gl_FragColor = vec4(distance, distance, distance, 1.0);\n #else\n gl_FragColor = packFloat((distance - u_cameraNear)/(u_cameraFar - u_cameraNear));\n #endif\n #endif\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(40)+"\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(91)+"\n"+n(44)+"\n"+n(46)+"\n"+n(47)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(48)+"\n "+n(49)+"\n "+n(93)+"\n "+n(51)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\nvarying vec2 v_texcoord0;\nuniform sampler2D u_diffuse;\n\nvoid main(void) { \n gl_FragColor = texture2D(u_diffuse, v_texcoord0);\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(52)+"\n"+n(18)+"\n"+n(53)+"\n\nattribute vec2 a_position;\nattribute vec2 a_texcoord0;\nvarying vec2 v_texcoord0;\n\n\nvoid main(void) {\n vec4 pos = vec4(a_position, 0.0, 1.0);\n gl_Position = pos;\n v_texcoord0 = a_texcoord0;\n}"},function(t,e){var n=function(){var t=navigator.userAgent,e=document,n=window,i=e.documentElement,r={iphone:/iphone/i.test(t),ipad:/ipad/i.test(t),ipod:/ipod/i.test(t),ios:/iphone|ipad|ipod/i.test(t),android:/android/i.test(t),webkit:/webkit/i.test(t),chrome:/chrome/i.test(t),safari:/safari/i.test(t),firefox:/firefox/i.test(t),ie:/msie/i.test(t),opera:/opera/i.test(t),supportTouch:"ontouchstart"in n,supportCanvas:null!=e.createElement("canvas").getContext,supportStorage:!1,supportOrientation:"orientation"in n||"orientation"in n.screen,supportDeviceMotion:"ondevicemotion"in n};try{localStorage.setItem("hilo","hilo"),localStorage.removeItem("hilo"),r.supportStorage=!0}catch(t){}var s=r.jsVendor=r.webkit?"webkit":r.firefox?"webkit":r.opera?"o":r.ie?"ms":"",a=r.cssVendor="-"+s+"-",o=e.createElement("div"),u=o.style,c=null!=u[s+"Transform"],h=null!=u[s+"Perspective"];h&&(o.id="test3d",(u=e.createElement("style")).textContent="@media ("+a+"transform-3d){#test3d{height:3px}}",e.head.appendChild(u),i.appendChild(o),h=3==o.offsetHeight,e.head.removeChild(u),i.removeChild(o)),r.supportTransform=c,r.supportTransform3D=h;var f=r.supportTouch,l=f?"touchstart":"mousedown",d=f?"touchmove":"mousemove",m=f?"touchend":"mouseup";return r.POINTER_START=l,r.POINTER_MOVE=d,r.POINTER_END=m,r}();t.exports=n},function(t,e,n){var i=n(19),r=function(){function t(){return+new Date}return i.create({constructor:function(t,e,n,i){var r=this;for(var s in r.target=t,r._startTime=0,r._seekTime=0,r._pausedTime=0,r._pausedStartTime=0,r._reverseFlag=1,r._repeatCount=0,3==arguments.length&&(i=n,n=e,e=null),i)r[s]=i[s];r._fromProps=e,r._toProps=n,!i.duration&&i.time&&(r.duration=i.time||0,r.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,isComplete:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var n=this.target,i=t||e,r=this._fromProps={},s=this._toProps={};for(var a in t=t||n,e=e||n,i)s[a]=e[a]||0,n[a]=r[a]=t[a]||0;return this},start:function(){var e=this;return e._startTime=t()+e.delay,e._seekTime=0,e._pausedTime=0,e._reverseFlag=1,e._repeatCount=0,e.paused=!1,e.isStart=!1,e.isComplete=!1,r.add(e),e},stop:function(){return r.remove(this),this},pause:function(){return this.paused=!0,this._pausedStartTime=t(),this},resume:function(){var e=this;return e.paused=!1,e._pausedStartTime&&(e._pausedTime+=t()-e._pausedStartTime),e._pausedStartTime=0,e},seek:function(e,n){var i=this,s=t();return i._startTime=s,i._seekTime=e,i._pausedTime=0,void 0!==n&&(i.paused=n),i._update(s,!0),r.add(i),i},link:function(t){var e,n,i=t.delay,s=this._startTime;return"string"==typeof i&&(e=0==i.indexOf("+"),n=0==i.indexOf("-"),i=e||n?Number(i.substr(1))*(e?1:-1):Number(i)),t.delay=i,t._startTime=e||n?s+this.duration+i:s+i,this._next=t,r.remove(t),t},_render:function(t){var e,n=this.target,i=this._fromProps;for(e in i)n[e]=i[e]+(this._toProps[e]-i[e])*t},_update:function(e,n){var i=this;if(!i.paused||n){if(i.isComplete)return!0;var s=e-i._startTime-i._pausedTime+i._seekTime;if(!(s<0)){var a,o=s/i.duration;o=o<=0?0:o>=1?1:o;var u=i.ease?i.ease(o):o;i.reverse&&i.isStart&&(i._reverseFlag<0&&(o=1-o,u=1-u),o<1e-7&&(i.repeat>0&&i._repeatCount++>=i.repeat||0==i.repeat&&!i.loop?!0:(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1))),i.isStart||(i.setProps(i._fromProps,i._toProps),i.isStart=!0,i.onStart&&i.onStart.call(i,i)),i.time=s,i._render(u),(a=i.onUpdate)&&a.call(i,u,i),o>=1&&(i.reverse?(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1):i.loop||i.repeat>0&&i._repeatCount++0&&h<=e?(c._render(o),c.time=s,r.add(c)):i.isComplete&&(h<0||h>e)&&c.start()}return i.isComplete?((a=i.onComplete)&&a.call(i,i),!0):void 0}}},Statics:{_tweens:[],tick:function(){var e,n,i=r._tweens,s=i.length;for(n=0;n-1&&i.splice(e,1);else for(e=0;el)return null;i(h,u,a);var m=r(n,h);if(m<0||d+m>l)return null;var _=r(o,h)/l;return t[0]=e[0]+_*n[0],t[1]=e[1]+_*n[1],t[2]=e[2]+_*n[2],t}},function(t,e){t.exports=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2];return t[0]=r*u-s*o,t[1]=s*a-i*u,t[2]=i*o-r*a,t}},function(t,e,n){var i=n(27),r=n(32),s=n(33),a=n(34);t.exports=function(t,e,n,u,c){var h=i(n,u);if(0!==h){var f=-(i(e,u)+c)/h;return f<0?null:(s(o,n,f),r(t,e,o))}return i(u,e)+c===0?a(t,e):null};var o=[0,0,0]},function(t,e,n){var i=n(98),r=n(27),s=n(31),a=n(99),o=n(33),u=n(32),c=[0,0,0];t.exports=function(t,e,n,h,f){s(c,h,e);var l=r(n,c);if(l<0)return null;a(c,e,n,l);var d=i(h,c),m=f*f;if(d>m)return null;return o(t,n,l-Math.sqrt(m-d)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}},function(t,e){t.exports=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}},function(t,e){function n(t,e,n){for(var i=t.length,r=-1/0,s=1/0,a=0;au){var c=o;o=u,u=c}if(us)return 1/0;o>r&&(r=o),us?1/0:r}t.exports=function(t,e,i,r){var s=n(e,i,r);if(s===1/0)t=null;else{t=t||[];for(var a=0;a0;){if(d(c)128){if(0==(u=(255&f[0])-128)||u>o-a)throw new Error("Bad scanline data");for(;u-- >0;)h[a++]=f[1]}else{if(0==(u=255&f[0])||u>o-a)throw new Error("Bad scanline data");if(h[a++]=f[1],--u>0){if(m(h,a,u)=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var i=n.slice(0),r=0,s=i.length;r=0&&e.splice(n,1)},nextTick:function(t){var e=this,n={tick:function(i){e.removeTick(n),t()}};return e.addTick(n),n},timeout:function(t,e){var n=this,i=(new Date).getTime()+e,r={tick:function(){(new Date).getTime()-i>=0&&(n.removeTick(r),t())}};return n.addTick(r),r},interval:function(t,e){var n=(new Date).getTime()+e,i={tick:function(){var i=(new Date).getTime(),r=i-n;r>=0&&(r 0.0 ? v : (0.5 * inversesqrt(max(1.0 - (x * x), 1e-7))) - v;\n return cross(v1, v2) * theta_sintheta;\n}\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 vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if (dot(lightNormal, P - rectCoords[0]) < 0.0)\n return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - (N * dot(V, N)));\n T2 = -cross(N, T1);\n mat3 mat = mInv * transpose(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n\nvec3 getAreaLight(const in vec3 diffuseColor, const in vec3 specularColor, const in float roughness, const in vec3 normal, const in vec3 viewDir, const in vec3 position, const in vec3 lightPos, const in vec3 lightColor, const in vec3 halfWidth, const in vec3 halfHeight, const in sampler2D areaLightsLtcTexture1, const in sampler2D areaLightsLtcTexture2){\n vec3 rectCoords[4];\n rectCoords[0] = (lightPos - halfWidth) - halfHeight;\n rectCoords[1] = (lightPos + halfWidth) - halfHeight;\n rectCoords[2] = (lightPos + halfWidth) + halfHeight;\n rectCoords[3] = (lightPos - halfWidth) + halfHeight;\n \n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(areaLightsLtcTexture1, uv);\n vec4 t2 = texture2D(areaLightsLtcTexture2, uv);\n\n mat3 mInv = mat3(vec3(t1.x, 0, t1.y), vec3(0, 1, 0), vec3(t1.z, 0, t1.w));\n vec3 fresnel = (specularColor * t2.x) + ((vec3(1.0) - specularColor) * t2.y);\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += ((lightColor * fresnel) * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords));\n color += ((lightColor * diffuseColor) * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords));\n return color;\n}\n\n"},function(t,e,n){"use strict";n.r(e);var i={};n.r(i),n.d(i,"ALI_amc_mesh_compression",(function(){return jn})),n.d(i,"WEB3D_quantized_attributes",(function(){return kn})),n.d(i,"HILO_animation_clips",(function(){return qn})),n.d(i,"ALI_animation_clips",(function(){return Wn})),n.d(i,"ALI_bounding_box",(function(){return Yn})),n.d(i,"KHR_materials_pbrSpecularGlossiness",(function(){return Zn})),n.d(i,"KHR_lights_punctual",(function(){return Kn})),n.d(i,"KHR_techniques_webgl",(function(){return Qn}));var r=n(4),s=n(1),a=n(9),o=n(7),u=n(22),c=n(5),h=n(17),f=n(23),l=n(10),d=n(6),m=n(3),_=new c.a(0,1,0),p=new o.a,g=s.a.create({Statics:{TRAVERSE_STOP_NONE:!1,TRAVERSE_STOP_CHILDREN:1,TRAVERSE_STOP_ALL:!0},Mixes:a.a,isNode:!0,className:"Node",name:"",animationId:"",autoUpdateWorldMatrix:!0,autoUpdateChildWorldMatrix:!0,parent:null,_quatDirty:!1,_matrixDirty:!1,needCallChildUpdate:!0,visible:!0,pointerEnabled:!0,pointerChildren:!0,useHandCursor:!1,__forceUseParentWorldMatrix:!1,constructor:function(t){var e=this;this.id=d.a.generateUUID(this.className),this.up=_.clone(),this.children=[],this.worldMatrix=new o.a,this._matrix=new u.a,this._position=new h.a(0,0,0),this._scale=new h.a(1,1,1),this._pivot=new h.a(0,0,0),this._rotation=new f.a,this._quaternion=new l.a,this._matrix.on("update",(function(){e._onMatrixUpdate()})),this._position.on("update",(function(){e._onPositionUpdate()})),this._scale.on("update",(function(){e._onScaleUpdate()})),this._pivot.on("update",(function(){e._onPivotUpdate()})),this._rotation.on("update",(function(){e._onRotationUpdate()})),this._quaternion.on("update",(function(){e._onQuaternionUpdate()})),Object.assign(this,t)},clone:function(t){var e=new this.constructor;return e.name=this.name,e.jointName=this.jointName,e.animationId=this.animationId,e.setPosition(this.x,this.y,this.z),e.setScale(this.scaleX,this.scaleY,this.scaleZ),e.setRotation(this.rotationX,this.rotationY,this.rotationZ),this.children.forEach((function(t){e.addChild(t.clone(!0))})),t||(this.anim&&(e.anim=this.anim.clone(e)),e.resetSkinedMeshRootNode()),e},setAnim:function(t){return this.anim=t,t.rootNode=this,this},resetSkinedMeshRootNode:function(){var t=this;this.traverse((function(e){e.isSkinedMesh&&e.jointNames&&(e.rootNode=t)}),!0)},getChildrenNameMap:function(){var t={};return this.traverse((function(e){t[e.name]=e;var n=e._originName;void 0===n||t[n]||(t[n]=e)}),!0),t},addChild:function(t){return t.parent&&t.removeFromParent(),t.parent=this,this.children.push(t),this},removeChild:function(t){var e=this.children.indexOf(t);return e>-1&&(this.children.splice(e,1),t.parent=null),this},addTo:function(t){return t.addChild(this),this},removeFromParent:function(){return this.parent&&this.parent.removeChild(this),this},updateMatrix:function(){return this._matrixDirty&&(this._matrixDirty=!1,this.matrixVersion++,this._matrix.fromRotationTranslationScaleOrigin(this.quaternion,this._position,this._scale,this._pivot,!0)),this},updateQuaternion:function(){return this._quatDirty&&(this._quatDirty=!1,this._quaternion.fromEuler(this._rotation,!0)),this},updateTransform:function(){return this._matrix.decompose(this._quaternion,this._position,this._scale,this._pivot),this._onQuaternionUpdate(),this._matrixDirty=!1,this},updateMatrixWorld:function(t){return this.traverse((function(e){return(e.autoUpdateWorldMatrix||t)&&(e.parent?e.__forceUseParentWorldMatrix?e.worldMatrix.copy(e.parent.worldMatrix):e.worldMatrix.multiply(e.parent.worldMatrix,e.matrix):e.worldMatrix.copy(e.matrix)),!e.autoUpdateChildWorldMatrix&&!t&&1})),this},getConcatenatedMatrix:function(t){for(var e=new o.a,n=this;n&&n!==t;n=n.parent)e.multiply(n.matrix,e);return e},_traverse:function(t,e){if(!e){var n=t(this);if(n)return n}for(var i=this.children,r=0,s=i.length;r1&&void 0!==arguments[1]&&arguments[1];return this._traverse(t,e),this},traverseBFS:function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(n=i?this.children:[this];n.length;){e=n,n=[];for(var r=0,s=e.length;r1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return this._scale.set(t,e,n),this},setPosition:function(t,e,n){return this._position.set(t,e,n),this},setRotation:function(t,e,n){return this._rotation.setDegree(t,e,n),this},setPivot:function(t,e,n){return this._pivot.set(t,e,n),this},lookAt:function(t){return this.isCamera?p.targetTo(this,t,this.up):p.targetTo(t,this,this.up),this._quaternion.fromMat4(p),this},raycast:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.visible)return null;var r=[];return this.traverse((function(n){if(i&&!n.pointerEnabled)return 1;if(n.isMesh){var s=n.raycast(t,!1);s&&(r=r.concat(s.map((function(t){return{mesh:n,point:t}}))))}return!(!i||e.pointerChildren)&&1})),r.length?(n&&t.sortPoints(r,"point"),r):null},matrix:{get:function(){return this.updateMatrix(),this._matrix},set:function(t){m.a.warnOnce("Node.matrix.set","node.matrix is readOnly.Use node.matrix.copy instead."),this._matrix.copy(t)}},position:{get:function(){return this._position},set:function(t){m.a.warnOnce("Node.position.set","node.position is readOnly.Use node.position.copy instead."),this._position.copy(t)}},x:{get:function(){return this._position.elements[0]},set:function(t){this._position.elements[0]=t,this._matrixDirty=!0}},y:{get:function(){return this._position.elements[1]},set:function(t){this._position.elements[1]=t,this._matrixDirty=!0}},z:{get:function(){return this._position.elements[2]},set:function(t){this._position.elements[2]=t,this._matrixDirty=!0}},scale:{get:function(){return this._scale},set:function(t){m.a.warnOnce("Node.scale.set","node.scale is readOnly.Use node.scale.copy instead."),this._scale.copy(t)}},scaleX:{get:function(){return this._scale.elements[0]},set:function(t){this._scale.elements[0]=t,this._matrixDirty=!0}},scaleY:{get:function(){return this._scale.elements[1]},set:function(t){this._scale.elements[1]=t,this._matrixDirty=!0}},scaleZ:{get:function(){return this._scale.elements[2]},set:function(t){this._scale.elements[2]=t,this._matrixDirty=!0}},pivot:{get:function(){return this._pivot},set:function(t){m.a.warnOnce("Node.pivot.set","node.pivot is readOnly.Use node.pivot.copy instead."),this._pivot.copy(t)}},pivotX:{get:function(){return this._pivot.elements[0]},set:function(t){this._pivot.elements[0]=t,this._matrixDirty=!0}},pivotY:{get:function(){return this._pivot.elements[1]},set:function(t){this._pivot.elements[1]=t,this._matrixDirty=!0}},pivotZ:{get:function(){return this._pivot.elements[2]},set:function(t){this._pivot.elements[2]=t,this._matrixDirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){m.a.warnOnce("Node.rotation.set","node.rotation is readOnly.Use node.rotation.copy instead."),this._rotation.copy(t)}},rotationX:{get:function(){return this._rotation.degX},set:function(t){this._rotation.degX=t}},rotationY:{get:function(){return this._rotation.degY},set:function(t){this._rotation.degY=t}},rotationZ:{get:function(){return this._rotation.degZ},set:function(t){this._rotation.degZ=t}},quaternion:{get:function(){return this.updateQuaternion(),this._quaternion},set:function(t){m.a.warnOnce("Node.quaternion.set","node.quaternion is readOnly.Use node.quaternion.copy instead."),this._quaternion.copy(t)}},matrixVersion:0,getBounds:function(t,e,n){return e?e.multiply(this.matrix):e=this.getConcatenatedMatrix(t),this.children.forEach((function(t){n=t.getBounds(null,e.clone(),n)})),this.isMesh&&(n=this.geometry.getBounds(e,n)),n},_fireMouseEvent:function(t){if(t.eventCurrentTarget=this,this.fire(t),"mousemove"===t.type){if(!this.__mouseOver){this.__mouseOver=!0;var e=Object.assign({},t);e.type="mouseover",this.fire(e)}}else"mouseout"===t.type&&(this.__mouseOver=!1);var n=this.parent;t._stopped||t._stopPropagationed||!n||n._fireMouseEvent(t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getChildrenByBaseClassName("Node");return this.off(),n.forEach((function(n){n.isMesh?n.destroy(t,e):(n.off(),n.removeFromParent())})),this.removeFromParent(),this},_onMatrixUpdate:function(){this.matrixVersion++,this.updateTransform()},_onPositionUpdate:function(){this._matrixDirty=!0},_onScaleUpdate:function(){this._matrixDirty=!0},_onPivotUpdate:function(){this._matrixDirty=!0},_onRotationUpdate:function(){this._quatDirty=!0,this._matrixDirty=!0},_onQuaternionUpdate:function(){this._rotation.fromQuat(this._quaternion),this._quatDirty=!1}}),v=n(8),E=new v.a,T=s.a.create({Extends:g,isLight:!0,className:"Light",amount:1,enabled:!0,constantAttenuation:1,linearAttenuation:0,quadraticAttenuation:0,_range:0,range:{get:function(){return this._range},set:function(t){this.constantAttenuation=1,t<=0?(this.linearAttenuation=0,this.quadraticAttenuation=0):(this.linearAttenuation=4.5/t,this.quadraticAttenuation=75/(t*t)),this._range=t}},constructor:function(t){this.color=new v.a(1,1,1),T.superclass.constructor.call(this,t)},toInfoArray:function(t,e){return t[e+0]=this.constantAttenuation,t[e+1]=this.linearAttenuation,t[e+2]=this.quadraticAttenuation,this},getRealColor:function(){return E.copy(this.color).scale(this.amount)},createShadowMap:function(t,e){}}),M=T,A=n(24),I=new o.a,L=s.a.create({Extends:g,isCamera:!0,className:"Camera",_needUpdateProjectionMatrix:!0,_isGeometryDirty:!1,constructor:function(t){this.viewMatrix=new o.a,this.projectionMatrix=new o.a,this.viewProjectionMatrix=new o.a,this._frustum=new A.a,L.superclass.constructor.call(this,t)},updateViewMatrix:function(){return this.updateMatrixWorld(!0),this.viewMatrix.invert(this.worldMatrix),this},updateProjectionMatrix:function(){},getGeometry:function(t){},updateViewProjectionMatrix:function(){return this._needUpdateProjectionMatrix&&(this.updateProjectionMatrix(),this._needUpdateProjectionMatrix=!1),this.updateViewMatrix(),this.viewProjectionMatrix.multiply(this.projectionMatrix,this.viewMatrix),this.updateFrustum(this.viewProjectionMatrix),this},getModelViewMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewMatrix,t.worldMatrix),e},getModelProjectionMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewProjectionMatrix,t.worldMatrix),e},projectVector:function(t,e,n){var i=t.clone();return i.transformMat4(this.viewProjectionMatrix),e&&n&&(i.x=(i.x+1)/2*e,i.y=n-(i.y+1)/2*n),i},unprojectVector:function(t,e,n){var i=t.clone();return e&&n&&(i.x=i.x/e*2-1,i.y=1-i.y/n*2),I.invert(this.viewProjectionMatrix),i.transformMat4(I),i},isPointVisible:function(t){return!!this._frustum.intersectsSphere({center:t,radius:0})},isMeshVisible:function(t){var e=t.geometry;if(e){var n=e.getSphereBounds(t.worldMatrix);if(this._frustum.intersectsSphere(n))return!0}return!1},updateFrustum:function(t){return this._frustum.fromMatrix(t),this}}),O=L,S=n(14),R=n(12),y=n(11),x=n(21),N={2:new S.a,3:new c.a,4:new R.a,16:new o.a},b=s.a.create({className:"GeometryData",isGeometryData:!0,size:void 0,normalized:!1,type:void 0,_isSubDirty:!1,_isAllDirty:!1,isDirty:{get:function(){return this._isSubDirty||this._isAllDirty},set:function(t){this._isAllDirty=t,!1===t&&this.clearSubData()}},bufferViewId:void 0,glBuffer:null,constructor:function(t,e,n){this.id=d.a.generateUUID(this.className),this.data=t,this.size=e,Object.assign(this,n),this.bufferViewId||(this.bufferViewId=this.id),this.size||m.a.warn("GeometryData.constructor: geometryData must set size!",this)},_stride:0,stride:{get:function(){return this._stride},set:function(t){this._stride=t,this.strideSize=0===t?0:t/this.data.BYTES_PER_ELEMENT}},strideSize:0,_offset:0,offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetSize=t/this.data.BYTES_PER_ELEMENT}},offsetSize:0,data:{set:function(t){t&&(this._data=t,this.type=Object(r.getTypedArrayGLType)(t),this.stride=this._stride,this.offset=this._offset,this._isAllDirty=!0)},get:function(){return this._data}},length:{get:function(){return this._data.length}},realLength:{get:function(){return 0===this.strideSize?this._data.length:this._data.length/this.strideSize*this.size}},getByteLength:function(){return this._data.BYTES_PER_ELEMENT*this.realLength},count:{get:function(){return 0===this.strideSize?this._data.length/this.size:this._data.length/this.strideSize}},setSubData:function(t,e){this._isSubDirty=!0,this.data.set(e,t),this.subDataList||(this.subDataList=[]);var n=e.BYTES_PER_ELEMENT*t;this.subDataList.push({byteOffset:n,data:e})},clearSubData:function(){this.subDataList&&(this.subDataList.length=0),this._isSubDirty=!1},clone:function(){var t=new b(null,1);return t.copy(this),t},copy:function(t){var e=t.data;this.data=new e.constructor(e),this.size=t.size,this.stride=t.stride,this.normalized=t.normalized,this.type=t.type,this.offset=t.offset},getOffset:function(t){var e=this.strideSize;return 0===e?t*this.size:t*e+this.offsetSize},get:function(t){var e=this.getOffset(t);return this.getByOffset(e)},set:function(t,e){var n=this.getOffset(t);return this.setByOffset(n,e),n},getByOffset:function(t){var e=this.size;return e>1?N[e].fromArray(this._data,t):this._data[t]},setByOffset:function(t,e){var n=this.size,i=this._data;n>1?e.toArray(i,t):i[t]=e,this._isAllDirty=!0},traverse:function(t){for(var e=this.count,n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(W.fromTranslation(G.set(t,e,n))),this},scale:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.transformMat4(W.fromScaling(G.set(t,e,n))),this},rotate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(W.fromQuat(Y.fromEuler({x:t*d.a.DEG2RAD,y:e*d.a.DEG2RAD,z:n*d.a.DEG2RAD}))),this},transformMat4:function(t){var e=this.vertices;if(e&&e.traverse((function(n,i,r){e.setByOffset(r,n.transformMat4(t))})),q.normalFromMat4(t),this._normals){var n=this.normals;n.traverse((function(t,e,i){n.setByOffset(i,t.transformMat3(q).normalize())}))}if(this._tangents){var i=this.tangents;i.traverse((function(t,e,n){i.setByOffset(n,t.transformMat3(q).normalize())}))}return this.isDirty=!0,this},merge:function(t,e){var n=t.vertices;if(n&&this.vertices){var i=this.vertices.count;e&&(n=t.vertices.clone()).traverse((function(t,i,r){n.setByOffset(r,t.transformMat4(e))})),this.vertices.merge(n),this.indices&&t.indices?this.indices.merge(t.indices,(function(t){return t+i})):this.indices=null}return this.uvs&&t.uvs?this.uvs.merge(t.uvs):this.uvs=null,this.uvs1&&t.uvs1?this.uvs1.merge(t.uvs1):this.uvs1=null,this.colors&&t.colors?this.colors.merge(t.colors):this.colors=null,this._normals&&(this._normals=null),this._tangents&&(this._tangents=null),this._tangents1&&(this._tangents1=null),this.isDirty=!0,this},ensureData:function(t,e,n,i){var r=this[t];if(!r||n>r.length){var s=new i(n);r?(s.set(r.data),r.data=s):this[t]=new C(s,e)}},addPoints:function(){var t=this,e=[].slice.call(arguments),n=3*(this.currentVerticesCount+e.length);this.ensureData("vertices",3,n,Float32Array);var i=this.vertices.data;return e.forEach((function(e){var n=3*t.currentVerticesCount++;i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2]})),this.currentVerticesCount-e.length},addIndices:function(){var t=this,e=[].slice.call(arguments),n=this.currentIndicesCount+e.length;this.ensureData("indices",1,n,Uint16Array);var i=this.indices.data;e.forEach((function(e){i[t.currentIndicesCount++]=e})),this._needUpdateNormals=!0},addLine:function(t,e){var n=this.addPoints(t,e);this.addIndices(n,n+1)},addFace:function(t,e,n){var i=this.addPoints(t,e,n);this.addIndices(i,i+1,i+2)},addRect:function(t,e,n,i){var r=this.addPoints(t,e,n,i);this.addIndices(r,r+1,r+2,r,r+2,r+3)},setVertexUV:function(t,e){this.ensureData("uvs",2,this.vertices.length/3*2,Float32Array);for(var n=this.uvs.data,i=0;i0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;e||(e={xMin:1/0,xMax:-1/0,yMin:1/0,yMax:-1/0,zMin:1/0,zMax:-1/0});var n=this.vertices;return n?(n.traverse((function(n){t&&n.transformMat4(t),e.xMax=Math.max(e.xMax,n.x),e.yMax=Math.max(e.yMax,n.y),e.zMax=Math.max(e.zMax,n.z),e.xMin=Math.min(e.xMin,n.x),e.yMin=Math.min(e.yMin,n.y),e.zMin=Math.min(e.zMin,n.z)})),e.width=e.xMax-e.xMin,e.height=e.yMax-e.yMin,e.depth=e.zMax-e.zMin,e.x=(e.xMin+e.xMax)/2,e.y=(e.yMin+e.yMax)/2,e.z=(e.zMin+e.zMax)/2,e):(m.a.warnOnce("geometry.getBounds","geometry has no vertices data, geometry.getBounds will return Infinity bounds."),e)},getLocalBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._localBounds&&!t||(this._localBounds=this.getBounds()),this._localBounds},getSphereBounds:function(t){this._sphereBounds||(this._sphereBounds=new x.a);var e=this._sphereBounds;return e.copy(this.getLocalSphereBounds()),t&&e.transformMat4(t),e},getLocalSphereBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._localSphereBounds||t){var e=this.getLocalBounds(t),n=new x.a({center:new c.a(e.x,e.y,e.z)}),i=this.vertices;i?n.fromGeometryData(i):(m.a.warnOnce("geometry.getLocalSphereBounds","geometry has no vertices data, geometry.getLocalSphereBounds will return Infinity bounds."),n.radius=1/0),this._localSphereBounds=n}return this._localSphereBounds},convertToNoIndices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(this.mode===w)if(this.indices){for(var e=this.indices.data,n=e.length,i=new Float32Array(n*t),s=this.uvs?new Float32Array(2*n):null,a=new Float32Array(3*n),o=this.colors?new Float32Array(this.colors.size*n):null,u=this.skinIndices?new Float32Array(4*n):null,c=this.skinWeights?new Float32Array(4*n):null,h=0;h2&&void 0!==arguments[2])||arguments[2];return(n=this.useAABBRaycast?this._aabbRaycast(t):this._raycast(t,e))&&i&&t.sortPoints(n),n},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.positionDecodeMat&&(t.QUANTIZED=1,t.POSITION_QUANTIZED=1),this.normalDecodeMat&&(t.QUANTIZED=1,t.NORMAL_QUANTIZED=1),this.uvDecodeMat&&(t.QUANTIZED=1,t.UV_QUANTIZED=1),this.uv1DecodeMat&&(t.QUANTIZED=1,t.UV1_QUANTIZED=1),this.colors&&(t.HAS_COLOR=1,t.COLOR_SIZE=this.colors.size),t},getShaderKey:function(){return void 0===this._shaderKey&&(this._shaderKey="geometry",this.isMorphGeometry?this._shaderKey+="_id_".concat(this.id):(this.colors&&(this._shaderKey+="_colors"),this.positionDecodeMat&&(this._shaderKey+="positionDecodeMat"))),this._shaderKey},getSize:function(){var t=0;for(var e in this)Object(r.hasOwnProperty)(this,e)&&this[e]&&this[e].isGeometryData&&(t+=this[e].getByteLength());return t},destroy:function(){m.a.warn("Geometry.destroy has been deprecated, use mesh.destroy(renderer) instead.")}}),K=s.a.create({Extends:O,isPerspectiveCamera:!0,className:"PerspectiveCamera",_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:null,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},_fov:50,fov:{get:function(){return this._fov},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._fov=t}},_aspect:1,aspect:{get:function(){return this._aspect},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._aspect=t}},constructor:function(t){K.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.projectionMatrix.elements,e=this.near,n=this.far,i=this.aspect,r=this.fov,s=1/Math.tan(.5*d.a.degToRad(r));if(t[0]=s/i,t[5]=s,t[11]=-1,t[15]=0,n){var a=1/(e-n);t[10]=(e+n)*a,t[14]=2*n*e*a}else t[10]=-1,t[14]=-2*e},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=Math.tan(this.fov/2*Math.PI/180),i=this.near,r=this.far,s=i*n,a=r*n,o=this.aspect*s,u=this.aspect*a,c=[-o,-s,-i],h=[o,-s,-i],f=[o,s,-i],l=[-o,s,-i],d=[-u,-a,-r],m=[u,-a,-r],_=[u,a,-r],p=[-u,a,-r];e.addRect(d,m,_,p),e.addRect(m,h,f,_),e.addRect(h,c,l,f),e.addRect(c,d,p,l),e.addRect(p,_,f,l),e.addRect(c,h,m,d),this._geometry=e}return this._geometry}}),Q=K,J=s.a.create({constructor:function(){this._cache={}},get:function(t){return this._cache[t]},getObject:function(t){return this._cache[t.__cacheId]},add:function(t,e){"object"==typeof e&&(e.__cacheId=t),this._cache[t]=e},remove:function(t){delete this._cache[t]},removeObject:function(t){delete this._cache[t.__cacheId]},removeAll:function(){this._cache={}},each:function(t){var e=this._cache;for(var n in e)t(e[n],n)}}),$={instanced:void 0,vao:void 0,texFloat:void 0,loseContext:void 0,textureFilterAnisotropic:void 0,_usedExtensions:{},_disabledExtensions:{},init:function(t){this.reset(t)},reset:function(t){this.gl=t;var e=this._usedExtensions;for(var n in e){var i=e[n];this[i]=void 0,this.get(n,i)}},use:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;this.gl?this.get(t,e):this._usedExtensions[t]=e},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this._disabledExtensions[t])return null;var n=this[e];return void 0===n&&(n=this._getExtension(t),this[e]=n),n},disable:function(t){this._disabledExtensions[t]=!0},enable:function(t){this._disabledExtensions[t]=!1},_getExtension:function(t){var e=this.gl;return e&&e.getExtension&&(e.getExtension(t)||e.getExtension("WEBKIT_"+t)||e.getExtension("MOZ_"+t))||null}};$.use("ANGLE_instanced_arrays","instanced"),$.use("OES_vertex_array_object","vao"),$.use("OES_texture_float","texFloat"),$.use("WEBGL_lose_context","loseContext"),$.use("OES_element_index_uint","uintIndices"),$.use("EXT_shader_texture_lod","shaderTextureLod"),$.use("EXT_texture_filter_anisotropic","textureFilterAnisotropic");var tt=$,et={MAX_TEXTURE_INDEX:null,MAX_PRECISION:null,MAX_VERTEX_PRECISION:null,MAX_FRAGMENT_PRECISION:null,VERTEX_TEXTURE_FLOAT:null,FRAGMENT_TEXTURE_FLOAT:null,MAX_TEXTURE_MAX_ANISOTROPY:1,init:function(t){var e=this;this.gl=t;["MAX_RENDERBUFFER_SIZE","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS","MAX_COMBINED_TEXTURE_IMAGE_UNITS"].forEach((function(t){e.get(t)})),this.MAX_TEXTURE_INDEX=this.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,this.MAX_VERTEX_PRECISION=this._getMaxSupportPrecision(t.VERTEX_SHADER),this.MAX_FRAGMENT_PRECISION=this._getMaxSupportPrecision(t.FRAGMENT_SHADER),this.MAX_PRECISION=this.getMaxPrecision(this.MAX_FRAGMENT_PRECISION,this.MAX_VERTEX_PRECISION),this.VERTEX_TEXTURE_FLOAT=!!tt.texFloat&&this.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0,this.FRAGMENT_TEXTURE_FLOAT=!!tt.texFloat,this.EXT_FRAG_DEPTH=tt.get("EXT_frag_depth"),this.SHADER_TEXTURE_LOD=!!tt.shaderTextureLod,tt.textureFilterAnisotropic&&(this.MAX_TEXTURE_MAX_ANISOTROPY=t.getParameter(tt.textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))},get:function(t){var e=this.gl,n=this[t];return void 0===n&&(n=this[t]=e.getParameter(e[t])),n},_getMaxSupportPrecision:function(t){var e=this.gl,n="lowp";if(e.getShaderPrecisionFormat)for(var i=[{name:"highp",type:e.HIGH_FLOAT},{name:"mediump",type:e.MEDIUM_FLOAT}],r=0;r0){n=s.name;break}}else n="mediump";return n},getMaxPrecision:function(t,e){return"highp"===t||"mediump"===t&&"lowp"===e?e:t}},nt=n(54),it=n.n(nt),rt=n(55),st=n.n(rt),at=n(56),ot=n.n(at),ut=n(57),ct=n.n(ut),ht=new J,ft=new J,lt=s.a.create({isShader:!0,className:"Shader",vs:"",fs:"",Statics:{commonOptions:{},shaders:{"chunk/baseDefine.glsl":n(18),"chunk/color.frag":n(40),"chunk/color.vert":n(80),"chunk/color_main.vert":n(82),"chunk/diffuse.frag":n(62),"chunk/diffuse_main.frag":n(71),"chunk/extensions.frag":n(25),"chunk/extensions.vert":n(52),"chunk/fog.frag":n(47),"chunk/fog_main.frag":n(73),"chunk/frag_color.frag":n(51),"chunk/joint.vert":n(75),"chunk/joint_main.vert":n(85),"chunk/light.frag":n(44),"chunk/lightFog.frag":n(43),"chunk/lightFog.vert":n(78),"chunk/lightFog_main.frag":n(49),"chunk/lightFog_main.vert":n(88),"chunk/logDepth.frag":n(29),"chunk/logDepth_main.frag":n(30),"chunk/logDepth.vert":n(81),"chunk/logDepth_main.vert":n(89),"chunk/morph.vert":n(79),"chunk/morph_main.vert":n(84),"chunk/normal.frag":n(42),"chunk/normal.vert":n(77),"chunk/normal_main.frag":n(48),"chunk/normal_main.vert":n(87),"chunk/pbr.frag":n(91),"chunk/pbr_main.frag":n(93),"chunk/phong.frag":n(69),"chunk/phong_main.frag":n(72),"chunk/precision.frag":n(26),"chunk/precision.vert":n(53),"chunk/transparency.frag":n(46),"chunk/transparency_main.frag":n(50),"chunk/unQuantize.vert":n(74),"chunk/unQuantize_main.vert":n(83),"chunk/uv.frag":n(41),"chunk/uv.vert":n(76),"chunk/uv_main.vert":n(86),"method/encoding.glsl":n(92),"method/getDiffuse.glsl":n(64),"method/getLightAttenuation.glsl":n(66),"method/getShadow.glsl":n(68),"method/getSpecular.glsl":n(65),"method/packFloat.glsl":n(90),"method/textureEnvMap.glsl":n(45),"method/transpose.glsl":n(63),"method/unpackFloat.glsl":n(67),"basic.frag":n(54),"basic.vert":n(55),"geometry.frag":n(56),"pbr.frag":n(57),"screen.frag":n(58),"screen.vert":n(59)},init:function(t){this.renderer=t,this.commonHeader=this._getCommonHeader(this.renderer)},cache:{get:function(){return ht}},headerCache:{get:function(){return ft}},reset:function(t){ht.removeAll()},getHeaderKey:function(t,e,n,i,r){var s="header_"+e.id+"_"+n.lightInfo.uid;return t.isSkinedMesh&&(s+="_joint"+t.jointNames.length),i&&(s+="_fog_"+i.mode),s+="_"+t.geometry.getShaderKey(),r&&(s+="_fogDepth"),s},getHeader:function(t,e,n,i,r){var s=this.getHeaderKey(t,e,n,i),a=ft.get(s);if(!a||e.isDirty){var o={};Object.assign(o,this.commonOptions);var u=e.lightType;u&&"NONE"!==u&&n.getRenderOption(o),e.getRenderOption(o),t.getRenderOption(o),i&&(o.HAS_FOG=1,i.getRenderOption(o)),r&&(o.USE_LOG_DEPTH=1,et.EXT_FRAG_DEPTH&&(o.USE_EXT_FRAG_DEPTH=1)),o.HAS_NORMAL&&o.NORMAL_MAP&&(o.HAS_TANGENT=1),o.RECEIVE_SHADOWS||(delete o.DIRECTIONAL_LIGHTS_SMC,delete o.SPOT_LIGHTS_SMC,delete o.POINT_LIGHTS_SMC),a="#define SHADER_NAME ".concat(e.className,"\n"),a+=Object.keys(o).map((function(t){return t.indexOf("HILO_CUSTUM_OPTION_")>-1?"#define ".concat(t.replace("HILO_CUSTUM_OPTION_","")," ").concat(o[t]):"#define HILO_".concat(t," ").concat(o[t])})).join("\n")+"\n",ft.add(s,a)}return a},_getCommonHeader:function(t){var e=et.getMaxPrecision(et.MAX_VERTEX_PRECISION,t.vertexPrecision),n=et.getMaxPrecision(et.MAX_FRAGMENT_PRECISION,t.fragmentPrecision),i=et.getMaxPrecision(e,n);return"\n#define HILO_MAX_PRECISION ".concat(i,"\n#define HILO_MAX_VERTEX_PRECISION ").concat(e,"\n#define HILO_MAX_FRAGMENT_PRECISION ").concat(n,"\n")},getShader:function(t,e,n,i,r,s){var a=this.getHeader(t,e,i,r,s);return e.isBasicMaterial||e.isPBRMaterial?this.getBasicShader(e,n,a):e.isShaderMaterial?this.getCustomShader(e.vs,e.fs,a,e.shaderCacheId||e.id,e.useHeaderCache):null},getBasicShader:function(t,e,n){var i="";e&&(i=(i=t.getInstancedUniforms().map((function(t){return t.name}))).join("|"));var r=t.className+":"+i;t.onBeforeCompile&&(r+=":"+(t.shaderCacheId||t.id));var s=ht.get(r);if(!s){var a="",o=st.a;if(t.isBasicMaterial?t.isGeometryMaterial?a+=ot.a:a+=it.a:t.isPBRMaterial&&(a+=ct.a),t.onBeforeCompile){var u=t.onBeforeCompile(o,a);a=u.fs,o=u.vs}if(i){var c=new RegExp("^\\s*uniform\\s+(\\w+)\\s+(".concat(i,");"),"gm");o=o.replace(c,"attribute $1 $2;")}s=this.getCustomShader(o,a,n,r,!0)}if(s){var h=this._getNumId(s);null!==h&&(t._shaderNumId=h)}return s},_getNumId:function(t){var e=t.id.match(/_(\d+)/);return e&&e[1]?parseInt(e[1],10):null},getCustomShader:function(t,e,n,i,r){var s,a=this.commonHeader;return i&&(r&&(i+=":"+n),s=ht.get(i)),s||(s=new lt({vs:a+n+t,fs:a+n+e}),i&&ht.add(i,s)),s}},alwaysUse:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){return this._isDestroyed?this:(ht.removeObject(this),this._isDestroyed=!0,this)}}),dt=lt,mt=n(59),_t=n.n(mt),pt=n(58),gt=n.n(pt),vt=[{name:"FLOAT",byteSize:4,uniformFuncName:"uniform1f",type:"Scalar",size:1},{name:"FLOAT_VEC2",byteSize:8,uniformFuncName:"uniform2f",type:"Vector",size:2},{name:"FLOAT_VEC3",byteSize:12,uniformFuncName:"uniform3f",type:"Vector",size:3},{name:"FLOAT_VEC4",byteSize:16,uniformFuncName:"uniform4f",type:"Vector",size:4},{name:"FLOAT_MAT2",byteSize:16,uniformFuncName:"uniformMatrix2fv",type:"Matrix",size:4},{name:"FLOAT_MAT3",byteSize:36,uniformFuncName:"uniformMatrix3fv",type:"Matrix",size:9},{name:"FLOAT_MAT4",byteSize:64,uniformFuncName:"uniformMatrix4fv",type:"Matrix",size:16},{name:"INT",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"INT_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"INT_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"INT_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"BOOL",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"BOOL_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"BOOL_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"BOOL_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"SAMPLER_2D",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"SAMPLER_CUBE",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1}],Et={},Tt={dict:Et,init:function(t){vt.forEach((function(e){var n,i,r=e.name,s=e.uniformFuncName,a=s+"v";"Matrix"===e.type?n=i=function(e,n){void 0!==n&&t[s](e,!1,n)}:(n=function(e,n){void 0!==n&&t[s](e,n)},i=function(e,n){t[a](e,n)}),Et[t[r]]=Object.assign(e,{glValue:t[r],uniform:n,uniformArray:i})}))},get:function(t){return Et[t]}},Mt=new J,At=s.a.create({Statics:{cache:{get:function(){return Mt}},reset:function(t){Mt.each((function(t){t.destroy()}))},getProgram:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t.id,r=Mt.get(i);return r||(r=new At({state:e,vertexShader:t.vs,fragShader:t.fs,ignoreError:n}),Mt.add(i,r)),r},getBlankProgram:function(t){var e=dt.getCustomShader("void main(){}","precision HILO_MAX_FRAGMENT_PRECISION float;void main(){gl_FragColor = vec4(0.0);}","","__hiloBlankShader");return this.getProgram(e,t,!0)}},className:"Program",isProgram:!0,fragShader:"",vertexShader:"",attributes:null,uniforms:null,program:null,gl:null,state:null,alwaysUse:!1,constructor:function(t){return this.id=d.a.generateUUID(this.className),Object.assign(this,t),this._dict={},this.attributes={},this.uniforms={},this.gl=this.state.gl,this.program=this.createProgram(),this.program?(this.initAttributes(),this.initUniforms(),this):this.ignoreError?this:At.getBlankProgram(t.state)},createProgram:function(){var t=this.gl,e=t.createProgram(),n=this.createShader(t.VERTEX_SHADER,this.vertexShader),i=this.createShader(t.FRAGMENT_SHADER,this.fragShader);if(n&&i){if(t.attachShader(e,n),t.attachShader(e,i),t.linkProgram(e),t.deleteShader(n),t.deleteShader(i),!t.getProgramParameter(e,t.LINK_STATUS)){var r=t.getProgramInfoLog(e);return m.a.error("compileProgramError: "+r,this),t.deleteProgram(e),null}return e}return null},useProgram:function(){this.state.useProgram(this.program)},createShader:function(t,e){var n=this.gl,i=n.createShader(t);if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){var r=n.getShaderInfoLog(i);return m.a.error("compileShaderError: "+r,e.split("\n").map((function(t,e){return"".concat(e+1," ").concat(t)})).join("\n")),null}return i},initAttributes:function(){for(var t=this,e=this.gl,n=this.program,i=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),r=tt.instanced,s=function(i){var s=e.getActiveAttrib(n,i),a=s.name,o=s.type,u=s.size,c=e.getAttribLocation(n,a),h=Tt.get(o),f=function(t){var n=t.type,i=void 0===n?e.FLOAT:n,r=t.normalized,s=void 0!==r&&r,a=t.stride,o=void 0===a?0:a,u=t.offset,f=void 0===u?0:u;e.vertexAttribPointer(c,h.size,i,s,o,f)},l=function(){e.enableVertexAttribArray(c)},d=function(){},m=function(t,e){t[c]=e};if(r&&(d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;r.vertexAttribDivisorANGLE(c,t)}),"Matrix"===h.type){var _=h.byteSize,p=h.size,g=Math.sqrt(p),v=4*g,E=function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;E((function(e){r.vertexAttribDivisorANGLE(e,t)}))})}t.attributes[a]={name:a,location:c,type:o,size:u,glTypeInfo:h,pointer:f,enable:l,divisor:d,addTo:m}},a=0;a1||o>1?function(t){f(c,t)}:function(e){t._dict[a]!==e&&(t._dict[a]=e,l(c,e))}})},a=0;a2&&void 0!==arguments[2]?arguments[2]:St;return this.createBuffer(t,Lt,e,n)},createBuffer:function(t,e,n,i){var r=n.bufferViewId,s=Rt.get(r);return s||(n.isDirty=!1,s=new yt(t,e,n.data,i),Rt.add(r,s),s)},createIndexBuffer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:St;return this.createBuffer(t,Ot,e,n)}},className:"Buffer",isBuffer:!0,constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:St;this.id=d.a.generateUUID(this.className),this.gl=t,this.target=e,this.usage=i,this.buffer=t.createBuffer(),n&&this.bufferData(n)},bind:function(){return this.gl.bindBuffer(this.target,this.buffer),this},bufferData:function(t){var e=this.gl,n=this.target,i=this.usage;return this.bind(),e.bufferData(n,t,i),this.data=t,this},bufferSubData:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.gl,r=this.target;return n||this.bind(),i.bufferSubData(r,t,e),this},uploadGeometryData:function(t){var e=this,n=t.subDataList;return!this.data||this.data.byteLength2&&void 0!==arguments[2]?arguments[2]:0,i=0,r=e.length;i0&&void 0!==arguments[0]?arguments[0]:1;this.bind();var e=this.gl,n=this.mode;this.useInstanced&&(this.indexBuffer?this.instancedExtension.drawElementsInstancedANGLE(n,this.vertexCount,e.UNSIGNED_SHORT,0,t):this.instancedExtension.drawArraysInstancedANGLE(n,0,this.getVertexCount(),t))},addIndexBuffer:function(t,e){this.bind();var n=this.gl,i=this.indexBuffer;return this.indexType=t.type,i?t.isDirty&&(i.uploadGeometryData(t),this.vertexCount=t.length):((i=xt.createIndexBuffer(n,t,e)).bind(),this.indexBuffer=i,this.vertexCount=t.length),i},addAttribute:function(t,e,n,i){this.bind();var r=this.gl,s=e.name,a=this[s];if(a)t.isDirty&&a.buffer.uploadGeometryData(t);else{var o=xt.createVertexBuffer(r,t,n);o.bind(),e.enable(),e.pointer(t),a={attribute:e,buffer:o,geometryData:t},this.attributes.push(a),this[s]=a,e.addTo(this.activeStates,a),i&&i(a)}return a},addInstancedAttribute:function(t,e,n){this.bind();var i=this.gl,r=t.name,s=t.glTypeInfo,a=bt.getTypedArray(Float32Array,e.length*s.size);e.forEach((function(t,e){void 0!==n(t)?bt.fillArrayData(a,n(t),e*s.size):m.a.warn("no attributeData:"+r+"-"+t.name)}));var o,u=this[r];return u?(o=u.geometryData).data=a:o=new C(a,1),this.addAttribute(o,t,i.DYNAMIC_DRAW,(function(e){t.divisor(1),e.useInstanced=!0}))},useResource:function(t,e){return this.attributes.forEach((function(n){t.useResource(n.buffer,e)})),this.indexBuffer&&t.useResource(this.indexBuffer,e),this},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){var t=this;return this._isDestroyed?this:(this.useVao&&this.vaoExtension.deleteVertexArrayOES(this.vao),this.gl=null,this.indexBuffer=null,this.attributes.forEach((function(e){t[e.name]=null})),this.attributes=null,this.activeStates=null,Ht.removeObject(this),this._isDestroyed=!0,this)}}),Ft=Dt,Ut=P.a.TEXTURE_2D,Gt=P.a.RGBA,Bt=P.a.LINEAR,Vt=P.a.NEAREST,Xt=P.a.REPEAT,jt=P.a.CLAMP_TO_EDGE,zt=P.a.UNSIGNED_BYTE,kt=new J,qt=s.a.create({Statics:{cache:{get:function(){return kt}},reset:function(t){kt.each((function(e,n){t.deleteTexture(e),kt.remove(n)}))}},isTexture:!0,className:"Texture",isImageCanRelease:!1,_isImageReleased:!1,_image:null,image:{get:function(){return this._isImageReleased&&m.a.errorOnce("Read Texture.image(".concat(this.id,")"),"Read Texture.image after image released!"),this._image},set:function(t){this._image=t,this._isImageReleased=!1}},_releaseImage:function(){this._canvasImage=null,this._canvasCtx=null,this._originImage=null,this._image=null,this.mipmaps=null,this._isImageReleased=!0},mipmaps:null,target:Ut,internalFormat:Gt,format:Gt,type:zt,width:0,height:0,border:0,magFilter:Bt,minFilter:Bt,wrapS:Xt,wrapT:Xt,name:"",premultiplyAlpha:!1,flipY:!1,compressed:!1,needUpdate:!0,needDestroy:!1,autoUpdate:!1,uv:0,anisotropic:1,origWidth:{get:function(){return this._originImage?this._originImage.width||this.width:this.image&&this.image.width||this.width}},origHeight:{get:function(){return this.originImage?this._originImage.height||this.height:this.image&&this.image.height||this.height}},useMipmap:{get:function(){return this.minFilter!==Bt&&this.minFilter!==Vt},set:function(){m.a.warn("texture.useMipmap is readOnly!")}},useRepeat:{get:function(){return this.wrapS!==jt||this.wrapT!==jt},set:function(){m.a.warn("texture.useRepeat is readOnly!")}},mipmapCount:{get:function(){return Math.floor(Math.log2(Math.max(this.width,this.height))+1)},set:function(){m.a.warn("texture.mipmapCount is readOnly!")}},constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},isImgPowerOfTwo:function(t){return d.a.isPowerOfTwo(t.width)&&d.a.isPowerOfTwo(t.height)},getSupportSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.width,i=t.height;e&&!this.isImgPowerOfTwo(t)&&(n=d.a.nextPowerOfTwo(n),i=d.a.nextPowerOfTwo(i));var r=et.MAX_TEXTURE_SIZE;return r&&(n>r&&(n=r),i>r&&(i=r)),{width:n,height:i}},resizeImgToPowerOfTwo:function(t){var e=this.getSupportSize(t,!0);return this.resizeImg(t,e.width,e.height)},resizeImg:function(t,e,n){if(t.width===e&&t.height===n)return t;var i=this._canvasImage;return i?(i.width=e,i.height=n,this._canvasCtx=i.getContext("2d")):((i=document.createElement("canvas")).width=e,i.height=n,this._canvasImage=i,this._canvasCtx=i.getContext("2d")),this._canvasCtx.drawImage(t,0,0,t.width,t.height,0,0,e,n),m.a.warnOnce("Texture.resizeImg(".concat(this.id,")"),"image size(".concat(t.width,"x").concat(t.height,") is not support. Resized to ").concat(i.width,"x").concat(i.height),t.src),this._originImage=t,i},_glUploadTexture:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.width,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.height,a=t.gl;return this.compressed?a.compressedTexImage2D(e,i,this.internalFormat,r,s,this.border,n):n&&void 0!==n.width?a.texImage2D(e,i,this.internalFormat,this.format,this.type,n):a.texImage2D(e,i,this.internalFormat,r,s,this.border,this.format,this.type,n),this},_uploadTexture:function(t){var e=this;return this.useMipmap&&this.mipmaps?this.mipmaps.forEach((function(n,i){e._glUploadTexture(t,e.target,n.data,i,n.width,n.height)})):this._glUploadTexture(t,this.target,this.image,0),this},updateTexture:function(t,e){var n=t.gl;if(this.needUpdate||this.autoUpdate){this._originImage&&this.image===this._canvasImage&&(this.image=this._originImage);var i=this.useMipmap,r=this.useRepeat;if(this.image&&!this.image.length){var s=r||i,a=this.getSupportSize(this.image,s);this.image=this.resizeImg(this.image,a.width,a.height),this.width=this.image.width,this.height=this.image.height}t.activeTexture(n.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),t.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!!this.flipY);var o=tt.textureFilterAnisotropic;o&&this.anisotropic>1&&n.texParameterf(this.target,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this.anisotropic,et.MAX_TEXTURE_MAX_ANISOTROPY)),this._uploadTexture(t),i&&(this.compressed?this.mipmaps||(m.a.warn("Compressed texture has no mipmips, changed the minFilter from ".concat(this.minFilter," to Linear!"),this),this.minFilter=Bt):n.generateMipmap(this.target)),n.texParameterf(this.target,n.TEXTURE_MAG_FILTER,this.magFilter),n.texParameterf(this.target,n.TEXTURE_MIN_FILTER,this.minFilter),n.texParameterf(this.target,n.TEXTURE_WRAP_S,this.wrapS),n.texParameterf(this.target,n.TEXTURE_WRAP_T,this.wrapT),this.needUpdate=!1}return this._needUpdateSubTexture&&(this._uploadSubTextures(t,e),this._needUpdateSubTexture=!1),this},_uploadSubTextures:function(t,e){var n=this;if(this._subTextureList&&this._subTextureList.length>0){var i=t.gl;t.activeTexture(i.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),t.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!!this.flipY),this._subTextureList.forEach((function(t){var e=t[0],r=t[1],s=t[2];i.texSubImage2D(n.target,0,e,r,n.format,n.type,s)})),this._subTextureList.length=0}},_needUpdateSubTexture:!1,_subTextureList:null,updateSubTexture:function(t,e,n){this._subTextureList||(this._subTextureList=[]),this._subTextureList.push([t,e,n]),this._needUpdateSubTexture=!0},getGLTexture:function(t){this.state=t;var e=this.gl=t.gl,n=this.id;this.needDestroy&&(this.destroy(),this.needDestroy=!1);var i=kt.get(n);return i?this.updateTexture(t,i):(i=e.createTexture(),kt.add(n,i),this.needUpdate=!0,this.updateTexture(t,i)),this.isImageCanRelease&&this._releaseImage(),i},setGLTexture:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&this.destroy(),kt.add(this.id,t),this},destroy:function(){var t=this.id,e=kt.get(t);return e&&this.gl&&(this.gl.deleteTexture(e),kt.remove(t)),this},clone:function(){var t=Object.assign({},this);return delete t.id,new this.constructor(t)}}),Wt=P.a.TEXTURE_2D,Yt=P.a.RGBA,Zt=P.a.UNSIGNED_BYTE,Kt=P.a.COLOR_ATTACHMENT0,Qt=P.a.DEPTH_STENCIL,Jt=P.a.DEPTH_TEST,$t=P.a.CULL_FACE,te=P.a.TRIANGLE_STRIP,ee=P.a.NEAREST,ne=P.a.CLAMP_TO_EDGE,ie=new J,re=s.a.create({Statics:{cache:{get:function(){return ie}},reset:function(t){ie.each((function(t){t.reset()}))},destroy:function(t){ie.each((function(t){t.destroy()}))}},className:"Framebuffer",isFramebuffer:!0,bufferInternalFormat:Qt,target:Wt,format:Yt,internalFormat:Yt,type:Zt,minFilter:ee,magFilter:ee,data:null,attachment:Kt,needRenderbuffer:!0,useVao:!0,renderer:null,texture:null,renderbuffer:null,framebuffer:null,_isInit:!1,constructor:function(t,e){this.id=d.a.generateUUID(this.className),this.renderer=t,Object.assign(this,e),this.width||(this.width=t.width),this.height||(this.height=t.height),ie.add(this.id,this)},init:function(){if(!this._isInit&&this.renderer.isInit){this._isInit=!0;var t=this.renderer;this.gl=t.gl,this.state=t.state,this.reset()}},reset:function(){this.destroyResource();var t=this.gl;this.framebuffer=t.createFramebuffer(),this.bind(),this.needRenderbuffer&&(this.renderbuffer=this.createRenderbuffer()),this.texture=this.createTexture(),this.isComplete()||m.a.warn("Framebuffer is not complete => "+t.checkFramebufferStatus(t.FRAMEBUFFER)),this.unbind()},isComplete:function(){var t=this.gl;return!(!t||t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)},bind:function(){this.init(),this._isInit&&this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this.framebuffer)},unbind:function(){if(this.init(),this._isInit){var t=this.state;t.bindFramebuffer(this.gl.FRAMEBUFFER,t.preFramebuffer)}},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new v.a(0,0,0,0);if(this._isInit){var e=this.gl;e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}},render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4?arguments[4]:void 0;if(this._isInit){var s=this.gl,a=this.state;a.disable(Jt),a.disable($t),r&&this.clear(r);var o=dt.getCustomShader(_t.a,gt.a,"","FramebufferTextureShader"),u=It.getProgram(o,a);u.useProgram();var c="".concat(t,"_").concat(e,"_").concat(n,"_").concat(i,"_").concat(u.id),h=Ft.getVao(s,c,{useVao:this.useVao,useInstanced:!1,mode:te});if(h.isDirty){h.isDirty=!1;var f=[t=2*t-1,e=1-2*e,t+(n*=2),e,t,e-(i*=2),t+n,e-i];h.addAttribute(new C(new Float32Array(f),2),u.attributes.a_position),h.addAttribute(new C(new Float32Array([0,1,1,1,0,0,1,0]),2),u.attributes.a_texcoord0)}a.activeTexture(s.TEXTURE0),a.bindTexture(s.TEXTURE_2D,this.texture.getGLTexture(a)),h.draw()}},createRenderbuffer:function(){var t=this.gl,e=this.width,n=this.height,i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,i),i},createTexture:function(){var t=this.state,e=t.gl,n=new qt({minFilter:this.minFilter,magFilter:this.magFilter,internalFormat:this.internalFormat,format:this.format,type:this.type,width:this.width,height:this.height,image:this.data,wrapS:ne,wrapT:ne}),i=n.getGLTexture(t);return e.framebufferTexture2D(e.FRAMEBUFFER,this.attachment,this.target,i,0),n},resize:function(t,e,n){(n||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this._isInit&&this.reset())},readPixels:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=Object(r.getTypedArrayClass)(this.type),a=new s(n*i*4);if(this._isInit){var o=this.gl;e=this.height-e-i,this.bind(),o.readPixels(t,e,n,i,this.format,this.type,a),this.unbind()}return a},destroy:function(){this.destroyResource(),this.gl=null,ie.removeObject(this)},destroyResource:function(){var t=this.gl;t&&(this.framebuffer&&(t.deleteFramebuffer(this.framebuffer),this.framebuffer=null),this.renderbuffer&&(t.deleteRenderbuffer(this.renderbuffer),this.renderbuffer=null),this.texture&&(this.texture.destroy(),this.texture=null))}}),se=P.a.TEXTURE_CUBE_MAP,ae=P.a.RGB,oe=P.a.LINEAR,ue=P.a.CLAMP_TO_EDGE,ce=P.a.TEXTURE_CUBE_MAP_POSITIVE_X,he=s.a.create({Extends:qt,isCubeTexture:!0,className:"CubeTexture",target:se,internalFormat:ae,format:ae,magFilter:oe,minFilter:oe,wrapS:ue,wrapT:ue,constructor:function(t){he.superclass.constructor.call(this,t),this.image=this.image||[]},_uploadTexture:function(t){var e=this,n=this.image;Array.isArray(n)&&6===n.length?(n[0]&&n[0].width&&(this.width=n[0].width,this.height=n[0].height),n.forEach((function(n,i){e._glUploadTexture(t,ce+i,n,0)}))):m.a.error("CubeTexture image must be an Array of length 6",n)},right:{get:function(){return this.image[0]},set:function(t){this.image[0]=t}},left:{get:function(){return this.image[1]},set:function(t){this.image[1]=t}},top:{get:function(){return this.image[2]},set:function(t){this.image[2]=t}},bottom:{get:function(){return this.image[3]},set:function(t){this.image[3]=t}},front:{get:function(){return this.image[4]},set:function(t){this.image[4]=t}},back:{get:function(){return this.image[5]},set:function(t){this.image[5]=t}}}),fe=he,le=P.a.TEXTURE_2D,de=P.a.RGBA,me=P.a.NEAREST,_e=P.a.CLAMP_TO_EDGE,pe=P.a.FLOAT,ge=s.a.create({Extends:qt,isDataTexture:!0,className:"DataTexture",target:le,internalFormat:de,format:de,type:pe,magFilter:me,minFilter:me,wrapS:_e,wrapT:_e,dataLength:0,resetSize:function(t){if(t!==this.dataLength){this.dataLength=t;var e=d.a.nextPowerOfTwo(t/4),n=Math.max(Math.log2(e),4),i=Math.floor(n/2),s=n-i;this.width=Math.pow(2,i),this.height=Math.pow(2,s),this.DataClass=Object(r.getTypedArrayClass)(this.type)}},data:{get:function(){return this.image},set:function(t){if(this.image!==t){this.resetSize(t.length);var e=this.width*this.height*4;e===t.length&&t instanceof this.DataClass?this.image=t:(this.image&&this.image.length===e||(this.image=new this.DataClass(e)),this.image.set(t,0)),this.needUpdate=!0}}},constructor:function(t){ge.superclass.constructor.call(this,t)}}),ve=ge;function Ee(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Te,Me,Ae,Ie,Le,Oe,Se=new c.a,Re=new y.a,ye=new o.a,xe=new Float32Array([.5,.5,.5,1]),Ne=new Float32Array([0,0]),be={state:null,camera:null,lightManager:null,fog:null,gl:null,renderer:null,blankInfo:{get:function(){}},init:function(t,e,n,i,r){Oe=this._renderer=t,Ie=this.state=e,Te=this.camera=n,Ae=this.lightManager=i,Le=this.fog=r,Me=this.gl=Ie.gl},setCamera:function(t){Te=this.camera=t},handlerColorOrTexture:function(t,e){return t&&t.isTexture?this.handlerTexture(t,e):(t&&t.isColor?t.toArray(xe):xe[0]=xe[1]=xe[2]=.5,xe)},handlerTexture:function(t,e){if(t&&t.isTexture)return this.handlerGLTexture(t.target,t.getGLTexture(Ie),e)},handlerGLTexture:function(t,e,n){if(e)return Ie.activeTexture(Me.TEXTURE0+n),Ie.bindTexture(t,e),n},handlerUV:function(t){return t&&t.isTexture&&t.uv||0},POSITION:{get:function(t,e,n){return t.geometry.vertices}},NORMAL:{get:function(t,e,n){return t.geometry.normals}},TANGENT:{get:function(t,e,n){var i=e.normalMap;if(i&&i.isTexture)return 1===Number(i.uv)?t.geometry.tangents1:t.geometry.tangents}},TEXCOORD_0:{get:function(t,e,n){if(t.geometry.uvs)return t.geometry.uvs}},TEXCOORD_1:{get:function(t,e,n){if(t.geometry.uvs1)return t.geometry.uvs1}},UVMATRIX_0:{get:function(t,e,n){if(e.uvMatrix)return e.uvMatrix.elements}},UVMATRIX_1:{get:function(t,e,n){if(e.uvMatrix1)return e.uvMatrix1.elements}},CAMERAFAR:{get:function(t,e,n){if(Te.isPerspectiveCamera)return Te.far}},CAMERANEAR:{get:function(t,e,n){if(Te.isPerspectiveCamera)return Te.near}},CAMERATYPE:{get:function(t,e,n){return Te.isPerspectiveCamera?1:0}},CAMERAPOSITION:{get:function(t,e,n){return Te.worldMatrix.getTranslation(Se).elements}},COLOR_0:{get:function(t,e,n){if(t.geometry.colors)return t.geometry.colors}},SKININDICES:{get:function(t,e,n){return t.geometry.skinIndices}},SKINWEIGHTS:{get:function(t,e,n){return t.geometry.skinWeights}},RENDERERSIZE:{get:function(t,e,n){return Ne[0]=Oe.width,Ne[1]=Oe.height,Ne}},LOCAL:{get:function(t,e,n){return t.matrix.elements},isDependMesh:!0},MODEL:{get:function(t,e,n){return t.worldMatrix.elements},isDependMesh:!0},VIEW:{get:function(t,e,n){return Te.viewMatrix.elements}},PROJECTION:{get:function(t,e,n){return Te.projectionMatrix.elements}},VIEWPROJECTION:{get:function(t,e,n){return Te.viewProjectionMatrix.elements}},MODELVIEW:{get:function(t,e,n){return Te.getModelViewMatrix(t,ye).elements},isDependMesh:!0},MODELVIEWPROJECTION:{get:function(t,e,n){return Te.getModelProjectionMatrix(t,ye).elements},isDependMesh:!0},MODELINVERSE:{get:function(t,e,n){return ye.invert(t.worldMatrix).elements},isDependMesh:!0},VIEWINVERSE:{get:function(t,e,n){return Te.worldMatrix.elements}},VIEWINVERSEINVERSETRANSPOSE:{get:function(t,e,n){return Re.normalFromMat4(Te.worldMatrix).elements}},PROJECTIONINVERSE:{get:function(t,e,n){return ye.invert(Te.projectionMatrix).elements}},MODELVIEWINVERSE:{get:function(t,e,n){return ye.invert(Te.getModelViewMatrix(t,ye)).elements},isDependMesh:!0},MODELVIEWPROJECTIONINVERSE:{get:function(t,e,n){return ye.invert(Te.getModelProjectionMatrix(t,ye)).elements},isDependMesh:!0},MODELINVERSETRANSPOSE:{get:function(t,e,n){return Re.normalFromMat4(t.worldMatrix).elements},isDependMesh:!0},MODELVIEWINVERSETRANSPOSE:{get:function(t,e,n){return Re.normalFromMat4(Te.getModelViewMatrix(t,ye)).elements},isDependMesh:!0},VIEWPORT:void 0,JOINTMATRIX:{get:function(t,e,n){if(t.isSkinedMesh)return t.getJointMat();m.a.warnOnce("semantic.JOINTMATRIX(".concat(t.id,")"),"Current mesh is not SkinedMesh!",t.id)},isDependMesh:!0,notSupportInstanced:!0},JOINTMATRIXTEXTURE:{get:function(t,e,n){if(t.isSkinedMesh)return t.updateJointMatTexture(),be.handlerTexture(t.jointMatTexture,n.textureIndex);m.a.warnOnce("semantic.JOINTMATRIXTEXTURE(".concat(t.id,")"),"Current mesh is not SkinedMesh!",t.id)},isDependMesh:!0,notSupportInstanced:!0},JOINTMATRIXTEXTURESIZE:{get:function(t,e,n){if(t.isSkinedMesh)return t.initJointMatTexture(),[t.jointMatTexture.width,t.jointMatTexture.height];m.a.warnOnce("semantic.JOINTMATRIXTEXTURESIZE(".concat(t.id,")"),"Current mesh is not SkinedMesh!",t.id)},isDependMesh:!0,notSupportInstanced:!0},NORMALMAPSCALE:{get:function(t,e,n){return e.normalMapScale}},OCCLUSIONSTRENGTH:{get:function(t,e,n){return e.occlusionStrength}},SHININESS:{get:function(t,e,n){return e.shininess}},SPECULARENVMATRIX:{get:function(t,e,n){return e.specularEnvMatrix&&e.specularEnvMap?e.specularEnvMatrix.elements:(ye.identity(),ye.elements)}},REFLECTIVITY:{get:function(t,e,n){return e.reflectivity}},REFRACTRATIO:{get:function(t,e,n){return e.refractRatio}},REFRACTIVITY:{get:function(t,e,n){return e.refractivity}},LOGDEPTH:{get:function(t,e,n){return 2/(Math.log(Te.far+1)/Math.LN2)}},AMBIENTLIGHTSCOLOR:{get:function(t,e,n){return Ae.ambientInfo}},DIRECTIONALLIGHTSCOLOR:{get:function(t,e,n){return Ae.directionalInfo.colors}},DIRECTIONALLIGHTSINFO:{get:function(t,e,n){return Ae.directionalInfo.infos}},DIRECTIONALLIGHTSSHADOWMAP:{get:function(t,e,n){return Ae.directionalInfo.shadowMap.map((function(t,e){return be.handlerTexture(t,n.textureIndex+e)}))}},DIRECTIONALLIGHTSSHADOWMAPSIZE:{get:function(t,e,n){return Ae.directionalInfo.shadowMapSize}},DIRECTIONALLIGHTSSHADOWBIAS:{get:function(t,e,n){return Ae.directionalInfo.shadowBias}},DIRECTIONALLIGHTSPACEMATRIX:{get:function(t,e,n){return Ae.directionalInfo.lightSpaceMatrix}},POINTLIGHTSPOS:{get:function(t,e,n){return Ae.pointInfo.poses}},POINTLIGHTSCOLOR:{get:function(t,e,n){return Ae.pointInfo.colors}},POINTLIGHTSINFO:{get:function(t,e,n){return Ae.pointInfo.infos}},POINTLIGHTSRANGE:{get:function(t,e,n){return Ae.pointInfo.ranges}},POINTLIGHTSSHADOWMAP:{get:function(t,e,n){return Ae.pointInfo.shadowMap.map((function(t,e){return be.handlerTexture(t,n.textureIndex+e)}))}},POINTLIGHTSSHADOWBIAS:{get:function(t,e,n){return Ae.pointInfo.shadowBias}},POINTLIGHTSPACEMATRIX:{get:function(t,e,n){return Ae.pointInfo.lightSpaceMatrix}},POINTLIGHTCAMERA:{get:function(t,e,n){return Ae.pointInfo.cameras}},SPOTLIGHTSPOS:{get:function(t,e,n){return Ae.spotInfo.poses}},SPOTLIGHTSDIR:{get:function(t,e,n){return Ae.spotInfo.dirs}},SPOTLIGHTSCOLOR:{get:function(t,e,n){return Ae.spotInfo.colors}},SPOTLIGHTSCUTOFFS:{get:function(t,e,n){return Ae.spotInfo.cutoffs}},SPOTLIGHTSINFO:{get:function(t,e,n){return Ae.spotInfo.infos}},SPOTLIGHTSRANGE:{get:function(t,e,n){return Ae.spotInfo.ranges}},SPOTLIGHTSSHADOWMAP:{get:function(t,e,n){return Ae.spotInfo.shadowMap.map((function(t,e){return be.handlerTexture(t,n.textureIndex+e)}))}},SPOTLIGHTSSHADOWMAPSIZE:{get:function(t,e,n){return Ae.spotInfo.shadowMapSize}},SPOTLIGHTSSHADOWBIAS:{get:function(t,e,n){return Ae.spotInfo.shadowBias}},SPOTLIGHTSPACEMATRIX:{get:function(t,e,n){return Ae.spotInfo.lightSpaceMatrix}},AREALIGHTSCOLOR:{get:function(t,e,n){return Ae.areaInfo.colors}},AREALIGHTSPOS:{get:function(t,e,n){return Ae.areaInfo.poses}},AREALIGHTSWIDTH:{get:function(t,e,n){return Ae.areaInfo.width}},AREALIGHTSHEIGHT:{get:function(t,e,n){return Ae.areaInfo.height}},AREALIGHTSLTCTEXTURE1:{get:function(t,e,n){return be.handlerTexture(Ae.areaInfo.ltcTexture1,n.textureIndex)}},AREALIGHTSLTCTEXTURE2:{get:function(t,e,n){return be.handlerTexture(Ae.areaInfo.ltcTexture2,n.textureIndex)}},FOGCOLOR:{get:function(t,e,n){if(Le)return Le.color.elements}},FOGINFO:{get:function(t,e,n){if(Le)return Le.getInfo()}},POSITIONDECODEMAT:{get:function(t,e,n){return t.geometry.positionDecodeMat},isDependMesh:!0},NORMALDECODEMAT:{get:function(t,e,n){return t.geometry.normalDecodeMat},isDependMesh:!0},UVDECODEMAT:{get:function(t,e,n){return t.geometry.uvDecodeMat},isDependMesh:!0},UV1DECODEMAT:{get:function(t,e,n){return t.geometry.uv1DecodeMat},isDependMesh:!0},BASECOLOR:{get:function(t,e,n){return e.baseColor.elements}},METALLIC:{get:function(t,e,n){return e.metallic}},ROUGHNESS:{get:function(t,e,n){return e.roughness}},DIFFUSEENVMAP:{get:function(t,e,n){return be.handlerTexture(e.diffuseEnvMap,n.textureIndex)}},DIFFUSEENVINTENSITY:{get:function(t,e,n){return e.diffuseEnvIntensity}},DIFFUSEENVSPHEREHARMONICS3:{get:function(t,e,n){var i=e.diffuseEnvSphereHarmonics3;if(i)return i.toArray()}},BRDFLUT:{get:function(t,e,n){return be.handlerTexture(e.brdfLUT,n.textureIndex)}},SPECULARENVMAP:{get:function(t,e,n){return be.handlerTexture(e.specularEnvMap,n.textureIndex)}},SPECULARENVINTENSITY:{get:function(t,e,n){return e.specularEnvIntensity}},SPECULARENVMAPMIPCOUNT:{get:function(t,e,n){var i=e.specularEnvMap;return i?i.mipmapCount:1}},GLOSSINESS:{get:function(t,e,n){return e.glossiness}},ALPHACUTOFF:{get:function(t,e,n){return e.alphaCutoff}},EXPOSURE:{get:function(t,e,n){return e.exposure}},GAMMAFACTOR:{get:function(t,e,n){return e.gammaFactor}},MORPHWEIGHTS:{isDependMesh:!0,notSupportInstanced:!0,get:function(t,e,n){var i=t.geometry;if(i.isMorphGeometry&&i.weights)return i.weights}}};[["POSITION","vertices"],["NORMAL","normals"],["TANGENT","tangents"]].forEach((function(t){for(var e=0;e<8;e++)be["MORPH"+t[0]+e]={get:function(t,e){return function(n,i,r){var s=n.geometry;if(s.isMorphGeometry&&s.targets&&s.targets[t]){var a=s._originalMorphIndices?s._originalMorphIndices[e]:e,o=s.targets[t][a],u="_target_".concat(t,"_").concat(e);return s[u]!==a&&o&&(o.isDirty=!0,s[u]=a),o}}}(t[1],e)}})),[["DIFFUSE","diffuse"],["SPECULAR","specular"],["EMISSION","emission"],["AMBIENT","ambient"]].forEach((function(t){var e=Ee(t,2),n=e[0],i=e[1];be[n]={get:function(t,e,n){return be.handlerColorOrTexture(e[i],n.textureIndex)}},be["".concat(n,"UV")]={get:function(t,e,n){return be.handlerUV(e[i])}}})),[["NORMALMAP","normalMap"],["PARALLAXMAP","parallaxMap"],["BASECOLORMAP","baseColorMap"],["METALLICMAP","metallicMap"],["ROUGHNESSMAP","roughnessMap"],["METALLICROUGHNESSMAP","metallicRoughnessMap"],["OCCLUSIONMAP","occlusionMap"],["SPECULARGLOSSINESSMAP","specularGlossinessMap"],["LIGHTMAP","lightMap"]].forEach((function(t){var e=Ee(t,2),n=e[0],i=e[1];be[n]={get:function(t,e,n){return be.handlerTexture(e[i],n.textureIndex)}},be["".concat(n,"UV")]={get:function(t,e,n){return be.handlerUV(e[i])}}})),[["TRANSPARENCY","transparency"]].forEach((function(t){var e=Ee(t,2),n=e[0],i=e[1];be[n]={get:function(t,e,n){var r=e[i];return r&&r.isTexture?be.handlerTexture(r,n.textureIndex):null!=r?r:1}},be["".concat(n,"UV")]={get:function(t,e,n){return be.handlerUV(e[i])}}}));var Ce=be,Pe=P.a.LEQUAL,we=P.a.BACK,He=P.a.FRONT,De=P.a.FRONT_AND_BACK,Fe=P.a.ZERO,Ue=P.a.FUNC_ADD,Ge=P.a.ONE,Be=P.a.SRC_ALPHA,Ve=P.a.ONE_MINUS_SRC_ALPHA,Xe={isBlankInfo:!0,get:function(){}},je=s.a.create({isMaterial:!0,className:"Material",shaderCacheId:null,lightType:"NONE",wireframe:!1,depthTest:!0,sampleAlphaToCoverage:!1,depthMask:!0,depthRange:[0,1],depthFunc:Pe,_cullFace:!0,normalMap:null,parallaxMap:null,normalMapScale:1,ignoreTranparent:!1,gammaCorrection:!1,usePhysicsLight:!1,isDiffuesEnvAndAmbientLightWorkTogether:!1,renderOrder:0,_premultiplyAlpha:!0,premultiplyAlpha:{get:function(){return this._premultiplyAlpha},set:function(t){this._premultiplyAlpha=t,this.transparent&&this.setDefaultTransparentBlend()}},gammaOutput:{get:function(){return m.a.warnOnce("Matrial.gammaOutput","material.gammaOutput has deprecated. Use material.gammaCorrection instead."),this.gammaCorrection},set:function(t){m.a.warnOnce("Matrial.gammaOutput","material.gammaOutput has deprecated. Use material.gammaCorrection instead."),this.gammaCorrection=t}},gammaFactor:2.2,castShadows:!0,receiveShadows:!0,uvMatrix:null,uvMatrix1:null,cullFace:{get:function(){return this._cullFace},set:function(t){this._cullFace=t,t?this.cullFaceType=this._cullFaceType:this._side=De}},_cullFaceType:we,cullFaceType:{get:function(){return this._cullFaceType},set:function(t){this._cullFaceType=t,this._cullFace&&(t===we?this._side=He:t===He&&(this._side=we))}},_side:He,side:{get:function(){return this._side},set:function(t){this._side!==t&&(this._side=t,t===De?this._cullFace=!1:(this._cullFace=!0,t===He?this._cullFaceType=we:t===we&&(this._cullFaceType=He)))}},blend:!1,blendEquation:Ue,blendEquationAlpha:Ue,blendSrc:Ge,blendDst:Fe,blendSrcAlpha:Ge,blendDstAlpha:Fe,isDirty:!1,transparency:1,_transparent:!1,transparent:{get:function(){return this._transparent},set:function(t){this._transparent!==t&&(this._transparent=t,t?this.setDefaultTransparentBlend():(this.blend=!1,this.depthMask=!0))}},setDefaultTransparentBlend:function(){this.blend=!0,this.depthMask=!1,this.premultiplyAlpha?(this.blendSrc=Ge,this.blendDst=Ve,this.blendSrcAlpha=Ge,this.blendDstAlpha=Ve):(this.blendSrc=Be,this.blendDst=Ve,this.blendSrcAlpha=Be,this.blendDstAlpha=Ve)},alphaCutoff:0,useHDR:!1,exposure:1,needBasicUnifroms:!0,needBasicAttributes:!0,constructor:function(t){this.id=d.a.generateUUID(this.className),this.uniforms={},this.attributes={},Object.assign(this,t),this.needBasicAttributes&&this.addBasicAttributes(),this.needBasicUnifroms&&this.addBasicUniforms()},addBasicAttributes:function(){var t=this.attributes;this._copyProps(t,{a_position:"POSITION",a_normal:"NORMAL",a_tangent:"TANGENT",a_texcoord0:"TEXCOORD_0",a_texcoord1:"TEXCOORD_1",a_color:"COLOR_0",a_skinIndices:"SKININDICES",a_skinWeights:"SKINWEIGHTS"}),["POSITION","NORMAL","TANGENT"].forEach((function(e){for(var n=e.slice(0,1)+e.slice(1).toLowerCase(),i=0;i<8;i++){var r="a_morph"+n+i;void 0===t[r]&&(t[r]="MORPH"+e+i)}}))},addBasicUniforms:function(){this._copyProps(this.uniforms,{u_modelMatrix:"MODEL",u_viewMatrix:"VIEW",u_projectionMatrix:"PROJECTION",u_modelViewMatrix:"MODELVIEW",u_modelViewProjectionMatrix:"MODELVIEWPROJECTION",u_viewInverseNormalMatrix:"VIEWINVERSEINVERSETRANSPOSE",u_normalMatrix:"MODELVIEWINVERSETRANSPOSE",u_normalWorldMatrix:"MODELINVERSETRANSPOSE",u_cameraPosition:"CAMERAPOSITION",u_rendererSize:"RENDERERSIZE",u_logDepth:"LOGDEPTH",u_ambientLightsColor:"AMBIENTLIGHTSCOLOR",u_directionalLightsColor:"DIRECTIONALLIGHTSCOLOR",u_directionalLightsInfo:"DIRECTIONALLIGHTSINFO",u_directionalLightsShadowMap:"DIRECTIONALLIGHTSSHADOWMAP",u_directionalLightsShadowMapSize:"DIRECTIONALLIGHTSSHADOWMAPSIZE",u_directionalLightsShadowBias:"DIRECTIONALLIGHTSSHADOWBIAS",u_directionalLightSpaceMatrix:"DIRECTIONALLIGHTSPACEMATRIX",u_pointLightsPos:"POINTLIGHTSPOS",u_pointLightsColor:"POINTLIGHTSCOLOR",u_pointLightsInfo:"POINTLIGHTSINFO",u_pointLightsRange:"POINTLIGHTSRANGE",u_pointLightsShadowBias:"POINTLIGHTSSHADOWBIAS",u_pointLightsShadowMap:"POINTLIGHTSSHADOWMAP",u_pointLightSpaceMatrix:"POINTLIGHTSPACEMATRIX",u_pointLightCamera:"POINTLIGHTCAMERA",u_spotLightsPos:"SPOTLIGHTSPOS",u_spotLightsDir:"SPOTLIGHTSDIR",u_spotLightsColor:"SPOTLIGHTSCOLOR",u_spotLightsCutoffs:"SPOTLIGHTSCUTOFFS",u_spotLightsInfo:"SPOTLIGHTSINFO",u_spotLightsRange:"SPOTLIGHTSRANGE",u_spotLightsShadowMap:"SPOTLIGHTSSHADOWMAP",u_spotLightsShadowMapSize:"SPOTLIGHTSSHADOWMAPSIZE",u_spotLightsShadowBias:"SPOTLIGHTSSHADOWBIAS",u_spotLightSpaceMatrix:"SPOTLIGHTSPACEMATRIX",u_areaLightsPos:"AREALIGHTSPOS",u_areaLightsColor:"AREALIGHTSCOLOR",u_areaLightsWidth:"AREALIGHTSWIDTH",u_areaLightsHeight:"AREALIGHTSHEIGHT",u_areaLightsLtcTexture1:"AREALIGHTSLTCTEXTURE1",u_areaLightsLtcTexture2:"AREALIGHTSLTCTEXTURE2",u_jointMat:"JOINTMATRIX",u_jointMatTexture:"JOINTMATRIXTEXTURE",u_jointMatTextureSize:"JOINTMATRIXTEXTURESIZE",u_positionDecodeMat:"POSITIONDECODEMAT",u_normalDecodeMat:"NORMALDECODEMAT",u_uvDecodeMat:"UVDECODEMAT",u_uv1DecodeMat:"UV1DECODEMAT",u_morphWeights:"MORPHWEIGHTS",u_normalMapScale:"NORMALMAPSCALE",u_emission:"EMISSION",u_transparency:"TRANSPARENCY",u_uvMatrix:"UVMATRIX_0",u_uvMatrix1:"UVMATRIX_1",u_fogColor:"FOGCOLOR",u_fogInfo:"FOGINFO",u_alphaCutoff:"ALPHACUTOFF",u_exposure:"EXPOSURE",u_gammaFactor:"GAMMAFACTOR"}),this.addTextureUniforms({u_normalMap:"NORMALMAP",u_parallaxMap:"PARALLAXMAP",u_emission:"EMISSION",u_transparency:"TRANSPARENCY"})},addTextureUniforms:function(t){var e={};for(var n in t){var i=t[n];e[n]=i,e["".concat(n,".texture")]=i,e["".concat(n,".uv")]="".concat(i,"UV")}this._copyProps(this.uniforms,e)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.lightType;e["LIGHT_TYPE_".concat(n)]=1,e.SIDE=this.side,"NONE"!==n&&(e.HAS_LIGHT=1),this.premultiplyAlpha&&(e.PREMULTIPLY_ALPHA=1);var i=this._textureOption.reset(e);return e.HAS_LIGHT&&(e.HAS_NORMAL=1,i.add(this.normalMap,"NORMAL_MAP",(function(){1!==t.normalMapScale&&(e.NORMAL_MAP_SCALE=1)}))),i.add(this.parallaxMap,"PARALLAX_MAP"),i.add(this.emission,"EMISSION_MAP"),i.add(this.transparency,"TRANSPARENCY_MAP"),this.ignoreTranparent&&(e.IGNORE_TRANSPARENT=1),this.alphaCutoff>0&&(e.ALPHA_CUTOFF=1),this.useHDR&&(e.USE_HDR=1),this.gammaCorrection&&(e.GAMMA_CORRECTION=1),this.receiveShadows&&(e.RECEIVE_SHADOWS=1),this.castShadows&&(e.CAST_SHADOWS=1),this.uvMatrix&&(e.UV_MATRIX=1),this.uvMatrix1&&(e.UV_MATRIX1=1),this.usePhysicsLight&&(e.USE_PHYSICS_LIGHT=1),this.isDiffuesEnvAndAmbientLightWorkTogether&&(e.IS_DIFFUESENV_AND_AMBIENTLIGHT_WORK_TOGETHER=1),i.update(),e},_textureOption:{uvTypes:null,option:null,reset:function(t){return this.option=t,this.uvTypes={},this},add:function(t,e,n){if(t&&t.isTexture){var i=this.uvTypes,r=this.option,s=t.uv||0;i[s]=1,r[e]=s,t.isCubeTexture&&(r["".concat(e,"_CUBE")]=1),n&&n(t)}return this},update:function(){var t=[0,1],e=this.uvTypes,n=this.option;for(var i in e)-1!==t.indexOf(Number(i))?n["HAS_TEXCOORD".concat(i)]=1:(m.a.warnOnce("Material._textureOption.update(".concat(i,")"),"uv_".concat(i," not support!")),n.HAS_TEXCOORD0=1);return this}},getInstancedUniforms:function(){var t=this._instancedUniforms;if(!this._instancedUniforms){var e=this.uniforms;for(var n in t=this._instancedUniforms=[],e){var i=this.getUniformInfo(n);i.isDependMesh&&!i.notSupportInstanced&&t.push({name:n,info:i})}}return t},getUniformData:function(t,e,n){return this.getUniformInfo(t).get(e,this,n)},getAttributeData:function(t,e,n){return this.getAttributeInfo(t).get(e,this,n)},getUniformInfo:function(t){return this.getInfo("uniforms",t)},getAttributeInfo:function(t){return this.getInfo("attributes",t)},getInfo:function(t,e){var n=this[t][e];return"string"==typeof n&&(n=Ce[n]),n&&n.get||(m.a.warnOnce("material.getInfo-"+e,"Material.getInfo: no this semantic:"+e),n=Xe),n},clone:function(){var t=new this.constructor;for(var e in this)"id"!==e&&(t[e]=this[e]);return t},destroyTextures:function(){this.getTextures().forEach((function(t){t.destroy()}))},getTextures:function(){var t=[];for(var e in this){var n=this[e];n&&n.isTexture&&t.push(n)}return t},_copyProps:function(t,e){for(var n in e)void 0===t[n]&&(t[n]=e[n])}}),ze=s.a.create({Extends:je,isBasicMaterial:!0,className:"BasicMaterial",lightType:"BLINN-PHONG",diffuse:null,ambient:null,specular:null,emission:null,specularEnvMap:null,specularEnvMatrix:null,reflectivity:0,refractRatio:0,refractivity:0,shininess:32,usedUniformVectors:11,constructor:function(t){this.diffuse=new v.a(.5,.5,.5),this.specular=new v.a(1,1,1),this.emission=new v.a(0,0,0),ze.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT",u_shininess:"SHININESS",u_reflectivity:"REFLECTIVITY",u_refractRatio:"REFRACTRATIO",u_refractivity:"REFRACTIVITY",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvMatrix:"SPECULARENVMATRIX"}),this.addTextureUniforms({u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ze.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t),n=this.lightType;"PHONG"!==n&&"BLINN-PHONG"!==n||(t.HAS_SPECULAR=1);var i=this.diffuse;return i&&i.isTexture&&(i.isCubeTexture?t.DIFFUSE_CUBE_MAP=1:e.add(this.diffuse,"DIFFUSE_MAP")),t.HAS_LIGHT&&(e.add(this.specular,"SPECULAR_MAP"),e.add(this.ambient,"AMBIENT_MAP"),e.add(this.specularEnvMap,"SPECULAR_ENV_MAP")),e.update(),t}}),ke=ze,qe=P.a.POSITION,We=P.a.NORMAL,Ye=P.a.DEPTH,Ze=P.a.DISTANCE,Ke=P.a.NONE,Qe=s.a.create({Extends:ke,isGeometryMaterial:!0,className:"GeometryMaterial",vertexType:qe,lightType:Ke,writeOriginData:!1,constructor:function(t){Qe.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_cameraFar:"CAMERAFAR",u_cameraNear:"CAMERANEAR",u_cameraType:"CAMERATYPE"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(Qe.superclass.getRenderOption.call(this,t),t["VERTEX_TYPE_".concat(this.vertexType)]=1,this.vertexType){case qe:t.HAS_FRAG_POS=1;break;case We:t.HAS_NORMAL=1;break;case Ye:break;case Ze:t.HAS_FRAG_POS=1}return this.writeOriginData&&(t.WRITE_ORIGIN_DATA=1),t}}),Je=Qe,$e=s.a.create({Extends:O,isOrthographicCamera:!0,className:"OrthographicCamera",_left:-1,left:{get:function(){return this._left},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._left=t}},_right:1,right:{get:function(){return this._right},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._right=t}},_bottom:-1,bottom:{get:function(){return this._bottom},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._bottom=t}},_top:1,top:{get:function(){return this._top},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._top=t}},_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:1,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},constructor:function(t){$e.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=[this.left,this.bottom,-this.near],i=[this.right,this.bottom,-this.near],r=[this.right,this.top,-this.near],s=[this.left,this.top,-this.near],a=[this.left,this.bottom,-this.far],o=[this.right,this.bottom,-this.far],u=[this.right,this.top,-this.far],c=[this.left,this.top,-this.far];e.addRect(a,o,u,c),e.addRect(o,i,r,u),e.addRect(i,n,s,r),e.addRect(n,a,c,s),e.addRect(c,u,r,s),e.addRect(n,i,o,a),this._geometry=e}return this._geometry}}),tn=$e,en=P.a.DEPTH,nn=P.a.BACK,rn=null,sn=new v.a(1,1,1),an=new o.a,on=function(t){return t.material.castShadows},un=s.a.create({isLightShadow:!0,className:"LightShadow",light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,cameraInfo:null,debug:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},createFramebuffer:function(){this.framebuffer||(this.framebuffer=new re(this.renderer,{width:this.width,height:this.height}),this.debug&&this.showShadowMap())},updateLightCamera:function(t){this.light.isDirectionalLight?this.updateDirectionalLightCamera(t):this.light.isSpotLight&&this.updateSpotLightCamera(t)},updateDirectionalLightCamera:function(t){var e=this.light;if(this.camera.lookAt(e.direction),this.cameraInfo)this.updateCustumCamera(this.cameraInfo);else{var n=t.getGeometry();if(n){this.camera.updateViewMatrix(),an.multiply(this.camera.viewMatrix,t.worldMatrix);var i=n.getBounds(an);this.camera.near=-i.zMax,this.camera.far=-i.zMin,this.camera.left=i.xMin,this.camera.right=i.xMax,this.camera.bottom=i.yMin,this.camera.top=i.yMax}}this.camera.updateViewMatrix()},updateCustumCamera:function(t){for(var e in t)this.camera[e]=t[e]},updateSpotLightCamera:function(t){var e=this.light;this.camera.lookAt(e.direction),this.cameraInfo?this.updateCustumCamera(this.cameraInfo):(this.camera.fov=2*e.outerCutoff,this.camera.near=.01,this.camera.far=t.far,this.camera.aspect=1),this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.light.isDirectionalLight?this.camera=new tn:this.light.isSpotLight&&(this.camera=new Q),this.camera.addTo(this.light)),this._cameraMatrixVersion!==t.matrixVersion&&(this.updateLightCamera(t),this._cameraMatrixVersion=t.matrixVersion)},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;rn||(rn=new Je({vertexType:en,side:nn,writeOriginData:!0})),n.bind(),e.state.viewport(0,0,this.width,this.height),e.clear(sn),i.updateViewProjectionMatrix(),Ce.setCamera(i),e.forceMaterial=rn,this.renderShadowScene(e),delete e.forceMaterial,n.unbind(),Ce.setCamera(t),e.viewport()},renderShadowScene:function(t){t.renderList.traverse((function(e){on(e)&&t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e.filter((function(t){return on(t)})))}))},showShadowMap:function(){var t=this;this.renderer.on("afterRender",(function(){t.framebuffer.render(0,.7,.3,.3)}))}}),cn=P.a.DISTANCE,hn=P.a.BACK,fn=P.a.TEXTURE_CUBE_MAP,ln=P.a.TEXTURE0,dn=P.a.TEXTURE_CUBE_MAP_POSITIVE_X,mn=P.a.NEAREST,_n=P.a.FRAMEBUFFER,pn=P.a.FRAMEBUFFER_COMPLETE,gn=null,vn=new v.a(0,0,0,0),En=new c.a,Tn=[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0]],Mn=function(t,e){if(t.material.castShadows){if(!t.frustumTest)return!0;if(e.isMeshVisible(t))return!0}return!1},An=s.a.create({isLightShadow:!0,className:"CubeLightShadow",Extends:un,light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,debug:!1,constructor:function(t){An.superclass.constructor.call(this,t)},createFramebuffer:function(){if(!this.framebuffer){this.framebuffer=new re(this.renderer,{target:fn,width:1024,height:1024,createTexture:function(){var t=this.state.gl,e=new fe({image:[null,null,null,null,null,null],type:this.type,format:this.format,internalFormat:this.internalFormat,magFilter:mn,minFilter:mn,width:1024,height:1024});return t.checkFramebufferStatus(_n)!==pn&&m.a.warn("Framebuffer is not complete",t.checkFramebufferStatus(_n)),e},bindTexture:function(t){t=t||0;var e=this.state,n=e.gl,i=this.texture.getGLTexture(e);e.activeTexture(ln+et.MAX_TEXTURE_INDEX),e.bindTexture(this.target,i),n.framebufferTexture2D(_n,this.attachment,dn+t,i,0)}})}},updateLightCamera:function(t){this.camera.fov=90,this.camera.near=t.near,this.camera.far=t.far,this.camera.aspect=1,this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.camera=new Q,this.updateLightCamera(t))},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;gn||(gn=new Je({vertexType:cn,side:hn,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,n.width,n.height),this.light.worldMatrix.getTranslation(i.position);for(var r=0;r<6;r++)n.bindTexture(r),En.fromArray(Tn[0],3*r).add(i.position),i.up.fromArray(Tn[1],3*r),i.lookAt(En),i.updateViewProjectionMatrix(),e.clear(vn),Ce.setCamera(i),e.forceMaterial=gn,this.renderShadowScene(e);i.matrix.identity(),i.updateViewProjectionMatrix(),delete e.forceMaterial,n.unbind(),Ce.setCamera(t),e.viewport()},renderShadowScene:function(t){var e=t.renderList,n=this.camera;e.traverse((function(e){Mn(e,n)&&t.renderMesh(e)}),(function(e){var i=e.filter((function(t){return Mn(t,n)}));t.renderInstancedMeshes(i)}))}}),In=An,Ln=s.a.create({Extends:M,isPointLight:!0,className:"PointLight",constructor:function(t){Ln.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new In({light:this,renderer:t}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))}}),On=Ln,Sn=new o.a,Rn=new c.a,yn=s.a.create({Extends:M,isDirectionalLight:!0,className:"DirectionalLight",shadow:null,constructor:function(t){this.direction=new c.a(0,0,1),yn.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new un({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return Rn.copy(this.direction).transformDirection(this.worldMatrix).normalize(),Rn},getViewDirection:function(t){var e=t.getModelViewMatrix(this,Sn);return Rn.copy(this.direction).transformDirection(e).normalize(),Rn}}),xn=yn,Nn=new o.a,bn=new c.a,Cn=s.a.create({Extends:M,isSpotLight:!0,className:"SpotLight",shadow:null,_cutoffCos:.9763,_cutoff:12.5,cutoff:{get:function(){return this._cutoff},set:function(t){this._cutoff=t,this._cutoffCos=Math.cos(d.a.degToRad(t))}},_outerCutoffCos:.9537,_outerCutoff:17.5,outerCutoff:{get:function(){return this._outerCutoff},set:function(t){this._outerCutoff=t,this._outerCutoffCos=Math.cos(d.a.degToRad(t))}},constructor:function(t){this.direction=new c.a(0,0,1),Cn.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new un({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return bn.copy(this.direction).transformDirection(this.worldMatrix).normalize(),bn},getViewDirection:function(t){var e=t.getModelViewMatrix(this,Nn);return bn.copy(this.direction).transformDirection(e).normalize(),bn}}),Pn=Cn,wn=s.a.create({Extends:je,isShaderMaterial:!0,className:"ShaderMaterial",vs:"",fs:"",useHeaderCache:!1,constructor:function(t){wn.superclass.constructor.call(this,t)},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(wn.superclass.getRenderOption.call(this,t),this.getCustomRenderOption){var e=this.getCustomRenderOption({});for(var n in e)t["HILO_CUSTUM_OPTION_".concat(n)]=e[n]}return t},getCustomRenderOption:null}),Hn=wn,Dn=n(15),Fn=n.n(Dn),Un=s.a.create({Extends:Z,isMorphGeometry:!0,className:"MorphGeometry",isStatic:!1,weights:[],targets:null,constructor:function(t){Un.superclass.constructor.call(this,t),this.weights=this.weights||[]},update:function(t,e){this.weights=t,this._originalMorphIndices=e},clone:function(){return Z.prototype.clone.call(this,{targets:this.targets,weights:this.weights})},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Un.superclass.getRenderOption.call(this,e),this.targets&&(this._maxMorphTargetCount||(this._maxMorphTargetCount=Math.floor(8/Object.keys(this.targets).length)),Object(r.each)(this.targets,(function(n,i){e.MORPH_TARGET_COUNT=Math.min(n.length,t._maxMorphTargetCount),"vertices"===i?e.MORPH_HAS_POSITION=1:"normals"===i?e.MORPH_HAS_NORMAL=1:"tangents"===i&&(e.MORPH_HAS_TANGENT=1)}))),e}}),Gn=Un,Bn={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},Vn={Geometry:Z,GeometryData:C};var Xn={_decodeTotalTime:0,wasmURL:"",workerURL:"",useWASM:!0,useWebWorker:!0,useAuto:!0,init:function(){return Xn.useAuto?Fn.a.initWASM(Xn.wasmURL,Xn.memPages):Xn.useWebWorker?Fn.a.initWorker(Xn.workerURL):Xn.useWASM?Fn.a.initWASM(Xn.wasmURL,Xn.memPages):Promise.resolve()},parse:function(t,e,n,i){var r=Date.now(),s=e.bufferViews[t.bufferView],a=Xn.wasmURL,o=Xn.workerURL,u=Xn.useAuto,c=Xn.useWASM,h=Xn.useWebWorker,f=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);function l(e){Xn._decodeTotalTime+=Date.now()-r;var n=e.toHilo3dGeometry(Vn,i.primitive._geometry);return t.targets&&(n=function(t,e,n){if(!n.isMorphGeometry){var i=new Gn;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&"id"!==r&&(i[r]=n[r]);i.targets={},n=i}for(var s=n.targets,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return t["FOG_".concat(this.mode)]=1,t}}),ti=n(16),ei=new ti.a,ni=new o.a,ii=s.a.create({Extends:g,isMesh:!0,className:"Mesh",geometry:null,material:null,useInstanced:!1,frustumTest:!0,constructor:function(t){ii.superclass.constructor.call(this,t),this._usedResourceDict={}},clone:function(t){var e=g.prototype.clone.call(this,t);return Object.assign(e,{geometry:this.geometry,material:this.material}),e},raycast:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.visible)return null;var n=this.geometry,i=this.material,r=this.worldMatrix;if(n&&i){ni.invert(r),ei.copy(t),ei.transformMat4(ni);var s=n.raycast(ei,i.side,e);if(s)return s.forEach((function(t){t.transformMat4(r)})),s}return null},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.geometry.getRenderOption(t),t},useResource:function(t){t&&(this._usedResourceDict[t.className+":"+t.id]=t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._isDestroyed)return this;this.removeFromParent();var n=t.resourceManager,i=this._usedResourceDict;for(var r in i)n.destroyIfNoRef(i[r]);return this.material&&e&&this.material.destroyTextures(),this.off(),this._usedResourceDict=null,this.geometry=null,this.material=null,this._isDestroyed=!0,this}}),ri=ii,si=new o.a,ai=new o.a,oi=s.a.create({Extends:ri,isSkinedMesh:!0,className:"SkinedMesh",_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initJointNodeList()}},jointNodeList:null,useInstanced:!1,jointMatTexture:null,frustumTest:!1,constructor:function(t){this.jointNames=[],this.inverseBindMatrices=[],oi.superclass.constructor.call(this,t)},initJointNodeList:function(){var t=this;if(this._rootNode){var e={};this._rootNode.traverse((function(t){"jointName"in t&&(e[t.jointName]=t)})),this.jointNodeList=[],this.jointNames.forEach((function(n){t.jointNodeList.push(e[n])}))}},getJointMat:function(){var t=this;if(this.jointNodeList)return this.jointMat||(this.jointMat=new Float32Array(16*this.jointNodeList.length)),this._rootNode||!this.clonedFrom?ai.invert(this.worldMatrix):ai.invert(this.clonedFrom.worldMatrix),this.jointNodeList.forEach((function(e,n){si.copy(ai),si.multiply(e.worldMatrix),si.multiply(t.inverseBindMatrices[n]),si.toArray(t.jointMat,16*n)})),this.jointMat},initJointMatTexture:function(){if(!this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture=new ve({data:t})}return this.jointMatTexture},updateJointMatTexture:function(){if(this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture.data.set(t,0),this.jointMatTexture.needUpdate=!0}else this.initJointMatTexture()},clone:function(t){var e=ri.prototype.clone.call(this,t);return Object.assign(e,{useInstanced:this.useInstanced,jointNames:this.jointNames.slice(),inverseBindMatrices:this.inverseBindMatrices.map((function(t){return t.clone()})),jointNodeList:this.jointNodeList}),e.clonedFrom=this,e},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};oi.superclass.getRenderOption.call(this,t);var e=this.jointNames.length;if(e&&(t.JOINT_COUNT=e,et.VERTEX_TEXTURE_FLOAT)){var n=(et.MAX_VERTEX_UNIFORM_VECTORS-22)/4;e>n&&(t.JOINT_MAT_MAP=1)}return t}}),ui=oi,ci=s.a.create({className:"RenderInfo",isRenderInfo:!0,constructor:function(){this.reset()},addFaceCount:function(t){this._currentFaceCount+=t},addDrawCount:function(t){this._currentDrawCount+=t},reset:function(){this.faceCount=Math.floor(this._currentFaceCount),this.drawCount=Math.floor(this._currentDrawCount),this._currentFaceCount=0,this._currentDrawCount=0}}),hi=new c.a,fi=function(t,e){var n=t.material.renderOrder,i=e.material.renderOrder;if(n!==i)return n-i;var r=t.material._shaderNumId||0,s=e.material._shaderNumId||0;return r!==s?r-s:t._sortRenderZ-e._sortRenderZ},li=function(t,e){var n=t.material.renderOrder,i=e.material.renderOrder;return n!==i?n-i:e._sortRenderZ-t._sortRenderZ},di=s.a.create({className:"RenderList",isRenderList:!0,useInstanced:!1,constructor:function(){this.opaqueList=[],this.transparentList=[],this.instancedDict={}},reset:function(){this.opaqueList.length=0,this.transparentList.length=0,this.instancedDict={}},traverse:function(t,e){this.opaqueList.forEach((function(e){t(e)}));var n=this.instancedDict;for(var i in n){var r=n[i];r.length>2&&e?e(r):r.forEach((function(e){t(e)}))}this.transparentList.forEach((function(e){t(e)}))},sort:function(){this.transparentList.sort(li),this.opaqueList.sort(fi)},addMesh:function(t,e){var n=t.material,i=t.geometry;if(n&&i){if(t.frustumTest&&!e.isMeshVisible(t))return;if(this.useInstanced&&t.useInstanced){var r=this.instancedDict,s=n.id+"_"+i.id,a=r[s];r[s]||(a=r[s]=[]),a.push(t)}else t.worldMatrix.getTranslation(hi),hi.transformMat4(e.viewProjectionMatrix),t._sortRenderZ=hi.z,n.transparent?this.transparentList.push(t):this.opaqueList.push(t)}else m.a.warnOnce("RenderList.addMesh(".concat(t.id,")"),"Mesh must have material and geometry",t)}}),mi=s.a.create({className:"WebGLState",isWebGLState:!0,systemFramebuffer:null,constructor:function(t){this.gl=t,this.reset()},reset:function(){this._dict={},this.activeTextureIndex=null,this.textureUnitDict={},this.currentFramebuffer=null,this.preFramebuffer=null,this._pixelStorei={}},enable:function(t){!0!==this._dict[t]&&(this._dict[t]=!0,this.gl.enable(t))},disable:function(t){!1!==this._dict[t]&&(this._dict[t]=!1,this.gl.disable(t))},bindFramebuffer:function(t,e){this.currentFramebuffer!==e&&(this.preFramebuffer=this.currentFramebuffer,this.currentFramebuffer=e,this.gl.bindFramebuffer(t,e))},bindSystemFramebuffer:function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,this.systemFramebuffer)},useProgram:function(t){this.set1("useProgram",t)},depthFunc:function(t){this.set1("depthFunc",t)},depthMask:function(t){this.set1("depthMask",t)},clear:function(t){this.gl.clear(t)},depthRange:function(t,e){this.set2("depthRange",t,e)},stencilFunc:function(t,e,n){this.set3("stencilFunc",t,e,n)},stencilMask:function(t){this.set1("stencilMask",t)},stencilOp:function(t,e,n){this.set3("stencilOp",t,e,n)},colorMask:function(t,e,n,i){this.set4("colorMask",t,e,n,i)},cullFace:function(t){this.set1("cullFace",t)},frontFace:function(t){this.set1("frontFace",t)},blendFuncSeparate:function(t,e,n,i){this.set4("blendFuncSeparate",t,e,n,i)},blendEquationSeparate:function(t,e){this.set2("blendEquationSeparate",t,e)},pixelStorei:function(t,e){this._pixelStorei[t]!==e&&(this._pixelStorei[t]=e,this.gl.pixelStorei(t,e))},viewport:function(t,e,n,i){this.set4("viewport",t,e,n,i)},activeTexture:function(t){this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},bindTexture:function(t,e){var n=this.getActiveTextureUnit();n[t]!==e&&(n[t]=e,this.gl.bindTexture(t,e))},getActiveTextureUnit:function(){var t=this.textureUnitDict[this.activeTextureIndex];return t||(t=this.textureUnitDict[this.activeTextureIndex]={}),t},set1:function(t,e){this._dict[t]!==e&&(this._dict[t]=e,this.gl[t](e))},set2:function(t,e,n){var i=this._dict[t];i||(i=this._dict[t]=[]),i[0]===e&&i[1]===n||(i[0]=e,i[1]=n,this.gl[t](e,n))},set3:function(t,e,n,i){var r=this._dict[t];r||(r=this._dict[t]=[]),r[0]===e&&r[1]===n&&r[2]===i||(r[0]=e,r[1]=n,r[2]=i,this.gl[t](e,n,i))},set4:function(t,e,n,i,r){var s=this._dict[t];s||(s=this._dict[t]=[]),s[0]===e&&s[1]===n&&s[2]===i&&s[3]===r||(s[0]=e,s[1]=n,s[2]=i,s[3]=r,this.gl[t](e,n,i,r))},get:function(t){return this._dict[t]}}),_i=s.a.create({className:"WebGLResourceManager",isWebGLResourceManager:!0,hasNeedDestroyResource:!1,constructor:function(t){Object.assign(this,t)},useResource:function(t,e){if(t){var n=t.className+":"+t.id;this._usedResourceDict[n]||(this._usedResourceDict[n]=t,t.useResource&&t.useResource(this,e))}return e&&e.useResource(t),this},destroyIfNoRef:function(t){return this._needDestroyDict||(this._needDestroyDict={}),t&&(this.hasNeedDestroyResource=!0,this._needDestroyDict[t.className+":"+t.id]=t),this},destroyUnsuedResource:function(){if(!this.hasNeedDestroyResource)return this;var t=this._needDestroyDict,e=this._usedResourceDict;for(var n in t)if(!e[n]){var i=t[n];i&&!i.alwaysUse&&i.destroy&&i.destroy()}return this._needDestroyDict={},this.hasNeedDestroyResource=!1,this},reset:function(){return this._usedResourceDict={},this}}),pi=new o.a,gi=new c.a,vi=new Float32Array([0,0,0]),Ei=s.a.create({isLightManager:!0,className:"LightManager",constructor:function(t){this.ambientLights=[],this.directionalLights=[],this.pointLights=[],this.spotLights=[],this.areaLights=[],this.lightInfo={AMBIENT_LIGHTS:0,POINT_LIGHTS:0,DIRECTIONAL_LIGHTS:0,SPOT_LIGHTS:0,AREA_LIGHTS:0,uid:0},Object.assign(this,t)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(r.each)(this.lightInfo,(function(n,i){if("uid"!==i&&n){e[i]=n;var r=t.getShadowMapCount(i);r&&(e[i+"_SMC"]=r)}})),e},addLight:function(t){var e=null;return t.enabled?(t.isAmbientLight?e=this.ambientLights:t.isDirectionalLight?e=this.directionalLights:t.isPointLight?e=this.pointLights:t.isSpotLight?e=this.spotLights:t.isAreaLight?e=this.areaLights:m.a.warnOnce("LightManager.addLight(".concat(t.id,")"),"Not support this light:",t),e&&(t.shadow?e.unshift(t):e.push(t)),this):this},getDirectionalInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[];this.directionalLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(e,c),o.getViewDirection(t).toArray(n,c),o.shadow&&o.lightShadow&&(i.push(o.lightShadow.framebuffer.texture),r.push(o.lightShadow.width),r.push(o.lightShadow.height),a.push(o.lightShadow.minBias,o.lightShadow.maxBias),pi.copy(t.worldMatrix),pi.premultiply(o.lightShadow.camera.viewProjectionMatrix),pi.toArray(s,16*u))}));var o={colors:new Float32Array(e),infos:new Float32Array(n)};return i.length&&(o.shadowMap=i,o.shadowMapSize=new Float32Array(r),o.shadowBias=new Float32Array(a),o.lightSpaceMatrix=new Float32Array(s)),o},getSpotInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[],c=[],h=[];this.spotLights.forEach((function(f,l){var d=3*l;f.getRealColor().toRGBArray(e,d),f.toInfoArray(n,d),f.getViewDirection(t).toArray(r,d),h.push(f.range),s.push(f._cutoffCos,f._outerCutoffCos),t.getModelViewMatrix(f,pi),pi.getTranslation(gi),gi.toArray(i,d),f.shadow&&f.lightShadow&&(a.push(f.lightShadow.framebuffer.texture),o.push(f.lightShadow.width),o.push(f.lightShadow.height),c.push(f.lightShadow.minBias,f.lightShadow.maxBias),pi.multiply(f.lightShadow.camera.viewProjectionMatrix,t.worldMatrix),pi.toArray(u,16*l))}));var f={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),dirs:new Float32Array(r),cutoffs:new Float32Array(s),ranges:new Float32Array(h)};return a.length&&(f.shadowMap=a,f.shadowMapSize=new Float32Array(o),f.shadowBias=new Float32Array(c),f.lightSpaceMatrix=new Float32Array(u)),f},getPointInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[];this.pointLights.forEach((function(c,h){var f=3*h;c.getRealColor().toRGBArray(e,f),c.toInfoArray(n,f),u.push(c.range),t.getModelViewMatrix(c,pi),pi.getTranslation(gi),gi.toArray(i,f),c.shadow&&c.lightShadow&&(r.push(c.lightShadow.framebuffer.texture),a.push(c.lightShadow.minBias,c.lightShadow.maxBias),t.worldMatrix.toArray(s,16*h),o[2*h]=c.lightShadow.camera.near,o[2*h+1]=c.lightShadow.camera.far)}));var c={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),ranges:new Float32Array(u)};return r.length&&(c.shadowMap=r,c.shadowBias=new Float32Array(a),c.lightSpaceMatrix=new Float32Array(s),c.cameras=new Float32Array(o)),c},getAreaInfo:function(t){var e,n,i=[],r=[],s=[],a=[];return this.areaLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(i,c),t.getModelViewMatrix(o,pi),pi.getTranslation(gi),gi.toArray(r,c);var h=pi.getRotation();pi.fromQuat(h),gi.set(.5*o.width,0,0),gi.transformMat4(pi),gi.toArray(s,c),gi.set(0,.5*o.height,0),gi.transformMat4(pi),gi.toArray(a,c),e=o.ltcTexture1,n=o.ltcTexture2})),{colors:new Float32Array(i),poses:new Float32Array(r),width:new Float32Array(s),height:new Float32Array(a),ltcTexture1:e,ltcTexture2:n}},getAmbientInfo:function(){return vi[0]=vi[1]=vi[2]=0,this.ambientLights.forEach((function(t){var e=t.getRealColor();vi[0]+=e.r,vi[1]+=e.g,vi[2]+=e.b})),vi[0]=Math.min(1,vi[0]),vi[1]=Math.min(1,vi[1]),vi[2]=Math.min(1,vi[2]),vi},updateInfo:function(t){var e=this.lightInfo,n=this.ambientLights,i=this.directionalLights,r=this.pointLights,s=this.spotLights,a=this.areaLights;e.AMBIENT_LIGHTS=n.length,e.POINT_LIGHTS=r.length,e.DIRECTIONAL_LIGHTS=i.length,e.SPOT_LIGHTS=s.length,e.AREA_LIGHTS=a.length;var o=function(t){return!!t.shadow};e.SHADOW_POINT_LIGHTS=r.filter(o).length,e.SHADOW_SPOT_LIGHTS=s.filter(o).length,e.SHADOW_DIRECTIONAL_LIGHTS=i.filter(o).length,e.uid=[e.AMBIENT_LIGHTS,e.POINT_LIGHTS,e.SHADOW_POINT_LIGHTS,e.DIRECTIONAL_LIGHTS,e.SHADOW_DIRECTIONAL_LIGHTS,e.SPOT_LIGHTS,e.SHADOW_SPOT_LIGHTS,e.AREA_LIGHTS].join("_"),this.directionalInfo=this.getDirectionalInfo(t),this.pointInfo=this.getPointInfo(t),this.spotInfo=this.getSpotInfo(t),this.areaInfo=this.getAreaInfo(t),this.ambientInfo=this.getAmbientInfo()},getInfo:function(){return this.lightInfo},reset:function(){this.ambientLights.length=0,this.directionalLights.length=0,this.pointLights.length=0,this.spotLights.length=0,this.areaLights.length=0},getShadowMapCount:function(t){var e=[];"POINT_LIGHTS"===t?e=this.pointLights:"DIRECTIONAL_LIGHTS"===t?e=this.directionalLights:"SPOT_LIGHTS"===t?e=this.spotLights:"AREA_LIGHTS"===t&&(e=this.spotLights);var n=0;return e.forEach((function(t){n+=t.shadow?1:0})),n},createShadowMap:function(t,e){this.directionalLights.forEach((function(n){n.createShadowMap(t,e)})),this.spotLights.forEach((function(n){n.createShadowMap(t,e)})),this.pointLights.forEach((function(n){n.createShadowMap(t,e)})),this.areaLights.forEach((function(n){n.createShadowMap(t,e)}))}}),Ti=P.a.DEPTH_TEST,Mi=P.a.SAMPLE_ALPHA_TO_COVERAGE,Ai=P.a.CULL_FACE,Ii=P.a.FRONT_AND_BACK,Li=P.a.BLEND,Oi=P.a.LINES,Si=P.a.STATIC_DRAW,Ri=P.a.DYNAMIC_DRAW,yi=s.a.create({Mixes:a.a,className:"WebGLRenderer",isWebGLRenderer:!0,gl:null,width:0,height:0,pixelRatio:1,domElement:null,useInstanced:!1,useVao:!0,alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!1,gameMode:!1,useFramebuffer:!1,framebufferOption:{},useLogDepth:!1,vertexPrecision:"highp",fragmentPrecision:"highp",fog:null,offsetX:0,offsetY:0,isInitFailed:!1,_isInit:!1,_isContextLost:!1,constructor:function(t){this.clearColor=new v.a(1,1,1),Object.assign(this,t),this.renderInfo=new ci,this.renderList=new di,this.lightManager=new Ei,this.resourceManager=new _i},resize:function(t,e,n){if(n||this.width!==t||this.height!==e){var i=this.domElement;this.width=t,this.height=e,i.width=t,i.height=e,this.framebuffer&&this.framebuffer.resize(this.width,this.height,n),this.viewport()}},setOffset:function(t,e){this.offsetX===t&&this.offsetY===e||(this.offsetX=t,this.offsetY=e,this.viewport())},viewport:function(t,e,n,i){var r=this.state,s=this.gl;r&&(void 0===t?t=this.offsetX:this.offsetX=t,void 0===e?e=this.offsetY:this.offsetY=e,void 0===n&&(n=s.drawingBufferWidth),void 0===i&&(i=s.drawingBufferHeight),r.viewport(t,e,n,i))},isInit:{get:function(){return this._isInit&&!this.isInitFailed}},onInit:function(t){var e=this;this._isInit?t(this):this.on("init",(function(){t(e)}),!0)},initContext:function(){if(!this._isInit){this._isInit=!0;try{this._initContext(),this.fire("init")}catch(t){this.isInitFailed=!0,this.fire("initFailed",t)}}},_initContext:function(){var t=this,e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat};!0===this.preserveDrawingBuffer&&(e.preserveDrawingBuffer=!0),!0===this.gameMode&&(e.gameMode=!0);var n=this.gl=this.domElement.getContext("webgl",e);n.viewport(0,0,this.width,this.height),Tt.init(n),tt.init(n),et.init(n),dt.init(this),this.state=new mi(n),tt.instanced||(this.useInstanced=!1),this.renderList.useInstanced=this.useInstanced,tt.vao||(this.useVao=!1),this.useFramebuffer&&(this.framebuffer=new re(this,Object.assign({useVao:this.useVao,width:this.width,height:this.height},this.framebufferOption))),this.domElement.addEventListener("webglcontextlost",(function(e){t._onContextLost(e)}),!1),this.domElement.addEventListener("webglcontextrestored",(function(e){t._onContextRestore(e)}),!1)},_onContextLost:function(t){this.fire("webglContextLost");var e=this.gl;this._isContextLost=!0,t.preventDefault(),It.reset(e),dt.reset(e),qt.reset(e),xt.reset(e),Ft.reset(e),this.state.reset(e),this._lastMaterial=null,this._lastProgram=null},_onContextRestore:function(t){this.fire("webglContextRestored");var e=this.gl;this._isContextLost=!1,tt.reset(e),re.reset(e)},setupDepthTest:function(t){var e=this.state;t.depthTest?(e.enable(Ti),e.depthFunc(t.depthFunc),e.depthMask(t.depthMask),e.depthRange(t.depthRange[0],t.depthRange[1])):e.disable(Ti)},setupSampleAlphaToCoverage:function(t){var e=this.state;t.sampleAlphaToCoverage?e.enable(Mi):e.disable(Mi)},setupCullFace:function(t){var e=this.state;t.cullFace&&t.cullFaceType!==Ii?(e.enable(Ai),e.cullFace(t.cullFaceType)):e.disable(Ai)},setupBlend:function(t){var e=this.state;t.blend?(e.enable(Li),e.blendFuncSeparate(t.blendSrc,t.blendDst,t.blendSrcAlpha,t.blendDstAlpha),e.blendEquationSeparate(t.blendEquation,t.blendEquationAlpha)):e.disable(Li)},setupUniforms:function(t,e,n,i){var r=this.forceMaterial||e.material;for(var s in t.uniforms){var a=r.getUniformInfo(s),o=t.uniforms[s];if(!a.isBlankInfo&&(i||a.isDependMesh&&!n)){var u=a.get(e,r,o);null!=u&&(t[s]=u)}}},setupVao:function(t,e,n){var i=n.geometry,r=i.isStatic;if(t.isDirty||!r||i.isDirty){t.isDirty=!1;var s=this.forceMaterial||n.material,a=s.attributes,o=r?Si:Ri;for(var u in a){var c=e.attributes[u];if(c){var h=s.getAttributeData(u,n,c);null!=h&&t.addAttribute(h,c,o)}}i.indices&&t.addIndexBuffer(i.indices,o),i.isDirty=!1}i.vertexCount&&(t.vertexCount=i.vertexCount)},setupMaterial:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.forceMaterial||e.material;(r.isDirty||this._lastMaterial!==r)&&(this.setupDepthTest(r),this.setupSampleAlphaToCoverage(r),this.setupCullFace(r),this.setupBlend(r),i=!0),this.setupUniforms(t,e,n,i),r.isDirty=!1,this._lastMaterial=r},setupMesh:function(t,e){var n=this.gl,i=this.state,r=this.lightManager,s=this.resourceManager,a=t.geometry,o=this.forceMaterial||t.material,u=dt.getShader(t,o,e,r,this.fog,this.useLogDepth),c=It.getProgram(u,i);c.useProgram(),this.setupMaterial(c,t,e,this._lastProgram!==c),this._lastProgram=c,t.material.wireframe&&a.mode!==Oi&&a.convertToLinesMode();var h=a.id+c.id,f=Ft.getVao(n,h,{useInstanced:e,useVao:this.useVao,mode:a.mode});return this.setupVao(f,c,t),s.useResource(f,t).useResource(u,t).useResource(c,t),{vao:f,program:c,geometry:a}},addRenderInfo:function(t,e){var n=this.renderInfo;n.addFaceCount(t),n.addDrawCount(e)},render:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.initContext(),!this.isInitFailed&&!this._isContextLost){var i=this.renderList,r=this.renderInfo,s=this.lightManager,a=this.resourceManager,o=this.state;this.fog=t.fog,s.reset(),r.reset(),i.reset(),a.reset(),Ce.init(this,o,e,s,this.fog),t.updateMatrixWorld(),e.updateViewProjectionMatrix(),t.traverse((function(t){return t.visible?(t.isMesh?i.addMesh(t,e):t.isLight&&s.addLight(t),g.TRAVERSE_STOP_NONE):g.TRAVERSE_STOP_CHILDREN})),i.sort(),s.createShadowMap(this,e),s.updateInfo(e),n&&this.fire("beforeRender"),this.useFramebuffer&&this.framebuffer.bind(),this.clear(),n&&this.fire("beforeRenderScene"),this.renderScene(),this.useFramebuffer&&this.renderToScreen(this.framebuffer),n&&this.fire("afterRender"),a.destroyUnsuedResource()}},renderScene:function(){var t=this;this.renderList.traverse((function(e){t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e)})),this._gameModeSumbit()},_gameModeSumbit:function(){var t=this.gl;this.gameMode&&t&&t.submit&&t.submit()},clear:function(t){var e=this.gl,n=this.state;t=t||this.clearColor,n.depthMask(!0),this._lastMaterial=null,this._lastProgram=null,e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)},clearDepth:function(){var t=this.gl;this.state.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},renderToScreen:function(t){this.state.bindSystemFramebuffer(),t.render(0,0,1,1,this.clearColor)},renderMesh:function(t){var e=this.setupMesh(t,!1).vao;e.draw(),this.addRenderInfo(e.vertexCount/3,1)},renderInstancedMeshes:function(t){var e=t[0];if(e){var n=this.forceMaterial||e.material,i=this.setupMesh(e,!0),r=i.vao,s=i.program;n.getInstancedUniforms().forEach((function(e){var n=e.name,i=e.info,a=s.attributes[n];a&&r.addInstancedAttribute(a,t,(function(t){return i.get(t)}))})),r.drawInstance(t.length),this.addRenderInfo(r.vertexCount/3*t.length,1)}},renderMultipleMeshes:function(t){var e=this;t.forEach((function(t){e.renderMesh(t)}))},releaseGLResource:function(){var t=this.gl;t&&(It.reset(t),dt.reset(t),xt.reset(t),Ft.reset(t),this.state.reset(t),qt.reset(t),re.destroy(t))}}),xi=n(60),Ni=n.n(xi).a,bi=s.a.create({Extends:g,isStage:!0,className:"Stage",renderer:null,camera:null,pixelRatio:null,offsetX:0,offsetY:0,constructor:function(t){if(t.width||(t.width=window.innerWidth),t.height||(t.height=window.innerHeight),!t.pixelRatio){var e=window.devicePixelRatio||1;e=Math.min(e,1024/Math.max(t.width,t.height),2),e=Math.max(e,1),t.pixelRatio=e}bi.superclass.constructor.call(this,t),this.initRenderer(t),m.a.log("Hilo3d version: ".concat("1.13.47"))},initRenderer:function(t){var e=this.canvas=this.createCanvas(t);this.renderer=new yi(Object.assign(t,{domElement:e})),this.resize(this.width,this.height,this.pixelRatio,!0)},createCanvas:function(t){var e;return e=t.canvas?t.canvas:document.createElement("canvas"),t.container&&t.container.appendChild(e),e},resize:function(t,e,n,i){if(void 0===n&&(n=this.pixelRatio),i||this.width!==t||this.height!==e||this.pixelRatio!==n){this.width=t,this.height=e,this.pixelRatio=n,this.rendererWidth=t*n,this.rendererHeight=e*n;var r=this.canvas;this.renderer.resize(this.rendererWidth,this.rendererHeight,i),r.style.width=this.width+"px",r.style.height=this.height+"px",this.updateDomViewport()}return this},setOffset:function(t,e){if(this.offsetX!==t||this.offsetY!==e){this.offsetX=t,this.offsetY=e;var n=this.pixelRatio;this.renderer.setOffset(t*n,e*n)}return this},viewport:function(t,e,n,i){return this.resize(n,i,this.pixelRatio,!0),this.setOffset(t,e),this},tick:function(t){return this.traverseUpdate(t),this.camera&&this.renderer.render(this,this.camera,!0),this},enableDOMEvent:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.canvas,r=this._domListener||(this._domListener=function(t){e._onDOMEvent(t)});return(t="string"==typeof t?[t]:t).forEach((function(t){n?i.addEventListener(t,r,!1):i.removeEventListener(t,r)})),this},_onDOMEvent:function(t){var e=this.canvas,n=this._eventTarget,i=t.type,r=0===i.indexOf("touch"),s=t;if(r){var a=t.touches,o=t.changedTouches;a&&a.length?s=a[0]:o&&o.length&&(s=o[0])}var u=this.domViewport||this.updateDomViewport(),c=(s.pageX||s.clientX)-u.left,h=(s.pageY||s.clientY)-u.top;t.stageX=c,t.stageY=h,t.stopPropagation=function(){this._stopPropagationed=!0};var f=this.getMeshResultAtPoint(c,h,!0),l=f.mesh;t.hitPoint=f.point;var d="mouseout"===i;if(n&&(n!==l&&(!n.contains||!n.contains(l))||d)){var m=!1;if("touchmove"===i?m="touchout":"mousemove"!==i&&!d&&l||(m="mouseout"),m){var _=Object.assign({},t);_.type=m,_.eventTarget=n,n._fireMouseEvent(_)}t.lastEventTarget=n,this._eventTarget=null}if(l&&l.pointerEnabled&&"mouseout"!==i&&(t.eventTarget=this._eventTarget=l,l._fireMouseEvent(t)),!r){var p=l&&l.pointerEnabled&&l.useHandCursor?"pointer":"";e.style.cursor=p}Ni.android&&"touchmove"===i&&t.preventDefault()},updateDomViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.domViewport=Object(r.getElementRect)(t)),e},getMeshResultAtPoint:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.camera,r=this._ray;r||(r=this._ray=new ti.a),r.fromCamera(i,t,e,this.width,this.height);var s=this.raycast(r,!0,n);if(s)return s[0];this._stageResultAtPoint||(this._stageResultAtPoint={mesh:this,point:new c.a});var a=this._stageResultAtPoint.point;return a.copy(i.unprojectVector(a.set(t,e,0),this.width,this.height)),this._stageResultAtPoint},releaseGLResource:function(){return this.renderer.releaseGLResource(),this},destroy:function(){return this.releaseGLResource(),this.traverse((function(t){t.off(),t.parent=null})),this.children.length=0,this.renderer.off(),this}}),Ci=bi,Pi=n(61),wi=n.n(Pi),Hi=n(105),Di=n.n(Hi);wi.a.Ease=Di.a;var Fi=wi.a,Ui=s.a.create({Extends:Z,isBoxGeometry:!0,className:"BoxGeometry",width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1,constructor:function(t){Ui.superclass.constructor.call(this,t),this.isSegments()?this.buildWithSegments():this.build()},buildWithSegments:function(){var t=this.width,e=this.height,n=this.depth,i=this.widthSegments,r=this.heightSegments,s=this.depthSegments,a=r*s*6,o=i*s*6,u=i*r*6,c=2*((r+1)*(s+1)+(i+1)*(s+1)+(i+1)*(r+1)),h=new Float32Array(3*c),f=new Float32Array(3*c),l=new Float32Array(2*c),d=new Uint16Array(2*(a+o+u));this.vertices=new C(h,3),this.normals=new C(f,3),this.uvs=new C(l,2),this.indices=new C(d,1);var m=[0,0];this.buildPlane(m,2,1,0,-1,1,n,e,t/2,s,r),this.buildPlane(m,2,1,0,1,1,n,e,-t/2,s,r),this.buildPlane(m,0,2,1,1,-1,t,n,e/2,i,s),this.buildPlane(m,0,2,1,1,1,t,n,-e/2,i,s),this.buildPlane(m,0,1,2,1,1,t,e,n/2,i,r),this.buildPlane(m,0,1,2,-1,1,t,e,-n/2,i,r)},buildPlane:function(t,e,n,i,r,s,a,o,u,c,h){for(var f=a/c,l=o/h,d=a/2,m=o/2,_=t[0],p=t[1],g=this.vertices.data,v=this.normals.data,E=this.uvs.data,T=this.indices.data,M=0;M<=h;M++)for(var A=(M*l-m)*s,I=0;I<=c;I++){if(g[3*_+e]=(I*f-d)*r,g[3*_+n]=A,g[3*_+i]=u,v[3*_+e]=0,v[3*_+n]=0,v[3*_+i]=u<0?-1:1,E[2*_]=I/c,E[2*_+1]=1-M/h,I1||this.heightSegments>1||this.depthSegments>1},setFrontUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setFrontUV!"):this.setVertexUV(32,t)},setRightUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setRightUV!"):this.setVertexUV(0,t)},setBackUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBackUV!"):this.setVertexUV(40,t)},setLeftUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setLeftUV!"):this.setVertexUV(8,t)},setTopUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setTopUV!"):this.setVertexUV(16,t)},setBottomUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBottomUV!"):this.setVertexUV(24,t)},setAllRectUV:function(t){if(this.isSegments())return m.a.warn("segmented BoxGeometry dont support setAllRectUV!"),null;for(var e=0;e<6;e++)this.setVertexUV(8*e,t);return this},_raycast:function(t,e){return Ui.superclass._raycast.call(this,t,e)}}),Gi=Ui,Bi=P.a.FRONT,Vi=P.a.BACK,Xi=[0,0,1],ji=s.a.create({Extends:Z,isPlaneGeometry:!0,className:"PlaneGeometry",width:1,height:1,widthSegments:1,heightSegments:1,constructor:function(t){ji.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.widthSegments,e=this.heightSegments,n=(t+1)*(e+1),i=this.width/t,r=this.height/e,s=new Float32Array(3*n),a=new Float32Array(3*n),o=new Float32Array(2*n),u=new Uint16Array(t*e*6),c=0,h=0;h<=e;h++)for(var f=0;f<=t;f++){var l=h*(t+1)+f;if(s[3*l]=f*i-this.width/2,s[3*l+1]=this.height/2-h*r,a[3*l]=0,a[3*l+1]=0,a[3*l+2]=1,o[2*l]=f/t,o[2*l+1]=1-h/e,h0||n<0))return null;if(e===Vi&&(i<0||n>0))return null;var r=t.intersectsPlane(Xi,0);if(r){var s=r.x,a=r.y,o=.5*this.width,u=.5*this.height;if(s>=-o&&s<=o&&a>=-u&&a<=u)return[r]}return null}}),zi=ji,ki=s.a.create({Extends:Z,isSphereGeometry:!0,className:"SphereGeometry",radius:1,heightSegments:16,widthSegments:32,constructor:function(t){ki.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.radius,e=this.heightSegments,n=this.widthSegments,i=(n+1)*(e+1),r=n*e,s=new Float32Array(3*i),a=new Float32Array(4*i),o=new Float32Array(2*i),u=new Uint16Array(6*r),c=0,h=0,f=0,l=0,d=0,m=2*Math.PI,_=Math.PI,p=0;p<=e;p++)for(var g=p/e,v=_*g,E=Math.cos(v)*t,T=Math.sin(v)*t,M=0;M<=n;M++){var A=M/n,I=m*A,L=Math.cos(I),O=Math.sin(I),S=L*T,R=O*T,y=O,x=-L;if(a[f++]=y,a[f++]=0,a[f++]=x,a[f++]=1,s[h++]=S,s[h++]=E,s[h++]=R,o[l++]=A,o[l++]=g,p>0&&M>0){var N=d,b=N-1,P=b-n-1,w=N-n-1;u[c++]=P,u[c++]=w,u[c++]=N,u[c++]=P,u[c++]=N,u[c++]=b}d++}this.vertices=new C(s,3),this.indices=new C(u,1),this.uvs=new C(o,2),this.tangents=new C(a,4),this.normals=new C(new Float32Array(s),3)},_raycast:function(t,e){return ki.superclass._raycast.call(this,t,e)}}),qi=ki,Wi=[dt,It,xt,Ft,qt],Yi=function(){var t="";Wi.forEach((function(e){t+="".concat(e.prototype.className,":").concat(Object.keys(e.cache._cache).length," ")})),m.a.log(t)},Zi=s.a.create({Mixes:a.a,isLoadCache:!0,className:"LoadCache",Statics:{PENDING:1,LOADED:2,FAILED:3},enabled:!0,constructor:function(){this._files={}},update:function(t,e,n){if(this.enabled){var i={key:t,state:e,data:n};this._files[t]=i,this.fire("update",i),this.fire("update:".concat(i.key),i)}},get:function(t){return this.enabled?this._files[t]:null},remove:function(t){delete this._files[t]},clear:function(){this._files={}},wait:function(t){var e=this;return t?t.state===Zi.LOADED?Promise.resolve(t.data):t.state===Zi.FAILED?Promise.reject():new Promise((function(n,i){e.on("update:".concat(t.key),(function(t){var e=t.detail;e.state===Zi.LOADED?n(e.data):e.state===Zi.FAILED&&i(e.data)}),!0)})):Promise.reject()}}),Ki=Zi,Qi=new Ki,Ji=s.a.create({Mixes:a.a,isBasicLoader:!0,className:"BasicLoader",Statics:{_cache:Qi,enalbeCache:function(){Qi.enabled=!0},disableCache:function(){Qi.enabled=!1},deleteCache:function(t){Qi.remove(t)},clearCache:function(){Qi.clear()},cache:{get:function(){return Qi},set:function(){m.a.warn("BasicLoader.cache is readonly!")}}},load:function(t){var e=t.src,n=t.type;if(!n){var i=Object(r.getExtension)(e);/^(?:png|jpe?g|gif|webp|bmp)$/i.test(i)&&(n="img"),n||(n=t.defaultType)}return"img"===n?this.loadImg(e,t.crossOrigin):this.loadRes(e,n)},isCrossOrigin:function(t){var e=window.location,n=document.createElement("a");return n.href=t,n.hostname!==e.hostname||n.port!==e.port||n.protocol!==e.protocol},isBase64:function(t){return/^data:(.+?);base64,/.test(t)},Uint8ArrayFrom:function(t,e){if(Uint8Array.from)return Uint8Array.from(t,e);for(var n=t.length,i=new Uint8Array(n),r=0;r=300)i(new TypeError("Network request failed for ".concat(s.status)));else{var e="response"in s?s.response:s.responseText;if("json"===t.type)try{e=JSON.parse(e)}catch(t){return void i(new TypeError("JSON.parse error"+t))}n(e)}},s.onprogress=function(n){e.fire("progress",{url:t.url,loaded:n.loaded,total:n.total})},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request timed out"))},s.open(t.method||"GET",t.url,!0),"include"===t.credentials&&(s.withCredentials=!0),"buffer"===t.type&&(s.responseType="arraybuffer"),Object(r.each)(t.headers,(function(t,e){s.setRequestHeader(e,t)})),s.send(t.body||null)}))}}),$i=s.a.create({isLoader:!0,className:"Loader",maxConnections:2,Statics:{_loaderClassMap:{},_loaders:{},addLoader:function(t,e){$i._loaderClassMap[t]=e},getLoader:function(t){if(!$i._loaders[t]){var e=$i._loaderClassMap[t]?$i._loaderClassMap[t]:Ji;$i._loaders[t]=new e}return $i._loaders[t]}},load:function(t){var e=this;if(t instanceof Array)return Promise.all(t.map((function(t){return e.load(t)})));var n=t.type||Object(r.getExtension)(t.src);return $i.getLoader(n).load(t)}}),tr=$i,er=s.a.create({Extends:Ji,isCubeTextureLoader:!0,className:"CubeTextureLoader",constructor:function(){er.superclass.constructor.call(this)},load:function(t){var e,n=this;return e=t.images&&Array.isArray(t.images)?t.images:[t.right,t.left,t.top,t.bottom,t.front,t.back],Promise.all(e.map((function(e){return n.loadImg(e,t.crossOrigin)}))).then((function(e){var n=Object.assign({},t);return delete n.images,delete n.type,delete n.right,delete n.left,delete n.top,delete n.bottom,delete n.front,delete n.back,n.image=e,new fe(n)})).catch((function(t){throw m.a.error("load CubeTexture failed",t.message,t.stack),t}))}});tr.addLoader("CubeTexture",er);var nr=er,ir=s.a.create({Extends:je,isPBRMaterial:!0,className:"PBRMaterial",lightType:"PBR",gammaCorrection:!0,usePhysicsLight:!0,baseColor:null,baseColorMap:null,metallic:1,metallicMap:null,roughness:1,roughnessMap:null,metallicRoughnessMap:null,occlusionMap:null,occlusionStrength:1,isOcclusionInMetallicRoughnessMap:!1,diffuseEnvMap:null,diffuseEnvSphereHarmonics3:null,diffuseEnvIntensity:1,brdfLUT:null,specularEnvIntensity:1,specularEnv:null,emission:null,isSpecularGlossiness:!1,specular:null,glossiness:1,specularGlossinessMap:null,usedUniformVectors:11,constructor:function(t){this.baseColor=new v.a(1,1,1),this.specular=new v.a(1,1,1),ir.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_baseColor:"BASECOLOR",u_metallic:"METALLIC",u_roughness:"ROUGHNESS",u_specular:"SPECULAR",u_glossiness:"GLOSSINESS",u_brdfLUT:"BRDFLUT",u_diffuseEnvMap:"DIFFUSEENVMAP",u_diffuseEnvIntensity:"DIFFUSEENVINTENSITY",u_occlusionStrength:"OCCLUSIONSTRENGTH",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvIntensity:"SPECULARENVINTENSITY",u_specularEnvMapMipCount:"SPECULARENVMAPMIPCOUNT",u_diffuseEnvSphereHarmonics3:"DIFFUSEENVSPHEREHARMONICS3"}),this.addTextureUniforms({u_baseColorMap:"BASECOLORMAP",u_metallicMap:"METALLICMAP",u_roughnessMap:"ROUGHNESSMAP",u_metallicRoughnessMap:"METALLICROUGHNESSMAP",u_occlusionMap:"OCCLUSIONMAP",u_specularGlossinessMap:"SPECULARGLOSSINESSMAP",u_lightMap:"LIGHTMAP"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ir.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t);return e.add(this.baseColorMap,"BASE_COLOR_MAP"),e.add(this.metallicMap,"METALLIC_MAP"),e.add(this.roughnessMap,"ROUGHNESS_MAP"),e.add(this.metallicRoughnessMap,"METALLIC_ROUGHNESS_MAP"),e.add(this.diffuseEnvMap,"DIFFUSE_ENV_MAP"),e.add(this.occlusionMap,"OCCLUSION_MAP"),e.add(this.lightMap,"LIGHT_MAP"),this.brdfLUT&&(e.add(this.specularEnvMap,"SPECULAR_ENV_MAP"),et.SHADER_TEXTURE_LOD&&this.specularEnvMap&&(t.USE_SHADER_TEXTURE_LOD=1)),this.isSpecularGlossiness&&(t.PBR_SPECULAR_GLOSSINESS=1,e.add(this.specularGlossinessMap,"SPECULAR_GLOSSINESS_MAP")),this.isOcclusionInMetallicRoughnessMap&&(t.IS_OCCLUSION_MAP_IN_METALLIC_ROUGHNESS_MAP=1),1!==this.occlusionStrength&&(t.OCCLUSION_STRENGTH=1),this.diffuseEnvSphereHarmonics3&&(t.HAS_NORMAL=1,t.DIFFUSE_ENV_SPHERE_HARMONICS3=1),(this.specularEnvMap||this.diffuseEnvSphereHarmonics3||this.specularEnvMap)&&(t.NEED_WORLD_NORMAL=1),e.update(),t}}),rr=ir,sr=new Image;sr.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var ar=s.a.create({Extends:qt,Mixes:a.a,isLazyTexture:!0,className:"LazyTexture",_src:"",crossOrigin:!1,autoLoad:!0,resType:"",src:{get:function(){return this._src},set:function(t){this._src!==t&&(this._src=t,this.autoLoad&&this.load())}},constructor:function(t){t&&("crossOrigin"in t&&(this.crossOrigin=t.crossOrigin),"autoLoad"in t&&(this.autoLoad=t.autoLoad)),ar.superclass.constructor.call(this,t),this.image=this.placeHolder||sr},load:function(t){var e=this;return ar.loader=ar.loader||new tr,ar.loader.load({src:this.src,crossOrigin:this.crossOrigin,type:this.resType,defaultType:"img"}).then((function(t){t.isTexture?(Object.assign(e,t),e.needUpdate=!0,e.needDestroy=!0,e.fire("load")):(e.image=t,e.needUpdate=!0,e.fire("load"))}),(function(n){if(e.fire("error"),t)throw new Error("LazyTexture Failed ".concat(n));m.a.warn("LazyTexture Failed ".concat(n))}))},_releaseImage:function(){this._src&&"string"!=typeof this._src&&(this._src=""),ar.superclass._releaseImage.call(this)}}),or=ar,ur=n(13);function cr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var hr=new l.a,fr=new l.a,lr=new l.a,dr=new l.a,mr=new l.a,_r=new l.a,pr=new ur.a,gr=[];function vr(t,e){return t-e}var Er=s.a.create({Statics:{interpolation:{LINEAR:function(t,e,n){if(void 0===e)return t;if(t.slerp)return t.slerp(e,n);if(t.lerp)return t.lerp(e,n);if(Object(r.isArrayLike)(t)){gr.length=0;for(var i=t.length-1;i>=0;i--)gr[i]=t[i]+n*(e[i]-t[i]);return gr}return t+n*(e-t)},STEP:function(t,e,n){return t},CUBICSPLINE:function(t,e,n,i){var s=t.length/3;if(void 0===e)return 1===s?t[1]:t.slice(s,-s);var a=t[1],o=t[2],u=e[1],c=e[0];if(s>1&&(a=t.slice(s,-s),o=t.slice(-s),u=e.slice(s,-s),c=e.slice(0,s)),a.hermite)a.hermite(a,o.scale(i),u,c.scale(i),n);else if(a.sqlerp)a.sqlerp(a,o.scale(i),u,c.scale(i),n);else{Object(r.isArrayLike)(a)||(a=[a],o=[o],u=[u],c=[c]);var h=n*n,f=h*n,l=2*f-3*h+1,d=f-2*h+n,m=-2*f+3*h,_=f-h;gr.length=0;for(var p=a.length-1;p>=0;p--)gr[p]=a[p]*l+d*o[p]*i+u[p]*m+_*c[p]*i;a=gr}return a}},StateType:{TRANSLATE:"Translation",POSITION:"Translation",TRANSLATION:"Translation",SCALE:"Scale",ROTATE:"Rotation",ROTATION:"Rotation",QUATERNION:"Quaternion",WEIGHTS:"Weights"},getType:function(t){return t=String(t).toUpperCase(),Er.StateType[t]}},isAnimationStates:!0,className:"AnimationStates",nodeName:"",type:"",interpolationType:"LINEAR",constructor:function(t){this.id=d.a.generateUUID(this.className),this.keyTime=[],this.states=[],Object.assign(this,t)},findIndexByTime:function(t){return Object(r.getIndexFromSortedArray)(this.keyTime,t,vr)},getStateByIndex:function(t){var e=this.states.length/this.keyTime.length;return 1===e?this.states[t]:this.states.slice(t*e,t*e+e)},getState:function(t){var e=cr(this.findIndexByTime(t),2),n=e[0],i=e[1];if(n<0||i>=this.keyTime.length)return null;var s=this.keyTime[n],a=this.keyTime[i],o=this.getStateByIndex(n);if(n===i){var u=this.interpolation(o);return this.type===Er.StateType.ROTATION&&(u=hr.fromEuler(pr.fromArray(u))),u.elements||u}var c=this.getStateByIndex(i),h=a-s,f=(t-s)/h;this.type===Er.StateType.ROTATION?Object(r.isArrayLike)(o[0])?(o[0]=hr.fromEuler(pr.fromArray(o[0])),o[1]=fr.fromEuler(pr.fromArray(o[1])),o[2]=lr.fromEuler(pr.fromArray(o[2])),c[0]=dr.fromEuler(pr.fromArray(c[0])),c[1]=mr.fromEuler(pr.fromArray(c[1])),c[2]=_r.fromEuler(pr.fromArray(c[2]))):(o=hr.fromEuler(pr.fromArray(o)),c=fr.fromEuler(pr.fromArray(c))):this.type===Er.StateType.QUATERNION&&(Object(r.isArrayLike)(o[0])?(o[0]=hr.fromArray(o[0]),o[1]=fr.fromArray(o[1]),o[2]=lr.fromArray(o[2]),c[0]=dr.fromArray(c[0]),c[1]=mr.fromArray(c[1]),c[2]=_r.fromArray(c[2])):(o=hr.fromArray(o),c=fr.fromArray(c)));var l=this.interpolation(o,c,f,h);return l.elements||l},interpolation:function(t,e,n,i){return Er.interpolation[this.interpolationType](t,e,n,i)},updateNodeTranslation:function(t,e){t.x=e[0],t.y=e[1],t.z=e[2]},updateNodeScale:function(t,e){t.scaleX=e[0],t.scaleY=e[1],t.scaleZ=e[2]},updateNodeQuaternion:function(t,e){t.quaternion.fromArray(e)},updateNodeWeights:function(t,e){var n=this._originalWeightIndices=this._originalWeightIndices||[],i=e.length;e=e.slice();for(var r=0;re[s]){var o=e[s];e[s]=e[a],e[a]=o,o=n[s],n[s]=n[a],n[a]=o}t.traverse((function(t){t.isMesh&&t.geometry&&t.geometry.isMorphGeometry&&t.geometry.update(e,n)}))},updateNodeState:function(t,e){if(e){var n=this.type;n===Er.StateType.ROTATION&&(n=Er.StateType.QUATERNION);var i=this.getState(t);i&&this["updateNode".concat(n)](e,i)}},clone:function(){return new this.constructor({keyTime:this.keyTime,states:this.states,type:this.type,nodeName:this.nodeName})}}),Tr=Er,Mr=s.a.create({Statics:{_anims:[],tick:function(t){this._anims.forEach((function(e){return e.tick(t)}))}},Mixes:a.a,isAnimation:!0,className:"Animation",paused:!1,currentLoopCount:0,loop:1/0,currentTime:0,timeScale:1,startTime:0,endTime:0,clipStartTime:0,clipEndTime:0,nodeNameMap:null,_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initNodeNameMap()}},validAnimationIds:null,constructor:function(t){this.id=d.a.generateUUID(this.className),this.animStatesList=[],this.clips={},Object.assign(this,t),this.initClipTime()},addClip:function(t,e,n,i){this.clips[t]={start:e,end:n,animStatesList:i}},removeClip:function(t){this.clips[t]=null},getAnimStatesListTimeInfo:function(t){var e=0,n=1/0;return t.forEach((function(t){e=Math.max(t.keyTime[t.keyTime.length-1],e),n=Math.min(t.keyTime[0],n)})),{startTime:n,endTime:e}},initClipTime:function(){var t=this.getAnimStatesListTimeInfo(this.animStatesList);this.clipStartTime=t.startTime,this.clipEndTime=t.endTime},initNodeNameMap:function(){if(this._rootNode){var t=this.nodeNameMap={};this._rootNode.traverse((function(e){t[e.animationId]=e;var n=e.name;void 0===n||t[n]||(t[n]=e)}),!1)}},tick:function(t){this.paused||(this.currentTime+=t/1e3*this.timeScale,this.currentTime>=this.endTime?(this.currentLoopCount++,this.currentTime=this.endTime,this.updateAnimStates(),this.fire("loopEnd"),!this.loop||this.currentLoopCount>=this.loop?(this.stop(),this.fire("end")):this.currentTime=this.startTime):this.updateAnimStates())},updateAnimStates:function(){var t=this;return this.animStatesList.forEach((function(e){e.updateNodeState(t.currentTime,t.nodeNameMap[e.nodeName])})),this},play:function(t,e){var n;if("string"==typeof t){var i=this.clips[t];i?(n=i.start,e=i.end,i.animStatesList&&(this.animStatesList=i.animStatesList,this.initClipTime())):m.a.warn("no this animation clip name:"+t)}else n=t;void 0===n&&(n=this.clipStartTime),void 0===e&&(e=this.clipEndTime),this.endTime=Math.min(e,this.clipEndTime),this.startTime=Math.min(n,this.endTime),this.currentTime=this.startTime,this.currentLoopCount=0,this.stop(),this.paused=!1,Mr._anims.push(this)},stop:function(){this.paused=!0;var t=Mr._anims,e=t.indexOf(this);-1!==e&&t.splice(e,1)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},clone:function(t){var e=new this.constructor({rootNode:t,animStatesList:this.animStatesList,timeScale:this.timeScale,loop:this.loop,paused:this.paused,currentTime:this.currentTime,startTime:this.startTime,endTime:this.endTime,clips:this.clips});return this.paused||e.play(),e}}),Ar=Mr;function Ir(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Lr=P.a.BLEND,Or=P.a.DEPTH_TEST,Sr=P.a.CULL_FACE,Rr=P.a.FRONT,yr=P.a.BACK,xr=P.a.FRONT_AND_BACK,Nr={5120:[1,Int8Array],5121:[1,Uint8Array],5122:[2,Int16Array],5123:[2,Uint16Array],5125:[4,Uint32Array],5126:[4,Float32Array]},br={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cr={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},Pr=s.a.create({isGLTFParser:!0,className:"GLTFParser",Statics:{MAGIC:"glTF",extensionHandlers:i,registerExtensionHandler:function(t,e){this.extensionHandlers[t]=e},unregisterExtensionHandler:function(t){this.extensionHandlers[t]&&delete this.extensionHandlers[t]}},isMultiAnim:!0,isProgressive:!1,isUnQuantizeInShader:!0,isLoadAllTextures:!1,preHandlerImageURI:null,preHandlerBufferURI:null,customMaterialCreator:null,ignoreTextureError:!1,forceCreateNewBuffer:!1,src:"",constructor:function(t,e){Object.assign(this,e),this.content=t},parse:function(t){var e=this;if(this.content instanceof ArrayBuffer){var n=this.content;if(r.convertUint8ArrayToString(new Uint8Array(n,0,4))===Pr.MAGIC)this.parseBinary(n);else{var i=r.convertUint8ArrayToString(new Uint8Array(n),!0);this.json=JSON.parse(i)}}else this.json=JSON.parse(this.content);return this.glTFVersion=parseFloat(this.json.asset.version),this.glTFVersion>=2&&(this.isGLTF2=!0),this.parseExtensionUsed(),this.loadResources(t).then((function(){return e.parseExtensions(e.json.extensions,null,{isGlobal:!0,methodName:"parseOnLoad"}),Promise.resolve()})).then((function(){return e.parseGeometries()})).then((function(){return e.parseScene()}))},parseExtensionUsed:function(){var t=this;this.extensionsUsed={},r.each(this.json.extensionsUsed,(function(e){t.extensionsUsed[e]=!0})),this.extensionsUsed.WEB3D_quantized_attributes||(this.isUnQuantizeInShader=!1)},getExtensionHandler:function(t){return this.extensionHandlers&&this.extensionHandlers[t]||Pr.extensionHandlers[t]},parseExtension:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=t[e],s=this.getExtensionHandler(e);return s&&s.parse?s.parse(r,this,n,i):n},parseExtensions:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.each(t,(function(t,r){if(!i.ignoreExtensions||!i.ignoreExtensions[r]){var s=n.getExtensionHandler(r),a=i.methodName||"parse";s&&s[a]&&(e=s[a](t,n,e,i))}})),e},isUseExtension:function(t,e){return!!(t&&t.extensions&&t.extensions[e])},parseBinary:function(t){this.isBinary=!0;var e,n=new DataView(t),i=n.getUint32(4,!0),s=n.getUint32(8,!0),a=12;if(i<2){var o=n.getUint32(a,!0);e=new Uint8Array(t,20,o),e=r.convertUint8ArrayToString(e,!0),this.json=JSON.parse(e),this.binaryBody=t.slice(20+o)}else{if(2!==i)throw new Error("Dont support glTF version ".concat(i));for(;as*r.BYTES_PER_ELEMENT)a.array=new r(a.buffer,a.byteOffset,a.byteLength/r.BYTES_PER_ELEMENT),i=new C(a.array,s,{offset:n.byteOffset||0,stride:a.byteStride,bufferViewId:a.id});else{var u,c=(n.byteOffset||0)+a.byteOffset;if(c%r.BYTES_PER_ELEMENT||this.forceCreateNewBuffer)u=new r(a.buffer.slice(c,c+o*r.BYTES_PER_ELEMENT));else u=new r(a.buffer,c,o);i=new C(u,s)}return n.sparse&&(i||(i=new C(new r(o),s)),i=this.sparseAccessorHandler(i,n.sparse)),i=this.parseExtensions(n.extensions,i,{isDecode:e,isAccessor:!0}),n.data=i,n.normalized&&(i.normalized=!0),i},getArrayByAccessor:function(t,e){var n=this.json.accessors[t];if(n.array)return n.array;var i=this.getAccessorData(t,e);if(!i.stride&&!i.offset&&1===i.size)return i.data;var r=[];return i.traverse((function(t){r.push(t.toArray?t.toArray():t)})),n.array=r,r},parseTechnique:function(t,e){var n=null;this.json.techniques&&(n=this.json.techniques[t.technique]),n&&n.states&&(n.states.enable.forEach((function(t){switch(t){case Lr:e.blend=!0;break;case Or:e.depthTest=!0;break;case Sr:e.cullFace=!0}})),r.each(n.states.functions,(function(t,n){switch(n){case"blendEquationSeparate":e.blendEquation=t[0],e.blendEquationAlpha=t[1];break;case"blendFuncSeparate":e.blendSrc=t[0],e.blendDst=t[1],e.blendSrcAlpha=t[2],e.blendDstAlpha=t[3];break;case"depthMask":e.depthMask=t[0];break;case"cullFace":e.cullFaceType=t[0];break;default:e[n]=t}})),e.cullFace?e.side=e.cullFaceType===Rr?yr:Rr:e.side=xr)},createMorphGeometry:function(t,e){var n=this,i=new Gn,s=i.targets={};return r.each(t.targets,(function(t){r.each(t,(function(t,e){var i=Cr[e].name;s[i]||(s[i]=[]);var r=n.getAccessorData(t,!0);s[i].push(r)}))})),i.weights=e||new Float32Array(t.targets.length),i},handlerGeometry:function(t,e){var n=void 0===e.mode?4:e.mode;if(e.extensions){var i=this.parseExtensions(e.extensions,null,{primitive:e,isPrimitive:!0});if(i)return i.mode=n,i}t||(t=new Z({mode:n})),"indices"in e&&(t.indices=this.getAccessorData(e.indices));var r=e.attributes;for(var s in r){var a=Cr[s];if(a){var o=!(this.isUnQuantizeInShader&&a.decodeMatName);t[a.name]=this.getAccessorData(r[s],o),o||(t[a.decodeMatName]=t[a.name].decodeMat,delete t[a.name].decodeMat)}else m.a.warn("Unknow attribute named ".concat(s,"!"))}return t},handlerSkinedMesh:function(t,e){if(e){var n,i=(e.jointNames||e.joints).length;e.bindShapeMatrix&&(n=(new o.a).fromArray(e.bindShapeMatrix));for(var r=this.getArrayByAccessor(e.inverseBindMatrices,!0),s=0;s0&&(i=Object.values(n)[0].animStatesList),i.length?new Ar({rootNode:this.node,animStatesList:i,validAnimationIds:s,clips:n}):null},parseScene:function(){var t=this;this.parseMaterials(),this.jointMap={},this.meshes=[],this.lights=[],this.node=new g({needCallChildUpdate:!1}),this.parseCameras();var e=this.json.scenes[this.getDefaultSceneName()];if(!e)return m.a.warn("GLTFParser:no scene!"),{node:this.node,meshes:[],cameras:[],lights:[],textures:[],materials:[]};e.nodes.forEach((function(e){return t.parseNode(e,t.node)})),this.node.resetSkinedMeshRootNode();var n={node:this.node,scene:this.node,meshes:this.meshes,json:this.json,cameras:Object.values(this.cameras),lights:this.lights,textures:Object.values(this.textures),materials:Object.values(this.materials)},i=this.parseAnimations();return i&&(this.node.setAnim(i),i.play(),n.anim=i),this.parseExtensions(e.extensions,null,{isScene:!0}),this.parseExtensions(this.json.extensions,n,{isGlobal:!0,methodName:"parseOnEnd"}),n},getDefaultSceneName:function(){return void 0!==this.defaultScene?this.defaultScene:this.json.scenes?Object.keys(this.json.scenes)[0]:null}}),wr=Pr,Hr=s.a.create({Extends:Ji,isGLTFLoader:!0,className:"GLTFLoader",constructor:function(){Hr.superclass.constructor.call(this)},load:function(t){var e=this;return this.loadRes(t.src,"buffer").then((function(n){return new wr(n,t).parse(e)})).catch((function(t){throw m.a.error("load gltf failed",t.message,t.stack),t}))}});tr.addLoader("gltf",Hr),tr.addLoader("glb",Hr);var Dr=Hr,Fr=n(106),Ur=n.n(Fr),Gr=P.a.RGBA,Br=P.a.NEAREST,Vr=P.a.CLAMP_TO_EDGE,Xr=P.a.FLOAT,jr=s.a.create({Extends:Ji,isHDRLoader:!0,className:"HDRLoader",constructor:function(){jr.superclass.constructor.call(this)},load:function(t){return this.loadRes(t.src,"buffer").then((function(e){try{var n=Ur()(e),i=n.shape,r=n.data,s=new qt({width:i[0],height:i[1],flipY:t.flipY||!1,image:r,type:Xr,magFilter:Br,minFilter:Br,wrapS:Vr,wrapT:Vr,internalFormat:Gr,format:Gr});return Object.assign(s,t),s}catch(t){m.a.error("HDRLoader:parse error => ",t)}return null}))}});tr.addLoader("hdr",jr);var zr=jr,kr=s.a.create({Statics:{HEADER_LEN:64,COMPRESSED_2D:0,COMPRESSED_3D:1,TEX_2D:2,TEX_3D:3},isKhronosTextureContainer:!0,className:"KhronosTextureContainer",constructor:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.arrayBuffer=t,this.baseOffset=n;var i=new Uint8Array(this.arrayBuffer,this.baseOffset,12);if(171===i[0]&&75===i[1]&&84===i[2]&&88===i[3]&&32===i[4]&&49===i[5]&&49===i[6]&&187===i[7]&&13===i[8]&&10===i[9]&&26===i[10]&&10===i[11]){var r=Uint32Array.BYTES_PER_ELEMENT,s=new DataView(this.arrayBuffer,this.baseOffset+12,13*r),a=s.getUint32(0,!0),o=67305985===a;this.glType=s.getUint32(1*r,o),this.glTypeSize=s.getUint32(2*r,o),this.glFormat=s.getUint32(3*r,o),this.glInternalFormat=s.getUint32(4*r,o),this.glBaseInternalFormat=s.getUint32(5*r,o),this.pixelWidth=s.getUint32(6*r,o),this.pixelHeight=s.getUint32(7*r,o),this.pixelDepth=s.getUint32(8*r,o),this.numberOfArrayElements=s.getUint32(9*r,o),this.numberOfFaces=s.getUint32(10*r,o),this.numberOfMipmapLevels=s.getUint32(11*r,o),this.bytesOfKeyValueData=s.getUint32(12*r,o),this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?0===this.glType?this.loadType=kr.COMPRESSED_2D:this.loadType=kr.TEX_2D:m.a.warn("number of faces expected"+e+", but found "+this.numberOfFaces):m.a.warn("texture arrays not currently supported"):m.a.warn("only 2D textures currently supported")}else m.a.error("texture missing KTX identifier")},mipmaps:function(t){for(var e=[],n=kr.HEADER_LEN+this.bytesOfKeyValueData,i=this.pixelWidth,r=this.pixelHeight,s=t?this.numberOfMipmapLevels:1,a=0;a2&&void 0!==arguments[2]?arguments[2]:0,i=new kr(e,1,n),r={compressed:0===i.glType,type:i.glType,width:i.pixelWidth,height:i.pixelHeight,internalFormat:i.glInternalFormat,format:i.glFormat,isCubemap:6===i.numberOfFaces};return i.numberOfMipmapLevels>=Math.floor(Math.log2(Math.max(r.width,r.height))+1)?(r.mipmaps=i.mipmaps(!0),r.image=r.mipmaps[0].data):(r.mipmaps=null,r.image=i.mipmaps(!1)[0].data),new qt(r)}});tr.addLoader("ktx",qr);var Wr=qr,Yr=s.a.create({Mixes:a.a,isLoadQueue:!0,className:"LoadQueue",Statics:{addLoader:function(t,e){m.a.warn("LoadQueue.addLoader is duplicated, please use Loader.addLoader"),tr.addLoader(t,e)}},constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){return t&&(t=Array.isArray(t)?t:[t],this._source=this._source.concat(t)),this},get:function(t){if(!t)return null;for(var e=this._source,n=0;n=n)this.fire("complete");else if(this._currentIndex2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=this.renderer.pixelRatio,s=[],a=this.framebuffer.readPixels(t*r,e*r,n*r,i*r),o=0;o0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=i*a,t[2]=r*a,t[3]=s*a),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t[2]=a+i*(n[2]-a),t[3]=o+i*(n[3]-o),t},e.random=function(t,e){var n,r,s,a,o,u;e=e||1;do{o=(n=2*i.RANDOM()-1)*n+(r=2*i.RANDOM()-1)*r}while(o>=1);do{u=(s=2*i.RANDOM()-1)*s+(a=2*i.RANDOM()-1)*a}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*r,t[2]=e*s*c,t[3]=e*a*c,t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*s+n[12]*a,t[1]=n[1]*i+n[5]*r+n[9]*s+n[13]*a,t[2]=n[2]*i+n[6]*r+n[10]*s+n[14]*a,t[3]=n[3]*i+n[7]*r+n[11]*s+n[15]*a,t},e.transformQuat=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2],c=n[3],h=c*i+o*s-u*r,f=c*r+u*i-a*s,l=c*s+a*r-o*i,d=-a*i-o*r-u*s;return t[0]=h*c+d*-a+f*-u-l*-o,t[1]=f*c+d*-o+l*-a-h*-u,t[2]=l*c+d*-u+h*-o-f*-a,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(n*n+i*i+r*r+s*s)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],s=e[3]-t[3];return n*n+i*i+r*r+s*s}function h(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.sqrt(e*e+n*n+i*i+r*r)}function f(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r}e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.len=h,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=4),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;u1?0:r<-1?Math.PI:Math.acos(r)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=e[0],o=e[1],u=e[2];return Math.abs(n-a)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-u)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(3);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function a(t,e,n){var r=new i.ARRAY_TYPE(3);return r[0]=t,r[1]=e,r[2]=n,r}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(n*n+i*i+r*r)}function f(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}function l(t){var e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i}function d(t,e){var n=e[0],i=e[1],r=e[2],s=n*n+i*i+r*r;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function m(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=h,e.sqrDist=f,e.len=s,e.sqrLen=l,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=3),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;ui.EPSILON?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=h,e.rotateX=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+a*o,t[1]=r*u+s*o,t[2]=s*u-r*o,t[3]=a*u-i*o,t},e.rotateY=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u-s*o,t[1]=r*u+a*o,t[2]=s*u+i*o,t[3]=a*u-r*o,t},e.rotateZ=function(t,e,n){n*=.5;var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+r*o,t[1]=r*u-i*o,t[2]=s*u+a*o,t[3]=a*u-s*o,t},e.calculateW=function(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t},e.slerp=f,e.random=function(t){var e=i.RANDOM(),n=i.RANDOM(),r=i.RANDOM(),s=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*n),t[1]=s*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*n+i*i+r*r+s*s,o=a?1/a:0;return t[0]=-n*o,t[1]=-i*o,t[2]=-r*o,t[3]=s*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=l,e.fromEuler=function(t,e,n,i){var r=.5*Math.PI/180;e*=r,n*=r,i*=r;var s=Math.sin(e),a=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(i),h=Math.cos(i);return t[0]=s*u*h-a*o*c,t[1]=a*o*h+s*u*c,t[2]=a*u*c-s*o*h,t[3]=a*u*h+s*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var i=o(n(0)),r=o(n(5)),s=o(n(2)),a=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function h(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*h+a*o+r*c-s*u,t[1]=r*h+a*u+s*o-i*c,t[2]=s*h+a*c+i*u-r*o,t[3]=a*h-i*o-r*u-s*c,t}function f(t,e,n,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=n[0],h=n[1],f=n[2],l=n[3],d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return(m=s*c+a*h+o*f+u*l)<0&&(m=-m,c=-c,h=-h,f=-f,l=-l),1-m>i.EPSILON?(d=Math.acos(m),_=Math.sin(d),p=Math.sin((1-r)*d)/_,g=Math.sin(r*d)/_):(p=1-r,g=r),t[0]=p*s+g*c,t[1]=p*a+g*h,t[2]=p*o+g*f,t[3]=p*u+g*l,t}function l(t,e){var n=e[0]+e[4]+e[8],i=void 0;if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var s=(r+1)%3,a=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*s+s]-e[3*a+a]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*s+a]-e[3*a+s])*i,t[s]=(e[3*s+r]+e[3*r+s])*i,t[a]=(e[3*a+r]+e[3*r+a])*i}return t}e.clone=a.clone,e.fromValues=a.fromValues,e.copy=a.copy,e.set=a.set,e.add=a.add,e.mul=h,e.scale=a.scale,e.dot=a.dot,e.lerp=a.lerp;var d=e.length=a.length,m=(e.len=d,e.squaredLength=a.squaredLength),_=(e.sqrLen=m,e.normalize=a.normalize);e.exactEquals=a.exactEquals,e.equals=a.equals,e.rotationTo=function(){var t=s.create(),e=s.fromValues(1,0,0),n=s.fromValues(0,1,0);return function(i,r,a){var o=s.dot(r,a);return o<-.999999?(s.cross(t,e,r),s.len(t)<1e-6&&s.cross(t,n,r),s.normalize(t,t),c(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(s.cross(t,r,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,_(i,i))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,i,r,s,a,o){return f(t,i,a,o),f(e,r,s,o),f(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=r.create();return function(e,n,i,r){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=r[0],t[4]=r[1],t[7]=r[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],_(e,l(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(16);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,r,s,a,o,u,c,h,f,l,d,m,_,p){var g=new i.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=s,g[5]=a,g[6]=o,g[7]=u,g[8]=c,g[9]=h,g[10]=f,g[11]=l,g[12]=d,g[13]=m,g[14]=_,g[15]=p,g},e.set=function(t,e,n,i,r,s,a,o,u,c,h,f,l,d,m,_,p){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t[9]=h,t[10]=f,t[11]=l,t[12]=d,t[13]=m,t[14]=_,t[15]=p,t},e.identity=r,e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],s=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=s,t[11]=e[14],t[12]=r,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,E=n*u-r*a,T=n*c-s*a,M=i*u-r*o,A=i*c-s*o,I=r*c-s*u,L=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-E*y+T*R+M*S-A*O+I*L;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(r*y-i*x-s*R)*N,t[2]=(_*I-p*A+g*M)*N,t[3]=(l*A-f*I-d*M)*N,t[4]=(u*S-a*x-c*O)*N,t[5]=(n*x-r*S+s*O)*N,t[6]=(p*T-m*I-g*E)*N,t[7]=(h*I-l*T+d*E)*N,t[8]=(a*y-o*S+c*L)*N,t[9]=(i*S-n*y-s*L)*N,t[10]=(m*A-_*T+g*v)*N,t[11]=(f*T-h*A-d*v)*N,t[12]=(o*O-a*R-u*L)*N,t[13]=(n*R-i*O+r*L)*N,t[14]=(_*E-m*M-p*v)*N,t[15]=(h*M-f*E+l*v)*N,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15];return t[0]=o*(l*g-d*p)-f*(u*g-c*p)+_*(u*d-c*l),t[1]=-(i*(l*g-d*p)-f*(r*g-s*p)+_*(r*d-s*l)),t[2]=i*(u*g-c*p)-o*(r*g-s*p)+_*(r*c-s*u),t[3]=-(i*(u*d-c*l)-o*(r*d-s*l)+f*(r*c-s*u)),t[4]=-(a*(l*g-d*p)-h*(u*g-c*p)+m*(u*d-c*l)),t[5]=n*(l*g-d*p)-h*(r*g-s*p)+m*(r*d-s*l),t[6]=-(n*(u*g-c*p)-a*(r*g-s*p)+m*(r*c-s*u)),t[7]=n*(u*d-c*l)-a*(r*d-s*l)+h*(r*c-s*u),t[8]=a*(f*g-d*_)-h*(o*g-c*_)+m*(o*d-c*f),t[9]=-(n*(f*g-d*_)-h*(i*g-s*_)+m*(i*d-s*f)),t[10]=n*(o*g-c*_)-a*(i*g-s*_)+m*(i*c-s*o),t[11]=-(n*(o*d-c*f)-a*(i*d-s*f)+h*(i*c-s*o)),t[12]=-(a*(f*p-l*_)-h*(o*p-u*_)+m*(o*l-u*f)),t[13]=n*(f*p-l*_)-h*(i*p-r*_)+m*(i*l-r*f),t[14]=-(n*(o*p-u*_)-a*(i*p-r*_)+m*(i*u-r*o)),t[15]=n*(o*l-u*f)-a*(i*l-r*f)+h*(i*u-r*o),t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8],h=t[9],f=t[10],l=t[11],d=t[12],m=t[13],_=t[14],p=t[15];return(e*a-n*s)*(f*p-l*_)-(e*o-i*s)*(h*p-l*m)+(e*u-r*s)*(h*_-f*m)+(n*o-i*a)*(c*p-l*d)-(n*u-r*a)*(c*_-f*d)+(i*u-r*o)*(c*m-h*d)},e.multiply=s,e.translate=function(t,e,n){var i=n[0],r=n[1],s=n[2],a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=void 0,g=void 0;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],u=e[2],c=e[3],h=e[4],f=e[5],l=e[6],d=e[7],m=e[8],_=e[9],p=e[10],g=e[11],t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=h,t[5]=f,t[6]=l,t[7]=d,t[8]=m,t[9]=_,t[10]=p,t[11]=g,t[12]=a*i+h*r+m*s+e[12],t[13]=o*i+f*r+_*s+e[13],t[14]=u*i+l*r+p*s+e[14],t[15]=c*i+d*r+g*s+e[15]),t},e.scale=function(t,e,n){var i=n[0],r=n[1],s=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,r){var s,a,o,u,c,h,f,l,d,m,_,p,g,v,E,T,M,A,I,L,O,S,R,y,x=r[0],N=r[1],b=r[2],C=Math.sqrt(x*x+N*N+b*b);return C0?(n[0]=2*(c*u+l*r+h*o-f*s)/d,n[1]=2*(h*u+l*s+f*r-c*o)/d,n[2]=2*(f*u+l*o+c*s-h*r)/d):(n[0]=2*(c*u+l*r+h*o-f*s),n[1]=2*(h*u+l*s+f*r-c*o),n[2]=2*(f*u+l*o+c*s-h*r)),a(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[4],a=e[5],o=e[6],u=e[8],c=e[9],h=e[10];return t[0]=Math.sqrt(n*n+i*i+r*r),t[1]=Math.sqrt(s*s+a*a+o*o),t[2]=Math.sqrt(u*u+c*c+h*h),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],i=0;return n>0?(i=2*Math.sqrt(n+1),t[3]=.25*i,t[0]=(e[6]-e[9])/i,t[1]=(e[8]-e[2])/i,t[2]=(e[1]-e[4])/i):e[0]>e[5]&&e[0]>e[10]?(i=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/i,t[0]=.25*i,t[1]=(e[1]+e[4])/i,t[2]=(e[8]+e[2])/i):e[5]>e[10]?(i=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/i,t[0]=(e[1]+e[4])/i,t[1]=.25*i,t[2]=(e[6]+e[9])/i):(i=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/i,t[0]=(e[8]+e[2])/i,t[1]=(e[6]+e[9])/i,t[2]=.25*i),t},e.fromRotationTranslationScale=function(t,e,n,i){var r=e[0],s=e[1],a=e[2],o=e[3],u=r+r,c=s+s,h=a+a,f=r*u,l=r*c,d=r*h,m=s*c,_=s*h,p=a*h,g=o*u,v=o*c,E=o*h,T=i[0],M=i[1],A=i[2];return t[0]=(1-(m+p))*T,t[1]=(l+E)*T,t[2]=(d-v)*T,t[3]=0,t[4]=(l-E)*M,t[5]=(1-(f+p))*M,t[6]=(_+g)*M,t[7]=0,t[8]=(d+v)*A,t[9]=(_-g)*A,t[10]=(1-(f+m))*A,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,i,r){var s=e[0],a=e[1],o=e[2],u=e[3],c=s+s,h=a+a,f=o+o,l=s*c,d=s*h,m=s*f,_=a*h,p=a*f,g=o*f,v=u*c,E=u*h,T=u*f,M=i[0],A=i[1],I=i[2],L=r[0],O=r[1],S=r[2],R=(1-(_+g))*M,y=(d+T)*M,x=(m-E)*M,N=(d-T)*A,b=(1-(l+g))*A,C=(p+v)*A,P=(m+E)*I,w=(p-v)*I,H=(1-(l+_))*I;return t[0]=R,t[1]=y,t[2]=x,t[3]=0,t[4]=N,t[5]=b,t[6]=C,t[7]=0,t[8]=P,t[9]=w,t[10]=H,t[11]=0,t[12]=n[0]+L-(R*L+N*O+P*S),t[13]=n[1]+O-(y*L+b*O+w*S),t[14]=n[2]+S-(x*L+C*O+H*S),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[1]=h+g,t[2]=l-p,t[3]=0,t[4]=h-g,t[5]=1-c-m,t[6]=d+_,t[7]=0,t[8]=l+p,t[9]=d-_,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,i,r,s,a){var o=1/(n-e),u=1/(r-i),c=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(r+i)*u,t[10]=(a+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*c,t[15]=0,t},e.perspective=function(t,e,n,i,r){var s=1/Math.tan(e/2),a=void 0;return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(a=1/(i-r),t[10]=(r+i)*a,t[14]=2*r*i*a):(t[10]=-1,t[14]=-2*i),t},e.perspectiveFromFieldOfView=function(t,e,n,i){var r=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+o),c=2/(r+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-o)*u*.5,t[9]=(r-s)*c*.5,t[10]=i/(n-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*n/(n-i),t[15]=0,t},e.ortho=function(t,e,n,i,r,s,a){var o=1/(e-n),u=1/(i-r),c=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(r+i)*u,t[14]=(a+s)*c,t[15]=1,t},e.lookAt=function(t,e,n,s){var a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,f=void 0,l=void 0,d=void 0,m=void 0,_=void 0,p=e[0],g=e[1],v=e[2],E=s[0],T=s[1],M=s[2],A=n[0],I=n[1],L=n[2];return Math.abs(p-A)0&&(h*=d=1/Math.sqrt(d),f*=d,l*=d);var m=u*l-c*f,_=c*h-o*l,p=o*f-u*h;return(d=m*m+_*_+p*p)>0&&(m*=d=1/Math.sqrt(d),_*=d,p*=d),t[0]=m,t[1]=_,t[2]=p,t[3]=0,t[4]=f*p-l*_,t[5]=l*m-h*p,t[6]=h*_-f*m,t[7]=0,t[8]=h,t[9]=f,t[10]=l,t[11]=0,t[12]=r,t[13]=s,t[14]=a,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t[9]=e[9]+n[9]*i,t[10]=e[10]+n[10]*i,t[11]=e[11]+n[11]*i,t[12]=e[12]+n[12]*i,t[13]=e[13]+n[13]*i,t[14]=e[14]+n[14]*i,t[15]=e[15]+n[15]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=t[9],d=t[10],m=t[11],_=t[12],p=t[13],g=t[14],v=t[15],E=e[0],T=e[1],M=e[2],A=e[3],I=e[4],L=e[5],O=e[6],S=e[7],R=e[8],y=e[9],x=e[10],N=e[11],b=e[12],C=e[13],P=e[14],w=e[15];return Math.abs(n-E)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(E))&&Math.abs(r-T)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(T))&&Math.abs(s-M)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(a-A)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(o-I)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(u-L)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(L))&&Math.abs(c-O)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(h-S)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-R)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(R))&&Math.abs(l-y)<=i.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(d-x)<=i.EPSILON*Math.max(1,Math.abs(d),Math.abs(x))&&Math.abs(m-N)<=i.EPSILON*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(_-b)<=i.EPSILON*Math.max(1,Math.abs(_),Math.abs(b))&&Math.abs(p-C)<=i.EPSILON*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(g-P)<=i.EPSILON*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(v-w)<=i.EPSILON*Math.max(1,Math.abs(v),Math.abs(w))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function s(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=e[9],d=e[10],m=e[11],_=e[12],p=e[13],g=e[14],v=e[15],E=n[0],T=n[1],M=n[2],A=n[3];return t[0]=E*i+T*o+M*f+A*_,t[1]=E*r+T*u+M*l+A*p,t[2]=E*s+T*c+M*d+A*g,t[3]=E*a+T*h+M*m+A*v,E=n[4],T=n[5],M=n[6],A=n[7],t[4]=E*i+T*o+M*f+A*_,t[5]=E*r+T*u+M*l+A*p,t[6]=E*s+T*c+M*d+A*g,t[7]=E*a+T*h+M*m+A*v,E=n[8],T=n[9],M=n[10],A=n[11],t[8]=E*i+T*o+M*f+A*_,t[9]=E*r+T*u+M*l+A*p,t[10]=E*s+T*c+M*d+A*g,t[11]=E*a+T*h+M*m+A*v,E=n[12],T=n[13],M=n[14],A=n[15],t[12]=E*i+T*o+M*f+A*_,t[13]=E*r+T*u+M*l+A*p,t[14]=E*s+T*c+M*d+A*g,t[15]=E*a+T*h+M*m+A*v,t}function a(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=i+i,u=r+r,c=s+s,h=i*o,f=i*u,l=i*c,d=r*u,m=r*c,_=s*c,p=a*o,g=a*u,v=a*c;return t[0]=1-(d+_),t[1]=f+v,t[2]=l-g,t[3]=0,t[4]=f-v,t[5]=1-(h+_),t[6]=m+p,t[7]=0,t[8]=l+g,t[9]=m-p,t[10]=1-(h+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=s,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(9);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new i.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,r,s,a,o,u,c){var h=new i.ARRAY_TYPE(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=r,h[4]=s,h[5]=a,h[6]=o,h[7]=u,h[8]=c,h},e.set=function(t,e,n,i,r,s,a,o,u,c){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],i=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=h*a-o*c,l=-h*s+o*u,d=c*s-a*u,m=n*f+i*l+r*d;return m?(m=1/m,t[0]=f*m,t[1]=(-h*i+r*c)*m,t[2]=(o*i-r*a)*m,t[3]=l*m,t[4]=(h*n-r*u)*m,t[5]=(-o*n+r*s)*m,t[6]=d*m,t[7]=(-c*n+i*u)*m,t[8]=(a*n-i*s)*m,t):null},e.adjoint=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-o*c,t[1]=r*c-i*h,t[2]=i*o-r*a,t[3]=o*u-s*h,t[4]=n*h-r*u,t[5]=r*s-n*o,t[6]=s*c-a*u,t[7]=i*u-n*c,t[8]=n*a-i*s,t},e.determinant=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8];return e*(c*s-a*u)+n*(-c*r+a*o)+i*(u*r-s*o)},e.multiply=r,e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=l*i+d*a+c,t[7]=l*r+d*o+h,t[8]=l*s+d*u+f,t},e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=Math.sin(n),d=Math.cos(n);return t[0]=d*i+l*a,t[1]=d*r+l*o,t[2]=d*s+l*u,t[3]=d*a-l*i,t[4]=d*o-l*r,t[5]=d*u-l*s,t[6]=c,t[7]=h,t[8]=f,t},e.scale=function(t,e,n){var i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n+n,o=i+i,u=r+r,c=n*a,h=i*a,f=i*o,l=r*a,d=r*o,m=r*u,_=s*a,p=s*o,g=s*u;return t[0]=1-f-m,t[3]=h-g,t[6]=l+p,t[1]=h+g,t[4]=1-c-m,t[7]=d-_,t[2]=l-p,t[5]=d+_,t[8]=1-c-f,t},e.normalFromMat4=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],f=e[9],l=e[10],d=e[11],m=e[12],_=e[13],p=e[14],g=e[15],v=n*o-i*a,E=n*u-r*a,T=n*c-s*a,M=i*u-r*o,A=i*c-s*o,I=r*c-s*u,L=h*_-f*m,O=h*p-l*m,S=h*g-d*m,R=f*p-l*_,y=f*g-d*_,x=l*g-d*p,N=v*x-E*y+T*R+M*S-A*O+I*L;return N?(N=1/N,t[0]=(o*x-u*y+c*R)*N,t[1]=(u*S-a*x-c*O)*N,t[2]=(a*y-o*S+c*L)*N,t[3]=(r*y-i*x-s*R)*N,t[4]=(n*x-r*S+s*O)*N,t[5]=(i*S-n*y-s*L)*N,t[6]=(_*I-p*A+g*M)*N,t[7]=(p*T-m*I-g*E)*N,t[8]=(m*A-_*T+g*v)*N,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=t[8],l=e[0],d=e[1],m=e[2],_=e[3],p=e[4],g=e[5],v=e[6],E=e[7],T=e[8];return Math.abs(n-l)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-d)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(s-m)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-_)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-p)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(u-g)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-v)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-E)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(f-T)<=i.EPSILON*Math.max(1,Math.abs(f),Math.abs(T))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],f=e[8],l=n[0],d=n[1],m=n[2],_=n[3],p=n[4],g=n[5],v=n[6],E=n[7],T=n[8];return t[0]=l*i+d*a+m*c,t[1]=l*r+d*o+m*h,t[2]=l*s+d*u+m*f,t[3]=_*i+p*a+g*c,t[4]=_*r+p*o+g*h,t[5]=_*s+p*u+g*f,t[6]=v*i+E*a+T*c,t[7]=v*r+E*o+T*h,t[8]=v*s+E*u+T*f,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=r,e.clone=function(t){var e=new i.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new i.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=s,e.multiply=a,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=f,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],i=e[1],r=n*n+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},e.lerp=function(t,e,n,i){var r=e[0],s=e[1];return t[0]=r+i*(n[0]-r),t[1]=s+i*(n[1]-s),t},e.random=function(t,e){e=e||1;var n=2*i.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t},e.transformMat2d=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},e.transformMat3=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t},e.transformMat4=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t},e.rotate=function(t,e,n,i){var r=e[0]-n[0],s=e[1]-n[1],a=Math.sin(i),o=Math.cos(i);return t[0]=r*o-s*a+n[0],t[1]=r*a+s*o+n[1],t},e.angle=function(t,e){var n=t[0],i=t[1],r=e[0],s=e[1],a=n*n+i*i;a>0&&(a=1/Math.sqrt(a));var o=r*r+s*s;o>0&&(o=1/Math.sqrt(o));var u=(n*r+i*s)*a*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],r=t[1],s=e[0],a=e[1];return Math.abs(n-s)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(r-a)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(){var t=new i.ARRAY_TYPE(2);return i.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)}function c(t,e){var n=e[0]-t[0],i=e[1]-t[1];return n*n+i*i}function h(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function f(t){var e=t[0],n=t[1];return e*e+n*n}e.len=h,e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=f,e.forEach=function(){var t=r();return function(e,n,i,r,s,a){var o,u=void 0;for(n||(n=2),i||(i=0),o=r?Math.min(r*n+i,e.length):e.length,u=i;u0){n=Math.sqrt(n);var i=e[0]/n,r=e[1]/n,s=e[2]/n,a=e[3]/n,o=e[4],u=e[5],c=e[6],h=e[7],f=i*o+r*u+s*c+a*h;t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=(o-i*f)/n,t[5]=(u-r*f)/n,t[6]=(c-s*f)/n,t[7]=(h-a*f)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],f=e[0],l=e[1],d=e[2],m=e[3],_=e[4],p=e[5],g=e[6],v=e[7];return Math.abs(n-f)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-l)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(s-d)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-m)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(o-_)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(u-p)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(p))&&Math.abs(c-g)<=i.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))&&Math.abs(h-v)<=i.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))};var i=a(n(0)),r=a(n(3)),s=a(n(4));function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var i=.5*n[0],r=.5*n[1],s=.5*n[2],a=e[0],o=e[1],u=e[2],c=e[3];return t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=i*c+r*u-s*o,t[5]=r*c+s*a-i*u,t[6]=s*c+i*o-r*a,t[7]=-i*a-r*o-s*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[4],u=n[5],c=n[6],h=n[7],f=e[4],l=e[5],d=e[6],m=e[7],_=n[0],p=n[1],g=n[2],v=n[3];return t[0]=i*v+a*_+r*g-s*p,t[1]=r*v+a*p+s*_-i*g,t[2]=s*v+a*g+i*p-r*_,t[3]=a*v-i*_-r*p-s*g,t[4]=i*h+a*o+r*c-s*u+f*v+m*_+l*g-d*p,t[5]=r*h+a*u+s*o-i*c+l*v+m*p+d*_-f*g,t[6]=s*h+a*c+i*u-r*o+d*v+m*g+f*p-l*_,t[7]=a*h-i*o-r*u-s*c+m*v-f*_-l*p-d*g,t}e.getReal=r.copy,e.setReal=r.copy,e.mul=c;var h=e.dot=r.dot,f=e.length=r.length,l=(e.len=f,e.squaredLength=r.squaredLength);e.sqrLen=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(6);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,r,s,a){var o=new i.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o[4]=s,o[5]=a,o},e.set=function(t,e,n,i,r,s,a){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=a,t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],u=n*s-i*r;return u?(u=1/u,t[0]=s*u,t[1]=-i*u,t[2]=-r*u,t[3]=n*u,t[4]=(r*o-s*a)*u,t[5]=(i*a-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=Math.sin(n),h=Math.cos(n);return t[0]=i*h+s*c,t[1]=r*h+a*c,t[2]=i*-c+s*h,t[3]=r*-c+a*h,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i*c,t[1]=r*c,t[2]=s*h,t[3]=a*h,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=i,t[1]=r,t[2]=s,t[3]=a,t[4]=i*c+s*h+o,t[5]=r*c+a*h+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=e[0],h=e[1],f=e[2],l=e[3],d=e[4],m=e[5];return Math.abs(n-c)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(r-h)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(s-f)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-l)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-d)<=i.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-m)<=i.EPSILON*Math.max(1,Math.abs(u),Math.abs(m))};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1],f=n[2],l=n[3],d=n[4],m=n[5];return t[0]=i*c+s*h,t[1]=r*c+a*h,t[2]=i*f+s*l,t[3]=r*f+a*l,t[4]=i*d+s*m+o,t[5]=r*d+a*m+u,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new i.ARRAY_TYPE(4);return i.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new i.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,r){var s=new i.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=n,s[3]=r,s},e.set=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],i=e[1],r=e[2],s=e[3],a=n*s-r*i;return a?(a=1/a,t[0]=s*a,t[1]=-i*a,t[2]=-r*a,t[3]=n*a,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=r,e.rotate=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=i*u+s*o,t[1]=r*u+a*o,t[2]=i*-o+s*u,t[3]=r*-o+a*u,t},e.scale=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1];return t[0]=i*o,t[1]=r*o,t[2]=s*u,t[3]=a*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,i){return t[2]=i[2]/i[0],n[0]=i[0],n[1]=i[1],n[3]=i[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=s,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],r=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=i.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-u)<=i.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(s-c)<=i.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=i.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t};var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function r(t,e,n){var i=e[0],r=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=i*o+s*u,t[1]=r*o+a*u,t[2]=i*c+s*h,t[3]=r*c+a*h,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=r,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var i=d(n(0)),r=d(n(9)),s=d(n(8)),a=d(n(5)),o=d(n(4)),u=d(n(3)),c=d(n(7)),h=d(n(6)),f=d(n(2)),l=d(n(1));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=i,e.mat2=r,e.mat2d=s,e.mat3=a,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=h,e.vec3=f,e.vec4=l}])},function(t,e,n){"use strict";var i=n(19),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i={};n.r(i),n.d(i,"POSITION",(function(){return u})),n.d(i,"NORMAL",(function(){return c})),n.d(i,"DEPTH",(function(){return h})),n.d(i,"DISTANCE",(function(){return f}));var r=n(35),s=n.n(r).a,a=n(36),o=n.n(a).a,u="POSITION",c="NORMAL",h="DEPTH",f="DISTANCE",l={webgl:s,webglExtensions:o,Hilo:i};Object.assign(l,s,o,i);e.a=l},function(t,e,n){"use strict";var i={},r={_cache:i,level:3,LEVEL_LOG:3,LEVEL_WARN:2,LEVEL_ERROR:1,LEVEL_NONE:0,log:function(){return this.level>=3&&console.log.apply(console,arguments),this},warn:function(){return this.level>=2&&console.warn.apply(console,arguments),this},error:function(){return this.level>=1&&console.error.apply(console,arguments),this},logOnce:function(t){return i["log_"+t]||(i["log_"+t]=!0,this.log.apply(this,Array.prototype.slice.call(arguments,1))),this},warnOnce:function(t){return i["warn_"+t]||(i["warn_"+t]=!0,this.warn.apply(this,Array.prototype.slice.call(arguments,1))),this},errorOnce:function(t){return i["error_"+t]||(i["error_"+t]=!0,this.error.apply(this,Array.prototype.slice.call(arguments,1))),this}};e.a=r},function(t,e,n){"use strict";n.r(e),n.d(e,"each",(function(){return p})),n.d(e,"getRelativePath",(function(){return d})),n.d(e,"convertUint8ArrayToString",(function(){return m})),n.d(e,"getExtension",(function(){return _})),n.d(e,"getIndexFromSortedArray",(function(){return g})),n.d(e,"insertToSortedArray",(function(){return v})),n.d(e,"padLeft",(function(){return E})),n.d(e,"getTypedArrayClass",(function(){return I})),n.d(e,"copyArrayData",(function(){return L})),n.d(e,"isStrOrNumber",(function(){return O})),n.d(e,"getTypedArrayGLType",(function(){return T})),n.d(e,"getBlobUrl",(function(){return y})),n.d(e,"isBlobUrl",(function(){return S})),n.d(e,"revokeBlobUrl",(function(){return R})),n.d(e,"isArrayLike",(function(){return x})),n.d(e,"getElementRect",(function(){return N})),n.d(e,"serialRun",(function(){return b})),n.d(e,"hasOwnProperty",(function(){return C}));var i=n(3),r=n(2);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a,o=r.a.BYTE,u=r.a.UNSIGNED_BYTE,c=r.a.SHORT,h=r.a.UNSIGNED_SHORT,f=r.a.UNSIGNED_INT,l=r.a.FLOAT;function d(t,e){if(/^(?:http|blob|data:|\/)/.test(e))return e;var n;for(t=t.replace(/\/[^/]*?$/,"").split("/"),e=e.split("/"),n=0;n>1,a=n(t[s],e);if(0===a)return[s,s];a<0?i=s+1:r=s-1}return i>r?[r,i]:[i,r]}function v(t,e,n){var i=g(t,e,n);t.splice(i[1],0,e)}function E(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?l:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?h:t instanceof Uint32Array?f:l}var M,A,I=(s(M={},o,Int8Array),s(M,u,Uint8Array),s(M,c,Int16Array),s(M,h,Uint16Array),s(M,f,Uint32Array),s(M,l,Float32Array),A=M,function(t){return A[t]||Float32Array});function L(t,e,n,i,r){if(t&&e){e.isGeometryData&&(e=e.data);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,i){return t.then((function(){return e(n,i)}))}),Promise.resolve())}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec3.round(this.elements,this.elements),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this},random:function(t){return i.vec3.random(this.elements,t),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i,r={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(i=0,function(t){var e=++i;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=r},function(t,e,n){"use strict";var i,r=n(0),s=n(1),a=n(5),o=n(10),u=new a.a,c=new a.a,h=s.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=r.mat4.create()},copy:function(t){return r.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this},identity:function(){return r.mat4.identity(this.elements),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,i){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],h=n[1],f=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=h*m-f*d,g=f*l-o*m,v=o*d-h*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=h*m-f*d)*p+(g=f*l-(o+=1e-7)*m)*g+(v=o*d-h*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new h),this.determinant()<0&&(n.x*=-1),i.copy(this),u.inverse(n),i.scale(u),t.fromMat4(i),r&&r.set(0,0,0),this}});h.prototype.sub=h.prototype.subtract,h.prototype.mul=h.prototype.multiply,e.a=h},function(t,e,n){"use strict";var i=n(1),r=n(12),s=n(4),a=i.a.create({Extends:r.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;a.superclass.constructor.call(this,t,e,n,i)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(s.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(s.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=a},function(t,e,n){"use strict";var i=n(37),r=n.n(i);e.a=r.a},function(t,e,n){"use strict";var i=n(0),r=n(11),s=n(1),a=n(9),o=new r.a,u=s.a.create({Mixes:a.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=i.quat.fromValues(t,e,n,r)},copy:function(t,e){return i.quat.copy(this.elements,t.elements),e||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=this.elements;return i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],n||this.fire("update"),this},set:function(t,e,n,r,s){return i.quat.set(this.elements,t,e,n,r),s||this.fire("update"),this},identity:function(t){return i.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,e,n){return i.quat.rotationTo(this.elements,t.elements,e.elements),n||this.fire("update"),this},setAxes:function(t,e,n,r){return i.quat.setAxes(this.elements,t.elements,e.elements,n.elements),r||this.fire("update"),this},setAxisAngle:function(t,e,n){return i.quat.setAxisAngle(this.elements,t.elements,e),n||this.fire("update"),this},getAxisAngle:function(t){return i.quat.getAxisAngle(t.elements,this.elements)},add:function(t,e){return i.quat.add(this.elements,this.elements,t.elements),e||this.fire("update"),this},multiply:function(t,e){return i.quat.multiply(this.elements,this.elements,t.elements),e||this.fire("update"),this},premultiply:function(t,e){return i.quat.multiply(this.elements,t.elements,this.elements),e||this.fire("update"),this},scale:function(t,e){return i.quat.scale(this.elements,this.elements,t),e||this.fire("update"),this},rotateX:function(t,e){return i.quat.rotateX(this.elements,this.elements,t),e||this.fire("update"),this},rotateY:function(t,e){return i.quat.rotateY(this.elements,this.elements,t),e||this.fire("update"),this},rotateZ:function(t,e){return i.quat.rotateZ(this.elements,this.elements,t),e||this.fire("update"),this},calculateW:function(t){return i.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return i.quat.dot(this.elements,t.elements)},lerp:function(t,e,n){return i.quat.lerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},slerp:function(t,e,n){return i.quat.slerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},sqlerp:function(t,e,n,r,s,a){return i.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,r.elements,s),a||this.fire("update"),this},invert:function(t){return i.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return i.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return i.quat.length(this.elements)},squaredLength:function(){return i.quat.squaredLength(this.elements)},normalize:function(t){return i.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,e){return i.quat.fromMat3(this.elements,t.elements),e||this.fire("update"),this},fromMat4:function(t,e){return o.fromMat4(t),this.fromMat3(o,e),this},exactEquals:function(t){return i.quat.exactEquals(this.elements,t.elements)},equals:function(t){return i.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,i=.5*t.y,r=.5*t.z,s=t.order||"ZYX",a=Math.sin(n),o=Math.cos(n),u=Math.sin(i),c=Math.cos(i),h=Math.sin(r),f=Math.cos(r),l=this.elements;return"XYZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"YXZ"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"ZXY"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f-a*u*h):"ZYX"===s?(l[0]=a*c*f-o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f+a*u*h):"YZX"===s?(l[0]=a*c*f+o*u*h,l[1]=o*u*f+a*c*h,l[2]=o*c*h-a*u*f,l[3]=o*c*f-a*u*h):"XZY"===s&&(l[0]=a*c*f-o*u*h,l[1]=o*u*f-a*c*h,l[2]=o*c*h+a*u*f,l[3]=o*c*f+a*u*h),e||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});u.prototype.mul=u.prototype.multiply,u.prototype.len=u.prototype.length,u.prototype.sqrLen=u.prototype.squaredLength,e.a=u},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=i.mat3.create()},copy:function(t){return i.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)t[e+i]=n[i];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<9;i++)n[i]=t[e+i];return this},set:function(t,e,n,r,s,a,o,u,c){return i.mat3.set(this.elements,t,e,n,r,s,a,o,u,c),this},identity:function(){return i.mat3.identity(this.elements),this},transpose:function(){return i.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return i.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return i.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return i.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return i.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return i.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return i.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return i.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return i.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return i.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,i,r){var s=Math.cos(t),a=Math.sin(t);return this.set(i*s,-r*a,0,i*a,r*s,0,e,n,1),this}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,e.a=r},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=i.vec4.fromValues(t,e,n,r)},copy:function(t){return i.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,r){return i.vec4.set(this.elements,t,e,n,r),this},add:function(t,e){return e||(e=t,t=this),i.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec4.ceil(this.elements,this.elements),this},floor:function(){return i.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec4.round(this.elements,this.elements),this},scale:function(t){return i.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec4.squaredDistance(t.elements,e.elements)},length:function(){return i.vec4.length(this.elements)},squaredLength:function(){return i.vec4.squaredLength(this.elements)},negate:function(){return i.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec4.inverse(this.elements,t.elements),this},normalize:function(){return i.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return i.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return i.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return i.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e,n){"use strict";var i=n(1),r=n(6),s=n(7),a=n(3),o=new s.a,u=r.a.DEG2RAD,c=r.a.RAD2DEG,h=i.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,i=n[0],s=n[1],o=n[2],u=n[4],c=n[5],h=n[6],f=n[8],l=n[9],d=n[10];e=e||this.order,this.order=e;var m=r.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(m(f,-1,1)),Math.abs(f)<.99999?(this.elements[0]=Math.atan2(-l,d),this.elements[2]=Math.atan2(-u,i)):(this.elements[0]=Math.atan2(h,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-m(l,-1,1)),Math.abs(l)<.99999?(this.elements[1]=Math.atan2(f,d),this.elements[2]=Math.atan2(s,c)):(this.elements[1]=Math.atan2(-o,i),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(m(h,-1,1)),Math.abs(h)<.99999?(this.elements[1]=Math.atan2(-o,d),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(s,i))):"ZYX"===e?(this.elements[1]=Math.asin(-m(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(h,d),this.elements[2]=Math.atan2(s,i)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(m(s,-1,1)),Math.abs(s)<.99999?(this.elements[0]=Math.atan2(-l,c),this.elements[1]=Math.atan2(-o,i)):(this.elements[0]=0,this.elements[1]=Math.atan2(f,d))):"XZY"===e?(this.elements[2]=Math.asin(-m(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(h,c),this.elements[1]=Math.atan2(f,i)):(this.elements[0]=Math.atan2(-l,d),this.elements[1]=0)):a.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=h},function(t,e,n){"use strict";var i=n(0),r=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=i.vec2.fromValues(t,e)},copy:function(t){return i.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return i.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),i.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),i.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),i.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return i.vec2.ceil(this.elements,this.elements),this},floor:function(){return i.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),i.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),i.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return i.vec2.round(this.elements,this.elements),this},scale:function(t){return i.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),i.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec2.squaredDistance(t.elements,e.elements)},length:function(){return i.vec2.length(this.elements)},squaredLength:function(){return i.vec2.squaredLength(this.elements)},negate:function(){return i.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),i.vec2.inverse(this.elements,t.elements),this},normalize:function(){return i.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),i.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return i.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return i.vec2.random(this.elements,t),this},transformMat3:function(t){return i.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return i.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});r.prototype.sub=r.prototype.subtract,r.prototype.mul=r.prototype.multiply,r.prototype.div=r.prototype.divide,r.prototype.dist=r.prototype.distance,r.prototype.sqrDist=r.prototype.squaredDistance,r.prototype.len=r.prototype.length,r.prototype.sqrLen=r.prototype.squaredLength,e.a=r},function(t,e){t.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){function i(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.indices=e,this.mode=n,this.attrs=[],this.attrIndexMap={}}return r(t,null,[{key:"cp",value:function(t){return t}},{key:"minus",value:function(t,e){return t-e}},{key:"plus",value:function(t,e){return t+e}},{key:"pp",value:function(t,e,n,i){return i-e-n+t}},{key:"depp",value:function(t,e,n,i){return e+n-t+i}},{key:"ATTR",get:function(){return a}},{key:"ATTR_NAME_ID",get:function(){return u}}]),r(t,[{key:"getAttrLength",value:function(){return this.attrs[0].data.length/this.attrs[0].itemCount}},{key:"attrIdToName",value:function(t){return o[t]||"OTHER"}},{key:"addAttr",value:function(t,e,n){a[t]?(this.attrIndexMap[t]=this.attrs.length,n||(n=f[t])):n||(n=1),this.attrs.push({name:t,itemCount:n,data:e})}},{key:"getAttr",value:function(t){if(this.attrIndexMap[t])return this.attrs[this.attrIndexMap[t]];for(var e=this.attrs.length-1;e>=0;e--){var n=this.attrs[e];if(n.name===t)return n}}},{key:"cal",value:function(t,e,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),s=3;s=0;c--)o[u+c]=n.apply(null,r.map((function(t){return a[t*i.itemCount+c]})))}))}},{key:"quantize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attrs.forEach((function(e){if("JOINT"!==e.name&&0!=t[e.name]){var n=s.encode(e.data,t[e.name]||12);e.quantizationBit=n.quantizationBit,e.min=n.min,e.max=n.max,e.data=n.data}}))}},{key:"dequantize",value:function(){this.attrs.forEach((function(t){t.quantizationBit&&(t.data=s.decode(t.data,t.quantizationBit,t.min,t.max))}))}},{key:"convertTypedArray",value:function(){!this.indices||this.indices instanceof Array||(this.indices=Array.from(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array||t.data instanceof Float32Array||(t.data=Array.from(t.data))}))}},{key:"clearEBAttrs",value:function(){delete this.clers,delete this.holes,delete this.handles}},{key:"convertToTypedArray",value:function(){this.indices instanceof Array&&(this.getAttrLength()>65535?this.indices=new Uint32Array(this.indices):this.indices=new Uint16Array(this.indices)),this.attrs.forEach((function(t){t.data instanceof Array&&(t.data=new Float32Array(t.data))}))}},{key:"prepareToWorkerSend",value:function(){return this.clearEBAttrs(),this.convertToTypedArray(),this.getAllBuffers()}},{key:"clone",value:function(){var e=new t(Array.from(this.indices),this.mode);return Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=Array.from(e.data),e})),e}},{key:"cloneStruct",value:function(){var e=new t;return e.mode=this.mode,this.indices&&(e.indices=[]),Object.assign(e.attrIndexMap,this.attrIndexMap),e.attrs=this.attrs.map((function(t){var e=Object.assign({},t);return e.data=[],e})),e}},{key:"toHilo3dGeometry",value:function(t,e){var n=e||new t.Geometry;return this.indices&&(this.indices.BYTES_PER_ELEMENT?n.indices=new t.GeometryData(this.indices,1):this.getAttrLength()>65535?n.indices=new t.GeometryData(new Uint32Array(this.indices),1):n.indices=new t.GeometryData(new Uint16Array(this.indices),1)),this.attrs.forEach((function(e){var i=c[e.name];i&&(e.data.BYTES_PER_ELEMENT?n[i]=new t.GeometryData(e.data,e.itemCount):n[i]=new t.GeometryData(new Float32Array(e.data),e.itemCount))})),n}},{key:"getAllBuffers",value:function(){var t=[];return this.indices.BYTES_PER_ELEMENT&&t.push(this.indices.buffer),this.attrs.forEach((function(e){e.data&&e.data.BYTES_PER_ELEMENT&&t.push(e.data.buffer)})),t}}],[{key:"fromGLTFPrimitive",value:function(e){var n=new t(e.indices,e.mode),i=e.attributes,r=0;for(var s in i.POSITION&&(r=i.POSITION.length/3),i)if(a[s]){var o=f[a[s]];r&&(o=i[s].length/r),n.addAttr(a[s],i[s],o)}else console.warn("Dont support attribute",s);return n}},{key:"fromHilo3dGeometry",value:function(e){var n=new t(e.indices.data,e.mode);for(var i in h)e[i]&&n.addAttr(h[i],e[i].data,e[i].size);return n}}]),t}();t.exports=l},function(t,e){var n={};function i(t){return n[t]||(n[t]=Math.pow(2,t)-1),n[t]}t.exports={cal:function(t,e,n,r){var s=i(r),a=n-e;return Math.round((t-e)/a*s)},encode:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=t.length,r=i(e),s=1/0,a=-1/0,o=0;o1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:8,a=t.length,o=i(s),u=r-n||1,c=0;c1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=t.length,a=i(e),o=r-n,u=new Float32Array(s),c=0;c1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,i=t.length,r=0;r1&&void 0!==arguments[1]?arguments[1]:0;return t instanceof Uint8Array&&(e=t.byteOffset,t=t.buffer),function(t){return new u[t.type](t).decompress()}(function(t,e){var n=new Uint8Array(t,e,4);if(65!==n[0]||77!==n[1]||67!==n[2])throw new Error("The file is not AMC format!");var i=c[n[3]].read(t,e+4);return i.geometry.type=n[3],i.geometry}(t,e))}var f,l=null,d=null;function m(t,e){return!l&&o()?(l=new a({wasmURL:t,memPages:e}),d=l.init()):d||Promise.resolve()}function _(t,e,n){if(l||m(e,n),!l||!l.isReady)return h(t);try{return l.decompress(t)}catch(e){return console.warn("wasm decompress error",e),h(t)}}var p=null;function g(t){return t=t||"https://g.alicdn.com/hilo/amc/0.1.27/worker.js",p||(!1===f||"undefined"==typeof Worker?Promise.reject("dont support web worker"):p=/^(?:http|blob|data:|\/\/)/.test(t)?new Promise((function(e,n){var i=new XMLHttpRequest;i.addEventListener("load",(function(){if("undefined"==typeof URL||"undefined"==typeof Blob)f=new Worker("data:application/javascript, ".concat(this.responseText));else{var t=URL.createObjectURL(new Blob([this.responseText]));f=new Worker(t)}f.onerror=function(t){console.log("web worker error",t),f=!1,n(t)},e(f)})),i.addEventListener("error",(function(t){return n(t)})),i.open("get",t,!0),i.send()})):new Promise((function(e,n){(f=new Worker(t)).onerror=function(t){console.log("web worker init error",t),f=!1,n(t)},e(f)})))}var v=0;function E(t,e,n,r){return e=e&&o(),t=new Uint8Array(t),g(r).then((function(r){return new Promise((function(s,a){var o=v++,u=function(e){if(e.data.id===o)if(r.removeEventListener("message",u),u=null,e.data.data){var n=e.data.data;n.constructor=i,n.__proto__=i.prototype,s(n)}else s(h(t))};r.addEventListener("message",u),r.postMessage({id:o,data:t,useWASM:e,wasmURL:n},[t.buffer])}))})).catch((function(i){return e?_(t,n):h(t)}))}t.exports={initWASM:m,initWorker:g,decompress:function(t,e,n){var i=o();return!i||t.byteLength>1048576?E(t,i,e,n):i?Promise.resolve(_(t,e)):Promise.resolve(h(t))},decompressWithJS:h,decompressWithWASM:_,decompressWithWorker:E,destory:function(){f&&(f.terminate(),f=null,p=null),l&&(l=null,d=null)}}},function(t,e,n){function i(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=0;n-=2)e[t[n]]=t[n-1]}},{key:"mapBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex,r=this.currentVertex-n+1,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i,i=r,e[this.prevCorner(t[s])]=r++;this.currentVertex-=n}},{key:"mapHoleBoundary",value:function(t){for(var e=this.indices,n=t.length,i=this.currentVertex-n+1,r=i,s=n-1;s>=0;s--)e[this.nextCorner(t[s])]=i++,e[this.prevCorner(t[s])]=s?i:r;this.currentVertex-=n}},{key:"fixNegativeIndex",value:function(t){for(var e=t,n=this.indices;n[t]<0;){if(e===-n[-n[t]]||n[t]===n[-n[t]]){console.warn("dead loop bug!!"),n[s]=0;break}n[t]=n[-n[t]]}}},{key:"fixIndicesAndReadVertice",value:function(){for(var t,e=this.indices,n=this.handlesMap,i=this.clers,r=i.length,s=-1,a=[],u=0,c=0;u1&&void 0!==arguments[1]?arguments[1]:-1;if(!this.readedVertexMap[t]&&(this.readedVertexMap[t]=1,!this.noParallelogramPrediction)){var n=this.indices,i=this.geometry;-1===e?void 0!==this.lastReadVertexIndex&&i.cal(i,t,a.plus,this.lastReadVertexIndex,t):i.cal(i,t,a.depp,n[e],n[this.prevCorner(e)],n[this.nextCorner(e)],t),this.lastReadVertexIndex=t}}},{key:"markCorner",value:function(t,e){var n=this.indices;void 0===n[this.nextCorner(t)]&&(n[this.nextCorner(t)]=-this.prevCorner(e[0])),void 0===n[this.prevCorner(t)]&&(n[this.prevCorner(t)]=-this.nextCorner(e[e.length-1]))}},{key:"onFaceC",value:function(t){var e=this.indices,n=3*this.currentFace,i=this.currentVertex--;e[n]=i;var r=t.pop();return e[this.nextCorner(r)]=i,e[this.prevCorner(r)]=-this.nextCorner(t[t.length-1]),r=t.shift(),e[this.prevCorner(r)]=i,e[this.nextCorner(r)]=-this.prevCorner(t[0]),t.push(n),t}},{key:"onFaceL",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.unshift(e+2),t.push(e),t}},{key:"onFaceF",value:function(t,e){return t&&this.mapBoundary(t),this.onFaceE(null,e)}},{key:"onFaceE",value:function(t,e){var n=3*this.currentFace;return t&&e.push(t),[n+2,n+1,n]}},{key:"onFaceR",value:function(t){var e=3*this.currentFace;return this.markCorner(t.pop(),t),t.push(e+1,e),t}},{key:"onHandleEnd",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=this.handlesMap[this.currentFace],a=e.splice(0,t);return e.shift(),n.push(a),i[this.nextCorner(s)]=-(r+1),i[this.prevCorner(s)]=-this.nextCorner(a[a.length-1]),i[r]=-this.prevCorner(a[0]),e.push(r),e}},{key:"onHandleStart",value:function(t,e){for(var n,r=this.indices,s=3*this.currentFace,a=this.handlesMap[this.currentFace],o=e.length-1;o>=0;o--){var u=e[o].indexOf(a);if(u>=0){var c,h=(n=e.splice(o,1)[0]).splice(0,u);n.shift(),(c=n).push.apply(c,i(h));break}}return r[this.nextCorner(a)]=-(s+1),r[this.prevCorner(a)]=-this.nextCorner(n[n.length-1]),r[s]=-this.prevCorner(t[0]),(t=n.concat(t)).push(s),t}},{key:"onFaceS",value:function(t,e,n){var i=this.handlesMap,r=this.indices,s=3*this.currentFace;if(i[this.currentFace]){this.markCorner(t.pop(),t);var a=t.indexOf(i[this.currentFace]);t=a>=0?this.onHandleEnd(a,t,n):this.onHandleStart(t,n)}else{var o=t.pop();this.markCorner(o,t),r[s]=-this.nextCorner(o);var u=e.pop();this.markCorner(u.pop(),u),(t=u.concat(t)).push(s)}return t}},{key:"onFaceM",value:function(t,e,n){var i=this.indices,r=3*this.currentFace,s=t.splice(0,this.holes[this.currentHole--]);this.mapHoleBoundary(s);var a=i[this.prevCorner(s[0])];i[r]=a;var o=t.pop();return i[this.prevCorner(o)]=-this.nextCorner(t[t.length-1]),i[this.nextCorner(o)]=a,o=t.shift(),i[this.prevCorner(o)]=a,i[this.nextCorner(o)]=-this.prevCorner(t[0]),t.push(r),t}},{key:"decompress",value:function(){this.readedVertexMap=new Uint8Array(this.vertexCount);var t=this.faceCount,e=this.indices=new Array(3*t);this.currentFace=t-1,this.currentVertex=this.vertexCount-1,this.currentHole=this.holes.length-1;for(var n,i=this.clers,r=[],s=[];this.currentFace>=0;){var a="onFace"+u[i[this.currentFace]];this[a]?n=this[a](n,r,s):console.warn("has no ".concat(a)),this.currentFace--}return this.mapBoundary(n),this.fixIndicesAndReadVertice(this.indices),this.geometry.indices=e,this.geometry.dequantize(),this.geometry}},{key:"_onDecompressFace",value:function(t,e){this.onDecompressFace&&this.onDecompressFace(t,e)}}])&&r(e.prototype,n),t}();t.exports=c},function(t,e){var n={C:0,R:1,L:2,S:3,E:4,M:5,F:6},i=[];for(var r in n)i[n[r]]=r;n.map=i,t.exports=n},function(t,e,n){var i=n(0);function r(t,e,n,i){return new t(e.slice(n,n+i*t.BYTES_PER_ELEMENT))}t.exports={read:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new DataView(t),s=new i,a=function(t,e){var n={};return n.version=t.getUint8(e++),n.faceCount=t.getUint32(e,!0),e+=4,n.vertexCount=t.getUint32(e,!0),e+=4,n.attrCount=t.getUint8(e++),n.noParallelogramPrediction=t.getUint8(e++),n.holesCount=t.getUint16(e,!0),e+=2,n.handlesCount=t.getUint16(e,!0),e+=2,n.headerBytes=15,n}(n,e);return e+=a.headerBytes,s.mode="CLERS",e=function(t,e,n,i){for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.wasmURL=e.wasmURL||"https://ossgw.alicdn.com/tmall-c3/tmx/70b8d82ccf33e97a124e54c2d6a3e0c7.wasm",this.memPages=e.memPages||256,this.memPages<256&&(this.memPages=256),this.isReady=!1}var e,n;return e=t,(n=[{key:"initASMJS",value:function(){this.isReady=!0,this.dv=new DataView(HEAP8.buffer),this.heap8=HEAP8,this.ins={exports:{__Z7AMCinitj:Module.__Z7AMCinitj,__Z12AMDecompressv:Module.__Z12AMDecompressv}}}},{key:"init",value:function(){var t=this,e=this.memory=new WebAssembly.Memory({initial:this.memPages});this.dv=new DataView(e.buffer);var n=this.heap8=new Uint8Array(e.buffer),i={global:{NaN:5,Infinity:6},env:{memoryBase:0,memory:e,_malloc:function(){return 2097152},_memset:function(t,e,i){return n.fill(e,t,t+i),t},_printf:function(t,e){for(var i=t;n[i];)i++;var r=String.fromCharCode.apply(String,function(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e65536?new Uint32Array(d):new Uint16Array(d);var m=new r(d);return h.forEach((function(t){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(t,3),i=n[0],r=n[1],s=n[2],a=new Float32Array(e.buffer.slice(s,s+u*r*4));m.addAttr(m.attrIdToName(i),a,r)})),m}}])&&i(e.prototype,n),t}();t.exports=s},function(t,e){var n;t.exports=function(){return void 0===n&&(n=function(){if("undefined"==typeof WebAssembly||"undefined"==typeof fetch||function(){if(!/iPad|iPhone|iPod/i.test(navigator.userAgent))return!1;if(/OS (\d+)_(\d+)_?(\d+)?/i.test(navigator.userAgent)){var t=Number(RegExp.$1),e=Number(RegExp.$2);if(11===t&&e>=3||t>11)return!1}return!0}())return!1;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)}catch(t){return console.log("err while check WebAssembly",t),!1}}()),n}}])},function(t,e,n){"use strict";var i=n(38),r=n.n(i),s=n(1),a=n(5),o=s.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new r.a,this.origin=t.origin||new a.a(0,0,0),this.direction=t.direction||new a.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,i,r){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,i,r)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,i,r)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,i){return n.squaredDistance(t[e])-n.squaredDistance(i[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new a.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var i=n(0),r=n(1),s=n(9),a=n(5),o=r.a.create({Mixes:s.a,Extends:a.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=i.vec3.fromValues(t,e,n)},copy:function(t){return i.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.fire("update"),this},set:function(t,e,n){return i.vec3.set(this.elements,t,e,n),this.fire("update"),this},add:function(t,e){return e||(e=t,t=this),i.vec3.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),i.vec3.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},multiply:function(t,e){return e||(e=t,t=this),i.vec3.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},divide:function(t,e){return e||(e=t,t=this),i.vec3.divide(this.elements,t.elements,e.elements),this.fire("update"),this},ceil:function(){return i.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return i.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,e){return e||(e=t,t=this),i.vec3.min(this.elements,t.elements,e.elements),this.fire("update"),this},max:function(t,e){return e||(e=t,t=this),i.vec3.max(this.elements,t.elements,e.elements),this.fire("update"),this},round:function(){return i.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return i.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),i.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.fire("update"),this},distance:function(t,e){return e||(e=t,t=this),i.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),i.vec3.squaredDistance(t.elements,e.elements)},length:function(){return i.vec3.length(this.elements)},squaredLength:function(){return i.vec3.squaredLength(this.elements)},negate:function(){return i.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),i.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return i.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,e){return e||(e=t,t=this),i.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),i.vec3.cross(this.elements,t.elements,e.elements),this.fire("update"),this},lerp:function(t,e){return i.vec3.lerp(this.elements,this.elements,t.elements,e),this.fire("update"),this},hermite:function(t,e,n,r,s){return i.vec3.hermite(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},bezier:function(t,e,n,r,s){return i.vec3.bezier(this.elements,t.elements,e.elements,n.elements,r.elements,s),this.fire("update"),this},random:function(t){return i.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return i.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return i.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var e=this.elements,n=t.elements,i=e[0],r=e[1],s=e[2];return e[0]=i*n[0]+r*n[4]+s*n[8],e[1]=i*n[1]+r*n[5]+s*n[9],e[2]=i*n[2]+r*n[6]+s*n[10],this.fire("update"),this},transformQuat:function(t){return i.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,e){return i.vec3.rotateX(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateY:function(t,e){return i.vec3.rotateY(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateZ:function(t,e){return i.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),i.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});e.a=o},function(t,e){t.exports="#define GLSLIFY 1\n#define HILO_FRONT_SIDE 1028\n#define HILO_BACK_SIDE 1029\n#define HILO_FRONT_AND_BACK_SIDE 1032\n#define HILO_PI 3.141592653589793\n#define HILO_INVERSE_PI 0.3183098861837907"},function(t,e){var n=function(){var t,e,n=function(t){var e,n,r={};for(e in t)n=t[e],i.hasOwnProperty(e)?i[e].call(this,n):r[e]=n;s(this.prototype,r)},i={Extends:function(t){var e=this.prototype,n=r(t.prototype);s(this,t),s(n,e),n.constructor=this,this.prototype=n,this.superclass=t.prototype},Mixes:function(t){t instanceof Array||(t=[t]);for(var e,n=this.prototype;e=t.shift();)s(n,e.prototype||e)},Statics:function(t){s(this,t)}},r=function(){if(Object.__proto__)return function(t){return{__proto__:t}};var t=function(){};return function(e){return t.prototype=e,new t}}(),s=function(t){for(var n=1,i=arguments.length;n0&&void 0!==arguments[0]?arguments[0]:new r.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,i){return this.normal.set(t,e,n),this.distance=i,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new r.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=s},function(t,e,n){"use strict";var i=n(1),r=n(5),s=new r.a,a=i.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new r.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,i=0;i<16;i++)n[i]=t[e+i];return this.fire("update"),this},set:function(t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p){return r.mat4.set(this.elements,t,e,n,i,s,a,o,u,c,h,f,l,d,m,_,p),this.fire("update"),this},identity:function(){return r.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return r.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return r.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat4.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return r.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return r.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,e){return r.mat4.rotate(this.elements,this.elements,t,e.elements),this.fire("update"),this},rotateX:function(t){return r.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return r.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return r.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return r.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return r.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,e){return r.mat4.fromRotation(this.elements,t,e.elements),this.fire("update"),this},fromXRotation:function(t){return r.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return r.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return r.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,e){return r.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return r.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return r.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return r.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,e,n,i,s){return r.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,i.elements),s||this.fire("update"),this},fromQuat:function(t){return r.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,e,n,i,s,a){return r.mat4.frustum(this.elements,t,e,n,i,s,a),this.fire("update"),this},perspective:function(t,e,n,i){return r.mat4.perspective(this.elements,t,e,n,i),this.fire("update"),this},perspectiveFromFieldOfView:function(t,e,n){return r.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.fire("update"),this},ortho:function(t,e,n,i,s,a){return r.mat4.ortho(this.elements,t,e,n,i,s,a),this.fire("update"),this},lookAt:function(t,e,n){return t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),r.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},targetTo:function(t,e,n){t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=f.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var i=this.elements,r=t[0],s=t[1],a=t[2],o=n[0],u=n[1],c=n[2],l=r-e[0],d=s-e[1],m=a-e[2],_=l*l+d*d+m*m;_>0?(l*=_=1/Math.sqrt(_),d*=_,m*=_):m=1;var p=u*m-c*d,g=c*l-o*m,v=o*d-u*l;return(_=p*p+g*g+v*v)>0?(p*=_=1/Math.sqrt(_),g*=_,v*=_):(_=(p=u*m-c*d)*p+(g=c*l-(o+=1e-7)*m)*g+(v=o*d-u*l)*v,p*=_=1/Math.sqrt(_),g*=_,v*=_),i[0]=p,i[1]=g,i[2]=v,i[3]=0,i[4]=d*v-m*g,i[5]=m*p-l*v,i[6]=l*g-d*p,i[7]=0,i[8]=l,i[9]=d,i[10]=m,i[11]=0,i[12]=r,i[13]=s,i[14]=a,i[15]=1,this.fire("update"),this},frob:function(){return r.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat4.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),r.mat4.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,i){return i?this.fromRotationTranslationScaleOrigin(t,e,n,i):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,r){return this.getScaling(n),this.getTranslation(e),i||(i=new u.a),this.determinant()<0&&(n.x*=-1),i.copy(this),h.inverse(n),i.scale(h),t.fromMat4(i),r&&r.set(0,0,0),this}});e.a=l},function(t,e,n){"use strict";var i=n(1),r=n(9),s=n(6),a=n(13),o=s.a.DEG2RAD,u=s.a.RAD2DEG,c=i.a.create({Mixes:r.a,Extends:a.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a.a.call(this,t,e,n)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*u,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*u,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*u,this.fire("update")}}});e.a=c},function(t,e,n){"use strict";var i=n(1),r=n(20),s=i.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new r.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],u=n[5],c=n[6],h=n[7],f=n[8],l=n[9],d=n[10],m=n[11],_=n[12],p=n[13],g=n[14],v=n[15];return e[0].set(a-i,h-o,m-f,v-_).normalize(),e[1].set(a+i,h+o,m+f,v+_).normalize(),e[2].set(a+r,h+u,m+l,v+p).normalize(),e[3].set(a-r,h-u,m-l,v-p).normalize(),e[4].set(a-s,h-c,m-d,v-g).normalize(),e[5].set(a+s,h+c,m+d,v+g).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)-1&&a.splice(h,1)}}return 0==a.length&&delete s[i],!0}return!1}},r=n(19).create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),s=window.Event;if(s){var a=s.prototype,o=a.stopImmediatePropagation;a.stopImmediatePropagation=function(){o&&o.call(this),this._stopped=!0}}t.exports=i},function(t,e,n){var i=n(94),r=n(96),s=n(97),a=n(100),o=n(34),u=[[0,0,0],[0,0,0],[0,0,0]],c=[0,0,0];function h(t,e){this.origin=t||[0,0,0],this.direction=e||[0,0,-1]}t.exports=h,h.prototype.set=function(t,e){this.origin=t,this.direction=e},h.prototype.copy=function(t){o(this.origin,t.origin),o(this.direction,t.direction)},h.prototype.clone=function(){var t=new h;return t.copy(this),t},h.prototype.intersectsSphere=function(t,e){return s(c,this.origin,this.direction,t,e)},h.prototype.intersectsPlane=function(t,e){return r(c,this.origin,this.direction,t,e)},h.prototype.intersectsTriangle=function(t){return i(c,this.origin,this.direction,t)},h.prototype.intersectsBox=function(t){return a(c,this.origin,this.direction,t)},h.prototype.intersectsTriangleCell=function(t,e){var n=t[0],i=t[1],r=t[2];return u[0]=e[n],u[1]=e[i],u[2]=e[r],this.intersectsTriangle(u)}},,function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_COLOR\n varying vec4 v_color;\n#endif\n\n#ifdef HILO_USE_HDR\n uniform float u_exposure;\n#endif\n\n#ifdef HILO_GAMMA_CORRECTION\n uniform float u_gammaFactor;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_TEXCOORD0\n varying vec2 v_texcoord0;\n#endif\n\n#ifdef HILO_HAS_TEXCOORD1\n varying vec2 v_texcoord1;\n#endif\n\n#if defined(HILO_HAS_TEXCOORD0) || defined(HILO_HAS_TEXCOORD1)\n #if defined(HILO_HAS_TEXCOORD0) && defined(HILO_HAS_TEXCOORD1)\n #define HILO_SAMPLER_2D hiloSampler2D\n // https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Opaque_types\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) hiloTexture2D(HILO_SAMPLER_2D.texture, HILO_SAMPLER_2D.uv)\n struct hiloSampler2D{\n sampler2D texture;\n int uv; \n };\n \n vec4 hiloTexture2D(sampler2D texture, int uv){\n if(uv == 0){\n return texture2D(texture, v_texcoord0);\n }\n else{\n return texture2D(texture, v_texcoord1);\n }\n }\n #else\n #ifdef HILO_HAS_TEXCOORD1\n #define HILO_V_TEXCOORD v_texcoord1\n #else\n #define HILO_V_TEXCOORD v_texcoord0\n #endif\n #define HILO_SAMPLER_2D sampler2D\n #define HILO_TEXTURE_2D(HILO_SAMPLER_2D) texture2D(HILO_SAMPLER_2D, HILO_V_TEXCOORD)\n #endif\n#endif\n\n\n#ifdef HILO_DIFFUSE_CUBE_MAP\n varying vec3 v_position;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_NORMAL\n varying vec3 v_normal;\n #ifdef HILO_NORMAL_MAP\n uniform HILO_SAMPLER_2D u_normalMap;\n varying mat3 v_TBN;\n \n #ifdef HILO_NORMAL_MAP_SCALE\n uniform float u_normalMapScale;\n #endif\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#if defined(HILO_HAS_LIGHT) || defined(HILO_HAS_FRAG_POS)\n varying vec3 v_fragPos;\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n#ifdef HILO_DIRECTIONAL_LIGHTS\n uniform vec3 u_directionalLightsColor[HILO_DIRECTIONAL_LIGHTS];\n uniform vec3 u_directionalLightsInfo[HILO_DIRECTIONAL_LIGHTS];\n #ifdef HILO_DIRECTIONAL_LIGHTS_SMC\n uniform sampler2D u_directionalLightsShadowMap[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowMapSize[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform mat4 u_directionalLightSpaceMatrix[HILO_DIRECTIONAL_LIGHTS_SMC];\n uniform vec2 u_directionalLightsShadowBias[HILO_DIRECTIONAL_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_SPOT_LIGHTS\n uniform vec3 u_spotLightsPos[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsDir[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsColor[HILO_SPOT_LIGHTS];\n uniform vec2 u_spotLightsCutoffs[HILO_SPOT_LIGHTS];\n uniform vec3 u_spotLightsInfo[HILO_SPOT_LIGHTS];\n uniform float u_spotLightsRange[HILO_SPOT_LIGHTS];\n #ifdef HILO_SPOT_LIGHTS_SMC\n uniform sampler2D u_spotLightsShadowMap[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowMapSize[HILO_SPOT_LIGHTS_SMC];\n uniform mat4 u_spotLightSpaceMatrix[HILO_SPOT_LIGHTS_SMC];\n uniform vec2 u_spotLightsShadowBias[HILO_SPOT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_POINT_LIGHTS\n uniform vec3 u_pointLightsPos[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsColor[HILO_POINT_LIGHTS];\n uniform vec3 u_pointLightsInfo[HILO_POINT_LIGHTS];\n uniform float u_pointLightsRange[HILO_POINT_LIGHTS];\n #ifdef HILO_POINT_LIGHTS_SMC\n uniform samplerCube u_pointLightsShadowMap[HILO_POINT_LIGHTS_SMC];\n uniform mat4 u_pointLightSpaceMatrix[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightsShadowBias[HILO_POINT_LIGHTS_SMC];\n uniform vec2 u_pointLightCamera[HILO_POINT_LIGHTS_SMC];\n #endif\n#endif\n\n#ifdef HILO_AREA_LIGHTS\n uniform vec3 u_areaLightsPos[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsColor[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsWidth[HILO_AREA_LIGHTS];\n uniform vec3 u_areaLightsHeight[HILO_AREA_LIGHTS];\n uniform sampler2D u_areaLightsLtcTexture1;\n uniform sampler2D u_areaLightsLtcTexture2;\n\n "+n(113)+"\n#endif\n\n#ifdef HILO_AMBIENT_LIGHTS\n uniform vec3 u_ambientLightsColor;\n#endif\n\n"+n(64)+"\n"+n(65)+"\n"+n(66)+"\n"+n(67)+"\n"+n(68)},function(t,e){t.exports="#define GLSLIFY 1\nvec4 textureEnvMap(sampler2D texture, vec3 position){\n return texture2D(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI));\n}\n\nvec4 textureEnvMap(samplerCube texture, vec3 position){\n return textureCube(texture, position);\n}\n\n#ifdef HILO_USE_SHADER_TEXTURE_LOD\n vec4 textureEnvMapLod(sampler2D texture, vec3 position, float lod){\n return texture2DLodEXT(texture, vec2(atan(position.x, position.z) * HILO_INVERSE_PI * 0.5+0.5, acos(position.y) * HILO_INVERSE_PI), lod);\n }\n\n vec4 textureEnvMapLod(samplerCube texture, vec3 position, float lod){\n return textureCubeLodEXT(texture, position, lod);\n }\n#endif\n\n"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_TRANSPARENCY_MAP\n uniform HILO_SAMPLER_2D u_transparency;\n#else\n uniform float u_transparency;\n#endif\n\n#ifdef HILO_ALPHA_CUTOFF\n uniform float u_alphaCutoff;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_FOG\n varying float v_dist;\n uniform vec4 u_fogColor;\n \n #ifdef HILO_FOG_LINEAR\n uniform vec2 u_fogInfo;\n #else\n uniform float u_fogInfo;\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_NORMAL_MAP\n vec3 normal = HILO_TEXTURE_2D(u_normalMap).rgb * 2.0 - 1.0;\n #ifdef HILO_NORMAL_MAP_SCALE\n normal.xy *= u_normalMapScale;\n #endif\n normal = normalize(v_TBN * normal);\n#elif defined(HILO_HAS_NORMAL)\n vec3 normal = normalize(v_normal);\n#else\n vec3 normal = vec3(0, 0, 1);\n#endif\n\n#if HILO_SIDE == HILO_BACK_SIDE\n normal = -normal;\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\n#ifdef HILO_HAS_LIGHT\n #if HILO_SIDE == HILO_FRONT_AND_BACK_SIDE\n normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #endif\n#endif"},function(t,e){t.exports="#define GLSLIFY 1\nfloat transparency = 1.0;\n#ifdef HILO_TRANSPARENCY_MAP\n transparency = HILO_TEXTURE_2D(u_transparency).r;\n#else\n transparency = u_transparency;\n#endif\ncolor.a *= transparency;\n#ifdef HILO_ALPHA_CUTOFF\n if (color.a < u_alphaCutoff) {\n discard;\n } else {\n color.a = 1.0;\n }\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n#ifdef HILO_IGNORE_TRANSPARENT\ncolor.a = 1.0;\n#endif\n\n#ifdef HILO_USE_HDR\n color.rgb = vec3(1.0) - exp(-color.rgb * u_exposure);\n#endif\n\n#ifdef HILO_GAMMA_CORRECTION\n color.rgb = pow(color.rgb, vec3(1.0 / u_gammaFactor));\n#endif\n\n"+n(73)+"\n\n#ifdef HILO_PREMULTIPLY_ALPHA\n color.rgb *= color.a;\n#endif\n\ngl_FragColor = color;"},function(t,e){t.exports="#define GLSLIFY 1\n"},function(t,e){t.exports="#ifdef GL_ES\nprecision HILO_MAX_VERTEX_PRECISION float;\n#define GLSLIFY 1\n#endif"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(40)+"\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(62)+"\n"+n(44)+"\n"+n(69)+"\n"+n(46)+"\n"+n(47)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 diffuse = vec4(0., 0., 0., 1.);\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(48)+"\n "+n(49)+"\n "+n(71)+"\n "+n(72)+"\n "+n(50)+"\n "+n(51)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(52)+"\n"+n(18)+"\n"+n(53)+"\n\nattribute vec3 a_position;\nuniform mat4 u_modelViewProjectionMatrix;\n\n"+n(74)+"\n"+n(75)+"\n"+n(76)+"\n"+n(77)+"\n"+n(78)+"\n"+n(79)+"\n"+n(80)+"\n"+n(81)+"\nvoid main(void) {\n vec4 pos = vec4(a_position, 1.0);\n #ifdef HILO_HAS_TEXCOORD0\n vec2 uv = a_texcoord0;\n #endif\n #ifdef HILO_HAS_TEXCOORD1\n vec2 uv1 = a_texcoord1;\n #endif\n #ifdef HILO_HAS_NORMAL\n vec3 normal = a_normal;\n #endif\n\n #ifdef HILO_NORMAL_MAP\n vec4 tangent = a_tangent;\n #endif\n\n "+n(82)+"\n "+n(83)+"\n "+n(84)+"\n "+n(85)+"\n "+n(86)+"\n "+n(87)+"\n "+n(88)+"\n\n gl_Position = u_modelViewProjectionMatrix * pos;\n\n "+n(89)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n#if defined(HILO_VERTEX_TYPE_POSITION)\n varying vec3 v_fragPos;\n#elif defined(HILO_VERTEX_TYPE_NORMAL)\n varying vec3 v_normal;\n#elif defined(HILO_VERTEX_TYPE_DEPTH)\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n uniform float u_cameraType;\n#elif defined(HILO_VERTEX_TYPE_DISTANCE)\n "+n(90)+"\n\n uniform float u_cameraFar;\n uniform float u_cameraNear;\n varying vec3 v_fragPos;\n#endif\n\nvec4 transformDataToColor(vec3 data){\n #ifdef HILO_WRITE_ORIGIN_DATA\n return vec4(data, 1.0);\n #else\n return vec4(data * 0.5 + 0.5, 1.0);\n #endif\n}\n\n"+n(29)+"\n\nvoid main(void) {\n #if defined(HILO_VERTEX_TYPE_POSITION)\n gl_FragColor = transformDataToColor(v_fragPos);\n #elif defined(HILO_VERTEX_TYPE_NORMAL)\n gl_FragColor = transformDataToColor(v_normal);\n #elif defined(HILO_VERTEX_TYPE_DEPTH)\n float z;\n #ifdef HILO_WRITE_ORIGIN_DATA\n z = gl_FragCoord.z;\n #else\n // OrthographicCamera\n if(u_cameraType < 1.0){\n z = gl_FragCoord.z;\n }\n // PerspectiveCamera\n else{\n z = gl_FragCoord.z * 2.0 - 1.0;\n z = (2.0 * u_cameraNear * u_cameraFar) / (u_cameraFar + u_cameraNear - z * (u_cameraFar - u_cameraNear));\n }\n #endif\n gl_FragColor = vec4(z, z, z, 1.0);\n #elif defined(HILO_VERTEX_TYPE_DISTANCE)\n float distance = length(v_fragPos);\n #ifdef HILO_WRITE_ORIGIN_DATA\n gl_FragColor = vec4(distance, distance, distance, 1.0);\n #else\n gl_FragColor = packFloat((distance - u_cameraNear)/(u_cameraFar - u_cameraNear));\n #endif\n #endif\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\n"+n(40)+"\n"+n(41)+"\n"+n(42)+"\n"+n(43)+"\n"+n(91)+"\n"+n(44)+"\n"+n(46)+"\n"+n(47)+"\n"+n(29)+"\n\nvoid main(void) {\n vec4 color = vec4(0., 0., 0., 1.);\n\n "+n(48)+"\n "+n(49)+"\n "+n(93)+"\n "+n(51)+"\n "+n(30)+"\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(25)+"\n"+n(18)+"\n"+n(26)+"\n\nvarying vec2 v_texcoord0;\nuniform sampler2D u_diffuse;\n\nvoid main(void) { \n gl_FragColor = texture2D(u_diffuse, v_texcoord0);\n}"},function(t,e,n){t.exports="#define GLSLIFY 1\n"+n(52)+"\n"+n(18)+"\n"+n(53)+"\n\nattribute vec2 a_position;\nattribute vec2 a_texcoord0;\nvarying vec2 v_texcoord0;\n\n\nvoid main(void) {\n vec4 pos = vec4(a_position, 0.0, 1.0);\n gl_Position = pos;\n v_texcoord0 = a_texcoord0;\n}"},function(t,e){var n=function(){var t=navigator.userAgent,e=document,n=window,i=e.documentElement,r={iphone:/iphone/i.test(t),ipad:/ipad/i.test(t),ipod:/ipod/i.test(t),ios:/iphone|ipad|ipod/i.test(t),android:/android/i.test(t),webkit:/webkit/i.test(t),chrome:/chrome/i.test(t),safari:/safari/i.test(t),firefox:/firefox/i.test(t),ie:/msie/i.test(t),opera:/opera/i.test(t),supportTouch:"ontouchstart"in n,supportCanvas:null!=e.createElement("canvas").getContext,supportStorage:!1,supportOrientation:"orientation"in n||"orientation"in n.screen,supportDeviceMotion:"ondevicemotion"in n};try{localStorage.setItem("hilo","hilo"),localStorage.removeItem("hilo"),r.supportStorage=!0}catch(t){}var s=r.jsVendor=r.webkit||r.firefox?"webkit":r.opera?"o":r.ie?"ms":"",a=r.cssVendor="-"+s+"-",o=e.createElement("div"),u=o.style,c=null!=u[s+"Transform"],h=null!=u[s+"Perspective"];h&&(o.id="test3d",(u=e.createElement("style")).textContent="@media ("+a+"transform-3d){#test3d{height:3px}}",e.head.appendChild(u),i.appendChild(o),h=3==o.offsetHeight,e.head.removeChild(u),i.removeChild(o)),r.supportTransform=c,r.supportTransform3D=h;var f=r.supportTouch,l=f?"touchstart":"mousedown",d=f?"touchmove":"mousemove",m=f?"touchend":"mouseup";return r.POINTER_START=l,r.POINTER_MOVE=d,r.POINTER_END=m,r}();t.exports=n},function(t,e,n){var i=n(19),r=function(){function t(){return+new Date}return i.create({constructor:function(t,e,n,i){var r=this;for(var s in r.target=t,r._startTime=0,r._seekTime=0,r._pausedTime=0,r._pausedStartTime=0,r._reverseFlag=1,r._repeatCount=0,3==arguments.length&&(i=n,n=e,e=null),i)r[s]=i[s];r._fromProps=e,r._toProps=n,!i.duration&&i.time&&(r.duration=i.time||0,r.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,isComplete:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var n=this.target,i=t||e,r=this._fromProps={},s=this._toProps={};for(var a in t=t||n,e=e||n,i)s[a]=e[a]||0,n[a]=r[a]=t[a]||0;return this},start:function(){var e=this;return e._startTime=t()+e.delay,e._seekTime=0,e._pausedTime=0,e._reverseFlag=1,e._repeatCount=0,e.paused=!1,e.isStart=!1,e.isComplete=!1,r.add(e),e},stop:function(){return r.remove(this),this},pause:function(){return this.paused=!0,this._pausedStartTime=t(),this},resume:function(){var e=this;return e.paused=!1,e._pausedStartTime&&(e._pausedTime+=t()-e._pausedStartTime),e._pausedStartTime=0,e},seek:function(e,n){var i=this,s=t();return i._startTime=s,i._seekTime=e,i._pausedTime=0,void 0!==n&&(i.paused=n),i._update(s,!0),r.add(i),i},link:function(t){var e,n,i=t.delay,s=this._startTime;return"string"==typeof i&&(e=0==i.indexOf("+"),n=0==i.indexOf("-"),i=e||n?Number(i.substr(1))*(e?1:-1):Number(i)),t.delay=i,t._startTime=e||n?s+this.duration+i:s+i,this._next=t,r.remove(t),t},_render:function(t){var e,n=this.target,i=this._fromProps;for(e in i)n[e]=i[e]+(this._toProps[e]-i[e])*t},_update:function(e,n){var i=this;if(!i.paused||n){if(i.isComplete)return!0;var s=e-i._startTime-i._pausedTime+i._seekTime;if(!(s<0)){var a,o=s/i.duration;o=o<=0?0:o>=1?1:o;var u=i.ease?i.ease(o):o;i.reverse&&i.isStart&&(i._reverseFlag<0&&(o=1-o,u=1-u),o<1e-7&&(i.repeat>0&&i._repeatCount++>=i.repeat||0==i.repeat&&!i.loop?!0:(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1))),i.isStart||(i.setProps(i._fromProps,i._toProps),i.isStart=!0,i.onStart&&i.onStart.call(i,i)),i.time=s,i._render(u),(a=i.onUpdate)&&a.call(i,u,i),o>=1&&(i.reverse?(i._startTime=t(),i._pausedTime=0,i._reverseFlag*=-1):i.loop||i.repeat>0&&i._repeatCount++0&&h<=e?(c._render(o),c.time=s,r.add(c)):i.isComplete&&(h<0||h>e)&&c.start()}return i.isComplete?((a=i.onComplete)&&a.call(i,i),!0):void 0}}},Statics:{_tweens:[],tick:function(){var e,n,i=r._tweens,s=i.length;for(n=0;n-1&&i.splice(e,1);else for(e=0;el)return null;i(h,u,a);var m=r(n,h);if(m<0||d+m>l)return null;var _=r(o,h)/l;return t[0]=e[0]+_*n[0],t[1]=e[1]+_*n[1],t[2]=e[2]+_*n[2],t}},function(t,e){t.exports=function(t,e,n){var i=e[0],r=e[1],s=e[2],a=n[0],o=n[1],u=n[2];return t[0]=r*u-s*o,t[1]=s*a-i*u,t[2]=i*o-r*a,t}},function(t,e,n){var i=n(27),r=n(32),s=n(33),a=n(34);t.exports=function(t,e,n,u,c){var h=i(n,u);if(0!==h){var f=-(i(e,u)+c)/h;return f<0?null:(s(o,n,f),r(t,e,o))}return i(u,e)+c===0?a(t,e):null};var o=[0,0,0]},function(t,e,n){var i=n(98),r=n(27),s=n(31),a=n(99),o=n(33),u=n(32),c=[0,0,0];t.exports=function(t,e,n,h,f){s(c,h,e);var l=r(n,c);if(l<0)return null;a(c,e,n,l);var d=i(h,c),m=f*f;if(d>m)return null;return o(t,n,l-Math.sqrt(m-d)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r}},function(t,e){t.exports=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}},function(t,e){function n(t,e,n){for(var i=t.length,r=-1/0,s=1/0,a=0;au){var c=o;o=u,u=c}if(us)return 1/0;o>r&&(r=o),us?1/0:r}t.exports=function(t,e,i,r){var s=n(e,i,r);if(s===1/0)t=null;else{t=t||[];for(var a=0;a0;){if(d(c)128){if(0==(u=(255&f[0])-128)||u>o-a)throw new Error("Bad scanline data");for(;u-- >0;)h[a++]=f[1]}else{if(0==(u=255&f[0])||u>o-a)throw new Error("Bad scanline data");if(h[a++]=f[1],--u>0){if(m(h,a,u)=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var i=n.slice(0),r=0,s=i.length;r=0&&e.splice(n,1)},nextTick:function(t){var e=this,n={tick:function(i){e.removeTick(n),t()}};return e.addTick(n),n},timeout:function(t,e){var n=this,i=(new Date).getTime()+e,r={tick:function(){(new Date).getTime()-i>=0&&(n.removeTick(r),t())}};return n.addTick(r),r},interval:function(t,e){var n=(new Date).getTime()+e,i={tick:function(){var i=(new Date).getTime(),r=i-n;r>=0&&(r 0.0 ? v : (0.5 * inversesqrt(max(1.0 - (x * x), 1e-7))) - v;\n return cross(v1, v2) * theta_sintheta;\n}\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 vec3 v1 = rectCoords[1] - rectCoords[0];\n vec3 v2 = rectCoords[3] - rectCoords[0];\n vec3 lightNormal = cross(v1, v2);\n if (dot(lightNormal, P - rectCoords[0]) < 0.0)\n return vec3(0.0);\n vec3 T1, T2;\n T1 = normalize(V - (N * dot(V, N)));\n T2 = -cross(N, T1);\n mat3 mat = mInv * transpose(mat3(T1, T2, N));\n vec3 coords[4];\n coords[0] = mat * (rectCoords[0] - P);\n coords[1] = mat * (rectCoords[1] - P);\n coords[2] = mat * (rectCoords[2] - P);\n coords[3] = mat * (rectCoords[3] - P);\n coords[0] = normalize(coords[0]);\n coords[1] = normalize(coords[1]);\n coords[2] = normalize(coords[2]);\n coords[3] = normalize(coords[3]);\n vec3 vectorFormFactor = vec3(0.0);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[0], coords[1]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[1], coords[2]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[2], coords[3]);\n vectorFormFactor += LTC_EdgeVectorFormFactor(coords[3], coords[0]);\n float result = LTC_ClippedSphereFormFactor(vectorFormFactor);\n return vec3(result);\n}\n\nvec3 getAreaLight(const in vec3 diffuseColor, const in vec3 specularColor, const in float roughness, const in vec3 normal, const in vec3 viewDir, const in vec3 position, const in vec3 lightPos, const in vec3 lightColor, const in vec3 halfWidth, const in vec3 halfHeight, const in sampler2D areaLightsLtcTexture1, const in sampler2D areaLightsLtcTexture2){\n vec3 rectCoords[4];\n rectCoords[0] = (lightPos - halfWidth) - halfHeight;\n rectCoords[1] = (lightPos + halfWidth) - halfHeight;\n rectCoords[2] = (lightPos + halfWidth) + halfHeight;\n rectCoords[3] = (lightPos - halfWidth) + halfHeight;\n \n vec2 uv = LTC_Uv(normal, viewDir, roughness);\n vec4 t1 = texture2D(areaLightsLtcTexture1, uv);\n vec4 t2 = texture2D(areaLightsLtcTexture2, uv);\n\n mat3 mInv = mat3(vec3(t1.x, 0, t1.y), vec3(0, 1, 0), vec3(t1.z, 0, t1.w));\n vec3 fresnel = (specularColor * t2.x) + ((vec3(1.0) - specularColor) * t2.y);\n \n vec3 color = vec3(0.0, 0.0, 0.0);\n color += ((lightColor * fresnel) * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords));\n color += ((lightColor * diffuseColor) * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords));\n return color;\n}\n\n"},function(t,e,n){"use strict";n.r(e),n.d(e,"util",(function(){return r})),n.d(e,"GLTFExtensions",(function(){return i})),n.d(e,"Class",(function(){return s.a})),n.d(e,"EventMixin",(function(){return a.a})),n.d(e,"Fog",(function(){return ti})),n.d(e,"Mesh",(function(){return si})),n.d(e,"Node",(function(){return g})),n.d(e,"SkinedMesh",(function(){return ci})),n.d(e,"Stage",(function(){return wi})),n.d(e,"Tween",(function(){return Gi})),n.d(e,"version",(function(){return hi})),n.d(e,"BoxGeometry",(function(){return Vi})),n.d(e,"Geometry",(function(){return Z})),n.d(e,"GeometryData",(function(){return C})),n.d(e,"MorphGeometry",(function(){return Bn})),n.d(e,"PlaneGeometry",(function(){return qi})),n.d(e,"SphereGeometry",(function(){return Yi})),n.d(e,"Camera",(function(){return O})),n.d(e,"PerspectiveCamera",(function(){return Q})),n.d(e,"OrthographicCamera",(function(){return en})),n.d(e,"Buffer",(function(){return xt})),n.d(e,"capabilities",(function(){return et})),n.d(e,"extensions",(function(){return tt})),n.d(e,"Framebuffer",(function(){return re})),n.d(e,"glType",(function(){return Tt})),n.d(e,"logGLResource",(function(){return Ki})),n.d(e,"Program",(function(){return It})),n.d(e,"RenderInfo",(function(){return fi})),n.d(e,"RenderList",(function(){return _i})),n.d(e,"VertexArrayObject",(function(){return Ft})),n.d(e,"WebGLRenderer",(function(){return Ni})),n.d(e,"WebGLResourceManager",(function(){return gi})),n.d(e,"WebGLState",(function(){return pi})),n.d(e,"BasicLoader",(function(){return tr})),n.d(e,"CubeTextureLoader",(function(){return rr})),n.d(e,"GLTFLoader",(function(){return Br})),n.d(e,"GLTFParser",(function(){return Ur})),n.d(e,"AliAMCExtension",(function(){return zn})),n.d(e,"HDRLoader",(function(){return Yr})),n.d(e,"KTXLoader",(function(){return Qr})),n.d(e,"LoadCache",(function(){return Ji})),n.d(e,"LoadQueue",(function(){return Jr})),n.d(e,"ShaderMaterialLoader",(function(){return ts})),n.d(e,"TextureLoader",(function(){return ns})),n.d(e,"Loader",(function(){return nr})),n.d(e,"Texture",(function(){return qt})),n.d(e,"LazyTexture",(function(){return cr})),n.d(e,"CubeTexture",(function(){return fe})),n.d(e,"DataTexture",(function(){return ve})),n.d(e,"Shader",(function(){return dt})),n.d(e,"BasicMaterial",(function(){return qe})),n.d(e,"GeometryMaterial",(function(){return $e})),n.d(e,"Material",(function(){return ze})),n.d(e,"PBRMaterial",(function(){return ar})),n.d(e,"semantic",(function(){return Pe})),n.d(e,"ShaderMaterial",(function(){return Dn})),n.d(e,"AxisHelper",(function(){return as})),n.d(e,"AxisNetHelper",(function(){return cs})),n.d(e,"CameraHelper",(function(){return ds})),n.d(e,"AmbientLight",(function(){return _s})),n.d(e,"AreaLight",(function(){return gs})),n.d(e,"DirectionalLight",(function(){return Nn})),n.d(e,"CubeLightShadow",(function(){return Ln})),n.d(e,"Light",(function(){return M})),n.d(e,"LightManager",(function(){return Mi})),n.d(e,"LightShadow",(function(){return cn})),n.d(e,"PointLight",(function(){return Sn})),n.d(e,"SpotLight",(function(){return wn})),n.d(e,"Animation",(function(){return Or})),n.d(e,"AnimationStates",(function(){return Ir})),n.d(e,"MeshPicker",(function(){return Ms})),n.d(e,"Ticker",(function(){return Is})),n.d(e,"log",(function(){return m.a})),n.d(e,"Cache",(function(){return J})),n.d(e,"browser",(function(){return Ci})),n.d(e,"WebGLSupport",(function(){return Ls})),n.d(e,"constants",(function(){return P.a})),n.d(e,"Color",(function(){return Os.Color})),n.d(e,"Euler",(function(){return Os.Euler})),n.d(e,"EulerNotifier",(function(){return Os.EulerNotifier})),n.d(e,"Frustum",(function(){return Os.Frustum})),n.d(e,"math",(function(){return Os.math})),n.d(e,"Matrix3",(function(){return Os.Matrix3})),n.d(e,"Matrix4",(function(){return Os.Matrix4})),n.d(e,"Matrix4Notifier",(function(){return Os.Matrix4Notifier})),n.d(e,"Plane",(function(){return Os.Plane})),n.d(e,"Quaternion",(function(){return Os.Quaternion})),n.d(e,"Ray",(function(){return Os.Ray})),n.d(e,"Sphere",(function(){return Os.Sphere})),n.d(e,"SphericalHarmonics3",(function(){return Os.SphericalHarmonics3})),n.d(e,"Vector2",(function(){return Os.Vector2})),n.d(e,"Vector3",(function(){return Os.Vector3})),n.d(e,"Vector3Notifier",(function(){return Os.Vector3Notifier})),n.d(e,"Vector4",(function(){return Os.Vector4}));var i={};n.r(i),n.d(i,"ALI_amc_mesh_compression",(function(){return zn})),n.d(i,"WEB3D_quantized_attributes",(function(){return qn})),n.d(i,"HILO_animation_clips",(function(){return Wn})),n.d(i,"ALI_animation_clips",(function(){return Yn})),n.d(i,"ALI_bounding_box",(function(){return Zn})),n.d(i,"KHR_materials_pbrSpecularGlossiness",(function(){return Kn})),n.d(i,"KHR_lights_punctual",(function(){return Qn})),n.d(i,"KHR_techniques_webgl",(function(){return Jn}));var r=n(4),s=n(1),a=n(9),o=n(7),u=n(22),c=n(5),h=n(17),f=n(23),l=n(10),d=n(6),m=n(3),_=new c.a(0,1,0),p=new o.a,g=s.a.create({Statics:{TRAVERSE_STOP_NONE:!1,TRAVERSE_STOP_CHILDREN:1,TRAVERSE_STOP_ALL:!0},Mixes:a.a,isNode:!0,className:"Node",name:"",animationId:"",autoUpdateWorldMatrix:!0,autoUpdateChildWorldMatrix:!0,parent:null,_quatDirty:!1,_matrixDirty:!1,needCallChildUpdate:!0,visible:!0,pointerEnabled:!0,pointerChildren:!0,useHandCursor:!1,__forceUseParentWorldMatrix:!1,constructor:function(t){var e=this;this.id=d.a.generateUUID(this.className),this.up=_.clone(),this.children=[],this.worldMatrix=new o.a,this._matrix=new u.a,this._position=new h.a(0,0,0),this._scale=new h.a(1,1,1),this._pivot=new h.a(0,0,0),this._rotation=new f.a,this._quaternion=new l.a,this._matrix.on("update",(function(){e._onMatrixUpdate()})),this._position.on("update",(function(){e._onPositionUpdate()})),this._scale.on("update",(function(){e._onScaleUpdate()})),this._pivot.on("update",(function(){e._onPivotUpdate()})),this._rotation.on("update",(function(){e._onRotationUpdate()})),this._quaternion.on("update",(function(){e._onQuaternionUpdate()})),Object.assign(this,t)},clone:function(t){var e=new this.constructor;return e.name=this.name,e.jointName=this.jointName,e.animationId=this.animationId,e.setPosition(this.x,this.y,this.z),e.setScale(this.scaleX,this.scaleY,this.scaleZ),e.setRotation(this.rotationX,this.rotationY,this.rotationZ),this.children.forEach((function(t){e.addChild(t.clone(!0))})),t||(this.anim&&(e.anim=this.anim.clone(e)),e.resetSkinedMeshRootNode()),e},setAnim:function(t){return this.anim=t,t.rootNode=this,this},resetSkinedMeshRootNode:function(){var t=this;this.traverse((function(e){e.isSkinedMesh&&e.jointNames&&(e.rootNode=t)}),!0)},getChildrenNameMap:function(){var t={};return this.traverse((function(e){t[e.name]=e;var n=e._originName;void 0===n||t[n]||(t[n]=e)}),!0),t},addChild:function(t){return t.parent&&t.removeFromParent(),t.parent=this,this.children.push(t),this},removeChild:function(t){var e=this.children.indexOf(t);return e>-1&&(this.children.splice(e,1),t.parent=null),this},addTo:function(t){return t.addChild(this),this},removeFromParent:function(){return this.parent&&this.parent.removeChild(this),this},updateMatrix:function(){return this._matrixDirty&&(this._matrixDirty=!1,this.matrixVersion++,this._matrix.fromRotationTranslationScaleOrigin(this.quaternion,this._position,this._scale,this._pivot,!0)),this},updateQuaternion:function(){return this._quatDirty&&(this._quatDirty=!1,this._quaternion.fromEuler(this._rotation,!0)),this},updateTransform:function(){return this._matrix.decompose(this._quaternion,this._position,this._scale,this._pivot),this._onQuaternionUpdate(),this._matrixDirty=!1,this},updateMatrixWorld:function(t){return this.traverse((function(e){return(e.autoUpdateWorldMatrix||t)&&(e.parent?e.__forceUseParentWorldMatrix?e.worldMatrix.copy(e.parent.worldMatrix):e.worldMatrix.multiply(e.parent.worldMatrix,e.matrix):e.worldMatrix.copy(e.matrix)),!e.autoUpdateChildWorldMatrix&&!t&&1})),this},getConcatenatedMatrix:function(t){for(var e=new o.a,n=this;n&&n!==t;n=n.parent)e.multiply(n.matrix,e);return e},_traverse:function(t,e){if(!e){var n=t(this);if(n)return n}for(var i=this.children,r=0,s=i.length;r1&&void 0!==arguments[1]&&arguments[1];return this._traverse(t,e),this},traverseBFS:function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(n=i?this.children:[this];n.length;){e=n,n=[];for(var r=0,s=e.length;r1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return this._scale.set(t,e,n),this},setPosition:function(t,e,n){return this._position.set(t,e,n),this},setRotation:function(t,e,n){return this._rotation.setDegree(t,e,n),this},setPivot:function(t,e,n){return this._pivot.set(t,e,n),this},lookAt:function(t){return this.isCamera?p.targetTo(this,t,this.up):p.targetTo(t,this,this.up),this._quaternion.fromMat4(p),this},raycast:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.visible)return null;var r=[];return this.traverse((function(n){if(i&&!n.pointerEnabled)return 1;if(n.isMesh){var s=n.raycast(t,!1);s&&(r=r.concat(s.map((function(t){return{mesh:n,point:t}}))))}return!(!i||e.pointerChildren)&&1})),r.length?(n&&t.sortPoints(r,"point"),r):null},matrix:{get:function(){return this.updateMatrix(),this._matrix},set:function(t){m.a.warnOnce("Node.matrix.set","node.matrix is readOnly.Use node.matrix.copy instead."),this._matrix.copy(t)}},position:{get:function(){return this._position},set:function(t){m.a.warnOnce("Node.position.set","node.position is readOnly.Use node.position.copy instead."),this._position.copy(t)}},x:{get:function(){return this._position.elements[0]},set:function(t){this._position.elements[0]=t,this._matrixDirty=!0}},y:{get:function(){return this._position.elements[1]},set:function(t){this._position.elements[1]=t,this._matrixDirty=!0}},z:{get:function(){return this._position.elements[2]},set:function(t){this._position.elements[2]=t,this._matrixDirty=!0}},scale:{get:function(){return this._scale},set:function(t){m.a.warnOnce("Node.scale.set","node.scale is readOnly.Use node.scale.copy instead."),this._scale.copy(t)}},scaleX:{get:function(){return this._scale.elements[0]},set:function(t){this._scale.elements[0]=t,this._matrixDirty=!0}},scaleY:{get:function(){return this._scale.elements[1]},set:function(t){this._scale.elements[1]=t,this._matrixDirty=!0}},scaleZ:{get:function(){return this._scale.elements[2]},set:function(t){this._scale.elements[2]=t,this._matrixDirty=!0}},pivot:{get:function(){return this._pivot},set:function(t){m.a.warnOnce("Node.pivot.set","node.pivot is readOnly.Use node.pivot.copy instead."),this._pivot.copy(t)}},pivotX:{get:function(){return this._pivot.elements[0]},set:function(t){this._pivot.elements[0]=t,this._matrixDirty=!0}},pivotY:{get:function(){return this._pivot.elements[1]},set:function(t){this._pivot.elements[1]=t,this._matrixDirty=!0}},pivotZ:{get:function(){return this._pivot.elements[2]},set:function(t){this._pivot.elements[2]=t,this._matrixDirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){m.a.warnOnce("Node.rotation.set","node.rotation is readOnly.Use node.rotation.copy instead."),this._rotation.copy(t)}},rotationX:{get:function(){return this._rotation.degX},set:function(t){this._rotation.degX=t}},rotationY:{get:function(){return this._rotation.degY},set:function(t){this._rotation.degY=t}},rotationZ:{get:function(){return this._rotation.degZ},set:function(t){this._rotation.degZ=t}},quaternion:{get:function(){return this.updateQuaternion(),this._quaternion},set:function(t){m.a.warnOnce("Node.quaternion.set","node.quaternion is readOnly.Use node.quaternion.copy instead."),this._quaternion.copy(t)}},matrixVersion:0,getBounds:function(t,e,n){return e?e.multiply(this.matrix):e=this.getConcatenatedMatrix(t),this.children.forEach((function(t){n=t.getBounds(null,e.clone(),n)})),this.isMesh&&(n=this.geometry.getBounds(e,n)),n},_fireMouseEvent:function(t){if(t.eventCurrentTarget=this,this.fire(t),"mousemove"===t.type){if(!this.__mouseOver){this.__mouseOver=!0;var e=Object.assign({},t);e.type="mouseover",this.fire(e)}}else"mouseout"===t.type&&(this.__mouseOver=!1);var n=this.parent;t._stopped||t._stopPropagationed||!n||n._fireMouseEvent(t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getChildrenByBaseClassName("Node");return this.off(),n.forEach((function(n){n.isMesh?n.destroy(t,e):(n.off(),n.removeFromParent())})),this.removeFromParent(),this},_onMatrixUpdate:function(){this.matrixVersion++,this.updateTransform()},_onPositionUpdate:function(){this._matrixDirty=!0},_onScaleUpdate:function(){this._matrixDirty=!0},_onPivotUpdate:function(){this._matrixDirty=!0},_onRotationUpdate:function(){this._quatDirty=!0,this._matrixDirty=!0},_onQuaternionUpdate:function(){this._rotation.fromQuat(this._quaternion),this._quatDirty=!1}}),v=n(8),E=new v.a,T=s.a.create({Extends:g,isLight:!0,className:"Light",amount:1,enabled:!0,constantAttenuation:1,linearAttenuation:0,quadraticAttenuation:0,_range:0,range:{get:function(){return this._range},set:function(t){this.constantAttenuation=1,t<=0?(this.linearAttenuation=0,this.quadraticAttenuation=0):(this.linearAttenuation=4.5/t,this.quadraticAttenuation=75/(t*t)),this._range=t}},constructor:function(t){this.color=new v.a(1,1,1),T.superclass.constructor.call(this,t)},toInfoArray:function(t,e){return t[e+0]=this.constantAttenuation,t[e+1]=this.linearAttenuation,t[e+2]=this.quadraticAttenuation,this},getRealColor:function(){return E.copy(this.color).scale(this.amount)},createShadowMap:function(t,e){}}),M=T,A=n(24),I=new o.a,L=s.a.create({Extends:g,isCamera:!0,className:"Camera",_needUpdateProjectionMatrix:!0,_isGeometryDirty:!1,constructor:function(t){this.viewMatrix=new o.a,this.projectionMatrix=new o.a,this.viewProjectionMatrix=new o.a,this._frustum=new A.a,L.superclass.constructor.call(this,t)},updateViewMatrix:function(){return this.updateMatrixWorld(!0),this.viewMatrix.invert(this.worldMatrix),this},updateProjectionMatrix:function(){},getGeometry:function(t){},updateViewProjectionMatrix:function(){return this._needUpdateProjectionMatrix&&(this.updateProjectionMatrix(),this._needUpdateProjectionMatrix=!1),this.updateViewMatrix(),this.viewProjectionMatrix.multiply(this.projectionMatrix,this.viewMatrix),this.updateFrustum(this.viewProjectionMatrix),this},getModelViewMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewMatrix,t.worldMatrix),e},getModelProjectionMatrix:function(t,e){return(e=e||new o.a).multiply(this.viewProjectionMatrix,t.worldMatrix),e},projectVector:function(t,e,n){var i=t.clone();return i.transformMat4(this.viewProjectionMatrix),e&&n&&(i.x=(i.x+1)/2*e,i.y=n-(i.y+1)/2*n),i},unprojectVector:function(t,e,n){var i=t.clone();return e&&n&&(i.x=i.x/e*2-1,i.y=1-i.y/n*2),I.invert(this.viewProjectionMatrix),i.transformMat4(I),i},isPointVisible:function(t){return!!this._frustum.intersectsSphere({center:t,radius:0})},isMeshVisible:function(t){var e=t.geometry;if(e){var n=e.getSphereBounds(t.worldMatrix);if(this._frustum.intersectsSphere(n))return!0}return!1},updateFrustum:function(t){return this._frustum.fromMatrix(t),this}}),O=L,S=n(14),R=n(12),y=n(11),x=n(21),N={2:new S.a,3:new c.a,4:new R.a,16:new o.a},b=s.a.create({className:"GeometryData",isGeometryData:!0,size:void 0,normalized:!1,type:void 0,_isSubDirty:!1,_isAllDirty:!1,isDirty:{get:function(){return this._isSubDirty||this._isAllDirty},set:function(t){this._isAllDirty=t,!1===t&&this.clearSubData()}},bufferViewId:void 0,glBuffer:null,constructor:function(t,e,n){this.id=d.a.generateUUID(this.className),this.data=t,this.size=e,Object.assign(this,n),this.bufferViewId||(this.bufferViewId=this.id),this.size||m.a.warn("GeometryData.constructor: geometryData must set size!",this)},_stride:0,stride:{get:function(){return this._stride},set:function(t){this._stride=t,this.strideSize=0===t?0:t/this.data.BYTES_PER_ELEMENT}},strideSize:0,_offset:0,offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetSize=t/this.data.BYTES_PER_ELEMENT}},offsetSize:0,data:{set:function(t){t&&(this._data=t,this.type=Object(r.getTypedArrayGLType)(t),this.stride=this._stride,this.offset=this._offset,this._isAllDirty=!0)},get:function(){return this._data}},length:{get:function(){return this._data.length}},realLength:{get:function(){return 0===this.strideSize?this._data.length:this._data.length/this.strideSize*this.size}},getByteLength:function(){return this._data.BYTES_PER_ELEMENT*this.realLength},count:{get:function(){return 0===this.strideSize?this._data.length/this.size:this._data.length/this.strideSize}},setSubData:function(t,e){this._isSubDirty=!0,this.data.set(e,t),this.subDataList||(this.subDataList=[]);var n=e.BYTES_PER_ELEMENT*t;this.subDataList.push({byteOffset:n,data:e})},clearSubData:function(){this.subDataList&&(this.subDataList.length=0),this._isSubDirty=!1},clone:function(){var t=new b(null,1);return t.copy(this),t},copy:function(t){var e=t.data;this.data=new e.constructor(e),this.size=t.size,this.stride=t.stride,this.normalized=t.normalized,this.type=t.type,this.offset=t.offset},getOffset:function(t){var e=this.strideSize;return 0===e?t*this.size:t*e+this.offsetSize},get:function(t){var e=this.getOffset(t);return this.getByOffset(e)},getCopy:function(t){return this.get(t).clone()},set:function(t,e){var n=this.getOffset(t);return this.setByOffset(n,e),n},getByOffset:function(t){var e=this.size;return e>1?N[e].fromArray(this._data,t):this._data[t]},setByOffset:function(t,e){var n=this.size,i=this._data;n>1?e.toArray(i,t):i[t]=e,this._isAllDirty=!0},traverse:function(t){for(var e=this.count,n=0;n0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(W.fromTranslation(G.set(t,e,n))),this},scale:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return this.transformMat4(W.fromScaling(G.set(t,e,n))),this},rotate:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.transformMat4(W.fromQuat(Y.fromEuler({x:t*d.a.DEG2RAD,y:e*d.a.DEG2RAD,z:n*d.a.DEG2RAD}))),this},transformMat4:function(t){var e=this.vertices;if(e&&e.traverse((function(n,i,r){e.setByOffset(r,n.transformMat4(t))})),q.normalFromMat4(t),this._normals){var n=this.normals;n.traverse((function(t,e,i){n.setByOffset(i,t.transformMat3(q).normalize())}))}if(this._tangents){var i=this.tangents;i.traverse((function(t,e,n){i.setByOffset(n,t.transformMat3(q).normalize())}))}return this.isDirty=!0,this},merge:function(t,e){var n=t.vertices;if(n&&this.vertices){var i=this.vertices.count;e&&(n=t.vertices.clone()).traverse((function(t,i,r){n.setByOffset(r,t.transformMat4(e))})),this.vertices.merge(n),this.indices&&t.indices?this.indices.merge(t.indices,(function(t){return t+i})):this.indices=null}return this.uvs&&t.uvs?this.uvs.merge(t.uvs):this.uvs=null,this.uvs1&&t.uvs1?this.uvs1.merge(t.uvs1):this.uvs1=null,this.colors&&t.colors?this.colors.merge(t.colors):this.colors=null,this._normals&&(this._normals=null),this._tangents&&(this._tangents=null),this._tangents1&&(this._tangents1=null),this.isDirty=!0,this},ensureData:function(t,e,n,i){var r=this[t];if(!r||n>r.length){var s=new i(n);r?(s.set(r.data),r.data=s):this[t]=new C(s,e)}},addPoints:function(){var t=this,e=[].slice.call(arguments),n=3*(this.currentVerticesCount+e.length);this.ensureData("vertices",3,n,Float32Array);var i=this.vertices.data;return e.forEach((function(e){var n=3*t.currentVerticesCount++;i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2]})),this.currentVerticesCount-e.length},addIndices:function(){var t=this,e=[].slice.call(arguments),n=this.currentIndicesCount+e.length;this.ensureData("indices",1,n,Uint16Array);var i=this.indices.data;e.forEach((function(e){i[t.currentIndicesCount++]=e})),this._needUpdateNormals=!0},addLine:function(t,e){var n=this.addPoints(t,e);this.addIndices(n,n+1)},addFace:function(t,e,n){var i=this.addPoints(t,e,n);this.addIndices(i,i+1,i+2)},addRect:function(t,e,n,i){var r=this.addPoints(t,e,n,i);this.addIndices(r,r+1,r+2,r,r+2,r+3)},setVertexUV:function(t,e){this.ensureData("uvs",2,this.vertices.length/3*2,Float32Array);for(var n=this.uvs.data,i=0;i0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;e||(e={xMin:1/0,xMax:-1/0,yMin:1/0,yMax:-1/0,zMin:1/0,zMax:-1/0});var n=this.vertices;return n?(n.traverse((function(n){t&&n.transformMat4(t),e.xMax=Math.max(e.xMax,n.x),e.yMax=Math.max(e.yMax,n.y),e.zMax=Math.max(e.zMax,n.z),e.xMin=Math.min(e.xMin,n.x),e.yMin=Math.min(e.yMin,n.y),e.zMin=Math.min(e.zMin,n.z)})),e.width=e.xMax-e.xMin,e.height=e.yMax-e.yMin,e.depth=e.zMax-e.zMin,e.x=(e.xMin+e.xMax)/2,e.y=(e.yMin+e.yMax)/2,e.z=(e.zMin+e.zMax)/2,e):(m.a.warnOnce("geometry.getBounds","geometry has no vertices data, geometry.getBounds will return Infinity bounds."),e)},getLocalBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._localBounds&&!t||(this._localBounds=this.getBounds()),this._localBounds},getSphereBounds:function(t){this._sphereBounds||(this._sphereBounds=new x.a);var e=this._sphereBounds;return e.copy(this.getLocalSphereBounds()),t&&e.transformMat4(t),e},getLocalSphereBounds:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._localSphereBounds||t){var e=this.getLocalBounds(t),n=new x.a({center:new c.a(e.x,e.y,e.z)}),i=this.vertices;i?n.fromGeometryData(i):(m.a.warnOnce("geometry.getLocalSphereBounds","geometry has no vertices data, geometry.getLocalSphereBounds will return Infinity bounds."),n.radius=1/0),this._localSphereBounds=n}return this._localSphereBounds},convertToNoIndices:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if(this.mode===w)if(this.indices){for(var e=this.indices.data,n=e.length,i=new Float32Array(n*t),s=this.uvs?new Float32Array(2*n):null,a=new Float32Array(3*n),o=this.colors?new Float32Array(this.colors.size*n):null,u=this.skinIndices?new Float32Array(4*n):null,c=this.skinWeights?new Float32Array(4*n):null,h=0;h2&&void 0!==arguments[2])||arguments[2];return(n=this.useAABBRaycast?this._aabbRaycast(t):this._raycast(t,e))&&i&&t.sortPoints(n),n},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.positionDecodeMat&&(t.QUANTIZED=1,t.POSITION_QUANTIZED=1),this.normalDecodeMat&&(t.QUANTIZED=1,t.NORMAL_QUANTIZED=1),this.uvDecodeMat&&(t.QUANTIZED=1,t.UV_QUANTIZED=1),this.uv1DecodeMat&&(t.QUANTIZED=1,t.UV1_QUANTIZED=1),this.colors&&(t.HAS_COLOR=1,t.COLOR_SIZE=this.colors.size),t},getShaderKey:function(){return void 0===this._shaderKey&&(this._shaderKey="geometry",this.isMorphGeometry?this._shaderKey+="_id_".concat(this.id):(this.colors&&(this._shaderKey+="_colors"),this.positionDecodeMat&&(this._shaderKey+="positionDecodeMat"))),this._shaderKey},getSize:function(){var t=0;for(var e in this)Object(r.hasOwnProperty)(this,e)&&this[e]&&this[e].isGeometryData&&(t+=this[e].getByteLength());return t},destroy:function(){m.a.warn("Geometry.destroy has been deprecated, use mesh.destroy(renderer) instead.")}}),K=s.a.create({Extends:O,isPerspectiveCamera:!0,className:"PerspectiveCamera",_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:null,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},_fov:50,fov:{get:function(){return this._fov},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._fov=t}},_aspect:1,aspect:{get:function(){return this._aspect},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._aspect=t}},constructor:function(t){K.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.projectionMatrix.elements,e=this.near,n=this.far,i=this.aspect,r=this.fov,s=1/Math.tan(.5*d.a.degToRad(r));if(t[0]=s/i,t[5]=s,t[11]=-1,t[15]=0,n){var a=1/(e-n);t[10]=(e+n)*a,t[14]=2*n*e*a}else t[10]=-1,t[14]=-2*e},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=Math.tan(this.fov/2*Math.PI/180),i=this.near,r=this.far,s=i*n,a=r*n,o=this.aspect*s,u=this.aspect*a,c=[-o,-s,-i],h=[o,-s,-i],f=[o,s,-i],l=[-o,s,-i],d=[-u,-a,-r],m=[u,-a,-r],_=[u,a,-r],p=[-u,a,-r];e.addRect(d,m,_,p),e.addRect(m,h,f,_),e.addRect(h,c,l,f),e.addRect(c,d,p,l),e.addRect(p,_,f,l),e.addRect(c,h,m,d),this._geometry=e}return this._geometry}}),Q=K,J=s.a.create({constructor:function(){this._cache={}},get:function(t){return this._cache[t]},getObject:function(t){return this._cache[t.__cacheId]},add:function(t,e){"object"==typeof e&&(e.__cacheId=t),this._cache[t]=e},remove:function(t){delete this._cache[t]},removeObject:function(t){delete this._cache[t.__cacheId]},removeAll:function(){this._cache={}},each:function(t){var e=this._cache;for(var n in e)t(e[n],n)}}),$={instanced:void 0,vao:void 0,texFloat:void 0,loseContext:void 0,textureFilterAnisotropic:void 0,_usedExtensions:{},_disabledExtensions:{},init:function(t){this.reset(t)},reset:function(t){this.gl=t;var e=this._usedExtensions;for(var n in e){var i=e[n];this[i]=void 0,this.get(n,i)}},use:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;this.gl?this.get(t,e):this._usedExtensions[t]=e},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(this._disabledExtensions[t])return null;var n=this[e];return void 0===n&&(n=this._getExtension(t),this[e]=n),n},disable:function(t){this._disabledExtensions[t]=!0},enable:function(t){this._disabledExtensions[t]=!1},_getExtension:function(t){var e=this.gl;return e&&e.getExtension&&(e.getExtension(t)||e.getExtension("WEBKIT_"+t)||e.getExtension("MOZ_"+t))||null}};$.use("ANGLE_instanced_arrays","instanced"),$.use("OES_vertex_array_object","vao"),$.use("OES_texture_float","texFloat"),$.use("WEBGL_lose_context","loseContext"),$.use("OES_element_index_uint","uintIndices"),$.use("EXT_shader_texture_lod","shaderTextureLod"),$.use("EXT_texture_filter_anisotropic","textureFilterAnisotropic");var tt=$,et={MAX_TEXTURE_INDEX:null,MAX_PRECISION:null,MAX_VERTEX_PRECISION:null,MAX_FRAGMENT_PRECISION:null,VERTEX_TEXTURE_FLOAT:null,FRAGMENT_TEXTURE_FLOAT:null,MAX_TEXTURE_MAX_ANISOTROPY:1,init:function(t){var e=this;this.gl=t;["MAX_RENDERBUFFER_SIZE","MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_CUBE_MAP_TEXTURE_SIZE","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_TEXTURE_SIZE","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS","MAX_COMBINED_TEXTURE_IMAGE_UNITS"].forEach((function(t){e.get(t)})),this.MAX_TEXTURE_INDEX=this.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,this.MAX_VERTEX_PRECISION=this._getMaxSupportPrecision(t.VERTEX_SHADER),this.MAX_FRAGMENT_PRECISION=this._getMaxSupportPrecision(t.FRAGMENT_SHADER),this.MAX_PRECISION=this.getMaxPrecision(this.MAX_FRAGMENT_PRECISION,this.MAX_VERTEX_PRECISION),this.VERTEX_TEXTURE_FLOAT=!!tt.texFloat&&this.MAX_VERTEX_TEXTURE_IMAGE_UNITS>0,this.FRAGMENT_TEXTURE_FLOAT=!!tt.texFloat,this.EXT_FRAG_DEPTH=tt.get("EXT_frag_depth"),this.SHADER_TEXTURE_LOD=!!tt.shaderTextureLod,tt.textureFilterAnisotropic&&(this.MAX_TEXTURE_MAX_ANISOTROPY=t.getParameter(tt.textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT))},get:function(t){var e=this.gl,n=this[t];return void 0===n&&(n=this[t]=e.getParameter(e[t])),n},_getMaxSupportPrecision:function(t){var e=this.gl,n="lowp";if(e.getShaderPrecisionFormat)for(var i=[{name:"highp",type:e.HIGH_FLOAT},{name:"mediump",type:e.MEDIUM_FLOAT}],r=0;r0){n=s.name;break}}else n="mediump";return n},getMaxPrecision:function(t,e){return"highp"===t||"mediump"===t&&"lowp"===e?e:t}},nt=n(54),it=n.n(nt),rt=n(55),st=n.n(rt),at=n(56),ot=n.n(at),ut=n(57),ct=n.n(ut),ht=new J,ft=new J,lt=s.a.create({isShader:!0,className:"Shader",vs:"",fs:"",Statics:{commonOptions:{},shaders:{"chunk/baseDefine.glsl":n(18),"chunk/color.frag":n(40),"chunk/color.vert":n(80),"chunk/color_main.vert":n(82),"chunk/diffuse.frag":n(62),"chunk/diffuse_main.frag":n(71),"chunk/extensions.frag":n(25),"chunk/extensions.vert":n(52),"chunk/fog.frag":n(47),"chunk/fog_main.frag":n(73),"chunk/frag_color.frag":n(51),"chunk/joint.vert":n(75),"chunk/joint_main.vert":n(85),"chunk/light.frag":n(44),"chunk/lightFog.frag":n(43),"chunk/lightFog.vert":n(78),"chunk/lightFog_main.frag":n(49),"chunk/lightFog_main.vert":n(88),"chunk/logDepth.frag":n(29),"chunk/logDepth_main.frag":n(30),"chunk/logDepth.vert":n(81),"chunk/logDepth_main.vert":n(89),"chunk/morph.vert":n(79),"chunk/morph_main.vert":n(84),"chunk/normal.frag":n(42),"chunk/normal.vert":n(77),"chunk/normal_main.frag":n(48),"chunk/normal_main.vert":n(87),"chunk/pbr.frag":n(91),"chunk/pbr_main.frag":n(93),"chunk/phong.frag":n(69),"chunk/phong_main.frag":n(72),"chunk/precision.frag":n(26),"chunk/precision.vert":n(53),"chunk/transparency.frag":n(46),"chunk/transparency_main.frag":n(50),"chunk/unQuantize.vert":n(74),"chunk/unQuantize_main.vert":n(83),"chunk/uv.frag":n(41),"chunk/uv.vert":n(76),"chunk/uv_main.vert":n(86),"method/encoding.glsl":n(92),"method/getDiffuse.glsl":n(64),"method/getLightAttenuation.glsl":n(66),"method/getShadow.glsl":n(68),"method/getSpecular.glsl":n(65),"method/packFloat.glsl":n(90),"method/textureEnvMap.glsl":n(45),"method/transpose.glsl":n(63),"method/unpackFloat.glsl":n(67),"basic.frag":n(54),"basic.vert":n(55),"geometry.frag":n(56),"pbr.frag":n(57),"screen.frag":n(58),"screen.vert":n(59)},init:function(t){this.renderer=t,this.commonHeader=this._getCommonHeader(this.renderer)},cache:{get:function(){return ht}},headerCache:{get:function(){return ft}},reset:function(t){ht.removeAll()},getHeaderKey:function(t,e,n,i,r){var s="header_"+e.id+"_"+n.lightInfo.uid;return t.isSkinedMesh&&(s+="_joint"+t.jointNames.length),i&&(s+="_fog_"+i.mode),s+="_"+t.geometry.getShaderKey(),r&&(s+="_fogDepth"),s},getHeader:function(t,e,n,i,r){var s=this.getHeaderKey(t,e,n,i),a=ft.get(s);if(!a||e.isDirty){var o={};Object.assign(o,this.commonOptions);var u=e.lightType;u&&"NONE"!==u&&n.getRenderOption(o),e.getRenderOption(o),t.getRenderOption(o),i&&(o.HAS_FOG=1,i.getRenderOption(o)),r&&(o.USE_LOG_DEPTH=1,et.EXT_FRAG_DEPTH&&(o.USE_EXT_FRAG_DEPTH=1)),o.HAS_NORMAL&&o.NORMAL_MAP&&(o.HAS_TANGENT=1),o.RECEIVE_SHADOWS||(delete o.DIRECTIONAL_LIGHTS_SMC,delete o.SPOT_LIGHTS_SMC,delete o.POINT_LIGHTS_SMC),a="#define SHADER_NAME ".concat(e.className,"\n"),a+=Object.keys(o).map((function(t){return t.indexOf("HILO_CUSTUM_OPTION_")>-1?"#define ".concat(t.replace("HILO_CUSTUM_OPTION_","")," ").concat(o[t]):"#define HILO_".concat(t," ").concat(o[t])})).join("\n")+"\n",ft.add(s,a)}return a},_getCommonHeader:function(t){var e=et.getMaxPrecision(et.MAX_VERTEX_PRECISION,t.vertexPrecision),n=et.getMaxPrecision(et.MAX_FRAGMENT_PRECISION,t.fragmentPrecision),i=et.getMaxPrecision(e,n);return"\n#define HILO_MAX_PRECISION ".concat(i,"\n#define HILO_MAX_VERTEX_PRECISION ").concat(e,"\n#define HILO_MAX_FRAGMENT_PRECISION ").concat(n,"\n")},getShader:function(t,e,n,i,r,s){var a=this.getHeader(t,e,i,r,s);return e.isBasicMaterial||e.isPBRMaterial?this.getBasicShader(e,n,a):e.isShaderMaterial?this.getCustomShader(e.vs,e.fs,a,e.shaderCacheId||e.id,e.useHeaderCache):null},getBasicShader:function(t,e,n){var i="";e&&(i=(i=t.getInstancedUniforms().map((function(t){return t.name}))).join("|"));var r=t.className+":"+i;t.onBeforeCompile&&(r+=":"+(t.shaderCacheId||t.id));var s=ht.get(r);if(!s){var a="",o=st.a;if(t.isBasicMaterial?t.isGeometryMaterial?a+=ot.a:a+=it.a:t.isPBRMaterial&&(a+=ct.a),t.onBeforeCompile){var u=t.onBeforeCompile(o,a);a=u.fs,o=u.vs}if(i){var c=new RegExp("^\\s*uniform\\s+(\\w+)\\s+(".concat(i,");"),"gm");o=o.replace(c,"attribute $1 $2;")}s=this.getCustomShader(o,a,n,r,!0)}if(s){var h=this._getNumId(s);null!==h&&(t._shaderNumId=h)}return s},_getNumId:function(t){var e=t.id.match(/_(\d+)/);return e&&e[1]?parseInt(e[1],10):null},getCustomShader:function(t,e,n,i,r){var s,a=this.commonHeader;return i&&(r&&(i+=":"+n),s=ht.get(i)),s||(s=new lt({vs:a+n+t,fs:a+n+e}),i&&ht.add(i,s)),s}},alwaysUse:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){return this._isDestroyed||(ht.removeObject(this),this._isDestroyed=!0),this}}),dt=lt,mt=n(59),_t=n.n(mt),pt=n(58),gt=n.n(pt),vt=[{name:"FLOAT",byteSize:4,uniformFuncName:"uniform1f",type:"Scalar",size:1},{name:"FLOAT_VEC2",byteSize:8,uniformFuncName:"uniform2f",type:"Vector",size:2},{name:"FLOAT_VEC3",byteSize:12,uniformFuncName:"uniform3f",type:"Vector",size:3},{name:"FLOAT_VEC4",byteSize:16,uniformFuncName:"uniform4f",type:"Vector",size:4},{name:"FLOAT_MAT2",byteSize:16,uniformFuncName:"uniformMatrix2fv",type:"Matrix",size:4},{name:"FLOAT_MAT3",byteSize:36,uniformFuncName:"uniformMatrix3fv",type:"Matrix",size:9},{name:"FLOAT_MAT4",byteSize:64,uniformFuncName:"uniformMatrix4fv",type:"Matrix",size:16},{name:"INT",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"INT_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"INT_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"INT_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"BOOL",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"BOOL_VEC2",byteSize:8,uniformFuncName:"uniform2i",type:"Vector",size:2},{name:"BOOL_VEC3",byteSize:12,uniformFuncName:"uniform3i",type:"Vector",size:3},{name:"BOOL_VEC4",byteSize:16,uniformFuncName:"uniform4i",type:"Vector",size:4},{name:"SAMPLER_2D",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1},{name:"SAMPLER_CUBE",byteSize:4,uniformFuncName:"uniform1i",type:"Scalar",size:1}],Et={},Tt={dict:Et,init:function(t){vt.forEach((function(e){var n,i,r=e.name,s=e.uniformFuncName,a=s+"v";"Matrix"===e.type?n=i=function(e,n){void 0!==n&&t[s](e,!1,n)}:(n=function(e,n){void 0!==n&&t[s](e,n)},i=function(e,n){t[a](e,n)}),Et[t[r]]=Object.assign(e,{glValue:t[r],uniform:n,uniformArray:i})}))},get:function(t){return Et[t]}},Mt=new J,At=s.a.create({Statics:{cache:{get:function(){return Mt}},reset:function(t){Mt.each((function(t){t.destroy()}))},getProgram:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t.id,r=Mt.get(i);return r||(r=new At({state:e,vertexShader:t.vs,fragShader:t.fs,ignoreError:n}),Mt.add(i,r)),r},getBlankProgram:function(t){var e=dt.getCustomShader("void main(){}","precision HILO_MAX_FRAGMENT_PRECISION float;void main(){gl_FragColor = vec4(0.0);}","","__hiloBlankShader");return this.getProgram(e,t,!0)}},className:"Program",isProgram:!0,fragShader:"",vertexShader:"",attributes:null,uniforms:null,program:null,gl:null,state:null,alwaysUse:!1,constructor:function(t){return this.id=d.a.generateUUID(this.className),Object.assign(this,t),this._dict={},this.attributes={},this.uniforms={},this.gl=this.state.gl,this.program=this.createProgram(),this.program?(this.initAttributes(),this.initUniforms(),this):this.ignoreError?this:At.getBlankProgram(t.state)},createProgram:function(){var t=this.gl,e=t.createProgram(),n=this.createShader(t.VERTEX_SHADER,this.vertexShader),i=this.createShader(t.FRAGMENT_SHADER,this.fragShader);if(n&&i){if(t.attachShader(e,n),t.attachShader(e,i),t.linkProgram(e),t.deleteShader(n),t.deleteShader(i),!t.getProgramParameter(e,t.LINK_STATUS)){var r=t.getProgramInfoLog(e);return m.a.error("compileProgramError: "+r,this),t.deleteProgram(e),null}return e}return null},useProgram:function(){this.state.useProgram(this.program)},createShader:function(t,e){var n=this.gl,i=n.createShader(t);if(n.shaderSource(i,e),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS)){var r=n.getShaderInfoLog(i);return m.a.error("compileShaderError: "+r,e.split("\n").map((function(t,e){return"".concat(e+1," ").concat(t)})).join("\n")),null}return i},initAttributes:function(){for(var t=this,e=this.gl,n=this.program,i=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES),r=tt.instanced,s=function(i){var s=e.getActiveAttrib(n,i),a=s.name,o=s.type,u=s.size,c=e.getAttribLocation(n,a),h=Tt.get(o),f=function(t){var n=t.type,i=void 0===n?e.FLOAT:n,r=t.normalized,s=void 0!==r&&r,a=t.stride,o=void 0===a?0:a,u=t.offset,f=void 0===u?0:u;e.vertexAttribPointer(c,h.size,i,s,o,f)},l=function(){e.enableVertexAttribArray(c)},d=function(){},m=function(t,e){t[c]=e};if(r&&(d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;r.vertexAttribDivisorANGLE(c,t)}),"Matrix"===h.type){var _=h.byteSize,p=h.size,g=Math.sqrt(p),v=4*g,E=function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:1;E((function(e){r.vertexAttribDivisorANGLE(e,t)}))})}t.attributes[a]={name:a,location:c,type:o,size:u,glTypeInfo:h,pointer:f,enable:l,divisor:d,addTo:m}},a=0;a1||o>1?function(t){f(c,t)}:function(e){t._dict[a]!==e&&(t._dict[a]=e,l(c,e))}})},a=0;a2&&void 0!==arguments[2]?arguments[2]:St;return this.createBuffer(t,Lt,e,n)},createBuffer:function(t,e,n,i){var r=n.bufferViewId,s=Rt.get(r);return s||(n.isDirty=!1,s=new yt(t,e,n.data,i),Rt.add(r,s),s)},createIndexBuffer:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:St;return this.createBuffer(t,Ot,e,n)}},className:"Buffer",isBuffer:!0,constructor:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:St;this.id=d.a.generateUUID(this.className),this.gl=t,this.target=e,this.usage=i,this.buffer=t.createBuffer(),n&&this.bufferData(n)},bind:function(){return this.gl.bindBuffer(this.target,this.buffer),this},bufferData:function(t){var e=this.gl,n=this.target,i=this.usage;return this.bind(),e.bufferData(n,t,i),this.data=t,this},bufferSubData:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.gl,r=this.target;return n||this.bind(),i.bufferSubData(r,t,e),this},uploadGeometryData:function(t){var e=this,n=t.subDataList;return!this.data||this.data.byteLength2&&void 0!==arguments[2]?arguments[2]:0,i=0,r=e.length;i0&&void 0!==arguments[0]?arguments[0]:1;this.bind();var e=this.gl,n=this.mode;this.useInstanced&&(this.indexBuffer?this.instancedExtension.drawElementsInstancedANGLE(n,this.vertexCount,e.UNSIGNED_SHORT,0,t):this.instancedExtension.drawArraysInstancedANGLE(n,0,this.getVertexCount(),t))},addIndexBuffer:function(t,e){this.bind();var n=this.gl,i=this.indexBuffer;return this.indexType=t.type,i?t.isDirty&&(i.uploadGeometryData(t),this.vertexCount=t.length):((i=xt.createIndexBuffer(n,t,e)).bind(),this.indexBuffer=i,this.vertexCount=t.length),i},addAttribute:function(t,e,n,i){this.bind();var r=this.gl,s=e.name,a=this[s];if(a)t.isDirty&&a.buffer.uploadGeometryData(t);else{var o=xt.createVertexBuffer(r,t,n);o.bind(),e.enable(),e.pointer(t),a={attribute:e,buffer:o,geometryData:t},this.attributes.push(a),this[s]=a,e.addTo(this.activeStates,a),i&&i(a)}return a},addInstancedAttribute:function(t,e,n){this.bind();var i=this.gl,r=t.name,s=t.glTypeInfo,a=bt.getTypedArray(Float32Array,e.length*s.size);e.forEach((function(t,e){void 0!==n(t)?bt.fillArrayData(a,n(t),e*s.size):m.a.warn("no attributeData:"+r+"-"+t.name)}));var o,u=this[r];return u?(o=u.geometryData).data=a:o=new C(a,1),this.addAttribute(o,t,i.DYNAMIC_DRAW,(function(e){t.divisor(1),e.useInstanced=!0}))},useResource:function(t,e){return this.attributes.forEach((function(n){t.useResource(n.buffer,e)})),this.indexBuffer&&t.useResource(this.indexBuffer,e),this},destroyIfNoRef:function(t){return t.resourceManager.destroyIfNoRef(this),this},destroy:function(){var t=this;return this._isDestroyed||(this.useVao&&this.vaoExtension.deleteVertexArrayOES(this.vao),this.gl=null,this.indexBuffer=null,this.attributes.forEach((function(e){t[e.name]=null})),this.attributes=null,this.activeStates=null,Ht.removeObject(this),this._isDestroyed=!0),this}}),Ft=Dt,Ut=P.a.TEXTURE_2D,Gt=P.a.RGBA,Bt=P.a.LINEAR,Vt=P.a.NEAREST,Xt=P.a.REPEAT,jt=P.a.CLAMP_TO_EDGE,zt=P.a.UNSIGNED_BYTE,kt=new J,qt=s.a.create({Statics:{cache:{get:function(){return kt}},reset:function(t){kt.each((function(e,n){t.deleteTexture(e),kt.remove(n)}))}},isTexture:!0,className:"Texture",isImageCanRelease:!1,_isImageReleased:!1,_image:null,image:{get:function(){return this._isImageReleased&&m.a.errorOnce("Read Texture.image(".concat(this.id,")"),"Read Texture.image after image released!"),this._image},set:function(t){this._image=t,this._isImageReleased=!1}},_releaseImage:function(){this._canvasImage=null,this._canvasCtx=null,this._originImage=null,this._image=null,this.mipmaps=null,this._isImageReleased=!0},mipmaps:null,target:Ut,internalFormat:Gt,format:Gt,type:zt,width:0,height:0,border:0,magFilter:Bt,minFilter:Bt,wrapS:Xt,wrapT:Xt,name:"",premultiplyAlpha:!1,flipY:!1,compressed:!1,needUpdate:!0,needDestroy:!1,autoUpdate:!1,uv:0,anisotropic:1,origWidth:{get:function(){return this._originImage?this._originImage.width||this.width:this.image&&this.image.width||this.width}},origHeight:{get:function(){return this.originImage?this._originImage.height||this.height:this.image&&this.image.height||this.height}},useMipmap:{get:function(){return this.minFilter!==Bt&&this.minFilter!==Vt},set:function(){m.a.warn("texture.useMipmap is readOnly!")}},useRepeat:{get:function(){return this.wrapS!==jt||this.wrapT!==jt},set:function(){m.a.warn("texture.useRepeat is readOnly!")}},mipmapCount:{get:function(){return Math.floor(Math.log2(Math.max(this.width,this.height))+1)},set:function(){m.a.warn("texture.mipmapCount is readOnly!")}},constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},isImgPowerOfTwo:function(t){return d.a.isPowerOfTwo(t.width)&&d.a.isPowerOfTwo(t.height)},getSupportSize:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.width,i=t.height;e&&!this.isImgPowerOfTwo(t)&&(n=d.a.nextPowerOfTwo(n),i=d.a.nextPowerOfTwo(i));var r=et.MAX_TEXTURE_SIZE;return r&&(n>r&&(n=r),i>r&&(i=r)),{width:n,height:i}},resizeImgToPowerOfTwo:function(t){var e=this.getSupportSize(t,!0);return this.resizeImg(t,e.width,e.height)},resizeImg:function(t,e,n){if(t.width===e&&t.height===n)return t;var i=this._canvasImage;return i?(i.width=e,i.height=n,this._canvasCtx=i.getContext("2d")):((i=document.createElement("canvas")).width=e,i.height=n,this._canvasImage=i,this._canvasCtx=i.getContext("2d")),this._canvasCtx.drawImage(t,0,0,t.width,t.height,0,0,e,n),m.a.warnOnce("Texture.resizeImg(".concat(this.id,")"),"image size(".concat(t.width,"x").concat(t.height,") is not support. Resized to ").concat(i.width,"x").concat(i.height),t.src),this._originImage=t,i},_glUploadTexture:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.width,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.height,a=t.gl;return this.compressed?a.compressedTexImage2D(e,i,this.internalFormat,r,s,this.border,n):n&&void 0!==n.width?a.texImage2D(e,i,this.internalFormat,this.format,this.type,n):a.texImage2D(e,i,this.internalFormat,r,s,this.border,this.format,this.type,n),this},_uploadTexture:function(t){var e=this;return this.useMipmap&&this.mipmaps?this.mipmaps.forEach((function(n,i){e._glUploadTexture(t,e.target,n.data,i,n.width,n.height)})):this._glUploadTexture(t,this.target,this.image,0),this},updateTexture:function(t,e){var n=t.gl;if(this.needUpdate||this.autoUpdate){this._originImage&&this.image===this._canvasImage&&(this.image=this._originImage);var i=this.useMipmap,r=this.useRepeat;if(this.image&&!this.image.length){var s=r||i,a=this.getSupportSize(this.image,s);this.image=this.resizeImg(this.image,a.width,a.height),this.width=this.image.width,this.height=this.image.height}t.activeTexture(n.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),t.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!!this.flipY);var o=tt.textureFilterAnisotropic;o&&this.anisotropic>1&&n.texParameterf(this.target,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(this.anisotropic,et.MAX_TEXTURE_MAX_ANISOTROPY)),this._uploadTexture(t),i&&(this.compressed?this.mipmaps||(m.a.warn("Compressed texture has no mipmips, changed the minFilter from ".concat(this.minFilter," to Linear!"),this),this.minFilter=Bt):n.generateMipmap(this.target)),n.texParameterf(this.target,n.TEXTURE_MAG_FILTER,this.magFilter),n.texParameterf(this.target,n.TEXTURE_MIN_FILTER,this.minFilter),n.texParameterf(this.target,n.TEXTURE_WRAP_S,this.wrapS),n.texParameterf(this.target,n.TEXTURE_WRAP_T,this.wrapT),this.needUpdate=!1}return this._needUpdateSubTexture&&(this._uploadSubTextures(t,e),this._needUpdateSubTexture=!1),this},_uploadSubTextures:function(t,e){var n=this;if(this._subTextureList&&this._subTextureList.length>0){var i=t.gl;t.activeTexture(i.TEXTURE0+et.MAX_TEXTURE_INDEX),t.bindTexture(this.target,e),t.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!!this.flipY),this._subTextureList.forEach((function(t){var e=t[0],r=t[1],s=t[2];i.texSubImage2D(n.target,0,e,r,n.format,n.type,s)})),this._subTextureList.length=0}},_needUpdateSubTexture:!1,_subTextureList:null,updateSubTexture:function(t,e,n){this._subTextureList||(this._subTextureList=[]),this._subTextureList.push([t,e,n]),this._needUpdateSubTexture=!0},getGLTexture:function(t){this.state=t;var e=this.gl=t.gl,n=this.id;this.needDestroy&&(this.destroy(),this.needDestroy=!1);var i=kt.get(n);return i||(i=e.createTexture(),kt.add(n,i),this.needUpdate=!0),this.updateTexture(t,i),this.isImageCanRelease&&this._releaseImage(),i},setGLTexture:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&this.destroy(),kt.add(this.id,t),this},destroy:function(){var t=this.id,e=kt.get(t);return e&&this.gl&&(this.gl.deleteTexture(e),kt.remove(t)),this},clone:function(){var t=Object.assign({},this);return delete t.id,new this.constructor(t)}}),Wt=P.a.TEXTURE_2D,Yt=P.a.RGBA,Zt=P.a.UNSIGNED_BYTE,Kt=P.a.COLOR_ATTACHMENT0,Qt=P.a.DEPTH_STENCIL,Jt=P.a.DEPTH_TEST,$t=P.a.CULL_FACE,te=P.a.TRIANGLE_STRIP,ee=P.a.NEAREST,ne=P.a.CLAMP_TO_EDGE,ie=new J,re=s.a.create({Statics:{cache:{get:function(){return ie}},reset:function(t){ie.each((function(t){t.reset()}))},destroy:function(t){ie.each((function(t){t.destroy()}))}},className:"Framebuffer",isFramebuffer:!0,bufferInternalFormat:Qt,target:Wt,format:Yt,internalFormat:Yt,type:Zt,minFilter:ee,magFilter:ee,data:null,attachment:Kt,needRenderbuffer:!0,useVao:!0,renderer:null,texture:null,renderbuffer:null,framebuffer:null,_isInit:!1,constructor:function(t,e){this.id=d.a.generateUUID(this.className),this.renderer=t,Object.assign(this,e),this.width||(this.width=t.width),this.height||(this.height=t.height),ie.add(this.id,this)},init:function(){if(!this._isInit&&this.renderer.isInit){this._isInit=!0;var t=this.renderer;this.gl=t.gl,this.state=t.state,this.reset()}},reset:function(){this.destroyResource();var t=this.gl;this.framebuffer=t.createFramebuffer(),this.bind(),this.needRenderbuffer&&(this.renderbuffer=this.createRenderbuffer()),this.texture=this.createTexture(),this.isComplete()||m.a.warn("Framebuffer is not complete => "+t.checkFramebufferStatus(t.FRAMEBUFFER)),this.unbind()},isComplete:function(){var t=this.gl;return!(!t||t.checkFramebufferStatus(t.FRAMEBUFFER)!==t.FRAMEBUFFER_COMPLETE)},bind:function(){this.init(),this._isInit&&this.state.bindFramebuffer(this.gl.FRAMEBUFFER,this.framebuffer)},unbind:function(){if(this.init(),this._isInit){var t=this.state;t.bindFramebuffer(this.gl.FRAMEBUFFER,t.preFramebuffer)}},clear:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new v.a(0,0,0,0);if(this._isInit){var e=this.gl;e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}},render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4?arguments[4]:void 0;if(this._isInit){var s=this.gl,a=this.state;a.disable(Jt),a.disable($t),r&&this.clear(r);var o=dt.getCustomShader(_t.a,gt.a,"","FramebufferTextureShader"),u=It.getProgram(o,a);u.useProgram();var c="".concat(t,"_").concat(e,"_").concat(n,"_").concat(i,"_").concat(u.id),h=Ft.getVao(s,c,{useVao:this.useVao,useInstanced:!1,mode:te});if(h.isDirty){h.isDirty=!1;var f=[t=2*t-1,e=1-2*e,t+(n*=2),e,t,e-(i*=2),t+n,e-i];h.addAttribute(new C(new Float32Array(f),2),u.attributes.a_position),h.addAttribute(new C(new Float32Array([0,1,1,1,0,0,1,0]),2),u.attributes.a_texcoord0)}a.activeTexture(s.TEXTURE0),a.bindTexture(s.TEXTURE_2D,this.texture.getGLTexture(a)),h.draw()}},createRenderbuffer:function(){var t=this.gl,e=this.width,n=this.height,i=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,i),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,i),i},createTexture:function(){var t=this.state,e=t.gl,n=new qt({minFilter:this.minFilter,magFilter:this.magFilter,internalFormat:this.internalFormat,format:this.format,type:this.type,width:this.width,height:this.height,image:this.data,wrapS:ne,wrapT:ne}),i=n.getGLTexture(t);return e.framebufferTexture2D(e.FRAMEBUFFER,this.attachment,this.target,i,0),n},resize:function(t,e,n){(n||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this._isInit&&this.reset())},readPixels:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=Object(r.getTypedArrayClass)(this.type),a=new s(n*i*4);if(this._isInit){var o=this.gl;e=this.height-e-i,this.bind(),o.readPixels(t,e,n,i,this.format,this.type,a),this.unbind()}return a},destroy:function(){this.destroyResource(),this.gl=null,ie.removeObject(this)},destroyResource:function(){var t=this.gl;t&&(this.framebuffer&&(t.deleteFramebuffer(this.framebuffer),this.framebuffer=null),this.renderbuffer&&(t.deleteRenderbuffer(this.renderbuffer),this.renderbuffer=null),this.texture&&(this.texture.destroy(),this.texture=null))}}),se=P.a.TEXTURE_CUBE_MAP,ae=P.a.RGB,oe=P.a.LINEAR,ue=P.a.CLAMP_TO_EDGE,ce=P.a.TEXTURE_CUBE_MAP_POSITIVE_X,he=s.a.create({Extends:qt,isCubeTexture:!0,className:"CubeTexture",target:se,internalFormat:ae,format:ae,magFilter:oe,minFilter:oe,wrapS:ue,wrapT:ue,constructor:function(t){he.superclass.constructor.call(this,t),this.image=this.image||[]},_uploadTexture:function(t){var e=this,n=this.image;Array.isArray(n)&&6===n.length?(n[0]&&n[0].width&&(this.width=n[0].width,this.height=n[0].height),n.forEach((function(n,i){e._glUploadTexture(t,ce+i,n,0)}))):m.a.error("CubeTexture image must be an Array of length 6",n)},right:{get:function(){return this.image[0]},set:function(t){this.image[0]=t}},left:{get:function(){return this.image[1]},set:function(t){this.image[1]=t}},top:{get:function(){return this.image[2]},set:function(t){this.image[2]=t}},bottom:{get:function(){return this.image[3]},set:function(t){this.image[3]=t}},front:{get:function(){return this.image[4]},set:function(t){this.image[4]=t}},back:{get:function(){return this.image[5]},set:function(t){this.image[5]=t}}}),fe=he,le=P.a.TEXTURE_2D,de=P.a.RGBA,me=P.a.NEAREST,_e=P.a.CLAMP_TO_EDGE,pe=P.a.FLOAT,ge=s.a.create({Extends:qt,isDataTexture:!0,className:"DataTexture",target:le,internalFormat:de,format:de,type:pe,magFilter:me,minFilter:me,wrapS:_e,wrapT:_e,dataLength:0,resetSize:function(t){if(t!==this.dataLength){this.dataLength=t;var e=d.a.nextPowerOfTwo(t/4),n=Math.max(Math.log2(e),4),i=Math.floor(n/2),s=n-i;this.width=Math.pow(2,i),this.height=Math.pow(2,s),this.DataClass=Object(r.getTypedArrayClass)(this.type)}},data:{get:function(){return this.image},set:function(t){if(this.image!==t){this.resetSize(t.length);var e=this.width*this.height*4;e===t.length&&t instanceof this.DataClass?this.image=t:(this.image&&this.image.length===e||(this.image=new this.DataClass(e)),this.image.set(t,0)),this.needUpdate=!0}}},constructor:function(t){ge.superclass.constructor.call(this,t)}}),ve=ge;function Ee(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Te(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Te(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=this.lightType;e["LIGHT_TYPE_".concat(n)]=1,e.SIDE=this.side,"NONE"!==n&&(e.HAS_LIGHT=1),this.premultiplyAlpha&&(e.PREMULTIPLY_ALPHA=1);var i=this._textureOption.reset(e);return e.HAS_LIGHT&&(e.HAS_NORMAL=1,i.add(this.normalMap,"NORMAL_MAP",(function(){1!==t.normalMapScale&&(e.NORMAL_MAP_SCALE=1)}))),i.add(this.parallaxMap,"PARALLAX_MAP"),i.add(this.emission,"EMISSION_MAP"),i.add(this.transparency,"TRANSPARENCY_MAP"),this.ignoreTranparent&&(e.IGNORE_TRANSPARENT=1),this.alphaCutoff>0&&(e.ALPHA_CUTOFF=1),this.useHDR&&(e.USE_HDR=1),this.gammaCorrection&&(e.GAMMA_CORRECTION=1),this.receiveShadows&&(e.RECEIVE_SHADOWS=1),this.castShadows&&(e.CAST_SHADOWS=1),this.uvMatrix&&(e.UV_MATRIX=1),this.uvMatrix1&&(e.UV_MATRIX1=1),this.usePhysicsLight&&(e.USE_PHYSICS_LIGHT=1),this.isDiffuesEnvAndAmbientLightWorkTogether&&(e.IS_DIFFUESENV_AND_AMBIENTLIGHT_WORK_TOGETHER=1),i.update(),e},_textureOption:{uvTypes:null,option:null,reset:function(t){return this.option=t,this.uvTypes={},this},add:function(t,e,n){if(t&&t.isTexture){var i=this.uvTypes,r=this.option,s=t.uv||0;i[s]=1,r[e]=s,t.isCubeTexture&&(r["".concat(e,"_CUBE")]=1),n&&n(t)}return this},update:function(){var t=[0,1],e=this.uvTypes,n=this.option;for(var i in e)-1!==t.indexOf(Number(i))?n["HAS_TEXCOORD".concat(i)]=1:(m.a.warnOnce("Material._textureOption.update(".concat(i,")"),"uv_".concat(i," not support!")),n.HAS_TEXCOORD0=1);return this}},getInstancedUniforms:function(){var t=this._instancedUniforms;if(!this._instancedUniforms){var e=this.uniforms;for(var n in t=this._instancedUniforms=[],e){var i=this.getUniformInfo(n);i.isDependMesh&&!i.notSupportInstanced&&t.push({name:n,info:i})}}return t},getUniformData:function(t,e,n){return this.getUniformInfo(t).get(e,this,n)},getAttributeData:function(t,e,n){return this.getAttributeInfo(t).get(e,this,n)},getUniformInfo:function(t){return this.getInfo("uniforms",t)},getAttributeInfo:function(t){return this.getInfo("attributes",t)},getInfo:function(t,e){var n=this[t][e];return"string"==typeof n&&(n=Pe[n]),n&&n.get||(m.a.warnOnce("material.getInfo-"+e,"Material.getInfo: no this semantic:"+e),n=je),n},clone:function(){var t=new this.constructor;for(var e in this)"id"!==e&&(t[e]=this[e]);return t},destroyTextures:function(){this.getTextures().forEach((function(t){t.destroy()}))},getTextures:function(){var t=[];for(var e in this){var n=this[e];n&&n.isTexture&&t.push(n)}return t},_copyProps:function(t,e){for(var n in e)void 0===t[n]&&(t[n]=e[n])}}),ke=s.a.create({Extends:ze,isBasicMaterial:!0,className:"BasicMaterial",lightType:"BLINN-PHONG",diffuse:null,ambient:null,specular:null,emission:null,specularEnvMap:null,specularEnvMatrix:null,reflectivity:0,refractRatio:0,refractivity:0,shininess:32,usedUniformVectors:11,constructor:function(t){this.diffuse=new v.a(.5,.5,.5),this.specular=new v.a(1,1,1),this.emission=new v.a(0,0,0),ke.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT",u_shininess:"SHININESS",u_reflectivity:"REFLECTIVITY",u_refractRatio:"REFRACTRATIO",u_refractivity:"REFRACTIVITY",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvMatrix:"SPECULARENVMATRIX"}),this.addTextureUniforms({u_diffuse:"DIFFUSE",u_specular:"SPECULAR",u_ambient:"AMBIENT"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ke.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t),n=this.lightType;"PHONG"!==n&&"BLINN-PHONG"!==n||(t.HAS_SPECULAR=1);var i=this.diffuse;return i&&i.isTexture&&(i.isCubeTexture?t.DIFFUSE_CUBE_MAP=1:e.add(this.diffuse,"DIFFUSE_MAP")),t.HAS_LIGHT&&(e.add(this.specular,"SPECULAR_MAP"),e.add(this.ambient,"AMBIENT_MAP"),e.add(this.specularEnvMap,"SPECULAR_ENV_MAP")),e.update(),t}}),qe=ke,We=P.a.POSITION,Ye=P.a.NORMAL,Ze=P.a.DEPTH,Ke=P.a.DISTANCE,Qe=P.a.NONE,Je=s.a.create({Extends:qe,isGeometryMaterial:!0,className:"GeometryMaterial",vertexType:We,lightType:Qe,writeOriginData:!1,constructor:function(t){Je.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_cameraFar:"CAMERAFAR",u_cameraNear:"CAMERANEAR",u_cameraType:"CAMERATYPE"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(Je.superclass.getRenderOption.call(this,t),t["VERTEX_TYPE_".concat(this.vertexType)]=1,this.vertexType){case We:t.HAS_FRAG_POS=1;break;case Ye:t.HAS_NORMAL=1;break;case Ze:break;case Ke:t.HAS_FRAG_POS=1}return this.writeOriginData&&(t.WRITE_ORIGIN_DATA=1),t}}),$e=Je,tn=s.a.create({Extends:O,isOrthographicCamera:!0,className:"OrthographicCamera",_left:-1,left:{get:function(){return this._left},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._left=t}},_right:1,right:{get:function(){return this._right},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._right=t}},_bottom:-1,bottom:{get:function(){return this._bottom},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._bottom=t}},_top:1,top:{get:function(){return this._top},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._top=t}},_near:.1,near:{get:function(){return this._near},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._near=t}},_far:1,far:{get:function(){return this._far},set:function(t){this._needUpdateProjectionMatrix=!0,this._isGeometryDirty=!0,this._far=t}},constructor:function(t){tn.superclass.constructor.call(this,t),this.updateProjectionMatrix()},updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},getGeometry:function(t){if(t||!this._geometry||this._isGeometryDirty){this._isGeometryDirty=!1;var e=new Z,n=[this.left,this.bottom,-this.near],i=[this.right,this.bottom,-this.near],r=[this.right,this.top,-this.near],s=[this.left,this.top,-this.near],a=[this.left,this.bottom,-this.far],o=[this.right,this.bottom,-this.far],u=[this.right,this.top,-this.far],c=[this.left,this.top,-this.far];e.addRect(a,o,u,c),e.addRect(o,i,r,u),e.addRect(i,n,s,r),e.addRect(n,a,c,s),e.addRect(c,u,r,s),e.addRect(n,i,o,a),this._geometry=e}return this._geometry}}),en=tn,nn=P.a.DEPTH,rn=P.a.BACK,sn=null,an=new v.a(1,1,1),on=new o.a,un=function(t){return t.material.castShadows},cn=s.a.create({isLightShadow:!0,className:"LightShadow",light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,cameraInfo:null,debug:!1,constructor:function(t){this.id=d.a.generateUUID(this.className),Object.assign(this,t)},createFramebuffer:function(){this.framebuffer||(this.framebuffer=new re(this.renderer,{width:this.width,height:this.height}),this.debug&&this.showShadowMap())},updateLightCamera:function(t){this.light.isDirectionalLight?this.updateDirectionalLightCamera(t):this.light.isSpotLight&&this.updateSpotLightCamera(t)},updateDirectionalLightCamera:function(t){var e=this.light;if(this.camera.lookAt(e.direction),this.cameraInfo)this.updateCustumCamera(this.cameraInfo);else{var n=t.getGeometry();if(n){this.camera.updateViewMatrix(),on.multiply(this.camera.viewMatrix,t.worldMatrix);var i=n.getBounds(on);this.camera.near=-i.zMax,this.camera.far=-i.zMin,this.camera.left=i.xMin,this.camera.right=i.xMax,this.camera.bottom=i.yMin,this.camera.top=i.yMax}}this.camera.updateViewMatrix()},updateCustumCamera:function(t){for(var e in t)this.camera[e]=t[e]},updateSpotLightCamera:function(t){var e=this.light;this.camera.lookAt(e.direction),this.cameraInfo?this.updateCustumCamera(this.cameraInfo):(this.camera.fov=2*e.outerCutoff,this.camera.near=.01,this.camera.far=t.far,this.camera.aspect=1),this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.light.isDirectionalLight?this.camera=new en:this.light.isSpotLight&&(this.camera=new Q),this.camera.addTo(this.light)),this._cameraMatrixVersion!==t.matrixVersion&&(this.updateLightCamera(t),this._cameraMatrixVersion=t.matrixVersion)},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;sn||(sn=new $e({vertexType:nn,side:rn,writeOriginData:!0})),n.bind(),e.state.viewport(0,0,this.width,this.height),e.clear(an),i.updateViewProjectionMatrix(),Pe.setCamera(i),e.forceMaterial=sn,this.renderShadowScene(e),delete e.forceMaterial,n.unbind(),Pe.setCamera(t),e.viewport()},renderShadowScene:function(t){t.renderList.traverse((function(e){un(e)&&t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e.filter((function(t){return un(t)})))}))},showShadowMap:function(){var t=this;this.renderer.on("afterRender",(function(){t.framebuffer.render(0,.7,.3,.3)}))}}),hn=P.a.DISTANCE,fn=P.a.BACK,ln=P.a.TEXTURE_CUBE_MAP,dn=P.a.TEXTURE0,mn=P.a.TEXTURE_CUBE_MAP_POSITIVE_X,_n=P.a.NEAREST,pn=P.a.FRAMEBUFFER,gn=P.a.FRAMEBUFFER_COMPLETE,vn=null,En=new v.a(0,0,0,0),Tn=new c.a,Mn=[[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,-1,0,0,-1,0,0,0,1,0,0,-1,0,-1,0,0,-1,0]],An=function(t,e){if(t.material.castShadows){if(!t.frustumTest)return!0;if(e.isMeshVisible(t))return!0}return!1},In=s.a.create({isLightShadow:!0,className:"CubeLightShadow",Extends:cn,light:null,renderer:null,framebuffer:null,camera:null,width:1024,height:1024,maxBias:.05,minBias:.005,debug:!1,constructor:function(t){In.superclass.constructor.call(this,t)},createFramebuffer:function(){if(!this.framebuffer){this.framebuffer=new re(this.renderer,{target:ln,width:1024,height:1024,createTexture:function(){var t=this.state.gl,e=new fe({image:[null,null,null,null,null,null],type:this.type,format:this.format,internalFormat:this.internalFormat,magFilter:_n,minFilter:_n,width:1024,height:1024});return t.checkFramebufferStatus(pn)!==gn&&m.a.warn("Framebuffer is not complete",t.checkFramebufferStatus(pn)),e},bindTexture:function(t){t=t||0;var e=this.state,n=e.gl,i=this.texture.getGLTexture(e);e.activeTexture(dn+et.MAX_TEXTURE_INDEX),e.bindTexture(this.target,i),n.framebufferTexture2D(pn,this.attachment,mn+t,i,0)}})}},updateLightCamera:function(t){this.camera.fov=90,this.camera.near=t.near,this.camera.far=t.far,this.camera.aspect=1,this.camera.updateViewMatrix()},createCamera:function(t){this.camera||(this.camera=new Q,this.updateLightCamera(t))},createShadowMap:function(t){this.createFramebuffer(),this.createCamera(t);var e=this.renderer,n=this.framebuffer,i=this.camera;vn||(vn=new $e({vertexType:hn,side:fn,writeOriginData:!1})),n.bind(),e.state.viewport(0,0,n.width,n.height),this.light.worldMatrix.getTranslation(i.position);for(var r=0;r<6;r++)n.bindTexture(r),Tn.fromArray(Mn[0],3*r).add(i.position),i.up.fromArray(Mn[1],3*r),i.lookAt(Tn),i.updateViewProjectionMatrix(),e.clear(En),Pe.setCamera(i),e.forceMaterial=vn,this.renderShadowScene(e);i.matrix.identity(),i.updateViewProjectionMatrix(),delete e.forceMaterial,n.unbind(),Pe.setCamera(t),e.viewport()},renderShadowScene:function(t){var e=t.renderList,n=this.camera;e.traverse((function(e){An(e,n)&&t.renderMesh(e)}),(function(e){var i=e.filter((function(t){return An(t,n)}));t.renderInstancedMeshes(i)}))}}),Ln=In,On=s.a.create({Extends:M,isPointLight:!0,className:"PointLight",constructor:function(t){On.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new Ln({light:this,renderer:t}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))}}),Sn=On,Rn=new o.a,yn=new c.a,xn=s.a.create({Extends:M,isDirectionalLight:!0,className:"DirectionalLight",shadow:null,constructor:function(t){this.direction=new c.a(0,0,1),xn.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new cn({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return yn.copy(this.direction).transformDirection(this.worldMatrix).normalize(),yn},getViewDirection:function(t){var e=t.getModelViewMatrix(this,Rn);return yn.copy(this.direction).transformDirection(e).normalize(),yn}}),Nn=xn,bn=new o.a,Cn=new c.a,Pn=s.a.create({Extends:M,isSpotLight:!0,className:"SpotLight",shadow:null,_cutoffCos:.9763,_cutoff:12.5,cutoff:{get:function(){return this._cutoff},set:function(t){this._cutoff=t,this._cutoffCos=Math.cos(d.a.degToRad(t))}},_outerCutoffCos:.9537,_outerCutoff:17.5,outerCutoff:{get:function(){return this._outerCutoff},set:function(t){this._outerCutoff=t,this._outerCutoffCos=Math.cos(d.a.degToRad(t))}},constructor:function(t){this.direction=new c.a(0,0,1),Pn.superclass.constructor.call(this,t)},createShadowMap:function(t,e){this.shadow&&(this.lightShadow||(this.lightShadow=new cn({light:this,renderer:t,width:this.shadow.width||t.width,height:this.shadow.height||t.height,debug:this.shadow.debug,cameraInfo:this.shadow.cameraInfo}),"minBias"in this.shadow&&(this.lightShadow.minBias=this.shadow.minBias),"maxBias"in this.shadow&&(this.lightShadow.maxBias=this.shadow.maxBias)),this.lightShadow.createShadowMap(e))},getWorldDirection:function(){return Cn.copy(this.direction).transformDirection(this.worldMatrix).normalize(),Cn},getViewDirection:function(t){var e=t.getModelViewMatrix(this,bn);return Cn.copy(this.direction).transformDirection(e).normalize(),Cn}}),wn=Pn,Hn=s.a.create({Extends:ze,isShaderMaterial:!0,className:"ShaderMaterial",vs:"",fs:"",useHeaderCache:!1,constructor:function(t){Hn.superclass.constructor.call(this,t)},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Hn.superclass.getRenderOption.call(this,t),this.getCustomRenderOption){var e=this.getCustomRenderOption({});for(var n in e)t["HILO_CUSTUM_OPTION_".concat(n)]=e[n]}return t},getCustomRenderOption:null}),Dn=Hn,Fn=n(15),Un=n.n(Fn),Gn=s.a.create({Extends:Z,isMorphGeometry:!0,className:"MorphGeometry",isStatic:!1,weights:[],targets:null,constructor:function(t){Gn.superclass.constructor.call(this,t),this.weights=this.weights||[]},update:function(t,e){this.weights=t,this._originalMorphIndices=e},clone:function(){return Z.prototype.clone.call(this,{targets:this.targets,weights:this.weights})},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Gn.superclass.getRenderOption.call(this,e),this.targets&&(this._maxMorphTargetCount||(this._maxMorphTargetCount=Math.floor(8/Object.keys(this.targets).length)),Object(r.each)(this.targets,(function(n,i){e.MORPH_TARGET_COUNT=Math.min(n.length,t._maxMorphTargetCount),"vertices"===i?e.MORPH_HAS_POSITION=1:"normals"===i?e.MORPH_HAS_NORMAL=1:"tangents"===i&&(e.MORPH_HAS_TANGENT=1)}))),e}}),Bn=Gn,Vn={POSITION:{name:"vertices",decodeMatName:"positionDecodeMat"},TEXCOORD_0:{name:"uvs",decodeMatName:"uvDecodeMat"},TEXCOORD_1:{name:"uvs1",decodeMatName:"uv1DecodeMat"},NORMAL:{name:"normals",decodeMatName:"normalDecodeMat"},JOINT:{name:"skinIndices"},JOINTS_0:{name:"skinIndices"},WEIGHT:{name:"skinWeights"},WEIGHTS_0:{name:"skinWeights"},TANGENT:{name:"tangents"},COLOR_0:{name:"colors"}},Xn={Geometry:Z,GeometryData:C};var jn={_decodeTotalTime:0,wasmURL:"",workerURL:"",useWASM:!0,useWebWorker:!0,useAuto:!0,init:function(){return jn.useAuto?Un.a.initWASM(jn.wasmURL,jn.memPages):jn.useWebWorker?Un.a.initWorker(jn.workerURL):jn.useWASM?Un.a.initWASM(jn.wasmURL,jn.memPages):Promise.resolve()},parse:function(t,e,n,i){var r=Date.now(),s=e.bufferViews[t.bufferView],a=jn.wasmURL,o=jn.workerURL,u=jn.useAuto,c=jn.useWASM,h=jn.useWebWorker,f=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);function l(e){jn._decodeTotalTime+=Date.now()-r;var n=e.toHilo3dGeometry(Xn,i.primitive._geometry);return t.targets&&(n=function(t,e,n){if(!n.isMorphGeometry){var i=new Bn;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&"id"!==r&&(i[r]=n[r]);i.targets={},n=i}for(var s=n.targets,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return t["FOG_".concat(this.mode)]=1,t}}),ei=n(16),ni=new ei.a,ii=new o.a,ri=s.a.create({Extends:g,isMesh:!0,className:"Mesh",geometry:null,material:null,useInstanced:!1,frustumTest:!0,constructor:function(t){ri.superclass.constructor.call(this,t),this._usedResourceDict={}},clone:function(t){var e=g.prototype.clone.call(this,t);return Object.assign(e,{geometry:this.geometry,material:this.material}),e},raycast:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.visible)return null;var n=this.geometry,i=this.material,r=this.worldMatrix;if(n&&i){ii.invert(r),ni.copy(t),ni.transformMat4(ii);var s=n.raycast(ni,i.side,e);if(s)return s.forEach((function(t){t.transformMat4(r)})),s}return null},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.geometry.getRenderOption(t),t},useResource:function(t){t&&(this._usedResourceDict[t.className+":"+t.id]=t)},destroy:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._isDestroyed)return this;this.removeFromParent();var n=t.resourceManager,i=this._usedResourceDict;for(var r in i)n.destroyIfNoRef(i[r]);return this.material&&e&&this.material.destroyTextures(),this.off(),this._usedResourceDict=null,this.geometry=null,this.material=null,this._isDestroyed=!0,this}}),si=ri,ai=new o.a,oi=new o.a,ui=s.a.create({Extends:si,isSkinedMesh:!0,className:"SkinedMesh",_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initJointNodeList()}},jointNodeList:null,useInstanced:!1,jointMatTexture:null,frustumTest:!1,constructor:function(t){this.jointNames=[],this.inverseBindMatrices=[],ui.superclass.constructor.call(this,t)},initJointNodeList:function(){var t=this;if(this._rootNode){var e={};this._rootNode.traverse((function(t){"jointName"in t&&(e[t.jointName]=t)})),this.jointNodeList=[],this.jointNames.forEach((function(n){t.jointNodeList.push(e[n])}))}},getJointMat:function(){var t=this;if(this.jointNodeList)return this.jointMat||(this.jointMat=new Float32Array(16*this.jointNodeList.length)),this._rootNode||!this.clonedFrom?oi.invert(this.worldMatrix):oi.invert(this.clonedFrom.worldMatrix),this.jointNodeList.forEach((function(e,n){ai.copy(oi),ai.multiply(e.worldMatrix),ai.multiply(t.inverseBindMatrices[n]),ai.toArray(t.jointMat,16*n)})),this.jointMat},initJointMatTexture:function(){if(!this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture=new ve({data:t})}return this.jointMatTexture},updateJointMatTexture:function(){if(this.jointMatTexture){var t=this.getJointMat();this.jointMatTexture.data.set(t,0),this.jointMatTexture.needUpdate=!0}else this.initJointMatTexture()},clone:function(t){var e=si.prototype.clone.call(this,t);return Object.assign(e,{useInstanced:this.useInstanced,jointNames:this.jointNames.slice(),inverseBindMatrices:this.inverseBindMatrices.map((function(t){return t.clone()})),jointNodeList:this.jointNodeList}),e.clonedFrom=this,e},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ui.superclass.getRenderOption.call(this,t);var e=this.jointNames.length;if(e&&(t.JOINT_COUNT=e,et.VERTEX_TEXTURE_FLOAT)){var n=(et.MAX_VERTEX_UNIFORM_VECTORS-22)/4;e>n&&(t.JOINT_MAT_MAP=1)}return t}}),ci=ui,hi="1.14.0",fi=s.a.create({className:"RenderInfo",isRenderInfo:!0,constructor:function(){this.reset()},addFaceCount:function(t){this._currentFaceCount+=t},addDrawCount:function(t){this._currentDrawCount+=t},reset:function(){this.faceCount=Math.floor(this._currentFaceCount),this.drawCount=Math.floor(this._currentDrawCount),this._currentFaceCount=0,this._currentDrawCount=0}}),li=new c.a,di=function(t,e){var n=t.material.renderOrder,i=e.material.renderOrder;if(n!==i)return n-i;var r=t.material._shaderNumId||0,s=e.material._shaderNumId||0;return r!==s?r-s:t._sortRenderZ-e._sortRenderZ},mi=function(t,e){var n=t.material.renderOrder,i=e.material.renderOrder;return n!==i?n-i:e._sortRenderZ-t._sortRenderZ},_i=s.a.create({className:"RenderList",isRenderList:!0,useInstanced:!1,constructor:function(){this.opaqueList=[],this.transparentList=[],this.instancedDict={}},reset:function(){this.opaqueList.length=0,this.transparentList.length=0,this.instancedDict={}},traverse:function(t,e){this.opaqueList.forEach((function(e){t(e)}));var n=this.instancedDict;for(var i in n){var r=n[i];r.length>2&&e?e(r):r.forEach((function(e){t(e)}))}this.transparentList.forEach((function(e){t(e)}))},sort:function(){this.transparentList.sort(mi),this.opaqueList.sort(di)},addMesh:function(t,e){var n=t.material,i=t.geometry;if(n&&i){if(t.frustumTest&&!e.isMeshVisible(t))return;if(this.useInstanced&&t.useInstanced){var r=this.instancedDict,s=n.id+"_"+i.id,a=r[s];r[s]||(a=r[s]=[]),a.push(t)}else t.worldMatrix.getTranslation(li),li.transformMat4(e.viewProjectionMatrix),t._sortRenderZ=li.z,n.transparent?this.transparentList.push(t):this.opaqueList.push(t)}else m.a.warnOnce("RenderList.addMesh(".concat(t.id,")"),"Mesh must have material and geometry",t)}}),pi=s.a.create({className:"WebGLState",isWebGLState:!0,systemFramebuffer:null,constructor:function(t){this.gl=t,this.reset()},reset:function(){this._dict={},this.activeTextureIndex=null,this.textureUnitDict={},this.currentFramebuffer=null,this.preFramebuffer=null,this._pixelStorei={}},enable:function(t){!0!==this._dict[t]&&(this._dict[t]=!0,this.gl.enable(t))},disable:function(t){!1!==this._dict[t]&&(this._dict[t]=!1,this.gl.disable(t))},bindFramebuffer:function(t,e){this.currentFramebuffer!==e&&(this.preFramebuffer=this.currentFramebuffer,this.currentFramebuffer=e,this.gl.bindFramebuffer(t,e))},bindSystemFramebuffer:function(){this.bindFramebuffer(this.gl.FRAMEBUFFER,this.systemFramebuffer)},useProgram:function(t){this.set1("useProgram",t)},depthFunc:function(t){this.set1("depthFunc",t)},depthMask:function(t){this.set1("depthMask",t)},clear:function(t){this.gl.clear(t)},depthRange:function(t,e){this.set2("depthRange",t,e)},stencilFunc:function(t,e,n){this.set3("stencilFunc",t,e,n)},stencilMask:function(t){this.set1("stencilMask",t)},stencilOp:function(t,e,n){this.set3("stencilOp",t,e,n)},colorMask:function(t,e,n,i){this.set4("colorMask",t,e,n,i)},cullFace:function(t){this.set1("cullFace",t)},frontFace:function(t){this.set1("frontFace",t)},blendFuncSeparate:function(t,e,n,i){this.set4("blendFuncSeparate",t,e,n,i)},blendEquationSeparate:function(t,e){this.set2("blendEquationSeparate",t,e)},pixelStorei:function(t,e){this._pixelStorei[t]!==e&&(this._pixelStorei[t]=e,this.gl.pixelStorei(t,e))},viewport:function(t,e,n,i){this.set4("viewport",t,e,n,i)},activeTexture:function(t){this.activeTextureIndex!==t&&(this.activeTextureIndex=t,this.gl.activeTexture(t))},bindTexture:function(t,e){var n=this.getActiveTextureUnit();n[t]!==e&&(n[t]=e,this.gl.bindTexture(t,e))},getActiveTextureUnit:function(){var t=this.textureUnitDict[this.activeTextureIndex];return t||(t=this.textureUnitDict[this.activeTextureIndex]={}),t},set1:function(t,e){this._dict[t]!==e&&(this._dict[t]=e,this.gl[t](e))},set2:function(t,e,n){var i=this._dict[t];i||(i=this._dict[t]=[]),i[0]===e&&i[1]===n||(i[0]=e,i[1]=n,this.gl[t](e,n))},set3:function(t,e,n,i){var r=this._dict[t];r||(r=this._dict[t]=[]),r[0]===e&&r[1]===n&&r[2]===i||(r[0]=e,r[1]=n,r[2]=i,this.gl[t](e,n,i))},set4:function(t,e,n,i,r){var s=this._dict[t];s||(s=this._dict[t]=[]),s[0]===e&&s[1]===n&&s[2]===i&&s[3]===r||(s[0]=e,s[1]=n,s[2]=i,s[3]=r,this.gl[t](e,n,i,r))},get:function(t){return this._dict[t]}}),gi=s.a.create({className:"WebGLResourceManager",isWebGLResourceManager:!0,hasNeedDestroyResource:!1,constructor:function(t){Object.assign(this,t)},useResource:function(t,e){if(t){var n=t.className+":"+t.id;this._usedResourceDict[n]||(this._usedResourceDict[n]=t,t.useResource&&t.useResource(this,e))}return e&&e.useResource(t),this},destroyIfNoRef:function(t){return this._needDestroyDict||(this._needDestroyDict={}),t&&(this.hasNeedDestroyResource=!0,this._needDestroyDict[t.className+":"+t.id]=t),this},destroyUnsuedResource:function(){if(!this.hasNeedDestroyResource)return this;var t=this._needDestroyDict,e=this._usedResourceDict;for(var n in t)if(!e[n]){var i=t[n];i&&!i.alwaysUse&&i.destroy&&i.destroy()}return this._needDestroyDict={},this.hasNeedDestroyResource=!1,this},reset:function(){return this._usedResourceDict={},this}}),vi=new o.a,Ei=new c.a,Ti=new Float32Array([0,0,0]),Mi=s.a.create({isLightManager:!0,className:"LightManager",constructor:function(t){this.ambientLights=[],this.directionalLights=[],this.pointLights=[],this.spotLights=[],this.areaLights=[],this.lightInfo={AMBIENT_LIGHTS:0,POINT_LIGHTS:0,DIRECTIONAL_LIGHTS:0,SPOT_LIGHTS:0,AREA_LIGHTS:0,uid:0},Object.assign(this,t)},getRenderOption:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(r.each)(this.lightInfo,(function(n,i){if("uid"!==i&&n){e[i]=n;var r=t.getShadowMapCount(i);r&&(e[i+"_SMC"]=r)}})),e},addLight:function(t){var e=null;return t.enabled?(t.isAmbientLight?e=this.ambientLights:t.isDirectionalLight?e=this.directionalLights:t.isPointLight?e=this.pointLights:t.isSpotLight?e=this.spotLights:t.isAreaLight?e=this.areaLights:m.a.warnOnce("LightManager.addLight(".concat(t.id,")"),"Not support this light:",t),e&&(t.shadow?e.unshift(t):e.push(t)),this):this},getDirectionalInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[];this.directionalLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(e,c),o.getViewDirection(t).toArray(n,c),o.shadow&&o.lightShadow&&(i.push(o.lightShadow.framebuffer.texture),r.push(o.lightShadow.width),r.push(o.lightShadow.height),a.push(o.lightShadow.minBias,o.lightShadow.maxBias),vi.copy(t.worldMatrix),vi.premultiply(o.lightShadow.camera.viewProjectionMatrix),vi.toArray(s,16*u))}));var o={colors:new Float32Array(e),infos:new Float32Array(n)};return i.length&&(o.shadowMap=i,o.shadowMapSize=new Float32Array(r),o.shadowBias=new Float32Array(a),o.lightSpaceMatrix=new Float32Array(s)),o},getSpotInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[],c=[],h=[];this.spotLights.forEach((function(f,l){var d=3*l;f.getRealColor().toRGBArray(e,d),f.toInfoArray(n,d),f.getViewDirection(t).toArray(r,d),h.push(f.range),s.push(f._cutoffCos,f._outerCutoffCos),t.getModelViewMatrix(f,vi),vi.getTranslation(Ei),Ei.toArray(i,d),f.shadow&&f.lightShadow&&(a.push(f.lightShadow.framebuffer.texture),o.push(f.lightShadow.width),o.push(f.lightShadow.height),c.push(f.lightShadow.minBias,f.lightShadow.maxBias),vi.multiply(f.lightShadow.camera.viewProjectionMatrix,t.worldMatrix),vi.toArray(u,16*l))}));var f={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),dirs:new Float32Array(r),cutoffs:new Float32Array(s),ranges:new Float32Array(h)};return a.length&&(f.shadowMap=a,f.shadowMapSize=new Float32Array(o),f.shadowBias=new Float32Array(c),f.lightSpaceMatrix=new Float32Array(u)),f},getPointInfo:function(t){var e=[],n=[],i=[],r=[],s=[],a=[],o=[],u=[];this.pointLights.forEach((function(c,h){var f=3*h;c.getRealColor().toRGBArray(e,f),c.toInfoArray(n,f),u.push(c.range),t.getModelViewMatrix(c,vi),vi.getTranslation(Ei),Ei.toArray(i,f),c.shadow&&c.lightShadow&&(r.push(c.lightShadow.framebuffer.texture),a.push(c.lightShadow.minBias,c.lightShadow.maxBias),t.worldMatrix.toArray(s,16*h),o[2*h]=c.lightShadow.camera.near,o[2*h+1]=c.lightShadow.camera.far)}));var c={colors:new Float32Array(e),infos:new Float32Array(n),poses:new Float32Array(i),ranges:new Float32Array(u)};return r.length&&(c.shadowMap=r,c.shadowBias=new Float32Array(a),c.lightSpaceMatrix=new Float32Array(s),c.cameras=new Float32Array(o)),c},getAreaInfo:function(t){var e,n,i=[],r=[],s=[],a=[];return this.areaLights.forEach((function(o,u){var c=3*u;o.getRealColor().toRGBArray(i,c),t.getModelViewMatrix(o,vi),vi.getTranslation(Ei),Ei.toArray(r,c);var h=vi.getRotation();vi.fromQuat(h),Ei.set(.5*o.width,0,0),Ei.transformMat4(vi),Ei.toArray(s,c),Ei.set(0,.5*o.height,0),Ei.transformMat4(vi),Ei.toArray(a,c),e=o.ltcTexture1,n=o.ltcTexture2})),{colors:new Float32Array(i),poses:new Float32Array(r),width:new Float32Array(s),height:new Float32Array(a),ltcTexture1:e,ltcTexture2:n}},getAmbientInfo:function(){return Ti[0]=Ti[1]=Ti[2]=0,this.ambientLights.forEach((function(t){var e=t.getRealColor();Ti[0]+=e.r,Ti[1]+=e.g,Ti[2]+=e.b})),Ti[0]=Math.min(1,Ti[0]),Ti[1]=Math.min(1,Ti[1]),Ti[2]=Math.min(1,Ti[2]),Ti},updateInfo:function(t){var e=this.lightInfo,n=this.ambientLights,i=this.directionalLights,r=this.pointLights,s=this.spotLights,a=this.areaLights;e.AMBIENT_LIGHTS=n.length,e.POINT_LIGHTS=r.length,e.DIRECTIONAL_LIGHTS=i.length,e.SPOT_LIGHTS=s.length,e.AREA_LIGHTS=a.length;var o=function(t){return!!t.shadow};e.SHADOW_POINT_LIGHTS=r.filter(o).length,e.SHADOW_SPOT_LIGHTS=s.filter(o).length,e.SHADOW_DIRECTIONAL_LIGHTS=i.filter(o).length,e.uid=[e.AMBIENT_LIGHTS,e.POINT_LIGHTS,e.SHADOW_POINT_LIGHTS,e.DIRECTIONAL_LIGHTS,e.SHADOW_DIRECTIONAL_LIGHTS,e.SPOT_LIGHTS,e.SHADOW_SPOT_LIGHTS,e.AREA_LIGHTS].join("_"),this.directionalInfo=this.getDirectionalInfo(t),this.pointInfo=this.getPointInfo(t),this.spotInfo=this.getSpotInfo(t),this.areaInfo=this.getAreaInfo(t),this.ambientInfo=this.getAmbientInfo()},getInfo:function(){return this.lightInfo},reset:function(){this.ambientLights.length=0,this.directionalLights.length=0,this.pointLights.length=0,this.spotLights.length=0,this.areaLights.length=0},getShadowMapCount:function(t){var e=[];"POINT_LIGHTS"===t?e=this.pointLights:"DIRECTIONAL_LIGHTS"===t?e=this.directionalLights:("SPOT_LIGHTS"===t||"AREA_LIGHTS"===t)&&(e=this.spotLights);var n=0;return e.forEach((function(t){n+=t.shadow?1:0})),n},createShadowMap:function(t,e){this.directionalLights.forEach((function(n){n.createShadowMap(t,e)})),this.spotLights.forEach((function(n){n.createShadowMap(t,e)})),this.pointLights.forEach((function(n){n.createShadowMap(t,e)})),this.areaLights.forEach((function(n){n.createShadowMap(t,e)}))}}),Ai=P.a.DEPTH_TEST,Ii=P.a.SAMPLE_ALPHA_TO_COVERAGE,Li=P.a.CULL_FACE,Oi=P.a.FRONT_AND_BACK,Si=P.a.BLEND,Ri=P.a.LINES,yi=P.a.STATIC_DRAW,xi=P.a.DYNAMIC_DRAW,Ni=s.a.create({Mixes:a.a,className:"WebGLRenderer",isWebGLRenderer:!0,gl:null,width:0,height:0,pixelRatio:1,domElement:null,useInstanced:!1,useVao:!0,alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!1,gameMode:!1,useFramebuffer:!1,framebufferOption:{},useLogDepth:!1,vertexPrecision:"highp",fragmentPrecision:"highp",fog:null,offsetX:0,offsetY:0,isInitFailed:!1,_isInit:!1,_isContextLost:!1,constructor:function(t){this.clearColor=new v.a(1,1,1),Object.assign(this,t),this.renderInfo=new fi,this.renderList=new _i,this.lightManager=new Mi,this.resourceManager=new gi},resize:function(t,e,n){if(n||this.width!==t||this.height!==e){var i=this.domElement;this.width=t,this.height=e,i.width=t,i.height=e,this.framebuffer&&this.framebuffer.resize(this.width,this.height,n),this.viewport()}},setOffset:function(t,e){this.offsetX===t&&this.offsetY===e||(this.offsetX=t,this.offsetY=e,this.viewport())},viewport:function(t,e,n,i){var r=this.state,s=this.gl;r&&(void 0===t?t=this.offsetX:this.offsetX=t,void 0===e?e=this.offsetY:this.offsetY=e,void 0===n&&(n=s.drawingBufferWidth),void 0===i&&(i=s.drawingBufferHeight),r.viewport(t,e,n,i))},isInit:{get:function(){return this._isInit&&!this.isInitFailed}},onInit:function(t){var e=this;this._isInit?t(this):this.on("init",(function(){t(e)}),!0)},initContext:function(){if(!this._isInit){this._isInit=!0;try{this._initContext(),this.fire("init")}catch(t){this.isInitFailed=!0,this.fire("initFailed",t)}}},_initContext:function(){var t=this,e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat};!0===this.preserveDrawingBuffer&&(e.preserveDrawingBuffer=!0),!0===this.gameMode&&(e.gameMode=!0);var n=this.gl=this.domElement.getContext("webgl",e);n.viewport(0,0,this.width,this.height),Tt.init(n),tt.init(n),et.init(n),dt.init(this),this.state=new pi(n),tt.instanced||(this.useInstanced=!1),this.renderList.useInstanced=this.useInstanced,tt.vao||(this.useVao=!1),this.useFramebuffer&&(this.framebuffer=new re(this,Object.assign({useVao:this.useVao,width:this.width,height:this.height},this.framebufferOption))),this.domElement.addEventListener("webglcontextlost",(function(e){t._onContextLost(e)}),!1),this.domElement.addEventListener("webglcontextrestored",(function(e){t._onContextRestore(e)}),!1)},_onContextLost:function(t){this.fire("webglContextLost");var e=this.gl;this._isContextLost=!0,t.preventDefault(),It.reset(e),dt.reset(e),qt.reset(e),xt.reset(e),Ft.reset(e),this.state.reset(e),this._lastMaterial=null,this._lastProgram=null},_onContextRestore:function(t){this.fire("webglContextRestored");var e=this.gl;this._isContextLost=!1,tt.reset(e),re.reset(e)},setupDepthTest:function(t){var e=this.state;t.depthTest?(e.enable(Ai),e.depthFunc(t.depthFunc),e.depthMask(t.depthMask),e.depthRange(t.depthRange[0],t.depthRange[1])):e.disable(Ai)},setupSampleAlphaToCoverage:function(t){var e=this.state;t.sampleAlphaToCoverage?e.enable(Ii):e.disable(Ii)},setupCullFace:function(t){var e=this.state;t.cullFace&&t.cullFaceType!==Oi?(e.enable(Li),e.cullFace(t.cullFaceType)):e.disable(Li)},setupBlend:function(t){var e=this.state;t.blend?(e.enable(Si),e.blendFuncSeparate(t.blendSrc,t.blendDst,t.blendSrcAlpha,t.blendDstAlpha),e.blendEquationSeparate(t.blendEquation,t.blendEquationAlpha)):e.disable(Si)},setupUniforms:function(t,e,n,i){var r=this.forceMaterial||e.material;for(var s in t.uniforms){var a=r.getUniformInfo(s),o=t.uniforms[s];if(!a.isBlankInfo&&(i||a.isDependMesh&&!n)){var u=a.get(e,r,o);null!=u&&(t[s]=u)}}},setupVao:function(t,e,n){var i=n.geometry,r=i.isStatic;if(t.isDirty||!r||i.isDirty){t.isDirty=!1;var s=this.forceMaterial||n.material,a=s.attributes,o=r?yi:xi;for(var u in a){var c=e.attributes[u];if(c){var h=s.getAttributeData(u,n,c);null!=h&&t.addAttribute(h,c,o)}}i.indices&&t.addIndexBuffer(i.indices,o),i.isDirty=!1}i.vertexCount&&(t.vertexCount=i.vertexCount)},setupMaterial:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=this.forceMaterial||e.material;(r.isDirty||this._lastMaterial!==r)&&(this.setupDepthTest(r),this.setupSampleAlphaToCoverage(r),this.setupCullFace(r),this.setupBlend(r),i=!0),this.setupUniforms(t,e,n,i),r.isDirty=!1,this._lastMaterial=r},setupMesh:function(t,e){var n=this.gl,i=this.state,r=this.lightManager,s=this.resourceManager,a=t.geometry,o=this.forceMaterial||t.material,u=dt.getShader(t,o,e,r,this.fog,this.useLogDepth),c=It.getProgram(u,i);c.useProgram(),this.setupMaterial(c,t,e,this._lastProgram!==c),this._lastProgram=c,t.material.wireframe&&a.mode!==Ri&&a.convertToLinesMode();var h=a.id+c.id,f=Ft.getVao(n,h,{useInstanced:e,useVao:this.useVao,mode:a.mode});return this.setupVao(f,c,t),s.useResource(f,t).useResource(u,t).useResource(c,t),{vao:f,program:c,geometry:a}},addRenderInfo:function(t,e){var n=this.renderInfo;n.addFaceCount(t),n.addDrawCount(e)},render:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.initContext(),!this.isInitFailed&&!this._isContextLost){var i=this.renderList,r=this.renderInfo,s=this.lightManager,a=this.resourceManager,o=this.state;this.fog=t.fog,s.reset(),r.reset(),i.reset(),a.reset(),Pe.init(this,o,e,s,this.fog),t.updateMatrixWorld(),e.updateViewProjectionMatrix(),t.traverse((function(t){return t.visible?(t.isMesh?i.addMesh(t,e):t.isLight&&s.addLight(t),g.TRAVERSE_STOP_NONE):g.TRAVERSE_STOP_CHILDREN})),i.sort(),s.createShadowMap(this,e),s.updateInfo(e),n&&this.fire("beforeRender"),this.useFramebuffer&&this.framebuffer.bind(),this.clear(),n&&this.fire("beforeRenderScene"),this.renderScene(),this.useFramebuffer&&this.renderToScreen(this.framebuffer),n&&this.fire("afterRender"),a.destroyUnsuedResource()}},renderScene:function(){var t=this;this.renderList.traverse((function(e){t.renderMesh(e)}),(function(e){t.renderInstancedMeshes(e)})),this._gameModeSumbit()},_gameModeSumbit:function(){var t=this.gl;this.gameMode&&t&&t.submit&&t.submit()},clear:function(t){var e=this.gl,n=this.state;t=t||this.clearColor,n.depthMask(!0),this._lastMaterial=null,this._lastProgram=null,e.clearColor(t.r,t.g,t.b,t.a),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)},clearDepth:function(){var t=this.gl;this.state.depthMask(!0),t.clear(t.DEPTH_BUFFER_BIT)},renderToScreen:function(t){this.state.bindSystemFramebuffer(),t.render(0,0,1,1,this.clearColor)},renderMesh:function(t){var e=this.setupMesh(t,!1).vao;e.draw(),this.addRenderInfo(e.vertexCount/3,1)},renderInstancedMeshes:function(t){var e=t[0];if(e){var n=this.forceMaterial||e.material,i=this.setupMesh(e,!0),r=i.vao,s=i.program;n.getInstancedUniforms().forEach((function(e){var n=e.name,i=e.info,a=s.attributes[n];a&&r.addInstancedAttribute(a,t,(function(t){return i.get(t)}))})),r.drawInstance(t.length),this.addRenderInfo(r.vertexCount/3*t.length,1)}},renderMultipleMeshes:function(t){var e=this;t.forEach((function(t){e.renderMesh(t)}))},releaseGLResource:function(){var t=this.gl;t&&(It.reset(t),dt.reset(t),xt.reset(t),Ft.reset(t),this.state.reset(t),qt.reset(t),re.destroy(t))}}),bi=n(60),Ci=n.n(bi).a,Pi=s.a.create({Extends:g,isStage:!0,className:"Stage",renderer:null,camera:null,pixelRatio:null,offsetX:0,offsetY:0,constructor:function(t){if(t.width||(t.width=window.innerWidth),t.height||(t.height=window.innerHeight),!t.pixelRatio){var e=window.devicePixelRatio||1;e=Math.min(e,1024/Math.max(t.width,t.height),2),e=Math.max(e,1),t.pixelRatio=e}Pi.superclass.constructor.call(this,t),this.initRenderer(t),m.a.log("Hilo3d version: ".concat(hi))},initRenderer:function(t){var e=this.canvas=this.createCanvas(t);this.renderer=new Ni(Object.assign(t,{domElement:e})),this.resize(this.width,this.height,this.pixelRatio,!0)},createCanvas:function(t){var e;return e=t.canvas?t.canvas:document.createElement("canvas"),t.container&&t.container.appendChild(e),e},resize:function(t,e,n,i){if(void 0===n&&(n=this.pixelRatio),i||this.width!==t||this.height!==e||this.pixelRatio!==n){this.width=t,this.height=e,this.pixelRatio=n,this.rendererWidth=t*n,this.rendererHeight=e*n;var r=this.canvas;this.renderer.resize(this.rendererWidth,this.rendererHeight,i),r.style.width=this.width+"px",r.style.height=this.height+"px",this.updateDomViewport()}return this},setOffset:function(t,e){if(this.offsetX!==t||this.offsetY!==e){this.offsetX=t,this.offsetY=e;var n=this.pixelRatio;this.renderer.setOffset(t*n,e*n)}return this},viewport:function(t,e,n,i){return this.resize(n,i,this.pixelRatio,!0),this.setOffset(t,e),this},tick:function(t){return this.traverseUpdate(t),this.camera&&this.renderer.render(this,this.camera,!0),this},enableDOMEvent:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.canvas,r=this._domListener||(this._domListener=function(t){e._onDOMEvent(t)});return(t="string"==typeof t?[t]:t).forEach((function(t){n?i.addEventListener(t,r,!1):i.removeEventListener(t,r)})),this},_onDOMEvent:function(t){var e=this.canvas,n=this._eventTarget,i=t.type,r=0===i.indexOf("touch"),s=t;if(r){var a=t.touches,o=t.changedTouches;a&&a.length?s=a[0]:o&&o.length&&(s=o[0])}var u=this.domViewport||this.updateDomViewport(),c=(s.pageX||s.clientX)-u.left,h=(s.pageY||s.clientY)-u.top;t.stageX=c,t.stageY=h,t.stopPropagation=function(){this._stopPropagationed=!0};var f=this.getMeshResultAtPoint(c,h,!0),l=f.mesh;t.hitPoint=f.point;var d="mouseout"===i;if(n&&(n!==l&&(!n.contains||!n.contains(l))||d)){var m=!1;if("touchmove"===i?m="touchout":"mousemove"!==i&&!d&&l||(m="mouseout"),m){var _=Object.assign({},t);_.type=m,_.eventTarget=n,n._fireMouseEvent(_)}t.lastEventTarget=n,this._eventTarget=null}if(l&&l.pointerEnabled&&"mouseout"!==i&&(t.eventTarget=this._eventTarget=l,l._fireMouseEvent(t)),!r){var p=l&&l.pointerEnabled&&l.useHandCursor?"pointer":"";e.style.cursor=p}Ci.android&&"touchmove"===i&&t.preventDefault()},updateDomViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.domViewport=Object(r.getElementRect)(t)),e},getMeshResultAtPoint:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.camera,r=this._ray;r||(r=this._ray=new ei.a),r.fromCamera(i,t,e,this.width,this.height);var s=this.raycast(r,!0,n);if(s)return s[0];this._stageResultAtPoint||(this._stageResultAtPoint={mesh:this,point:new c.a});var a=this._stageResultAtPoint.point;return a.copy(i.unprojectVector(a.set(t,e,0),this.width,this.height)),this._stageResultAtPoint},releaseGLResource:function(){return this.renderer.releaseGLResource(),this},destroy:function(){return this.releaseGLResource(),this.traverse((function(t){t.off(),t.parent=null})),this.children.length=0,this.renderer.off(),this}}),wi=Pi,Hi=n(61),Di=n.n(Hi),Fi=n(105),Ui=n.n(Fi);Di.a.Ease=Ui.a;var Gi=Di.a,Bi=s.a.create({Extends:Z,isBoxGeometry:!0,className:"BoxGeometry",width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1,constructor:function(t){Bi.superclass.constructor.call(this,t),this.isSegments()?this.buildWithSegments():this.build()},buildWithSegments:function(){var t=this.width,e=this.height,n=this.depth,i=this.widthSegments,r=this.heightSegments,s=this.depthSegments,a=r*s*6,o=i*s*6,u=i*r*6,c=2*((r+1)*(s+1)+(i+1)*(s+1)+(i+1)*(r+1)),h=new Float32Array(3*c),f=new Float32Array(3*c),l=new Float32Array(2*c),d=new Uint16Array(2*(a+o+u));this.vertices=new C(h,3),this.normals=new C(f,3),this.uvs=new C(l,2),this.indices=new C(d,1);var m=[0,0];this.buildPlane(m,2,1,0,-1,1,n,e,t/2,s,r),this.buildPlane(m,2,1,0,1,1,n,e,-t/2,s,r),this.buildPlane(m,0,2,1,1,-1,t,n,e/2,i,s),this.buildPlane(m,0,2,1,1,1,t,n,-e/2,i,s),this.buildPlane(m,0,1,2,1,1,t,e,n/2,i,r),this.buildPlane(m,0,1,2,-1,1,t,e,-n/2,i,r)},buildPlane:function(t,e,n,i,r,s,a,o,u,c,h){for(var f=a/c,l=o/h,d=a/2,m=o/2,_=t[0],p=t[1],g=this.vertices.data,v=this.normals.data,E=this.uvs.data,T=this.indices.data,M=0;M<=h;M++)for(var A=(M*l-m)*s,I=0;I<=c;I++){if(g[3*_+e]=(I*f-d)*r,g[3*_+n]=A,g[3*_+i]=u,v[3*_+e]=0,v[3*_+n]=0,v[3*_+i]=u<0?-1:1,E[2*_]=I/c,E[2*_+1]=1-M/h,I1||this.heightSegments>1||this.depthSegments>1},setFrontUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setFrontUV!"):this.setVertexUV(32,t)},setRightUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setRightUV!"):this.setVertexUV(0,t)},setBackUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBackUV!"):this.setVertexUV(40,t)},setLeftUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setLeftUV!"):this.setVertexUV(8,t)},setTopUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setTopUV!"):this.setVertexUV(16,t)},setBottomUV:function(t){this.isSegments()?m.a.warn("segmented BoxGeometry dont support setBottomUV!"):this.setVertexUV(24,t)},setAllRectUV:function(t){if(this.isSegments())return m.a.warn("segmented BoxGeometry dont support setAllRectUV!"),null;for(var e=0;e<6;e++)this.setVertexUV(8*e,t);return this},_raycast:function(t,e){return Bi.superclass._raycast.call(this,t,e)}}),Vi=Bi,Xi=P.a.FRONT,ji=P.a.BACK,zi=[0,0,1],ki=s.a.create({Extends:Z,isPlaneGeometry:!0,className:"PlaneGeometry",width:1,height:1,widthSegments:1,heightSegments:1,constructor:function(t){ki.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.widthSegments,e=this.heightSegments,n=(t+1)*(e+1),i=this.width/t,r=this.height/e,s=new Float32Array(3*n),a=new Float32Array(3*n),o=new Float32Array(2*n),u=new Uint16Array(t*e*6),c=0,h=0;h<=e;h++)for(var f=0;f<=t;f++){var l=h*(t+1)+f;if(s[3*l]=f*i-this.width/2,s[3*l+1]=this.height/2-h*r,a[3*l]=0,a[3*l+1]=0,a[3*l+2]=1,o[2*l]=f/t,o[2*l+1]=1-h/e,h0||n<0))return null;if(e===ji&&(i<0||n>0))return null;var r=t.intersectsPlane(zi,0);if(r){var s=r.x,a=r.y,o=.5*this.width,u=.5*this.height;if(s>=-o&&s<=o&&a>=-u&&a<=u)return[r]}return null}}),qi=ki,Wi=s.a.create({Extends:Z,isSphereGeometry:!0,className:"SphereGeometry",radius:1,heightSegments:16,widthSegments:32,constructor:function(t){Wi.superclass.constructor.call(this,t),this.build()},build:function(){for(var t=this.radius,e=this.heightSegments,n=this.widthSegments,i=(n+1)*(e+1),r=n*e,s=new Float32Array(3*i),a=new Float32Array(4*i),o=new Float32Array(2*i),u=new Uint16Array(6*r),c=0,h=0,f=0,l=0,d=0,m=2*Math.PI,_=Math.PI,p=0;p<=e;p++)for(var g=p/e,v=_*g,E=Math.cos(v)*t,T=Math.sin(v)*t,M=0;M<=n;M++){var A=M/n,I=m*A,L=Math.cos(I),O=Math.sin(I),S=L*T,R=O*T,y=O,x=-L;if(a[f++]=y,a[f++]=0,a[f++]=x,a[f++]=1,s[h++]=S,s[h++]=E,s[h++]=R,o[l++]=A,o[l++]=g,p>0&&M>0){var N=d,b=N-1,P=b-n-1,w=N-n-1;u[c++]=P,u[c++]=w,u[c++]=N,u[c++]=P,u[c++]=N,u[c++]=b}d++}this.vertices=new C(s,3),this.indices=new C(u,1),this.uvs=new C(o,2),this.tangents=new C(a,4),this.normals=new C(new Float32Array(s),3)},_raycast:function(t,e){return Wi.superclass._raycast.call(this,t,e)}}),Yi=Wi,Zi=[dt,It,xt,Ft,qt],Ki=function(){var t="";Zi.forEach((function(e){t+="".concat(e.prototype.className,":").concat(Object.keys(e.cache._cache).length," ")})),m.a.log(t)},Qi=s.a.create({Mixes:a.a,isLoadCache:!0,className:"LoadCache",Statics:{PENDING:1,LOADED:2,FAILED:3},enabled:!0,constructor:function(){this._files={}},update:function(t,e,n){if(this.enabled){var i={key:t,state:e,data:n};this._files[t]=i,this.fire("update",i),this.fire("update:".concat(i.key),i)}},get:function(t){return this.enabled?this._files[t]:null},remove:function(t){delete this._files[t]},clear:function(){this._files={}},wait:function(t){var e=this;return t?t.state===Qi.LOADED?Promise.resolve(t.data):t.state===Qi.FAILED?Promise.reject():new Promise((function(n,i){e.on("update:".concat(t.key),(function(t){var e=t.detail;e.state===Qi.LOADED?n(e.data):e.state===Qi.FAILED&&i(e.data)}),!0)})):Promise.reject()}}),Ji=Qi,$i=new Ji,tr=s.a.create({Mixes:a.a,isBasicLoader:!0,className:"BasicLoader",Statics:{_cache:$i,enalbeCache:function(){$i.enabled=!0},disableCache:function(){$i.enabled=!1},deleteCache:function(t){$i.remove(t)},clearCache:function(){$i.clear()},cache:{get:function(){return $i},set:function(){m.a.warn("BasicLoader.cache is readonly!")}}},load:function(t){var e=t.src,n=t.type;if(!n){var i=Object(r.getExtension)(e);/^(?:png|jpe?g|gif|webp|bmp)$/i.test(i)&&(n="img"),n||(n=t.defaultType)}return"img"===n?this.loadImg(e,t.crossOrigin):this.loadRes(e,n)},isCrossOrigin:function(t){var e=window.location,n=document.createElement("a");return n.href=t,n.hostname!==e.hostname||n.port!==e.port||n.protocol!==e.protocol},isBase64:function(t){return/^data:(.+?);base64,/.test(t)},Uint8ArrayFrom:function(t,e){if(Uint8Array.from)return Uint8Array.from(t,e);for(var n=t.length,i=new Uint8Array(n),r=0;r=300)i(new TypeError("Network request failed for ".concat(s.status)));else{var e="response"in s?s.response:s.responseText;if("json"===t.type)try{e=JSON.parse(e)}catch(t){return void i(new TypeError("JSON.parse error"+t))}n(e)}},s.onprogress=function(n){e.fire("progress",{url:t.url,loaded:n.loaded,total:n.total})},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request timed out"))},s.open(t.method||"GET",t.url,!0),"include"===t.credentials&&(s.withCredentials=!0),"buffer"===t.type&&(s.responseType="arraybuffer"),Object(r.each)(t.headers,(function(t,e){s.setRequestHeader(e,t)})),s.send(t.body||null)}))}}),er=s.a.create({isLoader:!0,className:"Loader",maxConnections:2,Statics:{_loaderClassMap:{},_loaders:{},addLoader:function(t,e){er._loaderClassMap[t]=e},getLoader:function(t){if(!er._loaders[t]){var e=er._loaderClassMap[t]?er._loaderClassMap[t]:tr;er._loaders[t]=new e}return er._loaders[t]}},load:function(t){var e=this;if(t instanceof Array)return Promise.all(t.map((function(t){return e.load(t)})));var n=t.type||Object(r.getExtension)(t.src);return er.getLoader(n).load(t)}}),nr=er,ir=s.a.create({Extends:tr,isCubeTextureLoader:!0,className:"CubeTextureLoader",constructor:function(){ir.superclass.constructor.call(this)},load:function(t){var e,n=this;return e=t.images&&Array.isArray(t.images)?t.images:[t.right,t.left,t.top,t.bottom,t.front,t.back],Promise.all(e.map((function(e){return n.loadImg(e,t.crossOrigin)}))).then((function(e){var n=Object.assign({},t);return delete n.images,delete n.type,delete n.right,delete n.left,delete n.top,delete n.bottom,delete n.front,delete n.back,n.image=e,new fe(n)})).catch((function(t){throw m.a.error("load CubeTexture failed",t.message,t.stack),t}))}});nr.addLoader("CubeTexture",ir);var rr=ir,sr=s.a.create({Extends:ze,isPBRMaterial:!0,className:"PBRMaterial",lightType:"PBR",gammaCorrection:!0,usePhysicsLight:!0,baseColor:null,baseColorMap:null,metallic:1,metallicMap:null,roughness:1,roughnessMap:null,metallicRoughnessMap:null,occlusionMap:null,occlusionStrength:1,isOcclusionInMetallicRoughnessMap:!1,diffuseEnvMap:null,diffuseEnvSphereHarmonics3:null,diffuseEnvIntensity:1,brdfLUT:null,specularEnvIntensity:1,specularEnv:null,emission:null,isSpecularGlossiness:!1,specular:null,glossiness:1,specularGlossinessMap:null,usedUniformVectors:11,constructor:function(t){this.baseColor=new v.a(1,1,1),this.specular=new v.a(1,1,1),sr.superclass.constructor.call(this,t),Object.assign(this.uniforms,{u_baseColor:"BASECOLOR",u_metallic:"METALLIC",u_roughness:"ROUGHNESS",u_specular:"SPECULAR",u_glossiness:"GLOSSINESS",u_brdfLUT:"BRDFLUT",u_diffuseEnvMap:"DIFFUSEENVMAP",u_diffuseEnvIntensity:"DIFFUSEENVINTENSITY",u_occlusionStrength:"OCCLUSIONSTRENGTH",u_specularEnvMap:"SPECULARENVMAP",u_specularEnvIntensity:"SPECULARENVINTENSITY",u_specularEnvMapMipCount:"SPECULARENVMAPMIPCOUNT",u_diffuseEnvSphereHarmonics3:"DIFFUSEENVSPHEREHARMONICS3"}),this.addTextureUniforms({u_baseColorMap:"BASECOLORMAP",u_metallicMap:"METALLICMAP",u_roughnessMap:"ROUGHNESSMAP",u_metallicRoughnessMap:"METALLICROUGHNESSMAP",u_occlusionMap:"OCCLUSIONMAP",u_specularGlossinessMap:"SPECULARGLOSSINESSMAP",u_lightMap:"LIGHTMAP"})},getRenderOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};sr.superclass.getRenderOption.call(this,t);var e=this._textureOption.reset(t);return e.add(this.baseColorMap,"BASE_COLOR_MAP"),e.add(this.metallicMap,"METALLIC_MAP"),e.add(this.roughnessMap,"ROUGHNESS_MAP"),e.add(this.metallicRoughnessMap,"METALLIC_ROUGHNESS_MAP"),e.add(this.diffuseEnvMap,"DIFFUSE_ENV_MAP"),e.add(this.occlusionMap,"OCCLUSION_MAP"),e.add(this.lightMap,"LIGHT_MAP"),this.brdfLUT&&(e.add(this.specularEnvMap,"SPECULAR_ENV_MAP"),et.SHADER_TEXTURE_LOD&&this.specularEnvMap&&(t.USE_SHADER_TEXTURE_LOD=1)),this.isSpecularGlossiness&&(t.PBR_SPECULAR_GLOSSINESS=1,e.add(this.specularGlossinessMap,"SPECULAR_GLOSSINESS_MAP")),this.isOcclusionInMetallicRoughnessMap&&(t.IS_OCCLUSION_MAP_IN_METALLIC_ROUGHNESS_MAP=1),1!==this.occlusionStrength&&(t.OCCLUSION_STRENGTH=1),this.diffuseEnvSphereHarmonics3&&(t.HAS_NORMAL=1,t.DIFFUSE_ENV_SPHERE_HARMONICS3=1),(this.specularEnvMap||this.diffuseEnvSphereHarmonics3||this.specularEnvMap)&&(t.NEED_WORLD_NORMAL=1),e.update(),t}}),ar=sr,or=new Image;or.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";var ur=s.a.create({Extends:qt,Mixes:a.a,isLazyTexture:!0,className:"LazyTexture",_src:"",crossOrigin:!1,autoLoad:!0,resType:"",src:{get:function(){return this._src},set:function(t){this._src!==t&&(this._src=t,this.autoLoad&&this.load())}},constructor:function(t){t&&("crossOrigin"in t&&(this.crossOrigin=t.crossOrigin),"autoLoad"in t&&(this.autoLoad=t.autoLoad)),ur.superclass.constructor.call(this,t),this.image=this.placeHolder||or},load:function(t){var e=this;return ur.loader=ur.loader||new nr,ur.loader.load({src:this.src,crossOrigin:this.crossOrigin,type:this.resType,defaultType:"img"}).then((function(t){t.isTexture?(Object.assign(e,t),e.needUpdate=!0,e.needDestroy=!0,e.fire("load")):(e.image=t,e.needUpdate=!0,e.fire("load"))}),(function(n){if(e.fire("error"),t)throw new Error("LazyTexture Failed ".concat(n));m.a.warn("LazyTexture Failed ".concat(n))}))},_releaseImage:function(){this._src&&"string"!=typeof this._src&&(this._src=""),ur.superclass._releaseImage.call(this)}}),cr=ur,hr=n(13);function fr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return lr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lr(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=0;i--)Tr[i]=t[i]+n*(e[i]-t[i]);return Tr}return t+n*(e-t)},STEP:function(t,e,n){return t},CUBICSPLINE:function(t,e,n,i){var s=t.length/3;if(void 0===e)return 1===s?t[1]:t.slice(s,-s);var a=t[1],o=t[2],u=e[1],c=e[0];if(s>1&&(a=t.slice(s,-s),o=t.slice(-s),u=e.slice(s,-s),c=e.slice(0,s)),a.hermite)a.hermite(a,o.scale(i),u,c.scale(i),n);else if(a.sqlerp)a.sqlerp(a,o.scale(i),u,c.scale(i),n);else{Object(r.isArrayLike)(a)||(a=[a],o=[o],u=[u],c=[c]);var h=n*n,f=h*n,l=2*f-3*h+1,d=f-2*h+n,m=-2*f+3*h,_=f-h;Tr.length=0;for(var p=a.length-1;p>=0;p--)Tr[p]=a[p]*l+d*o[p]*i+u[p]*m+_*c[p]*i;a=Tr}return a}},StateType:{TRANSLATE:"Translation",POSITION:"Translation",TRANSLATION:"Translation",SCALE:"Scale",ROTATE:"Rotation",ROTATION:"Rotation",QUATERNION:"Quaternion",WEIGHTS:"Weights"},getType:function(t){return t=String(t).toUpperCase(),Ar.StateType[t]||Ar._extraStateHandlers.type[t]},_extraStateHandlers:{type:{},handler:{}},registerStateHandler:function(t,e){Ar._extraStateHandlers.type[String(t).toUpperCase()]=t,Ar._extraStateHandlers.handler[t]=e}},isAnimationStates:!0,className:"AnimationStates",nodeName:"",type:"",interpolationType:"LINEAR",constructor:function(t){this.id=d.a.generateUUID(this.className),this.keyTime=[],this.states=[],Object.assign(this,t)},findIndexByTime:function(t){return Object(r.getIndexFromSortedArray)(this.keyTime,t,Mr)},getStateByIndex:function(t){var e=this.states.length/this.keyTime.length;return 1===e?this.states[t]:this.states.slice(t*e,t*e+e)},getState:function(t){var e=fr(this.findIndexByTime(t),2),n=e[0],i=e[1];if(n<0||i>=this.keyTime.length)return null;var s=this.keyTime[n],a=this.keyTime[i],o=this.getStateByIndex(n);if("STEP"===this.interpolationType)return o;if(n===i){var u=this.interpolation(o);return this.type===Ar.StateType.ROTATION&&(u=dr.fromEuler(Er.fromArray(u))),u.elements||u}var c=this.getStateByIndex(i),h=a-s,f=(t-s)/h;this.type===Ar.StateType.ROTATION?Object(r.isArrayLike)(o[0])?(o[0]=dr.fromEuler(Er.fromArray(o[0])),o[1]=mr.fromEuler(Er.fromArray(o[1])),o[2]=_r.fromEuler(Er.fromArray(o[2])),c[0]=pr.fromEuler(Er.fromArray(c[0])),c[1]=gr.fromEuler(Er.fromArray(c[1])),c[2]=vr.fromEuler(Er.fromArray(c[2]))):(o=dr.fromEuler(Er.fromArray(o)),c=mr.fromEuler(Er.fromArray(c))):this.type===Ar.StateType.QUATERNION&&(Object(r.isArrayLike)(o[0])?(o[0]=dr.fromArray(o[0]),o[1]=mr.fromArray(o[1]),o[2]=_r.fromArray(o[2]),c[0]=pr.fromArray(c[0]),c[1]=gr.fromArray(c[1]),c[2]=vr.fromArray(c[2])):(o=dr.fromArray(o),c=mr.fromArray(c)));var l=this.interpolation(o,c,f,h);return l.elements||l},interpolation:function(t,e,n,i){return Ar.interpolation[this.interpolationType](t,e,n,i)},updateNodeTranslation:function(t,e){t.x=e[0],t.y=e[1],t.z=e[2]},updateNodeScale:function(t,e){t.scaleX=e[0],t.scaleY=e[1],t.scaleZ=e[2]},updateNodeQuaternion:function(t,e){t.quaternion.fromArray(e)},updateNodeWeights:function(t,e){var n=this._originalWeightIndices=this._originalWeightIndices||[],i=e.length;e=e.slice();for(var r=0;re[s]){var o=e[s];e[s]=e[a],e[a]=o,o=n[s],n[s]=n[a],n[a]=o}t.traverse((function(t){t.isMesh&&t.geometry&&t.geometry.isMorphGeometry&&t.geometry.update(e,n)}))},updateNodeState:function(t,e){if(e){var n=this.type;n===Ar.StateType.ROTATION&&(n=Ar.StateType.QUATERNION);var i=this.getState(t);if(i){var r="updateNode"+n;this[r]?this[r](e,i):Ar._extraStateHandlers.handler[n]?Ar._extraStateHandlers.handler[n].call(this,e,i):m.a.warnOnce(r,"updateNodeState failed unknow type(%s)",n)}}},clone:function(){return new this.constructor({keyTime:this.keyTime,states:this.states,type:this.type,nodeName:this.nodeName})}}),Ir=Ar,Lr=s.a.create({Statics:{_anims:[],tick:function(t){this._anims.forEach((function(e){return e.tick(t)}))}},Mixes:a.a,isAnimation:!0,className:"Animation",paused:!1,currentLoopCount:0,loop:1/0,currentTime:0,timeScale:1,startTime:0,endTime:0,clipStartTime:0,clipEndTime:0,nodeNameMap:null,_rootNode:null,rootNode:{get:function(){return this._rootNode},set:function(t){this._rootNode=t,this.initNodeNameMap()}},validAnimationIds:null,constructor:function(t){this.id=d.a.generateUUID(this.className),this.animStatesList=[],this.clips={},Object.assign(this,t),this.initClipTime()},addClip:function(t,e,n,i){this.clips[t]={start:e,end:n,animStatesList:i}},removeClip:function(t){this.clips[t]=null},getAnimStatesListTimeInfo:function(t){var e=0,n=1/0;return t.forEach((function(t){e=Math.max(t.keyTime[t.keyTime.length-1],e),n=Math.min(t.keyTime[0],n)})),{startTime:n,endTime:e}},initClipTime:function(){var t=this.getAnimStatesListTimeInfo(this.animStatesList);this.clipStartTime=t.startTime,this.clipEndTime=t.endTime},initNodeNameMap:function(){if(this._rootNode){var t=this.nodeNameMap={};this._rootNode.traverse((function(e){t[e.animationId]=e;var n=e.name;void 0===n||t[n]||(t[n]=e)}),!1)}},tick:function(t){this.paused||(this.currentTime+=t/1e3*this.timeScale,this.currentTime>=this.endTime?(this.currentLoopCount++,this.currentTime=this.endTime,this.updateAnimStates(),this.fire("loopEnd"),!this.loop||this.currentLoopCount>=this.loop?(this.stop(),this.fire("end")):this.currentTime=this.startTime):this.updateAnimStates())},updateAnimStates:function(){var t=this;return this.animStatesList.forEach((function(e){e.updateNodeState(t.currentTime,t.nodeNameMap[e.nodeName])})),this},play:function(t,e){var n;if("string"==typeof t){var i=this.clips[t];i?(n=i.start,e=i.end,i.animStatesList&&(this.animStatesList=i.animStatesList,this.initClipTime())):m.a.warn("no this animation clip name:"+t)}else n=t;void 0===n&&(n=this.clipStartTime),void 0===e&&(e=this.clipEndTime),this.endTime=Math.min(e,this.clipEndTime),this.startTime=Math.min(n,this.endTime),this.currentTime=this.startTime,this.currentLoopCount=0,this.stop(),this.paused=!1,Lr._anims.push(this)},stop:function(){this.paused=!0;var t=Lr._anims,e=t.indexOf(this);-1!==e&&t.splice(e,1)},pause:function(){this.paused=!0},resume:function(){this.paused=!1},clone:function(t){var e=new this.constructor({rootNode:t,animStatesList:this.animStatesList,timeScale:this.timeScale,loop:this.loop,paused:this.paused,currentTime:this.currentTime,startTime:this.startTime,endTime:this.endTime,clips:this.clips});return this.paused||e.play(),e}}),Or=Lr;function Sr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,r=!1,s=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,s=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw s}}return n}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return Rr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rr(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=2&&(this.isGLTF2=!0),this.parseExtensionUsed(),this.loadResources(t).then((function(){return e.parseExtensions(e.json.extensions,null,{isGlobal:!0,methodName:"parseOnLoad"}),Promise.resolve()})).then((function(){return e.parseGeometries()})).then((function(){return e.parseScene()}))},parseExtensionUsed:function(){var t=this;this.extensionsUsed={},r.each(this.json.extensionsUsed,(function(e){t.extensionsUsed[e]=!0})),this.extensionsUsed.WEB3D_quantized_attributes||(this.isUnQuantizeInShader=!1)},getExtensionHandler:function(t){return this.extensionHandlers&&this.extensionHandlers[t]||Fr.extensionHandlers[t]},parseExtension:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=t[e],s=this.getExtensionHandler(e);return s&&s.parse?s.parse(r,this,n,i):n},parseExtensions:function(t,e){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.each(t,(function(t,r){if(!i.ignoreExtensions||!i.ignoreExtensions[r]){var s=n.getExtensionHandler(r),a=i.methodName||"parse";s&&s[a]&&(e=s[a](t,n,e,i))}})),e},isUseExtension:function(t,e){return!!(t&&t.extensions&&t.extensions[e])},parseBinary:function(t){this.isBinary=!0;var e,n=new DataView(t),i=n.getUint32(4,!0),s=n.getUint32(8,!0),a=12;if(i<2){var o=n.getUint32(a,!0);e=new Uint8Array(t,20,o),e=r.convertUint8ArrayToString(e,!0),this.json=JSON.parse(e),this.binaryBody=t.slice(20+o)}else{if(2!==i)throw new Error("Dont support glTF version ".concat(i));for(;as*r.BYTES_PER_ELEMENT)a.array=new r(a.buffer,a.byteOffset,a.byteLength/r.BYTES_PER_ELEMENT),i=new C(a.array,s,{offset:n.byteOffset||0,stride:a.byteStride,bufferViewId:a.id});else{var u,c=(n.byteOffset||0)+a.byteOffset;if(c%r.BYTES_PER_ELEMENT||this.forceCreateNewBuffer)u=new r(a.buffer.slice(c,c+o*r.BYTES_PER_ELEMENT));else u=new r(a.buffer,c,o);i=new C(u,s)}return n.sparse&&(i||(i=new C(new r(o),s)),i=this.sparseAccessorHandler(i,n.sparse)),i=this.parseExtensions(n.extensions,i,{isDecode:e,isAccessor:!0}),n.data=i,n.normalized&&(i.normalized=!0),i},getArrayByAccessor:function(t,e){var n=this.json.accessors[t];if(n.array)return n.array;var i=this.getAccessorData(t,e);if(!i.stride&&!i.offset&&1===i.size)return i.data;var r=[];return i.traverse((function(t){r.push(t.toArray?t.toArray():t)})),n.array=r,r},parseTechnique:function(t,e){var n=null;this.json.techniques&&(n=this.json.techniques[t.technique]),n&&n.states&&(n.states.enable.forEach((function(t){switch(t){case yr:e.blend=!0;break;case xr:e.depthTest=!0;break;case Nr:e.cullFace=!0}})),r.each(n.states.functions,(function(t,n){switch(n){case"blendEquationSeparate":e.blendEquation=t[0],e.blendEquationAlpha=t[1];break;case"blendFuncSeparate":e.blendSrc=t[0],e.blendDst=t[1],e.blendSrcAlpha=t[2],e.blendDstAlpha=t[3];break;case"depthMask":e.depthMask=t[0];break;case"cullFace":e.cullFaceType=t[0];break;default:e[n]=t}})),e.cullFace?e.side=e.cullFaceType===br?Cr:br:e.side=Pr)},createMorphGeometry:function(t,e){var n=this,i=new Bn,s=i.targets={};return r.each(t.targets,(function(t){r.each(t,(function(t,e){var i=Dr[e].name;s[i]||(s[i]=[]);var r=n.getAccessorData(t,!0);s[i].push(r)}))})),i.weights=e||new Float32Array(t.targets.length),i},handlerGeometry:function(t,e){var n=void 0===e.mode?4:e.mode;if(e.extensions){var i=this.parseExtensions(e.extensions,null,{primitive:e,isPrimitive:!0});if(i)return i.mode=n,i}t||(t=new Z({mode:n})),"indices"in e&&(t.indices=this.getAccessorData(e.indices));var r=e.attributes;for(var s in r){var a=Dr[s];if(a){var o=!(this.isUnQuantizeInShader&&a.decodeMatName);t[a.name]=this.getAccessorData(r[s],o),o||(t[a.decodeMatName]=t[a.name].decodeMat,delete t[a.name].decodeMat)}else m.a.warn("Unknow attribute named ".concat(s,"!"))}return t},handlerSkinedMesh:function(t,e){if(e){var n,i=(e.jointNames||e.joints).length;e.bindShapeMatrix&&(n=(new o.a).fromArray(e.bindShapeMatrix));for(var r=this.getArrayByAccessor(e.inverseBindMatrices,!0),s=0;s0&&(i=Object.values(n)[0].animStatesList),i.length?new Or({rootNode:this.node,animStatesList:i,validAnimationIds:s,clips:n}):null},parseScene:function(){var t=this;this.parseMaterials(),this.jointMap={},this.meshes=[],this.lights=[],this.node=new g({needCallChildUpdate:!1}),this.parseCameras();var e=this.json.scenes[this.getDefaultSceneName()];if(!e)return m.a.warn("GLTFParser:no scene!"),{node:this.node,meshes:[],cameras:[],lights:[],textures:[],materials:[]};e.nodes.forEach((function(e){return t.parseNode(e,t.node)})),this.node.resetSkinedMeshRootNode();var n={node:this.node,scene:this.node,meshes:this.meshes,json:this.json,cameras:Object.values(this.cameras),lights:this.lights,textures:Object.values(this.textures),materials:Object.values(this.materials)},i=this.parseAnimations();return i&&(this.node.setAnim(i),i.play(),n.anim=i),this.parseExtensions(e.extensions,null,{isScene:!0}),this.parseExtensions(this.json.extensions,n,{isGlobal:!0,methodName:"parseOnEnd"}),n},getDefaultSceneName:function(){return void 0!==this.defaultScene?this.defaultScene:this.json.scenes?Object.keys(this.json.scenes)[0]:null}}),Ur=Fr,Gr=s.a.create({Extends:tr,isGLTFLoader:!0,className:"GLTFLoader",constructor:function(){Gr.superclass.constructor.call(this)},load:function(t){var e=this;return this.loadRes(t.src,"buffer").then((function(n){return new Ur(n,t).parse(e)})).catch((function(t){throw m.a.error("load gltf failed",t.message,t.stack),t}))}});nr.addLoader("gltf",Gr),nr.addLoader("glb",Gr);var Br=Gr,Vr=n(106),Xr=n.n(Vr),jr=P.a.RGBA,zr=P.a.NEAREST,kr=P.a.CLAMP_TO_EDGE,qr=P.a.FLOAT,Wr=s.a.create({Extends:tr,isHDRLoader:!0,className:"HDRLoader",constructor:function(){Wr.superclass.constructor.call(this)},load:function(t){return this.loadRes(t.src,"buffer").then((function(e){try{var n=Xr()(e),i=n.shape,r=n.data,s=new qt({width:i[0],height:i[1],flipY:t.flipY||!1,image:r,type:qr,magFilter:zr,minFilter:zr,wrapS:kr,wrapT:kr,internalFormat:jr,format:jr});return Object.assign(s,t),s}catch(t){m.a.error("HDRLoader:parse error => ",t)}return null}))}});nr.addLoader("hdr",Wr);var Yr=Wr,Zr=s.a.create({Statics:{HEADER_LEN:64,COMPRESSED_2D:0,COMPRESSED_3D:1,TEX_2D:2,TEX_3D:3},isKhronosTextureContainer:!0,className:"KhronosTextureContainer",constructor:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.arrayBuffer=t,this.baseOffset=n;var i=new Uint8Array(this.arrayBuffer,this.baseOffset,12);if(171===i[0]&&75===i[1]&&84===i[2]&&88===i[3]&&32===i[4]&&49===i[5]&&49===i[6]&&187===i[7]&&13===i[8]&&10===i[9]&&26===i[10]&&10===i[11]){var r=Uint32Array.BYTES_PER_ELEMENT,s=new DataView(this.arrayBuffer,this.baseOffset+12,13*r),a=s.getUint32(0,!0),o=67305985===a;this.glType=s.getUint32(1*r,o),this.glTypeSize=s.getUint32(2*r,o),this.glFormat=s.getUint32(3*r,o),this.glInternalFormat=s.getUint32(4*r,o),this.glBaseInternalFormat=s.getUint32(5*r,o),this.pixelWidth=s.getUint32(6*r,o),this.pixelHeight=s.getUint32(7*r,o),this.pixelDepth=s.getUint32(8*r,o),this.numberOfArrayElements=s.getUint32(9*r,o),this.numberOfFaces=s.getUint32(10*r,o),this.numberOfMipmapLevels=s.getUint32(11*r,o),this.bytesOfKeyValueData=s.getUint32(12*r,o),this.numberOfMipmapLevels=Math.max(1,this.numberOfMipmapLevels),0!==this.pixelHeight&&0===this.pixelDepth?0===this.numberOfArrayElements?this.numberOfFaces===e?0===this.glType?this.loadType=Zr.COMPRESSED_2D:this.loadType=Zr.TEX_2D:m.a.warn("number of faces expected"+e+", but found "+this.numberOfFaces):m.a.warn("texture arrays not currently supported"):m.a.warn("only 2D textures currently supported")}else m.a.error("texture missing KTX identifier")},mipmaps:function(t){for(var e=[],n=Zr.HEADER_LEN+this.bytesOfKeyValueData,i=this.pixelWidth,r=this.pixelHeight,s=t?this.numberOfMipmapLevels:1,a=0;a2&&void 0!==arguments[2]?arguments[2]:0,i=new Zr(e,1,n),r={compressed:0===i.glType,type:i.glType,width:i.pixelWidth,height:i.pixelHeight,internalFormat:i.glInternalFormat,format:i.glFormat,isCubemap:6===i.numberOfFaces};return i.numberOfMipmapLevels>=Math.floor(Math.log2(Math.max(r.width,r.height))+1)?(r.mipmaps=i.mipmaps(!0),r.image=r.mipmaps[0].data):(r.mipmaps=null,r.image=i.mipmaps(!1)[0].data),new qt(r)}});nr.addLoader("ktx",Kr);var Qr=Kr,Jr=s.a.create({Mixes:a.a,isLoadQueue:!0,className:"LoadQueue",Statics:{addLoader:function(t,e){m.a.warn("LoadQueue.addLoader is duplicated, please use Loader.addLoader"),nr.addLoader(t,e)}},constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){return t&&(t=Array.isArray(t)?t:[t],this._source=this._source.concat(t)),this},get:function(t){if(!t)return null;for(var e=this._source,n=0;n=n)this.fire("complete");else if(this._currentIndex2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=this.renderer.pixelRatio,s=[],a=this.framebuffer.readPixels(t*r,e*r,n*r,i*r),o=0;o0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=s*a),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,r){var i=e[0],s=e[1],a=e[2],o=e[3];return t[0]=i+r*(n[0]-i),t[1]=s+r*(n[1]-s),t[2]=a+r*(n[2]-a),t[3]=o+r*(n[3]-o),t},e.random=function(t,e){var n,i,s,a,o,u;e=e||1;do{o=(n=2*r.RANDOM()-1)*n+(i=2*r.RANDOM()-1)*i}while(o>=1);do{u=(s=2*r.RANDOM()-1)*s+(a=2*r.RANDOM()-1)*a}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*i,t[2]=e*s*c,t[3]=e*a*c,t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*s+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*s+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*s+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*s+n[15]*a,t},e.transformQuat=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=n[0],o=n[1],u=n[2],c=n[3],h=c*r+o*s-u*i,l=c*i+u*r-a*s,f=c*s+a*i-o*r,m=-a*r-o*i-u*s;return t[0]=h*c+m*-a+l*-u-f*-o,t[1]=l*c+m*-o+f*-a-h*-u,t[2]=f*c+m*-u+h*-o-l*-a,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-c)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+s*s)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return n*n+r*r+i*i+s*s}function h(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)}function l(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.len=h,e.sqrLen=l,e.forEach=function(){var t=i();return function(e,n,r,i,s,a){var o,u=void 0;for(n||(n=4),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=e[0],o=e[1],u=e[2];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(s-u)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function a(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function l(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function f(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function m(t,e){var n=e[0],r=e[1],i=e[2],s=n*n+r*r+i*i;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=h,e.sqrDist=l,e.len=s,e.sqrLen=f,e.forEach=function(){var t=i();return function(e,n,r,i,s,a){var o,u=void 0;for(n||(n=3),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;ur.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=h,e.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*o,t[1]=i*u+s*o,t[2]=s*u-i*o,t[3]=a*u-r*o,t},e.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u-s*o,t[1]=i*u+a*o,t[2]=s*u+r*o,t[3]=a*u-i*o,t},e.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*o,t[1]=i*u-r*o,t[2]=s*u+a*o,t[3]=a*u-s*o,t},e.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},e.slerp=l,e.random=function(t){var e=r.RANDOM(),n=r.RANDOM(),i=r.RANDOM(),s=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*n),t[1]=s*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*i),t[3]=a*Math.cos(2*Math.PI*i),t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=n*n+r*r+i*i+s*s,o=a?1/a:0;return t[0]=-n*o,t[1]=-r*o,t[2]=-i*o,t[3]=s*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=f,e.fromEuler=function(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var s=Math.sin(e),a=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(r),h=Math.cos(r);return t[0]=s*u*h-a*o*c,t[1]=a*o*h+s*u*c,t[2]=a*u*c-s*o*h,t[3]=a*u*h+s*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var r=o(n(0)),i=o(n(5)),s=o(n(2)),a=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function h(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=r*h+a*o+i*c-s*u,t[1]=i*h+a*u+s*o-r*c,t[2]=s*h+a*c+r*u-i*o,t[3]=a*h-r*o-i*u-s*c,t}function l(t,e,n,i){var s=e[0],a=e[1],o=e[2],u=e[3],c=n[0],h=n[1],l=n[2],f=n[3],m=void 0,E=void 0,d=void 0,M=void 0,_=void 0;return(E=s*c+a*h+o*l+u*f)<0&&(E=-E,c=-c,h=-h,l=-l,f=-f),1-E>r.EPSILON?(m=Math.acos(E),d=Math.sin(m),M=Math.sin((1-i)*m)/d,_=Math.sin(i*m)/d):(M=1-i,_=i),t[0]=M*s+_*c,t[1]=M*a+_*h,t[2]=M*o+_*l,t[3]=M*u+_*f,t}function f(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+a]-e[3*a+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}e.clone=a.clone,e.fromValues=a.fromValues,e.copy=a.copy,e.set=a.set,e.add=a.add,e.mul=h,e.scale=a.scale,e.dot=a.dot,e.lerp=a.lerp;var m=e.length=a.length,E=(e.len=m,e.squaredLength=a.squaredLength),d=(e.sqrLen=E,e.normalize=a.normalize);e.exactEquals=a.exactEquals,e.equals=a.equals,e.rotationTo=function(){var t=s.create(),e=s.fromValues(1,0,0),n=s.fromValues(0,1,0);return function(r,i,a){var o=s.dot(i,a);return o<-.999999?(s.cross(t,e,i),s.len(t)<1e-6&&s.cross(t,n,i),s.normalize(t,t),c(r,t,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(s.cross(t,i,a),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+o,d(r,r))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,r,i,s,a,o){return l(t,r,a,o),l(e,i,s,o),l(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=i.create();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],d(e,f(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,i,s,a,o,u,c,h,l,f,m,E,d,M){var _=new r.ARRAY_TYPE(16);return _[0]=t,_[1]=e,_[2]=n,_[3]=i,_[4]=s,_[5]=a,_[6]=o,_[7]=u,_[8]=c,_[9]=h,_[10]=l,_[11]=f,_[12]=m,_[13]=E,_[14]=d,_[15]=M,_},e.set=function(t,e,n,r,i,s,a,o,u,c,h,l,f,m,E,d,M){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t[9]=h,t[10]=l,t[11]=f,t[12]=m,t[13]=E,t[14]=d,t[15]=M,t},e.identity=i,e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],s=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=s,t[11]=e[14],t[12]=i,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],m=e[11],E=e[12],d=e[13],M=e[14],_=e[15],v=n*o-r*a,p=n*u-i*a,T=n*c-s*a,R=r*u-i*o,A=r*c-s*o,S=i*c-s*u,g=h*d-l*E,N=h*M-f*E,y=h*_-m*E,O=l*M-f*d,L=l*_-m*d,P=f*_-m*M,I=v*P-p*L+T*O+R*y-A*N+S*g;return I?(I=1/I,t[0]=(o*P-u*L+c*O)*I,t[1]=(i*L-r*P-s*O)*I,t[2]=(d*S-M*A+_*R)*I,t[3]=(f*A-l*S-m*R)*I,t[4]=(u*y-a*P-c*N)*I,t[5]=(n*P-i*y+s*N)*I,t[6]=(M*T-E*S-_*p)*I,t[7]=(h*S-f*T+m*p)*I,t[8]=(a*L-o*y+c*g)*I,t[9]=(r*y-n*L-s*g)*I,t[10]=(E*A-d*T+_*v)*I,t[11]=(l*T-h*A-m*v)*I,t[12]=(o*N-a*O-u*g)*I,t[13]=(n*O-r*N+i*g)*I,t[14]=(d*p-E*R-M*v)*I,t[15]=(h*R-l*p+f*v)*I,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],m=e[11],E=e[12],d=e[13],M=e[14],_=e[15];return t[0]=o*(f*_-m*M)-l*(u*_-c*M)+d*(u*m-c*f),t[1]=-(r*(f*_-m*M)-l*(i*_-s*M)+d*(i*m-s*f)),t[2]=r*(u*_-c*M)-o*(i*_-s*M)+d*(i*c-s*u),t[3]=-(r*(u*m-c*f)-o*(i*m-s*f)+l*(i*c-s*u)),t[4]=-(a*(f*_-m*M)-h*(u*_-c*M)+E*(u*m-c*f)),t[5]=n*(f*_-m*M)-h*(i*_-s*M)+E*(i*m-s*f),t[6]=-(n*(u*_-c*M)-a*(i*_-s*M)+E*(i*c-s*u)),t[7]=n*(u*m-c*f)-a*(i*m-s*f)+h*(i*c-s*u),t[8]=a*(l*_-m*d)-h*(o*_-c*d)+E*(o*m-c*l),t[9]=-(n*(l*_-m*d)-h*(r*_-s*d)+E*(r*m-s*l)),t[10]=n*(o*_-c*d)-a*(r*_-s*d)+E*(r*c-s*o),t[11]=-(n*(o*m-c*l)-a*(r*m-s*l)+h*(r*c-s*o)),t[12]=-(a*(l*M-f*d)-h*(o*M-u*d)+E*(o*f-u*l)),t[13]=n*(l*M-f*d)-h*(r*M-i*d)+E*(r*f-i*l),t[14]=-(n*(o*M-u*d)-a*(r*M-i*d)+E*(r*u-i*o)),t[15]=n*(o*f-u*l)-a*(r*f-i*l)+h*(r*u-i*o),t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8],h=t[9],l=t[10],f=t[11],m=t[12],E=t[13],d=t[14],M=t[15];return(e*a-n*s)*(l*M-f*d)-(e*o-r*s)*(h*M-f*E)+(e*u-i*s)*(h*d-l*E)+(n*o-r*a)*(c*M-f*m)-(n*u-i*a)*(c*d-l*m)+(r*u-i*o)*(c*E-h*m)},e.multiply=s,e.translate=function(t,e,n){var r=n[0],i=n[1],s=n[2],a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,l=void 0,f=void 0,m=void 0,E=void 0,d=void 0,M=void 0,_=void 0;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*s+e[12],t[13]=e[1]*r+e[5]*i+e[9]*s+e[13],t[14]=e[2]*r+e[6]*i+e[10]*s+e[14],t[15]=e[3]*r+e[7]*i+e[11]*s+e[15]):(a=e[0],o=e[1],u=e[2],c=e[3],h=e[4],l=e[5],f=e[6],m=e[7],E=e[8],d=e[9],M=e[10],_=e[11],t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=h,t[5]=l,t[6]=f,t[7]=m,t[8]=E,t[9]=d,t[10]=M,t[11]=_,t[12]=a*r+h*i+E*s+e[12],t[13]=o*r+l*i+d*s+e[13],t[14]=u*r+f*i+M*s+e[14],t[15]=c*r+m*i+_*s+e[15]),t},e.scale=function(t,e,n){var r=n[0],i=n[1],s=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,i){var s,a,o,u,c,h,l,f,m,E,d,M,_,v,p,T,R,A,S,g,N,y,O,L,P=i[0],I=i[1],b=i[2],C=Math.sqrt(P*P+I*I+b*b);return C0?(n[0]=2*(c*u+f*i+h*o-l*s)/m,n[1]=2*(h*u+f*s+l*i-c*o)/m,n[2]=2*(l*u+f*o+c*s-h*i)/m):(n[0]=2*(c*u+f*i+h*o-l*s),n[1]=2*(h*u+f*s+l*i-c*o),n[2]=2*(l*u+f*o+c*s-h*i)),a(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[4],a=e[5],o=e[6],u=e[8],c=e[9],h=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(s*s+a*a+o*o),t[2]=Math.sqrt(u*u+c*c+h*h),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],r=0;return n>0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},e.fromRotationTranslationScale=function(t,e,n,r){var i=e[0],s=e[1],a=e[2],o=e[3],u=i+i,c=s+s,h=a+a,l=i*u,f=i*c,m=i*h,E=s*c,d=s*h,M=a*h,_=o*u,v=o*c,p=o*h,T=r[0],R=r[1],A=r[2];return t[0]=(1-(E+M))*T,t[1]=(f+p)*T,t[2]=(m-v)*T,t[3]=0,t[4]=(f-p)*R,t[5]=(1-(l+M))*R,t[6]=(d+_)*R,t[7]=0,t[8]=(m+v)*A,t[9]=(d-_)*A,t[10]=(1-(l+E))*A,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,r,i){var s=e[0],a=e[1],o=e[2],u=e[3],c=s+s,h=a+a,l=o+o,f=s*c,m=s*h,E=s*l,d=a*h,M=a*l,_=o*l,v=u*c,p=u*h,T=u*l,R=r[0],A=r[1],S=r[2],g=i[0],N=i[1],y=i[2],O=(1-(d+_))*R,L=(m+T)*R,P=(E-p)*R,I=(m-T)*A,b=(1-(f+_))*A,C=(M+v)*A,D=(E+p)*S,U=(M-v)*S,B=(1-(f+d))*S;return t[0]=O,t[1]=L,t[2]=P,t[3]=0,t[4]=I,t[5]=b,t[6]=C,t[7]=0,t[8]=D,t[9]=U,t[10]=B,t[11]=0,t[12]=n[0]+g-(O*g+I*N+D*y),t[13]=n[1]+N-(L*g+b*N+U*y),t[14]=n[2]+y-(P*g+C*N+B*y),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=n+n,o=r+r,u=i+i,c=n*a,h=r*a,l=r*o,f=i*a,m=i*o,E=i*u,d=s*a,M=s*o,_=s*u;return t[0]=1-l-E,t[1]=h+_,t[2]=f-M,t[3]=0,t[4]=h-_,t[5]=1-c-E,t[6]=m+d,t[7]=0,t[8]=f+M,t[9]=m-d,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,r,i,s,a){var o=1/(n-e),u=1/(i-r),c=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(i+r)*u,t[10]=(a+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*c,t[15]=0,t},e.perspective=function(t,e,n,r,i){var s=1/Math.tan(e/2),a=void 0;return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(r-i),t[10]=(i+r)*a,t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t},e.perspectiveFromFieldOfView=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+o),c=2/(i+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-o)*u*.5,t[9]=(i-s)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},e.ortho=function(t,e,n,r,i,s,a){var o=1/(e-n),u=1/(r-i),c=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(i+r)*u,t[14]=(a+s)*c,t[15]=1,t},e.lookAt=function(t,e,n,s){var a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,l=void 0,f=void 0,m=void 0,E=void 0,d=void 0,M=e[0],_=e[1],v=e[2],p=s[0],T=s[1],R=s[2],A=n[0],S=n[1],g=n[2];return Math.abs(M-A)0&&(h*=m=1/Math.sqrt(m),l*=m,f*=m);var E=u*f-c*l,d=c*h-o*f,M=o*l-u*h;return(m=E*E+d*d+M*M)>0&&(E*=m=1/Math.sqrt(m),d*=m,M*=m),t[0]=E,t[1]=d,t[2]=M,t[3]=0,t[4]=l*M-f*d,t[5]=f*E-h*M,t[6]=h*d-l*E,t[7]=0,t[8]=h,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=a,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],l=t[8],f=t[9],m=t[10],E=t[11],d=t[12],M=t[13],_=t[14],v=t[15],p=e[0],T=e[1],R=e[2],A=e[3],S=e[4],g=e[5],N=e[6],y=e[7],O=e[8],L=e[9],P=e[10],I=e[11],b=e[12],C=e[13],D=e[14],U=e[15];return Math.abs(n-p)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(i-T)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(s-R)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(a-A)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(o-S)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(u-g)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-N)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(N))&&Math.abs(h-y)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(l-O)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-L)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(m-P)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(E-I)<=r.EPSILON*Math.max(1,Math.abs(E),Math.abs(I))&&Math.abs(d-b)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(b))&&Math.abs(M-C)<=r.EPSILON*Math.max(1,Math.abs(M),Math.abs(C))&&Math.abs(_-D)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(D))&&Math.abs(v-U)<=r.EPSILON*Math.max(1,Math.abs(v),Math.abs(U))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function s(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=e[9],m=e[10],E=e[11],d=e[12],M=e[13],_=e[14],v=e[15],p=n[0],T=n[1],R=n[2],A=n[3];return t[0]=p*r+T*o+R*l+A*d,t[1]=p*i+T*u+R*f+A*M,t[2]=p*s+T*c+R*m+A*_,t[3]=p*a+T*h+R*E+A*v,p=n[4],T=n[5],R=n[6],A=n[7],t[4]=p*r+T*o+R*l+A*d,t[5]=p*i+T*u+R*f+A*M,t[6]=p*s+T*c+R*m+A*_,t[7]=p*a+T*h+R*E+A*v,p=n[8],T=n[9],R=n[10],A=n[11],t[8]=p*r+T*o+R*l+A*d,t[9]=p*i+T*u+R*f+A*M,t[10]=p*s+T*c+R*m+A*_,t[11]=p*a+T*h+R*E+A*v,p=n[12],T=n[13],R=n[14],A=n[15],t[12]=p*r+T*o+R*l+A*d,t[13]=p*i+T*u+R*f+A*M,t[14]=p*s+T*c+R*m+A*_,t[15]=p*a+T*h+R*E+A*v,t}function a(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=r+r,u=i+i,c=s+s,h=r*o,l=r*u,f=r*c,m=i*u,E=i*c,d=s*c,M=a*o,_=a*u,v=a*c;return t[0]=1-(m+d),t[1]=l+v,t[2]=f-_,t[3]=0,t[4]=l-v,t[5]=1-(h+d),t[6]=E+M,t[7]=0,t[8]=f+_,t[9]=E-M,t[10]=1-(h+m),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=s,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,i,s,a,o,u,c){var h=new r.ARRAY_TYPE(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=i,h[4]=s,h[5]=a,h[6]=o,h[7]=u,h[8]=c,h},e.set=function(t,e,n,r,i,s,a,o,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],l=h*a-o*c,f=-h*s+o*u,m=c*s-a*u,E=n*l+r*f+i*m;return E?(E=1/E,t[0]=l*E,t[1]=(-h*r+i*c)*E,t[2]=(o*r-i*a)*E,t[3]=f*E,t[4]=(h*n-i*u)*E,t[5]=(-o*n+i*s)*E,t[6]=m*E,t[7]=(-c*n+r*u)*E,t[8]=(a*n-r*s)*E,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-o*c,t[1]=i*c-r*h,t[2]=r*o-i*a,t[3]=o*u-s*h,t[4]=n*h-i*u,t[5]=i*s-n*o,t[6]=s*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*s,t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8];return e*(c*s-a*u)+n*(-c*i+a*o)+r*(u*i-s*o)},e.multiply=i,e.translate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],m=n[1];return t[0]=r,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=f*r+m*a+c,t[7]=f*i+m*o+h,t[8]=f*s+m*u+l,t},e.rotate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=Math.sin(n),m=Math.cos(n);return t[0]=m*r+f*a,t[1]=m*i+f*o,t[2]=m*s+f*u,t[3]=m*a-f*r,t[4]=m*o-f*i,t[5]=m*u-f*s,t[6]=c,t[7]=h,t[8]=l,t},e.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=n+n,o=r+r,u=i+i,c=n*a,h=r*a,l=r*o,f=i*a,m=i*o,E=i*u,d=s*a,M=s*o,_=s*u;return t[0]=1-l-E,t[3]=h-_,t[6]=f+M,t[1]=h+_,t[4]=1-c-E,t[7]=m-d,t[2]=f-M,t[5]=m+d,t[8]=1-c-l,t},e.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],m=e[11],E=e[12],d=e[13],M=e[14],_=e[15],v=n*o-r*a,p=n*u-i*a,T=n*c-s*a,R=r*u-i*o,A=r*c-s*o,S=i*c-s*u,g=h*d-l*E,N=h*M-f*E,y=h*_-m*E,O=l*M-f*d,L=l*_-m*d,P=f*_-m*M,I=v*P-p*L+T*O+R*y-A*N+S*g;return I?(I=1/I,t[0]=(o*P-u*L+c*O)*I,t[1]=(u*y-a*P-c*N)*I,t[2]=(a*L-o*y+c*g)*I,t[3]=(i*L-r*P-s*O)*I,t[4]=(n*P-i*y+s*N)*I,t[5]=(r*y-n*L-s*g)*I,t[6]=(d*S-M*A+_*R)*I,t[7]=(M*T-E*S-_*p)*I,t[8]=(E*A-d*T+_*v)*I,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],l=t[8],f=e[0],m=e[1],E=e[2],d=e[3],M=e[4],_=e[5],v=e[6],p=e[7],T=e[8];return Math.abs(n-f)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-m)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(s-E)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(a-d)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-M)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(u-_)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(c-v)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-p)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(p))&&Math.abs(l-T)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(T))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],m=n[1],E=n[2],d=n[3],M=n[4],_=n[5],v=n[6],p=n[7],T=n[8];return t[0]=f*r+m*a+E*c,t[1]=f*i+m*o+E*h,t[2]=f*s+m*u+E*l,t[3]=d*r+M*a+_*c,t[4]=d*i+M*o+_*h,t[5]=d*s+M*u+_*l,t[6]=v*r+p*a+T*c,t[7]=v*i+p*o+T*h,t[8]=v*s+p*u+T*l,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=i,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=s,e.multiply=a,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=l,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],s=e[1];return t[0]=i+r*(n[0]-i),t[1]=s+r*(n[1]-s),t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.rotate=function(t,e,n,r){var i=e[0]-n[0],s=e[1]-n[1],a=Math.sin(r),o=Math.cos(r);return t[0]=i*o-s*a+n[0],t[1]=i*a+s*o+n[1],t},e.angle=function(t,e){var n=t[0],r=t[1],i=e[0],s=e[1],a=n*n+r*r;a>0&&(a=1/Math.sqrt(a));var o=i*i+s*s;o>0&&(o=1/Math.sqrt(o));var u=(n*i+r*s)*a*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],i=t[1],s=e[0],a=e[1];return Math.abs(n-s)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function h(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function l(t){var e=t[0],n=t[1];return e*e+n*n}e.len=h,e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=l,e.forEach=function(){var t=i();return function(e,n,r,i,s,a){var o,u=void 0;for(n||(n=2),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,s=e[2]/n,a=e[3]/n,o=e[4],u=e[5],c=e[6],h=e[7],l=r*o+i*u+s*c+a*h;t[0]=r,t[1]=i,t[2]=s,t[3]=a,t[4]=(o-r*l)/n,t[5]=(u-i*l)/n,t[6]=(c-s*l)/n,t[7]=(h-a*l)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],l=e[0],f=e[1],m=e[2],E=e[3],d=e[4],M=e[5],_=e[6],v=e[7];return Math.abs(n-l)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-m)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-E)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(o-d)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-M)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(c-_)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(h-v)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))};var r=a(n(0)),i=a(n(3)),s=a(n(4));function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var r=.5*n[0],i=.5*n[1],s=.5*n[2],a=e[0],o=e[1],u=e[2],c=e[3];return t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=r*c+i*u-s*o,t[5]=i*c+s*a-r*u,t[6]=s*c+r*o-i*a,t[7]=-r*a-i*o-s*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=n[4],u=n[5],c=n[6],h=n[7],l=e[4],f=e[5],m=e[6],E=e[7],d=n[0],M=n[1],_=n[2],v=n[3];return t[0]=r*v+a*d+i*_-s*M,t[1]=i*v+a*M+s*d-r*_,t[2]=s*v+a*_+r*M-i*d,t[3]=a*v-r*d-i*M-s*_,t[4]=r*h+a*o+i*c-s*u+l*v+E*d+f*_-m*M,t[5]=i*h+a*u+s*o-r*c+f*v+E*M+m*d-l*_,t[6]=s*h+a*c+r*u-i*o+m*v+E*_+l*M-f*d,t[7]=a*h-r*o-i*u-s*c+E*v-l*d-f*M-m*_,t}e.getReal=i.copy,e.setReal=i.copy,e.mul=c;var h=e.dot=i.dot,l=e.length=i.length,f=(e.len=l,e.squaredLength=i.squaredLength);e.sqrLen=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,i,s,a){var o=new r.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o[4]=s,o[5]=a,o},e.set=function(t,e,n,r,i,s,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=a,t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=n*s-r*i;return u?(u=1/u,t[0]=s*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*o-s*a)*u,t[5]=(r*a-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=Math.sin(n),h=Math.cos(n);return t[0]=r*h+s*c,t[1]=i*h+a*c,t[2]=r*-c+s*h,t[3]=i*-c+a*h,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=r*c,t[1]=i*c,t[2]=s*h,t[3]=a*h,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=r,t[1]=i,t[2]=s,t[3]=a,t[4]=r*c+s*h+o,t[5]=i*c+a*h+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=e[0],h=e[1],l=e[2],f=e[3],m=e[4],E=e[5];return Math.abs(n-c)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-l)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(a-f)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(o-m)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(u-E)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1],l=n[2],f=n[3],m=n[4],E=n[5];return t[0]=r*c+s*h,t[1]=i*c+a*h,t[2]=r*l+s*f,t[3]=i*l+a*f,t[4]=r*m+s*E+o,t[5]=i*m+a*E+u,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=i,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,i){var s=new r.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=n,s[3]=i,s},e.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=n*s-i*r;return a?(a=1/a,t[0]=s*a,t[1]=-r*a,t[2]=-i*a,t[3]=n*a,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+s*o,t[1]=i*u+a*o,t[2]=r*-o+s*u,t[3]=i*-o+a*u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=n[0],u=n[1];return t[0]=r*o,t[1]=i*o,t[2]=s*u,t[3]=a*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=s,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-c)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=r*o+s*u,t[1]=i*o+a*u,t[2]=r*c+s*h,t[3]=i*c+a*h,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=i,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var r=m(n(0)),i=m(n(9)),s=m(n(8)),a=m(n(5)),o=m(n(4)),u=m(n(3)),c=m(n(7)),h=m(n(6)),l=m(n(2)),f=m(n(1));function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=r,e.mat2=i,e.mat2d=s,e.mat3=a,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=h,e.vec3=l,e.vec4=f}])},function(t,e,n){"use strict";var r=n(19),i=n.n(r);e.a=i.a},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"POSITION",(function(){return u})),n.d(r,"NORMAL",(function(){return c})),n.d(r,"DEPTH",(function(){return h})),n.d(r,"DISTANCE",(function(){return l}));var i=n(35),s=n.n(i).a,a=n(36),o=n.n(a).a,u="POSITION",c="NORMAL",h="DEPTH",l="DISTANCE",f={webgl:s,webglExtensions:o,Hilo:r};Object.assign(f,s,o,r);e.a=f},function(t,e,n){"use strict";var r={},i={_cache:r,level:3,LEVEL_LOG:3,LEVEL_WARN:2,LEVEL_ERROR:1,LEVEL_NONE:0,log:function(){return this.level>=3&&console.log.apply(console,arguments),this},warn:function(){return this.level>=2&&console.warn.apply(console,arguments),this},error:function(){return this.level>=1&&console.error.apply(console,arguments),this},logOnce:function(t){return r["log_"+t]||(r["log_"+t]=!0,this.log.apply(this,Array.prototype.slice.call(arguments,1))),this},warnOnce:function(t){return r["warn_"+t]||(r["warn_"+t]=!0,this.warn.apply(this,Array.prototype.slice.call(arguments,1))),this},errorOnce:function(t){return r["error_"+t]||(r["error_"+t]=!0,this.error.apply(this,Array.prototype.slice.call(arguments,1))),this}};e.a=i},function(t,e,n){"use strict";n.r(e),n.d(e,"each",(function(){return M})),n.d(e,"getRelativePath",(function(){return m})),n.d(e,"convertUint8ArrayToString",(function(){return E})),n.d(e,"getExtension",(function(){return d})),n.d(e,"getIndexFromSortedArray",(function(){return _})),n.d(e,"insertToSortedArray",(function(){return v})),n.d(e,"padLeft",(function(){return p})),n.d(e,"getTypedArrayClass",(function(){return S})),n.d(e,"copyArrayData",(function(){return g})),n.d(e,"isStrOrNumber",(function(){return N})),n.d(e,"getTypedArrayGLType",(function(){return T})),n.d(e,"getBlobUrl",(function(){return L})),n.d(e,"isBlobUrl",(function(){return y})),n.d(e,"revokeBlobUrl",(function(){return O})),n.d(e,"isArrayLike",(function(){return P})),n.d(e,"getElementRect",(function(){return I})),n.d(e,"serialRun",(function(){return b})),n.d(e,"hasOwnProperty",(function(){return C}));var r=n(3),i=n(2);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a,o=i.a.BYTE,u=i.a.UNSIGNED_BYTE,c=i.a.SHORT,h=i.a.UNSIGNED_SHORT,l=i.a.UNSIGNED_INT,f=i.a.FLOAT;function m(t,e){if(/^(?:http|blob|data:|\/)/.test(e))return e;var n;for(t=t.replace(/\/[^/]*?$/,"").split("/"),e=e.split("/"),n=0;n>1,a=n(t[s],e);if(0===a)return[s,s];a<0?r=s+1:i=s-1}return r>i?[i,r]:[r,i]}function v(t,e,n){var r=_(t,e,n);t.splice(r[1],0,e)}function p(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?f:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?h:t instanceof Uint32Array?l:f}var R,A,S=(s(R={},o,Int8Array),s(R,u,Uint8Array),s(R,c,Int16Array),s(R,h,Uint16Array),s(R,l,Uint32Array),s(R,f,Float32Array),A=R,function(t){return A[t]||Float32Array});function g(t,e,n,r,i){if(t&&e){e.isGeometryData&&(e=e.data);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,r){return t.then((function(){return e(n,r)}))}),Promise.resolve())}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec3.round(this.elements,this.elements),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,i,s){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,s),this},bezier:function(t,e,n,i,s){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,s),this},random:function(t){return r.vec3.random(this.elements,t),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],s=e[2];return e[0]=r*n[0]+i*n[4]+s*n[8],e[1]=r*n[1]+i*n[5]+s*n[9],e[2]=r*n[2]+i*n[6]+s*n[10],this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r,i={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(r=0,function(t){var e=++r;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=i},function(t,e,n){"use strict";var r,i=n(0),s=n(1),a=n(5),o=n(10),u=new a.a,c=new a.a,h=s.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=i.mat4.create()},copy:function(t){return i.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this},set:function(t,e,n,r,s,a,o,u,c,h,l,f,m,E,d,M){return i.mat4.set(this.elements,t,e,n,r,s,a,o,u,c,h,l,f,m,E,d,M),this},identity:function(){return i.mat4.identity(this.elements),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,r){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,r,s,a){return i.mat4.frustum(this.elements,t,e,n,r,s,a),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,r,s,a){return i.mat4.ortho(this.elements,t,e,n,r,s,a),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],s=t[1],a=t[2],o=n[0],h=n[1],l=n[2],f=i-e[0],m=s-e[1],E=a-e[2],d=f*f+m*m+E*E;d>0?(f*=d=1/Math.sqrt(d),m*=d,E*=d):E=1;var M=h*E-l*m,_=l*f-o*E,v=o*m-h*f;return(d=M*M+_*_+v*v)>0?(M*=d=1/Math.sqrt(d),_*=d,v*=d):(d=(M=h*E-l*m)*M+(_=l*f-(o+=1e-7)*E)*_+(v=o*m-h*f)*v,M*=d=1/Math.sqrt(d),_*=d,v*=d),r[0]=M,r[1]=_,r[2]=v,r[3]=0,r[4]=m*v-E*_,r[5]=E*M-f*v,r[6]=f*_-m*M,r[7]=0,r[8]=f,r[9]=m,r[10]=E,r[11]=0,r[12]=i,r[13]=s,r[14]=a,r[15]=1,this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new h),this.determinant()<0&&(n.x*=-1),r.copy(this),u.inverse(n),r.scale(u),t.fromMat4(r),i&&i.set(0,0,0),this}});h.prototype.sub=h.prototype.subtract,h.prototype.mul=h.prototype.multiply,e.a=h},function(t,e,n){"use strict";var r=n(1),i=n(12),s=n(4),a=r.a.create({Extends:i.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;a.superclass.constructor.call(this,t,e,n,r)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(s.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(s.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=a},function(t,e,n){"use strict";var r=n(37),i=n.n(r);e.a=i.a},function(t,e,n){"use strict";var r=n(0),i=n(11),s=n(1),a=n(9),o=new i.a,u=s.a.create({Mixes:a.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,e,n,i)},copy:function(t,e){return r.quat.copy(this.elements,t.elements),e||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=this.elements;return r[0]=t[e],r[1]=t[e+1],r[2]=t[e+2],r[3]=t[e+3],n||this.fire("update"),this},set:function(t,e,n,i,s){return r.quat.set(this.elements,t,e,n,i),s||this.fire("update"),this},identity:function(t){return r.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,e,n){return r.quat.rotationTo(this.elements,t.elements,e.elements),n||this.fire("update"),this},setAxes:function(t,e,n,i){return r.quat.setAxes(this.elements,t.elements,e.elements,n.elements),i||this.fire("update"),this},setAxisAngle:function(t,e,n){return r.quat.setAxisAngle(this.elements,t.elements,e),n||this.fire("update"),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t,e){return r.quat.add(this.elements,this.elements,t.elements),e||this.fire("update"),this},multiply:function(t,e){return r.quat.multiply(this.elements,this.elements,t.elements),e||this.fire("update"),this},premultiply:function(t,e){return r.quat.multiply(this.elements,t.elements,this.elements),e||this.fire("update"),this},scale:function(t,e){return r.quat.scale(this.elements,this.elements,t),e||this.fire("update"),this},rotateX:function(t,e){return r.quat.rotateX(this.elements,this.elements,t),e||this.fire("update"),this},rotateY:function(t,e){return r.quat.rotateY(this.elements,this.elements,t),e||this.fire("update"),this},rotateZ:function(t,e){return r.quat.rotateZ(this.elements,this.elements,t),e||this.fire("update"),this},calculateW:function(t){return r.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,e,n){return r.quat.lerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},slerp:function(t,e,n){return r.quat.slerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},sqlerp:function(t,e,n,i,s,a){return r.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,i.elements,s),a||this.fire("update"),this},invert:function(t){return r.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return r.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(t){return r.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,e){return r.quat.fromMat3(this.elements,t.elements),e||this.fire("update"),this},fromMat4:function(t,e){return o.fromMat4(t),this.fromMat3(o,e),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,r=.5*t.y,i=.5*t.z,s=t.order||"ZYX",a=Math.sin(n),o=Math.cos(n),u=Math.sin(r),c=Math.cos(r),h=Math.sin(i),l=Math.cos(i),f=this.elements;return"XYZ"===s?(f[0]=a*c*l+o*u*h,f[1]=o*u*l-a*c*h,f[2]=o*c*h+a*u*l,f[3]=o*c*l-a*u*h):"YXZ"===s?(f[0]=a*c*l+o*u*h,f[1]=o*u*l-a*c*h,f[2]=o*c*h-a*u*l,f[3]=o*c*l+a*u*h):"ZXY"===s?(f[0]=a*c*l-o*u*h,f[1]=o*u*l+a*c*h,f[2]=o*c*h+a*u*l,f[3]=o*c*l-a*u*h):"ZYX"===s?(f[0]=a*c*l-o*u*h,f[1]=o*u*l+a*c*h,f[2]=o*c*h-a*u*l,f[3]=o*c*l+a*u*h):"YZX"===s?(f[0]=a*c*l+o*u*h,f[1]=o*u*l+a*c*h,f[2]=o*c*h-a*u*l,f[3]=o*c*l-a*u*h):"XZY"===s&&(f[0]=a*c*l-o*u*h,f[1]=o*u*l-a*c*h,f[2]=o*c*h+a*u*l,f[3]=o*c*l+a*u*h),e||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});u.prototype.mul=u.prototype.multiply,u.prototype.len=u.prototype.length,u.prototype.sqrLen=u.prototype.squaredLength,e.a=u},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=r.mat3.create()},copy:function(t){return r.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)n[r]=t[e+r];return this},set:function(t,e,n,i,s,a,o,u,c){return r.mat3.set(this.elements,t,e,n,i,s,a,o,u,c),this},identity:function(){return r.mat3.identity(this.elements),this},transpose:function(){return r.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return r.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return r.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return r.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return r.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return r.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return r.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return r.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return r.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return r.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,r,i){var s=Math.cos(t),a=Math.sin(t);return this.set(r*s,-i*a,0,r*a,i*s,0,e,n,1),this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,e.a=i},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=r.vec4.fromValues(t,e,n,i)},copy:function(t){return r.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,i){return r.vec4.set(this.elements,t,e,n,i),this},add:function(t,e){return e||(e=t,t=this),r.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec4.ceil(this.elements,this.elements),this},floor:function(){return r.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec4.round(this.elements,this.elements),this},scale:function(t){return r.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec4.squaredDistance(t.elements,e.elements)},length:function(){return r.vec4.length(this.elements)},squaredLength:function(){return r.vec4.squaredLength(this.elements)},negate:function(){return r.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec4.inverse(this.elements,t.elements),this},normalize:function(){return r.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return r.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return r.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return r.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r=n(1),i=n(6),s=n(7),a=n(3),o=new s.a,u=i.a.DEG2RAD,c=i.a.RAD2DEG,h=r.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,r=n[0],s=n[1],o=n[2],u=n[4],c=n[5],h=n[6],l=n[8],f=n[9],m=n[10];e=e||this.order,this.order=e;var E=i.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(E(l,-1,1)),Math.abs(l)<.99999?(this.elements[0]=Math.atan2(-f,m),this.elements[2]=Math.atan2(-u,r)):(this.elements[0]=Math.atan2(h,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-E(f,-1,1)),Math.abs(f)<.99999?(this.elements[1]=Math.atan2(l,m),this.elements[2]=Math.atan2(s,c)):(this.elements[1]=Math.atan2(-o,r),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(E(h,-1,1)),Math.abs(h)<.99999?(this.elements[1]=Math.atan2(-o,m),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(s,r))):"ZYX"===e?(this.elements[1]=Math.asin(-E(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(h,m),this.elements[2]=Math.atan2(s,r)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(E(s,-1,1)),Math.abs(s)<.99999?(this.elements[0]=Math.atan2(-f,c),this.elements[1]=Math.atan2(-o,r)):(this.elements[0]=0,this.elements[1]=Math.atan2(l,m))):"XZY"===e?(this.elements[2]=Math.asin(-E(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(h,c),this.elements[1]=Math.atan2(l,r)):(this.elements[0]=Math.atan2(-f,m),this.elements[1]=0)):a.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=h},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=r.vec2.fromValues(t,e)},copy:function(t){return r.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return r.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),r.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec2.ceil(this.elements,this.elements),this},floor:function(){return r.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec2.round(this.elements,this.elements),this},scale:function(t){return r.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec2.squaredDistance(t.elements,e.elements)},length:function(){return r.vec2.length(this.elements)},squaredLength:function(){return r.vec2.squaredLength(this.elements)},negate:function(){return r.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec2.inverse(this.elements,t.elements),this},normalize:function(){return r.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return r.vec2.random(this.elements,t),this},transformMat3:function(t){return r.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},,function(t,e,n){"use strict";var r=n(38),i=n.n(r),s=n(1),a=n(5),o=s.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new i.a,this.origin=t.origin||new a.a(0,0,0),this.direction=t.direction||new a.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,r,i){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,r,i)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,r,i)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,r){return n.squaredDistance(t[e])-n.squaredDistance(r[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new a.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var r=n(0),i=n(1),s=n(9),a=n(5),o=i.a.create({Mixes:s.a,Extends:a.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.fire("update"),this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this.fire("update"),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this.fire("update"),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this.fire("update"),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this.fire("update"),this},round:function(){return r.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.fire("update"),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this.fire("update"),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this.fire("update"),this},hermite:function(t,e,n,i,s){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,s),this.fire("update"),this},bezier:function(t,e,n,i,s){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,s),this.fire("update"),this},random:function(t){return r.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],s=e[2];return e[0]=r*n[0]+i*n[4]+s*n[8],e[1]=r*n[1]+i*n[5]+s*n[9],e[2]=r*n[2]+i*n[6]+s*n[10],this.fire("update"),this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});e.a=o},,function(t,e){var n=function(){var t,e,n=function(t){var e,n,i={};for(e in t)n=t[e],r.hasOwnProperty(e)?r[e].call(this,n):i[e]=n;s(this.prototype,i)},r={Extends:function(t){var e=this.prototype,n=i(t.prototype);s(this,t),s(n,e),n.constructor=this,this.prototype=n,this.superclass=t.prototype},Mixes:function(t){t instanceof Array||(t=[t]);for(var e,n=this.prototype;e=t.shift();)s(n,e.prototype||e)},Statics:function(t){s(this,t)}},i=function(){if(Object.__proto__)return function(t){return{__proto__:t}};var t=function(){};return function(e){return t.prototype=e,new t}}(),s=function(t){for(var n=1,r=arguments.length;n0&&void 0!==arguments[0]?arguments[0]:new i.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,r){return this.normal.set(t,e,n),this.distance=r,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new i.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=s},function(t,e,n){"use strict";var r=n(1),i=n(5),s=new i.a,a=r.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new i.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this.fire("update"),this},set:function(t,e,n,r,s,a,o,u,c,h,l,f,m,E,d,M){return i.mat4.set(this.elements,t,e,n,r,s,a,o,u,c,h,l,f,m,E,d,M),this.fire("update"),this},identity:function(){return i.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this.fire("update"),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this.fire("update"),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,e,n,r,s){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),s||this.fire("update"),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,e,n,r,s,a){return i.mat4.frustum(this.elements,t,e,n,r,s,a),this.fire("update"),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this.fire("update"),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.fire("update"),this},ortho:function(t,e,n,r,s,a){return i.mat4.ortho(this.elements,t,e,n,r,s,a),this.fire("update"),this},lookAt:function(t,e,n){return t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=l.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},targetTo:function(t,e,n){t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=l.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],s=t[1],a=t[2],o=n[0],u=n[1],c=n[2],f=i-e[0],m=s-e[1],E=a-e[2],d=f*f+m*m+E*E;d>0?(f*=d=1/Math.sqrt(d),m*=d,E*=d):E=1;var M=u*E-c*m,_=c*f-o*E,v=o*m-u*f;return(d=M*M+_*_+v*v)>0?(M*=d=1/Math.sqrt(d),_*=d,v*=d):(d=(M=u*E-c*m)*M+(_=c*f-(o+=1e-7)*E)*_+(v=o*m-u*f)*v,M*=d=1/Math.sqrt(d),_*=d,v*=d),r[0]=M,r[1]=_,r[2]=v,r[3]=0,r[4]=m*v-E*_,r[5]=E*M-f*v,r[6]=f*_-m*M,r[7]=0,r[8]=f,r[9]=m,r[10]=E,r[11]=0,r[12]=i,r[13]=s,r[14]=a,r[15]=1,this.fire("update"),this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new u.a),this.determinant()<0&&(n.x*=-1),r.copy(this),h.inverse(n),r.scale(h),t.fromMat4(r),i&&i.set(0,0,0),this}});e.a=f},function(t,e,n){"use strict";var r=n(1),i=n(9),s=n(6),a=n(13),o=s.a.DEG2RAD,u=s.a.RAD2DEG,c=r.a.create({Mixes:i.a,Extends:a.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a.a.call(this,t,e,n)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*u,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*u,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*u,this.fire("update")}}});e.a=c},function(t,e,n){"use strict";var r=n(1),i=n(20),s=r.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new i.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],s=n[2],a=n[3],o=n[4],u=n[5],c=n[6],h=n[7],l=n[8],f=n[9],m=n[10],E=n[11],d=n[12],M=n[13],_=n[14],v=n[15];return e[0].set(a-r,h-o,E-l,v-d).normalize(),e[1].set(a+r,h+o,E+l,v+d).normalize(),e[2].set(a+i,h+u,E+f,v+M).normalize(),e[3].set(a-i,h-u,E-f,v-M).normalize(),e[4].set(a-s,h-c,E-m,v-_).normalize(),e[5].set(a+s,h+c,E+m,v+_).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)-1&&a.splice(h,1)}}return 0==a.length&&delete s[r],!0}return!1}},i=n(19).create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),s=window.Event;if(s){var a=s.prototype,o=a.stopImmediatePropagation;a.stopImmediatePropagation=function(){o&&o.call(this),this._stopped=!0}}t.exports=r},function(t,e,n){var r=n(94),i=n(96),s=n(97),a=n(100),o=n(34),u=[[0,0,0],[0,0,0],[0,0,0]],c=[0,0,0];function h(t,e){this.origin=t||[0,0,0],this.direction=e||[0,0,-1]}t.exports=h,h.prototype.set=function(t,e){this.origin=t,this.direction=e},h.prototype.copy=function(t){o(this.origin,t.origin),o(this.direction,t.direction)},h.prototype.clone=function(){var t=new h;return t.copy(this),t},h.prototype.intersectsSphere=function(t,e){return s(c,this.origin,this.direction,t,e)},h.prototype.intersectsPlane=function(t,e){return i(c,this.origin,this.direction,t,e)},h.prototype.intersectsTriangle=function(t){return r(c,this.origin,this.direction,t)},h.prototype.intersectsBox=function(t){return a(c,this.origin,this.direction,t)},h.prototype.intersectsTriangleCell=function(t,e){var n=t[0],r=t[1],i=t[2];return u[0]=e[n],u[1]=e[r],u[2]=e[i],this.intersectsTriangle(u)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){var r=n(95),i=n(27),s=n(31),a=[0,0,0],o=[0,0,0],u=[0,0,0],c=[0,0,0],h=[0,0,0];t.exports=function(t,e,n,l){s(a,l[1],l[0]),s(o,l[2],l[0]),r(c,n,o);var f=i(a,c);if(f<1e-6)return null;s(u,e,l[0]);var m=i(u,c);if(m<0||m>f)return null;r(h,u,a);var E=i(n,h);if(E<0||m+E>f)return null;var d=i(o,h)/f;return t[0]=e[0]+d*n[0],t[1]=e[1]+d*n[1],t[2]=e[2]+d*n[2],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=n[0],o=n[1],u=n[2];return t[0]=i*u-s*o,t[1]=s*a-r*u,t[2]=r*o-i*a,t}},function(t,e,n){var r=n(27),i=n(32),s=n(33),a=n(34);t.exports=function(t,e,n,u,c){var h=r(n,u);if(0!==h){var l=-(r(e,u)+c)/h;return l<0?null:(s(o,n,l),i(t,e,o))}return r(u,e)+c===0?a(t,e):null};var o=[0,0,0]},function(t,e,n){var r=n(98),i=n(27),s=n(31),a=n(99),o=n(33),u=n(32),c=[0,0,0];t.exports=function(t,e,n,h,l){s(c,h,e);var f=i(n,c);if(f<0)return null;a(c,e,n,f);var m=r(h,c),E=l*l;if(m>E)return null;return o(t,n,f-Math.sqrt(E-m)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}},function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}},function(t,e){function n(t,e,n){for(var r=t.length,i=-1/0,s=1/0,a=0;au){var c=o;o=u,u=c}if(us)return 1/0;o>i&&(i=o),us?1/0:i}t.exports=function(t,e,r,i){var s=n(e,r,i);if(s===1/0)t=null;else{t=t||[];for(var a=0;a0&&(a=1/Math.sqrt(a),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=s*a),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},e.lerp=function(t,e,n,r){var i=e[0],s=e[1],a=e[2],o=e[3];return t[0]=i+r*(n[0]-i),t[1]=s+r*(n[1]-s),t[2]=a+r*(n[2]-a),t[3]=o+r*(n[3]-o),t},e.random=function(t,e){var n,i,s,a,o,u;e=e||1;do{o=(n=2*r.RANDOM()-1)*n+(i=2*r.RANDOM()-1)*i}while(o>=1);do{u=(s=2*r.RANDOM()-1)*s+(a=2*r.RANDOM()-1)*a}while(u>=1);var c=Math.sqrt((1-o)/u);return t[0]=e*n,t[1]=e*i,t[2]=e*s*c,t[3]=e*a*c,t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*s+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*s+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*s+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*s+n[15]*a,t},e.transformQuat=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=n[0],o=n[1],u=n[2],c=n[3],h=c*r+o*s-u*i,l=c*i+u*r-a*s,f=c*s+a*i-o*r,m=-a*r-o*i-u*s;return t[0]=h*c+m*-a+l*-u-f*-o,t[1]=l*c+m*-o+f*-a-h*-u,t[2]=f*c+m*-u+h*-o-l*-a,t[3]=e[3],t},e.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-c)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+s*s)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],s=e[3]-t[3];return n*n+r*r+i*i+s*s}function h(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)}function l(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.len=h,e.sqrLen=l,e.forEach=function(){var t=i();return function(e,n,r,i,s,a){var o,u=void 0;for(n||(n=4),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=e[0],o=e[1],u=e[2];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-o)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(s-u)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(u))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function s(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function a(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function u(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function c(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function l(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function f(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function m(t,e){var n=e[0],r=e[1],i=e[2],s=n*n+r*r+i*i;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function E(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=o,e.mul=u,e.div=c,e.dist=h,e.sqrDist=l,e.len=s,e.sqrLen=f,e.forEach=function(){var t=i();return function(e,n,r,i,s,a){var o,u=void 0;for(n||(n=3),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;ur.EPSILON?(t[0]=e[0]/i,t[1]=e[1]/i,t[2]=e[2]/i):(t[0]=1,t[1]=0,t[2]=0),n},e.multiply=h,e.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*o,t[1]=i*u+s*o,t[2]=s*u-i*o,t[3]=a*u-r*o,t},e.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u-s*o,t[1]=i*u+a*o,t[2]=s*u+r*o,t[3]=a*u-i*o,t},e.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*o,t[1]=i*u-r*o,t[2]=s*u+a*o,t[3]=a*u-s*o,t},e.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},e.slerp=l,e.random=function(t){var e=r.RANDOM(),n=r.RANDOM(),i=r.RANDOM(),s=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=s*Math.sin(2*Math.PI*n),t[1]=s*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*i),t[3]=a*Math.cos(2*Math.PI*i),t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=n*n+r*r+i*i+s*s,o=a?1/a:0;return t[0]=-n*o,t[1]=-r*o,t[2]=-i*o,t[3]=s*o,t},e.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},e.fromMat3=f,e.fromEuler=function(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var s=Math.sin(e),a=Math.cos(e),o=Math.sin(n),u=Math.cos(n),c=Math.sin(r),h=Math.cos(r);return t[0]=s*u*h-a*o*c,t[1]=a*o*h+s*u*c,t[2]=a*u*c-s*o*h,t[3]=a*u*h+s*o*c,t},e.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"};var r=o(n(0)),i=o(n(5)),s=o(n(2)),a=o(n(1));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function u(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function c(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function h(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=r*h+a*o+i*c-s*u,t[1]=i*h+a*u+s*o-r*c,t[2]=s*h+a*c+r*u-i*o,t[3]=a*h-r*o-i*u-s*c,t}function l(t,e,n,i){var s=e[0],a=e[1],o=e[2],u=e[3],c=n[0],h=n[1],l=n[2],f=n[3],m=void 0,E=void 0,d=void 0,M=void 0,_=void 0;return(E=s*c+a*h+o*l+u*f)<0&&(E=-E,c=-c,h=-h,l=-l,f=-f),1-E>r.EPSILON?(m=Math.acos(E),d=Math.sin(m),M=Math.sin((1-i)*m)/d,_=Math.sin(i*m)/d):(M=1-i,_=i),t[0]=M*s+_*c,t[1]=M*a+_*h,t[2]=M*o+_*l,t[3]=M*u+_*f,t}function f(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var s=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*s+s]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*s+a]-e[3*a+s])*r,t[s]=(e[3*s+i]+e[3*i+s])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}e.clone=a.clone,e.fromValues=a.fromValues,e.copy=a.copy,e.set=a.set,e.add=a.add,e.mul=h,e.scale=a.scale,e.dot=a.dot,e.lerp=a.lerp;var m=e.length=a.length,E=(e.len=m,e.squaredLength=a.squaredLength),d=(e.sqrLen=E,e.normalize=a.normalize);e.exactEquals=a.exactEquals,e.equals=a.equals,e.rotationTo=function(){var t=s.create(),e=s.fromValues(1,0,0),n=s.fromValues(0,1,0);return function(r,i,a){var o=s.dot(i,a);return o<-.999999?(s.cross(t,e,i),s.len(t)<1e-6&&s.cross(t,n,i),s.normalize(t,t),c(r,t,Math.PI),r):o>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(s.cross(t,i,a),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+o,d(r,r))}}(),e.sqlerp=function(){var t=u(),e=u();return function(n,r,i,s,a,o){return l(t,r,a,o),l(e,i,s,o),l(n,t,e,2*o*(1-o)),n}}(),e.setAxes=function(){var t=i.create();return function(e,n,r,i){return t[0]=r[0],t[3]=r[1],t[6]=r[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-n[0],t[5]=-n[1],t[8]=-n[2],d(e,f(e,t))}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(16);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.fromValues=function(t,e,n,i,s,a,o,u,c,h,l,f,m,E,d,M){var _=new r.ARRAY_TYPE(16);return _[0]=t,_[1]=e,_[2]=n,_[3]=i,_[4]=s,_[5]=a,_[6]=o,_[7]=u,_[8]=c,_[9]=h,_[10]=l,_[11]=f,_[12]=m,_[13]=E,_[14]=d,_[15]=M,_},e.set=function(t,e,n,r,i,s,a,o,u,c,h,l,f,m,E,d,M){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t[9]=h,t[10]=l,t[11]=f,t[12]=m,t[13]=E,t[14]=d,t[15]=M,t},e.identity=i,e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],s=e[6],a=e[7],o=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=s,t[11]=e[14],t[12]=i,t[13]=a,t[14]=o}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],m=e[11],E=e[12],d=e[13],M=e[14],_=e[15],v=n*o-r*a,p=n*u-i*a,T=n*c-s*a,R=r*u-i*o,A=r*c-s*o,S=i*c-s*u,g=h*d-l*E,N=h*M-f*E,y=h*_-m*E,O=l*M-f*d,L=l*_-m*d,P=f*_-m*M,I=v*P-p*L+T*O+R*y-A*N+S*g;return I?(I=1/I,t[0]=(o*P-u*L+c*O)*I,t[1]=(i*L-r*P-s*O)*I,t[2]=(d*S-M*A+_*R)*I,t[3]=(f*A-l*S-m*R)*I,t[4]=(u*y-a*P-c*N)*I,t[5]=(n*P-i*y+s*N)*I,t[6]=(M*T-E*S-_*p)*I,t[7]=(h*S-f*T+m*p)*I,t[8]=(a*L-o*y+c*g)*I,t[9]=(r*y-n*L-s*g)*I,t[10]=(E*A-d*T+_*v)*I,t[11]=(l*T-h*A-m*v)*I,t[12]=(o*N-a*O-u*g)*I,t[13]=(n*O-r*N+i*g)*I,t[14]=(d*p-E*R-M*v)*I,t[15]=(h*R-l*p+f*v)*I,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],m=e[11],E=e[12],d=e[13],M=e[14],_=e[15];return t[0]=o*(f*_-m*M)-l*(u*_-c*M)+d*(u*m-c*f),t[1]=-(r*(f*_-m*M)-l*(i*_-s*M)+d*(i*m-s*f)),t[2]=r*(u*_-c*M)-o*(i*_-s*M)+d*(i*c-s*u),t[3]=-(r*(u*m-c*f)-o*(i*m-s*f)+l*(i*c-s*u)),t[4]=-(a*(f*_-m*M)-h*(u*_-c*M)+E*(u*m-c*f)),t[5]=n*(f*_-m*M)-h*(i*_-s*M)+E*(i*m-s*f),t[6]=-(n*(u*_-c*M)-a*(i*_-s*M)+E*(i*c-s*u)),t[7]=n*(u*m-c*f)-a*(i*m-s*f)+h*(i*c-s*u),t[8]=a*(l*_-m*d)-h*(o*_-c*d)+E*(o*m-c*l),t[9]=-(n*(l*_-m*d)-h*(r*_-s*d)+E*(r*m-s*l)),t[10]=n*(o*_-c*d)-a*(r*_-s*d)+E*(r*c-s*o),t[11]=-(n*(o*m-c*l)-a*(r*m-s*l)+h*(r*c-s*o)),t[12]=-(a*(l*M-f*d)-h*(o*M-u*d)+E*(o*f-u*l)),t[13]=n*(l*M-f*d)-h*(r*M-i*d)+E*(r*f-i*l),t[14]=-(n*(o*M-u*d)-a*(r*M-i*d)+E*(r*u-i*o)),t[15]=n*(o*f-u*l)-a*(r*f-i*l)+h*(r*u-i*o),t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8],h=t[9],l=t[10],f=t[11],m=t[12],E=t[13],d=t[14],M=t[15];return(e*a-n*s)*(l*M-f*d)-(e*o-r*s)*(h*M-f*E)+(e*u-i*s)*(h*d-l*E)+(n*o-r*a)*(c*M-f*m)-(n*u-i*a)*(c*d-l*m)+(r*u-i*o)*(c*E-h*m)},e.multiply=s,e.translate=function(t,e,n){var r=n[0],i=n[1],s=n[2],a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,l=void 0,f=void 0,m=void 0,E=void 0,d=void 0,M=void 0,_=void 0;return e===t?(t[12]=e[0]*r+e[4]*i+e[8]*s+e[12],t[13]=e[1]*r+e[5]*i+e[9]*s+e[13],t[14]=e[2]*r+e[6]*i+e[10]*s+e[14],t[15]=e[3]*r+e[7]*i+e[11]*s+e[15]):(a=e[0],o=e[1],u=e[2],c=e[3],h=e[4],l=e[5],f=e[6],m=e[7],E=e[8],d=e[9],M=e[10],_=e[11],t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=h,t[5]=l,t[6]=f,t[7]=m,t[8]=E,t[9]=d,t[10]=M,t[11]=_,t[12]=a*r+h*i+E*s+e[12],t[13]=o*r+l*i+d*s+e[13],t[14]=u*r+f*i+M*s+e[14],t[15]=c*r+m*i+_*s+e[15]),t},e.scale=function(t,e,n){var r=n[0],i=n[1],s=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.rotate=function(t,e,n,i){var s,a,o,u,c,h,l,f,m,E,d,M,_,v,p,T,R,A,S,g,N,y,O,L,P=i[0],I=i[1],b=i[2],C=Math.sqrt(P*P+I*I+b*b);return C0?(n[0]=2*(c*u+f*i+h*o-l*s)/m,n[1]=2*(h*u+f*s+l*i-c*o)/m,n[2]=2*(l*u+f*o+c*s-h*i)/m):(n[0]=2*(c*u+f*i+h*o-l*s),n[1]=2*(h*u+f*s+l*i-c*o),n[2]=2*(l*u+f*o+c*s-h*i)),a(t,e,n),t},e.getTranslation=function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},e.getScaling=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[4],a=e[5],o=e[6],u=e[8],c=e[9],h=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(s*s+a*a+o*o),t[2]=Math.sqrt(u*u+c*c+h*h),t},e.getRotation=function(t,e){var n=e[0]+e[5]+e[10],r=0;return n>0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},e.fromRotationTranslationScale=function(t,e,n,r){var i=e[0],s=e[1],a=e[2],o=e[3],u=i+i,c=s+s,h=a+a,l=i*u,f=i*c,m=i*h,E=s*c,d=s*h,M=a*h,_=o*u,v=o*c,p=o*h,T=r[0],R=r[1],A=r[2];return t[0]=(1-(E+M))*T,t[1]=(f+p)*T,t[2]=(m-v)*T,t[3]=0,t[4]=(f-p)*R,t[5]=(1-(l+M))*R,t[6]=(d+_)*R,t[7]=0,t[8]=(m+v)*A,t[9]=(d-_)*A,t[10]=(1-(l+E))*A,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},e.fromRotationTranslationScaleOrigin=function(t,e,n,r,i){var s=e[0],a=e[1],o=e[2],u=e[3],c=s+s,h=a+a,l=o+o,f=s*c,m=s*h,E=s*l,d=a*h,M=a*l,_=o*l,v=u*c,p=u*h,T=u*l,R=r[0],A=r[1],S=r[2],g=i[0],N=i[1],y=i[2],O=(1-(d+_))*R,L=(m+T)*R,P=(E-p)*R,I=(m-T)*A,b=(1-(f+_))*A,C=(M+v)*A,D=(E+p)*S,U=(M-v)*S,B=(1-(f+d))*S;return t[0]=O,t[1]=L,t[2]=P,t[3]=0,t[4]=I,t[5]=b,t[6]=C,t[7]=0,t[8]=D,t[9]=U,t[10]=B,t[11]=0,t[12]=n[0]+g-(O*g+I*N+D*y),t[13]=n[1]+N-(L*g+b*N+U*y),t[14]=n[2]+y-(P*g+C*N+B*y),t[15]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=n+n,o=r+r,u=i+i,c=n*a,h=r*a,l=r*o,f=i*a,m=i*o,E=i*u,d=s*a,M=s*o,_=s*u;return t[0]=1-l-E,t[1]=h+_,t[2]=f-M,t[3]=0,t[4]=h-_,t[5]=1-c-E,t[6]=m+d,t[7]=0,t[8]=f+M,t[9]=m-d,t[10]=1-c-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,n,r,i,s,a){var o=1/(n-e),u=1/(i-r),c=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*u,t[6]=0,t[7]=0,t[8]=(n+e)*o,t[9]=(i+r)*u,t[10]=(a+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*c,t[15]=0,t},e.perspective=function(t,e,n,r,i){var s=1/Math.tan(e/2),a=void 0;return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(r-i),t[10]=(i+r)*a,t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t},e.perspectiveFromFieldOfView=function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),o=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+o),c=2/(i+s);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-o)*u*.5,t[9]=(i-s)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},e.ortho=function(t,e,n,r,i,s,a){var o=1/(e-n),u=1/(r-i),c=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*o,t[13]=(i+r)*u,t[14]=(a+s)*c,t[15]=1,t},e.lookAt=function(t,e,n,s){var a=void 0,o=void 0,u=void 0,c=void 0,h=void 0,l=void 0,f=void 0,m=void 0,E=void 0,d=void 0,M=e[0],_=e[1],v=e[2],p=s[0],T=s[1],R=s[2],A=n[0],S=n[1],g=n[2];return Math.abs(M-A)0&&(h*=m=1/Math.sqrt(m),l*=m,f*=m);var E=u*f-c*l,d=c*h-o*f,M=o*l-u*h;return(m=E*E+d*d+M*M)>0&&(E*=m=1/Math.sqrt(m),d*=m,M*=m),t[0]=E,t[1]=d,t[2]=M,t[3]=0,t[4]=l*M-f*d,t[5]=f*E-h*M,t[6]=h*d-l*E,t[7]=0,t[8]=h,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=s,t[14]=a,t[15]=1,t},e.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},e.subtract=o,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],l=t[8],f=t[9],m=t[10],E=t[11],d=t[12],M=t[13],_=t[14],v=t[15],p=e[0],T=e[1],R=e[2],A=e[3],S=e[4],g=e[5],N=e[6],y=e[7],O=e[8],L=e[9],P=e[10],I=e[11],b=e[12],C=e[13],D=e[14],U=e[15];return Math.abs(n-p)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(i-T)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(s-R)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(R))&&Math.abs(a-A)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(o-S)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(u-g)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-N)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(N))&&Math.abs(h-y)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(l-O)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(f-L)<=r.EPSILON*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(m-P)<=r.EPSILON*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(E-I)<=r.EPSILON*Math.max(1,Math.abs(E),Math.abs(I))&&Math.abs(d-b)<=r.EPSILON*Math.max(1,Math.abs(d),Math.abs(b))&&Math.abs(M-C)<=r.EPSILON*Math.max(1,Math.abs(M),Math.abs(C))&&Math.abs(_-D)<=r.EPSILON*Math.max(1,Math.abs(_),Math.abs(D))&&Math.abs(v-U)<=r.EPSILON*Math.max(1,Math.abs(v),Math.abs(U))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function s(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=e[9],m=e[10],E=e[11],d=e[12],M=e[13],_=e[14],v=e[15],p=n[0],T=n[1],R=n[2],A=n[3];return t[0]=p*r+T*o+R*l+A*d,t[1]=p*i+T*u+R*f+A*M,t[2]=p*s+T*c+R*m+A*_,t[3]=p*a+T*h+R*E+A*v,p=n[4],T=n[5],R=n[6],A=n[7],t[4]=p*r+T*o+R*l+A*d,t[5]=p*i+T*u+R*f+A*M,t[6]=p*s+T*c+R*m+A*_,t[7]=p*a+T*h+R*E+A*v,p=n[8],T=n[9],R=n[10],A=n[11],t[8]=p*r+T*o+R*l+A*d,t[9]=p*i+T*u+R*f+A*M,t[10]=p*s+T*c+R*m+A*_,t[11]=p*a+T*h+R*E+A*v,p=n[12],T=n[13],R=n[14],A=n[15],t[12]=p*r+T*o+R*l+A*d,t[13]=p*i+T*u+R*f+A*M,t[14]=p*s+T*c+R*m+A*_,t[15]=p*a+T*h+R*E+A*v,t}function a(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=r+r,u=i+i,c=s+s,h=r*o,l=r*u,f=r*c,m=i*u,E=i*c,d=s*c,M=a*o,_=a*u,v=a*c;return t[0]=1-(m+d),t[1]=l+v,t[2]=f-_,t[3]=0,t[4]=l-v,t[5]=1-(h+d),t[6]=E+M,t[7]=0,t[8]=f+_,t[9]=E-M,t[10]=1-(h+m),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}e.mul=s,e.sub=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(9);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.clone=function(t){var e=new r.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromValues=function(t,e,n,i,s,a,o,u,c){var h=new r.ARRAY_TYPE(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=i,h[4]=s,h[5]=a,h[6]=o,h[7]=u,h[8]=c,h},e.set=function(t,e,n,r,i,s,a,o,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=a,t[6]=o,t[7]=u,t[8]=c,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.transpose=function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],l=h*a-o*c,f=-h*s+o*u,m=c*s-a*u,E=n*l+r*f+i*m;return E?(E=1/E,t[0]=l*E,t[1]=(-h*r+i*c)*E,t[2]=(o*r-i*a)*E,t[3]=f*E,t[4]=(h*n-i*u)*E,t[5]=(-o*n+i*s)*E,t[6]=m*E,t[7]=(-c*n+r*u)*E,t[8]=(a*n-r*s)*E,t):null},e.adjoint=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-o*c,t[1]=i*c-r*h,t[2]=r*o-i*a,t[3]=o*u-s*h,t[4]=n*h-i*u,t[5]=i*s-n*o,t[6]=s*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*s,t},e.determinant=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],s=t[4],a=t[5],o=t[6],u=t[7],c=t[8];return e*(c*s-a*u)+n*(-c*i+a*o)+r*(u*i-s*o)},e.multiply=i,e.translate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],m=n[1];return t[0]=r,t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=u,t[6]=f*r+m*a+c,t[7]=f*i+m*o+h,t[8]=f*s+m*u+l,t},e.rotate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=Math.sin(n),m=Math.cos(n);return t[0]=m*r+f*a,t[1]=m*i+f*o,t[2]=m*s+f*u,t[3]=m*a-f*r,t[4]=m*o-f*i,t[5]=m*u-f*s,t[6]=c,t[7]=h,t[8]=l,t},e.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},e.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=n+n,o=r+r,u=i+i,c=n*a,h=r*a,l=r*o,f=i*a,m=i*o,E=i*u,d=s*a,M=s*o,_=s*u;return t[0]=1-l-E,t[3]=h-_,t[6]=f+M,t[1]=h+_,t[4]=1-c-E,t[7]=m-d,t[2]=f-M,t[5]=m+d,t[8]=1-c-l,t},e.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],m=e[11],E=e[12],d=e[13],M=e[14],_=e[15],v=n*o-r*a,p=n*u-i*a,T=n*c-s*a,R=r*u-i*o,A=r*c-s*o,S=i*c-s*u,g=h*d-l*E,N=h*M-f*E,y=h*_-m*E,O=l*M-f*d,L=l*_-m*d,P=f*_-m*M,I=v*P-p*L+T*O+R*y-A*N+S*g;return I?(I=1/I,t[0]=(o*P-u*L+c*O)*I,t[1]=(u*y-a*P-c*N)*I,t[2]=(a*L-o*y+c*g)*I,t[3]=(i*L-r*P-s*O)*I,t[4]=(n*P-i*y+s*N)*I,t[5]=(r*y-n*L-s*g)*I,t[6]=(d*S-M*A+_*R)*I,t[7]=(M*T-E*S-_*p)*I,t[8]=(E*A-d*T+_*v)*I,t):null},e.projection=function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},e.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],l=t[8],f=e[0],m=e[1],E=e[2],d=e[3],M=e[4],_=e[5],v=e[6],p=e[7],T=e[8];return Math.abs(n-f)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(i-m)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(m))&&Math.abs(s-E)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(a-d)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(d))&&Math.abs(o-M)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(u-_)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(c-v)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(v))&&Math.abs(h-p)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(p))&&Math.abs(l-T)<=r.EPSILON*Math.max(1,Math.abs(l),Math.abs(T))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],m=n[1],E=n[2],d=n[3],M=n[4],_=n[5],v=n[6],p=n[7],T=n[8];return t[0]=f*r+m*a+E*c,t[1]=f*i+m*o+E*h,t[2]=f*s+m*u+E*l,t[3]=d*r+M*a+_*c,t[4]=d*i+M*o+_*h,t[5]=d*s+M*u+_*l,t[6]=v*r+p*a+T*c,t[7]=v*i+p*o+T*h,t[8]=v*s+p*u+T*l,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}e.mul=i,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forEach=e.sqrLen=e.sqrDist=e.dist=e.div=e.mul=e.sub=e.len=void 0,e.create=i,e.clone=function(t){var e=new r.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},e.fromValues=function(t,e){var n=new r.ARRAY_TYPE(2);return n[0]=t,n[1]=e,n},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.subtract=s,e.multiply=a,e.divide=o,e.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},e.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},e.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},e.distance=u,e.squaredDistance=c,e.length=h,e.squaredLength=l,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},e.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],s=e[1];return t[0]=i+r*(n[0]-i),t[1]=s+r*(n[1]-s),t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.rotate=function(t,e,n,r){var i=e[0]-n[0],s=e[1]-n[1],a=Math.sin(r),o=Math.cos(r);return t[0]=i*o-s*a+n[0],t[1]=i*a+s*o+n[1],t},e.angle=function(t,e){var n=t[0],r=t[1],i=e[0],s=e[1],a=n*n+r*r;a>0&&(a=1/Math.sqrt(a));var o=i*i+s*s;o>0&&(o=1/Math.sqrt(o));var u=(n*i+r*s)*a*o;return u>1?0:u<-1?Math.PI:Math.acos(u)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],i=t[1],s=e[0],a=e[1];return Math.abs(n-s)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function o(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function h(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function l(t){var e=t[0],n=t[1];return e*e+n*n}e.len=h,e.sub=s,e.mul=a,e.div=o,e.dist=u,e.sqrDist=c,e.sqrLen=l,e.forEach=function(){var t=i();return function(e,n,r,i,s,a){var o,u=void 0;for(n||(n=2),r||(r=0),o=i?Math.min(i*n+r,e.length):e.length,u=r;u0){n=Math.sqrt(n);var r=e[0]/n,i=e[1]/n,s=e[2]/n,a=e[3]/n,o=e[4],u=e[5],c=e[6],h=e[7],l=r*o+i*u+s*c+a*h;t[0]=r,t[1]=i,t[2]=s,t[3]=a,t[4]=(o-r*l)/n,t[5]=(u-i*l)/n,t[6]=(c-s*l)/n,t[7]=(h-a*l)/n}return t},e.str=function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=t[6],h=t[7],l=e[0],f=e[1],m=e[2],E=e[3],d=e[4],M=e[5],_=e[6],v=e[7];return Math.abs(n-l)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-m)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-E)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(o-d)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(u-M)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(c-_)<=r.EPSILON*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(h-v)<=r.EPSILON*Math.max(1,Math.abs(h),Math.abs(v))};var r=a(n(0)),i=a(n(3)),s=a(n(4));function a(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function o(t,e,n){var r=.5*n[0],i=.5*n[1],s=.5*n[2],a=e[0],o=e[1],u=e[2],c=e[3];return t[0]=a,t[1]=o,t[2]=u,t[3]=c,t[4]=r*c+i*u-s*o,t[5]=i*c+s*a-r*u,t[6]=s*c+r*o-i*a,t[7]=-r*a-i*o-s*u,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function c(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=n[4],u=n[5],c=n[6],h=n[7],l=e[4],f=e[5],m=e[6],E=e[7],d=n[0],M=n[1],_=n[2],v=n[3];return t[0]=r*v+a*d+i*_-s*M,t[1]=i*v+a*M+s*d-r*_,t[2]=s*v+a*_+r*M-i*d,t[3]=a*v-r*d-i*M-s*_,t[4]=r*h+a*o+i*c-s*u+l*v+E*d+f*_-m*M,t[5]=i*h+a*u+s*o-r*c+f*v+E*M+m*d-l*_,t[6]=s*h+a*c+r*u-i*o+m*v+E*_+l*M-f*d,t[7]=a*h-r*o-i*u-s*c+E*v-l*d-f*M-m*_,t}e.getReal=i.copy,e.setReal=i.copy,e.mul=c;var h=e.dot=i.dot,l=e.length=i.length,f=(e.len=l,e.squaredLength=i.squaredLength);e.sqrLen=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(6);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},e.fromValues=function(t,e,n,i,s,a){var o=new r.ARRAY_TYPE(6);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o[4]=s,o[5]=a,o},e.set=function(t,e,n,r,i,s,a){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=s,t[5]=a,t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=n*s-r*i;return u?(u=1/u,t[0]=s*u,t[1]=-r*u,t[2]=-i*u,t[3]=n*u,t[4]=(i*o-s*a)*u,t[5]=(r*a-n*o)*u,t):null},e.determinant=function(t){return t[0]*t[3]-t[1]*t[2]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=Math.sin(n),h=Math.cos(n);return t[0]=r*h+s*c,t[1]=i*h+a*c,t[2]=r*-c+s*h,t[3]=i*-c+a*h,t[4]=o,t[5]=u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=r*c,t[1]=i*c,t[2]=s*h,t[3]=a*h,t[4]=o,t[5]=u,t},e.translate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1];return t[0]=r,t[1]=i,t[2]=s,t[3]=a,t[4]=r*c+s*h+o,t[5]=i*c+a*h+u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t[4]=0,t[5]=0,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t},e.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t},e.subtract=s,e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=t[4],u=t[5],c=e[0],h=e[1],l=e[2],f=e[3],m=e[4],E=e[5];return Math.abs(n-c)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-h)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(s-l)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(a-f)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(f))&&Math.abs(o-m)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(u-E)<=r.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=e[4],u=e[5],c=n[0],h=n[1],l=n[2],f=n[3],m=n[4],E=n[5];return t[0]=r*c+s*h,t[1]=i*c+a*h,t[2]=r*l+s*f,t[3]=i*l+a*f,t[4]=r*m+s*E+o,t[5]=i*m+a*E+u,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t}e.mul=i,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sub=e.mul=void 0,e.create=function(){var t=new r.ARRAY_TYPE(4);return r.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},e.clone=function(t){var e=new r.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},e.fromValues=function(t,e,n,i){var s=new r.ARRAY_TYPE(4);return s[0]=t,s[1]=e,s[2]=n,s[3]=i,s},e.set=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},e.transpose=function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},e.invert=function(t,e){var n=e[0],r=e[1],i=e[2],s=e[3],a=n*s-i*r;return a?(a=1/a,t[0]=s*a,t[1]=-r*a,t[2]=-i*a,t[3]=n*a,t):null},e.adjoint=function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},e.determinant=function(t){return t[0]*t[3]-t[2]*t[1]},e.multiply=i,e.rotate=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=Math.sin(n),u=Math.cos(n);return t[0]=r*u+s*o,t[1]=i*u+a*o,t[2]=r*-o+s*u,t[3]=i*-o+a*u,t},e.scale=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=n[0],u=n[1];return t[0]=r*o,t[1]=i*o,t[2]=s*u,t[3]=a*u,t},e.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t},e.fromScaling=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t},e.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},e.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},e.subtract=s,e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},e.equals=function(t,e){var n=t[0],i=t[1],s=t[2],a=t[3],o=e[0],u=e[1],c=e[2],h=e[3];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-u)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(s-c)<=r.EPSILON*Math.max(1,Math.abs(s),Math.abs(c))&&Math.abs(a-h)<=r.EPSILON*Math.max(1,Math.abs(a),Math.abs(h))},e.multiplyScalar=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},e.multiplyScalarAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(0));function i(t,e,n){var r=e[0],i=e[1],s=e[2],a=e[3],o=n[0],u=n[1],c=n[2],h=n[3];return t[0]=r*o+s*u,t[1]=i*o+a*u,t[2]=r*c+s*h,t[3]=i*c+a*h,t}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}e.mul=i,e.sub=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.vec4=e.vec3=e.vec2=e.quat2=e.quat=e.mat4=e.mat3=e.mat2d=e.mat2=e.glMatrix=void 0;var r=m(n(0)),i=m(n(9)),s=m(n(8)),a=m(n(5)),o=m(n(4)),u=m(n(3)),c=m(n(7)),h=m(n(6)),l=m(n(2)),f=m(n(1));function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.glMatrix=r,e.mat2=i,e.mat2d=s,e.mat3=a,e.mat4=o,e.quat=u,e.quat2=c,e.vec2=h,e.vec3=l,e.vec4=f}])},function(t,e,n){"use strict";var r=n(19),i=n.n(r);e.a=i.a},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"POSITION",(function(){return u})),n.d(r,"NORMAL",(function(){return c})),n.d(r,"DEPTH",(function(){return h})),n.d(r,"DISTANCE",(function(){return l}));var i=n(35),s=n.n(i).a,a=n(36),o=n.n(a).a,u="POSITION",c="NORMAL",h="DEPTH",l="DISTANCE",f={webgl:s,webglExtensions:o,Hilo:r};Object.assign(f,s,o,r);e.a=f},function(t,e,n){"use strict";var r={},i={_cache:r,level:3,LEVEL_LOG:3,LEVEL_WARN:2,LEVEL_ERROR:1,LEVEL_NONE:0,log:function(){return this.level>=3&&console.log.apply(console,arguments),this},warn:function(){return this.level>=2&&console.warn.apply(console,arguments),this},error:function(){return this.level>=1&&console.error.apply(console,arguments),this},logOnce:function(t){return r["log_"+t]||(r["log_"+t]=!0,this.log.apply(this,Array.prototype.slice.call(arguments,1))),this},warnOnce:function(t){return r["warn_"+t]||(r["warn_"+t]=!0,this.warn.apply(this,Array.prototype.slice.call(arguments,1))),this},errorOnce:function(t){return r["error_"+t]||(r["error_"+t]=!0,this.error.apply(this,Array.prototype.slice.call(arguments,1))),this}};e.a=i},function(t,e,n){"use strict";n.r(e),n.d(e,"each",(function(){return M})),n.d(e,"getRelativePath",(function(){return m})),n.d(e,"convertUint8ArrayToString",(function(){return E})),n.d(e,"getExtension",(function(){return d})),n.d(e,"getIndexFromSortedArray",(function(){return _})),n.d(e,"insertToSortedArray",(function(){return v})),n.d(e,"padLeft",(function(){return p})),n.d(e,"getTypedArrayClass",(function(){return S})),n.d(e,"copyArrayData",(function(){return g})),n.d(e,"isStrOrNumber",(function(){return N})),n.d(e,"getTypedArrayGLType",(function(){return T})),n.d(e,"getBlobUrl",(function(){return L})),n.d(e,"isBlobUrl",(function(){return y})),n.d(e,"revokeBlobUrl",(function(){return O})),n.d(e,"isArrayLike",(function(){return P})),n.d(e,"getElementRect",(function(){return I})),n.d(e,"serialRun",(function(){return b})),n.d(e,"hasOwnProperty",(function(){return C}));var r=n(3),i=n(2);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a,o=i.a.BYTE,u=i.a.UNSIGNED_BYTE,c=i.a.SHORT,h=i.a.UNSIGNED_SHORT,l=i.a.UNSIGNED_INT,f=i.a.FLOAT;function m(t,e){if(/^(?:http|blob|data:|\/)/.test(e))return e;var n;for(t=t.replace(/\/[^/]*?$/,"").split("/"),e=e.split("/"),n=0;n>1,a=n(t[s],e);if(0===a)return[s,s];a<0?r=s+1:i=s-1}return r>i?[i,r]:[r,i]}function v(t,e,n){var r=_(t,e,n);t.splice(r[1],0,e)}function p(t,e,n){return e<=t.length?t:new Array(e-t.length+1).join(n||"0")+t}function T(t){return t instanceof Float32Array?f:t instanceof Int8Array?o:t instanceof Uint8Array?u:t instanceof Int16Array?c:t instanceof Uint16Array?h:t instanceof Uint32Array?l:f}var R,A,S=(s(R={},o,Int8Array),s(R,u,Uint8Array),s(R,c,Int16Array),s(R,h,Uint16Array),s(R,l,Uint32Array),s(R,f,Float32Array),A=R,function(t){return A[t]||Float32Array});function g(t,e,n,r,i){if(t&&e){e.isGeometryData&&(e=e.data);for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return Array.isArray(t)||(t=Object.values(t)),t.reduce((function(t,n,r){return t.then((function(){return e(n,r)}))}),Promise.resolve())}function C(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector3",isVector3:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec3.round(this.elements,this.elements),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this},hermite:function(t,e,n,i,s){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,s),this},bezier:function(t,e,n,i,s){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,s),this},random:function(t){return r.vec3.random(this.elements,t),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],s=e[2];return e[0]=r*n[0]+i*n[4]+s*n[8],e[1]=r*n[1]+i*n[5]+s*n[9],e[2]=r*n[2]+i*n[6]+s*n[10],this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r,i={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(r=0,function(t){var e=++r;return t?e=t+"_"+e:e+="",e}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},degToRad:function(t){return t*this.DEG2RAD},radToDeg:function(t){return t*this.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};e.a=i},function(t,e,n){"use strict";var r,i=n(0),s=n(1),a=n(5),o=n(10),u=new a.a,c=new a.a,h=s.a.create({className:"Matrix4",isMatrix4:!0,constructor:function(){this.elements=i.mat4.create()},copy:function(t){return i.mat4.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return i.mat4.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this},set:function(t,e,n,r,s,a,o,u,c,h,l,f,m,E,d,M){return i.mat4.set(this.elements,t,e,n,r,s,a,o,u,c,h,l,f,m,E,d,M),this},identity:function(){return i.mat4.identity(this.elements),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new a.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this},fromRotationTranslationScaleOrigin:function(t,e,n,r){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this},frustum:function(t,e,n,r,s,a){return i.mat4.frustum(this.elements,t,e,n,r,s,a),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this},ortho:function(t,e,n,r,s,a){return i.mat4.ortho(this.elements,t,e,n,r,s,a),this},lookAt:function(t,e,n){return t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this},targetTo:function(t,e,n){t.isVector3||(t=u.set(t.x,t.y,t.z)),e.isVector3||(e=c.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],s=t[1],a=t[2],o=n[0],h=n[1],l=n[2],f=i-e[0],m=s-e[1],E=a-e[2],d=f*f+m*m+E*E;d>0?(f*=d=1/Math.sqrt(d),m*=d,E*=d):E=1;var M=h*E-l*m,_=l*f-o*E,v=o*m-h*f;return(d=M*M+_*_+v*v)>0?(M*=d=1/Math.sqrt(d),_*=d,v*=d):(d=(M=h*E-l*m)*M+(_=l*f-(o+=1e-7)*E)*_+(v=o*m-h*f)*v,M*=d=1/Math.sqrt(d),_*=d,v*=d),r[0]=M,r[1]=_,r[2]=v,r[3]=0,r[4]=m*v-E*_,r[5]=E*M-f*v,r[6]=f*_-m*M,r[7]=0,r[8]=f,r[9]=m,r[10]=E,r[11]=0,r[12]=i,r[13]=s,r[14]=a,r[15]=1,this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new h),this.determinant()<0&&(n.x*=-1),r.copy(this),u.inverse(n),r.scale(u),t.fromMat4(r),i&&i.set(0,0,0),this}});h.prototype.sub=h.prototype.subtract,h.prototype.mul=h.prototype.multiply,e.a=h},function(t,e,n){"use strict";var r=n(1),i=n(12),s=n(4),a=r.a.create({Extends:i.a,className:"Color",isColor:!0,r:{get:function(){return this.x},set:function(t){this.x=t}},g:{get:function(){return this.y},set:function(t){this.y=t}},b:{get:function(){return this.z},set:function(t){this.z=t}},a:{get:function(){return this.w},set:function(t){this.w=t}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;a.superclass.constructor.call(this,t,e,n,r)},toRGBArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t},fromUintArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e]/255,this.elements[1]=t[e+1]/255,this.elements[2]=t[e+2]/255,this.elements[3]=t[e+3]/255,this},fromHEX:function(t){return"number"==typeof t?t=Object(s.padLeft)(t.toString(16),6):("#"===t[0]&&(t=t.slice(1)),3===t.length&&(t=t.replace(/(\w)/g,"$1$1"))),this.elements[0]=parseInt(t.slice(0,2),16)/255,this.elements[1]=parseInt(t.slice(2,4),16)/255,this.elements[2]=parseInt(t.slice(4,6),16)/255,this},toHEX:function(){for(var t="",e=0;e<3;e++)t+=Object(s.padLeft)(Math.floor(255*this.elements[e]).toString(16),2);return t}});e.a=a},function(t,e,n){"use strict";var r=n(37),i=n.n(r);e.a=i.a},function(t,e,n){"use strict";var r=n(0),i=n(11),s=n(1),a=n(9),o=new i.a,u=s.a.create({Mixes:a.a,className:"Quaternion",isQuaternion:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.elements=r.quat.fromValues(t,e,n,i)},copy:function(t,e){return r.quat.copy(this.elements,t.elements),e||this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=this.elements;return r[0]=t[e],r[1]=t[e+1],r[2]=t[e+2],r[3]=t[e+3],n||this.fire("update"),this},set:function(t,e,n,i,s){return r.quat.set(this.elements,t,e,n,i),s||this.fire("update"),this},identity:function(t){return r.quat.identity(this.elements),t||this.fire("update"),this},rotationTo:function(t,e,n){return r.quat.rotationTo(this.elements,t.elements,e.elements),n||this.fire("update"),this},setAxes:function(t,e,n,i){return r.quat.setAxes(this.elements,t.elements,e.elements,n.elements),i||this.fire("update"),this},setAxisAngle:function(t,e,n){return r.quat.setAxisAngle(this.elements,t.elements,e),n||this.fire("update"),this},getAxisAngle:function(t){return r.quat.getAxisAngle(t.elements,this.elements)},add:function(t,e){return r.quat.add(this.elements,this.elements,t.elements),e||this.fire("update"),this},multiply:function(t,e){return r.quat.multiply(this.elements,this.elements,t.elements),e||this.fire("update"),this},premultiply:function(t,e){return r.quat.multiply(this.elements,t.elements,this.elements),e||this.fire("update"),this},scale:function(t,e){return r.quat.scale(this.elements,this.elements,t),e||this.fire("update"),this},rotateX:function(t,e){return r.quat.rotateX(this.elements,this.elements,t),e||this.fire("update"),this},rotateY:function(t,e){return r.quat.rotateY(this.elements,this.elements,t),e||this.fire("update"),this},rotateZ:function(t,e){return r.quat.rotateZ(this.elements,this.elements,t),e||this.fire("update"),this},calculateW:function(t){return r.quat.calculateW(this.elements,this.elements),t||this.fire("update"),this},dot:function(t){return r.quat.dot(this.elements,t.elements)},lerp:function(t,e,n){return r.quat.lerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},slerp:function(t,e,n){return r.quat.slerp(this.elements,this.elements,t.elements,e),n||this.fire("update"),this},sqlerp:function(t,e,n,i,s,a){return r.quat.sqlerp(this.elements,t.elements,e.elements,n.elements,i.elements,s),a||this.fire("update"),this},invert:function(t){return r.quat.invert(this.elements,this.elements),t||this.fire("update"),this},conjugate:function(t){return r.quat.conjugate(this.elements,this.elements),t||this.fire("update"),this},length:function(){return r.quat.length(this.elements)},squaredLength:function(){return r.quat.squaredLength(this.elements)},normalize:function(t){return r.quat.normalize(this.elements,this.elements),t||this.fire("update"),this},fromMat3:function(t,e){return r.quat.fromMat3(this.elements,t.elements),e||this.fire("update"),this},fromMat4:function(t,e){return o.fromMat4(t),this.fromMat3(o,e),this},exactEquals:function(t){return r.quat.exactEquals(this.elements,t.elements)},equals:function(t){return r.quat.equals(this.elements,t.elements)},fromEuler:function(t,e){var n=.5*t.x,r=.5*t.y,i=.5*t.z,s=t.order||"ZYX",a=Math.sin(n),o=Math.cos(n),u=Math.sin(r),c=Math.cos(r),h=Math.sin(i),l=Math.cos(i),f=this.elements;return"XYZ"===s?(f[0]=a*c*l+o*u*h,f[1]=o*u*l-a*c*h,f[2]=o*c*h+a*u*l,f[3]=o*c*l-a*u*h):"YXZ"===s?(f[0]=a*c*l+o*u*h,f[1]=o*u*l-a*c*h,f[2]=o*c*h-a*u*l,f[3]=o*c*l+a*u*h):"ZXY"===s?(f[0]=a*c*l-o*u*h,f[1]=o*u*l+a*c*h,f[2]=o*c*h+a*u*l,f[3]=o*c*l-a*u*h):"ZYX"===s?(f[0]=a*c*l-o*u*h,f[1]=o*u*l+a*c*h,f[2]=o*c*h-a*u*l,f[3]=o*c*l+a*u*h):"YZX"===s?(f[0]=a*c*l+o*u*h,f[1]=o*u*l+a*c*h,f[2]=o*c*h-a*u*l,f[3]=o*c*l-a*u*h):"XZY"===s&&(f[0]=a*c*l-o*u*h,f[1]=o*u*l-a*c*h,f[2]=o*c*h+a*u*l,f[3]=o*c*l+a*u*h),e||this.fire("update"),this},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t,this.fire("update")}}});u.prototype.mul=u.prototype.multiply,u.prototype.len=u.prototype.length,u.prototype.sqrLen=u.prototype.squaredLength,e.a=u},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Matrix3",isMatrix3:!0,constructor:function(){this.elements=r.mat3.create()},copy:function(t){return r.mat3.copy(this.elements,t.elements),this},clone:function(){var t=new this.constructor;return r.mat3.copy(t.elements,this.elements),t},toArray:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)t[e+r]=n[r];return t},fromArray:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<9;r++)n[r]=t[e+r];return this},set:function(t,e,n,i,s,a,o,u,c){return r.mat3.set(this.elements,t,e,n,i,s,a,o,u,c),this},identity:function(){return r.mat3.identity(this.elements),this},transpose:function(){return r.mat3.transpose(this.elements,this.elements),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.invert(this.elements,t.elements),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return r.mat3.adjoint(this.elements,t.elements),this},determinant:function(){return r.mat3.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),r.mat3.multiply(this.elements,t.elements,e.elements),this},premultiply:function(t){return this.multiply(t,this),this},translate:function(t){return r.mat3.translate(this.elements,this.elements,t.elements),this},rotate:function(t){return r.mat3.rotate(this.elements,this.elements,t),this},scale:function(t){return r.mat3.scale(this.elements,this.elements,t.elements),this},fromTranslation:function(t){return r.mat3.fromTranslation(this.elements,t.elements),this},fromRotation:function(t){return r.mat3.fromRotation(this.elements,t),this},fromScaling:function(t){return r.mat3.fromScaling(this.elements,t.elements),this},fromQuat:function(t){return r.mat3.fromQuat(this.elements,t.elements),this},normalFromMat4:function(t){return r.mat3.normalFromMat4(this.elements,t.elements),this},fromMat4:function(t){return r.mat3.fromMat4(this.elements,t.elements),this},frob:function(){return r.mat3.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),r.mat3.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.mat3.subtract(this.elements,t.elements,e.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.mat3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.mat3.equals(t.elements,e.elements)},fromRotationTranslationScale:function(t,e,n,r,i){var s=Math.cos(t),a=Math.sin(t);return this.set(r*s,-i*a,0,r*a,i*s,0,e,n,1),this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,e.a=i},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector4",isVector4:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.elements=r.vec4.fromValues(t,e,n,i)},copy:function(t){return r.vec4.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2],t[3])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t[3+e]=n[3],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],n[3]=t[e+3],this},set:function(t,e,n,i){return r.vec4.set(this.elements,t,e,n,i),this},add:function(t,e){return e||(e=t,t=this),r.vec4.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec4.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec4.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec4.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec4.ceil(this.elements,this.elements),this},floor:function(){return r.vec4.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec4.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec4.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec4.round(this.elements,this.elements),this},scale:function(t){return r.vec4.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec4.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec4.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec4.squaredDistance(t.elements,e.elements)},length:function(){return r.vec4.length(this.elements)},squaredLength:function(){return r.vec4.squaredLength(this.elements)},negate:function(){return r.vec4.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec4.inverse(this.elements,t.elements),this},normalize:function(){return r.vec4.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec4.dot(t.elements,e.elements)},lerp:function(t,e){return r.vec4.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return t=t||1,this.elements[0]=Math.random(),this.elements[1]=Math.random(),this.elements[2]=Math.random(),this.elements[3]=Math.random(),this.normalize(),this.scale(t),this},transformMat4:function(t){return r.vec4.transformMat4(this.elements,this.elements,t.elements),this},transformQuat:function(t){return r.vec4.transformQuat(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec4.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t}},w:{get:function(){return this.elements[3]},set:function(t){this.elements[3]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},function(t,e,n){"use strict";var r=n(1),i=n(6),s=n(7),a=n(3),o=new s.a,u=i.a.DEG2RAD,c=i.a.RAD2DEG,h=r.a.create({className:"Euler",isEuler:!0,order:"ZYX",constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=new Float32Array([t,e,n]),this.updateDegrees()},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.elements[0]=t.x,this.elements[1]=t.y,this.elements[2]=t.z,this.order=t.order,this.updateDegrees(),this},set:function(t,e,n){return this.elements[0]=t,this.elements[1]=e,this.elements[2]=n,this.updateDegrees(),this},setDegree:function(t,e,n){return this._degX=t,this._degY=e,this._degZ=n,this.updateRadians(),this},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.elements[0]=t[e],this.elements[1]=t[e+1],this.elements[2]=t[e+2],this.updateDegrees(),this},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.elements[0],t[e+1]=this.elements[1],t[e+2]=this.elements[2],t},fromMat4:function(t,e){var n=t.elements,r=n[0],s=n[1],o=n[2],u=n[4],c=n[5],h=n[6],l=n[8],f=n[9],m=n[10];e=e||this.order,this.order=e;var E=i.a.clamp;return"XYZ"===e?(this.elements[1]=Math.asin(E(l,-1,1)),Math.abs(l)<.99999?(this.elements[0]=Math.atan2(-f,m),this.elements[2]=Math.atan2(-u,r)):(this.elements[0]=Math.atan2(h,c),this.elements[2]=0)):"YXZ"===e?(this.elements[0]=Math.asin(-E(f,-1,1)),Math.abs(f)<.99999?(this.elements[1]=Math.atan2(l,m),this.elements[2]=Math.atan2(s,c)):(this.elements[1]=Math.atan2(-o,r),this.elements[2]=0)):"ZXY"===e?(this.elements[0]=Math.asin(E(h,-1,1)),Math.abs(h)<.99999?(this.elements[1]=Math.atan2(-o,m),this.elements[2]=Math.atan2(-u,c)):(this.elements[1]=0,this.elements[2]=Math.atan2(s,r))):"ZYX"===e?(this.elements[1]=Math.asin(-E(o,-1,1)),Math.abs(o)<.99999?(this.elements[0]=Math.atan2(h,m),this.elements[2]=Math.atan2(s,r)):(this.elements[0]=0,this.elements[2]=Math.atan2(-u,c))):"YZX"===e?(this.elements[2]=Math.asin(E(s,-1,1)),Math.abs(s)<.99999?(this.elements[0]=Math.atan2(-f,c),this.elements[1]=Math.atan2(-o,r)):(this.elements[0]=0,this.elements[1]=Math.atan2(l,m))):"XZY"===e?(this.elements[2]=Math.asin(-E(u,-1,1)),Math.abs(u)<.99999?(this.elements[0]=Math.atan2(h,c),this.elements[1]=Math.atan2(l,r)):(this.elements[0]=Math.atan2(-f,m),this.elements[1]=0)):a.a.warn("Euler fromMat4() unsupported order: "+e),this.updateDegrees(),this},fromQuat:function(t,e){return o.fromQuat(t),this.fromMat4(o,e)},updateDegrees:function(){return this._degX=this.elements[0]*c,this._degY=this.elements[1]*c,this._degZ=this.elements[2]*c,this},updateRadians:function(){return this.elements[0]=this._degX*u,this.elements[1]=this._degY*u,this.elements[2]=this._degZ*u,this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*u}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*u}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*u}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*c}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*c}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*c}}});e.a=h},function(t,e,n){"use strict";var r=n(0),i=n(1).a.create({className:"Vector2",isVector2:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.elements=r.vec2.fromValues(t,e)},copy:function(t){return r.vec2.copy(this.elements,t.elements),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],this},set:function(t,e){return r.vec2.set(this.elements,t,e),this},add:function(t,e){return e||(e=t,t=this),r.vec2.add(this.elements,t.elements,e.elements),this},subtract:function(t,e){return e||(e=t,t=this),r.vec2.subtract(this.elements,t.elements,e.elements),this},multiply:function(t,e){return e||(e=t,t=this),r.vec2.multiply(this.elements,t.elements,e.elements),this},divide:function(t,e){return e||(e=t,t=this),r.vec2.divide(this.elements,t.elements,e.elements),this},ceil:function(){return r.vec2.ceil(this.elements,this.elements),this},floor:function(){return r.vec2.floor(this.elements,this.elements),this},min:function(t,e){return e||(e=t,t=this),r.vec2.min(this.elements,t.elements,e.elements),this},max:function(t,e){return e||(e=t,t=this),r.vec2.max(this.elements,t.elements,e.elements),this},round:function(){return r.vec2.round(this.elements,this.elements),this},scale:function(t){return r.vec2.scale(this.elements,this.elements,t),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec2.scaleAndAdd(this.elements,e.elements,n.elements,t),this},distance:function(t,e){return e||(e=t,t=this),r.vec2.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec2.squaredDistance(t.elements,e.elements)},length:function(){return r.vec2.length(this.elements)},squaredLength:function(){return r.vec2.squaredLength(this.elements)},negate:function(){return r.vec2.negate(this.elements,this.elements),this},inverse:function(t){return t||(t=this),r.vec2.inverse(this.elements,t.elements),this},normalize:function(){return r.vec2.normalize(this.elements,this.elements),this},dot:function(t,e){return e||(e=t,t=this),r.vec2.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec2.cross(this.elements,t.elements,e.elements),this},lerp:function(t,e){return r.vec2.lerp(this.elements,this.elements,t.elements,e),this},random:function(t){return r.vec2.random(this.elements,t),this},transformMat3:function(t){return r.vec2.transformMat3(this.elements,this.elements,t.elements),this},transformMat4:function(t){return r.vec2.transformMat4(this.elements,this.elements,t.elements),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec2.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec2.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t}}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.sqrDist=i.prototype.squaredDistance,i.prototype.len=i.prototype.length,i.prototype.sqrLen=i.prototype.squaredLength,e.a=i},,function(t,e,n){"use strict";var r=n(38),i=n.n(r),s=n(1),a=n(5),o=s.a.create({className:"Ray",isRay:!0,origin:{get:function(){return this._origin},set:function(t){this._origin=t,this._ray.origin=t.elements}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._ray.direction=t.elements}},constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._ray=new i.a,this.origin=t.origin||new a.a(0,0,0),this.direction=t.direction||new a.a(0,0,-1)},set:function(t,e){return this.origin=t,this.direction=e,this},copy:function(t){this.origin.copy(t.origin),this.direction.copy(t.direction)},clone:function(){return new this.constructor({origin:this.origin.clone(),direction:this.direction.clone()})},fromCamera:function(t,e,n,r,i){t.isPerspectiveCamera?(t.worldMatrix.getTranslation(this.origin),this.direction.set(e,n,0),this.direction.copy(t.unprojectVector(this.direction,r,i)),this.direction.sub(this.origin).normalize()):t.isOrthographicCamera&&(this.origin.set(e,n,(t.near+t.far)/(t.near-t.far)),this.origin.copy(t.unprojectVector(this.origin,r,i)),this.direction.set(0,0,-1).transformDirection(t.worldMatrix).normalize())},transformMat4:function(t){this.origin.transformMat4(t),this.direction.transformDirection(t).normalize()},sortPoints:function(t,e){var n=this;e?t.sort((function(t,r){return n.squaredDistance(t[e])-n.squaredDistance(r[e])})):t.sort((function(t,e){return n.squaredDistance(t)-n.squaredDistance(e)}))},squaredDistance:function(t){return this.origin.squaredDistance(t)},distance:function(t){return this.origin.distance(t)},intersectsSphere:function(t,e){var n=this._ray.intersectsSphere(t,e);return this._getRes(n)},intersectsPlane:function(t,e){var n=this._ray.intersectsPlane(t,e);return this._getRes(n)},intersectsTriangle:function(t){var e=this._ray.intersectsTriangle(t);return this._getRes(e)},intersectsBox:function(t){var e=this._ray.intersectsBox(t);return this._getRes(e)},intersectsTriangleCell:function(t,e){var n=this._ray.intersectsTriangleCell(t,e);return this._getRes(n)},_getRes:function(t){return t?new a.a(t[0],t[1],t[2]):null}});e.a=o},function(t,e,n){"use strict";var r=n(0),i=n(1),s=n(9),a=n(5),o=i.a.create({Mixes:s.a,Extends:a.a,className:"Vector3Notifier",isVector3Notifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.elements=r.vec3.fromValues(t,e,n)},copy:function(t){return r.vec3.copy(this.elements,t.elements),this.fire("update"),this},clone:function(){var t=this.elements;return new this.constructor(t[0],t[1],t[2])},toArray:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return t[0+e]=n[0],t[1+e]=n[1],t[2+e]=n[2],t},fromArray:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements;return n[0]=t[e+0],n[1]=t[e+1],n[2]=t[e+2],this.fire("update"),this},set:function(t,e,n){return r.vec3.set(this.elements,t,e,n),this.fire("update"),this},add:function(t,e){return e||(e=t,t=this),r.vec3.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),r.vec3.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},multiply:function(t,e){return e||(e=t,t=this),r.vec3.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},divide:function(t,e){return e||(e=t,t=this),r.vec3.divide(this.elements,t.elements,e.elements),this.fire("update"),this},ceil:function(){return r.vec3.ceil(this.elements,this.elements),this.fire("update"),this},floor:function(){return r.vec3.floor(this.elements,this.elements),this.fire("update"),this},min:function(t,e){return e||(e=t,t=this),r.vec3.min(this.elements,t.elements,e.elements),this.fire("update"),this},max:function(t,e){return e||(e=t,t=this),r.vec3.max(this.elements,t.elements,e.elements),this.fire("update"),this},round:function(){return r.vec3.round(this.elements,this.elements),this.fire("update"),this},scale:function(t){return r.vec3.scale(this.elements,this.elements,t),this.fire("update"),this},scaleAndAdd:function(t,e,n){return n||(n=e,e=this),r.vec3.scaleAndAdd(this.elements,e.elements,n.elements,t),this.fire("update"),this},distance:function(t,e){return e||(e=t,t=this),r.vec3.distance(t.elements,e.elements)},squaredDistance:function(t,e){return e||(e=t,t=this),r.vec3.squaredDistance(t.elements,e.elements)},length:function(){return r.vec3.length(this.elements)},squaredLength:function(){return r.vec3.squaredLength(this.elements)},negate:function(){return r.vec3.negate(this.elements,this.elements),this.fire("update"),this},inverse:function(t){return t||(t=this),r.vec3.inverse(this.elements,t.elements),this.fire("update"),this},normalize:function(){return r.vec3.normalize(this.elements,this.elements),this.fire("update"),this},dot:function(t,e){return e||(e=t,t=this),r.vec3.dot(t.elements,e.elements)},cross:function(t,e){return e||(e=t,t=this),r.vec3.cross(this.elements,t.elements,e.elements),this.fire("update"),this},lerp:function(t,e){return r.vec3.lerp(this.elements,this.elements,t.elements,e),this.fire("update"),this},hermite:function(t,e,n,i,s){return r.vec3.hermite(this.elements,t.elements,e.elements,n.elements,i.elements,s),this.fire("update"),this},bezier:function(t,e,n,i,s){return r.vec3.bezier(this.elements,t.elements,e.elements,n.elements,i.elements,s),this.fire("update"),this},random:function(t){return r.vec3.random(this.elements,t),this.fire("update"),this},transformMat3:function(t){return r.vec3.transformMat3(this.elements,this.elements,t.elements),this.fire("update"),this},transformMat4:function(t){return r.vec3.transformMat4(this.elements,this.elements,t.elements),this.fire("update"),this},transformDirection:function(t){var e=this.elements,n=t.elements,r=e[0],i=e[1],s=e[2];return e[0]=r*n[0]+i*n[4]+s*n[8],e[1]=r*n[1]+i*n[5]+s*n[9],e[2]=r*n[2]+i*n[6]+s*n[10],this.fire("update"),this},transformQuat:function(t){return r.vec3.transformQuat(this.elements,this.elements,t.elements),this.fire("update"),this},rotateX:function(t,e){return r.vec3.rotateX(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateY:function(t,e){return r.vec3.rotateY(this.elements,this.elements,t.elements,e),this.fire("update"),this},rotateZ:function(t,e){return r.vec3.rotateZ(this.elements,this.elements,t.elements,e),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),r.vec3.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),r.vec3.equals(t.elements,e.elements)},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this.fire("update")}}});e.a=o},,function(t,e){var n=function(){var t,e,n=function(t){var e,n,i={};for(e in t)n=t[e],r.hasOwnProperty(e)?r[e].call(this,n):i[e]=n;s(this.prototype,i)},r={Extends:function(t){var e=this.prototype,n=i(t.prototype);s(this,t),s(n,e),n.constructor=this,this.prototype=n,this.superclass=t.prototype},Mixes:function(t){t instanceof Array||(t=[t]);for(var e,n=this.prototype;e=t.shift();)s(n,e.prototype||e)},Statics:function(t){s(this,t)}},i=function(){if(Object.__proto__)return function(t){return{__proto__:t}};var t=function(){};return function(e){return t.prototype=e,new t}}(),s=function(t){for(var n=1,r=arguments.length;n0&&void 0!==arguments[0]?arguments[0]:new i.a,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.normal=t,this.distance=e},copy:function(t){return this.normal.copy(t.normal),this.distance=t.distance,this},clone:function(){return new this.constructor(this.normal.clone(),this.distance)},set:function(t,e,n,r){return this.normal.set(t,e,n),this.distance=r,this},normalize:function(){var t=1/this.normal.length();return this.normal.scale(t),this.distance*=t,this},distanceToPoint:function(t){return this.normal.dot(t)+this.distance},projectPoint:function(t){return(new i.a).copy(this.normal).scale(-this.distanceToPoint(t)).add(t)}});e.a=s},function(t,e,n){"use strict";var r=n(1),i=n(5),s=new i.a,a=r.a.create({className:"Sphere",isSphere:!0,radius:0,constructor:function(t){Object.assign(this,t),this.center||(this.center=new i.a(0,0,0))},clone:function(){var t=new this.constructor;return t.copy(this),t},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},fromPoints:function(t){for(var e=this.center,n=0,r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=this.elements,r=0;r<16;r++)n[r]=t[e+r];return this.fire("update"),this},set:function(t,e,n,r,s,a,o,u,c,h,l,f,m,E,d,M){return i.mat4.set(this.elements,t,e,n,r,s,a,o,u,c,h,l,f,m,E,d,M),this.fire("update"),this},identity:function(){return i.mat4.identity(this.elements),this.fire("update"),this},transpose:function(){return i.mat4.transpose(this.elements,this.elements),this.fire("update"),this},invert:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.invert(this.elements,t.elements),this.fire("update"),this},adjoint:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this;return i.mat4.adjoint(this.elements,t.elements),this.fire("update"),this},determinant:function(){return i.mat4.determinant(this.elements)},multiply:function(t,e){return e||(e=t,t=this),i.mat4.multiply(this.elements,t.elements,e.elements),this.fire("update"),this},premultiply:function(t){return this.multiply(t,this),this.fire("update"),this},translate:function(t){return i.mat4.translate(this.elements,this.elements,t.elements),this.fire("update"),this},scale:function(t){return i.mat4.scale(this.elements,this.elements,t.elements),this.fire("update"),this},rotate:function(t,e){return i.mat4.rotate(this.elements,this.elements,t,e.elements),this.fire("update"),this},rotateX:function(t){return i.mat4.rotateX(this.elements,this.elements,t),this.fire("update"),this},rotateY:function(t){return i.mat4.rotateY(this.elements,this.elements,t),this.fire("update"),this},rotateZ:function(t){return i.mat4.rotateZ(this.elements,this.elements,t),this.fire("update"),this},fromTranslation:function(t){return i.mat4.fromTranslation(this.elements,t.elements),this.fire("update"),this},fromScaling:function(t){return i.mat4.fromScaling(this.elements,t.elements),this.fire("update"),this},fromRotation:function(t,e){return i.mat4.fromRotation(this.elements,t,e.elements),this.fire("update"),this},fromXRotation:function(t){return i.mat4.fromXRotation(this.elements,t),this.fire("update"),this},fromYRotation:function(t){return i.mat4.fromYRotation(this.elements,t),this.fire("update"),this},fromZRotation:function(t){return i.mat4.fromZRotation(this.elements,t),this.fire("update"),this},fromRotationTranslation:function(t,e){return i.mat4.fromRotationTranslation(this.elements,t.elements,e.elements),this.fire("update"),this},getTranslation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getTranslation(t.elements,this.elements),t},getScaling:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o.a;return i.mat4.getScaling(t.elements,this.elements),t},getRotation:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new c.a;return i.mat4.getRotation(t.elements,this.elements),t},fromRotationTranslationScale:function(t,e,n){return i.mat4.fromRotationTranslationScale(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},fromRotationTranslationScaleOrigin:function(t,e,n,r,s){return i.mat4.fromRotationTranslationScaleOrigin(this.elements,t.elements,e.elements,n.elements,r.elements),s||this.fire("update"),this},fromQuat:function(t){return i.mat4.fromQuat(this.elements,t.elements),this.fire("update"),this},frustum:function(t,e,n,r,s,a){return i.mat4.frustum(this.elements,t,e,n,r,s,a),this.fire("update"),this},perspective:function(t,e,n,r){return i.mat4.perspective(this.elements,t,e,n,r),this.fire("update"),this},perspectiveFromFieldOfView:function(t,e,n){return i.mat4.perspectiveFromFieldOfView(this.elements,t,e,n),this.fire("update"),this},ortho:function(t,e,n,r,s,a){return i.mat4.ortho(this.elements,t,e,n,r,s,a),this.fire("update"),this},lookAt:function(t,e,n){return t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=l.set(e.x,e.y,e.z)),i.mat4.lookAt(this.elements,t.elements,e.elements,n.elements),this.fire("update"),this},targetTo:function(t,e,n){t.isVector3||(t=h.set(t.x,t.y,t.z)),e.isVector3||(e=l.set(e.x,e.y,e.z)),t=t.elements,e=e.elements,n=n.elements;var r=this.elements,i=t[0],s=t[1],a=t[2],o=n[0],u=n[1],c=n[2],f=i-e[0],m=s-e[1],E=a-e[2],d=f*f+m*m+E*E;d>0?(f*=d=1/Math.sqrt(d),m*=d,E*=d):E=1;var M=u*E-c*m,_=c*f-o*E,v=o*m-u*f;return(d=M*M+_*_+v*v)>0?(M*=d=1/Math.sqrt(d),_*=d,v*=d):(d=(M=u*E-c*m)*M+(_=c*f-(o+=1e-7)*E)*_+(v=o*m-u*f)*v,M*=d=1/Math.sqrt(d),_*=d,v*=d),r[0]=M,r[1]=_,r[2]=v,r[3]=0,r[4]=m*v-E*_,r[5]=E*M-f*v,r[6]=f*_-m*M,r[7]=0,r[8]=f,r[9]=m,r[10]=E,r[11]=0,r[12]=i,r[13]=s,r[14]=a,r[15]=1,this.fire("update"),this},frob:function(){return i.mat4.frob(this.elements)},add:function(t,e){return e||(e=t,t=this),i.mat4.add(this.elements,t.elements,e.elements),this.fire("update"),this},subtract:function(t,e){return e||(e=t,t=this),i.mat4.subtract(this.elements,t.elements,e.elements),this.fire("update"),this},exactEquals:function(t,e){return e||(e=t,t=this),i.mat4.exactEquals(t.elements,e.elements)},equals:function(t,e){return e||(e=t,t=this),i.mat4.equals(t.elements,e.elements)},compose:function(t,e,n,r){return r?this.fromRotationTranslationScaleOrigin(t,e,n,r):this.fromRotationTranslationScale(t,e,n),this},decompose:function(t,e,n,i){return this.getScaling(n),this.getTranslation(e),r||(r=new u.a),this.determinant()<0&&(n.x*=-1),r.copy(this),h.inverse(n),r.scale(h),t.fromMat4(r),i&&i.set(0,0,0),this}});e.a=f},function(t,e,n){"use strict";var r=n(1),i=n(9),s=n(6),a=n(13),o=s.a.DEG2RAD,u=s.a.RAD2DEG,c=r.a.create({Mixes:i.a,Extends:a.a,className:"EulerNotifier",isEulerNotifier:!0,constructor:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a.a.call(this,t,e,n)},updateDegrees:function(){return c.superclass.updateDegrees.call(this),this.fire("update"),this},updateRadians:function(){return c.superclass.updateRadians.call(this),this.fire("update"),this},degX:{get:function(){return this._degX},set:function(t){this._degX=t,this.elements[0]=t*o,this.fire("update")}},degY:{get:function(){return this._degY},set:function(t){this._degY=t,this.elements[1]=t*o,this.fire("update")}},degZ:{get:function(){return this._degZ},set:function(t){this._degZ=t,this.elements[2]=t*o,this.fire("update")}},x:{get:function(){return this.elements[0]},set:function(t){this.elements[0]=t,this._degX=t*u,this.fire("update")}},y:{get:function(){return this.elements[1]},set:function(t){this.elements[1]=t,this._degY=t*u,this.fire("update")}},z:{get:function(){return this.elements[2]},set:function(t){this.elements[2]=t,this._degZ=t*u,this.fire("update")}}});e.a=c},function(t,e,n){"use strict";var r=n(1),i=n(20),s=r.a.create({className:"Frustum",isFrustum:!0,constructor:function(){this.planes=[];for(var t=6;t--;)this.planes.push(new i.a)},copy:function(t){var e=t.planes;return this.planes.forEach((function(t,n){t.copy(e[n])})),this},clone:function(){var t=new this.constructor;return t.copy(this),t},fromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],s=n[2],a=n[3],o=n[4],u=n[5],c=n[6],h=n[7],l=n[8],f=n[9],m=n[10],E=n[11],d=n[12],M=n[13],_=n[14],v=n[15];return e[0].set(a-r,h-o,E-l,v-d).normalize(),e[1].set(a+r,h+o,E+l,v+d).normalize(),e[2].set(a+i,h+u,E+f,v+M).normalize(),e[3].set(a-i,h-u,E-f,v-M).normalize(),e[4].set(a-s,h-c,E-m,v-_).normalize(),e[5].set(a+s,h+c,E+m,v+_).normalize(),this},intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)-1&&a.splice(h,1)}}return 0==a.length&&delete s[r],!0}return!1}},i=n(19).create({constructor:function(t,e,n){this.type=t,this.target=e,this.detail=n,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),s=window.Event;if(s){var a=s.prototype,o=a.stopImmediatePropagation;a.stopImmediatePropagation=function(){o&&o.call(this),this._stopped=!0}}t.exports=r},function(t,e,n){var r=n(94),i=n(96),s=n(97),a=n(100),o=n(34),u=[[0,0,0],[0,0,0],[0,0,0]],c=[0,0,0];function h(t,e){this.origin=t||[0,0,0],this.direction=e||[0,0,-1]}t.exports=h,h.prototype.set=function(t,e){this.origin=t,this.direction=e},h.prototype.copy=function(t){o(this.origin,t.origin),o(this.direction,t.direction)},h.prototype.clone=function(){var t=new h;return t.copy(this),t},h.prototype.intersectsSphere=function(t,e){return s(c,this.origin,this.direction,t,e)},h.prototype.intersectsPlane=function(t,e){return i(c,this.origin,this.direction,t,e)},h.prototype.intersectsTriangle=function(t){return r(c,this.origin,this.direction,t)},h.prototype.intersectsBox=function(t){return a(c,this.origin,this.direction,t)},h.prototype.intersectsTriangleCell=function(t,e){var n=t[0],r=t[1],i=t[2];return u[0]=e[n],u[1]=e[r],u[2]=e[i],this.intersectsTriangle(u)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){var r=n(95),i=n(27),s=n(31),a=[0,0,0],o=[0,0,0],u=[0,0,0],c=[0,0,0],h=[0,0,0];t.exports=function(t,e,n,l){s(a,l[1],l[0]),s(o,l[2],l[0]),r(c,n,o);var f=i(a,c);if(f<1e-6)return null;s(u,e,l[0]);var m=i(u,c);if(m<0||m>f)return null;r(h,u,a);var E=i(n,h);if(E<0||m+E>f)return null;var d=i(o,h)/f;return t[0]=e[0]+d*n[0],t[1]=e[1]+d*n[1],t[2]=e[2]+d*n[2],t}},function(t,e){t.exports=function(t,e,n){var r=e[0],i=e[1],s=e[2],a=n[0],o=n[1],u=n[2];return t[0]=i*u-s*o,t[1]=s*a-r*u,t[2]=r*o-i*a,t}},function(t,e,n){var r=n(27),i=n(32),s=n(33),a=n(34);t.exports=function(t,e,n,u,c){var h=r(n,u);if(0!==h){var l=-(r(e,u)+c)/h;return l<0?null:(s(o,n,l),i(t,e,o))}return r(u,e)+c===0?a(t,e):null};var o=[0,0,0]},function(t,e,n){var r=n(98),i=n(27),s=n(31),a=n(99),o=n(33),u=n(32),c=[0,0,0];t.exports=function(t,e,n,h,l){s(c,h,e);var f=i(n,c);if(f<0)return null;a(c,e,n,f);var m=r(h,c),E=l*l;if(m>E)return null;return o(t,n,f-Math.sqrt(E-m)),u(t,t,e)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}},function(t,e){t.exports=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}},function(t,e){function n(t,e,n){for(var r=t.length,i=-1/0,s=1/0,a=0;au){var c=o;o=u,u=c}if(us)return 1/0;o>i&&(i=o),us?1/0:i}t.exports=function(t,e,r,i){var s=n(e,r,i);if(s===1/0)t=null;else{t=t||[];for(var a=0;a
  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8294,7 +8298,7 @@

    diff --git a/docs/Animation.html b/docs/Animation.html index a372fcdd..5a309559 100644 --- a/docs/Animation.html +++ b/docs/Animation.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9509,7 +9513,7 @@
    Returns:
    diff --git a/docs/AnimationStates.html b/docs/AnimationStates.html index 118bd54f..44bb8346 100644 --- a/docs/AnimationStates.html +++ b/docs/AnimationStates.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7553,7 +7557,7 @@

    @@ -8388,7 +8392,7 @@

    @@ -8518,6 +8522,144 @@

    Returns:
    + + + + +
    +
    +
    +

    + + staticAnimationStates.registerStateHandler(name, handler) +

    + + + + +
    +
    +
    + + +
    +

    注册属性处理器

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    name + + +string + + + + + +

    属性名

    handler + + +function + + + + + +

    属性处理方法

    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + +
    @@ -8532,7 +8674,7 @@

    @@ -8676,7 +8818,7 @@

    @@ -8820,7 +8962,7 @@

    @@ -8958,7 +9100,7 @@

    @@ -9096,7 +9238,7 @@

    @@ -9234,7 +9376,7 @@

    @@ -9372,7 +9514,7 @@

    @@ -9476,7 +9618,7 @@

    Returns:
    diff --git a/docs/AreaLight.html b/docs/AreaLight.html index f457fd28..470ffa88 100644 --- a/docs/AreaLight.html +++ b/docs/AreaLight.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8512,7 +8516,7 @@

    diff --git a/docs/AxisHelper.html b/docs/AxisHelper.html index 872a7be3..addffcc5 100644 --- a/docs/AxisHelper.html +++ b/docs/AxisHelper.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14150,7 +14154,7 @@
    Returns:
    diff --git a/docs/AxisNetHelper.html b/docs/AxisNetHelper.html index 2c296308..fa27c305 100644 --- a/docs/AxisNetHelper.html +++ b/docs/AxisNetHelper.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14331,7 +14335,7 @@
    Returns:
    diff --git a/docs/BasicLoader.html b/docs/BasicLoader.html index cbdc3263..e327112d 100644 --- a/docs/BasicLoader.html +++ b/docs/BasicLoader.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8888,7 +8892,7 @@
    Returns:
    diff --git a/docs/BasicMaterial.html b/docs/BasicMaterial.html index 162c9114..6dc6bec0 100644 --- a/docs/BasicMaterial.html +++ b/docs/BasicMaterial.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -10675,7 +10679,7 @@
    Returns:
    diff --git a/docs/BoxGeometry.html b/docs/BoxGeometry.html index 56ee4657..94b45929 100644 --- a/docs/BoxGeometry.html +++ b/docs/BoxGeometry.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -13485,7 +13489,7 @@
    Returns:
    diff --git a/docs/Buffer.html b/docs/Buffer.html index 6952818a..5540cb3f 100644 --- a/docs/Buffer.html +++ b/docs/Buffer.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9469,7 +9473,7 @@
    Returns:
    diff --git a/docs/Cache.html b/docs/Cache.html index 44739b30..c2fca900 100644 --- a/docs/Cache.html +++ b/docs/Cache.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8500,7 +8504,7 @@

    diff --git a/docs/Camera.html b/docs/Camera.html index d034f26b..4d35921a 100644 --- a/docs/Camera.html +++ b/docs/Camera.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -15823,7 +15827,7 @@
    Returns:
    diff --git a/docs/CameraHelper.html b/docs/CameraHelper.html index f7d91626..45f0dd1e 100644 --- a/docs/CameraHelper.html +++ b/docs/CameraHelper.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14294,7 +14298,7 @@
    Returns:
    diff --git a/docs/Class.html b/docs/Class.html index 08ba8447..3e616592 100644 --- a/docs/Class.html +++ b/docs/Class.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7611,7 +7615,7 @@

    diff --git a/docs/Color.html b/docs/Color.html index 33faf83d..c767c865 100644 --- a/docs/Color.html +++ b/docs/Color.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14065,7 +14069,7 @@

    diff --git a/docs/CubeTexture.html b/docs/CubeTexture.html index 8cefc177..9b0da594 100644 --- a/docs/CubeTexture.html +++ b/docs/CubeTexture.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -10790,7 +10794,7 @@
    Returns:
    diff --git a/docs/CubeTextureLoader.html b/docs/CubeTextureLoader.html index 1e356937..bd9845b5 100644 --- a/docs/CubeTextureLoader.html +++ b/docs/CubeTextureLoader.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9050,7 +9054,7 @@
    Returns:
    diff --git a/docs/DataTexture.html b/docs/DataTexture.html index 06535302..3ca9431d 100644 --- a/docs/DataTexture.html +++ b/docs/DataTexture.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -10577,7 +10581,7 @@
    Returns:
    diff --git a/docs/DirectionalLight.html b/docs/DirectionalLight.html index 8393fc8a..6baba20c 100644 --- a/docs/DirectionalLight.html +++ b/docs/DirectionalLight.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8742,7 +8746,7 @@

    diff --git a/docs/Euler.html b/docs/Euler.html index 9c110dfc..c3302c64 100644 --- a/docs/Euler.html +++ b/docs/Euler.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9523,7 +9527,7 @@
    Returns:
    diff --git a/docs/EulerNotifier.html b/docs/EulerNotifier.html index bf587f50..fdfd7112 100644 --- a/docs/EulerNotifier.html +++ b/docs/EulerNotifier.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9601,7 +9605,7 @@
    Returns:
    diff --git a/docs/EventMixin.html b/docs/EventMixin.html index 2b9df14a..578a011a 100644 --- a/docs/EventMixin.html +++ b/docs/EventMixin.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7611,7 +7615,7 @@

    diff --git a/docs/Fog.html b/docs/Fog.html index 04d9c67f..9a6fa282 100644 --- a/docs/Fog.html +++ b/docs/Fog.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8130,7 +8134,7 @@
    Returns:
    diff --git a/docs/Framebuffer.html b/docs/Framebuffer.html index 60796be1..65449959 100644 --- a/docs/Framebuffer.html +++ b/docs/Framebuffer.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9441,7 +9445,7 @@

    diff --git a/docs/Frustum.html b/docs/Frustum.html index de255073..771abdd8 100644 --- a/docs/Frustum.html +++ b/docs/Frustum.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8288,7 +8292,7 @@
    Returns:
    diff --git a/docs/GLTFLoader.html b/docs/GLTFLoader.html index 550e81ef..ea6e38f8 100644 --- a/docs/GLTFLoader.html +++ b/docs/GLTFLoader.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9250,7 +9254,7 @@
    Returns:
    diff --git a/docs/GLTFParser.html b/docs/GLTFParser.html index 8aeafd19..aad46f8f 100644 --- a/docs/GLTFParser.html +++ b/docs/GLTFParser.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8124,7 +8128,7 @@

    diff --git a/docs/Geometry.html b/docs/Geometry.html index 86efc187..f97f4192 100644 --- a/docs/Geometry.html +++ b/docs/Geometry.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -12334,7 +12338,7 @@
    Returns:
    diff --git a/docs/GeometryData.html b/docs/GeometryData.html index a1e27a2c..94268b48 100644 --- a/docs/GeometryData.html +++ b/docs/GeometryData.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8949,7 +8953,161 @@

    + + + +
    + + +
    +

    Get the value by index. +Please note that it will return the same reference for performance reasons. If you want to get a copy, use #getCopy instead.

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    index + + +Number + + + + + +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + + Number + | + + Vector2 + | + + Vector3 + | + + Vector4 + + +
    + + + + +
    + + + +
    +
    +
    +

    + + getCopy(index){Number|Vector2|Vector3|Vector4} +

    + + +
    @@ -8958,7 +9116,8 @@

    -

    获取值

    +

    Get the value by index. +It will return a copy of value.

    @@ -9102,7 +9261,7 @@

    @@ -9249,7 +9408,7 @@

    @@ -9402,7 +9561,7 @@

    @@ -9549,7 +9708,7 @@

    @@ -9693,7 +9852,7 @@

    @@ -9842,7 +10001,7 @@

    Returns:
    diff --git a/docs/GeometryMaterial.html b/docs/GeometryMaterial.html index 99d55c1e..6f886439 100644 --- a/docs/GeometryMaterial.html +++ b/docs/GeometryMaterial.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -10806,7 +10810,7 @@
    Returns:
    diff --git a/docs/HDRLoader.html b/docs/HDRLoader.html index cf0f12c7..f9bc27df 100644 --- a/docs/HDRLoader.html +++ b/docs/HDRLoader.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7897,7 +7901,7 @@
    Returns:
    diff --git a/docs/IGLTFExtensionHandler.html b/docs/IGLTFExtensionHandler.html index d57a6c8d..b7508c30 100644 --- a/docs/IGLTFExtensionHandler.html +++ b/docs/IGLTFExtensionHandler.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8517,7 +8521,7 @@
    Example
    diff --git a/docs/KTXLoader.html b/docs/KTXLoader.html index 96ed5f92..8d01c143 100644 --- a/docs/KTXLoader.html +++ b/docs/KTXLoader.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7868,7 +7872,7 @@

    diff --git a/docs/LazyTexture.html b/docs/LazyTexture.html index f9055169..cdce3b4f 100644 --- a/docs/LazyTexture.html +++ b/docs/LazyTexture.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -10983,7 +10987,7 @@
    Returns:
    diff --git a/docs/Light.html b/docs/Light.html index adfbbf34..1ac37209 100644 --- a/docs/Light.html +++ b/docs/Light.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14605,7 +14609,7 @@
    Returns:
    diff --git a/docs/LightManager.html b/docs/LightManager.html index cd8b43fc..843d6e95 100644 --- a/docs/LightManager.html +++ b/docs/LightManager.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8912,7 +8916,7 @@

    diff --git a/docs/LoadQueue.html b/docs/LoadQueue.html index a819c864..42e2cf13 100644 --- a/docs/LoadQueue.html +++ b/docs/LoadQueue.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8982,7 +8986,7 @@
    Returns:
    diff --git a/docs/Loader.html b/docs/Loader.html index 54ffcdff..b6056d79 100644 --- a/docs/Loader.html +++ b/docs/Loader.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8038,7 +8042,7 @@
    Returns:
    diff --git a/docs/Material.html b/docs/Material.html index 49a6fbf3..88ce4789 100644 --- a/docs/Material.html +++ b/docs/Material.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -10135,7 +10139,7 @@
    Returns:
    diff --git a/docs/Matrix3.html b/docs/Matrix3.html index 772e2c77..120f18f7 100644 --- a/docs/Matrix3.html +++ b/docs/Matrix3.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -12174,7 +12178,7 @@

    diff --git a/docs/Matrix4.html b/docs/Matrix4.html index 1a5bfe3f..de89fb3b 100644 --- a/docs/Matrix4.html +++ b/docs/Matrix4.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -15490,7 +15494,7 @@

    diff --git a/docs/Matrix4Notifier.html b/docs/Matrix4Notifier.html index 993b1802..7596e27e 100644 --- a/docs/Matrix4Notifier.html +++ b/docs/Matrix4Notifier.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -15617,7 +15621,7 @@

    diff --git a/docs/Mesh.html b/docs/Mesh.html index 67f46fcb..0549f003 100644 --- a/docs/Mesh.html +++ b/docs/Mesh.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14205,7 +14209,7 @@
    Returns:
    diff --git a/docs/MeshPicker.html b/docs/MeshPicker.html index 38c7c98c..4d57b5e0 100644 --- a/docs/MeshPicker.html +++ b/docs/MeshPicker.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8146,7 +8150,7 @@
    Returns:
    diff --git a/docs/MorphGeometry.html b/docs/MorphGeometry.html index c9b07266..96a37613 100644 --- a/docs/MorphGeometry.html +++ b/docs/MorphGeometry.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -12527,7 +12531,7 @@
    Returns:
    diff --git a/docs/Node.html b/docs/Node.html index eb025122..883450d1 100644 --- a/docs/Node.html +++ b/docs/Node.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14087,7 +14091,7 @@
    Returns:
    diff --git a/docs/OrthographicCamera.html b/docs/OrthographicCamera.html index 7a9934fd..3bef514f 100644 --- a/docs/OrthographicCamera.html +++ b/docs/OrthographicCamera.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -16110,7 +16114,7 @@
    Returns:
    diff --git a/docs/PBRMaterial.html b/docs/PBRMaterial.html index d467fd28..d36e6e8e 100644 --- a/docs/PBRMaterial.html +++ b/docs/PBRMaterial.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -11068,7 +11072,7 @@
    Returns:
    diff --git a/docs/PerspectiveCamera.html b/docs/PerspectiveCamera.html index 95910d54..6a35552e 100644 --- a/docs/PerspectiveCamera.html +++ b/docs/PerspectiveCamera.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -16036,7 +16040,7 @@
    Returns:
    diff --git a/docs/Plane.html b/docs/Plane.html index 81ed33de..6543b2dd 100644 --- a/docs/Plane.html +++ b/docs/Plane.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8696,7 +8700,7 @@
    Returns:
    diff --git a/docs/PlaneGeometry.html b/docs/PlaneGeometry.html index 468aa5db..e195d7d2 100644 --- a/docs/PlaneGeometry.html +++ b/docs/PlaneGeometry.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -12598,7 +12602,7 @@
    Returns:
    diff --git a/docs/PointLight.html b/docs/PointLight.html index 946d660c..d64e8512 100644 --- a/docs/PointLight.html +++ b/docs/PointLight.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14658,7 +14662,7 @@
    Returns:
    diff --git a/docs/Program.html b/docs/Program.html index 5bcf7b78..90d5f4c4 100644 --- a/docs/Program.html +++ b/docs/Program.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9375,7 +9379,7 @@
    Returns:
    diff --git a/docs/Quaternion.html b/docs/Quaternion.html index fd646b14..1e3c70db 100644 --- a/docs/Quaternion.html +++ b/docs/Quaternion.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14244,7 +14248,7 @@

    diff --git a/docs/Ray.html b/docs/Ray.html index 341e4538..d3dddee5 100644 --- a/docs/Ray.html +++ b/docs/Ray.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9958,7 +9962,7 @@
    Returns:
    diff --git a/docs/RenderInfo.html b/docs/RenderInfo.html index 967a45aa..383c8d2c 100644 --- a/docs/RenderInfo.html +++ b/docs/RenderInfo.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8127,7 +8131,7 @@

    diff --git a/docs/RenderList.html b/docs/RenderList.html index c508d307..072c71a1 100644 --- a/docs/RenderList.html +++ b/docs/RenderList.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8495,7 +8499,7 @@

    diff --git a/docs/Shader.html b/docs/Shader.html index fb64d756..ed84504b 100644 --- a/docs/Shader.html +++ b/docs/Shader.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9660,7 +9664,7 @@
    Returns:
    diff --git a/docs/ShaderMaterial.html b/docs/ShaderMaterial.html index 3696dcdd..08193993 100644 --- a/docs/ShaderMaterial.html +++ b/docs/ShaderMaterial.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -10463,7 +10467,7 @@
    Returns:
    diff --git a/docs/ShaderMaterialLoader.html b/docs/ShaderMaterialLoader.html index e653ed59..2551029c 100644 --- a/docs/ShaderMaterialLoader.html +++ b/docs/ShaderMaterialLoader.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8927,7 +8931,7 @@
    Returns:
    diff --git a/docs/SkinedMesh.html b/docs/SkinedMesh.html index ad629c09..4c471c11 100644 --- a/docs/SkinedMesh.html +++ b/docs/SkinedMesh.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14691,7 +14695,7 @@
    Returns:
    diff --git a/docs/SphereGeometry.html b/docs/SphereGeometry.html index e8ae8f5e..d1d1ae3d 100644 --- a/docs/SphereGeometry.html +++ b/docs/SphereGeometry.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -12554,7 +12558,7 @@
    Returns:
    diff --git a/docs/SphericalHarmonics3.html b/docs/SphericalHarmonics3.html index 00ec6f71..24015d31 100644 --- a/docs/SphericalHarmonics3.html +++ b/docs/SphericalHarmonics3.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8489,7 +8493,7 @@
    Returns:
    diff --git a/docs/SpotLight.html b/docs/SpotLight.html index fa98af99..c08e50e3 100644 --- a/docs/SpotLight.html +++ b/docs/SpotLight.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -15061,7 +15065,7 @@
    Returns:
    diff --git a/docs/Stage.html b/docs/Stage.html index 35a3b018..d0ca4a2b 100644 --- a/docs/Stage.html +++ b/docs/Stage.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -16048,7 +16052,7 @@
    Returns:
    diff --git a/docs/Texture.html b/docs/Texture.html index 1fb1cf9e..bb4ceaec 100644 --- a/docs/Texture.html +++ b/docs/Texture.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -10391,7 +10395,7 @@
    Returns:
    diff --git a/docs/TextureLoader.html b/docs/TextureLoader.html index 710c3332..1844b654 100644 --- a/docs/TextureLoader.html +++ b/docs/TextureLoader.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8905,7 +8909,7 @@
    Returns:
    diff --git a/docs/Ticker.html b/docs/Ticker.html index 1ab1fc99..6b4a1c41 100644 --- a/docs/Ticker.html +++ b/docs/Ticker.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7649,7 +7653,7 @@

    diff --git a/docs/Tween.html b/docs/Tween.html index 41c40825..8f74ab10 100644 --- a/docs/Tween.html +++ b/docs/Tween.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7714,7 +7718,7 @@

    staticTwe diff --git a/docs/Vector2.html b/docs/Vector2.html index 731e27a8..aec2dd8f 100644 --- a/docs/Vector2.html +++ b/docs/Vector2.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -13209,7 +13213,7 @@

    diff --git a/docs/Vector3.html b/docs/Vector3.html index 1127a801..4076c209 100644 --- a/docs/Vector3.html +++ b/docs/Vector3.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14564,7 +14568,7 @@

    diff --git a/docs/Vector3Notifier.html b/docs/Vector3Notifier.html index 4c0c48cb..57dea162 100644 --- a/docs/Vector3Notifier.html +++ b/docs/Vector3Notifier.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -14634,7 +14638,7 @@

    diff --git a/docs/Vector4.html b/docs/Vector4.html index d0d68201..b36ec632 100644 --- a/docs/Vector4.html +++ b/docs/Vector4.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -13218,7 +13222,7 @@

    diff --git a/docs/VertexArrayObject.html b/docs/VertexArrayObject.html index bd249e5e..41378ccd 100644 --- a/docs/VertexArrayObject.html +++ b/docs/VertexArrayObject.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9415,7 +9419,7 @@
    Returns:
    diff --git a/docs/WebGLRenderer.html b/docs/WebGLRenderer.html index 2a2f6fc3..37ea0e6a 100644 --- a/docs/WebGLRenderer.html +++ b/docs/WebGLRenderer.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -11976,7 +11980,7 @@

    diff --git a/docs/WebGLResourceManager.html b/docs/WebGLResourceManager.html index 05365215..f57c87b7 100644 --- a/docs/WebGLResourceManager.html +++ b/docs/WebGLResourceManager.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8348,7 +8352,7 @@
    Returns:
    diff --git a/docs/WebGLState.html b/docs/WebGLState.html index 3c449a1a..04dfaf4b 100644 --- a/docs/WebGLState.html +++ b/docs/WebGLState.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -10827,7 +10831,7 @@
    Returns:
    diff --git a/docs/WebGLSupport.html b/docs/WebGLSupport.html index c3a3845a..2d157282 100644 --- a/docs/WebGLSupport.html +++ b/docs/WebGLSupport.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7709,7 +7713,7 @@
    Returns:
    diff --git a/docs/animation_Animation.js.html b/docs/animation_Animation.js.html index aea65953..a4757bc7 100644 --- a/docs/animation_Animation.js.html +++ b/docs/animation_Animation.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7861,7 +7865,7 @@

    Source: anima diff --git a/docs/animation_AnimationStates.js.html b/docs/animation_AnimationStates.js.html index 1de774d0..60771fc2 100644 --- a/docs/animation_AnimationStates.js.html +++ b/docs/animation_AnimationStates.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7539,6 +7543,7 @@

    Source: isArrayLike, getIndexFromSortedArray } from '../utils/util'; +import log from '../utils/log'; const tempQuat1 = new Quaternion(); const tempQuat2 = new Quaternion(); @@ -7657,7 +7662,21 @@

    Source: */ getType(name) { name = String(name).toUpperCase(); - return AnimationStates.StateType[name]; + return AnimationStates.StateType[name] || AnimationStates._extraStateHandlers.type[name]; + }, + _extraStateHandlers: { + type: {}, + handler: {} + }, + /** + * 注册属性处理器 + * @memberOf AnimationStates + * @param {string} name 属性名 + * @param {Function} handler 属性处理方法 + */ + registerStateHandler(name, handler) { + AnimationStates._extraStateHandlers.type[String(name).toUpperCase()] = name; + AnimationStates._extraStateHandlers.handler[name] = handler; } }, /** @@ -7747,6 +7766,10 @@

    Source: const time2 = this.keyTime[index2]; let state1 = this.getStateByIndex(index1); + if (this.interpolationType === 'STEP') { + return state1; + } + if (index1 === index2) { let result = this.interpolation(state1); if (this.type === AnimationStates.StateType.ROTATION) { @@ -7863,7 +7886,14 @@

    Source: if (!state) { return; } - this[`updateNode${type}`](node, state); + const fnName = 'updateNode' + type; + if (this[fnName]) { + this[fnName](node, state); + } else if (AnimationStates._extraStateHandlers.handler[type]) { + AnimationStates._extraStateHandlers.handler[type].call(this, node, state); + } else { + log.warnOnce(fnName, 'updateNodeState failed unknow type(%s)', type); + } }, /** * clone @@ -7892,7 +7922,7 @@

    Source: diff --git a/docs/camera_Camera.js.html b/docs/camera_Camera.js.html index 45532270..04719471 100644 --- a/docs/camera_Camera.js.html +++ b/docs/camera_Camera.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7752,7 +7756,7 @@

    Source: camera/Came diff --git a/docs/camera_OrthographicCamera.js.html b/docs/camera_OrthographicCamera.js.html index 672b3957..eccc88d6 100644 --- a/docs/camera_OrthographicCamera.js.html +++ b/docs/camera_OrthographicCamera.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7709,7 +7713,7 @@

    Source: diff --git a/docs/camera_PerspectiveCamera.js.html b/docs/camera_PerspectiveCamera.js.html index 9f11f13b..123275aa 100644 --- a/docs/camera_PerspectiveCamera.js.html +++ b/docs/camera_PerspectiveCamera.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7713,7 +7717,7 @@

    Source: diff --git a/docs/capabilities.html b/docs/capabilities.html index 33c28bf1..507b91da 100644 --- a/docs/capabilities.html +++ b/docs/capabilities.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8379,7 +8383,7 @@
    Returns:
    diff --git a/docs/constants_index.js.html b/docs/constants_index.js.html index 9894e12d..791ca75b 100644 --- a/docs/constants_index.js.html +++ b/docs/constants_index.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7559,7 +7563,7 @@

    Source: constants diff --git a/docs/core_Class.js.html b/docs/core_Class.js.html index 6c0df6d5..71c8d671 100644 --- a/docs/core_Class.js.html +++ b/docs/core_Class.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7551,7 +7555,7 @@

    Source: core/Class.js< diff --git a/docs/core_EventMixin.js.html b/docs/core_EventMixin.js.html index 58aa84af..772d57e5 100644 --- a/docs/core_EventMixin.js.html +++ b/docs/core_EventMixin.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7551,7 +7555,7 @@

    Source: core/Even diff --git a/docs/core_Fog.js.html b/docs/core_Fog.js.html index 6cced6fb..460535c7 100644 --- a/docs/core_Fog.js.html +++ b/docs/core_Fog.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7634,7 +7638,7 @@

    Source: core/Fog.js

    diff --git a/docs/core_Mesh.js.html b/docs/core_Mesh.js.html index d9915101..4069daaf 100644 --- a/docs/core_Mesh.js.html +++ b/docs/core_Mesh.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7694,7 +7698,7 @@

    Source: core/Mesh.js - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.4 diff --git a/docs/core_Node.js.html b/docs/core_Node.js.html index f223366a..de2a8d8f 100644 --- a/docs/core_Node.js.html +++ b/docs/core_Node.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8590,7 +8594,7 @@

    Source: core/Node.js - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.4 diff --git a/docs/core_SkinedMesh.js.html b/docs/core_SkinedMesh.js.html index c982bf7a..53bd1b22 100644 --- a/docs/core_SkinedMesh.js.html +++ b/docs/core_SkinedMesh.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7722,7 +7726,7 @@

    Source: core/Skin diff --git a/docs/core_Stage.js.html b/docs/core_Stage.js.html index e7779b89..9d508d2e 100644 --- a/docs/core_Stage.js.html +++ b/docs/core_Stage.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7915,7 +7919,7 @@

    Source: core/Stage.js< diff --git a/docs/core_Tween.js.html b/docs/core_Tween.js.html index ca8e3dcc..0651695b 100644 --- a/docs/core_Tween.js.html +++ b/docs/core_Tween.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7559,7 +7563,7 @@

    Source: core/Tween.js< diff --git a/docs/extensions.html b/docs/extensions.html index de4d47c5..a3e375ea 100644 --- a/docs/extensions.html +++ b/docs/extensions.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8672,7 +8676,7 @@

    diff --git a/docs/geometry_BoxGeometry.js.html b/docs/geometry_BoxGeometry.js.html index 934258d7..c97f8957 100644 --- a/docs/geometry_BoxGeometry.js.html +++ b/docs/geometry_BoxGeometry.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7829,7 +7833,7 @@

    Source: geom diff --git a/docs/geometry_Geometry.js.html b/docs/geometry_Geometry.js.html index 26ce3e31..1e736e06 100644 --- a/docs/geometry_Geometry.js.html +++ b/docs/geometry_Geometry.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8495,7 +8499,7 @@

    Source: geometr diff --git a/docs/geometry_GeometryData.js.html b/docs/geometry_GeometryData.js.html index 8bcf60f3..6ce14971 100644 --- a/docs/geometry_GeometryData.js.html +++ b/docs/geometry_GeometryData.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7799,7 +7803,8 @@

    Source: geo return index * strideSize + this.offsetSize; }, /** - * 获取值 + * Get the value by index. + * Please note that it will return the same reference for performance reasons. If you want to get a copy, use #getCopy instead. * @param {Number} index * @return {Number|Vector2|Vector3|Vector4} */ @@ -7807,6 +7812,17 @@

    Source: geo const offset = this.getOffset(index); return this.getByOffset(offset); }, + + /** + * Get the value by index. + * It will return a copy of value. + * @param {Number} index + * @return {Number|Vector2|Vector3|Vector4} + */ + getCopy(index) { + return this.get(index).clone(); + }, + /** * 设置值 * @param {Number} index @@ -7927,7 +7943,7 @@

    Source: geo diff --git a/docs/geometry_MorphGeometry.js.html b/docs/geometry_MorphGeometry.js.html index 130794a3..bfe20f6d 100644 --- a/docs/geometry_MorphGeometry.js.html +++ b/docs/geometry_MorphGeometry.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7625,7 +7629,7 @@

    Source: ge diff --git a/docs/geometry_PlaneGeometry.js.html b/docs/geometry_PlaneGeometry.js.html index e65740ed..9dcfd227 100644 --- a/docs/geometry_PlaneGeometry.js.html +++ b/docs/geometry_PlaneGeometry.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7675,7 +7679,7 @@

    Source: ge diff --git a/docs/geometry_SphereGeometry.js.html b/docs/geometry_SphereGeometry.js.html index b1893268..72fc20c5 100644 --- a/docs/geometry_SphereGeometry.js.html +++ b/docs/geometry_SphereGeometry.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7670,7 +7674,7 @@

    Source: g diff --git a/docs/glType.html b/docs/glType.html index c6b45a9e..8c7ce3c4 100644 --- a/docs/glType.html +++ b/docs/glType.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7867,7 +7871,7 @@
    Returns:
    diff --git a/docs/global.html b/docs/global.html index bd8bdc46..d408134b 100644 --- a/docs/global.html +++ b/docs/global.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -9364,7 +9368,7 @@
    Properties:
    diff --git a/docs/helper_AxisHelper.js.html b/docs/helper_AxisHelper.js.html index 7c46cbbe..ebfb788e 100644 --- a/docs/helper_AxisHelper.js.html +++ b/docs/helper_AxisHelper.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7620,7 +7624,7 @@

    Source: helper/ diff --git a/docs/helper_AxisNetHelper.js.html b/docs/helper_AxisNetHelper.js.html index 613e14e6..abd3a4ae 100644 --- a/docs/helper_AxisNetHelper.js.html +++ b/docs/helper_AxisNetHelper.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7612,7 +7616,7 @@

    Source: help diff --git a/docs/helper_CameraHelper.js.html b/docs/helper_CameraHelper.js.html index 6f366a51..d8a3d6ba 100644 --- a/docs/helper_CameraHelper.js.html +++ b/docs/helper_CameraHelper.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7639,7 +7643,7 @@

    Source: helpe diff --git a/docs/index.html b/docs/index.html index 92edbfba..7abb8256 100644 --- a/docs/index.html +++ b/docs/index.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7551,7 +7555,7 @@

    A 3D WebGL Rendering Engine


    InstallationDocumentationDevelopmentShowcaseExamplesAuthorsLicense

    -

    npm ci size gitter.im

    +

    npm ci size gitter.im

    Features

    • Compatible for multiple mobile and desktop browsers.
    • @@ -7567,8 +7571,8 @@

      Installation

    • -

      use script tag from a cdn

      -
      <script src='//g.alicdn.com/hilo/Hilo3d/1.13.47/Hilo3d.js'></script>
      +

      use script tag from a cdn

      +
      <script src='//g.alicdn.com/hilo/Hilo3d/1.14.0/Hilo3d.js'></script>
       
    @@ -7743,7 +7747,7 @@

    License

    diff --git a/docs/light_AmbientLight.js.html b/docs/light_AmbientLight.js.html index a882e67f..9760c275 100644 --- a/docs/light_AmbientLight.js.html +++ b/docs/light_AmbientLight.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7567,7 +7571,7 @@

    Source: light/ diff --git a/docs/light_AreaLight.js.html b/docs/light_AreaLight.js.html index c81ae1db..80006e25 100644 --- a/docs/light_AreaLight.js.html +++ b/docs/light_AreaLight.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7683,7 +7687,7 @@

    Source: light/Are diff --git a/docs/light_DirectionalLight.js.html b/docs/light_DirectionalLight.js.html index 9f03c8be..66d9fd46 100644 --- a/docs/light_DirectionalLight.js.html +++ b/docs/light_DirectionalLight.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7628,7 +7632,7 @@

    Source: li diff --git a/docs/light_Light.js.html b/docs/light_Light.js.html index 39494e9c..247ee54d 100644 --- a/docs/light_Light.js.html +++ b/docs/light_Light.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7656,7 +7660,7 @@

    Source: light/Light.j diff --git a/docs/light_LightManager.js.html b/docs/light_LightManager.js.html index f46759b4..1f3875df 100644 --- a/docs/light_LightManager.js.html +++ b/docs/light_LightManager.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7950,7 +7954,7 @@

    Source: light/ diff --git a/docs/light_LightShadow.js.html b/docs/light_LightShadow.js.html index 23cd42fe..7fb231ae 100644 --- a/docs/light_LightShadow.js.html +++ b/docs/light_LightShadow.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7722,7 +7726,7 @@

    Source: light/L diff --git a/docs/light_PointLight.js.html b/docs/light_PointLight.js.html index 08060f82..601f3487 100644 --- a/docs/light_PointLight.js.html +++ b/docs/light_PointLight.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7592,7 +7596,7 @@

    Source: light/Po diff --git a/docs/light_SpotLight.js.html b/docs/light_SpotLight.js.html index 282a13e9..1f14833e 100644 --- a/docs/light_SpotLight.js.html +++ b/docs/light_SpotLight.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7661,7 +7665,7 @@

    Source: light/Spo diff --git a/docs/loader_BasicLoader.js.html b/docs/loader_BasicLoader.js.html index 3a353e9c..35c122bb 100644 --- a/docs/loader_BasicLoader.js.html +++ b/docs/loader_BasicLoader.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7806,7 +7810,7 @@

    Source: loader diff --git a/docs/loader_CubeTextureLoader.js.html b/docs/loader_CubeTextureLoader.js.html index d6d4bfad..05a114d2 100644 --- a/docs/loader_CubeTextureLoader.js.html +++ b/docs/loader_CubeTextureLoader.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7635,7 +7639,7 @@

    Source: diff --git a/docs/loader_GLTFExtensions.js.html b/docs/loader_GLTFExtensions.js.html index de80c261..6257f2c0 100644 --- a/docs/loader_GLTFExtensions.js.html +++ b/docs/loader_GLTFExtensions.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7944,7 +7948,7 @@

    Source: loa diff --git a/docs/loader_GLTFLoader.js.html b/docs/loader_GLTFLoader.js.html index 45a16c46..3a79f127 100644 --- a/docs/loader_GLTFLoader.js.html +++ b/docs/loader_GLTFLoader.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7624,7 +7628,7 @@

    Source: loader/ diff --git a/docs/loader_GLTFParser.js.html b/docs/loader_GLTFParser.js.html index ab41c05d..803a03b3 100644 --- a/docs/loader_GLTFParser.js.html +++ b/docs/loader_GLTFParser.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7865,7 +7869,7 @@

    Source: loader/ if (imgData && /^image\/(.*)$/.test(imgData.mimeType)) { type = RegExp.$1; } - if (!['ktx'].includes(type)) { + if (['ktx'].indexOf(type) < 0) { // clear type if type is not valid type = ''; } @@ -8762,7 +8766,7 @@

    Source: loader/ diff --git a/docs/loader_HDRLoader.js.html b/docs/loader_HDRLoader.js.html index 3ef811cb..527253b1 100644 --- a/docs/loader_HDRLoader.js.html +++ b/docs/loader_HDRLoader.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7617,7 +7621,7 @@

    Source: loader/H diff --git a/docs/loader_KTXLoader.js.html b/docs/loader_KTXLoader.js.html index c96705b3..fa391d68 100644 --- a/docs/loader_KTXLoader.js.html +++ b/docs/loader_KTXLoader.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7750,7 +7754,7 @@

    Source: loader/K diff --git a/docs/loader_LoadCache.js.html b/docs/loader_LoadCache.js.html index 830659ea..0a362a54 100644 --- a/docs/loader_LoadCache.js.html +++ b/docs/loader_LoadCache.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7629,7 +7633,7 @@

    Source: loader/L diff --git a/docs/loader_LoadQueue.js.html b/docs/loader_LoadQueue.js.html index 2577b42d..177a42a4 100644 --- a/docs/loader_LoadQueue.js.html +++ b/docs/loader_LoadQueue.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7772,7 +7776,7 @@

    Source: loader/L diff --git a/docs/loader_Loader.js.html b/docs/loader_Loader.js.html index 06798b45..9d6c67ce 100644 --- a/docs/loader_Loader.js.html +++ b/docs/loader_Loader.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7601,7 +7605,7 @@

    Source: loader/Load diff --git a/docs/loader_ShaderMaterialLoader.js.html b/docs/loader_ShaderMaterialLoader.js.html index eb4a6a59..f59777aa 100644 --- a/docs/loader_ShaderMaterialLoader.js.html +++ b/docs/loader_ShaderMaterialLoader.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7630,7 +7634,7 @@

    Sourc diff --git a/docs/loader_TextureLoader.js.html b/docs/loader_TextureLoader.js.html index 30a01884..d7ed76ba 100644 --- a/docs/loader_TextureLoader.js.html +++ b/docs/loader_TextureLoader.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7607,7 +7611,7 @@

    Source: load diff --git a/docs/log.html b/docs/log.html index 73e33aaa..b9a06d6e 100644 --- a/docs/log.html +++ b/docs/log.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8585,7 +8589,7 @@
    Returns:
    diff --git a/docs/material_BasicMaterial.js.html b/docs/material_BasicMaterial.js.html index d097af90..0c87da38 100644 --- a/docs/material_BasicMaterial.js.html +++ b/docs/material_BasicMaterial.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7696,7 +7700,7 @@

    Source: ma diff --git a/docs/material_GeometryMaterial.js.html b/docs/material_GeometryMaterial.js.html index 80b911b1..6b3a831d 100644 --- a/docs/material_GeometryMaterial.js.html +++ b/docs/material_GeometryMaterial.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7628,7 +7632,7 @@

    Source: diff --git a/docs/material_Material.js.html b/docs/material_Material.js.html index 2a53336a..2d3efce3 100644 --- a/docs/material_Material.js.html +++ b/docs/material_Material.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8343,7 +8347,7 @@

    Source: materia diff --git a/docs/material_PBRMaterial.js.html b/docs/material_PBRMaterial.js.html index e881b381..3ac9a9ad 100644 --- a/docs/material_PBRMaterial.js.html +++ b/docs/material_PBRMaterial.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7824,7 +7828,7 @@

    Source: mate diff --git a/docs/material_ShaderMaterial.js.html b/docs/material_ShaderMaterial.js.html index c96798e9..c16c79c0 100644 --- a/docs/material_ShaderMaterial.js.html +++ b/docs/material_ShaderMaterial.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7636,7 +7640,7 @@

    Source: m diff --git a/docs/material_semantic.js.html b/docs/material_semantic.js.html index ab43152a..a4e0e33d 100644 --- a/docs/material_semantic.js.html +++ b/docs/material_semantic.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8716,7 +8720,7 @@

    Source: materia diff --git a/docs/math.html b/docs/math.html index d8357940..b504a1b9 100644 --- a/docs/math.html +++ b/docs/math.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8782,7 +8786,7 @@
    Returns:
    diff --git a/docs/math_Color.js.html b/docs/math_Color.js.html index 532bdca7..a53bbb20 100644 --- a/docs/math_Color.js.html +++ b/docs/math_Color.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7686,7 +7690,7 @@

    Source: math/Color.js< diff --git a/docs/math_Euler.js.html b/docs/math_Euler.js.html index e46e47ea..241b9eb7 100644 --- a/docs/math_Euler.js.html +++ b/docs/math_Euler.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7853,7 +7857,7 @@

    Source: math/Euler.js< diff --git a/docs/math_EulerNotifier.js.html b/docs/math_EulerNotifier.js.html index 47ca21fa..d14e9776 100644 --- a/docs/math_EulerNotifier.js.html +++ b/docs/math_EulerNotifier.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7685,7 +7689,7 @@

    Source: math/E diff --git a/docs/math_Frustum.js.html b/docs/math_Frustum.js.html index 0af41e34..9b4b916c 100644 --- a/docs/math_Frustum.js.html +++ b/docs/math_Frustum.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7652,7 +7656,7 @@

    Source: math/Frustum diff --git a/docs/math_Matrix3.js.html b/docs/math_Matrix3.js.html index 4a8f4879..adef1989 100644 --- a/docs/math_Matrix3.js.html +++ b/docs/math_Matrix3.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7874,7 +7878,7 @@

    Source: math/Matrix3 diff --git a/docs/math_Matrix4.js.html b/docs/math_Matrix4.js.html index beb0bdad..5529d455 100644 --- a/docs/math_Matrix4.js.html +++ b/docs/math_Matrix4.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8185,7 +8189,7 @@

    Source: math/Matrix4 diff --git a/docs/math_Matrix4Notifier.js.html b/docs/math_Matrix4Notifier.js.html index ef6a92b6..b820f636 100644 --- a/docs/math_Matrix4Notifier.js.html +++ b/docs/math_Matrix4Notifier.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8192,7 +8196,7 @@

    Source: math diff --git a/docs/math_Plane.js.html b/docs/math_Plane.js.html index 029807d4..76eb15ca 100644 --- a/docs/math_Plane.js.html +++ b/docs/math_Plane.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7632,7 +7636,7 @@

    Source: math/Plane.js< diff --git a/docs/math_Quaternion.js.html b/docs/math_Quaternion.js.html index 9abc61ae..8b2945ef 100644 --- a/docs/math_Quaternion.js.html +++ b/docs/math_Quaternion.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8126,7 +8130,7 @@

    Source: math/Quat diff --git a/docs/math_Ray.js.html b/docs/math_Ray.js.html index eb7a755c..c055c8aa 100644 --- a/docs/math_Ray.js.html +++ b/docs/math_Ray.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7768,7 +7772,7 @@

    Source: math/Ray.js

    diff --git a/docs/math_Sphere.js.html b/docs/math_Sphere.js.html index d79c2966..034052e0 100644 --- a/docs/math_Sphere.js.html +++ b/docs/math_Sphere.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7645,7 +7649,7 @@

    Source: math/Sphere.j diff --git a/docs/math_SphericalHarmonics3.js.html b/docs/math_SphericalHarmonics3.js.html index 6038f07f..7aa01ac4 100644 --- a/docs/math_SphericalHarmonics3.js.html +++ b/docs/math_SphericalHarmonics3.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7668,7 +7672,7 @@

    Source: diff --git a/docs/math_Vector2.js.html b/docs/math_Vector2.js.html index 19ab464a..dd0255a2 100644 --- a/docs/math_Vector2.js.html +++ b/docs/math_Vector2.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7987,7 +7991,7 @@

    Source: math/Vector2 diff --git a/docs/math_Vector3.js.html b/docs/math_Vector3.js.html index 1cc82a9d..8addf7a0 100644 --- a/docs/math_Vector3.js.html +++ b/docs/math_Vector3.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8087,7 +8091,7 @@

    Source: math/Vector3 diff --git a/docs/math_Vector3Notifier.js.html b/docs/math_Vector3Notifier.js.html index c4360d77..f273fece 100644 --- a/docs/math_Vector3Notifier.js.html +++ b/docs/math_Vector3Notifier.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8084,7 +8088,7 @@

    Source: math diff --git a/docs/math_Vector4.js.html b/docs/math_Vector4.js.html index 66be5a7c..4b5e5722 100644 --- a/docs/math_Vector4.js.html +++ b/docs/math_Vector4.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8009,7 +8013,7 @@

    Source: math/Vector4 diff --git a/docs/math_math.js.html b/docs/math_math.js.html index 5b57f03f..e01228ec 100644 --- a/docs/math_math.js.html +++ b/docs/math_math.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7637,7 +7641,7 @@

    Source: math/math.js - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.4 diff --git a/docs/renderer_Buffer.js.html b/docs/renderer_Buffer.js.html index 373a9164..f392bbf5 100644 --- a/docs/renderer_Buffer.js.html +++ b/docs/renderer_Buffer.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7756,7 +7760,7 @@

    Source: renderer/ diff --git a/docs/renderer_Framebuffer.js.html b/docs/renderer_Framebuffer.js.html index 58b27eb0..c7913935 100644 --- a/docs/renderer_Framebuffer.js.html +++ b/docs/renderer_Framebuffer.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7986,7 +7990,7 @@

    Source: rend diff --git a/docs/renderer_Program.js.html b/docs/renderer_Program.js.html index 5479797b..14784fb3 100644 --- a/docs/renderer_Program.js.html +++ b/docs/renderer_Program.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7949,7 +7953,7 @@

    Source: renderer diff --git a/docs/renderer_RenderInfo.js.html b/docs/renderer_RenderInfo.js.html index fba93910..2fcde916 100644 --- a/docs/renderer_RenderInfo.js.html +++ b/docs/renderer_RenderInfo.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7617,7 +7621,7 @@

    Source: rende diff --git a/docs/renderer_RenderList.js.html b/docs/renderer_RenderList.js.html index 6275c791..ab435bc4 100644 --- a/docs/renderer_RenderList.js.html +++ b/docs/renderer_RenderList.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7714,7 +7718,7 @@

    Source: rende diff --git a/docs/renderer_VertexArrayObject.js.html b/docs/renderer_VertexArrayObject.js.html index 0281e1d9..5b8a5432 100644 --- a/docs/renderer_VertexArrayObject.js.html +++ b/docs/renderer_VertexArrayObject.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7966,7 +7970,7 @@

    Source diff --git a/docs/renderer_WebGLRenderer.js.html b/docs/renderer_WebGLRenderer.js.html index 87089e10..bbc454f1 100644 --- a/docs/renderer_WebGLRenderer.js.html +++ b/docs/renderer_WebGLRenderer.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8410,7 +8414,7 @@

    Source: re diff --git a/docs/renderer_WebGLResourceManager.js.html b/docs/renderer_WebGLResourceManager.js.html index cb7b9585..dcdde497 100644 --- a/docs/renderer_WebGLResourceManager.js.html +++ b/docs/renderer_WebGLResourceManager.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7658,7 +7662,7 @@

    Sou diff --git a/docs/renderer_WebGLState.js.html b/docs/renderer_WebGLState.js.html index 9d9b3d83..22c19099 100644 --- a/docs/renderer_WebGLState.js.html +++ b/docs/renderer_WebGLState.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7872,7 +7876,7 @@

    Source: rende diff --git a/docs/renderer_capabilities.js.html b/docs/renderer_capabilities.js.html index 3cd10a68..24771c9c 100644 --- a/docs/renderer_capabilities.js.html +++ b/docs/renderer_capabilities.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7690,7 +7694,7 @@

    Source: ren diff --git a/docs/renderer_extensions.js.html b/docs/renderer_extensions.js.html index 99e11fed..943f1a21 100644 --- a/docs/renderer_extensions.js.html +++ b/docs/renderer_extensions.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7672,7 +7676,7 @@

    Source: rende diff --git a/docs/renderer_glType.js.html b/docs/renderer_glType.js.html index 2daaf11d..20330a78 100644 --- a/docs/renderer_glType.js.html +++ b/docs/renderer_glType.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7717,7 +7721,7 @@

    Source: renderer/ diff --git a/docs/semantic.html b/docs/semantic.html index 4b964d3e..d39cdae1 100644 --- a/docs/semantic.html +++ b/docs/semantic.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -11584,7 +11588,7 @@

    diff --git a/docs/shader_Shader.js.html b/docs/shader_Shader.js.html index ef9d5cb6..bf39ad75 100644 --- a/docs/shader_Shader.js.html +++ b/docs/shader_Shader.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7940,7 +7944,7 @@

    Source: shader/Shad diff --git a/docs/texture_CubeTexture.js.html b/docs/texture_CubeTexture.js.html index d1af6a96..96ae08d3 100644 --- a/docs/texture_CubeTexture.js.html +++ b/docs/texture_CubeTexture.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7743,7 +7747,7 @@

    Source: textu diff --git a/docs/texture_DataTexture.js.html b/docs/texture_DataTexture.js.html index 5a2de7da..f61730f6 100644 --- a/docs/texture_DataTexture.js.html +++ b/docs/texture_DataTexture.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7671,7 +7675,7 @@

    Source: textu diff --git a/docs/texture_LazyTexture.js.html b/docs/texture_LazyTexture.js.html index 9760749a..b95c6a0d 100644 --- a/docs/texture_LazyTexture.js.html +++ b/docs/texture_LazyTexture.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7684,7 +7688,7 @@

    Source: textu diff --git a/docs/texture_Texture.js.html b/docs/texture_Texture.js.html index ceb18652..62b53af0 100644 --- a/docs/texture_Texture.js.html +++ b/docs/texture_Texture.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -8161,7 +8165,7 @@

    Source: texture/T diff --git a/docs/utils_Cache.js.html b/docs/utils_Cache.js.html index 37d38a1c..29e53ce1 100644 --- a/docs/utils_Cache.js.html +++ b/docs/utils_Cache.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7621,7 +7625,7 @@

    Source: utils/Cache.j diff --git a/docs/utils_MeshPicker.js.html b/docs/utils_MeshPicker.js.html index 4a2de628..3b527397 100644 --- a/docs/utils_MeshPicker.js.html +++ b/docs/utils_MeshPicker.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7678,7 +7682,7 @@

    Source: utils/Me diff --git a/docs/utils_Ticker.js.html b/docs/utils_Ticker.js.html index 1c11e418..6c4126db 100644 --- a/docs/utils_Ticker.js.html +++ b/docs/utils_Ticker.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7551,7 +7555,7 @@

    Source: utils/Ticker diff --git a/docs/utils_WebGLSupport.js.html b/docs/utils_WebGLSupport.js.html index cdbd6e25..c90dc0e5 100644 --- a/docs/utils_WebGLSupport.js.html +++ b/docs/utils_WebGLSupport.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7581,7 +7585,7 @@

    Source: utils/ diff --git a/docs/utils_log.js.html b/docs/utils_log.js.html index e200e956..e44bca3f 100644 --- a/docs/utils_log.js.html +++ b/docs/utils_log.js.html @@ -630,6 +630,8 @@

  • getType
  • +
  • registerStateHandler
  • +
  • findIndexByTime
  • getState
  • @@ -2298,6 +2300,8 @@

  • get
  • +
  • getCopy
  • +
  • set
  • getByOffset
  • @@ -7647,7 +7651,7 @@

    Source: utils/log.js - Documentation generated by JSDoc 3.6.3 + Documentation generated by JSDoc 3.6.4 diff --git a/package.json b/package.json index f2151910..fe9e8aa4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hilo3d", - "version": "1.13.47", + "version": "1.14.0", "description": "Hilo3d, a WebGL 3d engine.", "main": "build/Hilo3d.js", "types": "types/index.d.ts",