From a756fff95fe5b506a8d02f6c26c622b603dce610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Alves?= Date: Mon, 11 Sep 2023 22:26:59 +0100 Subject: [PATCH] Add dependencies --- .eslintignore | 2 + .eslintrc.cjs | 18 +++---- .prettierignore | 2 + package.json | 6 ++- public/bundle.js | 13 +++++ src/App.tsx | 14 ++--- src/main.tsx | 12 ++--- vite.config.ts | 6 +-- yarn.lock | 130 +++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 177 insertions(+), 26 deletions(-) create mode 100644 .eslintignore create mode 100644 .prettierignore create mode 100644 public/bundle.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..c523dda --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +node_modules +public \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d6c9537..6e8698b 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -2,17 +2,17 @@ module.exports = { root: true, env: { browser: true, es2020: true }, extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:react-hooks/recommended", ], - ignorePatterns: ['dist', '.eslintrc.cjs'], - parser: '@typescript-eslint/parser', - plugins: ['react-refresh'], + ignorePatterns: ["dist", ".eslintrc.cjs"], + parser: "@typescript-eslint/parser", + plugins: ["react-refresh"], rules: { - 'react-refresh/only-export-components': [ - 'warn', + "react-refresh/only-export-components": [ + "warn", { allowConstantExport: true }, ], }, -} +}; diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..c523dda --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +node_modules +public \ No newline at end of file diff --git a/package.json b/package.json index 4dc1251..4cdf1a0 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,16 @@ "preview": "vite preview" }, "dependencies": { + "@react-three/fiber": "^8.14.1", + "prettier": "^3.0.3", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "three": "^0.156.1" }, "devDependencies": { "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", + "@types/three": "^0.156.0", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", "@vitejs/plugin-react-swc": "^3.3.2", diff --git a/public/bundle.js b/public/bundle.js new file mode 100644 index 0000000..727895e --- /dev/null +++ b/public/bundle.js @@ -0,0 +1,13 @@ +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},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=3)}([function(t,e,n){"use strict";function r(){}n.r(e),n.d(e,"WebGLRenderTargetCube",function(){return ze}),n.d(e,"WebGLRenderTarget",function(){return Be}),n.d(e,"WebGLRenderer",function(){return Pi}),n.d(e,"ShaderLib",function(){return Dn}),n.d(e,"UniformsLib",function(){return On}),n.d(e,"UniformsUtils",function(){return Un}),n.d(e,"ShaderChunk",function(){return Nn}),n.d(e,"FogExp2",function(){return Ci}),n.d(e,"Fog",function(){return Ii}),n.d(e,"Scene",function(){return Oi}),n.d(e,"LensFlare",function(){return Ui}),n.d(e,"Sprite",function(){return Di}),n.d(e,"LOD",function(){return Fi}),n.d(e,"SkinnedMesh",function(){return Gi}),n.d(e,"Skeleton",function(){return Bi}),n.d(e,"Bone",function(){return zi}),n.d(e,"Mesh",function(){return Yr}),n.d(e,"LineSegments",function(){return ji}),n.d(e,"LineLoop",function(){return Vi}),n.d(e,"Line",function(){return ki}),n.d(e,"Points",function(){return Xi}),n.d(e,"Group",function(){return qi}),n.d(e,"VideoTexture",function(){return Yi}),n.d(e,"DataTexture",function(){return je}),n.d(e,"CompressedTexture",function(){return Zi}),n.d(e,"CubeTexture",function(){return Ve}),n.d(e,"CanvasTexture",function(){return Ji}),n.d(e,"DepthTexture",function(){return Ki}),n.d(e,"Texture",function(){return De}),n.d(e,"CompressedTextureLoader",function(){return $o}),n.d(e,"DataTextureLoader",function(){return ta}),n.d(e,"CubeTextureLoader",function(){return na}),n.d(e,"TextureLoader",function(){return ra}),n.d(e,"ObjectLoader",function(){return za}),n.d(e,"MaterialLoader",function(){return Pa}),n.d(e,"BufferGeometryLoader",function(){return Ca}),n.d(e,"DefaultLoadingManager",function(){return Ko}),n.d(e,"LoadingManager",function(){return Jo}),n.d(e,"JSONLoader",function(){return Ba}),n.d(e,"ImageLoader",function(){return ea}),n.d(e,"FontLoader",function(){return os}),n.d(e,"FileLoader",function(){return Qo}),n.d(e,"Loader",function(){return Fa}),n.d(e,"Cache",function(){return Zo}),n.d(e,"AudioLoader",function(){return Ts}),n.d(e,"SpotLightShadow",function(){return sa}),n.d(e,"SpotLight",function(){return ca}),n.d(e,"PointLight",function(){return ua}),n.d(e,"RectAreaLight",function(){return da}),n.d(e,"HemisphereLight",function(){return oa}),n.d(e,"DirectionalLightShadow",function(){return la}),n.d(e,"DirectionalLight",function(){return ha}),n.d(e,"AmbientLight",function(){return fa}),n.d(e,"LightShadow",function(){return aa}),n.d(e,"Light",function(){return ia}),n.d(e,"StereoCamera",function(){return Ss}),n.d(e,"PerspectiveCamera",function(){return pr}),n.d(e,"OrthographicCamera",function(){return dr}),n.d(e,"CubeCamera",function(){return As}),n.d(e,"ArrayCamera",function(){return Si}),n.d(e,"Camera",function(){return fr}),n.d(e,"AudioListener",function(){return Rs}),n.d(e,"PositionalAudio",function(){return Ps}),n.d(e,"AudioContext",function(){return Es}),n.d(e,"AudioAnalyser",function(){return Cs}),n.d(e,"Audio",function(){return Ls}),n.d(e,"VectorKeyframeTrack",function(){return ba}),n.d(e,"StringKeyframeTrack",function(){return Ta}),n.d(e,"QuaternionKeyframeTrack",function(){return Ma}),n.d(e,"NumberKeyframeTrack",function(){return Ea}),n.d(e,"ColorKeyframeTrack",function(){return Aa}),n.d(e,"BooleanKeyframeTrack",function(){return Sa}),n.d(e,"PropertyMixer",function(){return Is}),n.d(e,"PropertyBinding",function(){return Us}),n.d(e,"KeyframeTrack",function(){return Ra}),n.d(e,"AnimationUtils",function(){return ma}),n.d(e,"AnimationObjectGroup",function(){return Ns}),n.d(e,"AnimationMixer",function(){return Fs}),n.d(e,"AnimationClip",function(){return La}),n.d(e,"Uniform",function(){return Bs}),n.d(e,"InstancedBufferGeometry",function(){return zs}),n.d(e,"BufferGeometry",function(){return zr}),n.d(e,"GeometryIdCount",function(){return Tr}),n.d(e,"Geometry",function(){return Sr}),n.d(e,"InterleavedBufferAttribute",function(){return Gs}),n.d(e,"InstancedInterleavedBuffer",function(){return ks}),n.d(e,"InterleavedBuffer",function(){return Hs}),n.d(e,"InstancedBufferAttribute",function(){return js}),n.d(e,"Face3",function(){return mr}),n.d(e,"Object3D",function(){return hr}),n.d(e,"Raycaster",function(){return Vs}),n.d(e,"Layers",function(){return or}),n.d(e,"EventDispatcher",function(){return r}),n.d(e,"Clock",function(){return qs}),n.d(e,"QuaternionLinearInterpolant",function(){return wa}),n.d(e,"LinearInterpolant",function(){return ya}),n.d(e,"DiscreteInterpolant",function(){return xa}),n.d(e,"CubicInterpolant",function(){return va}),n.d(e,"Interpolant",function(){return ga}),n.d(e,"Triangle",function(){return qr}),n.d(e,"Math",function(){return Ae}),n.d(e,"Spherical",function(){return Ys}),n.d(e,"Cylindrical",function(){return Zs}),n.d(e,"Plane",function(){return tr}),n.d(e,"Frustum",function(){return er}),n.d(e,"Sphere",function(){return Qn}),n.d(e,"Ray",function(){return Wr}),n.d(e,"Matrix4",function(){return ke}),n.d(e,"Matrix3",function(){return $n}),n.d(e,"Box3",function(){return Kn}),n.d(e,"Box2",function(){return Fn}),n.d(e,"Line3",function(){return Xr}),n.d(e,"Euler",function(){return ir}),n.d(e,"Vector4",function(){return Fe}),n.d(e,"Vector3",function(){return He}),n.d(e,"Vector2",function(){return Re}),n.d(e,"Quaternion",function(){return Ge}),n.d(e,"Color",function(){return In}),n.d(e,"MorphBlendMesh",function(){return Js}),n.d(e,"ImmediateRenderObject",function(){return Ks}),n.d(e,"VertexNormalsHelper",function(){return Qs}),n.d(e,"SpotLightHelper",function(){return $s}),n.d(e,"SkeletonHelper",function(){return tc}),n.d(e,"PointLightHelper",function(){return ec}),n.d(e,"RectAreaLightHelper",function(){return nc}),n.d(e,"HemisphereLightHelper",function(){return rc}),n.d(e,"GridHelper",function(){return ic}),n.d(e,"PolarGridHelper",function(){return oc}),n.d(e,"FaceNormalsHelper",function(){return ac}),n.d(e,"DirectionalLightHelper",function(){return sc}),n.d(e,"CameraHelper",function(){return cc}),n.d(e,"BoxHelper",function(){return uc}),n.d(e,"ArrowHelper",function(){return lc}),n.d(e,"AxisHelper",function(){return hc}),n.d(e,"CatmullRomCurve3",function(){return vc}),n.d(e,"CubicBezierCurve3",function(){return yc}),n.d(e,"QuadraticBezierCurve3",function(){return xc}),n.d(e,"LineCurve3",function(){return _c}),n.d(e,"ArcCurve",function(){return bc}),n.d(e,"EllipseCurve",function(){return Za}),n.d(e,"SplineCurve",function(){return Ja}),n.d(e,"CubicBezierCurve",function(){return Ka}),n.d(e,"QuadraticBezierCurve",function(){return Qa}),n.d(e,"LineCurve",function(){return qa}),n.d(e,"Shape",function(){return ns}),n.d(e,"Path",function(){return es}),n.d(e,"ShapePath",function(){return rs}),n.d(e,"Font",function(){return is}),n.d(e,"CurvePath",function(){return Ya}),n.d(e,"Curve",function(){return Xa}),n.d(e,"ShapeUtils",function(){return yo}),n.d(e,"SceneUtils",function(){return wc}),n.d(e,"WireframeGeometry",function(){return Qi}),n.d(e,"ParametricGeometry",function(){return $i}),n.d(e,"ParametricBufferGeometry",function(){return to}),n.d(e,"TetrahedronGeometry",function(){return ro}),n.d(e,"TetrahedronBufferGeometry",function(){return io}),n.d(e,"OctahedronGeometry",function(){return oo}),n.d(e,"OctahedronBufferGeometry",function(){return ao}),n.d(e,"IcosahedronGeometry",function(){return so}),n.d(e,"IcosahedronBufferGeometry",function(){return co}),n.d(e,"DodecahedronGeometry",function(){return uo}),n.d(e,"DodecahedronBufferGeometry",function(){return lo}),n.d(e,"PolyhedronGeometry",function(){return eo}),n.d(e,"PolyhedronBufferGeometry",function(){return no}),n.d(e,"TubeGeometry",function(){return ho}),n.d(e,"TubeBufferGeometry",function(){return fo}),n.d(e,"TorusKnotGeometry",function(){return po}),n.d(e,"TorusKnotBufferGeometry",function(){return mo}),n.d(e,"TorusGeometry",function(){return go}),n.d(e,"TorusBufferGeometry",function(){return vo}),n.d(e,"TextGeometry",function(){return bo}),n.d(e,"TextBufferGeometry",function(){return wo}),n.d(e,"SphereGeometry",function(){return Mo}),n.d(e,"SphereBufferGeometry",function(){return Eo}),n.d(e,"RingGeometry",function(){return To}),n.d(e,"RingBufferGeometry",function(){return So}),n.d(e,"PlaneGeometry",function(){return kr}),n.d(e,"PlaneBufferGeometry",function(){return jr}),n.d(e,"LatheGeometry",function(){return Ao}),n.d(e,"LatheBufferGeometry",function(){return Ro}),n.d(e,"ShapeGeometry",function(){return Lo}),n.d(e,"ShapeBufferGeometry",function(){return Po}),n.d(e,"ExtrudeGeometry",function(){return xo}),n.d(e,"ExtrudeBufferGeometry",function(){return _o}),n.d(e,"EdgesGeometry",function(){return Co}),n.d(e,"ConeGeometry",function(){return Uo}),n.d(e,"ConeBufferGeometry",function(){return No}),n.d(e,"CylinderGeometry",function(){return Io}),n.d(e,"CylinderBufferGeometry",function(){return Oo}),n.d(e,"CircleGeometry",function(){return Do}),n.d(e,"CircleBufferGeometry",function(){return Fo}),n.d(e,"BoxGeometry",function(){return Gr}),n.d(e,"BoxBufferGeometry",function(){return Hr}),n.d(e,"ShadowMaterial",function(){return zo}),n.d(e,"SpriteMaterial",function(){return Ni}),n.d(e,"RawShaderMaterial",function(){return Go}),n.d(e,"ShaderMaterial",function(){return Zn}),n.d(e,"PointsMaterial",function(){return Wi}),n.d(e,"MeshPhysicalMaterial",function(){return ko}),n.d(e,"MeshStandardMaterial",function(){return Ho}),n.d(e,"MeshPhongMaterial",function(){return jo}),n.d(e,"MeshToonMaterial",function(){return Vo}),n.d(e,"MeshNormalMaterial",function(){return Wo}),n.d(e,"MeshLambertMaterial",function(){return Xo}),n.d(e,"MeshDepthMaterial",function(){return Jn}),n.d(e,"MeshBasicMaterial",function(){return Vr}),n.d(e,"LineDashedMaterial",function(){return qo}),n.d(e,"LineBasicMaterial",function(){return Hi}),n.d(e,"Material",function(){return Yn}),n.d(e,"Float64BufferAttribute",function(){return Dr}),n.d(e,"Float32BufferAttribute",function(){return Nr}),n.d(e,"Uint32BufferAttribute",function(){return Ur}),n.d(e,"Int32BufferAttribute",function(){return Or}),n.d(e,"Uint16BufferAttribute",function(){return Ir}),n.d(e,"Int16BufferAttribute",function(){return Cr}),n.d(e,"Uint8ClampedBufferAttribute",function(){return Pr}),n.d(e,"Uint8BufferAttribute",function(){return Lr}),n.d(e,"Int8BufferAttribute",function(){return Rr}),n.d(e,"BufferAttribute",function(){return Ar}),n.d(e,"REVISION",function(){return l}),n.d(e,"MOUSE",function(){return h}),n.d(e,"CullFaceNone",function(){return f}),n.d(e,"CullFaceBack",function(){return d}),n.d(e,"CullFaceFront",function(){return p}),n.d(e,"CullFaceFrontBack",function(){return m}),n.d(e,"FrontFaceDirectionCW",function(){return g}),n.d(e,"FrontFaceDirectionCCW",function(){return v}),n.d(e,"BasicShadowMap",function(){return y}),n.d(e,"PCFShadowMap",function(){return x}),n.d(e,"PCFSoftShadowMap",function(){return _}),n.d(e,"FrontSide",function(){return b}),n.d(e,"BackSide",function(){return w}),n.d(e,"DoubleSide",function(){return M}),n.d(e,"FlatShading",function(){return E}),n.d(e,"SmoothShading",function(){return T}),n.d(e,"NoColors",function(){return S}),n.d(e,"FaceColors",function(){return A}),n.d(e,"VertexColors",function(){return R}),n.d(e,"NoBlending",function(){return L}),n.d(e,"NormalBlending",function(){return P}),n.d(e,"AdditiveBlending",function(){return C}),n.d(e,"SubtractiveBlending",function(){return I}),n.d(e,"MultiplyBlending",function(){return O}),n.d(e,"CustomBlending",function(){return U}),n.d(e,"AddEquation",function(){return N}),n.d(e,"SubtractEquation",function(){return D}),n.d(e,"ReverseSubtractEquation",function(){return F}),n.d(e,"MinEquation",function(){return B}),n.d(e,"MaxEquation",function(){return z}),n.d(e,"ZeroFactor",function(){return G}),n.d(e,"OneFactor",function(){return H}),n.d(e,"SrcColorFactor",function(){return k}),n.d(e,"OneMinusSrcColorFactor",function(){return j}),n.d(e,"SrcAlphaFactor",function(){return V}),n.d(e,"OneMinusSrcAlphaFactor",function(){return W}),n.d(e,"DstAlphaFactor",function(){return X}),n.d(e,"OneMinusDstAlphaFactor",function(){return q}),n.d(e,"DstColorFactor",function(){return Y}),n.d(e,"OneMinusDstColorFactor",function(){return Z}),n.d(e,"SrcAlphaSaturateFactor",function(){return J}),n.d(e,"NeverDepth",function(){return K}),n.d(e,"AlwaysDepth",function(){return Q}),n.d(e,"LessDepth",function(){return $}),n.d(e,"LessEqualDepth",function(){return tt}),n.d(e,"EqualDepth",function(){return et}),n.d(e,"GreaterEqualDepth",function(){return nt}),n.d(e,"GreaterDepth",function(){return rt}),n.d(e,"NotEqualDepth",function(){return it}),n.d(e,"MultiplyOperation",function(){return ot}),n.d(e,"MixOperation",function(){return at}),n.d(e,"AddOperation",function(){return st}),n.d(e,"NoToneMapping",function(){return ct}),n.d(e,"LinearToneMapping",function(){return ut}),n.d(e,"ReinhardToneMapping",function(){return lt}),n.d(e,"Uncharted2ToneMapping",function(){return ht}),n.d(e,"CineonToneMapping",function(){return ft}),n.d(e,"UVMapping",function(){return dt}),n.d(e,"CubeReflectionMapping",function(){return pt}),n.d(e,"CubeRefractionMapping",function(){return mt}),n.d(e,"EquirectangularReflectionMapping",function(){return gt}),n.d(e,"EquirectangularRefractionMapping",function(){return vt}),n.d(e,"SphericalReflectionMapping",function(){return yt}),n.d(e,"CubeUVReflectionMapping",function(){return xt}),n.d(e,"CubeUVRefractionMapping",function(){return _t}),n.d(e,"RepeatWrapping",function(){return bt}),n.d(e,"ClampToEdgeWrapping",function(){return wt}),n.d(e,"MirroredRepeatWrapping",function(){return Mt}),n.d(e,"NearestFilter",function(){return Et}),n.d(e,"NearestMipMapNearestFilter",function(){return Tt}),n.d(e,"NearestMipMapLinearFilter",function(){return St}),n.d(e,"LinearFilter",function(){return At}),n.d(e,"LinearMipMapNearestFilter",function(){return Rt}),n.d(e,"LinearMipMapLinearFilter",function(){return Lt}),n.d(e,"UnsignedByteType",function(){return Pt}),n.d(e,"ByteType",function(){return Ct}),n.d(e,"ShortType",function(){return It}),n.d(e,"UnsignedShortType",function(){return Ot}),n.d(e,"IntType",function(){return Ut}),n.d(e,"UnsignedIntType",function(){return Nt}),n.d(e,"FloatType",function(){return Dt}),n.d(e,"HalfFloatType",function(){return Ft}),n.d(e,"UnsignedShort4444Type",function(){return Bt}),n.d(e,"UnsignedShort5551Type",function(){return zt}),n.d(e,"UnsignedShort565Type",function(){return Gt}),n.d(e,"UnsignedInt248Type",function(){return Ht}),n.d(e,"AlphaFormat",function(){return kt}),n.d(e,"RGBFormat",function(){return jt}),n.d(e,"RGBAFormat",function(){return Vt}),n.d(e,"LuminanceFormat",function(){return Wt}),n.d(e,"LuminanceAlphaFormat",function(){return Xt}),n.d(e,"RGBEFormat",function(){return qt}),n.d(e,"DepthFormat",function(){return Yt}),n.d(e,"DepthStencilFormat",function(){return Zt}),n.d(e,"RGB_S3TC_DXT1_Format",function(){return Jt}),n.d(e,"RGBA_S3TC_DXT1_Format",function(){return Kt}),n.d(e,"RGBA_S3TC_DXT3_Format",function(){return Qt}),n.d(e,"RGBA_S3TC_DXT5_Format",function(){return $t}),n.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return te}),n.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return ee}),n.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return ne}),n.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return re}),n.d(e,"RGB_ETC1_Format",function(){return ie}),n.d(e,"LoopOnce",function(){return oe}),n.d(e,"LoopRepeat",function(){return ae}),n.d(e,"LoopPingPong",function(){return se}),n.d(e,"InterpolateDiscrete",function(){return ce}),n.d(e,"InterpolateLinear",function(){return ue}),n.d(e,"InterpolateSmooth",function(){return le}),n.d(e,"ZeroCurvatureEnding",function(){return he}),n.d(e,"ZeroSlopeEnding",function(){return fe}),n.d(e,"WrapAroundEnding",function(){return de}),n.d(e,"TrianglesDrawMode",function(){return pe}),n.d(e,"TriangleStripDrawMode",function(){return me}),n.d(e,"TriangleFanDrawMode",function(){return ge}),n.d(e,"LinearEncoding",function(){return ve}),n.d(e,"sRGBEncoding",function(){return ye}),n.d(e,"GammaEncoding",function(){return xe}),n.d(e,"RGBEEncoding",function(){return _e}),n.d(e,"LogLuvEncoding",function(){return be}),n.d(e,"RGBM7Encoding",function(){return we}),n.d(e,"RGBM16Encoding",function(){return Me}),n.d(e,"RGBDEncoding",function(){return Ee}),n.d(e,"BasicDepthPacking",function(){return Te}),n.d(e,"RGBADepthPacking",function(){return Se}),n.d(e,"CubeGeometry",function(){return Gr}),n.d(e,"Face4",function(){return Mc}),n.d(e,"LineStrip",function(){return Ec}),n.d(e,"LinePieces",function(){return Tc}),n.d(e,"MeshFaceMaterial",function(){return Sc}),n.d(e,"MultiMaterial",function(){return Ac}),n.d(e,"PointCloud",function(){return Rc}),n.d(e,"Particle",function(){return Lc}),n.d(e,"ParticleSystem",function(){return Pc}),n.d(e,"PointCloudMaterial",function(){return Cc}),n.d(e,"ParticleBasicMaterial",function(){return Ic}),n.d(e,"ParticleSystemMaterial",function(){return Oc}),n.d(e,"Vertex",function(){return Uc}),n.d(e,"DynamicBufferAttribute",function(){return Nc}),n.d(e,"Int8Attribute",function(){return Dc}),n.d(e,"Uint8Attribute",function(){return Fc}),n.d(e,"Uint8ClampedAttribute",function(){return Bc}),n.d(e,"Int16Attribute",function(){return zc}),n.d(e,"Uint16Attribute",function(){return Gc}),n.d(e,"Int32Attribute",function(){return Hc}),n.d(e,"Uint32Attribute",function(){return kc}),n.d(e,"Float32Attribute",function(){return jc}),n.d(e,"Float64Attribute",function(){return Vc}),n.d(e,"ClosedSplineCurve3",function(){return Wc}),n.d(e,"SplineCurve3",function(){return Xc}),n.d(e,"Spline",function(){return qc}),n.d(e,"BoundingBoxHelper",function(){return Yc}),n.d(e,"EdgesHelper",function(){return Zc}),n.d(e,"WireframeHelper",function(){return Jc}),n.d(e,"XHRLoader",function(){return Kc}),n.d(e,"BinaryTextureLoader",function(){return Qc}),n.d(e,"GeometryUtils",function(){return $c}),n.d(e,"ImageUtils",function(){return tu}),n.d(e,"Projector",function(){return eu}),n.d(e,"CanvasRenderer",function(){return nu}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),void 0===Function.prototype.name&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n>=4,a[t]=o[19===t?3&i|8:i]);return a.join("")}),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Ae.DEG2RAD},radToDeg:function(t){return t*Ae.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}};function Re(t,e){this.x=t||0,this.y=e||0}Object.defineProperties(Re.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(Re.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:(c=new Re,u=new Re,function(t,e){return c.set(t,t),u.set(e,e),this.clamp(c,u)}),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*n-o*r+t.x,this.y=i*r+o*n+t.y,this}});var Le,Pe,Ce,Ie,Oe,Ue,Ne=0;function De(t,e,n,r,i,o,a,s,c,u){Object.defineProperty(this,"id",{value:Ne++}),this.uuid=Ae.generateUUID(),this.name="",this.image=void 0!==t?t:De.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:De.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:wt,this.wrapT=void 0!==r?r:wt,this.magFilter=void 0!==i?i:At,this.minFilter=void 0!==o?o:Lt,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:Vt,this.type=void 0!==s?s:Pt,this.offset=new Re(0,0),this.repeat=new Re(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:ve,this.version=0,this.onUpdate=null}function Fe(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function Be(t,e,n){this.uuid=Ae.generateUUID(),this.width=t,this.height=e,this.scissor=new Fe(0,0,t,e),this.scissorTest=!1,this.viewport=new Fe(0,0,t,e),void 0===(n=n||{}).minFilter&&(n.minFilter=At),this.texture=new De(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function ze(t,e,n){Be.call(this,t,e,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function Ge(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}function He(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function ke(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function je(t,e,n,r,i,o,a,s,c,u,l,h){De.call(this,null,o,a,s,c,u,r,i,l,h),this.image={data:t,width:e,height:n},this.magFilter=void 0!==c?c:Et,this.minFilter=void 0!==u?u:Et,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Ve(t,e,n,r,i,o,a,s,c,u){t=void 0!==t?t:[],e=void 0!==e?e:pt,De.call(this,t,e,n,r,i,o,a,s,c,u),this.flipY=!1}De.DEFAULT_IMAGE=void 0,De.DEFAULT_MAPPING=dt,Object.defineProperty(De.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(De.prototype,r.prototype,{constructor:De,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var e={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var n=this.image;void 0===n.uuid&&(n.uuid=Ae.generateUUID()),void 0===t.images[n.uuid]&&(t.images[n.uuid]={uuid:n.uuid,url:function(t){var e;return void 0!==t.toDataURL?e=t:((e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0,t.width,t.height)),e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}(n)}),e.image=n.uuid}return t.textures[this.uuid]=e,e},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===dt){if(t.multiply(this.repeat),t.add(this.offset),t.x<0||t.x>1)switch(this.wrapS){case bt:t.x=t.x-Math.floor(t.x);break;case wt:t.x=t.x<0?0:1;break;case Mt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case bt:t.y=t.y-Math.floor(t.y);break;case wt:t.y=t.y<0?0:1;break;case Mt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}}),Object.assign(Fe.prototype,{isVector4:!0,set:function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*e+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*e+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*e+o[7]*n+o[11]*r+o[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,r,i,o=t.elements,a=o[0],s=o[4],c=o[8],u=o[1],l=o[5],h=o[9],f=o[2],d=o[6],p=o[10];if(Math.abs(s-u)<.01&&Math.abs(c-f)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+u)<.1&&Math.abs(c+f)<.1&&Math.abs(h+d)<.1&&Math.abs(a+l+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,g=(l+1)/2,v=(p+1)/2,y=(s+u)/4,x=(c+f)/4,_=(h+d)/4;return m>g&&m>v?m<.01?(n=0,r=.707106781,i=.707106781):(r=y/(n=Math.sqrt(m)),i=x/n):g>v?g<.01?(n=.707106781,r=0,i=.707106781):(n=y/(r=Math.sqrt(g)),i=_/r):v<.01?(n=.707106781,r=.707106781,i=0):(n=x/(i=Math.sqrt(v)),r=_/i),this.set(n,r,i,e),this}var b=Math.sqrt((d-h)*(d-h)+(c-f)*(c-f)+(u-s)*(u-s));return Math.abs(b)<.001&&(b=1),this.x=(d-h)/b,this.y=(c-f)/b,this.z=(u-s)/b,this.w=Math.acos((a+l+p-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(n,r){return void 0===t&&(t=new Fe,e=new Fe),t.set(n,n,n,n),e.set(r,r,r,r),this.clamp(t,e)}}(),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),Object.assign(Be.prototype,r.prototype,{isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ze.prototype=Object.create(Be.prototype),ze.prototype.constructor=ze,ze.prototype.isWebGLRenderTargetCube=!0,Object.assign(Ge,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,i,o,a){var s=n[r+0],c=n[r+1],u=n[r+2],l=n[r+3],h=i[o+0],f=i[o+1],d=i[o+2],p=i[o+3];if(l!==p||s!==h||c!==f||u!==d){var m=1-a,g=s*h+c*f+u*d+l*p,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,g*v);m=Math.sin(m*_)/x,a=Math.sin(a*_)/x}var b=a*v;if(s=s*m+h*b,c=c*m+f*b,u=u*m+d*b,l=l*m+p*b,m===1-a){var w=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=w,c*=w,u*=w,l*=w}}t[e]=s,t[e+1]=c,t[e+2]=u,t[e+3]=l}}),Object.defineProperties(Ge.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(Ge.prototype,{set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,i=t._z,o=t.order,a=Math.cos,s=Math.sin,c=a(n/2),u=a(r/2),l=a(i/2),h=s(n/2),f=s(r/2),d=s(i/2);return"XYZ"===o?(this._x=h*u*l+c*f*d,this._y=c*f*l-h*u*d,this._z=c*u*d+h*f*l,this._w=c*u*l-h*f*d):"YXZ"===o?(this._x=h*u*l+c*f*d,this._y=c*f*l-h*u*d,this._z=c*u*d-h*f*l,this._w=c*u*l+h*f*d):"ZXY"===o?(this._x=h*u*l-c*f*d,this._y=c*f*l+h*u*d,this._z=c*u*d+h*f*l,this._w=c*u*l-h*f*d):"ZYX"===o?(this._x=h*u*l-c*f*d,this._y=c*f*l+h*u*d,this._z=c*u*d-h*f*l,this._w=c*u*l+h*f*d):"YZX"===o?(this._x=h*u*l+c*f*d,this._y=c*f*l+h*u*d,this._z=c*u*d-h*f*l,this._w=c*u*l-h*f*d):"XZY"===o&&(this._x=h*u*l-c*f*d,this._y=c*f*l-h*u*d,this._z=c*u*d+h*f*l,this._w=c*u*l+h*f*d),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],c=n[9],u=n[2],l=n[6],h=n[10],f=r+s+h;return f>0?(e=.5/Math.sqrt(f+1),this._w=.25/e,this._x=(l-c)*e,this._y=(o-u)*e,this._z=(a-i)*e):r>s&&r>h?(e=2*Math.sqrt(1+r-s-h),this._w=(l-c)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+u)/e):s>h?(e=2*Math.sqrt(1+s-r-h),this._w=(o-u)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+h-r-s),this._w=(a-i)/e,this._x=(o+u)/e,this._y=(c+l)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e=new He;return function(n,r){return void 0===e&&(e=new He),(t=n.dot(r)+1)<1e-6?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,r),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,r=t._y,i=t._z,o=t._w,a=e._x,s=e._y,c=e._z,u=e._w;return this._x=n*u+o*a+r*c-i*s,this._y=r*u+o*s+i*a-n*c,this._z=i*u+o*c+n*s-r*a,this._w=o*u-n*a-r*s-i*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*t._w+n*t._x+r*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(n+this._x),this._y=.5*(r+this._y),this._z=.5*(i+this._z),this;var c=Math.atan2(s,a),u=Math.sin((1-e)*c)/s,l=Math.sin(e*c)/s;return this._w=o*u+this._w*l,this._x=n*u+this._x*l,this._y=r*u+this._y*l,this._z=i*u+this._z*l,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(He.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:(Ce=new Ge,function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ce.setFromEuler(t))}),applyAxisAngle:function(){var t=new Ge;return function(e,n){return this.applyQuaternion(t.setFromAxisAngle(e,n))}}(),applyMatrix3:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*r-a*n,u=s*n+a*e-i*r,l=s*r+i*n-o*e,h=-i*e-o*n-a*r;return this.x=c*s+h*-i+u*-a-l*-o,this.y=u*s+h*-o+l*-i-c*-a,this.z=l*s+h*-a+c*-o-u*-i,this},project:(Pe=new ke,function(t){return Pe.multiplyMatrices(t.projectionMatrix,Pe.getInverse(t.matrixWorld)),this.applyMatrix4(Pe)}),unproject:function(){var t=new ke;return function(e){return t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyMatrix4(t)}}(),transformDirection:function(t){var e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t=new He,e=new He;return function(n,r){return t.set(n,n,n),e.set(r,r,r),this.clamp(t,e)}}(),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var n=this.x,r=this.y,i=this.z;return this.x=r*t.z-i*t.y,this.y=i*t.x-n*t.z,this.z=n*t.y-r*t.x,this},crossVectors:function(t,e){var n=t.x,r=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:(Le=new He,function(t){return Le.copy(this).projectOnVector(t),this.sub(Le)}),reflect:function(){var t=new He;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Ae.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromCylindrical:function(t){return this.x=t.radius*Math.sin(t.theta),this.y=t.y,this.z=t.radius*Math.cos(t.theta),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(ke.prototype,{isMatrix4:!0,set:function(t,e,n,r,i,o,a,s,c,u,l,h,f,d,p,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=u,g[10]=l,g[14]=h,g[3]=f,g[7]=d,g[11]=p,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new ke).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(){var t=new He;return function(e){var n=this.elements,r=e.elements,i=1/t.setFromMatrixColumn(e,0).length(),o=1/t.setFromMatrixColumn(e,1).length(),a=1/t.setFromMatrixColumn(e,2).length();return n[0]=r[0]*i,n[1]=r[1]*i,n[2]=r[2]*i,n[4]=r[4]*o,n[5]=r[5]*o,n[6]=r[6]*o,n[8]=r[8]*a,n[9]=r[9]*a,n[10]=r[10]*a,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,i=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),c=Math.sin(r),u=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var h=o*u,f=o*l,d=a*u,p=a*l;e[0]=s*u,e[4]=-s*l,e[8]=c,e[1]=f+d*c,e[5]=h-p*c,e[9]=-a*s,e[2]=p-h*c,e[6]=d+f*c,e[10]=o*s}else if("YXZ"===t.order){var m=s*u,g=s*l,v=c*u,y=c*l;e[0]=m+y*a,e[4]=v*a-g,e[8]=o*c,e[1]=o*l,e[5]=o*u,e[9]=-a,e[2]=g*a-v,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*u,g=s*l,v=c*u,y=c*l;e[0]=m-y*a,e[4]=-o*l,e[8]=v+g*a,e[1]=g+v*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){h=o*u,f=o*l,d=a*u,p=a*l;e[0]=s*u,e[4]=d*c-f,e[8]=h*c+p,e[1]=s*l,e[5]=p*c+h,e[9]=f*c-d,e[2]=-c,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var x=o*s,_=o*c,b=a*s,w=a*c;e[0]=s*u,e[4]=w-x*l,e[8]=b*l+_,e[1]=l,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=_*l+b,e[10]=x-w*l}else if("XZY"===t.order){x=o*s,_=o*c,b=a*s,w=a*c;e[0]=s*u,e[4]=-l,e[8]=c*u,e[1]=x*l+w,e[5]=o*u,e[9]=_*l-b,e[2]=b*l-_,e[6]=a*u,e[10]=w*l+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,n=t._x,r=t._y,i=t._z,o=t._w,a=n+n,s=r+r,c=i+i,u=n*a,l=n*s,h=n*c,f=r*s,d=r*c,p=i*c,m=o*a,g=o*s,v=o*c;return e[0]=1-(f+p),e[4]=l-v,e[8]=h+g,e[1]=l+v,e[5]=1-(u+p),e[9]=d-m,e[2]=h-g,e[6]=d+m,e[10]=1-(u+f),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:(Ie=new He,Oe=new He,Ue=new He,function(t,e,n){var r=this.elements;return Ue.subVectors(t,e),0===Ue.lengthSq()&&(Ue.z=1),Ue.normalize(),Ie.crossVectors(n,Ue),0===Ie.lengthSq()&&(1===Math.abs(n.z)?Ue.x+=1e-4:Ue.z+=1e-4,Ue.normalize(),Ie.crossVectors(n,Ue)),Ie.normalize(),Oe.crossVectors(Ue,Ie),r[0]=Ie.x,r[4]=Oe.x,r[8]=Ue.x,r[1]=Ie.y,r[5]=Oe.y,r[9]=Ue.y,r[2]=Ie.z,r[6]=Oe.z,r[10]=Ue.z,this}),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,r=e.elements,i=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],u=n[1],l=n[5],h=n[9],f=n[13],d=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=r[0],w=r[4],M=r[8],E=r[12],T=r[1],S=r[5],A=r[9],R=r[13],L=r[2],P=r[6],C=r[10],I=r[14],O=r[3],U=r[7],N=r[11],D=r[15];return i[0]=o*b+a*T+s*L+c*O,i[4]=o*w+a*S+s*P+c*U,i[8]=o*M+a*A+s*C+c*N,i[12]=o*E+a*R+s*I+c*D,i[1]=u*b+l*T+h*L+f*O,i[5]=u*w+l*S+h*P+f*U,i[9]=u*M+l*A+h*C+f*N,i[13]=u*E+l*R+h*I+f*D,i[2]=d*b+p*T+m*L+g*O,i[6]=d*w+p*S+m*P+g*U,i[10]=d*M+p*A+m*C+g*N,i[14]=d*E+p*R+m*I+g*D,i[3]=v*b+y*T+x*L+_*O,i[7]=v*w+y*S+x*P+_*U,i[11]=v*M+y*A+x*C+_*N,i[15]=v*E+y*R+x*I+_*D,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t=new He;return function(e){for(var n=0,r=e.count;n0)return t;var i=e*n,o=Ye[i];if(void 0===o&&(o=new Float32Array(i),Ye[i]=o),0!==e){r.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function $e(t,e){var n=Ze[e];void 0===n&&(n=new Int32Array(e),Ze[e]=n);for(var r=0;r!==e;++r)n[r]=t.allocTextureUnit();return n}function tn(t,e){t.uniform1f(this.addr,e)}function en(t,e){t.uniform1i(this.addr,e)}function nn(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)}function rn(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)}function on(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function an(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)}function sn(t,e){void 0===e.elements?t.uniformMatrix3fv(this.addr,!1,e):(Ke.set(e.elements),t.uniformMatrix3fv(this.addr,!1,Ke))}function cn(t,e){void 0===e.elements?t.uniformMatrix4fv(this.addr,!1,e):(Je.set(e.elements),t.uniformMatrix4fv(this.addr,!1,Je))}function un(t,e,n){var r=n.allocTextureUnit();t.uniform1i(this.addr,r),n.setTexture2D(e||We,r)}function ln(t,e,n){var r=n.allocTextureUnit();t.uniform1i(this.addr,r),n.setTextureCube(e||Xe,r)}function hn(t,e){t.uniform2iv(this.addr,e)}function fn(t,e){t.uniform3iv(this.addr,e)}function dn(t,e){t.uniform4iv(this.addr,e)}function pn(t,e){t.uniform1fv(this.addr,e)}function mn(t,e){t.uniform1iv(this.addr,e)}function gn(t,e){t.uniform2fv(this.addr,Qe(e,this.size,2))}function vn(t,e){t.uniform3fv(this.addr,Qe(e,this.size,3))}function yn(t,e){t.uniform4fv(this.addr,Qe(e,this.size,4))}function xn(t,e){t.uniformMatrix2fv(this.addr,!1,Qe(e,this.size,4))}function _n(t,e){t.uniformMatrix3fv(this.addr,!1,Qe(e,this.size,9))}function bn(t,e){t.uniformMatrix4fv(this.addr,!1,Qe(e,this.size,16))}function wn(t,e,n){var r=e.length,i=$e(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.setTexture2D(e[o]||We,i[o])}function Mn(t,e,n){var r=e.length,i=$e(n,r);t.uniform1iv(this.addr,i);for(var o=0;o!==r;++o)n.setTextureCube(e[o]||Xe,i[o])}function En(t,e,n){this.id=t,this.addr=n,this.setValue=function(t){switch(t){case 5126:return tn;case 35664:return nn;case 35665:return rn;case 35666:return on;case 35674:return an;case 35675:return sn;case 35676:return cn;case 35678:case 36198:return un;case 35680:return ln;case 5124:case 35670:return en;case 35667:case 35671:return hn;case 35668:case 35672:return fn;case 35669:case 35673:return dn}}(e.type)}function Tn(t,e,n){this.id=t,this.addr=n,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return pn;case 35664:return gn;case 35665:return vn;case 35666:return yn;case 35674:return xn;case 35675:return _n;case 35676:return bn;case 35678:return wn;case 35680:return Mn;case 5124:case 35670:return mn;case 35667:case 35671:return hn;case 35668:case 35672:return fn;case 35669:case 35673:return dn}}(e.type)}function Sn(t){this.id=t,qe.call(this)}Sn.prototype.setValue=function(t,e){for(var n=this.seq,r=0,i=n.length;r!==i;++r){var o=n[r];o.setValue(t,e[o.id])}};var An=/([\w\d_]+)(\])?(\[|\.)?/g;function Rn(t,e){t.seq.push(e),t.map[e.id]=e}function Ln(t,e,n){var r=t.name,i=r.length;for(An.lastIndex=0;;){var o=An.exec(r),a=An.lastIndex,s=o[1],c="]"===o[2],u=o[3];if(c&&(s|=0),void 0===u||"["===u&&a+2===i){Rn(n,void 0===u?new En(s,t,e):new Tn(s,t,e));break}var l=n.map[s];void 0===l&&Rn(n,l=new Sn(s)),n=l}}function Pn(t,e,n){qe.call(this),this.renderer=n;for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=0;i>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(){function t(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}return function(e,n,r){if(e=Ae.euclideanModulo(e,1),n=Ae.clamp(n,0,1),r=Ae.clamp(r,0,1),0===n)this.r=this.g=this.b=r;else{var i=r<=.5?r*(1+n):r+n-r*n,o=2*r-i;this.r=t(o,i,e+1/3),this.g=t(o,i,e),this.b=t(o,i,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(a,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u,l=(u=n[1]).length;if(3===l)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}t&&t.length>0&&(void 0!==(u=Cn[t])?this.setHex(u):console.warn("THREE.Color: Unknown color "+t));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(){var t=this.r,e=this.g,n=this.b;return this.r=t*t,this.g=e*e,this.b=n*n,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){var e,n,r=t||{h:0,s:0,l:0},i=this.r,o=this.g,a=this.b,s=Math.max(i,o,a),c=Math.min(i,o,a),u=(c+s)/2;if(c===s)e=0,n=0;else{var l=s-c;switch(n=u<=.5?l/(s+c):l/(2-s-c),s){case i:e=(o-a)/l+(o 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = asin( flipNormal * reflectVec.y ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_template:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_flip:"#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",normal_fragment:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",distanceRGBA_frag:"uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include \n#include \n#include \nvoid main () {\n\t#include \n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",distanceRGBA_vert:"varying vec4 vWorldPosition;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",shadow_frag:"uniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n",shadow_vert:"#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n}\n"},Dn={basic:{uniforms:Un.merge([On.common,On.aomap,On.lightmap,On.fog]),vertexShader:Nn.meshbasic_vert,fragmentShader:Nn.meshbasic_frag},lambert:{uniforms:Un.merge([On.common,On.aomap,On.lightmap,On.emissivemap,On.fog,On.lights,{emissive:{value:new In(0)}}]),vertexShader:Nn.meshlambert_vert,fragmentShader:Nn.meshlambert_frag},phong:{uniforms:Un.merge([On.common,On.aomap,On.lightmap,On.emissivemap,On.bumpmap,On.normalmap,On.displacementmap,On.gradientmap,On.fog,On.lights,{emissive:{value:new In(0)},specular:{value:new In(1118481)},shininess:{value:30}}]),vertexShader:Nn.meshphong_vert,fragmentShader:Nn.meshphong_frag},standard:{uniforms:Un.merge([On.common,On.aomap,On.lightmap,On.emissivemap,On.bumpmap,On.normalmap,On.displacementmap,On.roughnessmap,On.metalnessmap,On.fog,On.lights,{emissive:{value:new In(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Nn.meshphysical_vert,fragmentShader:Nn.meshphysical_frag},points:{uniforms:Un.merge([On.points,On.fog]),vertexShader:Nn.points_vert,fragmentShader:Nn.points_frag},dashed:{uniforms:Un.merge([On.common,On.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Nn.linedashed_vert,fragmentShader:Nn.linedashed_frag},depth:{uniforms:Un.merge([On.common,On.displacementmap]),vertexShader:Nn.depth_vert,fragmentShader:Nn.depth_frag},normal:{uniforms:Un.merge([On.common,On.bumpmap,On.normalmap,On.displacementmap,{opacity:{value:1}}]),vertexShader:Nn.normal_vert,fragmentShader:Nn.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Nn.cube_vert,fragmentShader:Nn.cube_frag},equirect:{uniforms:{tEquirect:{value:null},tFlip:{value:-1}},vertexShader:Nn.equirect_vert,fragmentShader:Nn.equirect_frag},distanceRGBA:{uniforms:{lightPos:{value:new He}},vertexShader:Nn.distanceRGBA_vert,fragmentShader:Nn.distanceRGBA_frag}};function Fn(t,e){this.min=void 0!==t?t:new Re(1/0,1/0),this.max=void 0!==e?e:new Re(-1/0,-1/0)}function Bn(t,e){var n,r,i,o,a,s,c,u,l=t.context,h=t.state;function f(){var e=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),f=new Uint16Array([0,1,2,0,2,3]);n=l.createBuffer(),r=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,n),l.bufferData(l.ARRAY_BUFFER,e,l.STATIC_DRAW),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,r),l.bufferData(l.ELEMENT_ARRAY_BUFFER,f,l.STATIC_DRAW),c=l.createTexture(),u=l.createTexture(),h.bindTexture(l.TEXTURE_2D,c),l.texImage2D(l.TEXTURE_2D,0,l.RGB,16,16,0,l.RGB,l.UNSIGNED_BYTE,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),h.bindTexture(l.TEXTURE_2D,u),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,16,16,0,l.RGBA,l.UNSIGNED_BYTE,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),i={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},o=function(e){var n=l.createProgram(),r=l.createShader(l.FRAGMENT_SHADER),i=l.createShader(l.VERTEX_SHADER),o="precision "+t.getPrecision()+" float;\n";return l.shaderSource(r,o+e.fragmentShader),l.shaderSource(i,o+e.vertexShader),l.compileShader(r),l.compileShader(i),l.attachShader(n,r),l.attachShader(n,i),l.linkProgram(n),n}(i),a={vertex:l.getAttribLocation(o,"position"),uv:l.getAttribLocation(o,"uv")},s={renderType:l.getUniformLocation(o,"renderType"),map:l.getUniformLocation(o,"map"),occlusionMap:l.getUniformLocation(o,"occlusionMap"),opacity:l.getUniformLocation(o,"opacity"),color:l.getUniformLocation(o,"color"),scale:l.getUniformLocation(o,"scale"),rotation:l.getUniformLocation(o,"rotation"),screenPosition:l.getUniformLocation(o,"screenPosition")}}this.render=function(i,d,p){if(0!==e.length){var m=new He,g=p.w/p.z,v=.5*p.z,y=.5*p.w,x=16/p.w,_=new Re(x*g,x),b=new He(1,1,0),w=new Re(1,1),M=new Fn;M.min.set(p.x,p.y),M.max.set(p.x+(p.z-16),p.y+(p.w-16)),void 0===o&&f(),l.useProgram(o),h.initAttributes(),h.enableAttribute(a.vertex),h.enableAttribute(a.uv),h.disableUnusedAttributes(),l.uniform1i(s.occlusionMap,0),l.uniform1i(s.map,1),l.bindBuffer(l.ARRAY_BUFFER,n),l.vertexAttribPointer(a.vertex,2,l.FLOAT,!1,16,0),l.vertexAttribPointer(a.uv,2,l.FLOAT,!1,16,8),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,r),h.disable(l.CULL_FACE),h.buffers.depth.setMask(!1);for(var E=0,T=e.length;E.001&&L.scale>.001&&(b.x=L.x,b.y=L.y,b.z=L.z,x=L.size*L.scale/p.w,_.x=x*g,_.y=x,l.uniform3f(s.screenPosition,b.x,b.y,b.z),l.uniform2f(s.scale,_.x,_.y),l.uniform1f(s.rotation,L.rotation),l.uniform1f(s.opacity,L.opacity),l.uniform3f(s.color,L.color.r,L.color.g,L.color.b),h.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst),t.setTexture2D(L.texture,1),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0))}}}h.enable(l.CULL_FACE),h.enable(l.DEPTH_TEST),h.buffers.depth.setMask(!0),t.resetGLState()}}}function zn(t,e){var n,r,i,o,a,s,c=t.context,u=t.state,l=new He,h=new Ge,f=new He;function d(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),u=new Uint16Array([0,1,2,0,2,3]);n=c.createBuffer(),r=c.createBuffer(),c.bindBuffer(c.ARRAY_BUFFER,n),c.bufferData(c.ARRAY_BUFFER,e,c.STATIC_DRAW),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,r),c.bufferData(c.ELEMENT_ARRAY_BUFFER,u,c.STATIC_DRAW),i=function(){var e=c.createProgram(),n=c.createShader(c.VERTEX_SHADER),r=c.createShader(c.FRAGMENT_SHADER);return c.shaderSource(n,["precision "+t.getPrecision()+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),c.shaderSource(r,["precision "+t.getPrecision()+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),c.compileShader(n),c.compileShader(r),c.attachShader(e,n),c.attachShader(e,r),c.linkProgram(e),e}(),o={position:c.getAttribLocation(i,"position"),uv:c.getAttribLocation(i,"uv")},a={uvOffset:c.getUniformLocation(i,"uvOffset"),uvScale:c.getUniformLocation(i,"uvScale"),rotation:c.getUniformLocation(i,"rotation"),scale:c.getUniformLocation(i,"scale"),color:c.getUniformLocation(i,"color"),map:c.getUniformLocation(i,"map"),opacity:c.getUniformLocation(i,"opacity"),modelViewMatrix:c.getUniformLocation(i,"modelViewMatrix"),projectionMatrix:c.getUniformLocation(i,"projectionMatrix"),fogType:c.getUniformLocation(i,"fogType"),fogDensity:c.getUniformLocation(i,"fogDensity"),fogNear:c.getUniformLocation(i,"fogNear"),fogFar:c.getUniformLocation(i,"fogFar"),fogColor:c.getUniformLocation(i,"fogColor"),alphaTest:c.getUniformLocation(i,"alphaTest")};var l=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");l.width=8,l.height=8;var h=l.getContext("2d");h.fillStyle="white",h.fillRect(0,0,8,8),(s=new De(l)).needsUpdate=!0}function p(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}this.render=function(m,g){if(0!==e.length){void 0===i&&d(),c.useProgram(i),u.initAttributes(),u.enableAttribute(o.position),u.enableAttribute(o.uv),u.disableUnusedAttributes(),u.disable(c.CULL_FACE),u.enable(c.BLEND),c.bindBuffer(c.ARRAY_BUFFER,n),c.vertexAttribPointer(o.position,2,c.FLOAT,!1,16,0),c.vertexAttribPointer(o.uv,2,c.FLOAT,!1,16,8),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,r),c.uniformMatrix4fv(a.projectionMatrix,!1,g.projectionMatrix.elements),u.activeTexture(c.TEXTURE0),c.uniform1i(a.map,0);var v=0,y=0,x=m.fog;x?(c.uniform3f(a.fogColor,x.color.r,x.color.g,x.color.b),x.isFog?(c.uniform1f(a.fogNear,x.near),c.uniform1f(a.fogFar,x.far),c.uniform1i(a.fogType,1),v=1,y=1):x.isFogExp2&&(c.uniform1f(a.fogDensity,x.density),c.uniform1i(a.fogType,2),v=2,y=2)):(c.uniform1i(a.fogType,0),v=0,y=0);for(var _=0,b=e.length;_this.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return(e||new Re).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return(e||new Re).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Re;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var Gn,Hn,kn,jn,Vn,Wn,Xn,qn=0;function Yn(){Object.defineProperty(this,"id",{value:qn++}),this.uuid=Ae.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=P,this.side=b,this.shading=T,this.vertexColors=S,this.opacity=1,this.transparent=!1,this.blendSrc=V,this.blendDst=W,this.blendEquation=N,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=tt,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.needsUpdate=!0}function Zn(t){Yn.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Jn(t){Yn.call(this),this.type="MeshDepthMaterial",this.depthPacking=Te,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function Kn(t,e){this.min=void 0!==t?t:new He(1/0,1/0,1/0),this.max=void 0!==e?e:new He(-1/0,-1/0,-1/0)}function Qn(t,e){this.center=void 0!==t?t:new He,this.radius=void 0!==e?e:0}function $n(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function tr(t,e){this.normal=void 0!==t?t:new He(1,0,0),this.constant=void 0!==e?e:0}function er(t,e,n,r,i,o){this.planes=[void 0!==t?t:new tr,void 0!==e?e:new tr,void 0!==n?n:new tr,void 0!==r?r:new tr,void 0!==i?i:new tr,void 0!==o?o:new tr]}function nr(t,e,n,r){var i=t.context,o=t.state,a=new er,s=new ke,c=e.shadows,u=new Re,l=new Re(r.maxTextureSize,r.maxTextureSize),h=new He,f=new He,d=1,p=2,m=1+(d|p),g=new Array(m),v=new Array(m),y={},_=[new He(1,0,0),new He(-1,0,0),new He(0,0,1),new He(0,0,-1),new He(0,1,0),new He(0,-1,0)],E=[new He(0,1,0),new He(0,1,0),new He(0,1,0),new He(0,1,0),new He(0,0,1),new He(0,0,-1)],T=[new Fe,new Fe,new Fe,new Fe,new Fe,new Fe],S=new Jn;S.depthPacking=Se,S.clipping=!0;for(var A=Dn.distanceRGBA,R=Un.clone(A.uniforms),L=0;L!==m;++L){var P=0!=(L&d),C=0!=(L&p),I=S.clone();I.morphTargets=P,I.skinning=C,g[L]=I;var O=new Zn({defines:{USE_SHADOWMAP:""},uniforms:R,vertexShader:A.vertexShader,fragmentShader:A.fragmentShader,morphTargets:P,skinning:C,clipping:!0});v[L]=O}var U=this;function N(e,n,r,i){var o=e.geometry,a=null,s=g,c=e.customDepthMaterial;if(r&&(s=v,c=e.customDistanceMaterial),c)a=c;else{var u=!1;n.morphTargets&&(o&&o.isBufferGeometry?u=o.morphAttributes&&o.morphAttributes.position&&o.morphAttributes.position.length>0:o&&o.isGeometry&&(u=o.morphTargets&&o.morphTargets.length>0)),e.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var l=e.isSkinnedMesh&&n.skinning,h=0;u&&(h|=d),l&&(h|=p),a=s[h]}if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var f=a.uuid,m=n.uuid,x=y[f];void 0===x&&(x={},y[f]=x);var _=x[m];void 0===_&&(_=a.clone(),x[m]=_),a=_}a.visible=n.visible,a.wireframe=n.wireframe;var E=n.side;return U.renderSingleSided&&E==M&&(E=b),U.renderReverseSided&&(E===b?E=w:E===w&&(E=b)),a.side=E,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,r&&void 0!==a.uniforms.lightPos&&a.uniforms.lightPos.value.copy(i),a}function D(e,r,i,o){if(!1!==e.visible){if(e.layers.test(r.layers)&&(e.isMesh||e.isLine||e.isPoints)&&e.castShadow&&(!e.frustumCulled||a.intersectsObject(e))){e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld);var s=n.update(e),c=e.material;if(Array.isArray(c))for(var u=s.groups,l=0,h=u.length;l0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),n.skinning=this.skinning,n.morphTargets=this.morphTargets,n.dithering=this.dithering,e){var i=r(t.textures),o=r(t.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.shading=t.shading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,n=null;if(null!==e){var r=e.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Zn.prototype=Object.create(Yn.prototype),Zn.prototype.constructor=Zn,Zn.prototype.isShaderMaterial=!0,Zn.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Un.clone(t.uniforms),this.defines=t.defines,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},Zn.prototype.toJSON=function(t){var e=Yn.prototype.toJSON.call(this,t);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},Jn.prototype=Object.create(Yn.prototype),Jn.prototype.constructor=Jn,Jn.prototype.isMeshDepthMaterial=!0,Jn.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Object.assign(Kn.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=t.length;si&&(i=u),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=t.count;si&&(i=u),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,n,r),this.max.set(i,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return(e||new He).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},intersectsSphere:(Hn=new He,function(t){return this.clampPoint(t.center,Hn),Hn.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=t.constant&&n>=t.constant},clampPoint:function(t,e){return(e||new He).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new He;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new He;return function(e){var n=e||new Qn;return this.getCenter(n.center),n.radius=.5*this.getSize(t).length(),n}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(Gn=[new He,new He,new He,new He,new He,new He,new He,new He],function(t){return this.isEmpty()?this:(Gn[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Gn[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Gn[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Gn[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Gn[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Gn[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Gn[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Gn[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Gn),this)}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(Qn.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(kn=new Kn,function(t,e){var n=this.center;void 0!==e?n.copy(e):kn.setFromPoints(t).getCenter(n);for(var r=0,i=0,o=t.length;ithis.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(t){var e=t||new Kn;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign($n.prototype,{isMatrix3:!0,set:function(t,e,n,r,i,o,a,s,c){var u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=e,u[4]=i,u[5]=s,u[6]=n,u[7]=o,u[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var t=new He;return function(e){for(var n=0,r=e.count;n1?void 0:r.copy(i).multiplyScalar(a).add(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return(t||new He).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new He,e=new $n;return function(n,r){var i=this.coplanarPoint(t).applyMatrix4(n),o=r||e.getNormalMatrix(n),a=this.normal.applyMatrix3(o).normalize();return this.constant=-i.dot(a),this}}(),translate:function(t){return this.constant=this.constant-t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(er.prototype,{set:function(t,e,n,r,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],u=n[6],l=n[7],h=n[8],f=n[9],d=n[10],p=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-r,l-s,p-h,y-m).normalize(),e[1].setComponents(a+r,l+s,p+h,y+m).normalize(),e[2].setComponents(a+i,l+c,p+f,y+g).normalize(),e[3].setComponents(a-i,l-c,p-f,y-g).normalize(),e[4].setComponents(a-o,l-u,p-d,y-v).normalize(),e[5].setComponents(a+o,l+u,p+d,y+v).normalize(),this},intersectsObject:(Wn=new Qn,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Wn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Wn)}),intersectsSprite:function(){var t=new Qn;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)0?t.min.x:t.max.x,Vn.x=r.normal.x>0?t.max.x:t.min.x,jn.y=r.normal.y>0?t.min.y:t.max.y,Vn.y=r.normal.y>0?t.max.y:t.min.y,jn.z=r.normal.z>0?t.min.z:t.max.z,Vn.z=r.normal.z>0?t.max.z:t.min.z;var i=r.distanceToPoint(jn),o=r.distanceToPoint(Vn);if(i<0&&o<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}}),ir.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],ir.DefaultOrder="XYZ",Object.defineProperties(ir.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(ir.prototype,{isEuler:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var r=Ae.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],c=i[1],u=i[5],l=i[9],h=i[2],f=i[6],d=i[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(f,u),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(f,-1,1)),Math.abs(f)<.99999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===e?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(f,d),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,u))):"YZX"===e?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===e?(this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(f,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var t=new ke;return function(e,n,r){return t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,n,r)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(Xn=new Ge,function(t){return Xn.setFromEuler(this),this.setFromQuaternion(Xn,t)}),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new He(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(or.prototype,{set:function(t){this.mask=1<1){for(var e=0;e1){for(var e=0;e0){r.children=[];for(a=0;a0&&(n.geometries=c),u.length>0&&(n.materials=u),l.length>0&&(n.textures=l),h.length>0&&(n.images=h)}return n.object=r,n;function f(t){var e=[];for(var n in t){var r=t[n];delete r.metadata,e.push(r)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;ne&&(e=t[n]);return e}function zr(){Object.defineProperty(this,"id",{value:Tr()}),this.uuid=Ae.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function Gr(t,e,n,r,i,o){Sr.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o},this.fromBufferGeometry(new Hr(t,e,n,r,i,o)),this.mergeVertices()}function Hr(t,e,n,r,i,o){zr.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};var a=this;r=Math.floor(r)||1,i=Math.floor(i)||1,o=Math.floor(o)||1;var s=[],c=[],u=[],l=[],h=0,f=0;function d(t,e,n,r,i,o,d,p,m,g,v){var y,x,_=o/m,b=d/g,w=o/2,M=d/2,E=p/2,T=m+1,S=g+1,A=0,R=0,L=new He;for(x=0;x0?1:-1,u.push(L.x,L.y,L.z),l.push(y/m),l.push(1-x/g),A+=1}}for(x=0;x65535?Ur:Ir)(a,1),e.update(r,t.ELEMENT_ARRAY_BUFFER),i[n.id]=r,r}}}function ri(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new He,color:new In,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"SpotLight":n={position:new He,direction:new He,color:new In,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"PointLight":n={position:new He,color:new In,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Re};break;case"HemisphereLight":n={direction:new He,skyColor:new In,groundColor:new In};break;case"RectAreaLight":n={color:new In,position:new He,halfWidth:new He,halfHeight:new He}}return t[e.id]=n,n}}}function ii(t,e,n){var r={};return{update:function(t){var i=n.frame,o=t.geometry,a=e.get(t,o);return r[a.id]!==i&&(o.isGeometry&&a.updateFromObject(t),e.update(a),r[a.id]=i),a},clear:function(){r={}}}}function oi(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),!1===t.getShaderParameter(r,t.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(r),function(t){for(var e=t.split("\n"),n=0;n0)for(f=0;f0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,r,i;for(n=0,r=this.faces.length;n0&&(t+=e[n].distanceTo(e[n-1])),this.lineDistances[n]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Kn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Qn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var r,i=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,c=t.faces,u=this.faceVertexUvs[0],l=t.faceVertexUvs[0],h=this.colors,f=t.colors;void 0===n&&(n=0),void 0!==e&&(r=(new $n).getNormalMatrix(e));for(var d=0,p=a.length;d=0;n--){var p=f[n];for(this.faces.splice(p,1),a=0,s=this.faceVertexUvs.length;a0,g=d.vertexNormals.length>0,v=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=d.vertexColors.length>0,x=0;if(x=M(x,0,0),x=M(x,1,!0),x=M(x,2,!1),x=M(x,3,p),x=M(x,4,m),x=M(x,5,g),x=M(x,6,v),x=M(x,7,y),a.push(x),a.push(d.a,d.b,d.c),a.push(d.materialIndex),p){var _=this.faceVertexUvs[0][i];a.push(S(_[0]),S(_[1]),S(_[2]))}if(m&&a.push(E(d.normal)),g){var b=d.vertexNormals;a.push(E(b[0]),E(b[1]),E(b[2]))}if(v&&a.push(T(d.color)),y){var w=d.vertexColors;a.push(T(w[0]),T(w[1]),T(w[2]))}}function M(t,e,n){return n?t|1<0&&(t.data.colors=u),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new Sr).copy(this)},copy:function(t){var e,n,r,i,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e0,a=i[1]&&i[1].length>0,s=t.morphTargets,c=s.length;if(c>0){e=[];for(var u=0;u0){l=[];for(u=0;u65535?Ur:Ir)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(e)):(this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(t,new Ar(arguments[1],arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new $n).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new ke;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new ke;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new ke;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new ke;return function(e,n,r){return t.makeTranslation(e,n,r),this.applyMatrix(t),this}}(),scale:function(){var t=new ke;return function(e,n,r){return t.makeScale(e,n,r),this.applyMatrix(t),this}}(),lookAt:function(){var t=new hr;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new Nr(3*e.vertices.length,3),r=new Nr(3*e.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(e.vertices)),this.addAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new Nr(e.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var r=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=r}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new Fr).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new Ar(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var n=new Float32Array(3*t.normals.length);this.addAttribute("normal",new Ar(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var r=new Float32Array(3*t.colors.length);this.addAttribute("color",new Ar(r,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new Ar(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new Ar(o,2).copyVector2sArray(t.uvs2))}if(t.indices.length>0){var a=new(Br(t.indices)>65535?Uint32Array:Uint16Array)(3*t.indices.length);this.setIndex(new Ar(a,1).copyIndicesArray(t.indices))}for(var s in this.groups=t.groups,t.morphTargets){for(var c=[],u=t.morphTargets[s],l=0,h=u.length;l0){var p=new Nr(4*t.skinIndices.length,4);this.addAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var m=new Nr(4*t.skinWeights.length,4);this.addAttribute("skinWeight",m.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Kn);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var t=new Kn,e=new He;return function(){null===this.boundingSphere&&(this.boundingSphere=new Qn);var n=this.attributes.position;if(n){var r=this.boundingSphere.center;t.setFromBufferAttribute(n),t.getCenter(r);for(var i=0,o=0,a=n.count;o0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(t.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),t},clone:function(){return(new zr).copy(this)},copy:function(t){var e,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var o=t.attributes;for(e in o){var a=o[e];this.addAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var c=[],u=s[e];for(n=0,r=u.length;n0)if(o=u*l-h,s=c*d,(i=u*h-l)>=0)if(o>=-s)if(o<=s){var p=1/d;a=(i*=p)*(i+u*(o*=p)+2*l)+o*(u*i+o+2*h)+f}else o=c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+f;else o=-c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+f;else o<=-s?a=-(i=Math.max(0,-(-u*c+l)))*i+(o=i>0?-c:Math.min(Math.max(-c,-h),c))*(o+2*h)+f:o<=s?(i=0,a=(o=Math.min(Math.max(-c,-h),c))*(o+2*h)+f):a=-(i=Math.max(0,-(u*c+l)))*i+(o=i>0?c:Math.min(Math.max(-c,-h),c))*(o+2*h)+f;else o=u>0?-c:c,a=-(i=Math.max(0,-(u*o+l)))*i+o*(o+2*h)+f;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(xr).multiplyScalar(o).add(yr),a}),intersectSphere:function(){var t=new He;return function(e,n){t.subVectors(e.center,this.origin);var r=t.dot(this.direction),i=t.dot(t)-r*r,o=e.radius*e.radius;if(i>o)return null;var a=Math.sqrt(o-i),s=r-a,c=r+a;return s<0&&c<0?null:s<0?this.at(c,n):this.at(s,n)}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,r,i,o,a,s,c=1/this.direction.x,u=1/this.direction.y,l=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,r=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,r=(t.min.x-h.x)*c),u>=0?(i=(t.min.y-h.y)*u,o=(t.max.y-h.y)*u):(i=(t.max.y-h.y)*u,o=(t.min.y-h.y)*u),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o=0?(a=(t.min.z-h.z)*l,s=(t.max.z-h.z)*l):(a=(t.max.z-h.z)*l,s=(t.min.z-h.z)*l),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s=0?n:r,e)))},intersectsBox:(vr=new He,function(t){return null!==this.intersectBox(t,vr)}),intersectTriangle:function(){var t=new He,e=new He,n=new He,r=new He;return function(i,o,a,s,c){e.subVectors(o,i),n.subVectors(a,i),r.crossVectors(e,n);var u,l=this.direction.dot(r);if(l>0){if(s)return null;u=1}else{if(!(l<0))return null;u=-1,l=-l}t.subVectors(this.origin,i);var h=u*this.direction.dot(n.crossVectors(t,n));if(h<0)return null;var f=u*this.direction.dot(e.cross(t));if(f<0)return null;if(h+f>l)return null;var d=-u*t.dot(r);return d<0?null:this.at(d/l,c)}}(),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(Xr.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return(t||new He).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return(t||new He).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var n=e||new He;return this.delta(n).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(br=new He,wr=new He,function(t,e){br.subVectors(t,this.start),wr.subVectors(this.end,this.start);var n=wr.dot(wr),r=wr.dot(br)/n;return e&&(r=Ae.clamp(r,0,1)),r}),closestPointToPoint:function(t,e,n){var r=this.closestPointToPointParameter(t,e),i=n||new He;return this.delta(i).multiplyScalar(r).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),Object.assign(qr,{normal:(Mr=new He,function(t,e,n,r){var i=r||new He;i.subVectors(n,e),Mr.subVectors(t,e),i.cross(Mr);var o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}),barycoordFromPoint:function(){var t=new He,e=new He,n=new He;return function(r,i,o,a,s){t.subVectors(a,i),e.subVectors(o,i),n.subVectors(r,i);var c=t.dot(t),u=t.dot(e),l=t.dot(n),h=e.dot(e),f=e.dot(n),d=c*h-u*u,p=s||new He;if(0===d)return p.set(-2,-1,-1);var m=1/d,g=(h*l-u*f)*m,v=(c*f-u*l)*m;return p.set(1-g-v,v,g)}}(),containsPoint:function(){var t=new He;return function(e,n,r,i){var o=qr.barycoordFromPoint(e,n,r,i,t);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}()}),Object.assign(qr.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new He,e=new He;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){return(t||new He).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return qr.normal(this.a,this.b,this.c,t)},plane:function(t){return(t||new tr).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return qr.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return qr.containsPoint(t,this.a,this.b,this.c)},closestPointToPoint:function(){var t=new tr,e=[new Xr,new Xr,new Xr],n=new He,r=new He;return function(i,o){var a=o||new He,s=1/0;if(t.setFromCoplanarPoints(this.a,this.b,this.c),t.projectPoint(i,n),!0===this.containsPoint(n))a.copy(n);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var c=0;c0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=s.length;te.far?null:{distance:c,point:p.clone(),object:t}}function v(t,e,n,a,s,c,f,p){r.fromBufferAttribute(a,c),i.fromBufferAttribute(a,f),o.fromBufferAttribute(a,p);var v=g(t,e,n,r,i,o,d);return v&&(s&&(u.fromBufferAttribute(s,c),l.fromBufferAttribute(s,f),h.fromBufferAttribute(s,p),v.uv=m(d,r,i,o,u,l,h)),v.face=new mr(c,f,p,qr.normal(r,i,o)),v.faceIndex=c),v}return function(f,p){var y,x=this.geometry,_=this.material,b=this.matrixWorld;if(void 0!==_&&(null===x.boundingSphere&&x.computeBoundingSphere(),n.copy(x.boundingSphere),n.applyMatrix4(b),!1!==f.ray.intersectsSphere(n)&&(t.getInverse(b),e.copy(f.ray).applyMatrix4(t),null===x.boundingBox||!1!==e.intersectsBox(x.boundingBox))))if(x.isBufferGeometry){var w,M,E,T,S,A=x.index,R=x.attributes.position,L=x.attributes.uv;if(null!==A)for(T=0,S=A.count;T0&&(O=F);for(var B=0,z=D.length;B/gm,function(t,e){var n=Nn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return yi(n)})}function xi(t){return t.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,n,r){for(var i="",o=parseInt(e);o0?t.gammaFactor:1,w=function(t,e,n){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(gi).join("\n")}(a,i,t.extensions),M=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(s),E=o.createProgram();n.isRawShaderMaterial?(p=[M,"\n"].filter(gi).join("\n"),m=[w,M,"\n"].filter(gi).join("\n")):(p=["precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+r.name,M,i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(gi).join("\n"),m=[w,"precision "+i.precision+" float;","precision "+i.precision+" int;","#define SHADER_NAME "+r.name,M,i.alphaTest?"#define ALPHATEST "+i.alphaTest:"","#define GAMMA_FACTOR "+b,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.envMap?"#define "+f:"",i.envMap?"#define "+d:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexColors?"#define USE_COLOR":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+i.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(i.numClippingPlanes-i.numClipIntersection),i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",i.envMap&&t.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",i.toneMapping!==ct?"#define TONE_MAPPING":"",i.toneMapping!==ct?Nn.tonemapping_pars_fragment:"",i.toneMapping!==ct?mi("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.outputEncoding||i.mapEncoding||i.envMapEncoding||i.emissiveMapEncoding?Nn.encodings_pars_fragment:"",i.mapEncoding?pi("mapTexelToLinear",i.mapEncoding):"",i.envMapEncoding?pi("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMapEncoding?pi("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.outputEncoding?(g="linearToOutputTexel",v=i.outputEncoding,y=di(v),"vec4 "+g+"( vec4 value ) { return LinearTo"+y[0]+y[1]+"; }"):"",i.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(gi).join("\n")),c=vi(c=yi(c),i),u=vi(u=yi(u),i),n.isShaderMaterial||(c=xi(c),u=xi(u));var T=p+c,S=m+u,A=oi(o,o.VERTEX_SHADER,T),R=oi(o,o.FRAGMENT_SHADER,S);o.attachShader(E,A),o.attachShader(E,R),void 0!==n.index0AttributeName?o.bindAttribLocation(E,0,n.index0AttributeName):!0===i.morphTargets&&o.bindAttribLocation(E,0,"position"),o.linkProgram(E);var L,P,C=o.getProgramInfoLog(E),I=o.getShaderInfoLog(A),O=o.getShaderInfoLog(R),U=!0,N=!0;return!1===o.getProgramParameter(E,o.LINK_STATUS)?(U=!1,console.error("THREE.WebGLProgram: shader error: ",o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(E,o.VALIDATE_STATUS),"gl.getProgramInfoLog",C,I,O)):""!==C?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",C):""!==I&&""!==O||(N=!1),N&&(this.diagnostics={runnable:U,material:n,programLog:C,vertexShader:{log:I,prefix:p},fragmentShader:{log:O,prefix:m}}),o.deleteShader(A),o.deleteShader(R),this.getUniforms=function(){return void 0===L&&(L=new Pn(o,E,t)),L},this.getAttributes=function(){return void 0===P&&(P=function(t,e,n){for(var r={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),o=0;o0,maxBones:h,useVertexTexture:e.floatVertexTextures,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numClippingPlanes:s,numClipIntersection:c,dithering:n.dithering,shadowMapEnabled:t.shadowMap.enabled&&u.receiveShadow&&i.shadows.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:n.side===M,flipSided:n.side===w,depthPacking:void 0!==n.depthPacking&&n.depthPacking}},this.getProgramCode=function(e,n){var r=[];if(n.shaderID?r.push(n.shaderID):(r.push(e.fragmentShader),r.push(e.vertexShader)),void 0!==e.defines)for(var o in e.defines)r.push(o),r.push(e.defines[o]);for(var a=0;ae||t.height>e){var n=e/Math.max(t.width,t.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return r.width=Math.floor(t.width*n),r.height=Math.floor(t.height*n),r.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+r.width+"x"+r.height,t),r}return t}function u(t){return Ae.isPowerOfTwo(t.width)&&Ae.isPowerOfTwo(t.height)}function l(t,e){return t.generateMipmaps&&e&&t.minFilter!==Et&&t.minFilter!==At}function h(e){return e===Et||e===Tt||e===St?t.NEAREST:t.LINEAR}function f(e){var n=e.target;n.removeEventListener("dispose",f),function(e){var n=r.get(e);if(e.image&&n.__image__webglTextureCube)t.deleteTexture(n.__image__webglTextureCube);else{if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture)}r.remove(e)}(n),a.textures--}function d(e){var n=e.target;n.removeEventListener("dispose",d),function(e){var n=r.get(e),i=r.get(e.texture);if(!e)return;void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);r.remove(e.texture),r.remove(e)}(n),a.textures--}function p(e,h){var d=r.get(e);if(e.version>0&&d.__version!==e.version){var p=e.image;if(void 0===p)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e);else{if(!1!==p.complete)return void function(e,r,h){void 0===e.__webglInit&&(e.__webglInit=!0,r.addEventListener("dispose",f),e.__webglTexture=t.createTexture(),a.textures++);n.activeTexture(t.TEXTURE0+h),n.bindTexture(t.TEXTURE_2D,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment);var d=c(r.image,i.maxTextureSize);(function(t){return t.wrapS!==wt||t.wrapT!==wt||t.minFilter!==Et&&t.minFilter!==At})(r)&&!1===u(d)&&(d=function(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return e.width=Ae.nearestPowerOfTwo(t.width),e.height=Ae.nearestPowerOfTwo(t.height),e.getContext("2d").drawImage(t,0,0,e.width,e.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+e.width+"x"+e.height,t),e}return t}(d));var p=u(d),g=o(r.format),v=o(r.type);m(t.TEXTURE_2D,r,p);var y,x=r.mipmaps;if(r.isDepthTexture){var _=t.DEPTH_COMPONENT;if(r.type===Dt){if(!s)throw new Error("Float Depth Texture only supported in WebGL2.0");_=t.DEPTH_COMPONENT32F}else s&&(_=t.DEPTH_COMPONENT16);r.format===Yt&&_===t.DEPTH_COMPONENT&&r.type!==Ot&&r.type!==Nt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Ot,v=o(r.type)),r.format===Zt&&(_=t.DEPTH_STENCIL,r.type!==Ht&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Ht,v=o(r.type))),n.texImage2D(t.TEXTURE_2D,0,_,d.width,d.height,0,g,v,null)}else if(r.isDataTexture)if(x.length>0&&p){for(var b=0,w=x.length;b-1?n.compressedTexImage2D(t.TEXTURE_2D,b,g,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(t.TEXTURE_2D,b,g,y.width,y.height,0,g,v,y.data);else if(x.length>0&&p){for(var b=0,w=x.length;b1||r.get(a).__currentAnisotropy)&&(t.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function g(e,i,a,s){var c=o(i.texture.format),u=o(i.texture.type);n.texImage2D(s,0,c,i.width,i.height,0,c,u,null),t.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,a,s,r.get(i.texture).__webglTexture,0),t.bindFramebuffer(t.FRAMEBUFFER,null)}function v(e,n){t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)):n.depthBuffer&&n.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)):t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,n.width,n.height),t.bindRenderbuffer(t.RENDERBUFFER,null)}function y(e){var n=r.get(e),i=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported!");if(t.bindFramebuffer(t.FRAMEBUFFER,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),p(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Yt)t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,i,0);else{if(n.depthTexture.format!==Zt)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,i,0)}}(n.__webglFramebuffer,e)}else if(i){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(t.FRAMEBUFFER,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),v(n.__webglDepthbuffer[o],e)}else t.bindFramebuffer(t.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),v(n.__webglDepthbuffer,e);t.bindFramebuffer(t.FRAMEBUFFER,null)}this.setTexture2D=p,this.setTextureCube=function(e,s){var h=r.get(e);if(6===e.image.length)if(e.version>0&&h.__version!==e.version){h.__image__webglTextureCube||(e.addEventListener("dispose",f),h.__image__webglTextureCube=t.createTexture(),a.textures++),n.activeTexture(t.TEXTURE0+s),n.bindTexture(t.TEXTURE_CUBE_MAP,h.__image__webglTextureCube),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var d=e&&e.isCompressedTexture,p=e.image[0]&&e.image[0].isDataTexture,g=[],v=0;v<6;v++)g[v]=d||p?p?e.image[v].image:e.image[v]:c(e.image[v],i.maxCubemapSize);var y=u(g[0]),x=o(e.format),_=o(e.type);for(m(t.TEXTURE_CUBE_MAP,e,y),v=0;v<6;v++)if(d)for(var b,w=g[v].mipmaps,M=0,E=w.length;M-1?n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,M,x,b.width,b.height,0,b.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,M,x,b.width,b.height,0,x,_,b.data);else p?n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,g[v].width,g[v].height,0,x,_,g[v].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,x,_,g[v]);l(e,y)&&t.generateMipmap(t.TEXTURE_CUBE_MAP),h.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(t.TEXTURE0+s),n.bindTexture(t.TEXTURE_CUBE_MAP,h.__image__webglTextureCube)},this.setTextureCubeDynamic=function(e,i){n.activeTexture(t.TEXTURE0+i),n.bindTexture(t.TEXTURE_CUBE_MAP,r.get(e).__webglTexture)},this.setupRenderTarget=function(e){var i=r.get(e),o=r.get(e.texture);e.addEventListener("dispose",d),o.__webglTexture=t.createTexture(),a.textures++;var s=!0===e.isWebGLRenderTargetCube,c=u(e);if(s){i.__webglFramebuffer=[];for(var h=0;h<6;h++)i.__webglFramebuffer[h]=t.createFramebuffer()}else i.__webglFramebuffer=t.createFramebuffer();if(s){for(n.bindTexture(t.TEXTURE_CUBE_MAP,o.__webglTexture),m(t.TEXTURE_CUBE_MAP,e.texture,c),h=0;h<6;h++)g(i.__webglFramebuffer[h],e,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+h);l(e.texture,c)&&t.generateMipmap(t.TEXTURE_CUBE_MAP),n.bindTexture(t.TEXTURE_CUBE_MAP,null)}else n.bindTexture(t.TEXTURE_2D,o.__webglTexture),m(t.TEXTURE_2D,e.texture,c),g(i.__webglFramebuffer,e,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),l(e.texture,c)&&t.generateMipmap(t.TEXTURE_2D),n.bindTexture(t.TEXTURE_2D,null);e.depthBuffer&&y(e)},this.updateRenderTargetMipmap=function(e){var i=e.texture;if(l(i,u(e))){var o=e.isWebGLRenderTargetCube?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=r.get(i).__webglTexture;n.bindTexture(o,a),t.generateMipmap(o),n.bindTexture(o,null)}}}function Mi(){var t={};return{get:function(e){var n=e.uuid,r=t[n];return void 0===r&&(r={},t[n]=r),r},remove:function(e){delete t[e.uuid]},clear:function(){t={}}}}function Ei(t,e,n){var r=new function(){var e=!1,n=new Fe,r=null,i=new Fe;return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,o,a,s){!0===s&&(e*=a,r*=a,o*=a),n.set(e,r,o,a),!1===i.equals(n)&&(t.clearColor(e,r,o,a),i.copy(n))},reset:function(){e=!1,r=null,i.set(0,0,0,1)}}},i=new function(){var e=!1,n=null,r=null,i=null;return{setTest:function(e){e?X(t.DEPTH_TEST):q(t.DEPTH_TEST)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){if(e)switch(e){case K:t.depthFunc(t.NEVER);break;case Q:t.depthFunc(t.ALWAYS);break;case $:t.depthFunc(t.LESS);break;case tt:t.depthFunc(t.LEQUAL);break;case et:t.depthFunc(t.EQUAL);break;case nt:t.depthFunc(t.GEQUAL);break;case rt:t.depthFunc(t.GREATER);break;case it:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,n=null,r=null,i=null}}},o=new function(){var e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null;return{setTest:function(e){e?X(t.STENCIL_TEST):q(t.STENCIL_TEST)},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,a){r===e&&i===n&&o===a||(t.stencilFunc(e,n,a),r=e,i=n,o=a)},setOp:function(e,n,r){a===e&&s===n&&c===r||(t.stencilOp(e,n,r),a=e,s=n,c=r)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,n=null,r=null,i=null,o=null,a=null,s=null,c=null,u=null}}},a=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=new Uint8Array(a),c=new Uint8Array(a),u=new Uint8Array(a),l={},h=null,m=null,g=null,v=null,y=null,x=null,_=null,b=null,E=!1,T=null,S=null,A=null,R=null,N=null,D=null,F=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),B=parseFloat(/^WebGL\ ([0-9])/.exec(t.getParameter(t.VERSION))[1]),z=parseFloat(B)>=1,G=null,H={},k=new Fe,j=new Fe;function V(e,n,r){var i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(var a=0;a0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o=void 0!==n.precision?n.precision:"highp",a=i(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);var s=!0===n.logarithmicDepthBuffer&&!!e.get("EXT_frag_depth"),c=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=t.getParameter(t.MAX_TEXTURE_SIZE),h=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),d=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),p=t.getParameter(t.MAX_VARYING_VECTORS),m=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),g=u>0,v=!!e.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==r)return r;var n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:s,maxTextures:c,maxVertexTextures:u,maxTextureSize:l,maxCubemapSize:h,maxAttributes:f,maxVertexUniforms:d,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:v,floatVertexTextures:g&&v}}function Si(t){pr.call(this),this.cameras=t||[]}function Ai(t){var e=this,n=null,r=null;"VRFrameData"in window&&(r=new window.VRFrameData);var i=new ke,o=new ke,a=new ke,s=new pr;s.bounds=new Fe(0,0,.5,1),s.layers.enable(1);var c=new pr;c.bounds=new Fe(.5,0,.5,1),c.layers.enable(2);var u,l,h=new Si([s,c]);h.layers.enable(1),h.layers.enable(2),window.addEventListener("vrdisplaypresentchange",function(){if(n.isPresenting){var r=n.getEyeParameters("left"),i=r.renderWidth,o=r.renderHeight;l=t.getPixelRatio(),u=t.getSize(),t.setDrawingBufferSize(2*i,o,1)}else e.enabled&&t.setDrawingBufferSize(u.width,u.height,l)},!1),this.enabled=!1,this.standing=!1,this.getDevice=function(){return n},this.setDevice=function(t){void 0!==t&&(n=t)},this.getCamera=function(t){if(null===n)return t;n.depthNear=t.near,n.depthFar=t.far,n.getFrameData(r);var e=r.pose;null!==e.position?t.position.fromArray(e.position):t.position.set(0,0,0),null!==e.orientation&&t.quaternion.fromArray(e.orientation),t.updateMatrixWorld();var u=n.stageParameters;if(this.standing&&u&&(o.fromArray(u.sittingToStandingTransform),a.getInverse(o),t.matrixWorld.multiply(o),t.matrixWorldInverse.multiply(a)),!1===n.isPresenting)return t;h.matrixWorld.copy(t.matrixWorld),h.matrixWorldInverse.copy(t.matrixWorldInverse),s.matrixWorldInverse.fromArray(r.leftViewMatrix),c.matrixWorldInverse.fromArray(r.rightViewMatrix),this.standing&&u&&(s.matrixWorldInverse.multiply(a),c.matrixWorldInverse.multiply(a));var l=t.parent;null!==l&&(i.getInverse(l.matrixWorld),s.matrixWorldInverse.multiply(i),c.matrixWorldInverse.multiply(i)),s.matrixWorld.getInverse(s.matrixWorldInverse),c.matrixWorld.getInverse(c.matrixWorldInverse),s.projectionMatrix.fromArray(r.leftProjectionMatrix),c.projectionMatrix.fromArray(r.rightProjectionMatrix),h.projectionMatrix.copy(s.projectionMatrix);var f=n.getLayers();if(f.length){var d=f[0];null!==d.leftBounds&&4===d.leftBounds.length&&s.bounds.fromArray(d.leftBounds),null!==d.rightBounds&&4===d.rightBounds.length&&c.bounds.fromArray(d.rightBounds)}return h},this.getStandingMatrix=function(){return o},this.submitFrame=function(){n&&n.isPresenting&&n.submitFrame()}}function Ri(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=t.getExtension("WEBGL_compressed_texture_etc1");break;default:r=t.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),e[n]=r,r}}}function Li(){var t=this,e=null,n=0,r=!1,i=!1,o=new tr,a=new $n,s={value:null,needsUpdate:!1};function c(){s.value!==e&&(s.value=e,s.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function u(e,n,r,i){var c=null!==e?e.length:0,u=null;if(0!==c){if(u=s.value,!0!==i||null===u){var l=r+4*c,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===u||u.length=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(l=0;l=0&&t.numSupportedMorphNormals++}var h=r.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(r.numClippingPlanes=tt.numPlanes,r.numIntersection=tt.numIntersection,h.clippingPlanes=tt.uniform),r.fog=e,r.lightsHash=st.hash,t.lights&&(h.ambientLightColor.value=st.ambient,h.directionalLights.value=st.directional,h.spotLights.value=st.spot,h.rectAreaLights.value=st.rectArea,h.pointLights.value=st.point,h.hemisphereLights.value=st.hemi,h.directionalShadowMap.value=st.directionalShadowMap,h.directionalShadowMatrix.value=st.directionalShadowMatrix,h.spotShadowMap.value=st.spotShadowMap,h.spotShadowMatrix.value=st.spotShadowMatrix,h.pointShadowMap.value=st.pointShadowMap,h.pointShadowMatrix.value=st.pointShadowMatrix);var f=r.program.getUniforms(),d=Pn.seqWithValue(f.seq,h);r.uniformsList=d}function Re(t,e,n,r){P=0;var i=mt.get(n);if(et&&(nt||t!==M)){var o=t===M&&n.id===b;tt.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,i,o)}!1===n.needsUpdate&&(void 0===i.program?n.needsUpdate=!0:n.fog&&i.fog!==e?n.needsUpdate=!0:n.lights&&i.lightsHash!==st.hash?n.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===tt.numPlanes&&i.numIntersection===tt.numIntersection||(n.needsUpdate=!0)),n.needsUpdate&&(Se(n,e,r),n.needsUpdate=!1);var a,s,c=!1,u=!1,l=!1,h=i.program,f=h.getUniforms(),d=i.shader.uniforms;if(h.id!==y&&(m.useProgram(h.program),y=h.id,c=!0,u=!0,l=!0),n.id!==b&&(b=n.id,u=!0),c||t!==M){if(f.setValue(m,"projectionMatrix",t.projectionMatrix),dt.logarithmicDepthBuffer&&f.setValue(m,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),M!==(T||t)&&(M=T||t,u=!0,l=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var p=f.map.cameraPosition;void 0!==p&&p.setValue(m,it.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&f.setValue(m,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){f.setOptional(m,r,"bindMatrix"),f.setOptional(m,r,"bindMatrixInverse");var g=r.skeleton;if(g){var x=g.bones;if(dt.floatVertexTextures){if(void 0===g.boneTexture){var _=Math.sqrt(4*x.length);_=Ae.nextPowerOfTwo(Math.ceil(_)),_=Math.max(_,4);var w=new Float32Array(_*_*4);w.set(g.boneMatrices);var E=new je(w,_,_,Vt,Dt);g.boneMatrices=w,g.boneTexture=E,g.boneTextureSize=_}f.setValue(m,"boneTexture",g.boneTexture),f.setValue(m,"boneTextureSize",g.boneTextureSize)}else f.setOptional(m,g,"boneMatrices")}}return u&&(f.setValue(m,"toneMappingExposure",v.toneMappingExposure),f.setValue(m,"toneMappingWhitePoint",v.toneMappingWhitePoint),n.lights&&(s=l,(a=d).ambientLightColor.needsUpdate=s,a.directionalLights.needsUpdate=s,a.pointLights.needsUpdate=s,a.spotLights.needsUpdate=s,a.rectAreaLights.needsUpdate=s,a.hemisphereLights.needsUpdate=s),e&&n.fog&&function(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(d,e),(n.isMeshBasicMaterial||n.isMeshLambertMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.isMeshNormalMaterial||n.isMeshDepthMaterial)&&function(t,e){t.opacity.value=e.opacity,t.diffuse.value=e.color,e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity);t.map.value=e.map,t.specularMap.value=e.specularMap,t.alphaMap.value=e.alphaMap,e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity);e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity);var n;e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap);if(void 0!==n){n.isWebGLRenderTarget&&(n=n.texture);var r=n.offset,i=n.repeat;t.offsetRepeat.value.set(r.x,r.y,i.x,i.y)}t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap&&e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio}(d,n),n.isLineBasicMaterial?Le(d,n):n.isLineDashedMaterial?(Le(d,n),function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(d,n)):n.isPointsMaterial?function(t,e){if(t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*O,t.scale.value=.5*I,t.map.value=e.map,null!==e.map){var n=e.map.offset,r=e.map.repeat;t.offsetRepeat.value.set(n.x,n.y,r.x,r.y)}}(d,n):n.isMeshLambertMaterial?function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(d,n):n.isMeshToonMaterial?function(t,e){Pe(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(d,n):n.isMeshPhongMaterial?Pe(d,n):n.isMeshPhysicalMaterial?function(t,e){t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness,Ce(t,e)}(d,n):n.isMeshStandardMaterial?Ce(d,n):n.isMeshDepthMaterial?n.displacementMap&&(d.displacementMap.value=n.displacementMap,d.displacementScale.value=n.displacementScale,d.displacementBias.value=n.displacementBias):n.isMeshNormalMaterial&&function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale);e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale));e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(d,n),void 0!==d.ltcMat&&(d.ltcMat.value=On.LTC_MAT_TEXTURE),void 0!==d.ltcMag&&(d.ltcMag.value=On.LTC_MAG_TEXTURE),Pn.upload(m,i.uniformsList,d,v)),f.setValue(m,"modelViewMatrix",r.modelViewMatrix),f.setValue(m,"normalMatrix",r.normalMatrix),f.setValue(m,"modelMatrix",r.matrixWorld),h}function Le(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function Pe(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function Ce(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function Ie(t,e){var n,r,i,o,a,s,c,u,l=0,h=0,f=0,d=e.matrixWorldInverse,p=0,m=0,g=0,v=0,y=0;for(n=0,r=t.length;n8&&(l.length=8);var g=n.morphAttributes;for(h=0,d=l.length;h=0){var u=i[s];if(void 0!==u){var l=u.normalized,h=u.itemSize,f=vt.get(u),d=f.buffer,p=f.type,g=f.bytesPerElement;if(u.isInterleavedBufferAttribute){var v=u.data,y=v.stride,x=u.offset;v&&v.isInstancedInterleavedBuffer?(pt.enableAttributeAndDivisor(c,v.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=v.meshPerAttribute*v.count)):pt.enableAttribute(c),m.bindBuffer(m.ARRAY_BUFFER,d),m.vertexAttribPointer(c,h,p,l,y*g,(r*y+x)*g)}else u.isInstancedBufferAttribute?(pt.enableAttributeAndDivisor(c,u.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=u.meshPerAttribute*u.count)):pt.enableAttribute(c),m.bindBuffer(m.ARRAY_BUFFER,d),m.vertexAttribPointer(c,h,p,l,0,r*h*g)}else if(void 0!==a){var _=a[s];if(void 0!==_)switch(_.length){case 2:m.vertexAttrib2fv(c,_);break;case 3:m.vertexAttrib3fv(c,_);break;case 4:m.vertexAttrib4fv(c,_);break;default:m.vertexAttrib1fv(c,_)}}}}pt.disableUnusedAttributes()}(r,a,n),null!==v&&m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,x.buffer));var E=0;null!==v?E=v.count:void 0!==_&&(E=_.count);var T=n.drawRange.start*b,S=n.drawRange.count*b,A=null!==o?o.start*b:0,R=null!==o?o.count*b:1/0,L=Math.max(T,A),P=Math.min(E,T+S,A+R)-1,C=Math.max(0,P-L+1);if(0!==C){if(i.isMesh)if(!0===r.wireframe)pt.setLineWidth(r.wireframeLinewidth*le()),M.setMode(m.LINES);else switch(i.drawMode){case pe:M.setMode(m.TRIANGLES);break;case me:M.setMode(m.TRIANGLE_STRIP);break;case ge:M.setMode(m.TRIANGLE_FAN)}else if(i.isLine){var I=r.linewidth;void 0===I&&(I=1),pt.setLineWidth(I*le()),i.isLineSegments?M.setMode(m.LINES):i.isLineLoop?M.setMode(m.LINE_LOOP):M.setMode(m.LINE_STRIP)}else i.isPoints&&M.setMode(m.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&M.renderInstances(n,L,C):M.render(L,C)}},this.compile=function(t,e){u=[],t.traverse(function(t){t.isLight&&u.push(t)}),Ie(u,e),t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var n=0;n=dt.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+dt.maxTextures),P+=1,t},this.setTexture2D=(ve=!1,function(t,e){t&&t.isWebGLRenderTarget&&(ve||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),ve=!0),t=t.texture),gt.setTexture2D(t,e)}),this.setTexture=function(){var t=!1;return function(e,n){t||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),t=!0),gt.setTexture2D(e,n)}}(),this.setTextureCube=function(){var t=!1;return function(e,n){e&&e.isWebGLRenderTargetCube&&(t||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?gt.setTextureCube(e,n):gt.setTextureCubeDynamic(e,n)}}(),this.getRenderTarget=function(){return x},this.setRenderTarget=function(t){x=t,t&&void 0===mt.get(t).__webglFramebuffer&>.setupRenderTarget(t);var e,n=t&&t.isWebGLRenderTargetCube;if(t){var r=mt.get(t);e=n?r.__webglFramebuffer[t.activeCubeFace]:r.__webglFramebuffer,A.copy(t.scissor),R=t.scissorTest,L.copy(t.viewport)}else e=null,A.copy(U).multiplyScalar(O),R=K,L.copy(Q).multiplyScalar(O);if(_!==e&&(m.bindFramebuffer(m.FRAMEBUFFER,e),_=e),pt.scissor(A),pt.setScissorTest(R),pt.viewport(L),n){var i=mt.get(t.texture);m.framebufferTexture2D(m.FRAMEBUFFER,m.COLOR_ATTACHMENT0,m.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,i.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,n,r,i,o){if(t&&t.isWebGLRenderTarget){var a=mt.get(t).__webglFramebuffer;if(a){var s=!1;a!==_&&(m.bindFramebuffer(m.FRAMEBUFFER,a),s=!0);try{var c=t.texture,u=c.format,l=c.type;if(u!==Vt&&Oe(u)!==m.getParameter(m.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(l===Pt||Oe(l)===m.getParameter(m.IMPLEMENTATION_COLOR_READ_TYPE)||l===Dt&&(ft.get("OES_texture_float")||ft.get("WEBGL_color_buffer_float"))||l===Ft&&ft.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");m.checkFramebufferStatus(m.FRAMEBUFFER)===m.FRAMEBUFFER_COMPLETE?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&m.readPixels(e,n,r,i,Oe(u),Oe(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&m.bindFramebuffer(m.FRAMEBUFFER,_)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")}}function Ci(t,e){this.name="",this.color=new In(t),this.density=void 0!==e?e:25e-5}function Ii(t,e,n){this.name="",this.color=new In(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Oi(){hr.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Ui(t,e,n,r,i){hr.call(this),this.lensFlares=[],this.positionScreen=new He,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,n,r,i)}function Ni(t){Yn.call(this),this.type="SpriteMaterial",this.color=new In(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(t)}function Di(t){hr.call(this),this.type="Sprite",this.material=void 0!==t?t:new Ni}function Fi(){hr.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Bi(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n=t.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}()}function Zi(t,e,n,r,i,o,a,s,c,u,l,h){De.call(this,null,o,a,s,c,u,r,i,l,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Ji(t,e,n,r,i,o,a,s,c){De.call(this,t,e,n,r,i,o,a,s,c),this.needsUpdate=!0}function Ki(t,e,n,r,i,o,a,s,c,u){if((u=void 0!==u?u:Yt)!==Yt&&u!==Zt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&u===Yt&&(n=Ot),void 0===n&&u===Zt&&(n=Ht),De.call(this,null,r,i,o,a,s,u,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:Et,this.minFilter=void 0!==s?s:Et,this.flipY=!1,this.generateMipmaps=!1}function Qi(t){zr.call(this),this.type="WireframeGeometry";var e,n,r,i,o,a,s,c,u,l,h=[],f=[0,0],d={},p=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,r=m.length;e=0?(h=t(g-1e-5,m,h),f.subVectors(l,h)):(h=t(g+1e-5,m,h),f.subVectors(h,l)),m-1e-5>=0?(h=t(g,m-1e-5,h),d.subVectors(l,h)):(h=t(g,m+1e-5,h),d.subVectors(h,l)),u.crossVectors(f,d).normalize(),s.push(u.x,u.y,u.z),c.push(g,m)}}for(r=0;r.9&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),r<.2&&(o[t+4]+=1))}}()}(),this.addAttribute("position",new Nr(i,3)),this.addAttribute("normal",new Nr(i.slice(),3)),this.addAttribute("uv",new Nr(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function ro(t,e){Sr.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new io(t,e)),this.mergeVertices()}function io(t,e){no.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function oo(t,e){Sr.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ao(t,e)),this.mergeVertices()}function ao(t,e){no.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function so(t,e){Sr.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new co(t,e)),this.mergeVertices()}function co(t,e){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];no.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function uo(t,e){Sr.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new lo(t,e)),this.mergeVertices()}function lo(t,e){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];no.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function ho(t,e,n,r,i,o){Sr.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new fo(t,e,n,r,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function fo(t,e,n,r,i){zr.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i},e=e||64,n=n||1,r=r||8,i=i||!1;var o=t.computeFrenetFrames(e,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new He,u=new He,l=new Re,h=[],f=[],d=[],p=[];function m(i){var a=t.getPointAt(i/e),l=o.normals[i],d=o.binormals[i];for(s=0;s<=r;s++){var p=s/r*Math.PI*2,m=Math.sin(p),g=-Math.cos(p);u.x=g*l.x+m*d.x,u.y=g*l.y+m*d.y,u.z=g*l.z+m*d.z,u.normalize(),f.push(u.x,u.y,u.z),c.x=a.x+n*u.x,c.y=a.y+n*u.y,c.z=a.z+n*u.z,h.push(c.x,c.y,c.z)}}!function(){for(a=0;an)){var r=t.ray.origin.distanceTo(ai);rt.far||e.push({distance:r,point:ai.clone(),face:null,object:this})}}),clone:function(){return new this.constructor(this.material).copy(this)}}),Fi.prototype=Object.assign(Object.create(hr.prototype),{constructor:Fi,copy:function(t){hr.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,r=e.length;n1){t.setFromMatrixPosition(n.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var i=t.distanceTo(e);r[0].object.visible=!0;for(var o=1,a=r.length;o=r[o].distance;o++)r[o-1].object.visible=!1,r[o].object.visible=!0;for(;oa))f.applyMatrix4(this.matrixWorld),(M=r.ray.origin.distanceTo(f))r.far||i.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}else for(v=0,y=m.length/3-1;va))f.applyMatrix4(this.matrixWorld),(M=r.ray.origin.distanceTo(f))r.far||i.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else if(s.isGeometry){var b=s.vertices,w=b.length;for(v=0;va))f.applyMatrix4(this.matrixWorld),(M=r.ray.origin.distanceTo(f))r.far||i.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),ji.prototype=Object.assign(Object.create(ki.prototype),{constructor:ji,isLineSegments:!0}),Vi.prototype=Object.assign(Object.create(ki.prototype),{constructor:Vi,isLineLoop:!0}),Wi.prototype=Object.create(Yn.prototype),Wi.prototype.constructor=Wi,Wi.prototype.isPointsMaterial=!0,Wi.prototype.copy=function(t){return Yn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this},Xi.prototype=Object.assign(Object.create(hr.prototype),{constructor:Xi,isPoints:!0,raycast:function(){var t=new ke,e=new Wr,n=new Qn;return function(r,i){var o=this,a=this.geometry,s=this.matrixWorld,c=r.params.Points.threshold;if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(s),n.radius+=c,!1!==r.ray.intersectsSphere(n)){t.getInverse(s),e.copy(r.ray).applyMatrix4(t);var u=c/((this.scale.x+this.scale.y+this.scale.z)/3),l=u*u,h=new He;if(a.isBufferGeometry){var f=a.index,d=a.attributes.position.array;if(null!==f)for(var p=f.array,m=0,g=p.length;mr.far)return;i.push({distance:u,distanceToRay:Math.sqrt(a),point:c.clone(),index:n,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),qi.prototype=Object.assign(Object.create(hr.prototype),{constructor:qi}),Yi.prototype=Object.create(De.prototype),Yi.prototype.constructor=Yi,Zi.prototype=Object.create(De.prototype),Zi.prototype.constructor=Zi,Zi.prototype.isCompressedTexture=!0,Ji.prototype=Object.create(De.prototype),Ji.prototype.constructor=Ji,Ki.prototype=Object.create(De.prototype),Ki.prototype.constructor=Ki,Ki.prototype.isDepthTexture=!0,Qi.prototype=Object.create(zr.prototype),Qi.prototype.constructor=Qi,$i.prototype=Object.create(Sr.prototype),$i.prototype.constructor=$i,to.prototype=Object.create(zr.prototype),to.prototype.constructor=to,eo.prototype=Object.create(Sr.prototype),eo.prototype.constructor=eo,no.prototype=Object.create(zr.prototype),no.prototype.constructor=no,ro.prototype=Object.create(Sr.prototype),ro.prototype.constructor=ro,io.prototype=Object.create(no.prototype),io.prototype.constructor=io,oo.prototype=Object.create(Sr.prototype),oo.prototype.constructor=oo,ao.prototype=Object.create(no.prototype),ao.prototype.constructor=ao,so.prototype=Object.create(Sr.prototype),so.prototype.constructor=so,co.prototype=Object.create(no.prototype),co.prototype.constructor=co,uo.prototype=Object.create(Sr.prototype),uo.prototype.constructor=uo,lo.prototype=Object.create(no.prototype),lo.prototype.constructor=lo,ho.prototype=Object.create(Sr.prototype),ho.prototype.constructor=ho,fo.prototype=Object.create(zr.prototype),fo.prototype.constructor=fo,po.prototype=Object.create(Sr.prototype),po.prototype.constructor=po,mo.prototype=Object.create(zr.prototype),mo.prototype.constructor=mo,go.prototype=Object.create(Sr.prototype),go.prototype.constructor=go,vo.prototype=Object.create(zr.prototype),vo.prototype.constructor=vo;var yo={area:function(t){for(var e=t.length,n=0,r=e-1,i=0;i=-Number.EPSILON&&w>=-Number.EPSILON&&b>=-Number.EPSILON))return!1;return!0}return function(e,n){var r=e.length;if(r<3)return null;var i,o,a,s=[],c=[],u=[];if(yo.area(e)>0)for(o=0;o2;){if(h--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),n?u:s;if(l<=(i=o)&&(i=0),l<=(o=i+1)&&(o=0),l<=(a=o+1)&&(a=0),t(e,i,o,a,l,c)){var f,d,p,m,g;for(f=c[i],d=c[o],p=c[a],s.push([e[f],e[d],e[p]]),u.push([c[i],c[o],c[a]]),m=o,g=o+1;g2&&t[e-1].equals(t[0])&&t.pop()}function r(t,e,n){return t.x!==e.x?t.xNumber.EPSILON){var p;if(f>0){if(d<0||d>f)return[];if((p=u*l-c*h)<0||p>f)return[]}else{if(d>0||d0||pM?[]:y===M?o?[]:[g]:x<=M?[g,v]:[g,b])}function o(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,a=n.x-t.x,s=n.y-t.y,c=r.x-t.x,u=r.y-t.y,l=i*s-o*a,h=i*u-o*c;if(Math.abs(l)>Number.EPSILON){var f=c*s-u*a;return l>0?h>=0&&f>=0:h>=0||f>=0}return h>0}n(t),e.forEach(n);for(var a,s,c,u,l,h,f={},d=t.concat(),p=0,m=e.length;pi&&(s=0);var c=o(r[t],r[a],r[s],n[e]);if(!c)return!1;var u=n.length-1,l=e-1;l<0&&(l=u);var h=e+1;return h>u&&(h=0),!!(c=o(n[e],n[l],n[h],r[t]))}function s(t,e){var n,o;for(n=0;n0)return!0;return!1}var c=[];function u(t,n){var r,o,a,s;for(r=0;r0)return!0;return!1}for(var l,h,f,d,p,m,g,v,y,x,_=[],b=0,w=e.length;b0;){if(--E<0){console.log("Infinite Loop! Holes left:"+c.length+", Probably Hole outside Shape!");break}for(h=M;h=0)break;_[m]=!0}if(l>=0)break}}return r}(t,e),v=yo.triangulate(g,!1);for(a=0,s=v.length;a0)&&p.push(b,w,E),(c!==n-1||u0&&v(!0),e>0&&v(!1)),this.setIndex(u),this.addAttribute("position",new Nr(l,3)),this.addAttribute("normal",new Nr(h,3)),this.addAttribute("uv",new Nr(f,2))}function Uo(t,e,n,r,i,o,a){Io.call(this,0,t,e,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function No(t,e,n,r,i,o,a){Oo.call(this,0,t,e,n,r,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Do(t,e,n,r){Sr.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Fo(t,e,n,r)),this.mergeVertices()}function Fo(t,e,n,r){zr.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||50,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,o,a=[],s=[],c=[],u=[],l=new He,h=new Re;for(s.push(0,0,0),c.push(0,0,1),u.push(.5,.5),o=0,i=3;o<=e;o++,i+=3){var f=n+o/e*r;l.x=t*Math.cos(f),l.y=t*Math.sin(f),s.push(l.x,l.y,l.z),c.push(0,0,1),h.x=(s[i]/t+1)/2,h.y=(s[i+1]/t+1)/2,u.push(h.x,h.y)}for(i=1;i<=e;i++)a.push(i,i+1,0);this.setIndex(a),this.addAttribute("position",new Nr(s,3)),this.addAttribute("normal",new Nr(c,3)),this.addAttribute("uv",new Nr(u,2))}xo.prototype=Object.create(Sr.prototype),xo.prototype.constructor=xo,_o.prototype=Object.create(zr.prototype),_o.prototype.constructor=_o,_o.prototype.getArrays=function(){var t=this.getAttribute("position"),e=t?Array.prototype.slice.call(t.array):[],n=this.getAttribute("uv"),r=n?Array.prototype.slice.call(n.array):[],i=this.index;return{position:e,uv:r,index:i?Array.prototype.slice.call(i.array):[]}},_o.prototype.addShapeList=function(t,e){var n=t.length;e.arrays=this.getArrays();for(var r=0;rNumber.EPSILON){var f=Math.sqrt(l),d=Math.sqrt(c*c+u*u),p=e.x-s/f,m=e.y+a/f,g=((n.x-u/d-p)*u-(n.y+c/d-m)*c)/(a*u-s*c),v=(r=p+a*g-t.x)*r+(i=m+s*g-t.y)*i;if(v<=2)return new Re(r,i);o=Math.sqrt(v/2)}else{var y=!1;a>Number.EPSILON?c>Number.EPSILON&&(y=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),y?(r=-s,i=a,o=Math.sqrt(l)):(r=a,i=s,o=Math.sqrt(l/2))}return new Re(r/o,i/o)}for(var H=[],k=0,j=P.length,V=j-1,W=k+1;k=0;I--){for(U=I/y,N=g*Math.cos(U*Math.PI/2),O=v*Math.sin(U*Math.PI/2),k=0,j=P.length;k=0;){n=k,(r=k-1)<0&&(r=t.length-1);var i=0,o=b+2*y;for(i=0;i0||0===t.search(/^data\:image\/jpeg/);o.format=n?jt:Vt,o.needsUpdate=!0,void 0!==e&&e(o)},n,r),o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),ia.prototype=Object.assign(Object.create(hr.prototype),{constructor:ia,isLight:!0,copy:function(t){return hr.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=hr.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),oa.prototype=Object.assign(Object.create(ia.prototype),{constructor:oa,isHemisphereLight:!0,copy:function(t){return ia.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(aa.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),sa.prototype=Object.assign(Object.create(aa.prototype),{constructor:sa,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*Ae.RAD2DEG*t.angle,r=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;n===e.fov&&r===e.aspect&&i===e.far||(e.fov=n,e.aspect=r,e.far=i,e.updateProjectionMatrix())}}),ca.prototype=Object.assign(Object.create(ia.prototype),{constructor:ca,isSpotLight:!0,copy:function(t){return ia.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),ua.prototype=Object.assign(Object.create(ia.prototype),{constructor:ua,isPointLight:!0,copy:function(t){return ia.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),la.prototype=Object.assign(Object.create(aa.prototype),{constructor:la}),ha.prototype=Object.assign(Object.create(ia.prototype),{constructor:ha,isDirectionalLight:!0,copy:function(t){return ia.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),fa.prototype=Object.assign(Object.create(ia.prototype),{constructor:fa,isAmbientLight:!0}),da.prototype=Object.assign(Object.create(ia.prototype),{constructor:da,isRectAreaLight:!0,copy:function(t){return ia.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=ia.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}});var pa,ma={arraySlice:function(t,e,n){return ma.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),r=0;r!==e;++r)n[r]=r;return n.sort(function(e,n){return t[e]-t[n]}),n},sortedArray:function(t,e,n){for(var r=t.length,i=new t.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*e,c=0;c!==e;++c)i[a++]=t[s+c];return i},flattenJSON:function(t,e,n,r){for(var i=1,o=t[0];void 0!==o&&void 0===o[r];)o=t[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[r])&&(e.push(o.time),n.push.apply(n,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(e.push(o.time),a.toArray(n,n.length)),o=t[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(e.push(o.time),n.push(a)),o=t[i++]}while(void 0!==o)}}};function ga(t,e,n,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function va(t,e,n,r){ga.call(this,t,e,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function ya(t,e,n,r){ga.call(this,t,e,n,r)}function xa(t,e,n,r){ga.call(this,t,e,n,r)}function _a(t,e,n,r){if(void 0===t)throw new Error("track name is undefined");if(void 0===e||0===e.length)throw new Error("no keyframes in track named "+t);this.name=t,this.times=ma.convertArray(e,this.TimeBufferType),this.values=ma.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function ba(t,e,n,r){_a.call(this,t,e,n,r)}function wa(t,e,n,r){ga.call(this,t,e,n,r)}function Ma(t,e,n,r){_a.call(this,t,e,n,r)}function Ea(t,e,n,r){_a.call(this,t,e,n,r)}function Ta(t,e,n,r){_a.call(this,t,e,n,r)}function Sa(t,e,n){_a.call(this,t,e,n)}function Aa(t,e,n,r){_a.call(this,t,e,n,r)}function Ra(t,e,n,r){_a.apply(this,arguments)}function La(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Ae.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function Pa(t){this.manager=void 0!==t?t:Ko,this.textures={}}function Ca(t){this.manager=void 0!==t?t:Ko}Object.assign(ga.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,r=e[n],i=e[n-1];t:{e:{var o;n:{r:if(!(t=i)break t;var s=e[1];t=(i=e[--n-1]))break e}o=n,n=0}for(;n>>1;te;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=ma.arraySlice(n,i,o),this.values=ma.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrackPrototype: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrackPrototype: Track is empty.",this),t=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrackPrototype: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrackPrototype: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==r&&ma.isTypedArray(r)){a=0;for(var c=r.length;a!==c;++a){var u=r[a];if(isNaN(u)){console.error("THREE.KeyframeTrackPrototype: Value is not a valid number.",this,a,u),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),r=this.getInterpolation()===le,i=1,o=t.length-1,a=1;a0){t[i]=t[o];for(p=o*n,m=i*n,f=0;f!==n;++f)e[m+f]=e[p+f];++i}return i!==t.length&&(this.times=ma.arraySlice(t,0,i),this.values=ma.arraySlice(e,0,i*n)),this}},ba.prototype=Object.assign(Object.create(pa),{constructor:ba,ValueTypeName:"vector"}),wa.prototype=Object.assign(Object.create(ga.prototype),{constructor:wa,interpolate_:function(t,e,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=(n-e)/(r-e),u=s+a;s!==u;s+=4)Ge.slerpFlat(i,0,o,s-a,o,s,c);return i}}),Ma.prototype=Object.assign(Object.create(pa),{constructor:Ma,ValueTypeName:"quaternion",DefaultInterpolation:ue,InterpolantFactoryMethodLinear:function(t){return new wa(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Ea.prototype=Object.assign(Object.create(pa),{constructor:Ea,ValueTypeName:"number"}),Ta.prototype=Object.assign(Object.create(pa),{constructor:Ta,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:ce,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Sa.prototype=Object.assign(Object.create(pa),{constructor:Sa,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:ce,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Aa.prototype=Object.assign(Object.create(pa),{constructor:Aa,ValueTypeName:"color"}),Ra.prototype=pa,pa.constructor=Ra,Object.assign(Ra,{parse:function(t){if(void 0===t.type)throw new Error("track type undefined, can not parse");var e=Ra._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){var n=[],r=[];ma.flattenJSON(t.keys,n,r,"value"),t.times=n,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:ma.convertArray(t.times,Array),values:ma.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ea;case"vector":case"vector2":case"vector3":case"vector4":return ba;case"color":return Aa;case"quaternion":return Ma;case"bool":case"boolean":return Sa;case"string":return Ta}throw new Error("Unsupported typeName: "+t)}}),Object.assign(La,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,o=n.length;i!==o;++i)e.push(Ra.parse(n[i]).scale(r));return new La(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e},i=0,o=n.length;i!==o;++i)e.push(Ra.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var i=e.length,o=[],a=0;a1){var u=r[h=c[1]];u||(r[h]=u=[]),u.push(s)}}var l=[];for(var h in r)l.push(La.CreateFromMorphTargetSequence(h,r[h],e,n));return l},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,i){if(0!==n.length){var o=[],a=[];ma.flattenJSON(n,o,a,r),0!==o.length&&i.push(new t(e,o,a))}},r=[],i=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],c=0;c1?t.skinWeights[r+1]:0,s=n>2?t.skinWeights[r+2]:0,c=n>3?t.skinWeights[r+3]:0;e.skinWeights.push(new Fe(o,a,s,c))}if(t.skinIndices)for(r=0,i=t.skinIndices.length;r1?t.skinIndices[r+1]:0,h=n>2?t.skinIndices[r+2]:0,f=n>3?t.skinIndices[r+3]:0;e.skinIndices.push(new Fe(u,l,h,f))}e.bones=t.bones,e.bones&&e.bones.length>0&&(e.skinWeights.length!==e.skinIndices.length||e.skinIndices.length!==e.vertices.length)&&console.warn("When skinning, number of vertices ("+e.vertices.length+"), skinIndices ("+e.skinIndices.length+"), and skinWeights ("+e.skinWeights.length+") should match.")}(t,n),function(t,e){var n=t.scale;if(void 0!==t.morphTargets)for(var r=0,i=t.morphTargets.length;r0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var l=e.faces,h=t.morphColors[0].colors;for(r=0,i=l.length;r0&&(e.animations=n)}(t,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:n}:{geometry:n,materials:Fa.prototype.initMaterials(t.materials,e,this.crossOrigin)}}}()}),Object.assign(za.prototype,{load:function(t,e,n,r){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var i=this;new Qo(i.manager).load(t,function(n){var o=null;try{o=JSON.parse(n)}catch(e){return void 0!==r&&r(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t+". Use THREE.JSONLoader instead.")},n,r)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var n=this.parseGeometries(t.geometries),r=this.parseImages(t.images,function(){void 0!==e&&e(a)}),i=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,i),a=this.parseObject(t.object,n,o);return t.animations&&(a.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(a),a},parseGeometries:function(t){var e={};if(void 0!==t)for(var n=new Ba,r=new Ca,i=0,o=t.length;i0){var o=new ea(new Jo(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a0?new Gi(s,c):new Yr(s,c);break;case"LOD":i=new Fi;break;case"Line":i=new ki(o(e.geometry),a(e.material),e.mode);break;case"LineLoop":i=new Vi(o(e.geometry),a(e.material));break;case"LineSegments":i=new ji(o(e.geometry),a(e.material));break;case"PointCloud":case"Points":i=new Xi(o(e.geometry),a(e.material));break;case"Sprite":i=new Di(a(e.material));break;case"Group":i=new qi;break;default:i=new hr}if(i.uuid=e.uuid,void 0!==e.name&&(i.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(i.position,i.quaternion,i.scale)):(void 0!==e.position&&i.position.fromArray(e.position),void 0!==e.rotation&&i.rotation.fromArray(e.rotation),void 0!==e.quaternion&&i.quaternion.fromArray(e.quaternion),void 0!==e.scale&&i.scale.fromArray(e.scale)),void 0!==e.castShadow&&(i.castShadow=e.castShadow),void 0!==e.receiveShadow&&(i.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(i.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(i.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&i.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(i.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.children)for(var u in e.children)i.add(this.parseObject(e.children[u],n,r));if("LOD"===e.type)for(var l=e.levels,h=0;h0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(o-1);var u=r[i];return(i+(n-u)/(r[i+1]-u))/(o-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),n>1&&(n=1);var r=this.getPoint(e);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,r,i,o=new He,a=[],s=[],c=[],u=new He,l=new ke;for(n=0;n<=t;n++)r=n/t,a[n]=this.getTangentAt(r),a[n].normalize();s[0]=new He,c[0]=new He;var h=Number.MAX_VALUE,f=Math.abs(a[0].x),d=Math.abs(a[0].y),p=Math.abs(a[0].z);for(f<=h&&(h=f,o.set(1,0,0)),d<=h&&(h=d,o.set(0,1,0)),p<=h&&o.set(0,0,1),u.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],u),c[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),u.crossVectors(a[n-1],a[n]),u.length()>Number.EPSILON&&(u.normalize(),i=Math.acos(Ae.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(l.makeRotationAxis(u,i))),c[n].crossVectors(a[n],s[n]);if(!0===e)for(i=Math.acos(Ae.clamp(s[0].dot(s[t]),-1,1)),i/=t,a[0].dot(u.crossVectors(s[0],s[t]))>0&&(i=-i),n=1;n<=t;n++)s[n].applyMatrix4(l.makeRotationAxis(a[n],i*n)),c[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:c}}}),qa.prototype=Object.create(Xa.prototype),qa.prototype.constructor=qa,qa.prototype.isLineCurve=!0,qa.prototype.getPoint=function(t){if(1===t)return this.v2.clone();var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},qa.prototype.getPointAt=function(t){return this.getPoint(t)},qa.prototype.getTangent=function(t){return this.v2.clone().sub(this.v1).normalize()},Ya.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Ya,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new qa(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),r=0;r=e){var i=n[r]-e,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,r=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},createPointsGeometry:function(t){var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){for(var e=new Sr,n=0,r=t.length;ne;)n-=e;ne.length-2?e.length-1:r+1],c=e[r>e.length-3?e.length-1:r+2];return new Re(ja(i,o.x,a.x,s.x,c.x),ja(i,o.y,a.y,s.y,c.y))},Ka.prototype=Object.create(Xa.prototype),Ka.prototype.constructor=Ka,Ka.prototype.getPoint=function(t){var e=this.v0,n=this.v1,r=this.v2,i=this.v3;return new Re(Wa(t,e.x,n.x,r.x,i.x),Wa(t,e.y,n.y,r.y,i.y))},Qa.prototype=Object.create(Xa.prototype),Qa.prototype.constructor=Qa,Qa.prototype.getPoint=function(t){var e=this.v0,n=this.v1,r=this.v2;return new Re(Va(t,e.x,n.x,r.x),Va(t,e.y,n.y,r.y))};var $a,ts=Object.assign(Object.create(Ya.prototype),{fromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e0){var u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);var l=c.getPoint(1);this.currentPoint.copy(l)}});function es(t){Ya.call(this),this.currentPoint=new Re,t&&this.fromPoints(t)}function ns(){es.apply(this,arguments),this.holes=[]}function rs(){this.subPaths=[],this.currentPath=null}function is(t){this.data=t}function os(t){this.manager=void 0!==t?t:Ko}es.prototype=ts,ts.constructor=es,ns.prototype=Object.assign(Object.create(ts),{constructor:ns,getPointsHoles:function(t){for(var e=[],n=0,r=this.holes.length;nNumber.EPSILON){if(u<0&&(a=e[o],c=-c,s=e[i],u=-u),t.ys.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var l=u*(t.x-a.x)-c*(t.y-a.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return r}var i=yo.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,c,u=[];if(1===o.length)return s=o[0],(c=new ns).curves=s.curves,u.push(c),u;var l=!i(o[0].getPoints());l=t?!l:l;var h,f,d=[],p=[],m=[],g=0;p[g]=void 0,m[g]=[];for(var v=0,y=o.length;v1){for(var x=!1,_=[],b=0,w=p.length;b0&&(x||(m=d))}v=0;for(var R=p.length;v0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t=.5)for(var o=0;o!==i;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,r){Ge.slerpFlat(t,e,t,e,t,n,r)},_lerp:function(t,e,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*r}}}),Object.assign(Os.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Us,{Composite:Os,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Us.Composite(t,e,n):new Us(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(/[^\w-]/g,"")},parseTrackName:(gs=new RegExp("^"+/((?:[\w-]+[\/:])*)/.source+/([\w-\.]+)?/.source+/(?:\.([\w-]+)(?:\[(.+)\])?)?/.source+/\.([\w-]+)(?:\[(.+)\])?/.source+"$"),vs=["material","materials","bones"],function(t){var e=gs.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==vs.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}),findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=function(t){for(var n=0;n=n){var h=n++,f=e[h];r[f.uuid]=l,e[l]=f,r[u]=h,e[h]=c;for(var d=0,p=o;d!==p;++d){var m=i[d],g=m[h],v=m[l];m[l]=g,m[h]=v}}}this.nCachedObjects_=n},uncache:function(t){for(var e=this._objects,n=e.length,r=this.nCachedObjects_,i=this._indicesByUUID,o=this._bindings,a=o.length,s=0,c=arguments.length;s!==c;++s){var u=arguments[s].uuid,l=i[u];if(void 0!==l)if(delete i[u],l0)for(var c=this._interpolants,u=this._propertyBindings,l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].accumulate(r,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(t)[0];e*=r,t>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var n=this._clip.duration,r=this.loop,i=this._loopCount;if(r===oe){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=n)e=n;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{var o=r===se;if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=n||e<0){var a=Math.floor(e/n);e-=n*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(0===s){var c=t<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1==(1&i))return this.time=e,n-e}return this.time=e,e},_setEndings:function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=fe,r.endingEnd=fe):(r.endingStart=t?this.zeroSlopeAtStart?fe:he:de,r.endingEnd=e?this.zeroSlopeAtEnd?fe:he:de)},_scheduleFading:function(t,e,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=n,this}}),Object.assign(Fs.prototype,r.prototype,{_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,i=r.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,u=c[s];void 0===u&&(u={},c[s]=u);for(var l=0;l!==i;++l){var h=r[l],f=h.name,d=u[f];if(void 0!==d)o[l]=d;else{if(void 0!==(d=o[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,f));continue}var p=e&&e._propertyBindings[l].binding.parsedPath;++(d=new Is(Us.create(n,f,p),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,f),o[l]=d}a[l].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var i=t._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,r=e.length;n!==r;++n){var i=e[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e1)r[c=s[1]]||(r[c]={start:1/0,end:-1/0}),o<(u=r[c]).start&&(u.start=o),o>u.end&&(u.end=o),e||(e=c)}for(var c in r){var u=r[c];this.createAnimation(c,u.start,u.end,t)}this.firstAnimation=e},Js.prototype.setAnimationDirectionForward=function(t){var e=this.animationsMap[t];e&&(e.direction=1,e.directionBackwards=!1)},Js.prototype.setAnimationDirectionBackward=function(t){var e=this.animationsMap[t];e&&(e.direction=-1,e.directionBackwards=!0)},Js.prototype.setAnimationFPS=function(t,e){var n=this.animationsMap[t];n&&(n.fps=e,n.duration=(n.end-n.start)/n.fps)},Js.prototype.setAnimationDuration=function(t,e){var n=this.animationsMap[t];n&&(n.duration=e,n.fps=(n.end-n.start)/n.duration)},Js.prototype.setAnimationWeight=function(t,e){var n=this.animationsMap[t];n&&(n.weight=e)},Js.prototype.setAnimationTime=function(t,e){var n=this.animationsMap[t];n&&(n.time=e)},Js.prototype.getAnimationTime=function(t){var e=0,n=this.animationsMap[t];return n&&(e=n.time),e},Js.prototype.getAnimationDuration=function(t){var e=-1,n=this.animationsMap[t];return n&&(e=n.duration),e},Js.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},Js.prototype.stopAnimation=function(t){var e=this.animationsMap[t];e&&(e.active=!1)},Js.prototype.update=function(t){for(var e=0,n=this.animationsList.length;er.duration||r.time<0)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),r.time<0&&(r.time=0,r.directionBackwards=!1)):(r.time=r.time%r.duration,r.time<0&&(r.time+=r.duration));var o=r.start+Ae.clamp(Math.floor(r.time/i),0,r.length-1),a=r.weight;o!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*a,this.morphTargetInfluences[o]=0,r.lastFrame=r.currentFrame,r.currentFrame=o);var s=r.time%i/i;r.directionBackwards&&(s=1-s),r.currentFrame!==r.lastFrame?(this.morphTargetInfluences[r.currentFrame]=s*a,this.morphTargetInfluences[r.lastFrame]=(1-s)*a):this.morphTargetInfluences[r.currentFrame]=a}}},Ks.prototype=Object.create(hr.prototype),Ks.prototype.constructor=Ks,Ks.prototype.isImmediateRenderObject=!0,Qs.prototype=Object.create(ji.prototype),Qs.prototype.constructor=Qs,Qs.prototype.update=function(){var t=new He,e=new He,n=new $n;return function(){var r=["a","b","c"];this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);var i=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,c=a.faces,u=0,l=0,h=c.length;l.99999?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(Ms.set(t.z,0,-t.x).normalize(),ws=Math.acos(t.y),this.quaternion.setFromAxisAngle(Ms,ws))}),lc.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},lc.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},hc.prototype=Object.create(ji.prototype),hc.prototype.constructor=hc;var dc=new He,pc=new fc,mc=new fc,gc=new fc;function vc(t){Xa.call(this),t.length<2&&console.warn("THREE.CatmullRomCurve3: Points array needs at least two entries."),this.points=t||[],this.closed=!1}function yc(t,e,n,r){Xa.call(this),this.v0=t,this.v1=e,this.v2=n,this.v3=r}function xc(t,e,n){Xa.call(this),this.v0=t,this.v1=e,this.v2=n}function _c(t,e){Xa.call(this),this.v1=t,this.v2=e}function bc(t,e,n,r,i,o){Za.call(this,t,e,n,n,r,i,o)}vc.prototype=Object.create(Xa.prototype),vc.prototype.constructor=vc,vc.prototype.getPoint=function(t){var e,n,r,i,o=this.points,a=o.length,s=(a-(this.closed?0:1))*t,c=Math.floor(s),u=s-c;if(this.closed?c+=c>0?0:(Math.floor(Math.abs(c)/o.length)+1)*o.length:0===u&&c===a-1&&(c=a-2,u=1),this.closed||c>0?e=o[(c-1)%a]:(dc.subVectors(o[0],o[1]).add(o[0]),e=dc),n=o[c%a],r=o[(c+1)%a],this.closed||c+2 + * Copyright JS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var o,a=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",u="__lodash_hash_undefined__",l=500,h="__lodash_placeholder__",f=1,d=2,p=4,m=1,g=2,v=1,y=2,x=4,_=8,b=16,w=32,M=64,E=128,T=256,S=512,A=30,R="...",L=800,P=16,C=1,I=2,O=1/0,U=9007199254740991,N=1.7976931348623157e308,D=NaN,F=4294967295,B=F-1,z=F>>>1,G=[["ary",E],["bind",v],["bindKey",y],["curry",_],["curryRight",b],["flip",S],["partial",w],["partialRight",M],["rearg",T]],H="[object Arguments]",k="[object Array]",j="[object AsyncFunction]",V="[object Boolean]",W="[object Date]",X="[object DOMException]",q="[object Error]",Y="[object Function]",Z="[object GeneratorFunction]",J="[object Map]",K="[object Number]",Q="[object Null]",$="[object Object]",tt="[object Proxy]",et="[object RegExp]",nt="[object Set]",rt="[object String]",it="[object Symbol]",ot="[object Undefined]",at="[object WeakMap]",st="[object WeakSet]",ct="[object ArrayBuffer]",ut="[object DataView]",lt="[object Float32Array]",ht="[object Float64Array]",ft="[object Int8Array]",dt="[object Int16Array]",pt="[object Int32Array]",mt="[object Uint8Array]",gt="[object Uint8ClampedArray]",vt="[object Uint16Array]",yt="[object Uint32Array]",xt=/\b__p \+= '';/g,_t=/\b(__p \+=) '' \+/g,bt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,Mt=/[&<>"']/g,Et=RegExp(wt.source),Tt=RegExp(Mt.source),St=/<%-([\s\S]+?)%>/g,At=/<%([\s\S]+?)%>/g,Rt=/<%=([\s\S]+?)%>/g,Lt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pt=/^\w*$/,Ct=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,It=/[\\^$.*+?()[\]{}|]/g,Ot=RegExp(It.source),Ut=/^\s+|\s+$/g,Nt=/^\s+/,Dt=/\s+$/,Ft=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,zt=/,? & /,Gt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ht=/\\(\\)?/g,kt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,jt=/\w*$/,Vt=/^[-+]0x[0-9a-f]+$/i,Wt=/^0b[01]+$/i,Xt=/^\[object .+?Constructor\]$/,qt=/^0o[0-7]+$/i,Yt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jt=/($^)/,Kt=/['\n\r\u2028\u2029\\]/g,Qt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",$t="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+$t+"]",ne="["+Qt+"]",re="\\d+",ie="[\\u2700-\\u27bf]",oe="[a-z\\xdf-\\xf6\\xf8-\\xff]",ae="[^\\ud800-\\udfff"+$t+re+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",ce="[^\\ud800-\\udfff]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",he="[A-Z\\xc0-\\xd6\\xd8-\\xde]",fe="(?:"+oe+"|"+ae+")",de="(?:"+he+"|"+ae+")",pe="(?:"+ne+"|"+se+")"+"?",me="[\\ufe0e\\ufe0f]?"+pe+("(?:\\u200d(?:"+[ce,ue,le].join("|")+")[\\ufe0e\\ufe0f]?"+pe+")*"),ge="(?:"+[ie,ue,le].join("|")+")"+me,ve="(?:"+[ce+ne+"?",ne,ue,le,te].join("|")+")",ye=RegExp("['’]","g"),xe=RegExp(ne,"g"),_e=RegExp(se+"(?="+se+")|"+ve+me,"g"),be=RegExp([he+"?"+oe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,he,"$"].join("|")+")",de+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,he+fe,"$"].join("|")+")",he+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",re,ge].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+Qt+"\\ufe0e\\ufe0f]"),Me=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ee=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Te=-1,Se={};Se[lt]=Se[ht]=Se[ft]=Se[dt]=Se[pt]=Se[mt]=Se[gt]=Se[vt]=Se[yt]=!0,Se[H]=Se[k]=Se[ct]=Se[V]=Se[ut]=Se[W]=Se[q]=Se[Y]=Se[J]=Se[K]=Se[$]=Se[et]=Se[nt]=Se[rt]=Se[at]=!1;var Ae={};Ae[H]=Ae[k]=Ae[ct]=Ae[ut]=Ae[V]=Ae[W]=Ae[lt]=Ae[ht]=Ae[ft]=Ae[dt]=Ae[pt]=Ae[J]=Ae[K]=Ae[$]=Ae[et]=Ae[nt]=Ae[rt]=Ae[it]=Ae[mt]=Ae[gt]=Ae[vt]=Ae[yt]=!0,Ae[q]=Ae[Y]=Ae[at]=!1;var Re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Le=parseFloat,Pe=parseInt,Ce="object"==typeof t&&t&&t.Object===Object&&t,Ie="object"==typeof self&&self&&self.Object===Object&&self,Oe=Ce||Ie||Function("return this")(),Ue=e&&!e.nodeType&&e,Ne=Ue&&"object"==typeof r&&r&&!r.nodeType&&r,De=Ne&&Ne.exports===Ue,Fe=De&&Ce.process,Be=function(){try{var t=Ne&&Ne.require&&Ne.require("util").types;return t||Fe&&Fe.binding&&Fe.binding("util")}catch(t){}}(),ze=Be&&Be.isArrayBuffer,Ge=Be&&Be.isDate,He=Be&&Be.isMap,ke=Be&&Be.isRegExp,je=Be&&Be.isSet,Ve=Be&&Be.isTypedArray;function We(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Xe(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function Qe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function bn(t,e){for(var n=t.length;n--&&cn(e,t[n],0)>-1;);return n}var wn=dn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Mn=dn({"&":"&","<":"<",">":">",'"':""","'":"'"});function En(t){return"\\"+Re[t]}function Tn(t){return we.test(t)}function Sn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function An(t,e){return function(n){return t(e(n))}}function Rn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"});var Un=function t(e){var n,r=(e=null==e?Oe:Un.defaults(Oe.Object(),e,Un.pick(Oe,Ee))).Array,i=e.Date,Qt=e.Error,$t=e.Function,te=e.Math,ee=e.Object,ne=e.RegExp,re=e.String,ie=e.TypeError,oe=r.prototype,ae=$t.prototype,se=ee.prototype,ce=e["__core-js_shared__"],ue=ae.toString,le=se.hasOwnProperty,he=0,fe=(n=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",de=se.toString,pe=ue.call(ee),me=Oe._,ge=ne("^"+ue.call(le).replace(It,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ve=De?e.Buffer:o,_e=e.Symbol,we=e.Uint8Array,Re=ve?ve.allocUnsafe:o,Ce=An(ee.getPrototypeOf,ee),Ie=ee.create,Ue=se.propertyIsEnumerable,Ne=oe.splice,Fe=_e?_e.isConcatSpreadable:o,Be=_e?_e.iterator:o,on=_e?_e.toStringTag:o,dn=function(){try{var t=zo(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Nn=e.clearTimeout!==Oe.clearTimeout&&e.clearTimeout,Dn=i&&i.now!==Oe.Date.now&&i.now,Fn=e.setTimeout!==Oe.setTimeout&&e.setTimeout,Bn=te.ceil,zn=te.floor,Gn=ee.getOwnPropertySymbols,Hn=ve?ve.isBuffer:o,kn=e.isFinite,jn=oe.join,Vn=An(ee.keys,ee),Wn=te.max,Xn=te.min,qn=i.now,Yn=e.parseInt,Zn=te.random,Jn=oe.reverse,Kn=zo(e,"DataView"),Qn=zo(e,"Map"),$n=zo(e,"Promise"),tr=zo(e,"Set"),er=zo(e,"WeakMap"),nr=zo(ee,"create"),rr=er&&new er,ir={},or=ha(Kn),ar=ha(Qn),sr=ha($n),cr=ha(tr),ur=ha(er),lr=_e?_e.prototype:o,hr=lr?lr.valueOf:o,fr=lr?lr.toString:o;function dr(t){if(Rs(t)&&!vs(t)&&!(t instanceof vr)){if(t instanceof gr)return t;if(le.call(t,"__wrapped__"))return fa(t)}return new gr(t)}var pr=function(){function t(){}return function(e){if(!As(e))return{};if(Ie)return Ie(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function mr(){}function gr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function vr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=F,this.__views__=[]}function yr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Nr(t,e,n,r,i,a){var s,c=e&f,u=e&d,l=e&p;if(n&&(s=i?n(t,r,i,a):n(t)),s!==o)return s;if(!As(t))return t;var h=vs(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&le.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!c)return no(t,s)}else{var m=ko(t),g=m==Y||m==Z;if(bs(t))return Ji(t,c);if(m==$||m==H||g&&!i){if(s=u||g?{}:Vo(t),!c)return u?function(t,e){return ro(t,Ho(t),e)}(t,function(t,e){return t&&ro(e,oc(e),t)}(s,t)):function(t,e){return ro(t,Go(t),e)}(t,Cr(s,t))}else{if(!Ae[m])return i?t:{};s=function(t,e,n){var r,i=t.constructor;switch(e){case ct:return Ki(t);case V:case W:return new i(+t);case ut:return function(t,e){var n=e?Ki(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case lt:case ht:case ft:case dt:case pt:case mt:case gt:case vt:case yt:return Qi(t,n);case J:return new i;case K:case rt:return new i(t);case et:return function(t){var e=new t.constructor(t.source,jt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case nt:return new i;case it:return r=t,hr?ee(hr.call(r)):{}}}(t,m,c)}}a||(a=new wr);var v=a.get(t);if(v)return v;if(a.set(t,s),Os(t))return t.forEach(function(r){s.add(Nr(r,e,n,r,t,a))}),s;if(Ls(t))return t.forEach(function(r,i){s.set(i,Nr(r,e,n,i,t,a))}),s;var y=h?o:(l?u?Io:Co:u?oc:ic)(t);return qe(y||t,function(r,i){y&&(r=t[i=r]),Rr(s,i,Nr(r,e,n,i,t,a))}),s}function Dr(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(t);r--;){var i=n[r],a=e[i],s=t[i];if(s===o&&!(i in t)||!a(s))return!1}return!0}function Fr(t,e,n){if("function"!=typeof t)throw new ie(c);return ia(function(){t.apply(o,n)},e)}function Br(t,e,n,r){var i=-1,o=Ke,s=!0,c=t.length,u=[],l=e.length;if(!c)return u;n&&(e=$e(e,vn(n))),r?(o=Qe,s=!1):e.length>=a&&(o=xn,s=!1,e=new br(e));t:for(;++i-1},xr.prototype.set=function(t,e){var n=this.__data__,r=Lr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},_r.prototype.clear=function(){this.size=0,this.__data__={hash:new yr,map:new(Qn||xr),string:new yr}},_r.prototype.delete=function(t){var e=Fo(this,t).delete(t);return this.size-=e?1:0,e},_r.prototype.get=function(t){return Fo(this,t).get(t)},_r.prototype.has=function(t){return Fo(this,t).has(t)},_r.prototype.set=function(t,e){var n=Fo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},br.prototype.add=br.prototype.push=function(t){return this.__data__.set(t,u),this},br.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.clear=function(){this.__data__=new xr,this.size=0},wr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},wr.prototype.get=function(t){return this.__data__.get(t)},wr.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof xr){var r=n.__data__;if(!Qn||r.length0&&n(s)?e>1?Vr(s,e-1,n,r,i):tn(i,s):r||(i[i.length]=s)}return i}var Wr=so(),Xr=so(!0);function qr(t,e){return t&&Wr(t,e,ic)}function Yr(t,e){return t&&Xr(t,e,ic)}function Zr(t,e){return Je(e,function(e){return Es(t[e])})}function Jr(t,e){for(var n=0,r=(e=Xi(e,t)).length;null!=t&&ne}function ti(t,e){return null!=t&&le.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ni(t,e,n){for(var i=n?Qe:Ke,a=t[0].length,s=t.length,c=s,u=r(s),l=1/0,h=[];c--;){var f=t[c];c&&e&&(f=$e(f,vn(e))),l=Xn(f.length,l),u[c]=!n&&(e||a>=120&&f.length>=120)?new br(c&&f):o}f=t[0];var d=-1,p=u[0];t:for(;++d=s)return c;var u=n[r];return c*("desc"==u?-1:1)}}return t.index-e.index}(t,e,n)})}function yi(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)s!==t&&Ne.call(s,c,1),Ne.call(t,c,1);return t}function _i(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Xo(i)?Ne.call(t,i,1):Bi(t,i)}}return t}function bi(t,e){return t+zn(Zn()*(e-t+1))}function wi(t,e){var n="";if(!t||e<1||e>U)return n;do{e%2&&(n+=t),(e=zn(e/2))&&(t+=t)}while(e);return n}function Mi(t,e){return oa(ta(t,e,Pc),t+"")}function Ei(t){return Er(dc(t))}function Ti(t,e){var n=dc(t);return ca(n,Ur(e,0,n.length))}function Si(t,e,n,r){if(!As(t))return t;for(var i=-1,a=(e=Xi(e,t)).length,s=a-1,c=t;null!=c&&++io?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i>>1,a=t[o];null!==a&&!Ns(a)&&(n?a<=e:a=a){var l=e?null:Mo(t);if(l)return Ln(l);s=!1,i=xn,u=new br}else u=e?[]:c;t:for(;++r=r?t:Pi(t,e,n)}var Zi=Nn||function(t){return Oe.clearTimeout(t)};function Ji(t,e){if(e)return t.slice();var n=t.length,r=Re?Re(n):new t.constructor(n);return t.copy(r),r}function Ki(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}function Qi(t,e){var n=e?Ki(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function $i(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,a=Ns(t),s=e!==o,c=null===e,u=e==e,l=Ns(e);if(!c&&!l&&!a&&t>e||a&&s&&u&&!c&&!l||r&&s&&u||!n&&u||!i)return 1;if(!r&&!a&&!l&&t1?n[i-1]:o,s=i>2?n[2]:o;for(a=t.length>3&&"function"==typeof a?(i--,a):o,s&&qo(n[0],n[1],s)&&(a=i<3?o:a,i=1),e=ee(e);++r-1?i[a?e[s]:s]:o}}function fo(t){return Po(function(e){var n=e.length,r=n,i=gr.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new ie(c);if(i&&!s&&"wrapper"==Uo(a))var s=new gr([],!0)}for(r=s?r:n;++r1&&_.reverse(),f&&lc))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var h=-1,f=!0,d=n&g?new br:o;for(a.set(t,e),a.set(e,t);++h-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Ft,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return qe(G,function(n){var r="_."+n[0];e&n[1]&&!Ke(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(Bt);return e?e[1].split(zt):[]}(r),n)))}function sa(t){var e=0,n=0;return function(){var r=qn(),i=P-(r-n);if(n=r,i>0){if(++e>=L)return arguments[0]}else e=0;return t.apply(o,arguments)}}function ca(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,Ia(t,n)});function za(t){var e=dr(t);return e.__chain__=!0,e}function Ga(t,e){return e(t)}var Ha=Po(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Or(e,t)};return!(e>1||this.__actions__.length)&&r instanceof vr&&Xo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Ga,args:[i],thisArg:o}),new gr(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(o),t})):this.thru(i)});var ka=io(function(t,e,n){le.call(t,n)?++t[n]:Ir(t,n,1)});var ja=ho(ga),Va=ho(va);function Wa(t,e){return(vs(t)?qe:zr)(t,Do(e,3))}function Xa(t,e){return(vs(t)?Ye:Gr)(t,Do(e,3))}var qa=io(function(t,e,n){le.call(t,n)?t[n].push(e):Ir(t,n,[e])});var Ya=Mi(function(t,e,n){var i=-1,o="function"==typeof e,a=xs(t)?r(t.length):[];return zr(t,function(t){a[++i]=o?We(e,t,n):ri(t,e,n)}),a}),Za=io(function(t,e,n){Ir(t,n,e)});function Ja(t,e){return(vs(t)?$e:fi)(t,Do(e,3))}var Ka=io(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var Qa=Mi(function(t,e){if(null==t)return[];var n=e.length;return n>1&&qo(t,e[0],e[1])?e=[]:n>2&&qo(e[0],e[1],e[2])&&(e=[e[0]]),vi(t,Vr(e,1),[])}),$a=Dn||function(){return Oe.Date.now()};function ts(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,To(t,E,o,o,o,o,e)}function es(t,e){var n;if("function"!=typeof e)throw new ie(c);return t=Hs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var ns=Mi(function(t,e,n){var r=v;if(n.length){var i=Rn(n,No(ns));r|=w}return To(t,r,e,n,i)}),rs=Mi(function(t,e,n){var r=v|y;if(n.length){var i=Rn(n,No(rs));r|=w}return To(e,r,t,n,i)});function is(t,e,n){var r,i,a,s,u,l,h=0,f=!1,d=!1,p=!0;if("function"!=typeof t)throw new ie(c);function m(e){var n=r,a=i;return r=i=o,h=e,s=t.apply(a,n)}function g(t){var n=t-l;return l===o||n>=e||n<0||d&&t-h>=a}function v(){var t=$a();if(g(t))return y(t);u=ia(v,function(t){var n=e-(t-l);return d?Xn(n,a-(t-h)):n}(t))}function y(t){return u=o,p&&r?m(t):(r=i=o,s)}function x(){var t=$a(),n=g(t);if(r=arguments,i=this,l=t,n){if(u===o)return function(t){return h=t,u=ia(v,e),f?m(t):s}(l);if(d)return u=ia(v,e),m(l)}return u===o&&(u=ia(v,e)),s}return e=js(e)||0,As(n)&&(f=!!n.leading,a=(d="maxWait"in n)?Wn(js(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),x.cancel=function(){u!==o&&Zi(u),h=0,r=l=i=u=o},x.flush=function(){return u===o?s:y($a())},x}var os=Mi(function(t,e){return Fr(t,1,e)}),as=Mi(function(t,e,n){return Fr(t,js(e)||0,n)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(c);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ss.Cache||_r),n}function cs(t){if("function"!=typeof t)throw new ie(c);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=_r;var us=qi(function(t,e){var n=(e=1==e.length&&vs(e[0])?$e(e[0],vn(Do())):$e(Vr(e,1),vn(Do()))).length;return Mi(function(r){for(var i=-1,o=Xn(r.length,n);++i=e}),gs=ii(function(){return arguments}())?ii:function(t){return Rs(t)&&le.call(t,"callee")&&!Ue.call(t,"callee")},vs=r.isArray,ys=ze?vn(ze):function(t){return Rs(t)&&Qr(t)==ct};function xs(t){return null!=t&&Ss(t.length)&&!Es(t)}function _s(t){return Rs(t)&&xs(t)}var bs=Hn||jc,ws=Ge?vn(Ge):function(t){return Rs(t)&&Qr(t)==W};function Ms(t){if(!Rs(t))return!1;var e=Qr(t);return e==q||e==X||"string"==typeof t.message&&"string"==typeof t.name&&!Cs(t)}function Es(t){if(!As(t))return!1;var e=Qr(t);return e==Y||e==Z||e==j||e==tt}function Ts(t){return"number"==typeof t&&t==Hs(t)}function Ss(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=U}function As(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Rs(t){return null!=t&&"object"==typeof t}var Ls=He?vn(He):function(t){return Rs(t)&&ko(t)==J};function Ps(t){return"number"==typeof t||Rs(t)&&Qr(t)==K}function Cs(t){if(!Rs(t)||Qr(t)!=$)return!1;var e=Ce(t);if(null===e)return!0;var n=le.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ue.call(n)==pe}var Is=ke?vn(ke):function(t){return Rs(t)&&Qr(t)==et};var Os=je?vn(je):function(t){return Rs(t)&&ko(t)==nt};function Us(t){return"string"==typeof t||!vs(t)&&Rs(t)&&Qr(t)==rt}function Ns(t){return"symbol"==typeof t||Rs(t)&&Qr(t)==it}var Ds=Ve?vn(Ve):function(t){return Rs(t)&&Ss(t.length)&&!!Se[Qr(t)]};var Fs=_o(hi),Bs=_o(function(t,e){return t<=e});function zs(t){if(!t)return[];if(xs(t))return Us(t)?In(t):no(t);if(Be&&t[Be])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Be]());var e=ko(t);return(e==J?Sn:e==nt?Ln:dc)(t)}function Gs(t){return t?(t=js(t))===O||t===-O?(t<0?-1:1)*N:t==t?t:0:0===t?t:0}function Hs(t){var e=Gs(t),n=e%1;return e==e?n?e-n:e:0}function ks(t){return t?Ur(Hs(t),0,F):0}function js(t){if("number"==typeof t)return t;if(Ns(t))return D;if(As(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=As(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Ut,"");var n=Wt.test(t);return n||qt.test(t)?Pe(t.slice(2),n?2:8):Vt.test(t)?D:+t}function Vs(t){return ro(t,oc(t))}function Ws(t){return null==t?"":Di(t)}var Xs=oo(function(t,e){if(Ko(e)||xs(e))ro(e,ic(e),t);else for(var n in e)le.call(e,n)&&Rr(t,n,e[n])}),qs=oo(function(t,e){ro(e,oc(e),t)}),Ys=oo(function(t,e,n,r){ro(e,oc(e),t,r)}),Zs=oo(function(t,e,n,r){ro(e,ic(e),t,r)}),Js=Po(Or);var Ks=Mi(function(t,e){t=ee(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&qo(e[0],e[1],i)&&(r=1);++n1),e}),ro(t,Io(t),n),r&&(n=Nr(n,f|d|p,Ro));for(var i=e.length;i--;)Bi(n,e[i]);return n});var uc=Po(function(t,e){return null==t?{}:function(t,e){return yi(t,e,function(e,n){return tc(t,n)})}(t,e)});function lc(t,e){if(null==t)return{};var n=$e(Io(t),function(t){return[t]});return e=Do(e),yi(t,n,function(t,n){return e(t,n[0])})}var hc=Eo(ic),fc=Eo(oc);function dc(t){return null==t?[]:yn(t,ic(t))}var pc=uo(function(t,e,n){return e=e.toLowerCase(),t+(n?mc(e):e)});function mc(t){return Mc(Ws(t).toLowerCase())}function gc(t){return(t=Ws(t))&&t.replace(Zt,wn).replace(xe,"")}var vc=uo(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),yc=uo(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),xc=co("toLowerCase");var _c=uo(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var bc=uo(function(t,e,n){return t+(n?" ":"")+Mc(e)});var wc=uo(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Mc=co("toUpperCase");function Ec(t,e,n){return t=Ws(t),(e=n?o:e)===o?function(t){return Me.test(t)}(t)?function(t){return t.match(be)||[]}(t):function(t){return t.match(Gt)||[]}(t):t.match(e)||[]}var Tc=Mi(function(t,e){try{return We(t,o,e)}catch(t){return Ms(t)?t:new Qt(t)}}),Sc=Po(function(t,e){return qe(e,function(e){e=la(e),Ir(t,e,ns(t[e],t))}),t});function Ac(t){return function(){return t}}var Rc=fo(),Lc=fo(!0);function Pc(t){return t}function Cc(t){return ci("function"==typeof t?t:Nr(t,f))}var Ic=Mi(function(t,e){return function(n){return ri(n,t,e)}}),Oc=Mi(function(t,e){return function(n){return ri(t,n,e)}});function Uc(t,e,n){var r=ic(e),i=Zr(e,r);null!=n||As(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Zr(e,ic(e)));var o=!(As(n)&&"chain"in n&&!n.chain),a=Es(t);return qe(i,function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=no(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,tn([this.value()],arguments))})}),t}function Nc(){}var Dc=vo($e),Fc=vo(Ze),Bc=vo(rn);function zc(t){return Yo(t)?fn(la(t)):function(t){return function(e){return Jr(e,t)}}(t)}var Gc=xo(),Hc=xo(!0);function kc(){return[]}function jc(){return!1}var Vc=go(function(t,e){return t+e},0),Wc=wo("ceil"),Xc=go(function(t,e){return t/e},1),qc=wo("floor");var Yc,Zc=go(function(t,e){return t*e},1),Jc=wo("round"),Kc=go(function(t,e){return t-e},0);return dr.after=function(t,e){if("function"!=typeof e)throw new ie(c);return t=Hs(t),function(){if(--t<1)return e.apply(this,arguments)}},dr.ary=ts,dr.assign=Xs,dr.assignIn=qs,dr.assignInWith=Ys,dr.assignWith=Zs,dr.at=Js,dr.before=es,dr.bind=ns,dr.bindAll=Sc,dr.bindKey=rs,dr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return vs(t)?t:[t]},dr.chain=za,dr.chunk=function(t,e,n){e=(n?qo(t,e,n):e===o)?1:Wn(Hs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var a=0,s=0,c=r(Bn(i/e));ai?0:i+n),(r=r===o||r>i?i:Hs(r))<0&&(r+=i),r=n>r?0:ks(r);n>>0)?(t=Ws(t))&&("string"==typeof e||null!=e&&!Is(e))&&!(e=Di(e))&&Tn(t)?Yi(In(t),0,n):t.split(e,n):[]},dr.spread=function(t,e){if("function"!=typeof t)throw new ie(c);return e=null==e?0:Wn(Hs(e),0),Mi(function(n){var r=n[e],i=Yi(n,0,e);return r&&tn(i,r),We(t,this,i)})},dr.tail=function(t){var e=null==t?0:t.length;return e?Pi(t,1,e):[]},dr.take=function(t,e,n){return t&&t.length?Pi(t,0,(e=n||e===o?1:Hs(e))<0?0:e):[]},dr.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Pi(t,(e=r-(e=n||e===o?1:Hs(e)))<0?0:e,r):[]},dr.takeRightWhile=function(t,e){return t&&t.length?Gi(t,Do(e,3),!1,!0):[]},dr.takeWhile=function(t,e){return t&&t.length?Gi(t,Do(e,3)):[]},dr.tap=function(t,e){return e(t),t},dr.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new ie(c);return As(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),is(t,e,{leading:r,maxWait:e,trailing:i})},dr.thru=Ga,dr.toArray=zs,dr.toPairs=hc,dr.toPairsIn=fc,dr.toPath=function(t){return vs(t)?$e(t,la):Ns(t)?[t]:no(ua(Ws(t)))},dr.toPlainObject=Vs,dr.transform=function(t,e,n){var r=vs(t),i=r||bs(t)||Ds(t);if(e=Do(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:As(t)&&Es(o)?pr(Ce(t)):{}}return(i?qe:qr)(t,function(t,r,i){return e(n,t,r,i)}),n},dr.unary=function(t){return ts(t,1)},dr.union=Ra,dr.unionBy=La,dr.unionWith=Pa,dr.uniq=function(t){return t&&t.length?Fi(t):[]},dr.uniqBy=function(t,e){return t&&t.length?Fi(t,Do(e,2)):[]},dr.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?Fi(t,o,e):[]},dr.unset=function(t,e){return null==t||Bi(t,e)},dr.unzip=Ca,dr.unzipWith=Ia,dr.update=function(t,e,n){return null==t?t:zi(t,e,Wi(n))},dr.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:zi(t,e,Wi(n),r)},dr.values=dc,dr.valuesIn=function(t){return null==t?[]:yn(t,oc(t))},dr.without=Oa,dr.words=Ec,dr.wrap=function(t,e){return ls(Wi(e),t)},dr.xor=Ua,dr.xorBy=Na,dr.xorWith=Da,dr.zip=Fa,dr.zipObject=function(t,e){return ji(t||[],e||[],Rr)},dr.zipObjectDeep=function(t,e){return ji(t||[],e||[],Si)},dr.zipWith=Ba,dr.entries=hc,dr.entriesIn=fc,dr.extend=qs,dr.extendWith=Ys,Uc(dr,dr),dr.add=Vc,dr.attempt=Tc,dr.camelCase=pc,dr.capitalize=mc,dr.ceil=Wc,dr.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=js(n))==n?n:0),e!==o&&(e=(e=js(e))==e?e:0),Ur(js(t),e,n)},dr.clone=function(t){return Nr(t,p)},dr.cloneDeep=function(t){return Nr(t,f|p)},dr.cloneDeepWith=function(t,e){return Nr(t,f|p,e="function"==typeof e?e:o)},dr.cloneWith=function(t,e){return Nr(t,p,e="function"==typeof e?e:o)},dr.conformsTo=function(t,e){return null==e||Dr(t,e,ic(e))},dr.deburr=gc,dr.defaultTo=function(t,e){return null==t||t!=t?e:t},dr.divide=Xc,dr.endsWith=function(t,e,n){t=Ws(t),e=Di(e);var r=t.length,i=n=n===o?r:Ur(Hs(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},dr.eq=ds,dr.escape=function(t){return(t=Ws(t))&&Tt.test(t)?t.replace(Mt,Mn):t},dr.escapeRegExp=function(t){return(t=Ws(t))&&Ot.test(t)?t.replace(It,"\\$&"):t},dr.every=function(t,e,n){var r=vs(t)?Ze:Hr;return n&&qo(t,e,n)&&(e=o),r(t,Do(e,3))},dr.find=ja,dr.findIndex=ga,dr.findKey=function(t,e){return an(t,Do(e,3),qr)},dr.findLast=Va,dr.findLastIndex=va,dr.findLastKey=function(t,e){return an(t,Do(e,3),Yr)},dr.floor=qc,dr.forEach=Wa,dr.forEachRight=Xa,dr.forIn=function(t,e){return null==t?t:Wr(t,Do(e,3),oc)},dr.forInRight=function(t,e){return null==t?t:Xr(t,Do(e,3),oc)},dr.forOwn=function(t,e){return t&&qr(t,Do(e,3))},dr.forOwnRight=function(t,e){return t&&Yr(t,Do(e,3))},dr.get=$s,dr.gt=ps,dr.gte=ms,dr.has=function(t,e){return null!=t&&jo(t,e,ti)},dr.hasIn=tc,dr.head=xa,dr.identity=Pc,dr.includes=function(t,e,n,r){t=xs(t)?t:dc(t),n=n&&!r?Hs(n):0;var i=t.length;return n<0&&(n=Wn(i+n,0)),Us(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&cn(t,e,n)>-1},dr.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Hs(n);return i<0&&(i=Wn(r+i,0)),cn(t,e,i)},dr.inRange=function(t,e,n){return e=Gs(e),n===o?(n=e,e=0):n=Gs(n),function(t,e,n){return t>=Xn(e,n)&&t=-U&&t<=U},dr.isSet=Os,dr.isString=Us,dr.isSymbol=Ns,dr.isTypedArray=Ds,dr.isUndefined=function(t){return t===o},dr.isWeakMap=function(t){return Rs(t)&&ko(t)==at},dr.isWeakSet=function(t){return Rs(t)&&Qr(t)==st},dr.join=function(t,e){return null==t?"":jn.call(t,e)},dr.kebabCase=vc,dr.last=Ma,dr.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=Hs(n))<0?Wn(r+i,0):Xn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):sn(t,ln,i,!0)},dr.lowerCase=yc,dr.lowerFirst=xc,dr.lt=Fs,dr.lte=Bs,dr.max=function(t){return t&&t.length?kr(t,Pc,$r):o},dr.maxBy=function(t,e){return t&&t.length?kr(t,Do(e,2),$r):o},dr.mean=function(t){return hn(t,Pc)},dr.meanBy=function(t,e){return hn(t,Do(e,2))},dr.min=function(t){return t&&t.length?kr(t,Pc,hi):o},dr.minBy=function(t,e){return t&&t.length?kr(t,Do(e,2),hi):o},dr.stubArray=kc,dr.stubFalse=jc,dr.stubObject=function(){return{}},dr.stubString=function(){return""},dr.stubTrue=function(){return!0},dr.multiply=Zc,dr.nth=function(t,e){return t&&t.length?gi(t,Hs(e)):o},dr.noConflict=function(){return Oe._===this&&(Oe._=me),this},dr.noop=Nc,dr.now=$a,dr.pad=function(t,e,n){t=Ws(t);var r=(e=Hs(e))?Cn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return yo(zn(i),n)+t+yo(Bn(i),n)},dr.padEnd=function(t,e,n){t=Ws(t);var r=(e=Hs(e))?Cn(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Zn();return Xn(t+i*(e-t+Le("1e-"+((i+"").length-1))),e)}return bi(t,e)},dr.reduce=function(t,e,n){var r=vs(t)?en:pn,i=arguments.length<3;return r(t,Do(e,4),n,i,zr)},dr.reduceRight=function(t,e,n){var r=vs(t)?nn:pn,i=arguments.length<3;return r(t,Do(e,4),n,i,Gr)},dr.repeat=function(t,e,n){return e=(n?qo(t,e,n):e===o)?1:Hs(e),wi(Ws(t),e)},dr.replace=function(){var t=arguments,e=Ws(t[0]);return t.length<3?e:e.replace(t[1],t[2])},dr.result=function(t,e,n){var r=-1,i=(e=Xi(e,t)).length;for(i||(i=1,t=o);++rU)return[];var n=F,r=Xn(t,F);e=Do(e),t-=F;for(var i=gn(r,e);++n=a)return t;var c=n-Cn(r);if(c<1)return r;var u=s?Yi(s,0,c).join(""):t.slice(0,c);if(i===o)return u+r;if(s&&(c+=u.length-c),Is(i)){if(t.slice(c).search(i)){var l,h=u;for(i.global||(i=ne(i.source,Ws(jt.exec(i))+"g")),i.lastIndex=0;l=i.exec(h);)var f=l.index;u=u.slice(0,f===o?c:f)}}else if(t.indexOf(Di(i),c)!=c){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r},dr.unescape=function(t){return(t=Ws(t))&&Et.test(t)?t.replace(wt,On):t},dr.uniqueId=function(t){var e=++he;return Ws(t)+e},dr.upperCase=wc,dr.upperFirst=Mc,dr.each=Wa,dr.eachRight=Xa,dr.first=xa,Uc(dr,(Yc={},qr(dr,function(t,e){le.call(dr.prototype,e)||(Yc[e]=t)}),Yc),{chain:!1}),dr.VERSION="4.17.11",qe(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){dr[t].placeholder=dr}),qe(["drop","take"],function(t,e){vr.prototype[t]=function(n){n=n===o?1:Wn(Hs(n),0);var r=this.__filtered__&&!e?new vr(this):this.clone();return r.__filtered__?r.__takeCount__=Xn(n,r.__takeCount__):r.__views__.push({size:Xn(n,F),type:t+(r.__dir__<0?"Right":"")}),r},vr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),qe(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==C||3==n;vr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Do(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),qe(["head","last"],function(t,e){var n="take"+(e?"Right":"");vr.prototype[t]=function(){return this[n](1).value()[0]}}),qe(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");vr.prototype[t]=function(){return this.__filtered__?new vr(this):this[n](1)}}),vr.prototype.compact=function(){return this.filter(Pc)},vr.prototype.find=function(t){return this.filter(t).head()},vr.prototype.findLast=function(t){return this.reverse().find(t)},vr.prototype.invokeMap=Mi(function(t,e){return"function"==typeof t?new vr(this):this.map(function(n){return ri(n,t,e)})}),vr.prototype.reject=function(t){return this.filter(cs(Do(t)))},vr.prototype.slice=function(t,e){t=Hs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new vr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=Hs(e))<0?n.dropRight(-e):n.take(e-t)),n)},vr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vr.prototype.toArray=function(){return this.take(F)},qr(vr.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=dr[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);i&&(dr.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,c=e instanceof vr,u=s[0],l=c||vs(e),h=function(t){var e=i.apply(dr,tn([t],s));return r&&f?e[0]:e};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var f=this.__chain__,d=!!this.__actions__.length,p=a&&!f,m=c&&!d;if(!a&&l){e=m?e:new vr(this);var g=t.apply(e,s);return g.__actions__.push({func:Ga,args:[h],thisArg:o}),new gr(g,f)}return p&&m?t.apply(this,s):(g=this.thru(h),p?r?g.value()[0]:g.value():g)})}),qe(["pop","push","shift","sort","splice","unshift"],function(t){var e=oe[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);dr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(vs(i)?i:[],t)}return this[n](function(n){return e.apply(vs(n)?n:[],t)})}}),qr(vr.prototype,function(t,e){var n=dr[e];if(n){var r=n.name+"";(ir[r]||(ir[r]=[])).push({name:e,func:n})}}),ir[po(o,y).name]=[{name:"wrapper",func:o}],vr.prototype.clone=function(){var t=new vr(this.__wrapped__);return t.__actions__=no(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=no(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=no(this.__views__),t},vr.prototype.reverse=function(){if(this.__filtered__){var t=new vr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},vr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=vs(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},dr.prototype.plant=function(t){for(var e,n=this;n instanceof mr;){var r=fa(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},dr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof vr){var e=t;return this.__actions__.length&&(e=new vr(this)),(e=e.reverse()).__actions__.push({func:Ga,args:[Aa],thisArg:o}),new gr(e,this.__chain__)}return this.thru(Aa)},dr.prototype.toJSON=dr.prototype.valueOf=dr.prototype.value=function(){return Hi(this.__wrapped__,this.__actions__)},dr.prototype.first=dr.prototype.head,Be&&(dr.prototype[Be]=function(){return this}),dr}();Oe._=Un,(i=function(){return Un}.call(e,n,e,r))===o||(r.exports=i)}).call(this)}).call(this,n(4),n(5)(t))},function(t,e,n){"use strict";const r=n(0);t.exports={Coins:new class{constructor(){this.setRadius(3),this.coinMaterial=new r.MeshStandardMaterial({color:13938487,roughness:.5,metalness:1})}setRadius(t){this.coinRadius=t,this.coinGeometry=this.generateCoinGeometry()}generateCoinGeometry(){let t=.18*this.coinRadius,e=.16*this.coinRadius,n=t/4,i=n+.25,o={amount:n,steps:1,curveSegments:24,bevelEnabled:!0,bevelSize:.25,bevelThickness:.25,bevelSegments:2},a=new r.TorusGeometry(this.coinRadius,.1*this.coinRadius,8,64),s=new r.CylinderGeometry(this.coinRadius,this.coinRadius,t,16);s.rotateX(Math.PI/2);let c=new r.Shape;c.moveTo(-3,1),c.lineTo(-3,2),c.bezierCurveTo(-2.75,1.75,-.75,3.5,-1,4),c.lineTo(1,4),c.lineTo(1,-3),c.lineTo(3,-3),c.lineTo(3,-4),c.lineTo(-3,-4),c.lineTo(-3,-3),c.lineTo(-1,-3),c.lineTo(-1,2),c.bezierCurveTo(-.8,1.8,-2.8,.8,-3,1);let u=new r.ExtrudeGeometry(c,o),l=new r.Mesh(u,this.coinMaterial);l.position.z-=n/2*e,l.position.z+=t/2,l.position.z-=i/2*e,l.scale.set(e,e,e);let h=new r.Shape;h.moveTo(0,4),h.bezierCurveTo(4,4,4,-4,0,-4),h.bezierCurveTo(-4,-4,-4,4,0,4);let f=new r.Path;f.moveTo(0,2.5),f.bezierCurveTo(-2.5,2.5,-2.5,-2.5,0,-2.5),f.bezierCurveTo(2.5,-2.5,2.5,2.5,0,2.5),h.holes.push(f);let d=new r.Shape;d.moveTo(-3.5,-2.5),d.lineTo(2.5,3.5),d.lineTo(3.5,2.5),d.lineTo(-2.5,-3.5),d.lineTo(-3.5,-2.5);let p=new r.ExtrudeGeometry(h,o),m=new r.ExtrudeGeometry(d,o),g=new r.Mesh(p,this.coinMaterial),v=new r.Mesh(m,this.coinMaterial);g.scale.set(e,e,e),v.scale.set(e,e,e),g.position.z-=n/2*e,v.position.z-=n/2*e,g.position.z-=t/2,v.position.z-=t/2,g.position.z+=i/2*e,v.position.z+=i/2*e;let y=new r.Geometry;return y.merge(a),y.merge(s),y.mergeMesh(l),y.mergeMesh(g),y.mergeMesh(v),y}createCoin(){return new r.Mesh(this.coinGeometry,this.coinMaterial)}createCoins(t=1){let e=[];for(let n=0;n=1&&this.animationCallbacks.shift()}.bind(this))}addAnimation(t){return this.animationCallbacks.push(t),this}animate(){requestAnimationFrame(this.getAnimateFunction());for(let t of this.animationCallbacks)t();this.renderer.render(this.scene,this.camera)}getAnimateFunction(){return this.animateFunction||(this.animateFunction=this.animate.bind(this)),this.animateFunction}showAxes(t={}){let e=r.assign({x:0,y:0,z:0,distance:1e5},t),n=new i.LineBasicMaterial({color:16711680,linewidth:1}),o=new i.LineBasicMaterial({color:65280,linewidth:1}),a=new i.LineBasicMaterial({color:255,linewidth:1}),s=new i.Geometry,c=new i.Geometry,u=new i.Geometry;s.vertices.push(new i.Vector3(e.distance,e.y,e.z),new i.Vector3(-1*e.distance,e.y,e.z)),c.vertices.push(new i.Vector3(e.x,e.distance,e.z),new i.Vector3(e.x,-1*e.distance,e.z)),u.vertices.push(new i.Vector3(e.x,e.y,e.distance),new i.Vector3(e.x,e.y,-1*e.distance));var l=new i.Line(s,n),h=new i.Line(c,o),f=new i.Line(u,a);this.scene.add(l,h,f)}}}},function(t,e,n){"use strict";const r=n(1),i=n(0),{Coins:o}=n(2);t.exports={CoinTunnel:class{constructor(t={}){this.opts=r.assign({radius:100,length:400,totalCoins:500,coinRotationSpeed:.05,pathSpeedMin:.001,pathSpeedMax:.001,rotateTunnel:!1,tunnelRotationSpeed:5e-4,excludeCenter:!0,scalePoint:.05,debug:!1},t),this.createTunnel(),this.initCoins()}createTunnel(){if(this.calculateCoinPaths(),this.tunnel=this.createTunnelMesh(),this.opts.debug){let t=new i.LineBasicMaterial({color:16711680,transparent:!0,opacity:.5});for(let e of this.coinPaths){let n=new i.Geometry;n.vertices.push(e.v1,e.v2);let r=new i.Line(n,t);this.tunnel.add(r)}}}createTunnelMesh(){let t=new i.CylinderGeometry(this.opts.radius,this.opts.radius,this.opts.length,16),e=new i.MeshBasicMaterial({color:65280,wireframe:!0,transparent:!0,opacity:this.opts.debug?.5:0});return new i.Mesh(t,e)}getCoinSpeed(){let t=this.opts.pathSpeedMax-this.opts.pathSpeedMin;return Math.random()*t+this.opts.pathSpeedMin}setCoinRotation(t){t.rotation.y=Math.PI*(.5*Math.random()),t.rotation.x=Math.PI*(.5*Math.random()),t.rotation.z=Math.PI*(.5*Math.random()),t.rotationPerStep={x:2*(.5-Math.random())*this.opts.coinRotationSpeed,z:2*(.5-Math.random())*this.opts.coinRotationSpeed}}randomizeCoinPath(t){t.path=r.sample(this.coinPaths);let e=t.path.getPoint(t.pathProgress);t.position.x=e.x,t.position.y=e.y,t.position.z=e.z}initCoins(){this.coins=[];for(let t=0;t{t.rotation[n]+=e}),t.pathProgress+=t.pathProgressPerStep;let e=t.path.getPoint(t.pathProgress);t.position.y=e.y,t.pathProgress>1&&(t.pathProgress=0,this.setCoinRotation(t),this.randomizeCoinPath(t));let n=t.pathProgress<=this.opts.scalePoint?Math.max(t.pathProgress/this.opts.scalePoint,1e-4):1;t.scale.set(n,n,n)}this.opts.rotateTunnel&&(this.tunnel.rotation.y+=this.opts.tunnelRotationSpeed)}}}},function(t,e,n){const r=n(0);r.OrbitControls=function(t,e){var n,i,o,a,s;this.object=t,this.domElement=void 0!==e?e:document,this.enabled=!0,this.target=new r.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:r.MOUSE.LEFT,ZOOM:r.MOUSE.MIDDLE,PAN:r.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){c.target0.copy(c.target),c.position0.copy(c.object.position),c.zoom0=c.object.zoom},this.reset=function(){c.target.copy(c.target0),c.object.position.copy(c.position0),c.object.zoom=c.zoom0,c.object.updateProjectionMatrix(),c.dispatchEvent(u),c.update(),d=f.NONE},this.update=(n=new r.Vector3,i=(new r.Quaternion).setFromUnitVectors(t.up,new r.Vector3(0,1,0)),o=i.clone().inverse(),a=new r.Vector3,s=new r.Quaternion,function(){var t=c.object.position;return n.copy(t).sub(c.target),n.applyQuaternion(i),m.setFromVector3(n),c.autoRotate&&d===f.NONE&&P(2*Math.PI/60/60*c.autoRotateSpeed),m.theta+=g.theta,m.phi+=g.phi,m.theta=Math.max(c.minAzimuthAngle,Math.min(c.maxAzimuthAngle,m.theta)),m.phi=Math.max(c.minPolarAngle,Math.min(c.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=v,m.radius=Math.max(c.minDistance,Math.min(c.maxDistance,m.radius)),c.target.add(y),n.setFromSpherical(m),n.applyQuaternion(o),t.copy(c.target).add(n),c.object.lookAt(c.target),!0===c.enableDamping?(g.theta*=1-c.dampingFactor,g.phi*=1-c.dampingFactor):g.set(0,0,0),v=1,y.set(0,0,0),!!(x||a.distanceToSquared(c.object.position)>p||8*(1-s.dot(c.object.quaternion))>p)&&(c.dispatchEvent(u),a.copy(c.object.position),s.copy(c.object.quaternion),x=!1,!0)}),this.dispose=function(){c.domElement.removeEventListener("contextmenu",X,!1),c.domElement.removeEventListener("mousedown",B,!1),c.domElement.removeEventListener("wheel",H,!1),c.domElement.removeEventListener("touchstart",j,!1),c.domElement.removeEventListener("touchend",W,!1),c.domElement.removeEventListener("touchmove",V,!1),document.removeEventListener("mousemove",z,!1),document.removeEventListener("mouseup",G,!1),window.removeEventListener("keydown",k,!1)};var c=this,u={type:"change"},l={type:"start"},h={type:"end"},f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=f.NONE,p=1e-6,m=new r.Spherical,g=new r.Spherical,v=1,y=new r.Vector3,x=!1,_=new r.Vector2,b=new r.Vector2,w=new r.Vector2,M=new r.Vector2,E=new r.Vector2,T=new r.Vector2,S=new r.Vector2,A=new r.Vector2,R=new r.Vector2;function L(){return Math.pow(.95,c.zoomSpeed)}function P(t){g.theta-=t}function C(t){g.phi-=t}var I,O=(I=new r.Vector3,function(t,e){I.setFromMatrixColumn(e,0),I.multiplyScalar(-t),y.add(I)}),U=function(){var t=new r.Vector3;return function(e,n){t.setFromMatrixColumn(n,1),t.multiplyScalar(e),y.add(t)}}(),N=function(){var t=new r.Vector3;return function(e,n){var i=c.domElement===document?c.domElement.body:c.domElement;if(c.object instanceof r.PerspectiveCamera){var o=c.object.position;t.copy(o).sub(c.target);var a=t.length();a*=Math.tan(c.object.fov/2*Math.PI/180),O(2*e*a/i.clientHeight,c.object.matrix),U(2*n*a/i.clientHeight,c.object.matrix)}else c.object instanceof r.OrthographicCamera?(O(e*(c.object.right-c.object.left)/c.object.zoom/i.clientWidth,c.object.matrix),U(n*(c.object.top-c.object.bottom)/c.object.zoom/i.clientHeight,c.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),c.enablePan=!1)}}();function D(t){c.object instanceof r.PerspectiveCamera?v/=t:c.object instanceof r.OrthographicCamera?(c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom*t)),c.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),c.enableZoom=!1)}function F(t){c.object instanceof r.PerspectiveCamera?v*=t:c.object instanceof r.OrthographicCamera?(c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom/t)),c.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),c.enableZoom=!1)}function B(t){if(!1!==c.enabled){switch(t.preventDefault(),t.button){case c.mouseButtons.ORBIT:if(!1===c.enableRotate)return;!function(t){_.set(t.clientX,t.clientY)}(t),d=f.ROTATE;break;case c.mouseButtons.ZOOM:if(!1===c.enableZoom)return;!function(t){S.set(t.clientX,t.clientY)}(t),d=f.DOLLY;break;case c.mouseButtons.PAN:if(!1===c.enablePan)return;!function(t){M.set(t.clientX,t.clientY)}(t),d=f.PAN}d!==f.NONE&&(document.addEventListener("mousemove",z,!1),document.addEventListener("mouseup",G,!1),c.dispatchEvent(l))}}function z(t){if(!1!==c.enabled)switch(t.preventDefault(),d){case f.ROTATE:if(!1===c.enableRotate)return;!function(t){b.set(t.clientX,t.clientY),w.subVectors(b,_);var e=c.domElement===document?c.domElement.body:c.domElement;P(2*Math.PI*w.x/e.clientWidth*c.rotateSpeed),C(2*Math.PI*w.y/e.clientHeight*c.rotateSpeed),_.copy(b),c.update()}(t);break;case f.DOLLY:if(!1===c.enableZoom)return;!function(t){A.set(t.clientX,t.clientY),R.subVectors(A,S),R.y>0?D(L()):R.y<0&&F(L()),S.copy(A),c.update()}(t);break;case f.PAN:if(!1===c.enablePan)return;!function(t){E.set(t.clientX,t.clientY),T.subVectors(E,M),N(T.x,T.y),M.copy(E),c.update()}(t)}}function G(t){!1!==c.enabled&&(document.removeEventListener("mousemove",z,!1),document.removeEventListener("mouseup",G,!1),c.dispatchEvent(h),d=f.NONE)}function H(t){!1===c.enabled||!1===c.enableZoom||d!==f.NONE&&d!==f.ROTATE||(t.preventDefault(),t.stopPropagation(),function(t){t.deltaY<0?F(L()):t.deltaY>0&&D(L()),c.update()}(t),c.dispatchEvent(l),c.dispatchEvent(h))}function k(t){!1!==c.enabled&&!1!==c.enableKeys&&!1!==c.enablePan&&function(t){switch(t.keyCode){case c.keys.UP:N(0,c.keyPanSpeed),c.update();break;case c.keys.BOTTOM:N(0,-c.keyPanSpeed),c.update();break;case c.keys.LEFT:N(c.keyPanSpeed,0),c.update();break;case c.keys.RIGHT:N(-c.keyPanSpeed,0),c.update()}}(t)}function j(t){if(!1!==c.enabled){switch(t.touches.length){case 1:if(!1===c.enableRotate)return;!function(t){_.set(t.touches[0].pageX,t.touches[0].pageY)}(t),d=f.TOUCH_ROTATE;break;case 2:if(!1===c.enableZoom)return;!function(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);S.set(0,r)}(t),d=f.TOUCH_DOLLY;break;case 3:if(!1===c.enablePan)return;!function(t){M.set(t.touches[0].pageX,t.touches[0].pageY)}(t),d=f.TOUCH_PAN;break;default:d=f.NONE}d!==f.NONE&&c.dispatchEvent(l)}}function V(t){if(!1!==c.enabled)switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:if(!1===c.enableRotate)return;if(d!==f.TOUCH_ROTATE)return;!function(t){b.set(t.touches[0].pageX,t.touches[0].pageY),w.subVectors(b,_);var e=c.domElement===document?c.domElement.body:c.domElement;P(2*Math.PI*w.x/e.clientWidth*c.rotateSpeed),C(2*Math.PI*w.y/e.clientHeight*c.rotateSpeed),_.copy(b),c.update()}(t);break;case 2:if(!1===c.enableZoom)return;if(d!==f.TOUCH_DOLLY)return;!function(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);A.set(0,r),R.subVectors(A,S),R.y>0?F(L()):R.y<0&&D(L()),S.copy(A),c.update()}(t);break;case 3:if(!1===c.enablePan)return;if(d!==f.TOUCH_PAN)return;!function(t){E.set(t.touches[0].pageX,t.touches[0].pageY),T.subVectors(E,M),N(T.x,T.y),M.copy(E),c.update()}(t);break;default:d=f.NONE}}function W(t){!1!==c.enabled&&(c.dispatchEvent(h),d=f.NONE)}function X(t){!1!==c.enabled&&t.preventDefault()}c.domElement.addEventListener("contextmenu",X,!1),c.domElement.addEventListener("mousedown",B,!1),c.domElement.addEventListener("wheel",H,!1),c.domElement.addEventListener("touchstart",j,!1),c.domElement.addEventListener("touchend",W,!1),c.domElement.addEventListener("touchmove",V,!1),window.addEventListener("keydown",k,!1),this.update()},r.OrbitControls.prototype=Object.create(r.EventDispatcher.prototype),r.OrbitControls.prototype.constructor=r.OrbitControls,Object.defineProperties(r.OrbitControls.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(t){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!t}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(t){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!t}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(t){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!t}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(t){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!t}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(t){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!t}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(t){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=t}}})}]); \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index afe48ac..52ea980 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,10 +1,10 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' -import './App.css' +import { useState } from "react"; +import reactLogo from "./assets/react.svg"; +import viteLogo from "/vite.svg"; +import "./App.css"; function App() { - const [count, setCount] = useState(0) + const [count, setCount] = useState(0); return ( <> @@ -29,7 +29,7 @@ function App() { Click on the Vite and React logos to learn more

- ) + ); } -export default App +export default App; diff --git a/src/main.tsx b/src/main.tsx index 3d7150d..f25366e 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,10 +1,10 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App.tsx' -import './index.css' +import React from "react"; +import ReactDOM from "react-dom/client"; +import App from "./App.tsx"; +import "./index.css"; -ReactDOM.createRoot(document.getElementById('root')!).render( +ReactDOM.createRoot(document.getElementById("root")!).render( , -) +); diff --git a/vite.config.ts b/vite.config.ts index 861b04b..d366e8c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,7 @@ -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react-swc' +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react-swc"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], -}) +}); diff --git a/yarn.lock b/yarn.lock index 1177d81..09b25db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,13 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== +"@babel/runtime@^7.17.8": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.15.tgz#38f46494ccf6cf020bd4eed7124b425e83e523b8" + integrity sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA== + dependencies: + regenerator-runtime "^0.14.0" + "@esbuild/android-arm64@0.18.20": version "0.18.20" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622" @@ -189,6 +196,21 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@react-three/fiber@^8.14.1": + version "8.14.1" + resolved "https://registry.yarnpkg.com/@react-three/fiber/-/fiber-8.14.1.tgz#08a6b02946aa0a5a0e2dd558ddf6bb70dedc717f" + integrity sha512-Ky/FiCyJiyaI8bd+vckzgkHgKDSQDOcSSUVFOHCuCO9XOLb7Ebs6lof2hPpFa1HkaeE5ZIbTWIprvN0QqdPF0w== + dependencies: + "@babel/runtime" "^7.17.8" + "@types/react-reconciler" "^0.26.7" + base64-js "^1.5.1" + its-fine "^1.0.6" + react-reconciler "^0.27.0" + react-use-measure "^2.1.1" + scheduler "^0.21.0" + suspend-react "^0.1.3" + zustand "^3.7.1" + "@swc/core-darwin-arm64@1.3.84": version "1.3.84" resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.84.tgz#9296626f9377e9bf92e41f9fe60a7cdc8c660e99" @@ -279,6 +301,20 @@ dependencies: "@types/react" "*" +"@types/react-reconciler@^0.26.7": + version "0.26.7" + resolved "https://registry.yarnpkg.com/@types/react-reconciler/-/react-reconciler-0.26.7.tgz#0c4643f30821ae057e401b0d9037e03e8e9b2a36" + integrity sha512-mBDYl8x+oyPX/VBb3E638N0B7xG+SPk/EAMcVPeexqus/5aTpTphQi0curhhshOqRrc9t6OPoJfEUkbymse/lQ== + dependencies: + "@types/react" "*" + +"@types/react-reconciler@^0.28.0": + version "0.28.4" + resolved "https://registry.yarnpkg.com/@types/react-reconciler/-/react-reconciler-0.28.4.tgz#c2c06f6d42f055972290eecebb87b10d0ac66e0e" + integrity sha512-Xd55E2aLI9Q/ikDQEmfRzIwYJs4oO0h9ZHA3FZDakzt1WR6JMZcpqtCZlF97I72KVjoY4rHXU5TfvkRDOyr/rg== + dependencies: + "@types/react" "*" + "@types/react@*", "@types/react@^18.2.15": version "18.2.21" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.21.tgz#774c37fd01b522d0b91aed04811b58e4e0514ed9" @@ -298,6 +334,26 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.1.tgz#0480eeb7221eb9bc398ad7432c9d7e14b1a5a367" integrity sha512-cJRQXpObxfNKkFAZbJl2yjWtJCqELQIdShsogr1d2MilP8dKD9TE/nEKHkJgUNHdGKCQaf9HbIynuV2csLGVLg== +"@types/stats.js@*": + version "0.17.0" + resolved "https://registry.yarnpkg.com/@types/stats.js/-/stats.js-0.17.0.tgz#0ed81d48e03b590c24da85540c1d952077a9fe20" + integrity sha512-9w+a7bR8PeB0dCT/HBULU2fMqf6BAzvKbxFboYhmDtDkKPiyXYbjoe2auwsXlEFI7CFNMF1dCv3dFH5Poy9R1w== + +"@types/three@^0.156.0": + version "0.156.0" + resolved "https://registry.yarnpkg.com/@types/three/-/three-0.156.0.tgz#cd49f2a12e858400962ea818d1e1c45e638141a8" + integrity sha512-733bXDSRdlrxqOmQuOmfC1UBRuJ2pREPk8sWnx9MtIJEVDQMx8U0NQO5MVVaOrjzDPyLI+cFPim2X/ss9v0+LQ== + dependencies: + "@types/stats.js" "*" + "@types/webxr" "*" + fflate "~0.6.10" + meshoptimizer "~0.18.1" + +"@types/webxr@*": + version "0.5.4" + resolved "https://registry.yarnpkg.com/@types/webxr/-/webxr-0.5.4.tgz#3d55a6427f9281d456843d754c99bf7804657fe3" + integrity sha512-41gfGLTtqXZhcmoDlLDHqMJDuwAMwhHwXf9Q2job3TUBsvkNfPNI/3IWVEtLH4tyY1ElWtfwIaoNeqeEX238/Q== + "@typescript-eslint/eslint-plugin@^6.0.0": version "6.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.0.tgz#ed2a38867190f8a688af85ad7c8a74670b8b3675" @@ -437,6 +493,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +base64-js@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -496,6 +557,11 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.2.tgz#1d4bf9d572f11c14031f0436e1c10bc1f571f50b" integrity sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ== +debounce@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.1.tgz#38881d8f4166a5c5848020c11827b834bcb3e0a5" + integrity sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug== + debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -687,6 +753,11 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" +fflate@~0.6.10: + version "0.6.10" + resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.6.10.tgz#5f40f9659205936a2d18abf88b2e7781662b6d43" + integrity sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg== + file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -846,6 +917,13 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== +its-fine@^1.0.6: + version "1.1.1" + resolved "https://registry.yarnpkg.com/its-fine/-/its-fine-1.1.1.tgz#e74b93fddd487441f978a50f64f0f5af4d2fc38e" + integrity sha512-v1Ia1xl20KbuSGlwoaGsW0oxsw8Be+TrXweidxD9oT/1lAh6O3K3/GIM95Tt6WCiv6W+h2M7RB1TwdoAjQyyKw== + dependencies: + "@types/react-reconciler" "^0.28.0" + "js-tokens@^3.0.0 || ^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -919,6 +997,11 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== +meshoptimizer@~0.18.1: + version "0.18.1" + resolved "https://registry.yarnpkg.com/meshoptimizer/-/meshoptimizer-0.18.1.tgz#cdb90907f30a7b5b1190facd3b7ee6b7087797d8" + integrity sha512-ZhoIoL7TNV4s5B6+rx5mC//fw8/POGyNxS/DZyCJeiZ12ScLfVwRE/GfsxwiTkMYYD5DmK2/JXnEVXqL4rF+Sw== + micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" @@ -1033,6 +1116,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.3.tgz#432a51f7ba422d1469096c0fdc28e235db8f9643" + integrity sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg== + punycode@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" @@ -1051,6 +1139,21 @@ react-dom@^18.2.0: loose-envify "^1.1.0" scheduler "^0.23.0" +react-reconciler@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/react-reconciler/-/react-reconciler-0.27.0.tgz#360124fdf2d76447c7491ee5f0e04503ed9acf5b" + integrity sha512-HmMDKciQjYmBRGuuhIaKA1ba/7a+UsM5FzOZsMO2JYHt9Jh8reCb7j1eDC95NOyUlKM9KRyvdx0flBuDvYSBoA== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.21.0" + +react-use-measure@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/react-use-measure/-/react-use-measure-2.1.1.tgz#5824537f4ee01c9469c45d5f7a8446177c6cc4ba" + integrity sha512-nocZhN26cproIiIduswYpV5y5lQpSQS1y/4KuvUCjSKmw7ZWIS/+g3aFnX3WdBkyuGUtTLif3UTqnLLhbDoQig== + dependencies: + debounce "^1.2.1" + react@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" @@ -1058,6 +1161,11 @@ react@^18.2.0: dependencies: loose-envify "^1.1.0" +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -1089,6 +1197,13 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +scheduler@^0.21.0: + version "0.21.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.21.0.tgz#6fd2532ff5a6d877b6edb12f00d8ab7e8f308820" + integrity sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ== + dependencies: + loose-envify "^1.1.0" + scheduler@^0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" @@ -1144,11 +1259,21 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +suspend-react@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/suspend-react/-/suspend-react-0.1.3.tgz#a52f49d21cfae9a2fb70bd0c68413d3f9d90768e" + integrity sha512-aqldKgX9aZqpoDp3e8/BZ8Dm7x1pJl+qI3ZKxDN0i/IQTWUwBx/ManmlVJ3wowqbno6c2bmiIfs+Um6LbsjJyQ== + text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== +three@^0.156.1: + version "0.156.1" + resolved "https://registry.yarnpkg.com/three/-/three-0.156.1.tgz#bab4fec121a5b3975eb4f4d227d9c912171eb399" + integrity sha512-kP7H0FK9d/k6t/XvQ9FO6i+QrePoDcNhwl0I02+wmUJRNSLCUIDMcfObnzQvxb37/0Uc9TDT0T1HgsRRrO6SYQ== + to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -1217,3 +1342,8 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zustand@^3.7.1: + version "3.7.2" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-3.7.2.tgz#7b44c4f4a5bfd7a8296a3957b13e1c346f42514d" + integrity sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==