7075 lines
2.1 MiB
7075 lines
2.1 MiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[function(t,e,i){"use strict";i.r(e),i.d(e,"ACESFilmicToneMapping",(function(){return it})),i.d(e,"AddEquation",(function(){return S})),i.d(e,"AddOperation",(function(){return J})),i.d(e,"AdditiveAnimationBlendMode",(function(){return je})),i.d(e,"AdditiveBlending",(function(){return w})),i.d(e,"AlphaFormat",(function(){return Bt})),i.d(e,"AlwaysDepth",(function(){return V})),i.d(e,"AlwaysStencilFunc",(function(){return _i})),i.d(e,"AmbientLight",(function(){return ou})),i.d(e,"AmbientLightProbe",(function(){return Cu})),i.d(e,"AnimationClip",(function(){return pc})),i.d(e,"AnimationLoader",(function(){return wc})),i.d(e,"AnimationMixer",(function(){return sd})),i.d(e,"AnimationObjectGroup",(function(){return nd})),i.d(e,"AnimationUtils",(function(){return tc})),i.d(e,"ArcCurve",(function(){return Pc})),i.d(e,"ArrayCamera",(function(){return Ca})),i.d(e,"ArrowHelper",(function(){return qd})),i.d(e,"Audio",(function(){return Uu})),i.d(e,"AudioAnalyser",(function(){return Xu})),i.d(e,"AudioContext",(function(){return Su})),i.d(e,"AudioListener",(function(){return Nu})),i.d(e,"AudioLoader",(function(){return Mu})),i.d(e,"AxesHelper",(function(){return Zd})),i.d(e,"AxisHelper",(function(){return Qp})),i.d(e,"BackSide",(function(){return m})),i.d(e,"BasicDepthPacking",(function(){return ri})),i.d(e,"BasicShadowMap",(function(){return c})),i.d(e,"BinaryTextureLoader",(function(){return rf})),i.d(e,"Bone",(function(){return dh})),i.d(e,"BooleanKeyframeTrack",(function(){return oc})),i.d(e,"BoundingBoxHelper",(function(){return $p})),i.d(e,"Box2",(function(){return md})),i.d(e,"Box3",(function(){return $i})),i.d(e,"Box3Helper",(function(){return Hd})),i.d(e,"BoxBufferGeometry",(function(){return ds})),i.d(e,"BoxGeometry",(function(){return ds})),i.d(e,"BoxHelper",(function(){return Vd})),i.d(e,"BufferAttribute",(function(){return Sr})),i.d(e,"BufferGeometry",(function(){return jr})),i.d(e,"BufferGeometryLoader",(function(){return fu})),i.d(e,"ByteType",(function(){return St})),i.d(e,"Cache",(function(){return mc})),i.d(e,"Camera",(function(){return vs})),i.d(e,"CameraHelper",(function(){return Ud})),i.d(e,"CanvasRenderer",(function(){return af})),i.d(e,"CanvasTexture",(function(){return Gh})),i.d(e,"CatmullRomCurve3",(function(){return Fc})),i.d(e,"CineonToneMapping",(function(){return et})),i.d(e,"CircleBufferGeometry",(function(){return Hh})),i.d(e,"CircleGeometry",(function(){return Hh})),i.d(e,"ClampToEdgeWrapping",(function(){return dt})),i.d(e,"Clock",(function(){return Ou})),i.d(e,"ClosedSplineCurve3",(function(){return Zp})),i.d(e,"Color",(function(){return yr})),i.d(e,"ColorKeyframeTrack",(function(){return ac})),i.d(e,"CompressedTexture",(function(){return zh})),i.d(e,"CompressedTextureLoader",(function(){return Tc})),i.d(e,"ConeBufferGeometry",(function(){return Xh})),i.d(e,"ConeGeometry",(function(){return Xh})),i.d(e,"CubeCamera",(function(){return xs})),i.d(e,"CubeReflectionMapping",(function(){return st})),i.d(e,"CubeRefractionMapping",(function(){return ot})),i.d(e,"CubeTexture",(function(){return bs})),i.d(e,"CubeTextureLoader",(function(){return Ec})),i.d(e,"CubeUVReflectionMapping",(function(){return lt})),i.d(e,"CubeUVRefractionMapping",(function(){return ct})),i.d(e,"CubicBezierCurve",(function(){return Uc})),i.d(e,"CubicBezierCurve3",(function(){return zc})),i.d(e,"CubicInterpolant",(function(){return ic})),i.d(e,"CullFaceBack",(function(){return a})),i.d(e,"CullFaceFront",(function(){return h})),i.d(e,"CullFaceFrontBack",(function(){return l})),i.d(e,"CullFaceNone",(function(){return o})),i.d(e,"Curve",(function(){return Ac})),i.d(e,"CurvePath",(function(){return Yc})),i.d(e,"CustomBlending",(function(){return E})),i.d(e,"CustomToneMapping",(function(){return nt})),i.d(e,"CylinderBufferGeometry",(function(){return Wh})),i.d(e,"CylinderGeometry",(function(){return Wh})),i.d(e,"Cylindrical",(function(){return pd})),i.d(e,"DataTexture",(function(){return Ts})),i.d(e,"DataTexture2DArray",(function(){return js})),i.d(e,"DataTexture3D",(function(){return Ys})),i.d(e,"DataTextureLoader",(function(){return Sc})),i.d(e,"DataUtils",(function(){return Qd})),i.d(e,"DecrementStencilOp",(function(){return di})),i.d(e,"DecrementWrapStencilOp",(function(){return fi})),i.d(e,"DefaultLoadingManager",(function(){return vc})),i.d(e,"DepthFormat",(function(){return Vt})),i.d(e,"DepthStencilFormat",(function(){return Ht})),i.d(e,"DepthTexture",(function(){return Vh})),i.d(e,"DirectionalLight",(function(){return su})),i.d(e,"DirectionalLightHelper",(function(){return Bd})),i.d(e,"DiscreteInterpolant",(function(){return rc})),i.d(e,"DodecahedronBufferGeometry",(function(){return Yh})),i.d(e,"DodecahedronGeometry",(function(){return Yh})),i.d(e,"DoubleSide",(function(){return g})),i.d(e,"DstAlphaFactor",(function(){return B})),i.d(e,"DstColorFactor",(function(){return N})),i.d(e,"DynamicBufferAttribute",(function(){return Up})),i.d(e,"DynamicCopyUsage",(function(){return Li})),i.d(e,"DynamicDrawUsage",(function(){return Si})),i.d(e,"DynamicReadUsage",(function(){return Ci})),i.d(e,"EdgesGeometry",(function(){return Qh})),i.d(e,"EdgesHelper",(function(){return tf})),i.d(e,"EllipseCurve",(function(){return Cc})),i.d(e,"EqualDepth",(function(){return X})),i.d(e,"EqualStencilFunc",(function(){return yi})),i.d(e,"EquirectangularReflectionMapping",(function(){return at})),i.d(e,"EquirectangularRefractionMapping",(function(){return ht})),i.d(e,"Euler",(function(){return Dn})),i.d(e,"EventDispatcher",(function(){return Fi})),i.d(e,"ExtrudeBufferGeometry",(function(){return Al})),i.d(e,"ExtrudeGeometry",(function(){return Al})),i.d(e,"Face3",(function(){return xr})),i.d(e,"Face4",(function(){return Ep})),i.d(e,"FaceColors",(function(){return Cp})),i.d(e,"FileLoader",(function(){return bc})),i.d(e,"FlatShading",(function(){return v})),i.d(e,"Float16BufferAttribute",(function(){return Dr})),i.d(e,"Float32Attribute",(function(){return Yp})),i.d(e,"Float32BufferAttribute",(function(){return Ir})),i.d(e,"Float64Attribute",(function(){return qp})),i.d(e,"Float64BufferAttribute",(function(){return Fr})),i.d(e,"FloatType",(function(){return Rt})),i.d(e,"Fog",(function(){return Ba})),i.d(e,"FogExp2",(function(){return Fa})),i.d(e,"Font",(function(){return wu})),i.d(e,"FontLoader",(function(){return _u})),i.d(e,"FrontSide",(function(){return f})),i.d(e,"Frustum",(function(){return Ss})),i.d(e,"GLBufferAttribute",(function(){return hd})),i.d(e,"GLSL1",(function(){return Di})),i.d(e,"GLSL3",(function(){return Ii})),i.d(e,"GammaEncoding",(function(){return Qe})),i.d(e,"GeometryUtils",(function(){return of})),i.d(e,"GreaterDepth",(function(){return Y})),i.d(e,"GreaterEqualDepth",(function(){return j})),i.d(e,"GreaterEqualStencilFunc",(function(){return Ti})),i.d(e,"GreaterStencilFunc",(function(){return bi})),i.d(e,"GridHelper",(function(){return Ld})),i.d(e,"Group",(function(){return Pa})),i.d(e,"HalfFloatType",(function(){return Lt})),i.d(e,"HemisphereLight",(function(){return Jc})),i.d(e,"HemisphereLightHelper",(function(){return Rd})),i.d(e,"HemisphereLightProbe",(function(){return Au})),i.d(e,"IcosahedronBufferGeometry",(function(){return Pl})),i.d(e,"IcosahedronGeometry",(function(){return Pl})),i.d(e,"ImageBitmapLoader",(function(){return xu})),i.d(e,"ImageLoader",(function(){return _c})),i.d(e,"ImageUtils",(function(){return Vi})),i.d(e,"ImmediateRenderObject",(function(){return xd})),i.d(e,"IncrementStencilOp",(function(){return ui})),i.d(e,"IncrementWrapStencilOp",(function(){return pi})),i.d(e,"InstancedBufferAttribute",(function(){return pu})),i.d(e,"InstancedBufferGeometry",(function(){return du})),i.d(e,"InstancedInterleavedBuffer",(function(){return ad})),i.d(e,"InstancedMesh",(function(){return bh})),i.d(e,"Int16Attribute",(function(){return Hp})),i.d(e,"Int16BufferAttribute",(function(){return Pr})),i.d(e,"Int32Attribute",(function(){return Xp})),i.d(e,"Int32BufferAttribute",(function(){return Lr})),i.d(e,"Int8Attribute",(function(){return zp})),i.d(e,"Int8BufferAttribute",(function(){return Mr})),i.d(e,"IntType",(function(){return Ct})),i.d(e,"InterleavedBuffer",(function(){return Na})),i.d(e,"InterleavedBufferAttribute",(function(){return za})),i.d(e,"Interpolant",(function(){return ec})),i.d(e,"InterpolateDiscrete",(function(){return Ue})),i.d(e,"InterpolateLinear",(function(){return ze})),i.d(e,"InterpolateSmooth",(function(){return Ge})),i.d(e,"InvertStencilOp",(function(){return mi})),i.d(e,"JSONLoader",(function(){return hf})),i.d(e,"KeepStencilOp",(function(){return li})),i.d(e,"KeyframeTrack",(function(){return sc})),i.d(e,"LOD",(function(){return sh})),i.d(e,"LatheBufferGeometry",(function(){return Rl})),i.d(e,"LatheGeometry",(function(){return Rl})),i.d(e,"Layers",(function(){return Bn})),i.d(e,"LensFlare",(function(){return cf})),i.d(e,"LessDepth",(function(){return H})),i.d(e,"LessEqualDepth",(function(){return W})),i.d(e,"LessEqualStencilFunc",(function(){return xi})),i.d(e,"LessStencilFunc",(function(){return vi})),i.d(e,"Light",(function(){return Kc})),i.d(e,"LightProbe",(function(){return lu})),i.d(e,"Line",(function(){return Ah})),i.d(e,"Line3",(function(){return yd})),i.d(e,"LineBasicMaterial",(function(){return wh})),i.d(e,"LineCurve",(function(){return Gc})),i.d(e,"LineCurve3",(function(){return Vc})),i.d(e,"LineDashedMaterial",(function(){return Ql})),i.d(e,"LineLoop",(function(){return Lh})),i.d(e,"LinePieces",(function(){return Mp})),i.d(e,"LineSegments",(function(){return Rh})),i.d(e,"LineStrip",(function(){return Sp})),i.d(e,"LinearEncoding",(function(){return Ke})),i.d(e,"LinearFilter",(function(){return xt})),i.d(e,"LinearInterpolant",(function(){return nc})),i.d(e,"LinearMipMapLinearFilter",(function(){return _t})),i.d(e,"LinearMipMapNearestFilter",(function(){return wt})),i.d(e,"LinearMipmapLinearFilter",(function(){return Tt})),i.d(e,"LinearMipmapNearestFilter",(function(){return bt})),i.d(e,"LinearToneMapping",(function(){return $})),i.d(e,"Loader",(function(){return yc})),i.d(e,"LoaderUtils",(function(){return uu})),i.d(e,"LoadingManager",(function(){return gc})),i.d(e,"LogLuvEncoding",(function(){return ti})),i.d(e,"LoopOnce",(function(){return Be})),i.d(e,"LoopPingPong",(function(){return Ne})),i.d(e,"LoopRepeat",(function(){return ke})),i.d(e,"LuminanceAlphaFormat",(function(){return zt})),i.d(e,"LuminanceFormat",(function(){return Ut})),i.d(e,"MOUSE",(function(){return r})),i.d(e,"Material",(function(){return wr})),i.d(e,"MaterialLoader",(function(){return cu})),i.d(e,"Math",(function(){return Ni})),i.d(e,"MathUtils",(function(){return Ni})),i.d(e,"Matrix3",(function(){return zi})),i.d(e,"Matrix4",(function(){return Sn})),i.d(e,"MaxEquation",(function(){return P})),i.d(e,"Mesh",(function(){return cs})),i.d(e,"MeshBasicMaterial",(function(){return Tr})),i.d(e,"MeshDepthMaterial",(function(){return Ta})),i.d(e,"MeshDistanceMaterial",(function(){return _a})),i.d(e,"MeshFaceMaterial",(function(){return Rp})),i.d(e,"MeshLambertMaterial",(function(){return Kl})),i.d(e,"MeshMatcapMaterial",(function(){return Jl})),i.d(e,"MeshNormalMaterial",(function(){return Zl})),i.d(e,"MeshPhongMaterial",(function(){return Yl})),i.d(e,"MeshPhysicalMaterial",(function(){return jl})),i.d(e,"MeshStandardMaterial",(function(){return Xl})),i.d(e,"MeshToonMaterial",(function(){return ql})),i.d(e,"MinEquation",(function(){return C})),i.d(e,"MirroredRepeatWrapping",(function(){return pt})),i.d(e,"MixOperation",(function(){return K})),i.d(e,"MultiMaterial",(function(){return Lp})),i.d(e,"MultiplyBlending",(function(){return _})),i.d(e,"MultiplyOperation",(function(){return Z})),i.d(e,"NearestFilter",(function(){return ft})),i.d(e,"NearestMipMapLinearFilter",(function(){return yt})),i.d(e,"NearestMipMapNearestFilter",(function(){return gt})),i.d(e,"NearestMipmapLinearFilter",(function(){return vt})),i.d(e,"NearestMipmapNearestFilter",(function(){return mt})),i.d(e,"NeverDepth",(function(){return G})),i.d(e,"NeverStencilFunc",(function(){return gi})),i.d(e,"NoBlending",(function(){return x})),i.d(e,"NoColors",(function(){return Ap})),i.d(e,"NoToneMapping",(function(){return Q})),i.d(e,"NormalAnimationBlendMode",(function(){return Xe})),i.d(e,"NormalBlending",(function(){return b})),i.d(e,"NotEqualDepth",(function(){return q})),i.d(e,"NotEqualStencilFunc",(function(){return wi})),i.d(e,"NumberKeyframeTrack",(function(){return hc})),i.d(e,"Object3D",(function(){return Kn})),i.d(e,"ObjectLoader",(function(){return mu})),i.d(e,"ObjectSpaceNormalMap",(function(){return ai})),i.d(e,"OctahedronBufferGeometry",(function(){return Ll})),i.d(e,"OctahedronGeometry",(function(){return Ll})),i.d(e,"OneFactor",(function(){return L})),i.d(e,"OneMinusDstAlphaFactor",(function(){return k})),i.d(e,"OneMinusDstColorFactor",(function(){return U})),i.d(e,"OneMinusSrcAlphaFactor",(function(){return F})),i.d(e,"OneMinusSrcColorFactor",(function(){return D})),i.d(e,"OrthographicCamera",(function(){return nu})),i.d(e,"PCFShadowMap",(function(){return u})),i.d(e,"PCFSoftShadowMap",(function(){return d})),i.d(e,"PMREMGenerator",(function(){return mp})),i.d(e,"ParametricBufferGeometry",(function(){return Ol})),i.d(e,"ParametricGeometry",(function(){return Ol})),i.d(e,"Particle",(function(){return Dp})),i.d(e,"ParticleBasicMaterial",(function(){return Bp})),i.d(e,"ParticleSystem",(function(){return Ip})),i.d(e,"ParticleSystemMaterial",(function(){return kp})),i.d(e,"Path",(function(){return qc})),i.d(e,"PerspectiveCamera",(function(){return ys})),i.d(e,"Plane",(function(){return tr})),i.d(e,"PlaneBufferGeometry",(function(){return Cs})),i.d(e,"PlaneGeometry",(function(){return Cs})),i.d(e,"PlaneHelper",(function(){return Wd})),i.d(e,"PointCloud",(function(){return Op})),i.d(e,"PointCloudMaterial",(function(){return Fp})),i.d(e,"PointLight",(function(){return iu})),i.d(e,"PointLightHelper",(function(){return Md})),i.d(e,"Points",(function(){return kh})),i.d(e,"PointsMaterial",(function(){return Oh})),i.d(e,"PolarGridHelper",(function(){return Od})),i.d(e,"PolyhedronBufferGeometry",(function(){return jh})),i.d(e,"PolyhedronGeometry",(function(){return jh})),i.d(e,"PositionalAudio",(function(){return Wu})),i.d(e,"PropertyBinding",(function(){return id})),i.d(e,"PropertyMixer",(function(){return ju})),i.d(e,"QuadraticBezierCurve",(function(){return Hc})),i.d(e,"QuadraticBezierCurve3",(function(){return Wc})),i.d(e,"Quaternion",(function(){return Zi})),i.d(e,"QuaternionKeyframeTrack",(function(){return cc})),i.d(e,"QuaternionLinearInterpolant",(function(){return lc})),i.d(e,"REVISION",(function(){return n})),i.d(e,"RGBADepthPacking",(function(){return si})),i.d(e,"RGBAFormat",(function(){return Nt})),i.d(e,"RGBAIntegerFormat",(function(){return Zt})),i.d(e,"RGBA_ASTC_10x10_Format",(function(){return ye})),i.d(e,"RGBA_ASTC_10x5_Format",(function(){return me})),i.d(e,"RGBA_ASTC_10x6_Format",(function(){return ge})),i.d(e,"RGBA_ASTC_10x8_Format",(function(){return ve})),i.d(e,"RGBA_ASTC_12x10_Format",(function(){return xe})),i.d(e,"RGBA_ASTC_12x12_Format",(function(){return be})),i.d(e,"RGBA_ASTC_4x4_Format",(function(){return ae})),i.d(e,"RGBA_ASTC_5x4_Format",(function(){return he})),i.d(e,"RGBA_ASTC_5x5_Format",(function(){return le})),i.d(e,"RGBA_ASTC_6x5_Format",(function(){return ce})),i.d(e,"RGBA_ASTC_6x6_Format",(function(){return ue})),i.d(e,"RGBA_ASTC_8x5_Format",(function(){return de})),i.d(e,"RGBA_ASTC_8x6_Format",(function(){return pe})),i.d(e,"RGBA_ASTC_8x8_Format",(function(){return fe})),i.d(e,"RGBA_BPTC_Format",(function(){return we})),i.d(e,"RGBA_ETC2_EAC_Format",(function(){return oe})),i.d(e,"RGBA_PVRTC_2BPPV1_Format",(function(){return ne})),i.d(e,"RGBA_PVRTC_4BPPV1_Format",(function(){return ie})),i.d(e,"RGBA_S3TC_DXT1_Format",(function(){return Jt})),i.d(e,"RGBA_S3TC_DXT3_Format",(function(){return Qt})),i.d(e,"RGBA_S3TC_DXT5_Format",(function(){return $t})),i.d(e,"RGBDEncoding",(function(){return ni})),i.d(e,"RGBEEncoding",(function(){return $e})),i.d(e,"RGBEFormat",(function(){return Gt})),i.d(e,"RGBFormat",(function(){return kt})),i.d(e,"RGBIntegerFormat",(function(){return qt})),i.d(e,"RGBM16Encoding",(function(){return ii})),i.d(e,"RGBM7Encoding",(function(){return ei})),i.d(e,"RGB_ETC1_Format",(function(){return re})),i.d(e,"RGB_ETC2_Format",(function(){return se})),i.d(e,"RGB_PVRTC_2BPPV1_Format",(function(){return ee})),i.d(e,"RGB_PVRTC_4BPPV1_Format",(function(){return te})),i.d(e,"RGB_S3TC_DXT1_Format",(function(){return Kt})),i.d(e,"RGFormat",(function(){return jt})),i.d(e,"RGIntegerFormat",(function(){return Yt})),i.d(e,"RawShaderMaterial",(function(){return Wl})),i.d(e,"Ray",(function(){return En})),i.d(e,"Raycaster",(function(){return ld})),i.d(e,"RectAreaLight",(function(){return au})),i.d(e,"RedFormat",(function(){return Wt})),i.d(e,"RedIntegerFormat",(function(){return Xt})),i.d(e,"ReinhardToneMapping",(function(){return tt})),i.d(e,"RepeatWrapping",(function(){return ut})),i.d(e,"ReplaceStencilOp",(function(){return ci})),i.d(e,"ReverseSubtractEquation",(function(){return A})),i.d(e,"RingBufferGeometry",(function(){return Dl})),i.d(e,"RingGeometry",(function(){return Dl})),i.d(e,"SRGB8_ALPHA8_ASTC_10x10_Format",(function(){return De})),i.d(e,"SRGB8_ALPHA8_ASTC_10x5_Format",(function(){return Re})),i.d(e,"SRGB8_ALPHA8_ASTC_10x6_Format",(function(){return Le})),i.d(e,"SRGB8_ALPHA8_ASTC_10x8_Format",(function(){return Oe})),i.d(e,"SRGB8_ALPHA8_ASTC_12x10_Format",(function(){return Ie})),i.d(e,"SRGB8_ALPHA8_ASTC_12x12_Format",(function(){return Fe})),i.d(e,"SRGB8_ALPHA8_ASTC_4x4_Format",(function(){return Te})),i.d(e,"SRGB8_ALPHA8_ASTC_5x4_Format",(function(){return _e})),i.d(e,"SRGB8_ALPHA8_ASTC_5x5_Format",(function(){return Ee})),i.d(e,"SRGB8_ALPHA8_ASTC_6x5_Format",(function(){return Se})),i.d(e,"SRGB8_ALPHA8_ASTC_6x6_Format",(function(){return Me})),i.d(e,"SRGB8_ALPHA8_ASTC_8x5_Format",(function(){return Ae})),i.d(e,"SRGB8_ALPHA8_ASTC_8x6_Format",(function(){return Ce})),i.d(e,"SRGB8_ALPHA8_ASTC_8x8_Format",(function(){return Pe})),i.d(e,"Scene",(function(){return ka})),i.d(e,"SceneUtils",(function(){return lf})),i.d(e,"ShaderChunk",(function(){return Ps})),i.d(e,"ShaderLib",(function(){return Ls})),i.d(e,"ShaderMaterial",(function(){return gs})),i.d(e,"ShadowMaterial",(function(){return Hl})),i.d(e,"Shape",(function(){return Zc})),i.d(e,"ShapeBufferGeometry",(function(){return Il})),i.d(e,"ShapeGeometry",(function(){return Il})),i.d(e,"ShapePath",(function(){return bu})),i.d(e,"ShapeUtils",(function(){return El})),i.d(e,"ShortType",(function(){return Mt})),i.d(e,"Skeleton",(function(){return mh})),i.d(e,"SkeletonHelper",(function(){return Sd})),i.d(e,"SkinnedMesh",(function(){return uh})),i.d(e,"SmoothShading",(function(){return y})),i.d(e,"Sphere",(function(){return gn})),i.d(e,"SphereBufferGeometry",(function(){return Fl})),i.d(e,"SphereGeometry",(function(){return Fl})),i.d(e,"Spherical",(function(){return dd})),i.d(e,"SphericalHarmonics3",(function(){return hu})),i.d(e,"Spline",(function(){return Jp})),i.d(e,"SplineCurve",(function(){return Xc})),i.d(e,"SplineCurve3",(function(){return Kp})),i.d(e,"SpotLight",(function(){return tu})),i.d(e,"SpotLightHelper",(function(){return wd})),i.d(e,"Sprite",(function(){return eh})),i.d(e,"SpriteMaterial",(function(){return Ga})),i.d(e,"SrcAlphaFactor",(function(){return I})),i.d(e,"SrcAlphaSaturateFactor",(function(){return z})),i.d(e,"SrcColorFactor",(function(){return O})),i.d(e,"StaticCopyUsage",(function(){return Ri})),i.d(e,"StaticDrawUsage",(function(){return Ei})),i.d(e,"StaticReadUsage",(function(){return Ai})),i.d(e,"StereoCamera",(function(){return Lu})),i.d(e,"StreamCopyUsage",(function(){return Oi})),i.d(e,"StreamDrawUsage",(function(){return Mi})),i.d(e,"StreamReadUsage",(function(){return Pi})),i.d(e,"StringKeyframeTrack",(function(){return uc})),i.d(e,"SubtractEquation",(function(){return M})),i.d(e,"SubtractiveBlending",(function(){return T})),i.d(e,"TOUCH",(function(){return s})),i.d(e,"TangentSpaceNormalMap",(function(){return oi})),i.d(e,"TetrahedronBufferGeometry",(function(){return Bl})),i.d(e,"TetrahedronGeometry",(function(){return Bl})),i.d(e,"TextBufferGeometry",(function(){return kl})),i.d(e,"TextGeometry",(function(){return kl})),i.d(e,"Texture",(function(){return Wi})),i.d(e,"TextureLoader",(function(){return Mc})),i.d(e,"TorusBufferGeometry",(function(){return Nl})),i.d(e,"TorusGeometry",(function(){return Nl})),i.d(e,"TorusKnotBufferGeometry",(function(){return Ul})),i.d(e,"TorusKnotGeometry",(function(){return Ul})),i.d(e,"Triangle",(function(){return ur})),i.d(e,"TriangleFanDrawMode",(function(){return Ze})),i.d(e,"TriangleStripDrawMode",(function(){return qe})),i.d(e,"TrianglesDrawMode",(function(){return Ye})),i.d(e,"TubeBufferGeometry",(function(){return zl})),i.d(e,"TubeGeometry",(function(){return zl})),i.d(e,"UVMapping",(function(){return rt})),i.d(e,"Uint16Attribute",(function(){return Wp})),i.d(e,"Uint16BufferAttribute",(function(){return Rr})),i.d(e,"Uint32Attribute",(function(){return jp})),i.d(e,"Uint32BufferAttribute",(function(){return Or})),i.d(e,"Uint8Attribute",(function(){return Gp})),i.d(e,"Uint8BufferAttribute",(function(){return Ar})),i.d(e,"Uint8ClampedAttribute",(function(){return Vp})),i.d(e,"Uint8ClampedBufferAttribute",(function(){return Cr})),i.d(e,"Uniform",(function(){return od})),i.d(e,"UniformsLib",(function(){return Rs})),i.d(e,"UniformsUtils",(function(){return ms})),i.d(e,"UnsignedByteType",(function(){return Et})),i.d(e,"UnsignedInt248Type",(function(){return Ft})),i.d(e,"UnsignedIntType",(function(){return Pt})),i.d(e,"UnsignedShort4444Type",(function(){return Ot})),i.d(e,"UnsignedShort5551Type",(function(){return Dt})),i.d(e,"UnsignedShort565Type",(function(){return It})),i.d(e,"UnsignedShortType",(function(){return At})),i.d(e,"VSMShadowMap",(function(){return p})),i.d(e,"Vector2",(function(){return Ui})),i.d(e,"Vector3",(function(){return Ki})),i.d(e,"Vector4",(function(){return ji})),i.d(e,"VectorKeyframeTrack",(function(){return dc})),i.d(e,"Vertex",(function(){return Np})),i.d(e,"VertexColors",(function(){return Pp})),i.d(e,"VideoTexture",(function(){return Uh})),i.d(e,"WebGL1Renderer",(function(){return Ia})),i.d(e,"WebGLCubeRenderTarget",(function(){return ws})),i.d(e,"WebGLMultisampleRenderTarget",(function(){return qi})),i.d(e,"WebGLRenderTarget",(function(){return Yi})),i.d(e,"WebGLRenderTargetCube",(function(){return sf})),i.d(e,"WebGLRenderer",(function(){return Da})),i.d(e,"WebGLUtils",(function(){return Aa})),i.d(e,"WireframeGeometry",(function(){return Gl})),i.d(e,"WireframeHelper",(function(){return ef})),i.d(e,"WrapAroundEnding",(function(){return We})),i.d(e,"XHRLoader",(function(){return nf})),i.d(e,"ZeroCurvatureEnding",(function(){return Ve})),i.d(e,"ZeroFactor",(function(){return R})),i.d(e,"ZeroSlopeEnding",(function(){return He})),i.d(e,"ZeroStencilOp",(function(){return hi})),i.d(e,"sRGBEncoding",(function(){return Je}));const n="125",r={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,h=2,l=3,c=0,u=1,d=2,p=3,f=0,m=1,g=2,v=1,y=2,x=0,b=1,w=2,T=3,_=4,E=5,S=100,M=101,A=102,C=103,P=104,R=200,L=201,O=202,D=203,I=204,F=205,B=206,k=207,N=208,U=209,z=210,G=0,V=1,H=2,W=3,X=4,j=5,Y=6,q=7,Z=0,K=1,J=2,Q=0,$=1,tt=2,et=3,it=4,nt=5,rt=300,st=301,ot=302,at=303,ht=304,lt=306,ct=307,ut=1e3,dt=1001,pt=1002,ft=1003,mt=1004,gt=1004,vt=1005,yt=1005,xt=1006,bt=1007,wt=1007,Tt=1008,_t=1008,Et=1009,St=1010,Mt=1011,At=1012,Ct=1013,Pt=1014,Rt=1015,Lt=1016,Ot=1017,Dt=1018,It=1019,Ft=1020,Bt=1021,kt=1022,Nt=1023,Ut=1024,zt=1025,Gt=Nt,Vt=1026,Ht=1027,Wt=1028,Xt=1029,jt=1030,Yt=1031,qt=1032,Zt=1033,Kt=33776,Jt=33777,Qt=33778,$t=33779,te=35840,ee=35841,ie=35842,ne=35843,re=36196,se=37492,oe=37496,ae=37808,he=37809,le=37810,ce=37811,ue=37812,de=37813,pe=37814,fe=37815,me=37816,ge=37817,ve=37818,ye=37819,xe=37820,be=37821,we=36492,Te=37840,_e=37841,Ee=37842,Se=37843,Me=37844,Ae=37845,Ce=37846,Pe=37847,Re=37848,Le=37849,Oe=37850,De=37851,Ie=37852,Fe=37853,Be=2200,ke=2201,Ne=2202,Ue=2300,ze=2301,Ge=2302,Ve=2400,He=2401,We=2402,Xe=2500,je=2501,Ye=0,qe=1,Ze=2,Ke=3e3,Je=3001,Qe=3007,$e=3002,ti=3003,ei=3004,ii=3005,ni=3006,ri=3200,si=3201,oi=0,ai=1,hi=0,li=7680,ci=7681,ui=7682,di=7683,pi=34055,fi=34056,mi=5386,gi=512,vi=513,yi=514,xi=515,bi=516,wi=517,Ti=518,_i=519,Ei=35044,Si=35048,Mi=35040,Ai=35045,Ci=35049,Pi=35041,Ri=35046,Li=35050,Oi=35042,Di="100",Ii="300 es";function Fi(){}Object.assign(Fi.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)},removeEventListener:function(t,e){if(void 0===this._listeners)return;const i=this._listeners[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}},dispatchEvent:function(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,n=i.length;e<n;e++)i[e].call(this,t)}}});const Bi=[];for(let t=0;t<256;t++)Bi[t]=(t<16?"0":"")+t.toString(16);let ki=1234567;const Ni={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(Bi[255&t]+Bi[t>>8&255]+Bi[t>>16&255]+Bi[t>>24&255]+"-"+Bi[255&e]+Bi[e>>8&255]+"-"+Bi[e>>16&15|64]+Bi[e>>24&255]+"-"+Bi[63&i|128]+Bi[i>>8&255]+"-"+Bi[i>>16&255]+Bi[i>>24&255]+Bi[255&n]+Bi[n>>8&255]+Bi[n>>16&255]+Bi[n>>24&255]).toUpperCase()},clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},damp:function(t,e,i,n){return Ni.lerp(t,e,1-Math.exp(-i*n))},pingpong:function(t,e=1){return e-Math.abs(Ni.euclideanModulo(t,2*e)-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-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())},seededRandom:function(t){return void 0!==t&&(ki=t%2147483647),ki=16807*ki%2147483647,(ki-1)/2147483646},degToRad:function(t){return t*Ni.DEG2RAD},radToDeg:function(t){return t*Ni.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,n,r){const s=Math.cos,o=Math.sin,a=s(i/2),h=o(i/2),l=s((e+n)/2),c=o((e+n)/2),u=s((e-n)/2),d=o((e-n)/2),p=s((n-e)/2),f=o((n-e)/2);switch(r){case"XYX":t.set(a*c,h*u,h*d,a*l);break;case"YZY":t.set(h*d,a*c,h*u,a*l);break;case"ZXZ":t.set(h*u,h*d,a*c,a*l);break;case"XZX":t.set(a*c,h*f,h*p,a*l);break;case"YXY":t.set(h*p,a*c,h*f,a*l);break;case"ZYZ":t.set(h*f,h*p,a*c,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};class Ui{constructor(t=0,e=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*i-s*n+t.x,this.y=r*n+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class zi{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,h){const l=this.elements;return l[0]=t,l[1]=n,l[2]=o,l[3]=e,l[4]=r,l[5]=a,l[6]=i,l[7]=s,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const 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}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[3],a=i[6],h=i[1],l=i[4],c=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],y=n[4],x=n[7],b=n[2],w=n[5],T=n[8];return r[0]=s*f+o*v+a*b,r[3]=s*m+o*y+a*w,r[6]=s*g+o*x+a*T,r[1]=h*f+l*v+c*b,r[4]=h*m+l*y+c*w,r[7]=h*g+l*x+c*T,r[2]=u*f+d*v+p*b,r[5]=u*m+d*y+p*w,r[8]=u*g+d*x+p*T,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*s*l-e*o*h-i*r*l+i*o*a+n*r*h-n*s*a}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=l*s-o*h,u=o*a-l*r,d=h*r-s*a,p=e*c+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=c*f,t[1]=(n*h-l*i)*f,t[2]=(o*i-n*s)*f,t[3]=u*f,t[4]=(l*e-n*a)*f,t[5]=(n*r-o*e)*f,t[6]=d*f,t[7]=(i*a-h*e)*f,t[8]=(s*e-i*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).copy(this).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,r,s,o){const a=Math.cos(r),h=Math.sin(r);return this.set(i*a,i*h,-i*(a*s+h*o)+s+t,-n*h,n*a,-n*(-h*s+a*o)+o+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],s=n[3],o=n[6],a=n[1],h=n[4],l=n[7];return n[0]=e*r+i*a,n[3]=e*s+i*h,n[6]=e*o+i*l,n[1]=-i*r+e*a,n[4]=-i*s+e*h,n[7]=-i*o+e*l,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}}let Gi;const Vi={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Gi&&(Gi=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Gi.width=t.width,Gi.height=t.height;const i=Gi.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Gi}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};let Hi=0;function Wi(t=Wi.DEFAULT_IMAGE,e=Wi.DEFAULT_MAPPING,i=dt,n=dt,r=xt,s=Tt,o=Nt,a=Et,h=1,l=Ke){Object.defineProperty(this,"id",{value:Hi++}),this.uuid=Ni.generateUUID(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=s,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=a,this.offset=new Ui(0,0),this.repeat=new Ui(1,1),this.center=new Ui(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new zi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l,this.version=0,this.onUpdate=null}function Xi(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Vi.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Wi.DEFAULT_IMAGE=void 0,Wi.DEFAULT_MAPPING=rt,Wi.prototype=Object.assign(Object.create(Fi.prototype),{constructor:Wi,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},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.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={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],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const n=this.image;if(void 0===n.uuid&&(n.uuid=Ni.generateUUID()),!e&&void 0===t.images[n.uuid]){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++)n[t].isDataTexture?e.push(Xi(n[t].image)):e.push(Xi(n[t]))}else e=Xi(n);t.images[n.uuid]={uuid:n.uuid,url:e}}i.image=n.uuid}return e||(t.textures[this.uuid]=i),i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping!==rt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ut:t.x=t.x-Math.floor(t.x);break;case dt:t.x=t.x<0?0:1;break;case pt: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 ut:t.y=t.y-Math.floor(t.y);break;case dt:t.y=t.y<0?0:1;break;case pt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(Wi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});class ji{constructor(t=0,e=0,i=0,n=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(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(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(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(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(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(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const 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(t){let e,i,n,r;const s=t.elements,o=s[0],a=s[4],h=s[8],l=s[1],c=s[5],u=s[9],d=s[2],p=s[6],f=s[10];if(Math.abs(a-l)<.01&&Math.abs(h-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(a+l)<.1&&Math.abs(h+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+c+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(o+1)/2,s=(c+1)/2,m=(f+1)/2,g=(a+l)/4,v=(h+d)/4,y=(u+p)/4;return t>s&&t>m?t<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=g/i,r=v/i):s>m?s<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(s),i=g/n,r=y/n):m<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(m),i=v/r,n=y/r),this.set(i,n,r,e),this}let m=Math.sqrt((p-u)*(p-u)+(h-d)*(h-d)+(l-a)*(l-a));return Math.abs(m)<.001&&(m=1),this.x=(p-u)/m,this.y=(h-d)/m,this.z=(l-a)/m,this.w=Math.acos((o+c+f-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,i){return void 0!==i&&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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}class Yi extends Fi{constructor(t,e,i){super(),Object.defineProperty(this,"isWebGLRenderTarget",{value:!0}),this.width=t,this.height=e,this.scissor=new ji(0,0,t,e),this.scissorTest=!1,this.viewport=new ji(0,0,t,e),i=i||{},this.texture=new Wi(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:xt,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0!==i.stencilBuffer&&i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}setSize(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(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(){this.dispatchEvent({type:"dispose"})}}class qi extends Yi{constructor(t,e,i){super(t,e,i),Object.defineProperty(this,"isWebGLMultisampleRenderTarget",{value:!0}),this.samples=4}copy(t){return super.copy.call(this,t),this.samples=t.samples,this}}class Zi{constructor(t=0,e=0,i=0,n=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=e,this._z=i,this._w=n}static slerp(t,e,i,n){return i.copy(t).slerp(e,n)}static slerpFlat(t,e,i,n,r,s,o){let a=i[n+0],h=i[n+1],l=i[n+2],c=i[n+3];const u=r[s+0],d=r[s+1],p=r[s+2],f=r[s+3];if(c!==f||a!==u||h!==d||l!==p){let t=1-o;const e=a*u+h*d+l*p+c*f,i=e>=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),s=Math.atan2(r,e*i);t=Math.sin(t*s)/r,o=Math.sin(o*s)/r}const r=o*i;if(a=a*t+u*r,h=h*t+d*r,l=l*t+p*r,c=c*t+f*r,t===1-o){const t=1/Math.sqrt(a*a+h*h+l*l+c*c);a*=t,h*=t,l*=t,c*=t}}t[e]=a,t[e+1]=h,t[e+2]=l,t[e+3]=c}static multiplyQuaternionsFlat(t,e,i,n,r,s){const o=i[n],a=i[n+1],h=i[n+2],l=i[n+3],c=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=o*p+l*c+a*d-h*u,t[e+1]=a*p+l*u+h*c-o*d,t[e+2]=h*p+l*d+o*u-a*c,t[e+3]=l*p-o*c-a*u-h*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=t._x,n=t._y,r=t._z,s=t._order,o=Math.cos,a=Math.sin,h=o(i/2),l=o(n/2),c=o(r/2),u=a(i/2),d=a(n/2),p=a(r/2);switch(s){case"XYZ":this._x=u*l*c+h*d*p,this._y=h*d*c-u*l*p,this._z=h*l*p+u*d*c,this._w=h*l*c-u*d*p;break;case"YXZ":this._x=u*l*c+h*d*p,this._y=h*d*c-u*l*p,this._z=h*l*p-u*d*c,this._w=h*l*c+u*d*p;break;case"ZXY":this._x=u*l*c-h*d*p,this._y=h*d*c+u*l*p,this._z=h*l*p+u*d*c,this._w=h*l*c-u*d*p;break;case"ZYX":this._x=u*l*c-h*d*p,this._y=h*d*c+u*l*p,this._z=h*l*p-u*d*c,this._w=h*l*c+u*d*p;break;case"YZX":this._x=u*l*c+h*d*p,this._y=h*d*c+u*l*p,this._z=h*l*p-u*d*c,this._w=h*l*c-u*d*p;break;case"XZY":this._x=u*l*c-h*d*p,this._y=h*d*c-u*l*p,this._z=h*l*p+u*d*c,this._w=h*l*c+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],n=e[4],r=e[8],s=e[1],o=e[5],a=e[9],h=e[2],l=e[6],c=e[10],u=i+o+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(l-a)*t,this._y=(r-h)*t,this._z=(s-n)*t}else if(i>o&&i>c){const t=2*Math.sqrt(1+i-o-c);this._w=(l-a)/t,this._x=.25*t,this._y=(n+s)/t,this._z=(r+h)/t}else if(o>c){const t=2*Math.sqrt(1+o-i-c);this._w=(r-h)/t,this._x=(n+s)/t,this._y=.25*t,this._z=(a+l)/t}else{const t=2*Math.sqrt(1+c-i-o);this._w=(s-n)/t,this._x=(r+h)/t,this._y=(a+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<1e-6?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Ni.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let 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(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(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,r=t._z,s=t._w,o=e._x,a=e._y,h=e._z,l=e._w;return this._x=i*l+s*o+n*h-r*a,this._y=n*l+s*a+r*o-i*h,this._z=r*l+s*h+i*a-n*o,this._w=s*l-i*o-n*a-r*h,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,s=this._w;let o=s*t._w+i*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=i,this._y=n,this._z=r,this;const a=1-o*o;if(a<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const h=Math.sqrt(a),l=Math.atan2(h,o),c=Math.sin((1-e)*l)/h,u=Math.sin(e*l)/h;return this._w=s*c+this._w*u,this._x=i*c+this._x*u,this._y=n*c+this._y*u,this._z=r*c+this._z*u,this._onChangeCallback(),this}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}class Ki{constructor(t=0,e=0,i=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Qi.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Qi.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*n-o*i,l=a*i+o*e-r*n,c=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=h*a+u*-r+l*-o-c*-s,this.y=l*a+u*-s+c*-r-h*-o,this.z=c*a+u*-o+h*-s-l*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Ji.copy(this).projectOnVector(t),this.sub(Ji)}reflect(t){return this.sub(Ji.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Ni.clamp(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const Ji=new Ki,Qi=new Zi;class $i{constructor(t,e){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new Ki(1/0,1/0,1/0),this.max=void 0!==e?e:new Ki(-1/0,-1/0,-1/0)}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,h=t.length;a<h;a+=3){const h=t[a],l=t[a+1],c=t[a+2];h<e&&(e=h),l<i&&(i=l),c<n&&(n=c),h>r&&(r=h),l>s&&(s=l),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromBufferAttribute(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,h=t.count;a<h;a++){const h=t.getX(a),l=t.getY(a),c=t.getZ(a);h<e&&(e=h),l<i&&(i=l),c<n&&(n=c),h>r&&(r=h),l>s&&(s=l),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=nn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t){return this.makeEmpty(),this.expandByObject(t)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new Ki),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new Ki),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t){t.updateWorldMatrix(!1,!1);const e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),rn.copy(e.boundingBox),rn.applyMatrix4(t.matrixWorld),this.union(rn));const i=t.children;for(let t=0,e=i.length;t<e;t++)this.expandByObject(i[t]);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(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(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Ki),e.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(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,nn),nn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(un),dn.subVectors(this.max,un),sn.subVectors(t.a,un),on.subVectors(t.b,un),an.subVectors(t.c,un),hn.subVectors(on,sn),ln.subVectors(an,on),cn.subVectors(sn,an);let e=[0,-hn.z,hn.y,0,-ln.z,ln.y,0,-cn.z,cn.y,hn.z,0,-hn.x,ln.z,0,-ln.x,cn.z,0,-cn.x,-hn.y,hn.x,0,-ln.y,ln.x,0,-cn.y,cn.x,0];return!!tn(e,sn,on,an,dn)&&(e=[1,0,0,0,1,0,0,0,1],!!tn(e,sn,on,an,dn)&&(pn.crossVectors(hn,ln),e=[pn.x,pn.y,pn.z],tn(e,sn,on,an,dn)))}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Ki),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return nn.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(nn).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(en[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),en[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),en[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),en[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),en[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),en[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),en[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),en[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(en)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}function tn(t,e,i,n,r){for(let s=0,o=t.length-3;s<=o;s+=3){fn.fromArray(t,s);const o=r.x*Math.abs(fn.x)+r.y*Math.abs(fn.y)+r.z*Math.abs(fn.z),a=e.dot(fn),h=i.dot(fn),l=n.dot(fn);if(Math.max(-Math.max(a,h,l),Math.min(a,h,l))>o)return!1}return!0}const en=[new Ki,new Ki,new Ki,new Ki,new Ki,new Ki,new Ki,new Ki],nn=new Ki,rn=new $i,sn=new Ki,on=new Ki,an=new Ki,hn=new Ki,ln=new Ki,cn=new Ki,un=new Ki,dn=new Ki,pn=new Ki,fn=new Ki,mn=new $i;class gn{constructor(t,e){this.center=void 0!==t?t:new Ki,this.radius=void 0!==e?e:-1}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):mn.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;e<r;e++)n=Math.max(n,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(n),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new Ki),e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new $i),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}}const vn=new Ki,yn=new Ki,xn=new Ki,bn=new Ki,wn=new Ki,Tn=new Ki,_n=new Ki;class En{constructor(t,e){this.origin=void 0!==t?t:new Ki,this.direction=void 0!==e?e:new Ki(0,0,-1)}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Ki),e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,vn)),this}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Ki),e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=vn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(vn.copy(this.direction).multiplyScalar(e).add(this.origin),vn.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){yn.copy(t).add(e).multiplyScalar(.5),xn.copy(e).sub(t).normalize(),bn.copy(this.origin).sub(yn);const r=.5*t.distanceTo(e),s=-this.direction.dot(xn),o=bn.dot(this.direction),a=-bn.dot(xn),h=bn.lengthSq(),l=Math.abs(1-s*s);let c,u,d,p;if(l>0)if(c=s*a-o,u=s*o-a,p=r*l,c>=0)if(u>=-p)if(u<=p){const t=1/l;c*=t,u*=t,d=c*(c+s*u+2*o)+u*(s*c+u+2*a)+h}else u=r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+h;else u=-r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+h;else u<=-p?(c=Math.max(0,-(-s*r+o)),u=c>0?-r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+h):u<=p?(c=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+h):(c=Math.max(0,-(s*r+o)),u=c>0?r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+h);else u=s>0?-r:r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+h;return i&&i.copy(this.direction).multiplyScalar(c).add(this.origin),n&&n.copy(xn).multiplyScalar(u).add(yn),d}intersectSphere(t,e){vn.subVectors(t.center,this.origin);const i=vn.dot(this.direction),n=vn.dot(vn)-i*i,r=t.radius*t.radius;if(n>r)return null;const s=Math.sqrt(r-n),o=i-s,a=i+s;return o<0&&a<0?null:o<0?this.at(a,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,s,o,a;const h=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,u=this.origin;return h>=0?(i=(t.min.x-u.x)*h,n=(t.max.x-u.x)*h):(i=(t.max.x-u.x)*h,n=(t.min.x-u.x)*h),l>=0?(r=(t.min.y-u.y)*l,s=(t.max.y-u.y)*l):(r=(t.max.y-u.y)*l,s=(t.min.y-u.y)*l),i>s||r>n?null:((r>i||i!=i)&&(i=r),(s<n||n!=n)&&(n=s),c>=0?(o=(t.min.z-u.z)*c,a=(t.max.z-u.z)*c):(o=(t.max.z-u.z)*c,a=(t.min.z-u.z)*c),i>a||o>n?null:((o>i||i!=i)&&(i=o),(a<n||n!=n)&&(n=a),n<0?null:this.at(i>=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,vn)}intersectTriangle(t,e,i,n,r){wn.subVectors(e,t),Tn.subVectors(i,t),_n.crossVectors(wn,Tn);let s,o=this.direction.dot(_n);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}bn.subVectors(this.origin,t);const a=s*this.direction.dot(Tn.crossVectors(bn,Tn));if(a<0)return null;const h=s*this.direction.dot(wn.cross(bn));if(h<0)return null;if(a+h>o)return null;const l=-s*bn.dot(_n);return l<0?null:this.at(l/o,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}class Sn{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=h,g[6]=l,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Sn).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,n=1/Mn.setFromMatrixColumn(t,0).length(),r=1/Mn.setFromMatrixColumn(t,1).length(),s=1/Mn.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,i=t.x,n=t.y,r=t.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(n),h=Math.sin(n),l=Math.cos(r),c=Math.sin(r);if("XYZ"===t.order){const t=s*l,i=s*c,n=o*l,r=o*c;e[0]=a*l,e[4]=-a*c,e[8]=h,e[1]=i+n*h,e[5]=t-r*h,e[9]=-o*a,e[2]=r-t*h,e[6]=n+i*h,e[10]=s*a}else if("YXZ"===t.order){const t=a*l,i=a*c,n=h*l,r=h*c;e[0]=t+r*o,e[4]=n*o-i,e[8]=s*h,e[1]=s*c,e[5]=s*l,e[9]=-o,e[2]=i*o-n,e[6]=r+t*o,e[10]=s*a}else if("ZXY"===t.order){const t=a*l,i=a*c,n=h*l,r=h*c;e[0]=t-r*o,e[4]=-s*c,e[8]=n+i*o,e[1]=i+n*o,e[5]=s*l,e[9]=r-t*o,e[2]=-s*h,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*l,i=s*c,n=o*l,r=o*c;e[0]=a*l,e[4]=n*h-i,e[8]=t*h+r,e[1]=a*c,e[5]=r*h+t,e[9]=i*h-n,e[2]=-h,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,i=s*h,n=o*a,r=o*h;e[0]=a*l,e[4]=r-t*c,e[8]=n*c+i,e[1]=c,e[5]=s*l,e[9]=-o*l,e[2]=-h*l,e[6]=i*c+n,e[10]=t-r*c}else if("XZY"===t.order){const t=s*a,i=s*h,n=o*a,r=o*h;e[0]=a*l,e[4]=-c,e[8]=h*l,e[1]=t*c+r,e[5]=s*l,e[9]=i*c-n,e[2]=n*c-i,e[6]=o*l,e[10]=r*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Cn,t,Pn)}lookAt(t,e,i){const n=this.elements;return On.subVectors(t,e),0===On.lengthSq()&&(On.z=1),On.normalize(),Rn.crossVectors(i,On),0===Rn.lengthSq()&&(1===Math.abs(i.z)?On.x+=1e-4:On.z+=1e-4,On.normalize(),Rn.crossVectors(i,On)),Rn.normalize(),Ln.crossVectors(On,Rn),n[0]=Rn.x,n[4]=Ln.x,n[8]=On.x,n[1]=Rn.y,n[5]=Ln.y,n[9]=On.y,n[2]=Rn.z,n[6]=Ln.z,n[10]=On.z,this}multiply(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(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[4],a=i[8],h=i[12],l=i[1],c=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],x=i[11],b=i[15],w=n[0],T=n[4],_=n[8],E=n[12],S=n[1],M=n[5],A=n[9],C=n[13],P=n[2],R=n[6],L=n[10],O=n[14],D=n[3],I=n[7],F=n[11],B=n[15];return r[0]=s*w+o*S+a*P+h*D,r[4]=s*T+o*M+a*R+h*I,r[8]=s*_+o*A+a*L+h*F,r[12]=s*E+o*C+a*O+h*B,r[1]=l*w+c*S+u*P+d*D,r[5]=l*T+c*M+u*R+d*I,r[9]=l*_+c*A+u*L+d*F,r[13]=l*E+c*C+u*O+d*B,r[2]=p*w+f*S+m*P+g*D,r[6]=p*T+f*M+m*R+g*I,r[10]=p*_+f*A+m*L+g*F,r[14]=p*E+f*C+m*O+g*B,r[3]=v*w+y*S+x*P+b*D,r[7]=v*T+y*M+x*R+b*I,r[11]=v*_+y*A+x*L+b*F,r[15]=v*E+y*C+x*O+b*B,this}multiplyScalar(t){const 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}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],s=t[1],o=t[5],a=t[9],h=t[13],l=t[2],c=t[6],u=t[10],d=t[14];return t[3]*(+r*a*c-n*h*c-r*o*u+i*h*u+n*o*d-i*a*d)+t[7]*(+e*a*d-e*h*u+r*s*u-n*s*d+n*h*l-r*a*l)+t[11]*(+e*h*c-e*o*d-r*s*c+i*s*d+r*o*l-i*h*l)+t[15]*(-n*o*l-e*a*c+e*o*u+n*s*c-i*s*u+i*a*l)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=c*m*h-f*u*h+f*a*d-o*m*d-c*a*g+o*u*g,y=p*u*h-l*m*h-p*a*d+s*m*d+l*a*g-s*u*g,x=l*f*h-p*c*h+p*o*d-s*f*d-l*o*g+s*c*g,b=p*c*a-l*f*a-p*o*u+s*f*u+l*o*m-s*c*m,w=e*v+i*y+n*x+r*b;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/w;return t[0]=v*T,t[1]=(f*u*r-c*m*r-f*n*d+i*m*d+c*n*g-i*u*g)*T,t[2]=(o*m*r-f*a*r+f*n*h-i*m*h-o*n*g+i*a*g)*T,t[3]=(c*a*r-o*u*r-c*n*h+i*u*h+o*n*d-i*a*d)*T,t[4]=y*T,t[5]=(l*m*r-p*u*r+p*n*d-e*m*d-l*n*g+e*u*g)*T,t[6]=(p*a*r-s*m*r-p*n*h+e*m*h+s*n*g-e*a*g)*T,t[7]=(s*u*r-l*a*r+l*n*h-e*u*h-s*n*d+e*a*d)*T,t[8]=x*T,t[9]=(p*c*r-l*f*r-p*i*d+e*f*d+l*i*g-e*c*g)*T,t[10]=(s*f*r-p*o*r+p*i*h-e*f*h-s*i*g+e*o*g)*T,t[11]=(l*o*r-s*c*r-l*i*h+e*c*h+s*i*d-e*o*d)*T,t[12]=b*T,t[13]=(l*f*n-p*c*n+p*i*u-e*f*u-l*i*m+e*c*m)*T,t[14]=(p*o*n-s*f*n-p*i*a+e*f*a+s*i*m-e*o*m)*T,t[15]=(s*c*n-l*o*n+l*i*a-e*c*a-s*i*u+e*o*u)*T,this}scale(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,o=t.y,a=t.z,h=r*s,l=r*o;return this.set(h*s+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*s,0,h*a-n*o,l*a+n*s,r*a*a+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e._x,s=e._y,o=e._z,a=e._w,h=r+r,l=s+s,c=o+o,u=r*h,d=r*l,p=r*c,f=s*l,m=s*c,g=o*c,v=a*h,y=a*l,x=a*c,b=i.x,w=i.y,T=i.z;return n[0]=(1-(f+g))*b,n[1]=(d+x)*b,n[2]=(p-y)*b,n[3]=0,n[4]=(d-x)*w,n[5]=(1-(u+g))*w,n[6]=(m+v)*w,n[7]=0,n[8]=(p+y)*T,n[9]=(m-v)*T,n[10]=(1-(u+f))*T,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let r=Mn.set(n[0],n[1],n[2]).length();const s=Mn.set(n[4],n[5],n[6]).length(),o=Mn.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],An.copy(this);const a=1/r,h=1/s,l=1/o;return An.elements[0]*=a,An.elements[1]*=a,An.elements[2]*=a,An.elements[4]*=h,An.elements[5]*=h,An.elements[6]*=h,An.elements[8]*=l,An.elements[9]*=l,An.elements[10]*=l,e.setFromRotationMatrix(An),i.x=r,i.y=s,i.z=o,this}makePerspective(t,e,i,n,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,a=2*r/(e-t),h=2*r/(i-n),l=(e+t)/(e-t),c=(i+n)/(i-n),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=h,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,n,r,s){const o=this.elements,a=1/(e-t),h=1/(i-n),l=1/(s-r),c=(e+t)*a,u=(i+n)*h,d=(s+r)*l;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*h,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const Mn=new Ki,An=new Sn,Cn=new Ki(0,0,0),Pn=new Ki(1,1,1),Rn=new Ki,Ln=new Ki,On=new Ki;class Dn{constructor(t=0,e=0,i=0,n=Dn.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._order=n||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e,i){const n=Ni.clamp,r=t.elements,s=r[0],o=r[4],a=r[8],h=r[1],l=r[5],c=r[9],u=r[2],d=r[6],p=r[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-n(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(n(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-n(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return In.makeRotationFromQuaternion(t),this.setFromRotationMatrix(In,e,i)}setFromVector3(t,e){return this.set(t.x,t.y,t.z,e||this._order)}reorder(t){return Fn.setFromEuler(this),this.setFromQuaternion(Fn,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(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(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new Ki(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}Dn.DefaultOrder="XYZ",Dn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const In=new Sn,Fn=new Zi;class Bn{constructor(){this.mask=1}set(t){this.mask=1<<t|0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!=(this.mask&t.mask)}}let kn=0;const Nn=new Ki,Un=new Zi,zn=new Sn,Gn=new Ki,Vn=new Ki,Hn=new Ki,Wn=new Zi,Xn=new Ki(1,0,0),jn=new Ki(0,1,0),Yn=new Ki(0,0,1),qn={type:"added"},Zn={type:"removed"};function Kn(){Object.defineProperty(this,"id",{value:kn++}),this.uuid=Ni.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Kn.DefaultUp.clone();const t=new Ki,e=new Dn,i=new Zi,n=new Ki(1,1,1);e._onChange((function(){i.setFromEuler(e,!1)})),i._onChange((function(){e.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Sn},normalMatrix:{value:new zi}}),this.matrix=new Sn,this.matrixWorld=new Sn,this.matrixAutoUpdate=Kn.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Bn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}Kn.DefaultUp=new Ki(0,1,0),Kn.DefaultMatrixAutoUpdate=!0,Kn.prototype=Object.assign(Object.create(Fi.prototype),{constructor:Kn,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return Un.setFromAxisAngle(t,e),this.quaternion.multiply(Un),this},rotateOnWorldAxis:function(t,e){return Un.setFromAxisAngle(t,e),this.quaternion.premultiply(Un),this},rotateX:function(t){return this.rotateOnAxis(Xn,t)},rotateY:function(t){return this.rotateOnAxis(jn,t)},rotateZ:function(t){return this.rotateOnAxis(Yn,t)},translateOnAxis:function(t,e){return Nn.copy(t).applyQuaternion(this.quaternion),this.position.add(Nn.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(Xn,t)},translateY:function(t){return this.translateOnAxis(jn,t)},translateZ:function(t){return this.translateOnAxis(Yn,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(zn.copy(this.matrixWorld).invert())},lookAt:function(t,e,i){t.isVector3?Gn.copy(t):Gn.set(t,e,i);const n=this.parent;this.updateWorldMatrix(!0,!1),Vn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?zn.lookAt(Vn,Gn,this.up):zn.lookAt(Gn,Vn,this.up),this.quaternion.setFromRotationMatrix(zn),n&&(zn.extractRotation(n.matrixWorld),Un.setFromRotationMatrix(zn),this.quaternion.premultiply(Un.invert()))},add:function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(qn)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Zn)),this},clear:function(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(Zn)}return this.children.length=0,this},attach:function(t){return this.updateWorldMatrix(!0,!1),zn.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),zn.multiply(t.parent.matrixWorld)),t.applyMatrix4(zn),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new Ki),this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new Zi),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vn,t,Hn),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new Ki),this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Vn,Wn,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Ki),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)},traverseVisible:function(t){if(!1===this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)},traverseAncestors:function(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){const i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}},toJSON:function(t){const e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const n={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){n.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const i=e.shapes;if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){const n=i[e];r(t.shapes,n)}else r(t.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let i=0,n=this.material.length;i<n;i++)e.push(r(t.materials,this.material[i]));n.material=e}else n.material=r(t.materials,this.material);if(this.children.length>0){n.children=[];for(let e=0;e<this.children.length;e++)n.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let e=0;e<this.animations.length;e++){const i=this.animations[e];n.animations.push(r(t.animations,i))}}if(e){const e=s(t.geometries),n=s(t.materials),r=s(t.textures),o=s(t.images),a=s(t.shapes),h=s(t.skeletons),l=s(t.animations);e.length>0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),o.length>0&&(i.images=o),a.length>0&&(i.shapes=a),h.length>0&&(i.skeletons=h),l.length>0&&(i.animations=l)}return i.object=n,i;function s(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,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(let e=0;e<t.children.length;e++){const i=t.children[e];this.add(i.clone())}return this}});const Jn=new Ki,Qn=new Ki,$n=new zi;class tr{constructor(t,e){Object.defineProperty(this,"isPlane",{value:!0}),this.normal=void 0!==t?t:new Ki(1,0,0),this.constant=void 0!==e?e:0}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=Jn.subVectors(i,e).cross(Qn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new Ki),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new Ki);const i=t.delta(Jn),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?void 0:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Ki),t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||$n.getNormalMatrix(t),n=this.coplanarPoint(Jn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}const er=new Ki,ir=new Ki,nr=new Ki,rr=new Ki,sr=new Ki,or=new Ki,ar=new Ki,hr=new Ki,lr=new Ki,cr=new Ki;class ur{constructor(t,e,i){this.a=void 0!==t?t:new Ki,this.b=void 0!==e?e:new Ki,this.c=void 0!==i?i:new Ki}static getNormal(t,e,i,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new Ki),n.subVectors(i,e),er.subVectors(t,e),n.cross(er);const r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(t,e,i,n,r){er.subVectors(n,e),ir.subVectors(i,e),nr.subVectors(t,e);const s=er.dot(er),o=er.dot(ir),a=er.dot(nr),h=ir.dot(ir),l=ir.dot(nr),c=s*h-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Ki),0===c)return r.set(-2,-1,-1);const u=1/c,d=(h*a-o*l)*u,p=(s*l-o*a)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,rr),rr.x>=0&&rr.y>=0&&rr.x+rr.y<=1}static getUV(t,e,i,n,r,s,o,a){return this.getBarycoord(t,e,i,n,rr),a.set(0,0),a.addScaledVector(r,rr.x),a.addScaledVector(s,rr.y),a.addScaledVector(o,rr.z),a}static isFrontFacing(t,e,i,n){return er.subVectors(i,e),ir.subVectors(t,e),er.cross(ir).dot(n)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return er.subVectors(this.c,this.b),ir.subVectors(this.a,this.b),.5*er.cross(ir).length()}getMidpoint(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Ki),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ur.getNormal(this.a,this.b,this.c,t)}getPlane(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new tr),t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ur.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return ur.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return ur.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ur.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new Ki);const i=this.a,n=this.b,r=this.c;let s,o;sr.subVectors(n,i),or.subVectors(r,i),hr.subVectors(t,i);const a=sr.dot(hr),h=or.dot(hr);if(a<=0&&h<=0)return e.copy(i);lr.subVectors(t,n);const l=sr.dot(lr),c=or.dot(lr);if(l>=0&&c<=l)return e.copy(n);const u=a*c-l*h;if(u<=0&&a>=0&&l<=0)return s=a/(a-l),e.copy(i).addScaledVector(sr,s);cr.subVectors(t,r);const d=sr.dot(cr),p=or.dot(cr);if(p>=0&&d<=p)return e.copy(r);const f=d*h-a*p;if(f<=0&&h>=0&&p<=0)return o=h/(h-p),e.copy(i).addScaledVector(or,o);const m=l*p-d*c;if(m<=0&&c-l>=0&&d-p>=0)return ar.subVectors(r,n),o=(c-l)/(c-l+(d-p)),e.copy(n).addScaledVector(ar,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(i).addScaledVector(sr,s).addScaledVector(or,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const dr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},pr={h:0,s:0,l:0},fr={h:0,s:0,l:0};function mr(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function gr(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function vr(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class yr{constructor(t,e,i){return Object.defineProperty(this,"isColor",{value:!0}),void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,i){return this.r=t,this.g=e,this.b=i,this}setHSL(t,e,i){if(t=Ni.euclideanModulo(t,1),e=Ni.clamp(e,0,1),i=Ni.clamp(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=mr(r,n,t+1/3),this.g=mr(r,n,t),this.b=mr(r,n,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const i=parseFloat(t[1])/360,n=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(i,n,r)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=i[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=dr[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=gr(t.r),this.g=gr(t.g),this.b=gr(t.b),this}copyLinearToSRGB(t){return this.r=vr(t.r),this.g=vr(t.g),this.b=vr(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,i=this.g,n=this.b,r=Math.max(e,i,n),s=Math.min(e,i,n);let o,a;const h=(s+r)/2;if(s===r)o=0,a=0;else{const t=r-s;switch(a=h<=.5?t/(r+s):t/(2-r-s),r){case e:o=(i-n)/t+(i<n?6:0);break;case i:o=(n-e)/t+2;break;case n:o=(e-i)/t+4}o/=6}return t.h=o,t.s=a,t.l=h,t}getStyle(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"}offsetHSL(t,e,i){return this.getHSL(pr),pr.h+=t,pr.s+=e,pr.l+=i,this.setHSL(pr.h,pr.s,pr.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(pr),t.getHSL(fr);const i=Ni.lerp(pr.h,fr.h,e),n=Ni.lerp(pr.s,fr.s,e),r=Ni.lerp(pr.l,fr.l,e);return this.setHSL(i,n,r),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}yr.NAMES=dr,yr.prototype.r=1,yr.prototype.g=1,yr.prototype.b=1;class xr{constructor(t,e,i,n,r,s=0){this.a=t,this.b=e,this.c=i,this.normal=n&&n.isVector3?n:new Ki,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new yr,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=s}clone(){return(new this.constructor).copy(this)}copy(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(let e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(let e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}let br=0;function wr(){Object.defineProperty(this,"id",{value:br++}),this.uuid=Ni.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=b,this.side=f,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=I,this.blendDst=F,this.blendEquation=S,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=W,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=_i,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=li,this.stencilZFail=li,this.stencilZPass=li,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function Tr(t){wr.call(this),this.type="MeshBasicMaterial",this.color=new yr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Z,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}wr.prototype=Object.assign(Object.create(Fi.prototype),{constructor:wr,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===v;continue}const n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}},toJSON:function(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(i.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,i.reflectivity=this.reflectivity,i.refractionRatio=this.refractionRatio,void 0!==this.combine&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==b&&(i.blending=this.blending),!0===this.flatShading&&(i.flatShading=this.flatShading),this.side!==f&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.morphNormals&&(i.morphNormals=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,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.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,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.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(wr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Tr.prototype=Object.create(wr.prototype),Tr.prototype.constructor=Tr,Tr.prototype.isMeshBasicMaterial=!0,Tr.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};const _r=new Ki,Er=new Ui;function Sr(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=Ei,this.updateRange={offset:0,count:-1},this.version=0}function Mr(t,e,i){Sr.call(this,new Int8Array(t),e,i)}function Ar(t,e,i){Sr.call(this,new Uint8Array(t),e,i)}function Cr(t,e,i){Sr.call(this,new Uint8ClampedArray(t),e,i)}function Pr(t,e,i){Sr.call(this,new Int16Array(t),e,i)}function Rr(t,e,i){Sr.call(this,new Uint16Array(t),e,i)}function Lr(t,e,i){Sr.call(this,new Int32Array(t),e,i)}function Or(t,e,i){Sr.call(this,new Uint32Array(t),e,i)}function Dr(t,e,i){Sr.call(this,new Uint16Array(t),e,i)}function Ir(t,e,i){Sr.call(this,new Float32Array(t),e,i)}function Fr(t,e,i){Sr.call(this,new Float64Array(t),e,i)}function Br(t){if(0===t.length)return-1/0;let e=t[0];for(let i=1,n=t.length;i<n;++i)t[i]>e&&(e=t[i]);return e}Object.defineProperty(Sr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Sr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),r=new yr),e[i++]=r.r,e[i++]=r.g,e[i++]=r.b}return this},copyVector2sArray:function(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),r=new Ui),e[i++]=r.x,e[i++]=r.y}return this},copyVector3sArray:function(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),r=new Ki),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z}return this},copyVector4sArray:function(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),r=new ji),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z,e[i++]=r.w}return this},applyMatrix3:function(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)Er.fromBufferAttribute(this,e),Er.applyMatrix3(t),this.setXY(e,Er.x,Er.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)_r.fromBufferAttribute(this,e),_r.applyMatrix3(t),this.setXYZ(e,_r.x,_r.y,_r.z);return this},applyMatrix4:function(t){for(let e=0,i=this.count;e<i;e++)_r.x=this.getX(e),_r.y=this.getY(e),_r.z=this.getZ(e),_r.applyMatrix4(t),this.setXYZ(e,_r.x,_r.y,_r.z);return this},applyNormalMatrix:function(t){for(let e=0,i=this.count;e<i;e++)_r.x=this.getX(e),_r.y=this.getY(e),_r.z=this.getZ(e),_r.applyNormalMatrix(t),this.setXYZ(e,_r.x,_r.y,_r.z);return this},transformDirection:function(t){for(let e=0,i=this.count;e<i;e++)_r.x=this.getX(e),_r.y=this.getY(e),_r.z=this.getZ(e),_r.transformDirection(t),this.setXYZ(e,_r.x,_r.y,_r.z);return this},set:function(t,e=0){return this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Mr.prototype=Object.create(Sr.prototype),Mr.prototype.constructor=Mr,Ar.prototype=Object.create(Sr.prototype),Ar.prototype.constructor=Ar,Cr.prototype=Object.create(Sr.prototype),Cr.prototype.constructor=Cr,Pr.prototype=Object.create(Sr.prototype),Pr.prototype.constructor=Pr,Rr.prototype=Object.create(Sr.prototype),Rr.prototype.constructor=Rr,Lr.prototype=Object.create(Sr.prototype),Lr.prototype.constructor=Lr,Or.prototype=Object.create(Sr.prototype),Or.prototype.constructor=Or,Dr.prototype=Object.create(Sr.prototype),Dr.prototype.constructor=Dr,Dr.prototype.isFloat16BufferAttribute=!0,Ir.prototype=Object.create(Sr.prototype),Ir.prototype.constructor=Ir,Fr.prototype=Object.create(Sr.prototype),Fr.prototype.constructor=Fr;const kr={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Nr(t,e){return new kr[t](e)}let Ur=0;const zr=new Sn,Gr=new Kn,Vr=new Ki,Hr=new $i,Wr=new $i,Xr=new Ki;function jr(){Object.defineProperty(this,"id",{value:Ur++}),this.uuid=Ni.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}jr.prototype=Object.assign(Object.create(Fi.prototype),{constructor:jr,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){return Array.isArray(t)?this.index=new(Br(t)>65535?Or:Rr)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new zi).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return zr.makeRotationX(t),this.applyMatrix4(zr),this},rotateY:function(t){return zr.makeRotationY(t),this.applyMatrix4(zr),this},rotateZ:function(t){return zr.makeRotationZ(t),this.applyMatrix4(zr),this},translate:function(t,e,i){return zr.makeTranslation(t,e,i),this.applyMatrix4(zr),this},scale:function(t,e,i){return zr.makeScale(t,e,i),this.applyMatrix4(zr),this},lookAt:function(t){return Gr.lookAt(t),Gr.updateMatrix(),this.applyMatrix4(Gr.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Vr).negate(),this.translate(Vr.x,Vr.y,Vr.z),this},setFromPoints:function(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new Ir(e,3)),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new $i);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new Ki(-1/0,-1/0,-1/0),new Ki(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];Hr.setFromBufferAttribute(i),this.morphTargetsRelative?(Xr.addVectors(this.boundingBox.min,Hr.min),this.boundingBox.expandByPoint(Xr),Xr.addVectors(this.boundingBox.max,Hr.max),this.boundingBox.expandByPoint(Xr)):(this.boundingBox.expandByPoint(Hr.min),this.boundingBox.expandByPoint(Hr.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new gn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new Ki,1/0);if(t){const i=this.boundingSphere.center;if(Hr.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];Wr.setFromBufferAttribute(i),this.morphTargetsRelative?(Xr.addVectors(Hr.min,Wr.min),Hr.expandByPoint(Xr),Xr.addVectors(Hr.max,Wr.max),Hr.expandByPoint(Xr)):(Hr.expandByPoint(Wr.min),Hr.expandByPoint(Wr.max))}Hr.getCenter(i);let n=0;for(let e=0,r=t.count;e<r;e++)Xr.fromBufferAttribute(t,e),n=Math.max(n,i.distanceToSquared(Xr));if(e)for(let r=0,s=e.length;r<s;r++){const s=e[r],o=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++)Xr.fromBufferAttribute(s,e),o&&(Vr.fromBufferAttribute(t,e),Xr.add(Vr)),n=Math.max(n,i.distanceToSquared(Xr))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeTangents:function(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=t.array,n=e.position.array,r=e.normal.array,s=e.uv.array,o=n.length/3;void 0===e.tangent&&this.setAttribute("tangent",new Sr(new Float32Array(4*o),4));const a=e.tangent.array,h=[],l=[];for(let t=0;t<o;t++)h[t]=new Ki,l[t]=new Ki;const c=new Ki,u=new Ki,d=new Ki,p=new Ui,f=new Ui,m=new Ui,g=new Ki,v=new Ki;function y(t,e,i){c.fromArray(n,3*t),u.fromArray(n,3*e),d.fromArray(n,3*i),p.fromArray(s,2*t),f.fromArray(s,2*e),m.fromArray(s,2*i),u.sub(c),d.sub(c),f.sub(p),m.sub(p);const r=1/(f.x*m.y-m.x*f.y);isFinite(r)&&(g.copy(u).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(r),v.copy(d).multiplyScalar(f.x).addScaledVector(u,-m.x).multiplyScalar(r),h[t].add(g),h[e].add(g),h[i].add(g),l[t].add(v),l[e].add(v),l[i].add(v))}let x=this.groups;0===x.length&&(x=[{start:0,count:i.length}]);for(let t=0,e=x.length;t<e;++t){const e=x[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)y(i[t+0],i[t+1],i[t+2])}const b=new Ki,w=new Ki,T=new Ki,_=new Ki;function E(t){T.fromArray(r,3*t),_.copy(T);const e=h[t];b.copy(e),b.sub(T.multiplyScalar(T.dot(e))).normalize(),w.crossVectors(_,e);const i=w.dot(l[t])<0?-1:1;a[4*t]=b.x,a[4*t+1]=b.y,a[4*t+2]=b.z,a[4*t+3]=i}for(let t=0,e=x.length;t<e;++t){const e=x[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)E(i[t+0]),E(i[t+1]),E(i[t+2])}},computeVertexNormals:function(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new Sr(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);const n=new Ki,r=new Ki,s=new Ki,o=new Ki,a=new Ki,h=new Ki,l=new Ki,c=new Ki;if(t)for(let u=0,d=t.count;u<d;u+=3){const d=t.getX(u+0),p=t.getX(u+1),f=t.getX(u+2);n.fromBufferAttribute(e,d),r.fromBufferAttribute(e,p),s.fromBufferAttribute(e,f),l.subVectors(s,r),c.subVectors(n,r),l.cross(c),o.fromBufferAttribute(i,d),a.fromBufferAttribute(i,p),h.fromBufferAttribute(i,f),o.add(l),a.add(l),h.add(l),i.setXYZ(d,o.x,o.y,o.z),i.setXYZ(p,a.x,a.y,a.z),i.setXYZ(f,h.x,h.y,h.z)}else for(let t=0,o=e.count;t<o;t+=3)n.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),l.subVectors(s,r),c.subVectors(n,r),l.cross(c),i.setXYZ(t+0,l.x,l.y,l.z),i.setXYZ(t+1,l.x,l.y,l.z),i.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),i.needsUpdate=!0}},merge:function(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const i=this.attributes;for(const n in i){if(void 0===t.attributes[n])continue;const r=i[n].array,s=t.attributes[n],o=s.array,a=s.itemSize*e,h=Math.min(o.length,r.length-a);for(let t=0,e=a;t<h;t++,e++)r[e]=o[t]}return this},normalizeNormals:function(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)Xr.fromBufferAttribute(t,e),Xr.normalize(),t.setXYZ(e,Xr.x,Xr.y,Xr.z)},toNonIndexed:function(){function t(t,e){const i=t.array,n=t.itemSize,r=t.normalized,s=new i.constructor(e.length*n);let o=0,a=0;for(let t=0,r=e.length;t<r;t++){o=e[t]*n;for(let t=0;t<n;t++)s[a++]=i[o++]}return new Sr(s,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new jr,i=this.index.array,n=this.attributes;for(const r in n){const s=t(n[r],i);e.setAttribute(r,s)}const r=this.morphAttributes;for(const n in r){const s=[],o=r[n];for(let e=0,n=o.length;e<n;e++){const n=t(o[e],i);s.push(n)}e.morphAttributes[n]=s}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let t=0,i=s.length;t<i;t++){const i=s[t];e.addGroup(i.start,i.count,i.materialIndex)}return e},toJSON:function(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e],r=n.toJSON(t.data);""!==n.name&&(r.name=n.name),t.data.attributes[e]=r}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],s=[];for(let e=0,n=i.length;e<n;e++){const n=i[e],r=n.toJSON(t.data);""!==n.name&&(r.name=n.name),s.push(r)}s.length>0&&(n[e]=s,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t},clone:function(){return(new jr).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const r=t.morphAttributes;for(const t in r){const i=[],n=r[t];for(let t=0,r=n.length;t<r;t++)i.push(n[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});const Yr=new Sn,qr=new En,Zr=new gn,Kr=new Ki,Jr=new Ki,Qr=new Ki,$r=new Ki,ts=new Ki,es=new Ki,is=new Ki,ns=new Ki,rs=new Ki,ss=new Ui,os=new Ui,as=new Ui,hs=new Ki,ls=new Ki;function cs(t=new jr,e=new Tr){Kn.call(this),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}function us(t,e,i,n,r,s,o,a,h,l,c,u){Kr.fromBufferAttribute(r,l),Jr.fromBufferAttribute(r,c),Qr.fromBufferAttribute(r,u);const d=t.morphTargetInfluences;if(e.morphTargets&&s&&d){is.set(0,0,0),ns.set(0,0,0),rs.set(0,0,0);for(let t=0,e=s.length;t<e;t++){const e=d[t],i=s[t];0!==e&&($r.fromBufferAttribute(i,l),ts.fromBufferAttribute(i,c),es.fromBufferAttribute(i,u),o?(is.addScaledVector($r,e),ns.addScaledVector(ts,e),rs.addScaledVector(es,e)):(is.addScaledVector($r.sub(Kr),e),ns.addScaledVector(ts.sub(Jr),e),rs.addScaledVector(es.sub(Qr),e)))}Kr.add(is),Jr.add(ns),Qr.add(rs)}t.isSkinnedMesh&&(t.boneTransform(l,Kr),t.boneTransform(c,Jr),t.boneTransform(u,Qr));const p=function(t,e,i,n,r,s,o,a){let h;if(h=e.side===m?n.intersectTriangle(o,s,r,!0,a):n.intersectTriangle(r,s,o,e.side!==g,a),null===h)return null;ls.copy(a),ls.applyMatrix4(t.matrixWorld);const l=i.ray.origin.distanceTo(ls);return l<i.near||l>i.far?null:{distance:l,point:ls.clone(),object:t}}(t,e,i,n,Kr,Jr,Qr,hs);if(p){a&&(ss.fromBufferAttribute(a,l),os.fromBufferAttribute(a,c),as.fromBufferAttribute(a,u),p.uv=ur.getUV(hs,Kr,Jr,Qr,ss,os,as,new Ui)),h&&(ss.fromBufferAttribute(h,l),os.fromBufferAttribute(h,c),as.fromBufferAttribute(h,u),p.uv2=ur.getUV(hs,Kr,Jr,Qr,ss,os,as,new Ui));const t=new xr(l,c,u);ur.getNormal(Kr,Jr,Qr,t.normal),p.face=t}return p}cs.prototype=Object.assign(Object.create(Kn.prototype),{constructor:cs,isMesh:!0,copy:function(t){return Kn.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),Zr.copy(i.boundingSphere),Zr.applyMatrix4(r),!1===t.ray.intersectsSphere(Zr))return;if(Yr.copy(r).invert(),qr.copy(t.ray).applyMatrix4(Yr),null!==i.boundingBox&&!1===qr.intersectsBox(i.boundingBox))return;let s;if(i.isBufferGeometry){const r=i.index,o=i.attributes.position,a=i.morphAttributes.position,h=i.morphTargetsRelative,l=i.attributes.uv,c=i.attributes.uv2,u=i.groups,d=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,p=u.length;i<p;i++){const p=u[i],f=n[p.materialIndex];for(let i=Math.max(p.start,d.start),n=Math.min(p.start+p.count,d.start+d.count);i<n;i+=3){const n=r.getX(i),u=r.getX(i+1),d=r.getX(i+2);s=us(this,f,t,qr,o,a,h,l,c,n,u,d),s&&(s.faceIndex=Math.floor(i/3),s.face.materialIndex=p.materialIndex,e.push(s))}}else{for(let i=Math.max(0,d.start),u=Math.min(r.count,d.start+d.count);i<u;i+=3){const u=r.getX(i),d=r.getX(i+1),p=r.getX(i+2);s=us(this,n,t,qr,o,a,h,l,c,u,d,p),s&&(s.faceIndex=Math.floor(i/3),e.push(s))}}else if(void 0!==o)if(Array.isArray(n))for(let i=0,r=u.length;i<r;i++){const r=u[i],p=n[r.materialIndex];for(let i=Math.max(r.start,d.start),n=Math.min(r.start+r.count,d.start+d.count);i<n;i+=3){s=us(this,p,t,qr,o,a,h,l,c,i,i+1,i+2),s&&(s.faceIndex=Math.floor(i/3),s.face.materialIndex=r.materialIndex,e.push(s))}}else{for(let i=Math.max(0,d.start),r=Math.min(o.count,d.start+d.count);i<r;i+=3){s=us(this,n,t,qr,o,a,h,l,c,i,i+1,i+2),s&&(s.faceIndex=Math.floor(i/3),e.push(s))}}}else i.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}});class ds extends jr{constructor(t=1,e=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const o=this;n=Math.floor(n),r=Math.floor(r),s=Math.floor(s);const a=[],h=[],l=[],c=[];let u=0,d=0;function p(t,e,i,n,r,s,p,f,m,g,v){const y=s/m,x=p/g,b=s/2,w=p/2,T=f/2,_=m+1,E=g+1;let S=0,M=0;const A=new Ki;for(let s=0;s<E;s++){const o=s*x-w;for(let a=0;a<_;a++){const u=a*y-b;A[t]=u*n,A[e]=o*r,A[i]=T,h.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[i]=f>0?1:-1,l.push(A.x,A.y,A.z),c.push(a/m),c.push(1-s/g),S+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const i=u+e+_*t,n=u+e+_*(t+1),r=u+(e+1)+_*(t+1),s=u+(e+1)+_*t;a.push(i,n,s),a.push(n,r,s),M+=6}o.addGroup(d,M,v),d+=M,u+=S}p("z","y","x",-1,-1,i,e,t,s,r,0),p("z","y","x",1,-1,i,e,-t,s,r,1),p("x","z","y",1,1,t,i,e,n,s,2),p("x","z","y",1,-1,t,i,-e,n,s,3),p("x","y","z",1,-1,t,e,i,n,r,4),p("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(a),this.setAttribute("position",new Ir(h,3)),this.setAttribute("normal",new Ir(l,3)),this.setAttribute("uv",new Ir(c,2))}}function ps(t){const e={};for(const i in t){e[i]={};for(const n in t[i]){const r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}}return e}function fs(t){const e={};for(let i=0;i<t.length;i++){const n=ps(t[i]);for(const t in n)e[t]=n[t]}return e}const ms={clone:ps,merge:fs};function gs(t){wr.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,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function vs(){Kn.call(this),this.type="Camera",this.matrixWorldInverse=new Sn,this.projectionMatrix=new Sn,this.projectionMatrixInverse=new Sn}function ys(t=50,e=1,i=.1,n=2e3){vs.call(this),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}gs.prototype=Object.create(wr.prototype),gs.prototype.constructor=gs,gs.prototype.isShaderMaterial=!0,gs.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ps(t.uniforms),this.defines=Object.assign({},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=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this},gs.prototype.toJSON=function(t){const e=wr.prototype.toJSON.call(this,t);e.glslVersion=this.glslVersion,e.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i].value;n&&n.isTexture?e.uniforms[i]={type:"t",value:n.toJSON(t).uuid}:n&&n.isColor?e.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?e.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?e.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?e.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?e.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?e.uniforms[i]={type:"m4",value:n.toArray()}:e.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e},vs.prototype=Object.assign(Object.create(Kn.prototype),{constructor:vs,isCamera:!0,copy:function(t,e){return Kn.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Ki),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Kn.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(t,e){Kn.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),ys.prototype=Object.assign(Object.create(vs.prototype),{constructor:ys,isPerspectiveCamera:!0,copy:function(t,e){return vs.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){const e=.5*this.getFilmHeight()/t;this.fov=2*Ni.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*Ni.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Ni.RAD2DEG*Math.atan(Math.tan(.5*Ni.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,i,n,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=this.near;let e=t*Math.tan(.5*Ni.DEG2RAD*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;r+=s.offsetX*n/t,e-=s.offsetY*i/o,n*=s.width/t,i*=s.height/o}const o=this.filmOffset;0!==o&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){const e=Kn.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});function xs(t,e,i){if(Kn.call(this),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const n=new ys(90,1,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new Ki(1,0,0)),this.add(n);const r=new ys(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Ki(-1,0,0)),this.add(r);const s=new ys(90,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Ki(0,1,0)),this.add(s);const o=new ys(90,1,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Ki(0,-1,0)),this.add(o);const a=new ys(90,1,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new Ki(0,0,1)),this.add(a);const h=new ys(90,1,t,e);h.layers=this.layers,h.up.set(0,-1,0),h.lookAt(new Ki(0,0,-1)),this.add(h),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();const l=t.xr.enabled,c=t.getRenderTarget();t.xr.enabled=!1;const u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,o),t.setRenderTarget(i,4),t.render(e,a),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,h),t.setRenderTarget(c),t.xr.enabled=l}}function bs(t,e,i,n,r,s,o,a,h,l){t=void 0!==t?t:[],e=void 0!==e?e:st,o=void 0!==o?o:kt,Wi.call(this,t,e,i,n,r,s,o,a,h,l),this.flipY=!1,this._needsFlipEnvMap=!0}xs.prototype=Object.create(Kn.prototype),xs.prototype.constructor=xs,bs.prototype=Object.create(Wi.prototype),bs.prototype.constructor=bs,bs.prototype.isCubeTexture=!0,Object.defineProperty(bs.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});class ws extends Yi{constructor(t,e,i){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=i),super(t,t,e),Object.defineProperty(this,"isWebGLCubeRenderTarget",{value:!0}),e=e||{},this.texture=new bs(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=Nt,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new ds(5,5,5),r=new gs({name:"CubemapFromEquirect",uniforms:ps(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:m,blending:x});r.uniforms.tEquirect.value=e;const s=new cs(n,r),o=e.minFilter;e.minFilter===Tt&&(e.minFilter=xt);return new xs(1,10,this).update(t,s),e.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,i,n){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,n);t.setRenderTarget(r)}}function Ts(t,e,i,n,r,s,o,a,h,l,c,u){Wi.call(this,null,s,o,a,h,l,n,r,c,u),this.image={data:t||null,width:e||1,height:i||1},this.magFilter=void 0!==h?h:ft,this.minFilter=void 0!==l?l:ft,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Ts.prototype=Object.create(Wi.prototype),Ts.prototype.constructor=Ts,Ts.prototype.isDataTexture=!0;const _s=new gn,Es=new Ki;class Ss{constructor(t,e,i,n,r,s){this.planes=[void 0!==t?t:new tr,void 0!==e?e:new tr,void 0!==i?i:new tr,void 0!==n?n:new tr,void 0!==r?r:new tr,void 0!==s?s:new tr]}set(t,e,i,n,r,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(s),this}clone(){return(new this.constructor).copy(this)}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],h=i[5],l=i[6],c=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(o-n,c-a,f-u,y-m).normalize(),e[1].setComponents(o+n,c+a,f+u,y+m).normalize(),e[2].setComponents(o+r,c+h,f+d,y+g).normalize(),e[3].setComponents(o-r,c-h,f-d,y-g).normalize(),e[4].setComponents(o-s,c-l,f-p,y-v).normalize(),e[5].setComponents(o+s,c+l,f+p,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),_s.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(_s)}intersectsSprite(t){return _s.center.set(0,0,0),_s.radius=.7071067811865476,_s.applyMatrix4(t.matrixWorld),this.intersectsSphere(_s)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)<n)return!1}return!0}intersectsBox(t){const e=this.planes;for(let i=0;i<6;i++){const n=e[i];if(Es.x=n.normal.x>0?t.max.x:t.min.x,Es.y=n.normal.y>0?t.max.y:t.min.y,Es.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Es)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}}function Ms(){let t=null,e=!1,i=null,n=null;function r(e,s){i(e,s),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function As(t,e){const i=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=n.get(e);return void((!t||t.version<e.version)&&n.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const s=n.get(e);void 0===s?n.set(e,function(e,n){const r=e.array,s=e.usage,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,r,s),e.onUploadCallback();let a=5126;return r instanceof Float32Array?a=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?e.isFloat16BufferAttribute?i?a=5131:console.warn("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2."):a=5123:r instanceof Int16Array?a=5122:r instanceof Uint32Array?a=5125:r instanceof Int32Array?a=5124:r instanceof Int8Array?a=5120:r instanceof Uint8Array&&(a=5121),{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(e,r)):s.version<e.version&&(!function(e,n,r){const s=n.array,o=n.updateRange;t.bindBuffer(r,e),-1===o.count?t.bufferSubData(r,0,s):(i?t.bufferSubData(r,o.offset*s.BYTES_PER_ELEMENT,s,o.offset,o.count):t.bufferSubData(r,o.offset*s.BYTES_PER_ELEMENT,s.subarray(o.offset,o.offset+o.count)),o.count=-1)}(s.buffer,e,r),s.version=e.version)}}}class Cs extends jr{constructor(t=1,e=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n};const r=t/2,s=e/2,o=Math.floor(i),a=Math.floor(n),h=o+1,l=a+1,c=t/o,u=e/a,d=[],p=[],f=[],m=[];for(let t=0;t<l;t++){const e=t*u-s;for(let i=0;i<h;i++){const n=i*c-r;p.push(n,-e,0),f.push(0,0,1),m.push(i/o),m.push(1-t/a)}}for(let t=0;t<a;t++)for(let e=0;e<o;e++){const i=e+h*t,n=e+h*(t+1),r=e+1+h*(t+1),s=e+1+h*t;d.push(i,n,s),d.push(n,r,s)}this.setIndex(d),this.setAttribute("position",new Ir(p,3)),this.setAttribute("normal",new Ir(f,3)),this.setAttribute("uv",new Ir(m,2))}}const Ps={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\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\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\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}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( 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 dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\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#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\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\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\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}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\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 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\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.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\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.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, 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.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.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 = cLogLuvM * value.rgb;\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 = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\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\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 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 roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, 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\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\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",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",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\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\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\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\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\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\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\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};\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};\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};\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 ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in 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",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\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)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#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\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * 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 defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\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\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp 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",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_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 <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <transmissionmap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <transmissionmap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Rs={common:{diffuse:{value:new yr(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new zi},uv2Transform:{value:new zi},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ui(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new yr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new yr(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new zi}},sprite:{diffuse:{value:new yr(15658734)},opacity:{value:1},center:{value:new Ui(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new zi}}},Ls={basic:{uniforms:fs([Rs.common,Rs.specularmap,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.fog]),vertexShader:Ps.meshbasic_vert,fragmentShader:Ps.meshbasic_frag},lambert:{uniforms:fs([Rs.common,Rs.specularmap,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.fog,Rs.lights,{emissive:{value:new yr(0)}}]),vertexShader:Ps.meshlambert_vert,fragmentShader:Ps.meshlambert_frag},phong:{uniforms:fs([Rs.common,Rs.specularmap,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.fog,Rs.lights,{emissive:{value:new yr(0)},specular:{value:new yr(1118481)},shininess:{value:30}}]),vertexShader:Ps.meshphong_vert,fragmentShader:Ps.meshphong_frag},standard:{uniforms:fs([Rs.common,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.roughnessmap,Rs.metalnessmap,Rs.fog,Rs.lights,{emissive:{value:new yr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ps.meshphysical_vert,fragmentShader:Ps.meshphysical_frag},toon:{uniforms:fs([Rs.common,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.gradientmap,Rs.fog,Rs.lights,{emissive:{value:new yr(0)}}]),vertexShader:Ps.meshtoon_vert,fragmentShader:Ps.meshtoon_frag},matcap:{uniforms:fs([Rs.common,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.fog,{matcap:{value:null}}]),vertexShader:Ps.meshmatcap_vert,fragmentShader:Ps.meshmatcap_frag},points:{uniforms:fs([Rs.points,Rs.fog]),vertexShader:Ps.points_vert,fragmentShader:Ps.points_frag},dashed:{uniforms:fs([Rs.common,Rs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ps.linedashed_vert,fragmentShader:Ps.linedashed_frag},depth:{uniforms:fs([Rs.common,Rs.displacementmap]),vertexShader:Ps.depth_vert,fragmentShader:Ps.depth_frag},normal:{uniforms:fs([Rs.common,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,{opacity:{value:1}}]),vertexShader:Ps.normal_vert,fragmentShader:Ps.normal_frag},sprite:{uniforms:fs([Rs.sprite,Rs.fog]),vertexShader:Ps.sprite_vert,fragmentShader:Ps.sprite_frag},background:{uniforms:{uvTransform:{value:new zi},t2D:{value:null}},vertexShader:Ps.background_vert,fragmentShader:Ps.background_frag},cube:{uniforms:fs([Rs.envmap,{opacity:{value:1}}]),vertexShader:Ps.cube_vert,fragmentShader:Ps.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ps.equirect_vert,fragmentShader:Ps.equirect_frag},distanceRGBA:{uniforms:fs([Rs.common,Rs.displacementmap,{referencePosition:{value:new Ki},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ps.distanceRGBA_vert,fragmentShader:Ps.distanceRGBA_frag},shadow:{uniforms:fs([Rs.lights,Rs.fog,{color:{value:new yr(0)},opacity:{value:1}}]),vertexShader:Ps.shadow_vert,fragmentShader:Ps.shadow_frag}};function Os(t,e,i,n,r){const s=new yr(0);let o,a,h=0,l=null,c=0,u=null;function d(t,e){i.buffers.color.setClear(t.r,t.g,t.b,e,r)}return{getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),h=e,d(s,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,d(s,h)},render:function(i,r,p,g){let v=!0===r.isScene?r.background:null;v&&v.isTexture&&(v=e.get(v));const y=t.xr,x=y.getSession&&y.getSession();x&&"additive"===x.environmentBlendMode&&(v=null),null===v?d(s,h):v&&v.isColor&&(d(v,1),g=!0),(t.autoClear||g)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.isWebGLCubeRenderTarget||v.mapping===lt)?(void 0===a&&(a=new cs(new ds(1,1,1),new gs({name:"BackgroundCubeMaterial",uniforms:ps(Ls.cube.uniforms),vertexShader:Ls.cube.vertexShader,fragmentShader:Ls.cube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a)),v.isWebGLCubeRenderTarget&&(v=v.texture),a.material.uniforms.envMap.value=v,a.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,l===v&&c===v.version&&u===t.toneMapping||(a.material.needsUpdate=!0,l=v,c=v.version,u=t.toneMapping),i.unshift(a,a.geometry,a.material,0,0,null)):v&&v.isTexture&&(void 0===o&&(o=new cs(new Cs(2,2),new gs({name:"BackgroundMaterial",uniforms:ps(Ls.background.uniforms),vertexShader:Ls.background.vertexShader,fragmentShader:Ls.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=v,!0===v.matrixAutoUpdate&&v.updateMatrix(),o.material.uniforms.uvTransform.value.copy(v.matrix),l===v&&c===v.version&&u===t.toneMapping||(o.material.needsUpdate=!0,l=v,c=v.version,u=t.toneMapping),i.unshift(o,o.geometry,o.material,0,0,null))}}}function Ds(t,e,i,n){const r=t.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||null!==s,a={},h=d(null);let l=h;function c(e){return n.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function u(e){return n.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function d(t){const e=[],i=[],n=[];for(let t=0;t<r;t++)e[t]=0,i[t]=0,n[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:n,object:t,attributes:{},index:null}}function p(){const t=l.newAttributes;for(let e=0,i=t.length;e<i;e++)t[e]=0}function f(t){m(t,0)}function m(i,r){const s=l.newAttributes,o=l.enabledAttributes,a=l.attributeDivisors;if(s[i]=1,0===o[i]&&(t.enableVertexAttribArray(i),o[i]=1),a[i]!==r){(n.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),a[i]=r}}function g(){const e=l.newAttributes,i=l.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==e[n]&&(t.disableVertexAttribArray(n),i[n]=0)}function v(e,i,r,s,o,a){!0!==n.isWebGL2||5124!==r&&5125!==r?t.vertexAttribPointer(e,i,r,s,o,a):t.vertexAttribIPointer(e,i,r,o,a)}function y(){x(),l!==h&&(l=h,c(l.object))}function x(){h.geometry=null,h.program=null,h.wireframe=!1}return{setup:function(r,h,u,y,x){let b=!1;if(o){const e=function(e,i,r){const o=!0===r.wireframe;let h=a[e.id];void 0===h&&(h={},a[e.id]=h);let l=h[i.id];void 0===l&&(l={},h[i.id]=l);let c=l[o];void 0===c&&(c=d(n.isWebGL2?t.createVertexArray():s.createVertexArrayOES()),l[o]=c);return c}(y,u,h);l!==e&&(l=e,c(l.object)),b=function(t,e){const i=l.attributes,n=t.attributes;let r=0;for(const t in n){const e=i[t],s=n[t];if(void 0===e)return!0;if(e.attribute!==s)return!0;if(e.data!==s.data)return!0;r++}return l.attributesNum!==r||l.index!==e}(y,x),b&&function(t,e){const i={},n=t.attributes;let r=0;for(const t in n){const e=n[t],s={};s.attribute=e,e.data&&(s.data=e.data),i[t]=s,r++}l.attributes=i,l.attributesNum=r,l.index=e}(y,x)}else{const t=!0===h.wireframe;l.geometry===y.id&&l.program===u.id&&l.wireframe===t||(l.geometry=y.id,l.program=u.id,l.wireframe=t,b=!0)}!0===r.isInstancedMesh&&(b=!0),null!==x&&i.update(x,34963),b&&(!function(r,s,o,a){if(!1===n.isWebGL2&&(r.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;p();const h=a.attributes,l=o.getAttributes(),c=s.defaultAttributeValues;for(const e in l){const n=l[e];if(n>=0){const s=h[e];if(void 0!==s){const e=s.normalized,r=s.itemSize,o=i.get(s);if(void 0===o)continue;const h=o.buffer,l=o.type,c=o.bytesPerElement;if(s.isInterleavedBufferAttribute){const i=s.data,o=i.stride,u=s.offset;i&&i.isInstancedInterleavedBuffer?(m(n,i.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)):f(n),t.bindBuffer(34962,h),v(n,r,l,e,o*c,u*c)}else s.isInstancedBufferAttribute?(m(n,s.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)):f(n),t.bindBuffer(34962,h),v(n,r,l,e,0,0)}else if("instanceMatrix"===e){const e=i.get(r.instanceMatrix);if(void 0===e)continue;const s=e.buffer,o=e.type;m(n+0,1),m(n+1,1),m(n+2,1),m(n+3,1),t.bindBuffer(34962,s),t.vertexAttribPointer(n+0,4,o,!1,64,0),t.vertexAttribPointer(n+1,4,o,!1,64,16),t.vertexAttribPointer(n+2,4,o,!1,64,32),t.vertexAttribPointer(n+3,4,o,!1,64,48)}else if("instanceColor"===e){const e=i.get(r.instanceColor);if(void 0===e)continue;const s=e.buffer,o=e.type;m(n,1),t.bindBuffer(34962,s),t.vertexAttribPointer(n,3,o,!1,12,0)}else if(void 0!==c){const i=c[e];if(void 0!==i)switch(i.length){case 2:t.vertexAttrib2fv(n,i);break;case 3:t.vertexAttrib3fv(n,i);break;case 4:t.vertexAttrib4fv(n,i);break;default:t.vertexAttrib1fv(n,i)}}}}g()}(r,h,u,y),null!==x&&t.bindBuffer(34963,i.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const t in a){const e=a[t];for(const t in e){const i=e[t];for(const t in i)u(i[t].object),delete i[t];delete e[t]}delete a[t]}},releaseStatesOfGeometry:function(t){if(void 0===a[t.id])return;const e=a[t.id];for(const t in e){const i=e[t];for(const t in i)u(i[t].object),delete i[t];delete e[t]}delete a[t.id]},releaseStatesOfProgram:function(t){for(const e in a){const i=a[e];if(void 0===i[t.id])continue;const n=i[t.id];for(const t in n)u(n[t].object),delete n[t];delete i[t.id]}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:g}}function Is(t,e,i,n){const r=n.isWebGL2;let s;this.setMode=function(t){s=t},this.render=function(e,n){t.drawArrays(s,e,n),i.update(n,s,1)},this.renderInstances=function(n,o,a){if(0===a)return;let h,l;if(r)h=t,l="drawArraysInstanced";else if(h=e.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===h)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[l](s,n,o,a),i.update(o,s,a)}}function Fs(t,e,i){let n;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let o=void 0!==i.precision?i.precision:"highp";const a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const h=!0===i.logarithmicDepthBuffer,l=t.getParameter(34930),c=t.getParameter(35660),u=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=c>0,y=s||!!e.get("OES_texture_float");return{isWebGL2:s,getMaxAnisotropy:function(){if(void 0!==n)return n;const i=e.get("EXT_texture_filter_anisotropic");return n=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:h,maxTextures:l,maxVertexTextures:c,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?t.getParameter(36183):0}}function Bs(t){const e=this;let i=null,n=0,r=!1,s=!1;const o=new tr,a=new zi,h={value:null,needsUpdate:!1};function l(){h.value!==i&&(h.value=i,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(t,i,n,r){const s=null!==t?t.length:0;let l=null;if(0!==s){if(l=h.value,!0!==r||null===l){const e=n+4*s,r=i.matrixWorldInverse;a.getNormalMatrix(r),(null===l||l.length<e)&&(l=new Float32Array(e));for(let e=0,i=n;e!==s;++e,i+=4)o.copy(t[e]).applyMatrix4(r,a),o.normal.toArray(l,i),l[i+3]=o.constant}h.value=l,h.needsUpdate=!0}return e.numPlanes=s,e.numIntersection=0,l}this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,s){const o=0!==t.length||e||0!==n||r;return r=e,i=c(t,s,0),n=t.length,o},this.beginShadows=function(){s=!0,c(null)},this.endShadows=function(){s=!1,l()},this.setState=function(e,o,a){const u=e.clippingPlanes,d=e.clipIntersection,p=e.clipShadows,f=t.get(e);if(!r||null===u||0===u.length||s&&!p)s?c(null):l();else{const t=s?0:n,e=4*t;let r=f.clippingState||null;h.value=r,r=c(u,o,e,a);for(let t=0;t!==e;++t)r[t]=i[t];f.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function ks(t){let e=new WeakMap;function i(t,e){return e===at?t.mapping=st:e===ht&&(t.mapping=ot),t}function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping;if(s===at||s===ht){if(e.has(r)){return i(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const o=t.getRenderList(),a=t.getRenderTarget(),h=new ws(s.height/2);return h.fromEquirectangularTexture(t,r),e.set(r,h),t.setRenderTarget(a),t.setRenderList(o),r.addEventListener("dispose",n),i(h.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}function Ns(t){const e={};function i(i){if(void 0!==e[i])return e[i];let n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=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":n=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":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return e[i]=n,n}return{has:function(t){return null!==i(t)},init:function(t){t.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float")},get:function(t){const e=i(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Us(t,e,i,n){const r={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);a.removeEventListener("dispose",o),delete r[a.id];const h=s.get(a);h&&(e.remove(h),s.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(t){const i=[],n=t.index,r=t.attributes.position;let o=0;if(null!==n){const t=n.array;o=n.version;for(let e=0,n=t.length;e<n;e+=3){const n=t[e+0],r=t[e+1],s=t[e+2];i.push(n,r,r,s,s,n)}}else{const t=r.array;o=r.version;for(let e=0,n=t.length/3-1;e<n;e+=3){const t=e+0,n=e+1,r=e+2;i.push(t,n,n,r,r,t)}}const a=new(Br(i)>65535?Or:Rr)(i,1);a.version=o;const h=s.get(t);h&&e.remove(h),s.set(t,a)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",o),r[e.id]=!0,i.memory.geometries++),e},update:function(t){const i=t.attributes;for(const t in i)e.update(i[t],34962);const n=t.morphAttributes;for(const t in n){const i=n[t];for(let t=0,n=i.length;t<n;t++)e.update(i[t],34962)}},getWireframeAttribute:function(t){const e=s.get(t);if(e){const i=t.index;null!==i&&e.version<i.version&&a(t)}else a(t);return s.get(t)}}}function zs(t,e,i,n){const r=n.isWebGL2;let s,o,a;this.setMode=function(t){s=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,n){t.drawElements(s,n,o,e*a),i.update(n,s,1)},this.renderInstances=function(n,h,l){if(0===l)return;let c,u;if(r)c=t,u="drawElementsInstanced";else if(c=e.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===c)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](s,h,o,n*a,l),i.update(h,s,l)}}function Gs(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,i,n){switch(e.calls++,i){case 4:e.triangles+=n*(t/3);break;case 1:e.lines+=n*(t/2);break;case 3:e.lines+=n*(t-1);break;case 2:e.lines+=n*t;break;case 0:e.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",i)}}}}function Vs(t,e){return t[0]-e[0]}function Hs(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Ws(t){const e={},i=new Float32Array(8),n=[];for(let t=0;t<8;t++)n[t]=[t,0];return{update:function(r,s,o,a){const h=r.morphTargetInfluences,l=void 0===h?0:h.length;let c=e[s.id];if(void 0===c){c=[];for(let t=0;t<l;t++)c[t]=[t,0];e[s.id]=c}for(let t=0;t<l;t++){const e=c[t];e[0]=t,e[1]=h[t]}c.sort(Hs);for(let t=0;t<8;t++)t<l&&c[t][1]?(n[t][0]=c[t][0],n[t][1]=c[t][1]):(n[t][0]=Number.MAX_SAFE_INTEGER,n[t][1]=0);n.sort(Vs);const u=o.morphTargets&&s.morphAttributes.position,d=o.morphNormals&&s.morphAttributes.normal;let p=0;for(let t=0;t<8;t++){const e=n[t],r=e[0],o=e[1];r!==Number.MAX_SAFE_INTEGER&&o?(u&&s.getAttribute("morphTarget"+t)!==u[r]&&s.setAttribute("morphTarget"+t,u[r]),d&&s.getAttribute("morphNormal"+t)!==d[r]&&s.setAttribute("morphNormal"+t,d[r]),i[t]=o,p+=o):(u&&!0===s.hasAttribute("morphTarget"+t)&&s.deleteAttribute("morphTarget"+t),d&&!0===s.hasAttribute("morphNormal"+t)&&s.deleteAttribute("morphNormal"+t),i[t]=0)}const f=s.morphTargetsRelative?1:1-p;a.getUniforms().setValue(t,"morphTargetBaseInfluence",f),a.getUniforms().setValue(t,"morphTargetInfluences",i)}}}function Xs(t,e,i,n){let r=new WeakMap;function s(t){const e=t.target;e.removeEventListener("dispose",s),i.remove(e.instanceMatrix),null!==e.instanceColor&&i.remove(e.instanceColor)}return{update:function(t){const o=n.render.frame,a=t.geometry,h=e.get(t,a);return r.get(h)!==o&&(e.update(h),r.set(h,o)),t.isInstancedMesh&&(!1===t.hasEventListener("dispose",s)&&t.addEventListener("dispose",s),i.update(t.instanceMatrix,34962),null!==t.instanceColor&&i.update(t.instanceColor,34962)),h},dispose:function(){r=new WeakMap}}}function js(t=null,e=1,i=1,n=1){Wi.call(this,null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=ft,this.minFilter=ft,this.wrapR=dt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function Ys(t=null,e=1,i=1,n=1){Wi.call(this,null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=ft,this.minFilter=ft,this.wrapR=dt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Ls.physical={uniforms:fs([Ls.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ui(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new yr(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:Ps.meshphysical_vert,fragmentShader:Ps.meshphysical_frag},js.prototype=Object.create(Wi.prototype),js.prototype.constructor=js,js.prototype.isDataTexture2DArray=!0,Ys.prototype=Object.create(Wi.prototype),Ys.prototype.constructor=Ys,Ys.prototype.isDataTexture3D=!0;const qs=new Wi,Zs=new js,Ks=new Ys,Js=new bs,Qs=[],$s=[],to=new Float32Array(16),eo=new Float32Array(9),io=new Float32Array(4);function no(t,e,i){const n=t[0];if(n<=0||n>0)return t;const r=e*i;let s=Qs[r];if(void 0===s&&(s=new Float32Array(r),Qs[r]=s),0!==e){n.toArray(s,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(s,r)}return s}function ro(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}function so(t,e){for(let i=0,n=e.length;i<n;i++)t[i]=e[i]}function oo(t,e){let i=$s[e];void 0===i&&(i=new Int32Array(e),$s[e]=i);for(let n=0;n!==e;++n)i[n]=t.allocateTextureUnit();return i}function ao(t,e){const i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function ho(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(ro(i,e))return;t.uniform2fv(this.addr,e),so(i,e)}}function lo(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(void 0!==e.r)i[0]===e.r&&i[1]===e.g&&i[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(ro(i,e))return;t.uniform3fv(this.addr,e),so(i,e)}}function co(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(ro(i,e))return;t.uniform4fv(this.addr,e),so(i,e)}}function uo(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(ro(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),so(i,e)}else{if(ro(i,n))return;io.set(n),t.uniformMatrix2fv(this.addr,!1,io),so(i,n)}}function po(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(ro(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),so(i,e)}else{if(ro(i,n))return;eo.set(n),t.uniformMatrix3fv(this.addr,!1,eo),so(i,n)}}function fo(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(ro(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),so(i,e)}else{if(ro(i,n))return;to.set(n),t.uniformMatrix4fv(this.addr,!1,to),so(i,n)}}function mo(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.safeSetTexture2D(e||qs,r)}function go(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(e||Zs,r)}function vo(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(e||Ks,r)}function yo(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.safeSetTextureCube(e||Js,r)}function xo(t,e){const i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function bo(t,e){const i=this.cache;ro(i,e)||(t.uniform2iv(this.addr,e),so(i,e))}function wo(t,e){const i=this.cache;ro(i,e)||(t.uniform3iv(this.addr,e),so(i,e))}function To(t,e){const i=this.cache;ro(i,e)||(t.uniform4iv(this.addr,e),so(i,e))}function _o(t,e){const i=this.cache;i[0]!==e&&(t.uniform1ui(this.addr,e),i[0]=e)}function Eo(t,e){t.uniform1fv(this.addr,e)}function So(t,e){t.uniform1iv(this.addr,e)}function Mo(t,e){t.uniform2iv(this.addr,e)}function Ao(t,e){t.uniform3iv(this.addr,e)}function Co(t,e){t.uniform4iv(this.addr,e)}function Po(t,e){const i=no(e,this.size,2);t.uniform2fv(this.addr,i)}function Ro(t,e){const i=no(e,this.size,3);t.uniform3fv(this.addr,i)}function Lo(t,e){const i=no(e,this.size,4);t.uniform4fv(this.addr,i)}function Oo(t,e){const i=no(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,i)}function Do(t,e){const i=no(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,i)}function Io(t,e){const i=no(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,i)}function Fo(t,e,i){const n=e.length,r=oo(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.safeSetTexture2D(e[t]||qs,r[t])}function Bo(t,e,i){const n=e.length,r=oo(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.safeSetTextureCube(e[t]||Js,r[t])}function ko(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=function(t){switch(t){case 5126:return ao;case 35664:return ho;case 35665:return lo;case 35666:return co;case 35674:return uo;case 35675:return po;case 35676:return fo;case 5124:case 35670:return xo;case 35667:case 35671:return bo;case 35668:case 35672:return wo;case 35669:case 35673:return To;case 5125:return _o;case 35678:case 36198:case 36298:case 36306:case 35682:return mo;case 35679:case 36299:case 36307:return vo;case 35680:case 36300:case 36308:case 36293:return yo;case 36289:case 36303:case 36311:case 36292:return go}}(e.type)}function No(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Eo;case 35664:return Po;case 35665:return Ro;case 35666:return Lo;case 35674:return Oo;case 35675:return Do;case 35676:return Io;case 5124:case 35670:return So;case 35667:case 35671:return Mo;case 35668:case 35672:return Ao;case 35669:case 35673:return Co;case 35678:case 36198:case 36298:case 36306:case 35682:return Fo;case 35680:case 36300:case 36308:case 36293:return Bo}}(e.type)}function Uo(t){this.id=t,this.seq=[],this.map={}}No.prototype.updateCache=function(t){const e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),so(e,t)},Uo.prototype.setValue=function(t,e,i){const n=this.seq;for(let r=0,s=n.length;r!==s;++r){const s=n[r];s.setValue(t,e[s.id],i)}};const zo=/(\w+)(\])?(\[|\.)?/g;function Go(t,e){t.seq.push(e),t.map[e.id]=e}function Vo(t,e,i){const n=t.name,r=n.length;for(zo.lastIndex=0;;){const s=zo.exec(n),o=zo.lastIndex;let a=s[1];const h="]"===s[2],l=s[3];if(h&&(a|=0),void 0===l||"["===l&&o+2===r){Go(i,void 0===l?new ko(a,t,e):new No(a,t,e));break}{let t=i.map[a];void 0===t&&(t=new Uo(a),Go(i,t)),i=t}}}function Ho(t,e){this.seq=[],this.map={};const i=t.getProgramParameter(e,35718);for(let n=0;n<i;++n){const i=t.getActiveUniform(e,n);Vo(i,t.getUniformLocation(e,i.name),this)}}function Wo(t,e,i){const n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}Ho.prototype.setValue=function(t,e,i,n){const r=this.map[e];void 0!==r&&r.setValue(t,i,n)},Ho.prototype.setOptional=function(t,e,i){const n=e[i];void 0!==n&&this.setValue(t,i,n)},Ho.upload=function(t,e,i,n){for(let r=0,s=e.length;r!==s;++r){const s=e[r],o=i[s.id];!1!==o.needsUpdate&&s.setValue(t,o.value,n)}},Ho.seqWithValue=function(t,e){const i=[];for(let n=0,r=t.length;n!==r;++n){const r=t[n];r.id in e&&i.push(r)}return i};let Xo=0;function jo(t){switch(t){case Ke:return["Linear","( value )"];case Je:return["sRGB","( value )"];case $e:return["RGBE","( value )"];case ei:return["RGBM","( value, 7.0 )"];case ii:return["RGBM","( value, 16.0 )"];case ni:return["RGBD","( value, 256.0 )"];case Qe:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case ti:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function Yo(t,e,i){const n=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();if(n&&""===r)return"";return"THREE.WebGLShader: gl.getShaderInfoLog() "+i+"\n"+r+function(t){const e=t.split("\n");for(let t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e.join("\n")}(t.getShaderSource(e))}function qo(t,e){const i=jo(e);return"vec4 "+t+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function Zo(t,e){const i=jo(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function Ko(t,e){let i;switch(e){case $:i="Linear";break;case tt:i="Reinhard";break;case et:i="OptimizedCineon";break;case it:i="ACESFilmic";break;case nt:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),i="Linear"}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function Jo(t){return""!==t}function Qo(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function $o(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const ta=/^[ \t]*#include +<([\w\d./]+)>/gm;function ea(t){return t.replace(ta,ia)}function ia(t,e){const i=Ps[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return ea(i)}const na=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ra=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function sa(t){return t.replace(ra,aa).replace(na,oa)}function oa(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),aa(t,e,i,n)}function aa(t,e,i,n){let r="";for(let t=parseInt(e);t<parseInt(i);t++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return r}function ha(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function la(t,e,i,n){const r=t.getContext(),s=i.defines;let o=i.vertexShader,a=i.fragmentShader;const h=function(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===u?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===d?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===p&&(e="SHADOWMAP_TYPE_VSM"),e}(i),l=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case st:case ot:e="ENVMAP_TYPE_CUBE";break;case lt:case ct:e="ENVMAP_TYPE_CUBE_UV"}return e}(i),c=function(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case ot:case ct:e="ENVMAP_MODE_REFRACTION"}return e}(i),f=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case Z:e="ENVMAP_BLENDING_MULTIPLY";break;case K:e="ENVMAP_BLENDING_MIX";break;case J:e="ENVMAP_BLENDING_ADD"}return e}(i),m=t.gammaFactor>0?t.gammaFactor:1,g=i.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Jo).join("\n")}(i),v=function(t){const e=[];for(const i in t){const n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}(s),y=r.createProgram();let x,b,w=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(x=[v].filter(Jo).join("\n"),x.length>0&&(x+="\n"),b=[g,v].filter(Jo).join("\n"),b.length>0&&(b+="\n")):(x=[ha(i),"#define SHADER_NAME "+i.shaderName,v,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",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.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_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.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",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":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+h:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#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(Jo).join("\n"),b=[g,ha(i),"#define SHADER_NAME "+i.shaderName,v,i.alphaTest?"#define ALPHATEST "+i.alphaTest+(i.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+m,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+l:"",i.envMap?"#define "+c:"",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.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.sheen?"#define USE_SHEEN":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+h:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==Q?"#define TONE_MAPPING":"",i.toneMapping!==Q?Ps.tonemapping_pars_fragment:"",i.toneMapping!==Q?Ko("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",Ps.encodings_pars_fragment,i.map?qo("mapTexelToLinear",i.mapEncoding):"",i.matcap?qo("matcapTexelToLinear",i.matcapEncoding):"",i.envMap?qo("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMap?qo("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.lightMap?qo("lightMapTexelToLinear",i.lightMapEncoding):"",Zo("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Jo).join("\n")),o=ea(o),o=Qo(o,i),o=$o(o,i),a=ea(a),a=Qo(a,i),a=$o(a,i),o=sa(o),a=sa(a),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(w="#version 300 es\n",x=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+x,b=["#define varying in",i.glslVersion===Ii?"":"out highp vec4 pc_fragColor;",i.glslVersion===Ii?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+b);const T=w+b+a,_=Wo(r,35633,w+x+o),E=Wo(r,35632,T);if(r.attachShader(y,_),r.attachShader(y,E),void 0!==i.index0AttributeName?r.bindAttribLocation(y,0,i.index0AttributeName):!0===i.morphTargets&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(y).trim(),e=r.getShaderInfoLog(_).trim(),i=r.getShaderInfoLog(E).trim();let n=!0,s=!0;if(!1===r.getProgramParameter(y,35714)){n=!1;const e=Yo(r,_,"vertex"),i=Yo(r,E,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(y,35715),"gl.getProgramInfoLog",t,e,i)}else""!==t?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",t):""!==e&&""!==i||(s=!1);s&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:x},fragmentShader:{log:i,prefix:b}})}let S,M;return r.deleteShader(_),r.deleteShader(E),this.getUniforms=function(){return void 0===S&&(S=new Ho(r,y)),S},this.getAttributes=function(){return void 0===M&&(M=function(t,e){const i={},n=t.getProgramParameter(e,35721);for(let r=0;r<n;r++){const n=t.getActiveAttrib(e,r).name;i[n]=t.getAttribLocation(e,n)}return i}(r,y)),M},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.name=i.shaderName,this.id=Xo++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=_,this.fragmentShader=E,this}function ca(t,e,i,n,r,s){const o=[],a=n.isWebGL2,h=n.logarithmicDepthBuffer,l=n.floatVertexTextures,c=n.maxVertexUniforms,u=n.vertexTextures;let d=n.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},f=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","instancingColor","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmissionMap"];function v(t){let e;return t&&t.isTexture?e=t.encoding:t&&t.isWebGLRenderTarget?(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=Ke,e}return{getParameters:function(r,o,f,y,x){const b=y.fog,w=r.isMeshStandardMaterial?y.environment:null,T=e.get(r.envMap||w),_=p[r.type],E=x.isSkinnedMesh?function(t){const e=t.skeleton.bones;if(l)return 1024;{const t=c,i=Math.floor((t-20)/4),n=Math.min(i,e.length);return n<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+n+"."),0):n}}(x):0;let S,M;if(null!==r.precision&&(d=n.getMaxPrecision(r.precision),d!==r.precision&&console.warn("THREE.WebGLProgram.getParameters:",r.precision,"not supported, using",d,"instead.")),_){const t=Ls[_];S=t.vertexShader,M=t.fragmentShader}else S=r.vertexShader,M=r.fragmentShader;const A=t.getRenderTarget();return{isWebGL2:a,shaderID:_,shaderName:r.type,vertexShader:S,fragmentShader:M,defines:r.defines,isRawShaderMaterial:!0===r.isRawShaderMaterial,glslVersion:r.glslVersion,precision:d,instancing:!0===x.isInstancedMesh,instancingColor:!0===x.isInstancedMesh&&null!==x.instanceColor,supportsVertexTextures:u,outputEncoding:null!==A?v(A.texture):t.outputEncoding,map:!!r.map,mapEncoding:v(r.map),matcap:!!r.matcap,matcapEncoding:v(r.matcap),envMap:!!T,envMapMode:T&&T.mapping,envMapEncoding:v(T),envMapCubeUV:!!T&&(T.mapping===lt||T.mapping===ct),lightMap:!!r.lightMap,lightMapEncoding:v(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:v(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:r.normalMapType===ai,tangentSpaceNormalMap:r.normalMapType===oi,clearcoatMap:!!r.clearcoatMap,clearcoatRoughnessMap:!!r.clearcoatRoughnessMap,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,transmissionMap:!!r.transmissionMap,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatMap||r.clearcoatRoughnessMap||r.clearcoatNormalMap||r.displacementMap||r.transmissionMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||r.transmissionMap||!r.displacementMap),fog:!!b,useFog:r.fog,fogExp2:b&&b.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:h,skinning:r.skinning&&E>0,maxBones:E,useVertexTexture:l,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&f.length>0,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:Q,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===g,flipSided:r.side===m,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:a||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||i.has("EXT_shader_texture_lod"),customProgramCacheKey:r.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);if(!1===e.isRawShaderMaterial){for(let t=0;t<f.length;t++)i.push(e[f[t]]);i.push(t.outputEncoding),i.push(t.gammaFactor)}return i.push(e.customProgramCacheKey),i.join()},getUniforms:function(t){const e=p[t.type];let i;if(e){const t=Ls[e];i=ms.clone(t.uniforms)}else i=t.uniforms;return i},acquireProgram:function(e,i){let n;for(let t=0,e=o.length;t<e;t++){const e=o[t];if(e.cacheKey===i){n=e,++n.usedTimes;break}}return void 0===n&&(n=new la(t,i,e,r),o.push(n)),n},releaseProgram:function(t){if(0==--t.usedTimes){const e=o.indexOf(t);o[e]=o[o.length-1],o.pop(),t.destroy()}},programs:o}}function ua(){let t=new WeakMap;return{get:function(e){let i=t.get(e);return void 0===i&&(i={},t.set(e,i)),i},remove:function(e){t.delete(e)},update:function(e,i,n){t.get(e)[i]=n},dispose:function(){t=new WeakMap}}}function da(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function pa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function fa(t){const e=[];let i=0;const n=[],r=[],s={id:-1};function o(n,r,o,a,h,l){let c=e[i];const u=t.get(o);return void 0===c?(c={id:n.id,object:n,geometry:r,material:o,program:u.program||s,groupOrder:a,renderOrder:n.renderOrder,z:h,group:l},e[i]=c):(c.id=n.id,c.object=n,c.geometry=r,c.material=o,c.program=u.program||s,c.groupOrder=a,c.renderOrder=n.renderOrder,c.z=h,c.group=l),i++,c}return{opaque:n,transparent:r,init:function(){i=0,n.length=0,r.length=0},push:function(t,e,i,s,a,h){const l=o(t,e,i,s,a,h);(!0===i.transparent?r:n).push(l)},unshift:function(t,e,i,s,a,h){const l=o(t,e,i,s,a,h);(!0===i.transparent?r:n).unshift(l)},finish:function(){for(let t=i,n=e.length;t<n;t++){const i=e[t];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(t,e){n.length>1&&n.sort(t||da),r.length>1&&r.sort(e||pa)}}}function ma(t){let e=new WeakMap;return{get:function(i,n){const r=e.get(i);let s;return void 0===r?(s=new fa(t),e.set(i,new WeakMap),e.get(i).set(n,s)):(s=r.get(n),void 0===s&&(s=new fa(t),r.set(n,s))),s},dispose:function(){e=new WeakMap}}}function ga(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new Ki,color:new yr};break;case"SpotLight":i={position:new Ki,direction:new Ki,color:new yr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Ki,color:new yr,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Ki,skyColor:new yr,groundColor:new yr};break;case"RectAreaLight":i={color:new yr,position:new Ki,halfWidth:new Ki,halfHeight:new Ki}}return t[e.id]=i,i}}}let va=0;function ya(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function xa(t,e){const i=new ga,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ui};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ui,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new Ki);const s=new Ki,o=new Sn,a=new Sn;return{setup:function(s){let o=0,a=0,h=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let l=0,c=0,u=0,d=0,p=0,f=0,m=0,g=0;s.sort(ya);for(let t=0,e=s.length;t<e;t++){const e=s[t],v=e.color,y=e.intensity,x=e.distance,b=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)o+=v.r*y,a+=v.g*y,h+=v.b*y;else if(e.isLightProbe)for(let t=0;t<9;t++)r.probe[t].addScaledVector(e.sh.coefficients[t],y);else if(e.isDirectionalLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity),e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,r.directionalShadow[l]=i,r.directionalShadowMap[l]=b,r.directionalShadowMatrix[l]=e.shadow.matrix,f++}r.directional[l]=t,l++}else if(e.isSpotLight){const t=i.get(e);if(t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(v).multiplyScalar(y),t.distance=x,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,r.spotShadow[u]=i,r.spotShadowMap[u]=b,r.spotShadowMatrix[u]=e.shadow.matrix,g++}r.spot[u]=t,u++}else if(e.isRectAreaLight){const t=i.get(e);t.color.copy(v).multiplyScalar(y),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),r.rectArea[d]=t,d++}else if(e.isPointLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,i.shadowCameraNear=t.camera.near,i.shadowCameraFar=t.camera.far,r.pointShadow[c]=i,r.pointShadowMap[c]=b,r.pointShadowMatrix[c]=e.shadow.matrix,m++}r.point[c]=t,c++}else if(e.isHemisphereLight){const t=i.get(e);t.skyColor.copy(e.color).multiplyScalar(y),t.groundColor.copy(e.groundColor).multiplyScalar(y),r.hemi[p]=t,p++}}d>0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=Rs.LTC_FLOAT_1,r.rectAreaLTC2=Rs.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Rs.LTC_HALF_1,r.rectAreaLTC2=Rs.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=a,r.ambient[2]=h;const v=r.hash;v.directionalLength===l&&v.pointLength===c&&v.spotLength===u&&v.rectAreaLength===d&&v.hemiLength===p&&v.numDirectionalShadows===f&&v.numPointShadows===m&&v.numSpotShadows===g||(r.directional.length=l,r.spot.length=u,r.rectArea.length=d,r.point.length=c,r.hemi.length=p,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=g,r.spotShadowMap.length=g,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=m,r.spotShadowMatrix.length=g,v.directionalLength=l,v.pointLength=c,v.spotLength=u,v.rectAreaLength=d,v.hemiLength=p,v.numDirectionalShadows=f,v.numPointShadows=m,v.numSpotShadows=g,r.version=va++)},setupView:function(t,e){let i=0,n=0,h=0,l=0,c=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e<d;e++){const d=t[e];if(d.isDirectionalLight){const t=r.directional[i];t.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(s),t.direction.transformDirection(u),i++}else if(d.isSpotLight){const t=r.spot[h];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(u),t.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(s),t.direction.transformDirection(u),h++}else if(d.isRectAreaLight){const t=r.rectArea[l];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(u),a.identity(),o.copy(d.matrixWorld),o.premultiply(u),a.extractRotation(o),t.halfWidth.set(.5*d.width,0,0),t.halfHeight.set(0,.5*d.height,0),t.halfWidth.applyMatrix4(a),t.halfHeight.applyMatrix4(a),l++}else if(d.isPointLight){const t=r.point[n];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(u),n++}else if(d.isHemisphereLight){const t=r.hemi[c];t.direction.setFromMatrixPosition(d.matrixWorld),t.direction.transformDirection(u),t.direction.normalize(),c++}}},state:r}}function ba(t,e){const i=new xa(t,e),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:function(){i.setup(n)},setupLightsView:function(t){i.setupView(n,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){r.push(t)}}}function wa(t,e){let i=new WeakMap;return{get:function(n,r=0){let s;return!1===i.has(n)?(s=new ba(t,e),i.set(n,[]),i.get(n).push(s)):r>=i.get(n).length?(s=new ba(t,e),i.get(n).push(s)):s=i.get(n)[r],s},dispose:function(){i=new WeakMap}}}function Ta(t){wr.call(this),this.type="MeshDepthMaterial",this.depthPacking=ri,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.setValues(t)}function _a(t){wr.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Ki,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Ta.prototype=Object.create(wr.prototype),Ta.prototype.constructor=Ta,Ta.prototype.isMeshDepthMaterial=!0,Ta.prototype.copy=function(t){return wr.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},_a.prototype=Object.create(wr.prototype),_a.prototype.constructor=_a,_a.prototype.isMeshDistanceMaterial=!0,_a.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,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};function Ea(t,e,i){let n=new Ss;const r=new Ui,s=new Ui,o=new ji,a=[],h=[],l={},c={0:m,1:f,2:g},d=new gs({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ui},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),v=d.clone();v.defines.HORIZONTAL_PASS=1;const y=new jr;y.setAttribute("position",new Sr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new cs(y,d),w=this;function T(i,n){const r=e.update(b);d.uniforms.shadow_pass.value=i.map.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,d,b,null),v.uniforms.shadow_pass.value=i.mapPass.texture,v.uniforms.resolution.value=i.mapSize,v.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,v,b,null)}function _(t,e,i){const n=t<<0|e<<1|i<<2;let r=a[n];return void 0===r&&(r=new Ta({depthPacking:si,morphTargets:t,skinning:e}),a[n]=r),r}function E(t,e,i){const n=t<<0|e<<1|i<<2;let r=h[n];return void 0===r&&(r=new _a({morphTargets:t,skinning:e}),h[n]=r),r}function S(e,i,n,r,s,o,a){let h=null,u=_,d=e.customDepthMaterial;if(!0===r.isPointLight&&(u=E,d=e.customDistanceMaterial),void 0===d){let t=!1;!0===n.morphTargets&&(t=i.morphAttributes&&i.morphAttributes.position&&i.morphAttributes.position.length>0);let r=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?r=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));h=u(t,r,!0===e.isInstancedMesh)}else h=d;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){const t=h.uuid,e=n.uuid;let i=l[t];void 0===i&&(i={},l[t]=i);let r=i[e];void 0===r&&(r=h.clone(),i[e]=r),h=r}return h.visible=n.visible,h.wireframe=n.wireframe,h.side=a===p?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:c[n.side],h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,!0===r.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(r.matrixWorld),h.nearDistance=s,h.farDistance=o),h}function M(i,r,s,o,a){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&a===p)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let h=0,l=e.length;h<l;h++){const l=e[h],c=r[l.materialIndex];if(c&&c.visible){const e=S(i,n,c,o,s.near,s.far,a);t.renderBufferDirect(s,null,n,e,i,l)}}}else if(r.visible){const e=S(i,n,r,o,s.near,s.far,a);t.renderBufferDirect(s,null,n,e,i,null)}}const h=i.children;for(let t=0,e=h.length;t<e;t++)M(h[t],r,s,o,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=u,this.render=function(e,a,h){if(!1===w.enabled)return;if(!1===w.autoUpdate&&!1===w.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),c=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),d=t.state;d.setBlending(x),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let l=0,c=e.length;l<c;l++){const c=e[l],u=c.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;r.copy(u.mapSize);const f=u.getFrameExtents();if(r.multiply(f),s.copy(u.mapSize),(r.x>i||r.y>i)&&(r.x>i&&(s.x=Math.floor(i/f.x),r.x=s.x*f.x,u.mapSize.x=s.x),r.y>i&&(s.y=Math.floor(i/f.y),r.y=s.y*f.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&this.type===p){const t={minFilter:xt,magFilter:xt,format:Nt};u.map=new Yi(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.mapPass=new Yi(r.x,r.y,t),u.camera.updateProjectionMatrix()}if(null===u.map){const t={minFilter:ft,magFilter:ft,format:Nt};u.map=new Yi(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const m=u.getViewportCount();for(let t=0;t<m;t++){const e=u.getViewport(t);o.set(s.x*e.x,s.y*e.y,s.x*e.z,s.y*e.w),d.viewport(o),u.updateMatrices(c,t),n=u.getFrustum(),M(a,h,u.camera,c,this.type)}u.isPointLightShadow||this.type!==p||T(u,h),u.needsUpdate=!1}w.needsUpdate=!1,t.setRenderTarget(l,c,u)}}function Sa(t,e,i){const n=i.isWebGL2;const r=new function(){let e=!1;const i=new ji;let n=null;const r=new ji(0,0,0,0);return{setMask:function(i){n===i||e||(t.colorMask(i,i,i,i),n=i)},setLocked:function(t){e=t},setClear:function(e,n,s,o,a){!0===a&&(e*=o,n*=o,s*=o),i.set(e,n,s,o),!1===r.equals(i)&&(t.clearColor(e,n,s,o),r.copy(i))},reset:function(){e=!1,n=null,r.set(-1,0,0,0)}}},s=new function(){let e=!1,i=null,n=null,r=null;return{setTest:function(t){t?ft(2929):mt(2929)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case G:t.depthFunc(512);break;case V:t.depthFunc(519);break;case H:t.depthFunc(513);break;case W:t.depthFunc(515);break;case X:t.depthFunc(514);break;case j:t.depthFunc(518);break;case Y:t.depthFunc(516);break;case q:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);n=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,i=null,n=null,r=null}}},l=new function(){let e=!1,i=null,n=null,r=null,s=null,o=null,a=null,h=null,l=null;return{setTest:function(t){e||(t?ft(2960):mt(2960))},setMask:function(n){i===n||e||(t.stencilMask(n),i=n)},setFunc:function(e,i,o){n===e&&r===i&&s===o||(t.stencilFunc(e,i,o),n=e,r=i,s=o)},setOp:function(e,i,n){o===e&&a===i&&h===n||(t.stencilOp(e,i,n),o=e,a=i,h=n)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,i=null,n=null,r=null,s=null,o=null,a=null,h=null,l=null}}};let c={},u=null,d=null,p=null,f=null,v=null,y=null,Z=null,K=null,J=null,Q=!1,$=null,tt=null,et=null,it=null,nt=null;const rt=t.getParameter(35661);let st=!1,ot=0;const at=t.getParameter(7938);-1!==at.indexOf("WebGL")?(ot=parseFloat(/^WebGL (\d)/.exec(at)[1]),st=ot>=1):-1!==at.indexOf("OpenGL ES")&&(ot=parseFloat(/^OpenGL ES (\d)/.exec(at)[1]),st=ot>=2);let ht=null,lt={};const ct=new ji,ut=new ji;function dt(e,i,n){const r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;e<n;e++)t.texImage2D(i+e,0,6408,1,1,0,6408,5121,r);return s}const pt={};function ft(e){!0!==c[e]&&(t.enable(e),c[e]=!0)}function mt(e){!1!==c[e]&&(t.disable(e),c[e]=!1)}pt[3553]=dt(3553,3553,1),pt[34067]=dt(34067,34069,6),r.setClear(0,0,0,1),s.setClear(1),l.setClear(0),ft(2929),s.setFunc(W),xt(!1),bt(a),ft(2884),yt(x);const gt={[S]:32774,[M]:32778,[A]:32779};if(n)gt[C]=32775,gt[P]=32776;else{const t=e.get("EXT_blend_minmax");null!==t&&(gt[C]=t.MIN_EXT,gt[P]=t.MAX_EXT)}const vt={[R]:0,[L]:1,[O]:768,[I]:770,[z]:776,[N]:774,[B]:772,[D]:769,[F]:771,[U]:775,[k]:773};function yt(e,i,n,r,s,o,a,h){if(e!==x){if(d||(ft(3042),d=!0),e===E)s=s||i,o=o||n,a=a||r,i===f&&s===Z||(t.blendEquationSeparate(gt[i],gt[s]),f=i,Z=s),n===v&&r===y&&o===K&&a===J||(t.blendFuncSeparate(vt[n],vt[r],vt[o],vt[a]),v=n,y=r,K=o,J=a),p=e,Q=null;else if(e!==p||h!==Q){if(f===S&&Z===S||(t.blendEquation(32774),f=S,Z=S),h)switch(e){case b:t.blendFuncSeparate(1,771,1,771);break;case w:t.blendFunc(1,1);break;case T:t.blendFuncSeparate(0,0,769,771);break;case _:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case b:t.blendFuncSeparate(770,771,1,771);break;case w:t.blendFunc(770,1);break;case T:t.blendFunc(0,769);break;case _:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}v=null,y=null,K=null,J=null,p=e,Q=h}}else d&&(mt(3042),d=!1)}function xt(e){$!==e&&(e?t.frontFace(2304):t.frontFace(2305),$=e)}function bt(e){e!==o?(ft(2884),e!==tt&&(e===a?t.cullFace(1029):e===h?t.cullFace(1028):t.cullFace(1032))):mt(2884),tt=e}function wt(e,i,n){e?(ft(32823),it===i&&nt===n||(t.polygonOffset(i,n),it=i,nt=n)):mt(32823)}function Tt(e){void 0===e&&(e=33984+rt-1),ht!==e&&(t.activeTexture(e),ht=e)}return{buffers:{color:r,depth:s,stencil:l},enable:ft,disable:mt,useProgram:function(e){return u!==e&&(t.useProgram(e),u=e,!0)},setBlending:yt,setMaterial:function(t,e){t.side===g?mt(2884):ft(2884);let i=t.side===m;e&&(i=!i),xt(i),t.blending===b&&!1===t.transparent?yt(x):yt(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),s.setFunc(t.depthFunc),s.setTest(t.depthTest),s.setMask(t.depthWrite),r.setMask(t.colorWrite);const n=t.stencilWrite;l.setTest(n),n&&(l.setMask(t.stencilWriteMask),l.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),l.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),wt(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:xt,setCullFace:bt,setLineWidth:function(e){e!==et&&(st&&t.lineWidth(e),et=e)},setPolygonOffset:wt,setScissorTest:function(t){t?ft(3089):mt(3089)},activeTexture:Tt,bindTexture:function(e,i){null===ht&&Tt();let n=lt[ht];void 0===n&&(n={type:void 0,texture:void 0},lt[ht]=n),n.type===e&&n.texture===i||(t.bindTexture(e,i||pt[e]),n.type=e,n.texture=i)},unbindTexture:function(){const e=lt[ht];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===ct.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),ct.copy(e))},viewport:function(e){!1===ut.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),ut.copy(e))},reset:function(){c={},ht=null,lt={},u=null,d=null,p=null,f=null,v=null,y=null,Z=null,K=null,J=null,Q=!1,$=null,tt=null,et=null,it=null,nt=null,r.reset(),s.reset(),l.reset()}}}function Ma(t,e,i,n,r,s,o){const a=r.isWebGL2,h=r.maxTextures,l=r.maxCubemapSize,c=r.maxTextureSize,u=r.maxSamples,d=new WeakMap;let p,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function m(t,e){return f?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function g(t,e,i,n){let r=1;if((t.width>n||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?Ni.floorPowerOfTwo:Math.floor,s=n(r*t.width),o=n(r*t.height);void 0===p&&(p=m(s,o));const a=i?m(s,o):p;a.width=s,a.height=o;return a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function v(t){return Ni.isPowerOfTwo(t.width)&&Ni.isPowerOfTwo(t.height)}function y(t,e){return t.generateMipmaps&&e&&t.minFilter!==ft&&t.minFilter!==xt}function x(e,i,r,s){t.generateMipmap(e);n.get(i).__maxMipLevel=Math.log(Math.max(r,s))*Math.LOG2E}function b(i,n,r){if(!1===a)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let s=n;return 6403===n&&(5126===r&&(s=33326),5131===r&&(s=33325),5121===r&&(s=33321)),6407===n&&(5126===r&&(s=34837),5131===r&&(s=34843),5121===r&&(s=32849)),6408===n&&(5126===r&&(s=34836),5131===r&&(s=34842),5121===r&&(s=32856)),33325!==s&&33326!==s&&34842!==s&&34836!==s||e.get("EXT_color_buffer_float"),s}function w(t){return t===ft||t===mt||t===vt?9728:9729}function T(e){const i=e.target;i.removeEventListener("dispose",T),function(e){const i=n.get(e);if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture),n.remove(e)}(i),i.isVideoTexture&&d.delete(i),o.memory.textures--}function _(e){const i=e.target;i.removeEventListener("dispose",_),function(e){const i=n.get(e),r=n.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(i.__webglFramebuffer[e]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[e]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&t.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&t.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&t.deleteRenderbuffer(i.__webglDepthRenderbuffer);n.remove(e.texture),n.remove(e)}(i),o.memory.textures--}let E=0;function S(t,e){const r=n.get(t);if(t.isVideoTexture&&function(t){const e=o.render.frame;d.get(t)!==e&&(d.set(t,e),t.update())}(t),t.version>0&&r.__version!==t.version){const i=t.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void L(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function M(e,r){const o=n.get(e);e.version>0&&o.__version!==e.version?function(e,n,r){if(6!==n.image.length)return;R(e,n),i.activeTexture(33984+r),i.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);const o=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),h=n.image[0]&&n.image[0].isDataTexture,c=[];for(let t=0;t<6;t++)c[t]=o||h?h?n.image[t].image:n.image[t]:g(n.image[t],!1,!0,l);const u=c[0],d=v(u)||a,p=s.convert(n.format),f=s.convert(n.type),m=b(n.internalFormat,p,f);let w;if(P(34067,n,d),o){for(let t=0;t<6;t++){w=c[t].mipmaps;for(let e=0;e<w.length;e++){const r=w[e];n.format!==Nt&&n.format!==kt?null!==p?i.compressedTexImage2D(34069+t,e,m,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(34069+t,e,m,r.width,r.height,0,p,f,r.data)}}e.__maxMipLevel=w.length-1}else{w=n.mipmaps;for(let t=0;t<6;t++)if(h){i.texImage2D(34069+t,0,m,c[t].width,c[t].height,0,p,f,c[t].data);for(let e=0;e<w.length;e++){const n=w[e].image[t].image;i.texImage2D(34069+t,e+1,m,n.width,n.height,0,p,f,n.data)}}else{i.texImage2D(34069+t,0,m,p,f,c[t]);for(let e=0;e<w.length;e++){const n=w[e];i.texImage2D(34069+t,e+1,m,p,f,n.image[t])}}e.__maxMipLevel=w.length}y(n,d)&&x(34067,n,u.width,u.height);e.__version=n.version,n.onUpdate&&n.onUpdate(n)}(o,e,r):(i.activeTexture(33984+r),i.bindTexture(34067,o.__webglTexture))}const A={[ut]:10497,[dt]:33071,[pt]:33648},C={[ft]:9728,[mt]:9984,[vt]:9986,[xt]:9729,[bt]:9985,[Tt]:9987};function P(i,s,o){o?(t.texParameteri(i,10242,A[s.wrapS]),t.texParameteri(i,10243,A[s.wrapT]),32879!==i&&35866!==i||t.texParameteri(i,32882,A[s.wrapR]),t.texParameteri(i,10240,C[s.magFilter]),t.texParameteri(i,10241,C[s.minFilter])):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),32879!==i&&35866!==i||t.texParameteri(i,32882,33071),s.wrapS===dt&&s.wrapT===dt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(i,10240,w(s.magFilter)),t.texParameteri(i,10241,w(s.minFilter)),s.minFilter!==ft&&s.minFilter!==xt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));const h=e.get("EXT_texture_filter_anisotropic");if(h){if(s.type===Rt&&null===e.get("OES_texture_float_linear"))return;if(s.type===Lt&&null===(a||e.get("OES_texture_half_float_linear")))return;(s.anisotropy>1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function R(e,i){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",T),e.__webglTexture=t.createTexture(),o.memory.textures++)}function L(e,n,r){let o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),R(e,n),i.activeTexture(33984+r),i.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);const h=function(t){return!a&&(t.wrapS!==dt||t.wrapT!==dt||t.minFilter!==ft&&t.minFilter!==xt)}(n)&&!1===v(n.image),l=g(n.image,h,!1,c),u=v(l)||a,d=s.convert(n.format);let p,f=s.convert(n.type),m=b(n.internalFormat,d,f);P(o,n,u);const w=n.mipmaps;if(n.isDepthTexture)m=6402,a?m=n.type===Rt?36012:n.type===Pt?33190:n.type===Ft?35056:33189:n.type===Rt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===Vt&&6402===m&&n.type!==At&&n.type!==Pt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=At,f=s.convert(n.type)),n.format===Ht&&6402===m&&(m=34041,n.type!==Ft&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Ft,f=s.convert(n.type))),i.texImage2D(3553,0,m,l.width,l.height,0,d,f,null);else if(n.isDataTexture)if(w.length>0&&u){for(let t=0,e=w.length;t<e;t++)p=w[t],i.texImage2D(3553,t,m,p.width,p.height,0,d,f,p.data);n.generateMipmaps=!1,e.__maxMipLevel=w.length-1}else i.texImage2D(3553,0,m,l.width,l.height,0,d,f,l.data),e.__maxMipLevel=0;else if(n.isCompressedTexture){for(let t=0,e=w.length;t<e;t++)p=w[t],n.format!==Nt&&n.format!==kt?null!==d?i.compressedTexImage2D(3553,t,m,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(3553,t,m,p.width,p.height,0,d,f,p.data);e.__maxMipLevel=w.length-1}else if(n.isDataTexture2DArray)i.texImage3D(35866,0,m,l.width,l.height,l.depth,0,d,f,l.data),e.__maxMipLevel=0;else if(n.isDataTexture3D)i.texImage3D(32879,0,m,l.width,l.height,l.depth,0,d,f,l.data),e.__maxMipLevel=0;else if(w.length>0&&u){for(let t=0,e=w.length;t<e;t++)p=w[t],i.texImage2D(3553,t,m,d,f,p);n.generateMipmaps=!1,e.__maxMipLevel=w.length-1}else i.texImage2D(3553,0,m,d,f,l),e.__maxMipLevel=0;y(n,u)&&x(o,n,l.width,l.height),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function O(e,r,o,a){const h=s.convert(r.texture.format),l=s.convert(r.texture.type),c=b(r.texture.internalFormat,h,l);i.texImage2D(a,0,c,r.width,r.height,0,h,l,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,o,a,n.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function D(e,i,n){if(t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n){const e=i.depthTexture;e&&e.isDepthTexture&&(e.type===Rt?r=36012:e.type===Pt&&(r=33190));const n=F(i);t.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else t.renderbufferStorage(36161,r,i.width,i.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(i.depthBuffer&&i.stencilBuffer){if(n){const e=F(i);t.renderbufferStorageMultisample(36161,e,35056,i.width,i.height)}else t.renderbufferStorage(36161,34041,i.width,i.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=s.convert(i.texture.format),r=s.convert(i.texture.type),o=b(i.texture.internalFormat,e,r);if(n){const e=F(i);t.renderbufferStorageMultisample(36161,e,o,i.width,i.height)}else t.renderbufferStorage(36161,o,i.width,i.height)}t.bindRenderbuffer(36161,null)}function I(e){const i=n.get(e),r=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),S(i.depthTexture,0);const r=n.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===Vt)t.framebufferTexture2D(36160,36096,3553,r,0);else{if(i.depthTexture.format!==Ht)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,r,0)}}(i.__webglFramebuffer,e)}else if(r){i.__webglDepthbuffer=[];for(let n=0;n<6;n++)t.bindFramebuffer(36160,i.__webglFramebuffer[n]),i.__webglDepthbuffer[n]=t.createRenderbuffer(),D(i.__webglDepthbuffer[n],e,!1)}else t.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),D(i.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}function F(t){return a&&t.isWebGLMultisampleRenderTarget?Math.min(u,t.samples):0}let B=!1,k=!1;this.allocateTextureUnit=function(){const t=E;return t>=h&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+h),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=S,this.setTexture2DArray=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?L(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?L(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=M,this.setupRenderTarget=function(e){const r=n.get(e),h=n.get(e.texture);e.addEventListener("dispose",_),h.__webglTexture=t.createTexture(),o.memory.textures++;const l=!0===e.isWebGLCubeRenderTarget,c=!0===e.isWebGLMultisampleRenderTarget,u=v(e)||a;if(!a||e.texture.format!==kt||e.texture.type!==Rt&&e.texture.type!==Lt||(e.texture.format=Nt,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),l){r.__webglFramebuffer=[];for(let e=0;e<6;e++)r.__webglFramebuffer[e]=t.createFramebuffer()}else if(r.__webglFramebuffer=t.createFramebuffer(),c)if(a){r.__webglMultisampledFramebuffer=t.createFramebuffer(),r.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,r.__webglColorRenderbuffer);const i=s.convert(e.texture.format),n=s.convert(e.texture.type),o=b(e.texture.internalFormat,i,n),a=F(e);t.renderbufferStorageMultisample(36161,a,o,e.width,e.height),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(r.__webglDepthRenderbuffer=t.createRenderbuffer(),D(r.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){i.bindTexture(34067,h.__webglTexture),P(34067,e.texture,u);for(let t=0;t<6;t++)O(r.__webglFramebuffer[t],e,36064,34069+t);y(e.texture,u)&&x(34067,e.texture,e.width,e.height),i.bindTexture(34067,null)}else i.bindTexture(3553,h.__webglTexture),P(3553,e.texture,u),O(r.__webglFramebuffer,e,36064,3553),y(e.texture,u)&&x(3553,e.texture,e.width,e.height),i.bindTexture(3553,null);e.depthBuffer&&I(e)},this.updateRenderTargetMipmap=function(t){const e=t.texture;if(y(e,v(t)||a)){const r=t.isWebGLCubeRenderTarget?34067:3553,s=n.get(e).__webglTexture;i.bindTexture(r,s),x(r,e,t.width,t.height),i.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(a){const i=n.get(e);t.bindFramebuffer(36008,i.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,i.__webglFramebuffer);const r=e.width,s=e.height;let o=16384;e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024),t.blitFramebuffer(0,0,r,s,0,0,r,s,o,9728),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),B=!0),t=t.texture),S(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===k&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),k=!0),t=t.texture),M(t,e)}}function Aa(t,e,i){const n=i.isWebGL2;return{convert:function(t){let i;if(t===Et)return 5121;if(t===Ot)return 32819;if(t===Dt)return 32820;if(t===It)return 33635;if(t===St)return 5120;if(t===Mt)return 5122;if(t===At)return 5123;if(t===Ct)return 5124;if(t===Pt)return 5125;if(t===Rt)return 5126;if(t===Lt)return n?5131:(i=e.get("OES_texture_half_float"),null!==i?i.HALF_FLOAT_OES:null);if(t===Bt)return 6406;if(t===kt)return 6407;if(t===Nt)return 6408;if(t===Ut)return 6409;if(t===zt)return 6410;if(t===Vt)return 6402;if(t===Ht)return 34041;if(t===Wt)return 6403;if(t===Xt)return 36244;if(t===jt)return 33319;if(t===Yt)return 33320;if(t===qt)return 36248;if(t===Zt)return 36249;if(t===Kt||t===Jt||t===Qt||t===$t){if(i=e.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(t===Kt)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Jt)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Qt)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===$t)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===te||t===ee||t===ie||t===ne){if(i=e.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(t===te)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===ee)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===ie)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===ne)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===re)return i=e.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===se||t===oe)&&(i=e.get("WEBGL_compressed_texture_etc"),null!==i)){if(t===se)return i.COMPRESSED_RGB8_ETC2;if(t===oe)return i.COMPRESSED_RGBA8_ETC2_EAC}return t===ae||t===he||t===le||t===ce||t===ue||t===de||t===pe||t===fe||t===me||t===ge||t===ve||t===ye||t===xe||t===be||t===Te||t===_e||t===Ee||t===Se||t===Me||t===Ae||t===Ce||t===Pe||t===Re||t===Le||t===Oe||t===De||t===Ie||t===Fe?(i=e.get("WEBGL_compressed_texture_astc"),null!==i?t:null):t===we?(i=e.get("EXT_texture_compression_bptc"),null!==i?t:null):t===Ft?n?34042:(i=e.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function Ca(t=[]){ys.call(this),this.cameras=t}function Pa(){Kn.call(this),this.type="Group"}function Ra(){this._targetRay=null,this._grip=null,this._hand=null}function La(t,e){const i=this;let n=null,r=1,s=null,o="local-floor",a=null;const h=[],l=new Map,c=new ys;c.layers.enable(1),c.viewport=new ji;const u=new ys;u.layers.enable(2),u.viewport=new ji;const d=[c,u],p=new Ca;p.layers.enable(1),p.layers.enable(2);let f=null,m=null;function g(t){const e=l.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function v(){l.forEach((function(t,e){t.disconnect(e)})),l.clear(),f=null,m=null,t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),_.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function y(t){const e=n.inputSources;for(let t=0;t<h.length;t++)l.set(e[t],h[t]);for(let e=0;e<t.removed.length;e++){const i=t.removed[e],n=l.get(i);n&&(n.dispatchEvent({type:"disconnected",data:i}),l.delete(i))}for(let e=0;e<t.added.length;e++){const i=t.added[e],n=l.get(i);n&&n.dispatchEvent({type:"connected",data:i})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=h[t];return void 0===e&&(e=new Ra,h[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=h[t];return void 0===e&&(e=new Ra,h[t]=e),e.getGripSpace()},this.getHand=function(t){let e=h[t];return void 0===e&&(e=new Ra,h[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s},this.getSession=function(){return n},this.setSession=async function(t){if(n=t,null!==n){n.addEventListener("select",g),n.addEventListener("selectstart",g),n.addEventListener("selectend",g),n.addEventListener("squeeze",g),n.addEventListener("squeezestart",g),n.addEventListener("squeezeend",g),n.addEventListener("end",v),n.addEventListener("inputsourceschange",y);const t=e.getContextAttributes();!0!==t.xrCompatible&&await e.makeXRCompatible();const a={antialias:t.antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:r},h=new XRWebGLLayer(n,e,a);n.updateRenderState({baseLayer:h}),s=await n.requestReferenceSpace(o),_.setContext(n),_.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const x=new Ki,b=new Ki;function w(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.getCamera=function(t){p.near=u.near=c.near=t.near,p.far=u.far=c.far=t.far,f===p.near&&m===p.far||(n.updateRenderState({depthNear:p.near,depthFar:p.far}),f=p.near,m=p.far);const e=t.parent,i=p.cameras;w(p,e);for(let t=0;t<i.length;t++)w(i[t],e);t.matrixWorld.copy(p.matrixWorld),t.matrix.copy(p.matrix),t.matrix.decompose(t.position,t.quaternion,t.scale);const r=t.children;for(let t=0,e=r.length;t<e;t++)r[t].updateMatrixWorld(!0);return 2===i.length?function(t,e,i){x.setFromMatrixPosition(e.matrixWorld),b.setFromMatrixPosition(i.matrixWorld);const n=x.distanceTo(b),r=e.projectionMatrix.elements,s=i.projectionMatrix.elements,o=r[14]/(r[10]-1),a=r[14]/(r[10]+1),h=(r[9]+1)/r[5],l=(r[9]-1)/r[5],c=(r[8]-1)/r[0],u=(s[8]+1)/s[0],d=o*c,p=o*u,f=n/(-c+u),m=f*-c;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=o+f,v=a+f,y=d-m,w=p+(n-m),T=h*a/v*g,_=l*a/v*g;t.projectionMatrix.makePerspective(y,w,T,_,g,v)}(p,c,u):p.projectionMatrix.copy(c.projectionMatrix),p};let T=null;const _=new Ms;_.setAnimationLoop((function(e,i){if(a=i.getViewerPose(s),null!==a){const e=a.views,i=n.renderState.baseLayer;t.setFramebuffer(i.framebuffer);let r=!1;e.length!==p.cameras.length&&(p.cameras.length=0,r=!0);for(let t=0;t<e.length;t++){const n=e[t],s=i.getViewport(n),o=d[t];o.matrix.fromArray(n.transform.matrix),o.projectionMatrix.fromArray(n.projectionMatrix),o.viewport.set(s.x,s.y,s.width,s.height),0===t&&p.matrix.copy(o.matrix),!0===r&&p.cameras.push(o)}}const r=n.inputSources;for(let t=0;t<h.length;t++){const e=h[t],n=r[t];e.update(n,i,s)}T&&T(e,i)})),this.setAnimationLoop=function(t){T=t},this.dispose=function(){}}function Oa(t){function e(e,i){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map),i.alphaMap&&(e.alphaMap.value=i.alphaMap),i.specularMap&&(e.specularMap.value=i.specularMap);const n=t.get(i).envMap;if(n){e.envMap.value=n,e.flipEnvMap.value=n.isCubeTexture&&n._needsFlipEnvMap?-1:1,e.reflectivity.value=i.reflectivity,e.refractionRatio.value=i.refractionRatio;const r=t.get(n).__maxMipLevel;void 0!==r&&(e.maxMipLevel.value=r)}let r,s;i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity),i.map?r=i.map:i.specularMap?r=i.specularMap:i.displacementMap?r=i.displacementMap:i.normalMap?r=i.normalMap:i.bumpMap?r=i.bumpMap:i.roughnessMap?r=i.roughnessMap:i.metalnessMap?r=i.metalnessMap:i.alphaMap?r=i.alphaMap:i.emissiveMap?r=i.emissiveMap:i.clearcoatMap?r=i.clearcoatMap:i.clearcoatNormalMap?r=i.clearcoatNormalMap:i.clearcoatRoughnessMap&&(r=i.clearcoatRoughnessMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),i.aoMap?s=i.aoMap:i.lightMap&&(s=i.lightMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),e.uv2Transform.value.copy(s.matrix))}function i(e,i){e.roughness.value=i.roughness,e.metalness.value=i.metalness,i.roughnessMap&&(e.roughnessMap.value=i.roughnessMap),i.metalnessMap&&(e.metalnessMap.value=i.metalnessMap),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,i.side===m&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),i.side===m&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias);t.get(i).envMap&&(e.envMapIntensity.value=i.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,n,r,s){n.isMeshBasicMaterial?e(t,n):n.isMeshLambertMaterial?(e(t,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,n)):n.isMeshToonMaterial?(e(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===m&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===m&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshPhongMaterial?(e(t,n),function(t,e){t.specular.value.copy(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.side===m&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===m&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshStandardMaterial?(e(t,n),n.isMeshPhysicalMaterial?function(t,e){i(t,e),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap);e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===m&&t.clearcoatNormalScale.value.negate());t.transmission.value=e.transmission,e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap)}(t,n):i(t,n)):n.isMeshMatcapMaterial?(e(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===m&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===m&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDepthMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isMeshDistanceMaterial?(e(t,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,n)):n.isMeshNormalMaterial?(e(t,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===m&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===m&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);let r;e.map?r=e.map:e.alphaMap&&(r=e.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,n,r,s):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);let i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function Da(t){const e=void 0!==(t=t||{}).canvas?t.canvas:function(){const t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return t.style.display="block",t}(),i=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,s=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,h=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,l=void 0!==t.powerPreference?t.powerPreference:"default",c=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let u=null,d=null;const p=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Ke,this.physicallyCorrectLights=!1,this.toneMapping=Q,this.toneMappingExposure=1,this.maxMorphTargets=8,this.maxMorphNormals=4;const f=this;let m=!1,g=null,v=0,y=0,x=null,b=null,w=-1,T=null;const _=new ji,E=new ji;let S=null,M=e.width,A=e.height,C=1,P=null,R=null;const L=new ji(0,0,M,A),O=new ji(0,0,M,A);let D=!1;const I=new Ss;let F=!1,B=!1;const k=new Sn,N=new Ki,U={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function z(){return null===x?C:1}let G,V,H,W,X,j,Y,q,Z,K,J,$,tt,et,it,nt,rt,st,ot,at,ht,lt=i;function ct(t,i){for(let n=0;n<t.length;n++){const r=t[n],s=e.getContext(r,i);if(null!==s)return s}return null}try{const t={alpha:n,depth:r,stencil:s,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:h,powerPreference:l,failIfMajorPerformanceCaveat:c};if(e.addEventListener("webglcontextlost",ft,!1),e.addEventListener("webglcontextrestored",mt,!1),null===lt){const e=["webgl2","webgl","experimental-webgl"];if(!0===f.isWebGL1Renderer&&e.shift(),lt=ct(e,t),null===lt)throw ct(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===lt.getShaderPrecisionFormat&&(lt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function ut(){G=new Ns(lt),V=new Fs(lt,G,t),G.init(V),at=new Aa(lt,G,V),H=new Sa(lt,G,V),H.scissor(E.copy(O).multiplyScalar(C).floor()),H.viewport(_.copy(L).multiplyScalar(C).floor()),W=new Gs(lt),X=new ua,j=new Ma(lt,G,H,X,V,at,W),Y=new ks(f),q=new As(lt,V),ht=new Ds(lt,G,q,V),Z=new Us(lt,q,W,ht),K=new Xs(lt,Z,q,W),rt=new Ws(lt),it=new Bs(X),J=new ca(f,Y,G,V,ht,it),$=new Oa(X),tt=new ma(X),et=new wa(G,V),nt=new Os(f,Y,H,K,a),st=new Is(lt,G,W,V),ot=new zs(lt,G,W,V),W.programs=J.programs,f.capabilities=V,f.extensions=G,f.properties=X,f.renderLists=tt,f.state=H,f.info=W}ut();const dt=new La(f,lt);this.xr=dt;const pt=new Ea(f,K,V.maxTextureSize);function ft(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),m=!0}function mt(){console.log("THREE.WebGLRenderer: Context Restored."),m=!1,ut()}function gt(t){const e=t.target;e.removeEventListener("dispose",gt),function(t){vt(t),X.remove(t)}(e)}function vt(t){const e=X.get(t).program;void 0!==e&&J.releaseProgram(e)}this.shadowMap=pt,this.getContext=function(){return lt},this.getContextAttributes=function(){return lt.getContextAttributes()},this.forceContextLoss=function(){const t=G.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=G.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return C},this.setPixelRatio=function(t){void 0!==t&&(C=t,this.setSize(M,A,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new Ui),t.set(M,A)},this.setSize=function(t,i,n){dt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(M=t,A=i,e.width=Math.floor(t*C),e.height=Math.floor(i*C),!1!==n&&(e.style.width=t+"px",e.style.height=i+"px"),this.setViewport(0,0,t,i))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new Ui),t.set(M*C,A*C).floor()},this.setDrawingBufferSize=function(t,i,n){M=t,A=i,C=n,e.width=Math.floor(t*n),e.height=Math.floor(i*n),this.setViewport(0,0,t,i)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new ji),t.copy(_)},this.getViewport=function(t){return t.copy(L)},this.setViewport=function(t,e,i,n){t.isVector4?L.set(t.x,t.y,t.z,t.w):L.set(t,e,i,n),H.viewport(_.copy(L).multiplyScalar(C).floor())},this.getScissor=function(t){return t.copy(O)},this.setScissor=function(t,e,i,n){t.isVector4?O.set(t.x,t.y,t.z,t.w):O.set(t,e,i,n),H.scissor(E.copy(O).multiplyScalar(C).floor())},this.getScissorTest=function(){return D},this.setScissorTest=function(t){H.setScissorTest(D=t)},this.setOpaqueSort=function(t){P=t},this.setTransparentSort=function(t){R=t},this.getClearColor=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getClearColor() now requires a Color as an argument"),t=new yr),t.copy(nt.getClearColor())},this.setClearColor=function(){nt.setClearColor.apply(nt,arguments)},this.getClearAlpha=function(){return nt.getClearAlpha()},this.setClearAlpha=function(){nt.setClearAlpha.apply(nt,arguments)},this.clear=function(t,e,i){let n=0;(void 0===t||t)&&(n|=16384),(void 0===e||e)&&(n|=256),(void 0===i||i)&&(n|=1024),lt.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",ft,!1),e.removeEventListener("webglcontextrestored",mt,!1),tt.dispose(),et.dispose(),X.dispose(),Y.dispose(),K.dispose(),ht.dispose(),dt.dispose(),xt.stop()},this.renderBufferImmediate=function(t,e){ht.initAttributes();const i=X.get(t);t.hasPositions&&!i.position&&(i.position=lt.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=lt.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=lt.createBuffer()),t.hasColors&&!i.color&&(i.color=lt.createBuffer());const n=e.getAttributes();t.hasPositions&&(lt.bindBuffer(34962,i.position),lt.bufferData(34962,t.positionArray,35048),ht.enableAttribute(n.position),lt.vertexAttribPointer(n.position,3,5126,!1,0,0)),t.hasNormals&&(lt.bindBuffer(34962,i.normal),lt.bufferData(34962,t.normalArray,35048),ht.enableAttribute(n.normal),lt.vertexAttribPointer(n.normal,3,5126,!1,0,0)),t.hasUvs&&(lt.bindBuffer(34962,i.uv),lt.bufferData(34962,t.uvArray,35048),ht.enableAttribute(n.uv),lt.vertexAttribPointer(n.uv,2,5126,!1,0,0)),t.hasColors&&(lt.bindBuffer(34962,i.color),lt.bufferData(34962,t.colorArray,35048),ht.enableAttribute(n.color),lt.vertexAttribPointer(n.color,3,5126,!1,0,0)),ht.disableUnusedAttributes(),lt.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,i,n,r,s){null===e&&(e=U);const o=r.isMesh&&r.matrixWorld.determinant()<0,a=St(t,e,n,r);H.setMaterial(n,o);let h=i.index;const l=i.attributes.position;if(null===h){if(void 0===l||0===l.count)return}else if(0===h.count)return;let c,u=1;!0===n.wireframe&&(h=Z.getWireframeAttribute(i),u=2),(n.morphTargets||n.morphNormals)&&rt.update(r,i,n,a),ht.setup(r,n,a,i,h);let d=st;null!==h&&(c=q.get(h),d=ot,d.setIndex(c));const p=null!==h?h.count:l.count,f=i.drawRange.start*u,m=i.drawRange.count*u,g=null!==s?s.start*u:0,v=null!==s?s.count*u:1/0,y=Math.max(f,g),x=Math.min(p,f+m,g+v)-1,b=Math.max(0,x-y+1);if(0!==b){if(r.isMesh)!0===n.wireframe?(H.setLineWidth(n.wireframeLinewidth*z()),d.setMode(1)):d.setMode(4);else if(r.isLine){let t=n.linewidth;void 0===t&&(t=1),H.setLineWidth(t*z()),r.isLineSegments?d.setMode(1):r.isLineLoop?d.setMode(2):d.setMode(3)}else r.isPoints?d.setMode(0):r.isSprite&&d.setMode(4);if(r.isInstancedMesh)d.renderInstances(y,b,r.count);else if(i.isInstancedBufferGeometry){const t=Math.min(i.instanceCount,i._maxInstanceCount);d.renderInstances(y,b,t)}else d.render(y,b)}},this.compile=function(t,e){d=et.get(t),d.init(),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))})),d.setupLights();const i=new WeakMap;t.traverse((function(e){const n=e.material;if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++){const s=n[r];!1===i.has(s)&&(_t(s,t,e),i.set(s))}else!1===i.has(n)&&(_t(n,t,e),i.set(n))}))};let yt=null;const xt=new Ms;function bt(t,e,i,n){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)i=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)d.pushLight(t),t.castShadow&&d.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||I.intersectsSprite(t)){n&&N.setFromMatrixPosition(t.matrixWorld).applyMatrix4(k);const e=K.update(t),r=t.material;r.visible&&u.push(t,e,r,i,N.z,null)}}else if(t.isImmediateRenderObject)n&&N.setFromMatrixPosition(t.matrixWorld).applyMatrix4(k),u.push(t,null,t.material,i,N.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==W.render.frame&&(t.skeleton.update(),t.skeleton.frame=W.render.frame),!t.frustumCulled||I.intersectsObject(t))){n&&N.setFromMatrixPosition(t.matrixWorld).applyMatrix4(k);const e=K.update(t),r=t.material;if(Array.isArray(r)){const n=e.groups;for(let s=0,o=n.length;s<o;s++){const o=n[s],a=r[o.materialIndex];a&&a.visible&&u.push(t,e,a,i,N.z,o)}}else r.visible&&u.push(t,e,r,i,N.z,null)}const r=t.children;for(let t=0,s=r.length;t<s;t++)bt(r[t],e,i,n)}function wt(t,e,i){const n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r<s;r++){const s=t[r],o=s.object,a=s.geometry,h=null===n?s.material:n,l=s.group;if(i.isArrayCamera){const t=i.cameras;for(let i=0,n=t.length;i<n;i++){const n=t[i];o.layers.test(n.layers)&&(H.viewport(_.copy(n.viewport)),d.setupLightsView(n),Tt(o,e,n,a,h,l))}}else Tt(o,e,i,a,h,l)}}function Tt(t,e,i,n,r,s){if(t.onBeforeRender(f,e,i,n,r,s),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){const n=St(i,e,r,t);H.setMaterial(r),ht.reset(),function(t,e){t.render((function(t){f.renderBufferImmediate(t,e)}))}(t,n)}else f.renderBufferDirect(i,e,n,r,t,s);t.onAfterRender(f,e,i,n,r,s)}function _t(t,e,i){!0!==e.isScene&&(e=U);const n=X.get(t),r=d.state.lights,s=d.state.shadowsArray,o=r.state.version,a=J.getParameters(t,r.state,s,e,i),h=J.getProgramCacheKey(a);let l=n.program,c=!0;if(n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.envMap=Y.get(t.envMap||n.environment),void 0===l)t.addEventListener("dispose",gt);else if(l.cacheKey!==h)vt(t);else if(n.lightsStateVersion!==o)c=!1;else{if(void 0!==a.shaderID)return;c=!1}c&&(a.uniforms=J.getUniforms(t),t.onBeforeCompile(a,f),l=J.acquireProgram(a,h),n.program=l,n.uniforms=a.uniforms,n.outputEncoding=a.outputEncoding);const u=n.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=it.numPlanes,n.numIntersection=it.numIntersection,u.clippingPlanes=it.uniform),n.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),n.lightsStateVersion=o,n.needsLights&&(u.ambientLightColor.value=r.state.ambient,u.lightProbe.value=r.state.probe,u.directionalLights.value=r.state.directional,u.directionalLightShadows.value=r.state.directionalShadow,u.spotLights.value=r.state.spot,u.spotLightShadows.value=r.state.spotShadow,u.rectAreaLights.value=r.state.rectArea,u.ltc_1.value=r.state.rectAreaLTC1,u.ltc_2.value=r.state.rectAreaLTC2,u.pointLights.value=r.state.point,u.pointLightShadows.value=r.state.pointShadow,u.hemisphereLights.value=r.state.hemi,u.directionalShadowMap.value=r.state.directionalShadowMap,u.directionalShadowMatrix.value=r.state.directionalShadowMatrix,u.spotShadowMap.value=r.state.spotShadowMap,u.spotShadowMatrix.value=r.state.spotShadowMatrix,u.pointShadowMap.value=r.state.pointShadowMap,u.pointShadowMatrix.value=r.state.pointShadowMatrix);const p=n.program.getUniforms(),m=Ho.seqWithValue(p.seq,u);n.uniformsList=m}function St(t,e,i,n){!0!==e.isScene&&(e=U),j.resetTextureUnits();const r=e.fog,s=i.isMeshStandardMaterial?e.environment:null,o=null===x?f.outputEncoding:x.texture.encoding,a=Y.get(i.envMap||s),h=X.get(i),l=d.state.lights;if(!0===F&&(!0===B||t!==T)){const e=t===T&&i.id===w;it.setState(i,t,e)}i.version===h.__version?i.fog&&h.fog!==r||h.environment!==s||h.needsLights&&h.lightsStateVersion!==l.state.version?_t(i,e,n):void 0===h.numClippingPlanes||h.numClippingPlanes===it.numPlanes&&h.numIntersection===it.numIntersection?(h.outputEncoding!==o||h.envMap!==a)&&_t(i,e,n):_t(i,e,n):(_t(i,e,n),h.__version=i.version);let c=!1,u=!1,p=!1;const m=h.program,g=m.getUniforms(),v=h.uniforms;if(H.useProgram(m.program)&&(c=!0,u=!0,p=!0),i.id!==w&&(w=i.id,u=!0),c||T!==t){if(g.setValue(lt,"projectionMatrix",t.projectionMatrix),V.logarithmicDepthBuffer&&g.setValue(lt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),T!==t&&(T=t,u=!0,p=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=g.map.cameraPosition;void 0!==e&&e.setValue(lt,N.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&g.setValue(lt,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||i.skinning)&&g.setValue(lt,"viewMatrix",t.matrixWorldInverse)}if(i.skinning){g.setOptional(lt,n,"bindMatrix"),g.setOptional(lt,n,"bindMatrixInverse");const t=n.skeleton;if(t){const e=t.bones;if(V.floatVertexTextures){if(null===t.boneTexture){let i=Math.sqrt(4*e.length);i=Ni.ceilPowerOfTwo(i),i=Math.max(i,4);const n=new Float32Array(i*i*4);n.set(t.boneMatrices);const r=new Ts(n,i,i,Nt,Rt);t.boneMatrices=n,t.boneTexture=r,t.boneTextureSize=i}g.setValue(lt,"boneTexture",t.boneTexture,j),g.setValue(lt,"boneTextureSize",t.boneTextureSize)}else g.setOptional(lt,t,"boneMatrices")}}var y,b;return(u||h.receiveShadow!==n.receiveShadow)&&(h.receiveShadow=n.receiveShadow,g.setValue(lt,"receiveShadow",n.receiveShadow)),u&&(g.setValue(lt,"toneMappingExposure",f.toneMappingExposure),h.needsLights&&(b=p,(y=v).ambientLightColor.needsUpdate=b,y.lightProbe.needsUpdate=b,y.directionalLights.needsUpdate=b,y.directionalLightShadows.needsUpdate=b,y.pointLights.needsUpdate=b,y.pointLightShadows.needsUpdate=b,y.spotLights.needsUpdate=b,y.spotLightShadows.needsUpdate=b,y.rectAreaLights.needsUpdate=b,y.hemisphereLights.needsUpdate=b),r&&i.fog&&$.refreshFogUniforms(v,r),$.refreshMaterialUniforms(v,i,C,A),Ho.upload(lt,h.uniformsList,v,j)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Ho.upload(lt,h.uniformsList,v,j),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&g.setValue(lt,"center",n.center),g.setValue(lt,"modelViewMatrix",n.modelViewMatrix),g.setValue(lt,"normalMatrix",n.normalMatrix),g.setValue(lt,"modelMatrix",n.matrixWorld),m}xt.setAnimationLoop((function(t){dt.isPresenting||yt&&yt(t)})),"undefined"!=typeof window&&xt.setContext(window),this.setAnimationLoop=function(t){yt=t,dt.setAnimationLoop(t),null===t?xt.stop():xt.start()},this.render=function(t,e){let i,n;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),n=arguments[3]),void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===m)return;ht.resetDefaultState(),w=-1,T=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===dt.enabled&&!0===dt.isPresenting&&(e=dt.getCamera(e)),!0===t.isScene&&t.onBeforeRender(f,t,e,i||x),d=et.get(t,p.length),d.init(),p.push(d),k.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),I.setFromProjectionMatrix(k),B=this.localClippingEnabled,F=it.init(this.clippingPlanes,B,e),u=tt.get(t,e),u.init(),bt(t,e,0,f.sortObjects),u.finish(),!0===f.sortObjects&&u.sort(P,R),!0===F&&it.beginShadows();const r=d.state.shadowsArray;pt.render(r,t,e),d.setupLights(),d.setupLightsView(e),!0===F&&it.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),nt.render(u,t,e,n);const s=u.opaque,o=u.transparent;s.length>0&&wt(s,t,e),o.length>0&&wt(o,t,e),!0===t.isScene&&t.onAfterRender(f,t,e),null!==x&&(j.updateRenderTargetMipmap(x),j.updateMultisampleRenderTarget(x)),H.buffers.depth.setTest(!0),H.buffers.depth.setMask(!0),H.buffers.color.setMask(!0),H.setPolygonOffset(!1),p.pop(),d=p.length>0?p[p.length-1]:null,u=null},this.setFramebuffer=function(t){g!==t&&null===x&<.bindFramebuffer(36160,t),g=t},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderList=function(){return u},this.setRenderList=function(t){u=t},this.getRenderTarget=function(){return x},this.setRenderTarget=function(t,e=0,i=0){x=t,v=e,y=i,t&&void 0===X.get(t).__webglFramebuffer&&j.setupRenderTarget(t);let n=g,r=!1;if(t){const i=X.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=i[e],r=!0):n=t.isWebGLMultisampleRenderTarget?X.get(t).__webglMultisampledFramebuffer:i,_.copy(t.viewport),E.copy(t.scissor),S=t.scissorTest}else _.copy(L).multiplyScalar(C).floor(),E.copy(O).multiplyScalar(C).floor(),S=D;if(b!==n&&(lt.bindFramebuffer(36160,n),b=n),H.viewport(_),H.scissor(E),H.setScissorTest(S),r){const n=X.get(t.texture);lt.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}},this.readRenderTargetPixels=function(t,e,i,n,r,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=X.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){let o=!1;a!==b&&(lt.bindFramebuffer(36160,a),o=!0);try{const a=t.texture,h=a.format,l=a.type;if(h!==Nt&&at.convert(h)!==lt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Lt&&(G.has("EXT_color_buffer_half_float")||V.isWebGL2&&G.has("EXT_color_buffer_float"));if(!(l===Et||at.convert(l)===lt.getParameter(35738)||l===Rt&&(V.isWebGL2||G.has("OES_texture_float")||G.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===lt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&<.readPixels(e,i,n,r,at.convert(h),at.convert(l),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{o&<.bindFramebuffer(36160,b)}}},this.copyFramebufferToTexture=function(t,e,i=0){const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n),o=at.convert(e.format);j.setTexture2D(e,0),lt.copyTexImage2D(3553,i,o,t.x,t.y,r,s,0),H.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){const r=e.image.width,s=e.image.height,o=at.convert(i.format),a=at.convert(i.type);j.setTexture2D(i,0),lt.pixelStorei(37440,i.flipY),lt.pixelStorei(37441,i.premultiplyAlpha),lt.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?lt.texSubImage2D(3553,n,t.x,t.y,r,s,o,a,e.image.data):e.isCompressedTexture?lt.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):lt.texSubImage2D(3553,n,t.x,t.y,o,a,e.image),0===n&&i.generateMipmaps&<.generateMipmap(3553),H.unbindTexture()},this.initTexture=function(t){j.setTexture2D(t,0),H.unbindTexture()},this.resetState=function(){H.reset(),ht.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Ia(t){Da.call(this,t)}Ca.prototype=Object.assign(Object.create(ys.prototype),{constructor:Ca,isArrayCamera:!0}),Pa.prototype=Object.assign(Object.create(Kn.prototype),{constructor:Pa,isGroup:!0}),Object.assign(Ra.prototype,{constructor:Ra,getHandSpace:function(){return null===this._hand&&(this._hand=new Pa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Pa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Pa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,i){let n=null,r=null,s=null;const o=this._targetRay,a=this._grip,h=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(h&&t.hand){s=!0;for(const n of t.hand.values()){const t=e.getJointPose(n,i);if(void 0===h.joints[n.jointName]){const t=new Pa;t.matrixAutoUpdate=!1,t.visible=!1,h.joints[n.jointName]=t,h.add(t)}const r=h.joints[n.jointName];null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=t.radius),r.visible=null!==t}const n=h.joints["index-finger-tip"],r=h.joints["thumb-tip"],o=n.position.distanceTo(r.position),a=.02,l=.005;h.inputState.pinching&&o>a+l?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&o<=a-l&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&(n=e.getPose(t.targetRaySpace,i),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==a&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)));return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==h&&(h.visible=null!==s),this}}),Object.assign(La.prototype,Fi.prototype),Ia.prototype=Object.assign(Object.create(Da.prototype),{constructor:Ia,isWebGL1Renderer:!0});class Fa{constructor(t,e){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new yr(t),this.density=void 0!==e?e:25e-5}clone(){return new Fa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Ba{constructor(t,e,i){Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new yr(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}clone(){return new Ba(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class ka extends Kn{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}function Na(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Ei,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ni.generateUUID()}Object.defineProperty(Na.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Na.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this},set:function(t,e=0){return this.array.set(t,e),this},clone:function(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ni.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new Na(new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),this.stride);return e.setUsage(this.usage),e},onUpload:function(t){return this.onUploadCallback=t,this},toJSON:function(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=Ni.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});const Ua=new Ki;function za(t,e,i,n){this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}function Ga(t){wr.call(this),this.type="SpriteMaterial",this.color=new yr(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}let Va;Object.defineProperties(za.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(t){this.data.needsUpdate=t}}}),Object.assign(za.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(let e=0,i=this.data.count;e<i;e++)Ua.x=this.getX(e),Ua.y=this.getY(e),Ua.z=this.getZ(e),Ua.applyMatrix4(t),this.setXYZ(e,Ua.x,Ua.y,Ua.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this},clone:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new Sr(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new za(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}),Ga.prototype=Object.create(wr.prototype),Ga.prototype.constructor=Ga,Ga.prototype.isSpriteMaterial=!0,Ga.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};const Ha=new Ki,Wa=new Ki,Xa=new Ki,ja=new Ui,Ya=new Ui,qa=new Sn,Za=new Ki,Ka=new Ki,Ja=new Ki,Qa=new Ui,$a=new Ui,th=new Ui;function eh(t){if(Kn.call(this),this.type="Sprite",void 0===Va){Va=new jr;const t=new Na(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Va.setIndex([0,1,2,0,2,3]),Va.setAttribute("position",new za(t,3,0,!1)),Va.setAttribute("uv",new za(t,2,3,!1))}this.geometry=Va,this.material=void 0!==t?t:new Ga,this.center=new Ui(.5,.5)}function ih(t,e,i,n,r,s){ja.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(Ya.x=s*ja.x-r*ja.y,Ya.y=r*ja.x+s*ja.y):Ya.copy(ja),t.copy(e),t.x+=Ya.x,t.y+=Ya.y,t.applyMatrix4(qa)}eh.prototype=Object.assign(Object.create(Kn.prototype),{constructor:eh,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Wa.setFromMatrixScale(this.matrixWorld),qa.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Xa.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Wa.multiplyScalar(-Xa.z);const i=this.material.rotation;let n,r;0!==i&&(r=Math.cos(i),n=Math.sin(i));const s=this.center;ih(Za.set(-.5,-.5,0),Xa,s,Wa,n,r),ih(Ka.set(.5,-.5,0),Xa,s,Wa,n,r),ih(Ja.set(.5,.5,0),Xa,s,Wa,n,r),Qa.set(0,0),$a.set(1,0),th.set(1,1);let o=t.ray.intersectTriangle(Za,Ka,Ja,!1,Ha);if(null===o&&(ih(Ka.set(-.5,.5,0),Xa,s,Wa,n,r),$a.set(0,1),o=t.ray.intersectTriangle(Za,Ja,Ka,!1,Ha),null===o))return;const a=t.ray.origin.distanceTo(Ha);a<t.near||a>t.far||e.push({distance:a,point:Ha.clone(),uv:ur.getUV(Ha,Za,Ka,Ja,Qa,$a,th,new Ui),face:null,object:this})},copy:function(t){return Kn.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});const nh=new Ki,rh=new Ki;function sh(){Kn.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}sh.prototype=Object.assign(Object.create(Kn.prototype),{constructor:sh,isLOD:!0,copy:function(t){Kn.prototype.copy.call(this,t,!1);const e=t.levels;for(let t=0,i=e.length;t<i;t++){const i=e[t];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e=0){e=Math.abs(e);const i=this.levels;let n;for(n=0;n<i.length&&!(e<i[n].distance);n++);return i.splice(n,0,{distance:e,object:t}),this.add(t),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(t){const e=this.levels;if(e.length>0){let i,n;for(i=1,n=e.length;i<n&&!(t<e[i].distance);i++);return e[i-1].object}return null},raycast:function(t,e){if(this.levels.length>0){nh.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(t,e)}},update:function(t){const e=this.levels;if(e.length>1){nh.setFromMatrixPosition(t.matrixWorld),rh.setFromMatrixPosition(this.matrixWorld);const i=nh.distanceTo(rh)/t.zoom;let n,r;for(e[0].object.visible=!0,n=1,r=e.length;n<r&&i>=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;n<r;n++)e[n].object.visible=!1}},toJSON:function(t){const e=Kn.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];const i=this.levels;for(let t=0,n=i.length;t<n;t++){const n=i[t];e.object.levels.push({object:n.object.uuid,distance:n.distance})}return e}});const oh=new Ki,ah=new ji,hh=new ji,lh=new Ki,ch=new Sn;function uh(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),cs.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Sn,this.bindMatrixInverse=new Sn}function dh(){Kn.call(this),this.type="Bone"}uh.prototype=Object.assign(Object.create(cs.prototype),{constructor:uh,isSkinnedMesh:!0,copy:function(t){return cs.prototype.copy.call(this,t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this},bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){const t=new ji,e=this.geometry.attributes.skinWeight;for(let i=0,n=e.count;i<n;i++){t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.w=e.getW(i);const n=1/t.manhattanLength();n!==1/0?t.multiplyScalar(n):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){cs.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},boneTransform:function(t,e){const i=this.skeleton,n=this.geometry;ah.fromBufferAttribute(n.attributes.skinIndex,t),hh.fromBufferAttribute(n.attributes.skinWeight,t),oh.fromBufferAttribute(n.attributes.position,t).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){const n=hh.getComponent(t);if(0!==n){const r=ah.getComponent(t);ch.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),e.addScaledVector(lh.copy(oh).applyMatrix4(ch),n)}}return e.applyMatrix4(this.bindMatrixInverse)}}),dh.prototype=Object.assign(Object.create(Kn.prototype),{constructor:dh,isBone:!0});const ph=new Sn,fh=new Sn;function mh(t=[],e=[]){this.uuid=Ni.generateUUID(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}Object.assign(mh.prototype,{init:function(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new Sn)}},calculateInverses:function(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const e=new Sn;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}},pose:function(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}},update:function(){const t=this.bones,e=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let n=0,r=t.length;n<r;n++){const r=t[n]?t[n].matrixWorld:fh;ph.multiplyMatrices(r,e[n]),ph.toArray(i,16*n)}null!==n&&(n.needsUpdate=!0)},clone:function(){return new mh(this.bones,this.boneInverses)},getBoneByName:function(t){for(let e=0,i=this.bones.length;e<i;e++){const i=this.bones[e];if(i.name===t)return i}},dispose:function(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)},fromJSON:function(t,e){this.uuid=t.uuid;for(let i=0,n=t.bones.length;i<n;i++){const n=t.bones[i];let r=e[n];void 0===r&&(console.warn("THREE.Skeleton: No bone found with UUID:",n),r=new dh),this.bones.push(r),this.boneInverses.push((new Sn).fromArray(t.boneInverses[i]))}return this.init(),this},toJSON:function(){const t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,i=this.boneInverses;for(let n=0,r=e.length;n<r;n++){const r=e[n];t.bones.push(r.uuid);const s=i[n];t.boneInverses.push(s.toArray())}return t}});const gh=new Sn,vh=new Sn,yh=[],xh=new cs;function bh(t,e,i){cs.call(this,t,e),this.instanceMatrix=new Sr(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}function wh(t){wr.call(this),this.type="LineBasicMaterial",this.color=new yr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}bh.prototype=Object.assign(Object.create(cs.prototype),{constructor:bh,isInstancedMesh:!0,copy:function(t){return cs.prototype.copy.call(this,t),this.instanceMatrix.copy(t.instanceMatrix),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this},getColorAt:function(t,e){e.fromArray(this.instanceColor.array,3*t)},getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){const i=this.matrixWorld,n=this.count;if(xh.geometry=this.geometry,xh.material=this.material,void 0!==xh.material)for(let r=0;r<n;r++){this.getMatrixAt(r,gh),vh.multiplyMatrices(i,gh),xh.matrixWorld=vh,xh.raycast(t,yh);for(let t=0,i=yh.length;t<i;t++){const i=yh[t];i.instanceId=r,i.object=this,e.push(i)}yh.length=0}},setColorAt:function(t,e){null===this.instanceColor&&(this.instanceColor=new Sr(new Float32Array(3*this.count),3)),e.toArray(this.instanceColor.array,3*t)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){},dispose:function(){this.dispatchEvent({type:"dispose"})}}),wh.prototype=Object.create(wr.prototype),wh.prototype.constructor=wh,wh.prototype.isLineBasicMaterial=!0,wh.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this};const Th=new Ki,_h=new Ki,Eh=new Sn,Sh=new En,Mh=new gn;function Ah(t=new jr,e=new wh){Kn.call(this),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}Ah.prototype=Object.assign(Object.create(Kn.prototype),{constructor:Ah,isLine:!0,copy:function(t){return Kn.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[0];for(let t=1,n=e.count;t<n;t++)Th.fromBufferAttribute(e,t-1),_h.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=Th.distanceTo(_h);t.setAttribute("lineDistance",new Ir(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this},raycast:function(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Line.threshold;if(null===i.boundingSphere&&i.computeBoundingSphere(),Mh.copy(i.boundingSphere),Mh.applyMatrix4(n),Mh.radius+=r,!1===t.ray.intersectsSphere(Mh))return;Eh.copy(n).invert(),Sh.copy(t.ray).applyMatrix4(Eh);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s,a=new Ki,h=new Ki,l=new Ki,c=new Ki,u=this.isLineSegments?2:1;if(i.isBufferGeometry){const n=i.index,r=i.attributes.position;if(null!==n){const i=n.array;for(let n=0,s=i.length-1;n<s;n+=u){const s=i[n],u=i[n+1];a.fromBufferAttribute(r,s),h.fromBufferAttribute(r,u);if(Sh.distanceSqToSegment(a,h,c,l)>o)continue;c.applyMatrix4(this.matrixWorld);const d=t.ray.origin.distanceTo(c);d<t.near||d>t.far||e.push({distance:d,point:l.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else for(let i=0,n=r.count-1;i<n;i+=u){a.fromBufferAttribute(r,i),h.fromBufferAttribute(r,i+1);if(Sh.distanceSqToSegment(a,h,c,l)>o)continue;c.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(c);n<t.near||n>t.far||e.push({distance:n,point:l.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Ch=new Ki,Ph=new Ki;function Rh(t,e){Ah.call(this,t,e),this.type="LineSegments"}function Lh(t,e){Ah.call(this,t,e),this.type="LineLoop"}function Oh(t){wr.call(this),this.type="PointsMaterial",this.color=new yr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Rh.prototype=Object.assign(Object.create(Ah.prototype),{constructor:Rh,isLineSegments:!0,computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;t<n;t+=2)Ch.fromBufferAttribute(e,t),Ph.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+Ch.distanceTo(Ph);t.setAttribute("lineDistance",new Ir(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else t.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}),Lh.prototype=Object.assign(Object.create(Ah.prototype),{constructor:Lh,isLineLoop:!0}),Oh.prototype=Object.create(wr.prototype),Oh.prototype.constructor=Oh,Oh.prototype.isPointsMaterial=!0,Oh.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};const Dh=new Sn,Ih=new En,Fh=new gn,Bh=new Ki;function kh(t=new jr,e=new Oh){Kn.call(this),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}function Nh(t,e,i,n,r,s,o){const a=Ih.distanceSqToPoint(t);if(a<i){const i=new Ki;Ih.closestPointToPoint(t,i),i.applyMatrix4(n);const h=r.ray.origin.distanceTo(i);if(h<r.near||h>r.far)return;s.push({distance:h,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:o})}}function Uh(t,e,i,n,r,s,o,a,h){Wi.call(this,t,e,i,n,r,s,o,a,h),this.format=void 0!==o?o:kt,this.minFilter=void 0!==s?s:xt,this.magFilter=void 0!==r?r:xt,this.generateMipmaps=!1;const l=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){l.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}function zh(t,e,i,n,r,s,o,a,h,l,c,u){Wi.call(this,null,s,o,a,h,l,n,r,c,u),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Gh(t,e,i,n,r,s,o,a,h){Wi.call(this,t,e,i,n,r,s,o,a,h),this.needsUpdate=!0}function Vh(t,e,i,n,r,s,o,a,h,l){if((l=void 0!==l?l:Vt)!==Vt&&l!==Ht)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&l===Vt&&(i=At),void 0===i&&l===Ht&&(i=Ft),Wi.call(this,null,n,r,s,o,a,l,i,h),this.image={width:t,height:e},this.magFilter=void 0!==o?o:ft,this.minFilter=void 0!==a?a:ft,this.flipY=!1,this.generateMipmaps=!1}kh.prototype=Object.assign(Object.create(Kn.prototype),{constructor:kh,isPoints:!0,copy:function(t){return Kn.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Points.threshold;if(null===i.boundingSphere&&i.computeBoundingSphere(),Fh.copy(i.boundingSphere),Fh.applyMatrix4(n),Fh.radius+=r,!1===t.ray.intersectsSphere(Fh))return;Dh.copy(n).invert(),Ih.copy(t.ray).applyMatrix4(Dh);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s;if(i.isBufferGeometry){const r=i.index,s=i.attributes.position;if(null!==r){const i=r.array;for(let r=0,a=i.length;r<a;r++){const a=i[r];Bh.fromBufferAttribute(s,a),Nh(Bh,a,o,n,t,e,this)}}else for(let i=0,r=s.count;i<r;i++)Bh.fromBufferAttribute(s,i),Nh(Bh,i,o,n,t,e,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),Uh.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Uh,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),zh.prototype=Object.create(Wi.prototype),zh.prototype.constructor=zh,zh.prototype.isCompressedTexture=!0,Gh.prototype=Object.create(Wi.prototype),Gh.prototype.constructor=Gh,Gh.prototype.isCanvasTexture=!0,Vh.prototype=Object.create(Wi.prototype),Vh.prototype.constructor=Vh,Vh.prototype.isDepthTexture=!0;class Hh extends jr{constructor(t=1,e=8,i=0,n=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},e=Math.max(3,e);const r=[],s=[],o=[],a=[],h=new Ki,l=new Ui;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let r=0,c=3;r<=e;r++,c+=3){const u=i+r/e*n;h.x=t*Math.cos(u),h.y=t*Math.sin(u),s.push(h.x,h.y,h.z),o.push(0,0,1),l.x=(s[c]/t+1)/2,l.y=(s[c+1]/t+1)/2,a.push(l.x,l.y)}for(let t=1;t<=e;t++)r.push(t,t+1,0);this.setIndex(r),this.setAttribute("position",new Ir(s,3)),this.setAttribute("normal",new Ir(o,3)),this.setAttribute("uv",new Ir(a,2))}}class Wh extends jr{constructor(t=1,e=1,i=1,n=8,r=1,s=!1,o=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a};const h=this;n=Math.floor(n),r=Math.floor(r);const l=[],c=[],u=[],d=[];let p=0;const f=[],m=i/2;let g=0;function v(i){const r=p,s=new Ui,f=new Ki;let v=0;const y=!0===i?t:e,x=!0===i?1:-1;for(let t=1;t<=n;t++)c.push(0,m*x,0),u.push(0,x,0),d.push(.5,.5),p++;const b=p;for(let t=0;t<=n;t++){const e=t/n*a+o,i=Math.cos(e),r=Math.sin(e);f.x=y*r,f.y=m*x,f.z=y*i,c.push(f.x,f.y,f.z),u.push(0,x,0),s.x=.5*i+.5,s.y=.5*r*x+.5,d.push(s.x,s.y),p++}for(let t=0;t<n;t++){const e=r+t,n=b+t;!0===i?l.push(n,n+1,e):l.push(n+1,n,e),v+=3}h.addGroup(g,v,!0===i?1:2),g+=v}!function(){const s=new Ki,v=new Ki;let y=0;const x=(e-t)/i;for(let h=0;h<=r;h++){const l=[],g=h/r,y=g*(e-t)+t;for(let t=0;t<=n;t++){const e=t/n,r=e*a+o,h=Math.sin(r),f=Math.cos(r);v.x=y*h,v.y=-g*i+m,v.z=y*f,c.push(v.x,v.y,v.z),s.set(h,x,f).normalize(),u.push(s.x,s.y,s.z),d.push(e,1-g),l.push(p++)}f.push(l)}for(let t=0;t<n;t++)for(let e=0;e<r;e++){const i=f[e][t],n=f[e+1][t],r=f[e+1][t+1],s=f[e][t+1];l.push(i,n,s),l.push(n,r,s),y+=6}h.addGroup(g,y,0),g+=y}(),!1===s&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(l),this.setAttribute("position",new Ir(c,3)),this.setAttribute("normal",new Ir(u,3)),this.setAttribute("uv",new Ir(d,2))}}class Xh extends Wh{constructor(t=1,e=1,i=8,n=1,r=!1,s=0,o=2*Math.PI){super(0,t,e,i,n,r,s,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:s,thetaLength:o}}}class jh extends jr{constructor(t,e,i=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n};const r=[],s=[];function o(t,e,i,n){const r=n+1,s=[];for(let n=0;n<=r;n++){s[n]=[];const o=t.clone().lerp(i,n/r),a=e.clone().lerp(i,n/r),h=r-n;for(let t=0;t<=h;t++)s[n][t]=0===t&&n===r?o:o.clone().lerp(a,t/h)}for(let t=0;t<r;t++)for(let e=0;e<2*(r-t)-1;e++){const i=Math.floor(e/2);e%2==0?(a(s[t][i+1]),a(s[t+1][i]),a(s[t][i])):(a(s[t][i+1]),a(s[t+1][i+1]),a(s[t+1][i]))}}function a(t){r.push(t.x,t.y,t.z)}function h(e,i){const n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function l(t,e,i,n){n<0&&1===t.x&&(s[e]=t.x-1),0===i.x&&0===i.z&&(s[e]=n/2/Math.PI+.5)}function c(t){return Math.atan2(t.z,-t.x)}!function(t){const i=new Ki,n=new Ki,r=new Ki;for(let s=0;s<e.length;s+=3)h(e[s+0],i),h(e[s+1],n),h(e[s+2],r),o(i,n,r,t)}(n),function(t){const e=new Ki;for(let i=0;i<r.length;i+=3)e.x=r[i+0],e.y=r[i+1],e.z=r[i+2],e.normalize().multiplyScalar(t),r[i+0]=e.x,r[i+1]=e.y,r[i+2]=e.z}(i),function(){const t=new Ki;for(let i=0;i<r.length;i+=3){t.x=r[i+0],t.y=r[i+1],t.z=r[i+2];const n=c(t)/2/Math.PI+.5,o=(e=t,Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5);s.push(n,1-o)}var e;(function(){const t=new Ki,e=new Ki,i=new Ki,n=new Ki,o=new Ui,a=new Ui,h=new Ui;for(let u=0,d=0;u<r.length;u+=9,d+=6){t.set(r[u+0],r[u+1],r[u+2]),e.set(r[u+3],r[u+4],r[u+5]),i.set(r[u+6],r[u+7],r[u+8]),o.set(s[d+0],s[d+1]),a.set(s[d+2],s[d+3]),h.set(s[d+4],s[d+5]),n.copy(t).add(e).add(i).divideScalar(3);const p=c(n);l(o,d+0,t,p),l(a,d+2,e,p),l(h,d+4,i,p)}})(),function(){for(let t=0;t<s.length;t+=6){const e=s[t+0],i=s[t+2],n=s[t+4],r=Math.max(e,i,n),o=Math.min(e,i,n);r>.9&&o<.1&&(e<.2&&(s[t+0]+=1),i<.2&&(s[t+2]+=1),n<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new Ir(r,3)),this.setAttribute("normal",new Ir(r.slice(),3)),this.setAttribute("uv",new Ir(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}}class Yh extends jh{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2,n=1/i;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[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="DodecahedronGeometry",this.parameters={radius:t,detail:e}}}const qh=new Ki,Zh=new Ki,Kh=new Ki,Jh=new ur;class Qh extends jr{constructor(t,e){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1,!0===t.isGeometry)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const i=Math.pow(10,4),n=Math.cos(Ni.DEG2RAD*e),r=t.getIndex(),s=t.getAttribute("position"),o=r?r.count:s.count,a=[0,0,0],h=["a","b","c"],l=new Array(3),c={},u=[];for(let t=0;t<o;t+=3){r?(a[0]=r.getX(t),a[1]=r.getX(t+1),a[2]=r.getX(t+2)):(a[0]=t,a[1]=t+1,a[2]=t+2);const{a:e,b:o,c:d}=Jh;if(e.fromBufferAttribute(s,a[0]),o.fromBufferAttribute(s,a[1]),d.fromBufferAttribute(s,a[2]),Jh.getNormal(Kh),l[0]=`${Math.round(e.x*i)},${Math.round(e.y*i)},${Math.round(e.z*i)}`,l[1]=`${Math.round(o.x*i)},${Math.round(o.y*i)},${Math.round(o.z*i)}`,l[2]=`${Math.round(d.x*i)},${Math.round(d.y*i)},${Math.round(d.z*i)}`,l[0]!==l[1]&&l[1]!==l[2]&&l[2]!==l[0])for(let t=0;t<3;t++){const e=(t+1)%3,i=l[t],r=l[e],s=Jh[h[t]],o=Jh[h[e]],d=`${i}_${r}`,p=`${r}_${i}`;p in c&&c[p]?(Kh.dot(c[p].normal)<=n&&(u.push(s.x,s.y,s.z),u.push(o.x,o.y,o.z)),c[p]=null):d in c||(c[d]={index0:a[t],index1:a[e],normal:Kh.clone()})}}for(const t in c)if(c[t]){const{index0:e,index1:i}=c[t];qh.fromBufferAttribute(s,e),Zh.fromBufferAttribute(s,i),u.push(qh.x,qh.y,qh.z),u.push(Zh.x,Zh.y,Zh.z)}this.setAttribute("position",new Ir(u,3))}}const $h=function(t,e,i){i=i||2;const n=e&&e.length,r=n?e[0]*i:t.length;let s=tl(t,0,r,i,!0);const o=[];if(!s||s.next===s.prev)return o;let a,h,l,c,u,d,p;if(n&&(s=function(t,e,i,n){const r=[];let s,o,a,h,l;for(s=0,o=e.length;s<o;s++)a=e[s]*n,h=s<o-1?e[s+1]*n:t.length,l=tl(t,a,h,n,!1),l===l.next&&(l.steiner=!0),r.push(ul(l));for(r.sort(al),s=0;s<r.length;s++)hl(r[s],i),i=el(i,i.next);return i}(t,e,s,i)),t.length>80*i){a=l=t[0],h=c=t[1];for(let e=i;e<r;e+=i)u=t[e],d=t[e+1],u<a&&(a=u),d<h&&(h=d),u>l&&(l=u),d>c&&(c=d);p=Math.max(l-a,c-h),p=0!==p?1/p:0}return il(s,o,i,a,h,p),o};function tl(t,e,i,n,r){let s,o;if(r===function(t,e,i,n){let r=0;for(let s=e,o=i-n;s<i;s+=n)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}(t,e,i,n)>0)for(s=e;s<i;s+=n)o=wl(s,t[s],t[s+1],o);else for(s=i-n;s>=e;s-=n)o=wl(s,t[s],t[s+1],o);return o&&ml(o,o.next)&&(Tl(o),o=o.next),o}function el(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!ml(n,n.next)&&0!==fl(n.prev,n,n.next))n=n.next;else{if(Tl(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function il(t,e,i,n,r,s,o){if(!t)return;!o&&s&&function(t,e,i,n){let r=t;do{null===r.z&&(r.z=cl(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i,n,r,s,o,a,h,l=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e<l&&(a++,n=n.nextZ,n);e++);for(h=l;a>0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,h--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,l*=2}while(o>1)}(r)}(t,n,r,s);let a,h,l=t;for(;t.prev!==t.next;)if(a=t.prev,h=t.next,s?rl(t,n,r,s):nl(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),Tl(t),t=h.next,l=h.next;else if((t=h)===l){o?1===o?il(t=sl(el(t),e,i),e,i,n,r,s,2):2===o&&ol(t,e,i,n,r,s):il(el(t),e,i,n,r,s,1);break}}function nl(t){const e=t.prev,i=t,n=t.next;if(fl(e,i,n)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(dl(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&fl(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function rl(t,e,i,n){const r=t.prev,s=t,o=t.next;if(fl(r,s,o)>=0)return!1;const a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,h=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,l=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=cl(a,h,e,i,n),d=cl(l,c,e,i,n);let p=t.prevZ,f=t.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&dl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&fl(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&dl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&fl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&dl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&fl(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&dl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&fl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function sl(t,e,i){let n=t;do{const r=n.prev,s=n.next.next;!ml(r,s)&&gl(r,n,n.next,s)&&xl(r,s)&&xl(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),Tl(n),Tl(n.next),n=t=s),n=n.next}while(n!==t);return el(n)}function ol(t,e,i,n,r,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&pl(o,t)){let a=bl(o,t);return o=el(o,o.next),a=el(a,a.next),il(o,e,i,n,r,s),void il(a,e,i,n,r,s)}t=t.next}o=o.next}while(o!==t)}function al(t,e){return t.x-e.x}function hl(t,e){if(e=function(t,e){let i=e;const n=t.x,r=t.y;let s,o=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>o){if(o=t,t===n){if(r===i.y)return i;if(r===i.next.y)return i.next}s=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!s)return null;if(n===o)return s;const a=s,h=s.x,l=s.y;let c,u=1/0;i=s;do{n>=i.x&&i.x>=h&&n!==i.x&&dl(r<l?n:o,r,h,l,r<l?o:n,r,i.x,i.y)&&(c=Math.abs(r-i.y)/(n-i.x),xl(i,t)&&(c<u||c===u&&(i.x>s.x||i.x===s.x&&ll(s,i)))&&(s=i,u=c)),i=i.next}while(i!==a);return s}(t,e)){const i=bl(e,t);el(e,e.next),el(i,i.next)}}function ll(t,e){return fl(t.prev,t,e.prev)<0&&fl(e.next,t,t.next)<0}function cl(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ul(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function dl(t,e,i,n,r,s,o,a){return(r-o)*(e-a)-(t-o)*(s-a)>=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function pl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&gl(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(xl(t,e)&&xl(e,t)&&function(t,e){let i=t,n=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(fl(t.prev,t,e.prev)||fl(t,e.prev,e))||ml(t,e)&&fl(t.prev,t,t.next)>0&&fl(e.prev,e,e.next)>0)}function fl(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function ml(t,e){return t.x===e.x&&t.y===e.y}function gl(t,e,i,n){const r=yl(fl(t,e,i)),s=yl(fl(t,e,n)),o=yl(fl(i,n,t)),a=yl(fl(i,n,e));return r!==s&&o!==a||(!(0!==r||!vl(t,i,e))||(!(0!==s||!vl(t,n,e))||(!(0!==o||!vl(i,t,n))||!(0!==a||!vl(i,e,n)))))}function vl(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function yl(t){return t>0?1:t<0?-1:0}function xl(t,e){return fl(t.prev,t,t.next)<0?fl(t,e,t.next)>=0&&fl(t,t.prev,e)>=0:fl(t,e,t.prev)<0||fl(t,t.next,e)<0}function bl(t,e){const i=new _l(t.i,t.x,t.y),n=new _l(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function wl(t,e,i,n){const r=new _l(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Tl(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function _l(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}const El={area:function(t){const e=t.length;let i=0;for(let n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i},isClockWise:function(t){return El.area(t)<0},triangulateShape:function(t,e){const i=[],n=[],r=[];Sl(t),Ml(i,t);let s=t.length;e.forEach(Sl);for(let t=0;t<e.length;t++)n.push(s),s+=e[t].length,Ml(i,e[t]);const o=$h(i,n);for(let t=0;t<o.length;t+=3)r.push(o.slice(t,t+3));return r}};function Sl(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Ml(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}class Al extends jr{constructor(t,e){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const i=this,n=[],r=[];for(let e=0,i=t.length;e<i;e++){s(t[e])}function s(t){const s=[],o=void 0!==e.curveSegments?e.curveSegments:12,a=void 0!==e.steps?e.steps:1;let h=void 0!==e.depth?e.depth:100,l=void 0===e.bevelEnabled||e.bevelEnabled,c=void 0!==e.bevelThickness?e.bevelThickness:6,u=void 0!==e.bevelSize?e.bevelSize:c-2,d=void 0!==e.bevelOffset?e.bevelOffset:0,p=void 0!==e.bevelSegments?e.bevelSegments:3;const f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:Cl;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=e.amount);let g,v,y,x,b,w=!1;f&&(g=f.getSpacedPoints(a),w=!0,l=!1,v=f.computeFrenetFrames(a,!1),y=new Ki,x=new Ki,b=new Ki),l||(p=0,c=0,u=0,d=0);const T=t.extractPoints(o);let _=T.shape;const E=T.holes;if(!El.isClockWise(_)){_=_.reverse();for(let t=0,e=E.length;t<e;t++){const e=E[t];El.isClockWise(e)&&(E[t]=e.reverse())}}const S=El.triangulateShape(_,E),M=_;for(let t=0,e=E.length;t<e;t++){const e=E[t];_=_.concat(e)}function A(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}const C=_.length,P=S.length;function R(t,e,i){let n,r,s;const o=t.x-e.x,a=t.y-e.y,h=i.x-t.x,l=i.y-t.y,c=o*o+a*a,u=o*l-a*h;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(c),d=Math.sqrt(h*h+l*l),p=e.x-a/u,f=e.y+o/u,m=((i.x-l/d-p)*l-(i.y+h/d-f)*h)/(o*l-a*h);n=p+o*m-t.x,r=f+a*m-t.y;const g=n*n+r*r;if(g<=2)return new Ui(n,r);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?h>Number.EPSILON&&(t=!0):o<-Number.EPSILON?h<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(l)&&(t=!0),t?(n=-a,r=o,s=Math.sqrt(c)):(n=o,r=a,s=Math.sqrt(c/2))}return new Ui(n/s,r/s)}const L=[];for(let t=0,e=M.length,i=e-1,n=t+1;t<e;t++,i++,n++)i===e&&(i=0),n===e&&(n=0),L[t]=R(M[t],M[i],M[n]);const O=[];let D,I=L.concat();for(let t=0,e=E.length;t<e;t++){const e=E[t];D=[];for(let t=0,i=e.length,n=i-1,r=t+1;t<i;t++,n++,r++)n===i&&(n=0),r===i&&(r=0),D[t]=R(e[t],e[n],e[r]);O.push(D),I=I.concat(D)}for(let t=0;t<p;t++){const e=t/p,i=c*Math.cos(e*Math.PI/2),n=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=M.length;t<e;t++){const e=A(M[t],L[t],n);k(e.x,e.y,-i)}for(let t=0,e=E.length;t<e;t++){const e=E[t];D=O[t];for(let t=0,r=e.length;t<r;t++){const r=A(e[t],D[t],n);k(r.x,r.y,-i)}}}const F=u+d;for(let t=0;t<C;t++){const e=l?A(_[t],I[t],F):_[t];w?(x.copy(v.normals[0]).multiplyScalar(e.x),y.copy(v.binormals[0]).multiplyScalar(e.y),b.copy(g[0]).add(x).add(y),k(b.x,b.y,b.z)):k(e.x,e.y,0)}for(let t=1;t<=a;t++)for(let e=0;e<C;e++){const i=l?A(_[e],I[e],F):_[e];w?(x.copy(v.normals[t]).multiplyScalar(i.x),y.copy(v.binormals[t]).multiplyScalar(i.y),b.copy(g[t]).add(x).add(y),k(b.x,b.y,b.z)):k(i.x,i.y,h/a*t)}for(let t=p-1;t>=0;t--){const e=t/p,i=c*Math.cos(e*Math.PI/2),n=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=M.length;t<e;t++){const e=A(M[t],L[t],n);k(e.x,e.y,h+i)}for(let t=0,e=E.length;t<e;t++){const e=E[t];D=O[t];for(let t=0,r=e.length;t<r;t++){const r=A(e[t],D[t],n);w?k(r.x,r.y+g[a-1].y,g[a-1].x+i):k(r.x,r.y,h+i)}}}function B(t,e){let i=t.length;for(;--i>=0;){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*p;t<i;t++){const i=C*t,s=C*(t+1);U(e+n+i,e+r+i,e+r+s,e+n+s)}}}function k(t,e,i){s.push(t),s.push(e),s.push(i)}function N(t,e,r){z(t),z(e),z(r);const s=n.length/3,o=m.generateTopUV(i,n,s-3,s-2,s-1);G(o[0]),G(o[1]),G(o[2])}function U(t,e,r,s){z(t),z(e),z(s),z(e),z(r),z(s);const o=n.length/3,a=m.generateSideWallUV(i,n,o-6,o-3,o-2,o-1);G(a[0]),G(a[1]),G(a[3]),G(a[1]),G(a[2]),G(a[3])}function z(t){n.push(s[3*t+0]),n.push(s[3*t+1]),n.push(s[3*t+2])}function G(t){r.push(t.x),r.push(t.y)}!function(){const t=n.length/3;if(l){let t=0,e=C*t;for(let t=0;t<P;t++){const i=S[t];N(i[2]+e,i[1]+e,i[0]+e)}t=a+2*p,e=C*t;for(let t=0;t<P;t++){const i=S[t];N(i[0]+e,i[1]+e,i[2]+e)}}else{for(let t=0;t<P;t++){const e=S[t];N(e[2],e[1],e[0])}for(let t=0;t<P;t++){const e=S[t];N(e[0]+C*a,e[1]+C*a,e[2]+C*a)}}i.addGroup(t,n.length/3-t,0)}(),function(){const t=n.length/3;let e=0;B(M,e),e+=M.length;for(let t=0,i=E.length;t<i;t++){const i=E[t];B(i,e),e+=i.length}i.addGroup(t,n.length/3-t,1)}()}this.setAttribute("position",new Ir(n,3)),this.setAttribute("uv",new Ir(r,2)),this.computeVertexNormals()}toJSON(){const t=jr.prototype.toJSON.call(this);return function(t,e,i){if(i.shapes=[],Array.isArray(t))for(let e=0,n=t.length;e<n;e++){const n=t[e];i.shapes.push(n.uuid)}else i.shapes.push(t.uuid);void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON());return i}(this.parameters.shapes,this.parameters.options,t)}}const Cl={generateTopUV:function(t,e,i,n,r){const s=e[3*i],o=e[3*i+1],a=e[3*n],h=e[3*n+1],l=e[3*r],c=e[3*r+1];return[new Ui(s,o),new Ui(a,h),new Ui(l,c)]},generateSideWallUV:function(t,e,i,n,r,s){const o=e[3*i],a=e[3*i+1],h=e[3*i+2],l=e[3*n],c=e[3*n+1],u=e[3*n+2],d=e[3*r],p=e[3*r+1],f=e[3*r+2],m=e[3*s],g=e[3*s+1],v=e[3*s+2];return Math.abs(a-c)<.01?[new Ui(o,1-h),new Ui(l,1-u),new Ui(d,1-f),new Ui(m,1-v)]:[new Ui(a,1-h),new Ui(c,1-u),new Ui(p,1-f),new Ui(g,1-v)]}};class Pl extends jh{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}}class Rl extends jr{constructor(t,e=12,i=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},e=Math.floor(e),n=Ni.clamp(n,0,2*Math.PI);const r=[],s=[],o=[],a=1/e,h=new Ki,l=new Ui;for(let r=0;r<=e;r++){const c=i+r*a*n,u=Math.sin(c),d=Math.cos(c);for(let i=0;i<=t.length-1;i++)h.x=t[i].x*u,h.y=t[i].y,h.z=t[i].x*d,s.push(h.x,h.y,h.z),l.x=r/e,l.y=i/(t.length-1),o.push(l.x,l.y)}for(let i=0;i<e;i++)for(let e=0;e<t.length-1;e++){const n=e+i*t.length,s=n,o=n+t.length,a=n+t.length+1,h=n+1;r.push(s,o,h),r.push(o,a,h)}if(this.setIndex(r),this.setAttribute("position",new Ir(s,3)),this.setAttribute("uv",new Ir(o,2)),this.computeVertexNormals(),n===2*Math.PI){const i=this.attributes.normal.array,n=new Ki,r=new Ki,s=new Ki,o=e*t.length*3;for(let e=0,a=0;e<t.length;e++,a+=3)n.x=i[a+0],n.y=i[a+1],n.z=i[a+2],r.x=i[o+a+0],r.y=i[o+a+1],r.z=i[o+a+2],s.addVectors(n,r).normalize(),i[a+0]=i[o+a+0]=s.x,i[a+1]=i[o+a+1]=s.y,i[a+2]=i[o+a+2]=s.z}}}class Ll extends jh{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}}function Ol(t,e,i){jr.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i};const n=[],r=[],s=[],o=[],a=1e-5,h=new Ki,l=new Ki,c=new Ki,u=new Ki,d=new Ki;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const p=e+1;for(let n=0;n<=i;n++){const p=n/i;for(let i=0;i<=e;i++){const n=i/e;t(n,p,l),r.push(l.x,l.y,l.z),n-a>=0?(t(n-a,p,c),u.subVectors(l,c)):(t(n+a,p,c),u.subVectors(c,l)),p-a>=0?(t(n,p-a,c),d.subVectors(l,c)):(t(n,p+a,c),d.subVectors(c,l)),h.crossVectors(u,d).normalize(),s.push(h.x,h.y,h.z),o.push(n,p)}}for(let t=0;t<i;t++)for(let i=0;i<e;i++){const e=t*p+i,r=t*p+i+1,s=(t+1)*p+i+1,o=(t+1)*p+i;n.push(e,r,o),n.push(r,s,o)}this.setIndex(n),this.setAttribute("position",new Ir(r,3)),this.setAttribute("normal",new Ir(s,3)),this.setAttribute("uv",new Ir(o,2))}Ol.prototype=Object.create(jr.prototype),Ol.prototype.constructor=Ol;class Dl extends jr{constructor(t=.5,e=1,i=8,n=1,r=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:s},i=Math.max(3,i);const o=[],a=[],h=[],l=[];let c=t;const u=(e-t)/(n=Math.max(1,n)),d=new Ki,p=new Ui;for(let t=0;t<=n;t++){for(let t=0;t<=i;t++){const n=r+t/i*s;d.x=c*Math.cos(n),d.y=c*Math.sin(n),a.push(d.x,d.y,d.z),h.push(0,0,1),p.x=(d.x/e+1)/2,p.y=(d.y/e+1)/2,l.push(p.x,p.y)}c+=u}for(let t=0;t<n;t++){const e=t*(i+1);for(let t=0;t<i;t++){const n=t+e,r=n,s=n+i+1,a=n+i+2,h=n+1;o.push(r,s,h),o.push(s,a,h)}}this.setIndex(o),this.setAttribute("position",new Ir(a,3)),this.setAttribute("normal",new Ir(h,3)),this.setAttribute("uv",new Ir(l,2))}}class Il extends jr{constructor(t,e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const i=[],n=[],r=[],s=[];let o=0,a=0;if(!1===Array.isArray(t))h(t);else for(let e=0;e<t.length;e++)h(t[e]),this.addGroup(o,a,e),o+=a,a=0;function h(t){const o=n.length/3,h=t.extractPoints(e);let l=h.shape;const c=h.holes;!1===El.isClockWise(l)&&(l=l.reverse());for(let t=0,e=c.length;t<e;t++){const e=c[t];!0===El.isClockWise(e)&&(c[t]=e.reverse())}const u=El.triangulateShape(l,c);for(let t=0,e=c.length;t<e;t++){const e=c[t];l=l.concat(e)}for(let t=0,e=l.length;t<e;t++){const e=l[t];n.push(e.x,e.y,0),r.push(0,0,1),s.push(e.x,e.y)}for(let t=0,e=u.length;t<e;t++){const e=u[t],n=e[0]+o,r=e[1]+o,s=e[2]+o;i.push(n,r,s),a+=3}}this.setIndex(i),this.setAttribute("position",new Ir(n,3)),this.setAttribute("normal",new Ir(r,3)),this.setAttribute("uv",new Ir(s,2))}toJSON(){const t=jr.prototype.toJSON.call(this);return function(t,e){if(e.shapes=[],Array.isArray(t))for(let i=0,n=t.length;i<n;i++){const n=t[i];e.shapes.push(n.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}}class Fl extends jr{constructor(t=1,e=8,i=6,n=0,r=2*Math.PI,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:s,thetaLength:o},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const a=Math.min(s+o,Math.PI);let h=0;const l=[],c=new Ki,u=new Ki,d=[],p=[],f=[],m=[];for(let d=0;d<=i;d++){const g=[],v=d/i;let y=0;0==d&&0==s?y=.5/e:d==i&&a==Math.PI&&(y=-.5/e);for(let i=0;i<=e;i++){const a=i/e;c.x=-t*Math.cos(n+a*r)*Math.sin(s+v*o),c.y=t*Math.cos(s+v*o),c.z=t*Math.sin(n+a*r)*Math.sin(s+v*o),p.push(c.x,c.y,c.z),u.copy(c).normalize(),f.push(u.x,u.y,u.z),m.push(a+y,1-v),g.push(h++)}l.push(g)}for(let t=0;t<i;t++)for(let n=0;n<e;n++){const e=l[t][n+1],r=l[t][n],o=l[t+1][n],h=l[t+1][n+1];(0!==t||s>0)&&d.push(e,r,h),(t!==i-1||a<Math.PI)&&d.push(r,o,h)}this.setIndex(d),this.setAttribute("position",new Ir(p,3)),this.setAttribute("normal",new Ir(f,3)),this.setAttribute("uv",new Ir(m,2))}}class Bl extends jh{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}}class kl extends Al{constructor(t,e={}){const i=e.font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new jr;const n=i.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),super(n,e),this.type="TextGeometry"}}class Nl extends jr{constructor(t=1,e=.4,i=8,n=6,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},i=Math.floor(i),n=Math.floor(n);const s=[],o=[],a=[],h=[],l=new Ki,c=new Ki,u=new Ki;for(let s=0;s<=i;s++)for(let d=0;d<=n;d++){const p=d/n*r,f=s/i*Math.PI*2;c.x=(t+e*Math.cos(f))*Math.cos(p),c.y=(t+e*Math.cos(f))*Math.sin(p),c.z=e*Math.sin(f),o.push(c.x,c.y,c.z),l.x=t*Math.cos(p),l.y=t*Math.sin(p),u.subVectors(c,l).normalize(),a.push(u.x,u.y,u.z),h.push(d/n),h.push(s/i)}for(let t=1;t<=i;t++)for(let e=1;e<=n;e++){const i=(n+1)*t+e-1,r=(n+1)*(t-1)+e-1,o=(n+1)*(t-1)+e,a=(n+1)*t+e;s.push(i,r,a),s.push(r,o,a)}this.setIndex(s),this.setAttribute("position",new Ir(o,3)),this.setAttribute("normal",new Ir(a,3)),this.setAttribute("uv",new Ir(h,2))}}class Ul extends jr{constructor(t=1,e=.4,i=64,n=8,r=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:s},i=Math.floor(i),n=Math.floor(n);const o=[],a=[],h=[],l=[],c=new Ki,u=new Ki,d=new Ki,p=new Ki,f=new Ki,m=new Ki,g=new Ki;for(let o=0;o<=i;++o){const y=o/i*r*Math.PI*2;v(y,r,s,t,d),v(y+.01,r,s,t,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let t=0;t<=n;++t){const r=t/n*Math.PI*2,s=-e*Math.cos(r),p=e*Math.sin(r);c.x=d.x+(s*g.x+p*f.x),c.y=d.y+(s*g.y+p*f.y),c.z=d.z+(s*g.z+p*f.z),a.push(c.x,c.y,c.z),u.subVectors(c,d).normalize(),h.push(u.x,u.y,u.z),l.push(o/i),l.push(t/n)}}for(let t=1;t<=i;t++)for(let e=1;e<=n;e++){const i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),s=(n+1)*t+e,a=(n+1)*(t-1)+e;o.push(i,r,a),o.push(r,s,a)}function v(t,e,i,n,r){const s=Math.cos(t),o=Math.sin(t),a=i/e*t,h=Math.cos(a);r.x=n*(2+h)*.5*s,r.y=n*(2+h)*o*.5,r.z=n*Math.sin(a)*.5}this.setIndex(o),this.setAttribute("position",new Ir(a,3)),this.setAttribute("normal",new Ir(h,3)),this.setAttribute("uv",new Ir(l,2))}}class zl extends jr{constructor(t,e=64,i=1,n=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r};const s=t.computeFrenetFrames(e,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new Ki,a=new Ki,h=new Ui;let l=new Ki;const c=[],u=[],d=[],p=[];function f(r){l=t.getPointAt(r/e,l);const h=s.normals[r],d=s.binormals[r];for(let t=0;t<=n;t++){const e=t/n*Math.PI*2,r=Math.sin(e),s=-Math.cos(e);a.x=s*h.x+r*d.x,a.y=s*h.y+r*d.y,a.z=s*h.z+r*d.z,a.normalize(),u.push(a.x,a.y,a.z),o.x=l.x+i*a.x,o.y=l.y+i*a.y,o.z=l.z+i*a.z,c.push(o.x,o.y,o.z)}}!function(){for(let t=0;t<e;t++)f(t);f(!1===r?e:0),function(){for(let t=0;t<=e;t++)for(let i=0;i<=n;i++)h.x=t/e,h.y=i/n,d.push(h.x,h.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=n;e++){const i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),s=(n+1)*t+e,o=(n+1)*(t-1)+e;p.push(i,r,o),p.push(r,s,o)}}()}(),this.setIndex(p),this.setAttribute("position",new Ir(c,3)),this.setAttribute("normal",new Ir(u,3)),this.setAttribute("uv",new Ir(d,2))}toJSON(){const t=jr.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t}}class Gl extends jr{constructor(t){if(super(),this.type="WireframeGeometry",!0===t.isGeometry)return void console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const e=[],i=[0,0],n={},r=new Ki;if(null!==t.index){const s=t.attributes.position,o=t.index;let a=t.groups;0===a.length&&(a=[{start:0,count:o.count,materialIndex:0}]);for(let t=0,e=a.length;t<e;++t){const e=a[t],r=e.start;for(let t=r,s=r+e.count;t<s;t+=3)for(let e=0;e<3;e++){const r=o.getX(t+e),s=o.getX(t+(e+1)%3);i[0]=Math.min(r,s),i[1]=Math.max(r,s);const a=i[0]+","+i[1];void 0===n[a]&&(n[a]={index1:i[0],index2:i[1]})}}for(const t in n){const i=n[t];r.fromBufferAttribute(s,i.index1),e.push(r.x,r.y,r.z),r.fromBufferAttribute(s,i.index2),e.push(r.x,r.y,r.z)}}else{const i=t.attributes.position;for(let t=0,n=i.count/3;t<n;t++)for(let n=0;n<3;n++){const s=3*t+n;r.fromBufferAttribute(i,s),e.push(r.x,r.y,r.z);const o=3*t+(n+1)%3;r.fromBufferAttribute(i,o),e.push(r.x,r.y,r.z)}}this.setAttribute("position",new Ir(e,3))}}var Vl=Object.freeze({__proto__:null,BoxGeometry:ds,BoxBufferGeometry:ds,CircleGeometry:Hh,CircleBufferGeometry:Hh,ConeGeometry:Xh,ConeBufferGeometry:Xh,CylinderGeometry:Wh,CylinderBufferGeometry:Wh,DodecahedronGeometry:Yh,DodecahedronBufferGeometry:Yh,EdgesGeometry:Qh,ExtrudeGeometry:Al,ExtrudeBufferGeometry:Al,IcosahedronGeometry:Pl,IcosahedronBufferGeometry:Pl,LatheGeometry:Rl,LatheBufferGeometry:Rl,OctahedronGeometry:Ll,OctahedronBufferGeometry:Ll,ParametricGeometry:Ol,ParametricBufferGeometry:Ol,PlaneGeometry:Cs,PlaneBufferGeometry:Cs,PolyhedronGeometry:jh,PolyhedronBufferGeometry:jh,RingGeometry:Dl,RingBufferGeometry:Dl,ShapeGeometry:Il,ShapeBufferGeometry:Il,SphereGeometry:Fl,SphereBufferGeometry:Fl,TetrahedronGeometry:Bl,TetrahedronBufferGeometry:Bl,TextGeometry:kl,TextBufferGeometry:kl,TorusGeometry:Nl,TorusBufferGeometry:Nl,TorusKnotGeometry:Ul,TorusKnotBufferGeometry:Ul,TubeGeometry:zl,TubeBufferGeometry:zl,WireframeGeometry:Gl});function Hl(t){wr.call(this),this.type="ShadowMaterial",this.color=new yr(0),this.transparent=!0,this.setValues(t)}function Wl(t){gs.call(this,t),this.type="RawShaderMaterial"}function Xl(t){wr.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new yr(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new yr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Ui(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function jl(t){Xl.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ui(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=Ni.clamp(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.setValues(t)}function Yl(t){wr.call(this),this.type="MeshPhongMaterial",this.color=new yr(16777215),this.specular=new yr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new yr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Ui(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Z,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ql(t){wr.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new yr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new yr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Ui(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Zl(t){wr.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Ui(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Kl(t){wr.call(this),this.type="MeshLambertMaterial",this.color=new yr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new yr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Z,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Jl(t){wr.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new yr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=oi,this.normalScale=new Ui(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ql(t){wh.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Hl.prototype=Object.create(wr.prototype),Hl.prototype.constructor=Hl,Hl.prototype.isShadowMaterial=!0,Hl.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.color.copy(t.color),this},Wl.prototype=Object.create(gs.prototype),Wl.prototype.constructor=Wl,Wl.prototype.isRawShaderMaterial=!0,Xl.prototype=Object.create(wr.prototype),Xl.prototype.constructor=Xl,Xl.prototype.isMeshStandardMaterial=!0,Xl.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},jl.prototype=Object.create(Xl.prototype),jl.prototype.constructor=jl,jl.prototype.isMeshPhysicalMaterial=!0,jl.prototype.copy=function(t){return Xl.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new yr).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this},Yl.prototype=Object.create(wr.prototype),Yl.prototype.constructor=Yl,Yl.prototype.isMeshPhongMaterial=!0,Yl.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},ql.prototype=Object.create(wr.prototype),ql.prototype.constructor=ql,ql.prototype.isMeshToonMaterial=!0,ql.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Zl.prototype=Object.create(wr.prototype),Zl.prototype.constructor=Zl,Zl.prototype.isMeshNormalMaterial=!0,Zl.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Kl.prototype=Object.create(wr.prototype),Kl.prototype.constructor=Kl,Kl.prototype.isMeshLambertMaterial=!0,Kl.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Jl.prototype=Object.create(wr.prototype),Jl.prototype.constructor=Jl,Jl.prototype.isMeshMatcapMaterial=!0,Jl.prototype.copy=function(t){return wr.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ql.prototype=Object.create(wh.prototype),Ql.prototype.constructor=Ql,Ql.prototype.isLineDashedMaterial=!0,Ql.prototype.copy=function(t){return wh.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var $l=Object.freeze({__proto__:null,ShadowMaterial:Hl,SpriteMaterial:Ga,RawShaderMaterial:Wl,ShaderMaterial:gs,PointsMaterial:Oh,MeshPhysicalMaterial:jl,MeshStandardMaterial:Xl,MeshPhongMaterial:Yl,MeshToonMaterial:ql,MeshNormalMaterial:Zl,MeshLambertMaterial:Kl,MeshDepthMaterial:Ta,MeshDistanceMaterial:_a,MeshBasicMaterial:Tr,MeshMatcapMaterial:Jl,LineDashedMaterial:Ql,LineBasicMaterial:wh,Material:wr});const tc={arraySlice:function(t,e,i){return tc.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&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){const e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort((function(e,i){return t[e]-t[i]})),i},sortedArray:function(t,e,i){const n=t.length,r=new t.constructor(n);for(let s=0,o=0;o!==n;++s){const n=i[s]*e;for(let i=0;i!==e;++i)r[o++]=t[n+i]}return r},flattenJSON:function(t,e,i,n){let r=1,s=t[0];for(;void 0!==s&&void 0===s[n];)s=t[r++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(e.push(s.time),i.push.apply(i,o)),s=t[r++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(e.push(s.time),o.toArray(i,i.length)),s=t[r++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(e.push(s.time),i.push(o)),s=t[r++]}while(void 0!==s)},subclip:function(t,e,i,n,r=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t<s.tracks.length;++t){const e=s.tracks[t],a=e.getValueSize(),h=[],l=[];for(let t=0;t<e.times.length;++t){const s=e.times[t]*r;if(!(s<i||s>=n)){h.push(e.times[t]);for(let i=0;i<a;++i)l.push(e.values[t*a+i])}}0!==h.length&&(e.times=tc.convertArray(h,e.times.constructor),e.values=tc.convertArray(l,e.values.constructor),o.push(e))}s.tracks=o;let a=1/0;for(let t=0;t<s.tracks.length;++t)a>s.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t<s.tracks.length;++t)s.tracks[t].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(t,e=0,i=t,n=30){n<=0&&(n=30);const r=i.tracks.length,s=e/n;for(let e=0;e<r;++e){const n=i.tracks[e],r=n.ValueTypeName;if("bool"===r||"string"===r)continue;const o=t.tracks.find((function(t){return t.name===n.name&&t.ValueTypeName===r}));if(void 0===o)continue;let a=0;const h=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=h/3);let l=0;const c=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=c/3);const u=n.times.length-1;let d;if(s<=n.times[0]){const t=a,e=h-a;d=tc.arraySlice(n.values,t,e)}else if(s>=n.times[u]){const t=u*h+a,e=t+h-a;d=tc.arraySlice(n.values,t,e)}else{const t=n.createInterpolant(),e=a,i=h-a;t.evaluate(s),d=tc.arraySlice(t.resultBuffer,e,i)}if("quaternion"===r){(new Zi).fromArray(d).normalize().conjugate().toArray(d)}const p=o.times.length;for(let t=0;t<p;++t){const e=t*c+l;if("quaternion"===r)Zi.multiplyQuaternionsFlat(o.values,e,d,0,o.values,e);else{const t=c-2*l;for(let i=0;i<t;++i)o.values[e+i]-=d[i]}}}return t.blendMode=je,t}};function ec(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i}function ic(t,e,i,n){ec.call(this,t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function nc(t,e,i,n){ec.call(this,t,e,i,n)}function rc(t,e,i,n){ec.call(this,t,e,i,n)}function sc(t,e,i,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=tc.convertArray(e,this.TimeBufferType),this.values=tc.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}function oc(t,e,i){sc.call(this,t,e,i)}function ac(t,e,i,n){sc.call(this,t,e,i,n)}function hc(t,e,i,n){sc.call(this,t,e,i,n)}function lc(t,e,i,n){ec.call(this,t,e,i,n)}function cc(t,e,i,n){sc.call(this,t,e,i,n)}function uc(t,e,i,n){sc.call(this,t,e,i,n)}function dc(t,e,i,n){sc.call(this,t,e,i,n)}function pc(t,e=-1,i,n=Xe){this.name=t,this.tracks=i,this.duration=e,this.blendMode=n,this.uuid=Ni.generateUUID(),this.duration<0&&this.resetDuration()}function fc(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return hc;case"vector":case"vector2":case"vector3":case"vector4":return dc;case"color":return ac;case"quaternion":return cc;case"bool":case"boolean":return oc;case"string":return uc}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],i=[];tc.flattenJSON(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(ec.prototype,{evaluate:function(t){const e=this.parameterPositions;let i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{let s;i:{n:if(!(t<n)){for(let s=i+2;;){if(void 0===n){if(t<r)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,r)}if(i===s)break;if(r=n,n=e[++i],t<n)break e}s=e.length;break i}if(t>=r)break t;{const o=e[1];t<o&&(i=2,r=o);for(let s=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===s)break;if(n=r,r=e[--i-1],t>=r)break e}s=i,i=0}}for(;i<s;){const n=i+s>>>1;t<e[n]?s=n:i=n+1}if(n=e[i],r=e[i-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,r,t)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n;for(let t=0;t!==n;++t)e[t]=i[r+t];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(ec.prototype,{beforeStart_:ec.prototype.copySampleValue_,afterEnd_:ec.prototype.copySampleValue_}),ic.prototype=Object.assign(Object.create(ec.prototype),{constructor:ic,DefaultSettings_:{endingStart:Ve,endingEnd:Ve},intervalChanged_:function(t,e,i){const n=this.parameterPositions;let r=t-2,s=t+1,o=n[r],a=n[s];if(void 0===o)switch(this.getSettings_().endingStart){case He:r=t,o=2*e-i;break;case We:r=n.length-2,o=e+n[r]-n[r+1];break;default:r=t,o=i}if(void 0===a)switch(this.getSettings_().endingEnd){case He:s=t,a=2*i-e;break;case We:s=1,a=i+n[1]-n[0];break;default:s=t-1,a=e}const h=.5*(i-e),l=this.valueSize;this._weightPrev=h/(e-o),this._weightNext=h/(a-i),this._offsetPrev=r*l,this._offsetNext=s*l},interpolate_:function(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=t*o,h=a-o,l=this._offsetPrev,c=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let t=0;t!==o;++t)r[t]=g*s[l+t]+v*s[h+t]+y*s[a+t]+x*s[c+t];return r}}),nc.prototype=Object.assign(Object.create(ec.prototype),{constructor:nc,interpolate_:function(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=t*o,h=a-o,l=(i-e)/(n-e),c=1-l;for(let t=0;t!==o;++t)r[t]=s[h+t]*c+s[a+t]*l;return r}}),rc.prototype=Object.assign(Object.create(ec.prototype),{constructor:rc,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(sc,{toJSON:function(t){const e=t.constructor;let i;if(void 0!==e.toJSON)i=e.toJSON(t);else{i={name:t.name,times:tc.convertArray(t.times,Array),values:tc.convertArray(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}}),Object.assign(sc.prototype,{constructor:sc,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ze,InterpolantFactoryMethodDiscrete:function(t){return new rc(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new nc(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new ic(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){let e;switch(t){case Ue:e=this.InterpolantFactoryMethodDiscrete;break;case ze:e=this.InterpolantFactoryMethodLinear;break;case Ge:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Ue;case this.InterpolantFactoryMethodLinear:return ze;case this.InterpolantFactoryMethodSmooth:return Ge}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this},scale:function(t){if(1!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this},trim:function(t,e){const i=this.times,n=i.length;let r=0,s=n-1;for(;r!==n&&i[r]<t;)++r;for(;-1!==s&&i[s]>e;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=tc.arraySlice(i,r,s),this.values=tc.arraySlice(this.values,r*t,s*t)}return this},validate:function(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==n&&tc.isTypedArray(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t},optimize:function(){const t=tc.arraySlice(this.times),e=tc.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===Ge,r=t.length-1;let s=1;for(let o=1;o<r;++o){let r=!1;const a=t[o];if(a!==t[o+1]&&(1!==o||a!==t[0]))if(n)r=!0;else{const t=o*i,n=t-i,s=t+i;for(let o=0;o!==i;++o){const i=e[t+o];if(i!==e[n+o]||i!==e[s+o]){r=!0;break}}}if(r){if(o!==s){t[s]=t[o];const n=o*i,r=s*i;for(let t=0;t!==i;++t)e[r+t]=e[n+t]}++s}}if(r>0){t[s]=t[r];for(let t=r*i,n=s*i,o=0;o!==i;++o)e[n+o]=e[t+o];++s}return s!==t.length?(this.times=tc.arraySlice(t,0,s),this.values=tc.arraySlice(e,0,s*i)):(this.times=t,this.values=e),this},clone:function(){const t=tc.arraySlice(this.times,0),e=tc.arraySlice(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}),oc.prototype=Object.assign(Object.create(sc.prototype),{constructor:oc,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Ue,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ac.prototype=Object.assign(Object.create(sc.prototype),{constructor:ac,ValueTypeName:"color"}),hc.prototype=Object.assign(Object.create(sc.prototype),{constructor:hc,ValueTypeName:"number"}),lc.prototype=Object.assign(Object.create(ec.prototype),{constructor:lc,interpolate_:function(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(i-e)/(n-e);let h=t*o;for(let t=h+o;h!==t;h+=4)Zi.slerpFlat(r,0,s,h-o,s,h,a);return r}}),cc.prototype=Object.assign(Object.create(sc.prototype),{constructor:cc,ValueTypeName:"quaternion",DefaultInterpolation:ze,InterpolantFactoryMethodLinear:function(t){return new lc(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),uc.prototype=Object.assign(Object.create(sc.prototype),{constructor:uc,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Ue,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),dc.prototype=Object.assign(Object.create(sc.prototype),{constructor:dc,ValueTypeName:"vector"}),Object.assign(pc,{parse:function(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(fc(i[t]).scale(n));const r=new pc(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r},toJSON:function(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(sc.toJSON(i[t]));return n},CreateFromMorphTargetSequence:function(t,e,i,n){const r=e.length,s=[];for(let t=0;t<r;t++){let o=[],a=[];o.push((t+r-1)%r,t,(t+1)%r),a.push(0,1,0);const h=tc.getKeyframeOrder(o);o=tc.sortedArray(o,1,h),a=tc.sortedArray(a,1,h),n||0!==o[0]||(o.push(r),a.push(a[0])),s.push(new hc(".morphTargetInfluences["+e[t].name+"]",o,a).scale(1/i))}return new pc(t,-1,s)},findByName:function(t,e){let i=t;if(!Array.isArray(t)){const e=t;i=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null},CreateClipsFromMorphTargetSequences:function(t,e,i){const n={},r=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){const i=t[e],s=i.name.match(r);if(s&&s.length>1){const t=s[1];let e=n[t];e||(n[t]=e=[]),e.push(i)}}const s=[];for(const t in n)s.push(pc.CreateFromMorphTargetSequence(t,n[t],e,i));return s},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const s=[],o=[];tc.flattenJSON(i,s,o,n),0!==s.length&&r.push(new t(e,s,o))}},n=[],r=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const h=t.hierarchy||[];for(let t=0;t<h.length;t++){const r=h[t].keys;if(r&&0!==r.length)if(r[0].morphTargets){const t={};let e;for(e=0;e<r.length;e++)if(r[e].morphTargets)for(let i=0;i<r[e].morphTargets.length;i++)t[r[e].morphTargets[i]]=-1;for(const i in t){const t=[],s=[];for(let n=0;n!==r[e].morphTargets.length;++n){const n=r[e];t.push(n.time),s.push(n.morphTarget===i?1:0)}n.push(new hc(".morphTargetInfluence["+i+"]",t,s))}a=t.length*(s||1)}else{const s=".bones["+e[t].name+"]";i(dc,s+".position",r,"pos",n),i(cc,s+".quaternion",r,"rot",n),i(dc,s+".scale",r,"scl",n)}}if(0===n.length)return null;return new pc(r,a,n,o)}}),Object.assign(pc.prototype,{resetDuration:function(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){const i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this},trim:function(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new pc(this.name,this.duration,t,this.blendMode)},toJSON:function(){return pc.toJSON(this)}});const mc={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function gc(t,e,i){const n=this;let r=!1,s=0,o=0,a=void 0;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,!1===r&&void 0!==n.onStart&&n.onStart(t,s,o),r=!0},this.itemEnd=function(t){s++,void 0!==n.onProgress&&n.onProgress(t,s,o),s===o&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return a?a(t):t},this.setURLModifier=function(t){return a=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){const e=h.indexOf(t);return-1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=h.length;e<i;e+=2){const i=h[e],n=h[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}}const vc=new gc;function yc(t){this.manager=void 0!==t?t:vc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(yc.prototype,{load:function(){},loadAsync:function(t,e){const i=this;return new Promise((function(n,r){i.load(t,n,e,r)}))},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});const xc={};function bc(t){yc.call(this,t)}function wc(t){yc.call(this,t)}function Tc(t){yc.call(this,t)}function _c(t){yc.call(this,t)}function Ec(t){yc.call(this,t)}function Sc(t){yc.call(this,t)}function Mc(t){yc.call(this,t)}function Ac(){this.type="Curve",this.arcLengthDivisions=200}function Cc(t,e,i,n,r,s,o,a){Ac.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=i||1,this.yRadius=n||1,this.aStartAngle=r||0,this.aEndAngle=s||2*Math.PI,this.aClockwise=o||!1,this.aRotation=a||0}function Pc(t,e,i,n,r,s){Cc.call(this,t,e,i,i,n,r,s),this.type="ArcCurve"}function Rc(){let t=0,e=0,i=0,n=0;function r(r,s,o,a){t=r,e=o,i=-3*r+3*s-2*o-a,n=2*r-2*s+o+a}return{initCatmullRom:function(t,e,i,n,s){r(e,i,s*(i-t),s*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,s,o,a){let h=(e-t)/s-(i-t)/(s+o)+(i-e)/o,l=(i-e)/o-(n-e)/(o+a)+(n-i)/a;h*=o,l*=o,r(e,i,h,l)},calc:function(r){const s=r*r;return t+e*r+i*s+n*(s*r)}}}bc.prototype=Object.assign(Object.create(yc.prototype),{constructor:bc,load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=mc.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;if(void 0!==xc[t])return void xc[t].push({onLoad:e,onProgress:i,onError:n});const o=t.match(/^data:(.*?)(;base64)?,(.*)$/);let a;if(o){const i=o[1],s=!!o[2];let a=o[3];a=decodeURIComponent(a),s&&(a=atob(a));try{let n;const s=(this.responseType||"").toLowerCase();switch(s){case"arraybuffer":case"blob":const t=new Uint8Array(a.length);for(let e=0;e<a.length;e++)t[e]=a.charCodeAt(e);n="blob"===s?new Blob([t.buffer],{type:i}):t.buffer;break;case"document":const e=new DOMParser;n=e.parseFromString(a,i);break;case"json":n=JSON.parse(a);break;default:n=a}setTimeout((function(){e&&e(n),r.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}),0)}}else{xc[t]=[],xc[t].push({onLoad:e,onProgress:i,onError:n}),a=new XMLHttpRequest,a.open("GET",t,!0),a.addEventListener("load",(function(e){const i=this.response,n=xc[t];if(delete xc[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),mc.add(t,i);for(let t=0,e=n.length;t<e;t++){const e=n[t];e.onLoad&&e.onLoad(i)}r.manager.itemEnd(t)}else{for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onError&&i.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}}),!1),a.addEventListener("progress",(function(e){const i=xc[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onProgress&&n.onProgress(e)}}),!1),a.addEventListener("error",(function(e){const i=xc[t];delete xc[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),a.addEventListener("abort",(function(e){const i=xc[t];delete xc[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(a.responseType=this.responseType),void 0!==this.withCredentials&&(a.withCredentials=this.withCredentials),a.overrideMimeType&&a.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(const t in this.requestHeader)a.setRequestHeader(t,this.requestHeader[t]);a.send(null)}return r.manager.itemStart(t),a},setResponseType:function(t){return this.responseType=t,this},setMimeType:function(t){return this.mimeType=t,this}}),wc.prototype=Object.assign(Object.create(yc.prototype),{constructor:wc,load:function(t,e,i,n){const r=this,s=new bc(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)},parse:function(t){const e=[];for(let i=0;i<t.length;i++){const n=pc.parse(t[i]);e.push(n)}return e}}),Tc.prototype=Object.assign(Object.create(yc.prototype),{constructor:Tc,load:function(t,e,i,n){const r=this,s=[],o=new zh,a=new bc(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(r.withCredentials);let h=0;function l(l){a.load(t[l],(function(t){const i=r.parse(t,!0);s[l]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},h+=1,6===h&&(1===i.mipmapCount&&(o.minFilter=xt),o.image=s,o.format=i.format,o.needsUpdate=!0,e&&e(o))}),i,n)}if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)l(e);else a.load(t,(function(t){const i=r.parse(t,!0);if(i.isCubemap){const t=i.mipmaps.length/i.mipmapCount;for(let e=0;e<t;e++){s[e]={mipmaps:[]};for(let t=0;t<i.mipmapCount;t++)s[e].mipmaps.push(i.mipmaps[e*i.mipmapCount+t]),s[e].format=i.format,s[e].width=i.width,s[e].height=i.height}o.image=s}else o.image.width=i.width,o.image.height=i.height,o.mipmaps=i.mipmaps;1===i.mipmapCount&&(o.minFilter=xt),o.format=i.format,o.needsUpdate=!0,e&&e(o)}),i,n);return o}}),_c.prototype=Object.assign(Object.create(yc.prototype),{constructor:_c,load:function(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=mc.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function a(){o.removeEventListener("load",a,!1),o.removeEventListener("error",h,!1),mc.add(t,this),e&&e(this),r.manager.itemEnd(t)}function h(e){o.removeEventListener("load",a,!1),o.removeEventListener("error",h,!1),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}return o.addEventListener("load",a,!1),o.addEventListener("error",h,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}),Ec.prototype=Object.assign(Object.create(yc.prototype),{constructor:Ec,load:function(t,e,i,n){const r=new bs,s=new _c(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function a(i){s.load(t[i],(function(t){r.images[i]=t,o++,6===o&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}for(let e=0;e<t.length;++e)a(e);return r}}),Sc.prototype=Object.assign(Object.create(yc.prototype),{constructor:Sc,load:function(t,e,i,n){const r=this,s=new Ts,o=new bc(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(t,(function(t){const i=r.parse(t);i&&(void 0!==i.image?s.image=i.image:void 0!==i.data&&(s.image.width=i.width,s.image.height=i.height,s.image.data=i.data),s.wrapS=void 0!==i.wrapS?i.wrapS:dt,s.wrapT=void 0!==i.wrapT?i.wrapT:dt,s.magFilter=void 0!==i.magFilter?i.magFilter:xt,s.minFilter=void 0!==i.minFilter?i.minFilter:xt,s.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.encoding&&(s.encoding=i.encoding),void 0!==i.flipY&&(s.flipY=i.flipY),void 0!==i.format&&(s.format=i.format),void 0!==i.type&&(s.type=i.type),void 0!==i.mipmaps&&(s.mipmaps=i.mipmaps,s.minFilter=Tt),1===i.mipmapCount&&(s.minFilter=xt),s.needsUpdate=!0,e&&e(s,i))}),i,n),s}}),Mc.prototype=Object.assign(Object.create(yc.prototype),{constructor:Mc,load:function(t,e,i,n){const r=new Wi,s=new _c(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,(function(i){r.image=i;const n=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=n?kt:Nt,r.needsUpdate=!0,void 0!==e&&e(r)}),i,n),r}}),Object.assign(Ac.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},getLength:function(){const t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)i=this.getPoint(s/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){const i=this.getLengths();let n=0;const r=i.length;let s;s=e||t*i[r-1];let o,a=0,h=r-1;for(;a<=h;)if(n=Math.floor(a+(h-a)/2),o=i[n]-s,o<0)a=n+1;else{if(!(o>0)){h=n;break}h=n-1}if(n=h,i[n]===s)return n/(r-1);const l=i[n];return(n+(s-l)/(i[n+1]-l))/(r-1)},getTangent:function(t,e){let i=t-1e-4,n=t+1e-4;i<0&&(i=0),n>1&&(n=1);const r=this.getPoint(i),s=this.getPoint(n),o=e||(r.isVector2?new Ui:new Ki);return o.copy(s).sub(r).normalize(),o},getTangentAt:function(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)},computeFrenetFrames:function(t,e){const i=new Ki,n=[],r=[],s=[],o=new Ki,a=new Sn;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new Ki),n[e].normalize()}r[0]=new Ki,s[0]=new Ki;let h=Number.MAX_VALUE;const l=Math.abs(n[0].x),c=Math.abs(n[0].y),u=Math.abs(n[0].z);l<=h&&(h=l,i.set(1,0,0)),c<=h&&(h=c,i.set(0,1,0)),u<=h&&i.set(0,0,1),o.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],o),s[0].crossVectors(n[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(n[e-1],n[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(Ni.clamp(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(n[e],r[e])}if(!0===e){let e=Math.acos(Ni.clamp(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(o.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],e*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),Cc.prototype=Object.create(Ac.prototype),Cc.prototype.constructor=Cc,Cc.prototype.isEllipseCurve=!0,Cc.prototype.getPoint=function(t,e){const i=e||new Ui,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=s?0:n),!0!==this.aClockwise||s||(r===n?r=-n:r-=n);const o=this.aStartAngle+t*r;let a=this.aX+this.xRadius*Math.cos(o),h=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=a-this.aX,n=h-this.aY;a=i*t-n*e+this.aX,h=i*e+n*t+this.aY}return i.set(a,h)},Cc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Cc.prototype.toJSON=function(){const t=Ac.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},Cc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Pc.prototype=Object.create(Cc.prototype),Pc.prototype.constructor=Pc,Pc.prototype.isArcCurve=!0;const Lc=new Ki,Oc=new Rc,Dc=new Rc,Ic=new Rc;function Fc(t=[],e=!1,i="centripetal",n=.5){Ac.call(this),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=n}function Bc(t,e,i,n,r){const s=.5*(n-e),o=.5*(r-i),a=t*t;return(2*i-2*n+s+o)*(t*a)+(-3*i+3*n-2*s-o)*a+s*t+i}function kc(t,e,i,n){return function(t,e){const i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}function Nc(t,e,i,n,r){return function(t,e){const i=1-t;return i*i*i*e}(t,e)+function(t,e){const i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}function Uc(t=new Ui,e=new Ui,i=new Ui,n=new Ui){Ac.call(this),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=n}function zc(t=new Ki,e=new Ki,i=new Ki,n=new Ki){Ac.call(this),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=n}function Gc(t=new Ui,e=new Ui){Ac.call(this),this.type="LineCurve",this.v1=t,this.v2=e}function Vc(t=new Ki,e=new Ki){Ac.call(this),this.type="LineCurve3",this.v1=t,this.v2=e}function Hc(t=new Ui,e=new Ui,i=new Ui){Ac.call(this),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}function Wc(t=new Ki,e=new Ki,i=new Ki){Ac.call(this),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}function Xc(t=[]){Ac.call(this),this.type="SplineCurve",this.points=t}Fc.prototype=Object.create(Ac.prototype),Fc.prototype.constructor=Fc,Fc.prototype.isCatmullRomCurve3=!0,Fc.prototype.getPoint=function(t,e=new Ki){const i=e,n=this.points,r=n.length,s=(r-(this.closed?0:1))*t;let o,a,h=Math.floor(s),l=s-h;this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/r)+1)*r:0===l&&h===r-1&&(h=r-2,l=1),this.closed||h>0?o=n[(h-1)%r]:(Lc.subVectors(n[0],n[1]).add(n[0]),o=Lc);const c=n[h%r],u=n[(h+1)%r];if(this.closed||h+2<r?a=n[(h+2)%r]:(Lc.subVectors(n[r-1],n[r-2]).add(n[r-1]),a=Lc),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(o.distanceToSquared(c),t),i=Math.pow(c.distanceToSquared(u),t),n=Math.pow(u.distanceToSquared(a),t);i<1e-4&&(i=1),e<1e-4&&(e=i),n<1e-4&&(n=i),Oc.initNonuniformCatmullRom(o.x,c.x,u.x,a.x,e,i,n),Dc.initNonuniformCatmullRom(o.y,c.y,u.y,a.y,e,i,n),Ic.initNonuniformCatmullRom(o.z,c.z,u.z,a.z,e,i,n)}else"catmullrom"===this.curveType&&(Oc.initCatmullRom(o.x,c.x,u.x,a.x,this.tension),Dc.initCatmullRom(o.y,c.y,u.y,a.y,this.tension),Ic.initCatmullRom(o.z,c.z,u.z,a.z,this.tension));return i.set(Oc.calc(l),Dc.calc(l),Ic.calc(l)),i},Fc.prototype.copy=function(t){Ac.prototype.copy.call(this,t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Fc.prototype.toJSON=function(){const t=Ac.prototype.toJSON.call(this);t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Fc.prototype.fromJSON=function(t){Ac.prototype.fromJSON.call(this,t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new Ki).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Uc.prototype=Object.create(Ac.prototype),Uc.prototype.constructor=Uc,Uc.prototype.isCubicBezierCurve=!0,Uc.prototype.getPoint=function(t,e=new Ui){const i=e,n=this.v0,r=this.v1,s=this.v2,o=this.v3;return i.set(Nc(t,n.x,r.x,s.x,o.x),Nc(t,n.y,r.y,s.y,o.y)),i},Uc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Uc.prototype.toJSON=function(){const t=Ac.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Uc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},zc.prototype=Object.create(Ac.prototype),zc.prototype.constructor=zc,zc.prototype.isCubicBezierCurve3=!0,zc.prototype.getPoint=function(t,e=new Ki){const i=e,n=this.v0,r=this.v1,s=this.v2,o=this.v3;return i.set(Nc(t,n.x,r.x,s.x,o.x),Nc(t,n.y,r.y,s.y,o.y),Nc(t,n.z,r.z,s.z,o.z)),i},zc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},zc.prototype.toJSON=function(){const t=Ac.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},zc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Gc.prototype=Object.create(Ac.prototype),Gc.prototype.constructor=Gc,Gc.prototype.isLineCurve=!0,Gc.prototype.getPoint=function(t,e=new Ui){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},Gc.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Gc.prototype.getTangent=function(t,e){const i=e||new Ui;return i.copy(this.v2).sub(this.v1).normalize(),i},Gc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Gc.prototype.toJSON=function(){const t=Ac.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Gc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Vc.prototype=Object.create(Ac.prototype),Vc.prototype.constructor=Vc,Vc.prototype.isLineCurve3=!0,Vc.prototype.getPoint=function(t,e=new Ki){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},Vc.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Vc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Vc.prototype.toJSON=function(){const t=Ac.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Vc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Hc.prototype=Object.create(Ac.prototype),Hc.prototype.constructor=Hc,Hc.prototype.isQuadraticBezierCurve=!0,Hc.prototype.getPoint=function(t,e=new Ui){const i=e,n=this.v0,r=this.v1,s=this.v2;return i.set(kc(t,n.x,r.x,s.x),kc(t,n.y,r.y,s.y)),i},Hc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Hc.prototype.toJSON=function(){const t=Ac.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Hc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Wc.prototype=Object.create(Ac.prototype),Wc.prototype.constructor=Wc,Wc.prototype.isQuadraticBezierCurve3=!0,Wc.prototype.getPoint=function(t,e=new Ki){const i=e,n=this.v0,r=this.v1,s=this.v2;return i.set(kc(t,n.x,r.x,s.x),kc(t,n.y,r.y,s.y),kc(t,n.z,r.z,s.z)),i},Wc.prototype.copy=function(t){return Ac.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Wc.prototype.toJSON=function(){const t=Ac.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Wc.prototype.fromJSON=function(t){return Ac.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Xc.prototype=Object.create(Ac.prototype),Xc.prototype.constructor=Xc,Xc.prototype.isSplineCurve=!0,Xc.prototype.getPoint=function(t,e=new Ui){const i=e,n=this.points,r=(n.length-1)*t,s=Math.floor(r),o=r-s,a=n[0===s?s:s-1],h=n[s],l=n[s>n.length-2?n.length-1:s+1],c=n[s>n.length-3?n.length-1:s+2];return i.set(Bc(o,a.x,h.x,l.x,c.x),Bc(o,a.y,h.y,l.y,c.y)),i},Xc.prototype.copy=function(t){Ac.prototype.copy.call(this,t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this},Xc.prototype.toJSON=function(){const t=Ac.prototype.toJSON.call(this);t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t},Xc.prototype.fromJSON=function(t){Ac.prototype.fromJSON.call(this,t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new Ui).fromArray(i))}return this};var jc=Object.freeze({__proto__:null,ArcCurve:Pc,CatmullRomCurve3:Fc,CubicBezierCurve:Uc,CubicBezierCurve3:zc,EllipseCurve:Cc,LineCurve:Gc,LineCurve3:Vc,QuadraticBezierCurve:Hc,QuadraticBezierCurve3:Wc,SplineCurve:Xc});function Yc(){Ac.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function qc(t){Yc.call(this),this.type="Path",this.currentPoint=new Ui,t&&this.setFromPoints(t)}function Zc(t){qc.call(this,t),this.uuid=Ni.generateUUID(),this.type="Shape",this.holes=[]}function Kc(t,e=1){Kn.call(this),this.type="Light",this.color=new yr(t),this.intensity=e}function Jc(t,e,i){Kc.call(this,t,i),this.type="HemisphereLight",this.position.copy(Kn.DefaultUp),this.updateMatrix(),this.groundColor=new yr(e)}function Qc(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Ui(512,512),this.map=null,this.mapPass=null,this.matrix=new Sn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ss,this._frameExtents=new Ui(1,1),this._viewportCount=1,this._viewports=[new ji(0,0,1,1)]}function $c(){Qc.call(this,new ys(50,1,.5,500)),this.focus=1}function tu(t,e,i,n,r,s){Kc.call(this,t,e),this.type="SpotLight",this.position.copy(Kn.DefaultUp),this.updateMatrix(),this.target=new Kn,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==s?s:1,this.shadow=new $c}function eu(){Qc.call(this,new ys(90,1,.5,500)),this._frameExtents=new Ui(4,2),this._viewportCount=6,this._viewports=[new ji(2,1,1,1),new ji(0,1,1,1),new ji(3,1,1,1),new ji(1,1,1,1),new ji(3,0,1,1),new ji(1,0,1,1)],this._cubeDirections=[new Ki(1,0,0),new Ki(-1,0,0),new Ki(0,0,1),new Ki(0,0,-1),new Ki(0,1,0),new Ki(0,-1,0)],this._cubeUps=[new Ki(0,1,0),new Ki(0,1,0),new Ki(0,1,0),new Ki(0,1,0),new Ki(0,0,1),new Ki(0,0,-1)]}function iu(t,e,i,n){Kc.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1,this.shadow=new eu}function nu(t=-1,e=1,i=1,n=-1,r=.1,s=2e3){vs.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}function ru(){Qc.call(this,new nu(-5,5,5,-5,.5,500))}function su(t,e){Kc.call(this,t,e),this.type="DirectionalLight",this.position.copy(Kn.DefaultUp),this.updateMatrix(),this.target=new Kn,this.shadow=new ru}function ou(t,e){Kc.call(this,t,e),this.type="AmbientLight"}function au(t,e,i,n){Kc.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==i?i:10,this.height=void 0!==n?n:10}Yc.prototype=Object.assign(Object.create(Ac.prototype),{constructor:Yc,add:function(t){this.curves.push(t)},closePath:function(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Gc(e,t))},getPoint:function(t){const e=t*this.getLength(),i=this.getCurveLengths();let n=0;for(;n<i.length;){if(i[n]>=e){const t=i[n]-e,r=this.curves[n],s=r.getLength(),o=0===s?0:1-t/s;return r.getPointAt(o)}n++}return null},getLength:function(){const 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;const t=[];let e=0;for(let i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t=40){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t=12){const e=[];let i;for(let n=0,r=this.curves;n<r.length;n++){const s=r[n],o=s&&s.isEllipseCurve?2*t:s&&(s.isLineCurve||s.isLineCurve3)?1:s&&s.isSplineCurve?t*s.points.length:t,a=s.getPoints(o);for(let t=0;t<a.length;t++){const n=a[t];i&&i.equals(n)||(e.push(n),i=n)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){Ac.prototype.copy.call(this,t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){const t=Ac.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){const i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){Ac.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push((new jc[i.type]).fromJSON(i))}return this}}),qc.prototype=Object.assign(Object.create(Yc.prototype),{constructor:qc,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){const i=new Gc(this.currentPoint.clone(),new Ui(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,i,n){const r=new Hc(this.currentPoint.clone(),new Ui(t,e),new Ui(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this},bezierCurveTo:function(t,e,i,n,r,s){const o=new Uc(this.currentPoint.clone(),new Ui(t,e),new Ui(i,n),new Ui(r,s));return this.curves.push(o),this.currentPoint.set(r,s),this},splineThru:function(t){const e=new Xc([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,i,n,r,s){const o=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+o,e+a,i,n,r,s),this},absarc:function(t,e,i,n,r,s){return this.absellipse(t,e,i,i,n,r,s),this},ellipse:function(t,e,i,n,r,s,o,a){const h=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+h,e+l,i,n,r,s,o,a),this},absellipse:function(t,e,i,n,r,s,o,a){const h=new Cc(t,e,i,n,r,s,o,a);if(this.curves.length>0){const t=h.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(h);const l=h.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return Yc.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){const t=Yc.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Yc.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Zc.prototype=Object.assign(Object.create(qc.prototype),{constructor:Zc,getPointsHoles:function(t){const e=[];for(let i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){qc.prototype.copy.call(this,t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){const t=qc.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){const i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){qc.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push((new qc).fromJSON(i))}return this}}),Kc.prototype=Object.assign(Object.create(Kn.prototype),{constructor:Kc,isLight:!0,copy:function(t){return Kn.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){const e=Kn.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}}),Jc.prototype=Object.assign(Object.create(Kc.prototype),{constructor:Jc,isHemisphereLight:!0,copy:function(t){return Kc.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Qc.prototype,{_projScreenMatrix:new Sn,_lightPositionWorld:new Ki,_lookTarget:new Ki,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){const e=this.camera,i=this.matrix,n=this._projScreenMatrix,r=this._lookTarget,s=this._lightPositionWorld;s.setFromMatrixPosition(t.matrixWorld),e.position.copy(s),r.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(r),e.updateMatrixWorld(),n.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(n),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(e.projectionMatrix),i.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},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(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),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}}),$c.prototype=Object.assign(Object.create(Qc.prototype),{constructor:$c,isSpotLightShadow:!0,updateMatrices:function(t){const e=this.camera,i=2*Ni.RAD2DEG*t.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;i===e.fov&&n===e.aspect&&r===e.far||(e.fov=i,e.aspect=n,e.far=r,e.updateProjectionMatrix()),Qc.prototype.updateMatrices.call(this,t)}}),tu.prototype=Object.assign(Object.create(Kc.prototype),{constructor:tu,isSpotLight:!0,copy:function(t){return Kc.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}}),eu.prototype=Object.assign(Object.create(Qc.prototype),{constructor:eu,isPointLightShadow:!0,updateMatrices:function(t,e=0){const i=this.camera,n=this.matrix,r=this._lightPositionWorld,s=this._lookTarget,o=this._projScreenMatrix;r.setFromMatrixPosition(t.matrixWorld),i.position.copy(r),s.copy(i.position),s.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(s),i.updateMatrixWorld(),n.makeTranslation(-r.x,-r.y,-r.z),o.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),iu.prototype=Object.assign(Object.create(Kc.prototype),{constructor:iu,isPointLight:!0,copy:function(t){return Kc.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),nu.prototype=Object.assign(Object.create(vs.prototype),{constructor:nu,isOrthographicCamera:!0,copy:function(t,e){return vs.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,i,n,r,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,s=i+t,o=n+e,a=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){const e=Kn.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),ru.prototype=Object.assign(Object.create(Qc.prototype),{constructor:ru,isDirectionalLightShadow:!0,updateMatrices:function(t){Qc.prototype.updateMatrices.call(this,t)}}),su.prototype=Object.assign(Object.create(Kc.prototype),{constructor:su,isDirectionalLight:!0,copy:function(t){return Kc.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),ou.prototype=Object.assign(Object.create(Kc.prototype),{constructor:ou,isAmbientLight:!0}),au.prototype=Object.assign(Object.create(Kc.prototype),{constructor:au,isRectAreaLight:!0,copy:function(t){return Kc.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){const e=Kc.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}});class hu{constructor(){Object.defineProperty(this,"isSphericalHarmonics3",{value:!0}),this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new Ki)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*n),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*i),e.addScaledVector(s[4],i*n*1.092548),e.addScaledVector(s[5],n*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],i*r*1.092548),e.addScaledVector(s[8],.546274*(i*i-n*n)),e}getIrradianceAt(t,e){const i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*n),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*i),e.addScaledVector(s[4],.858086*i*n),e.addScaledVector(s[5],.858086*n*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*i*r),e.addScaledVector(s[8],.429043*(i*i-n*n)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(t,e+3*n);return this}toArray(t=[],e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(t,e+3*n);return t}static getBasisAt(t,e){const i=t.x,n=t.y,r=t.z;e[0]=.282095,e[1]=.488603*n,e[2]=.488603*r,e[3]=.488603*i,e[4]=1.092548*i*n,e[5]=1.092548*n*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*i*r,e[8]=.546274*(i*i-n*n)}}function lu(t,e){Kc.call(this,void 0,e),this.type="LightProbe",this.sh=void 0!==t?t:new hu}function cu(t){yc.call(this,t),this.textures={}}lu.prototype=Object.assign(Object.create(Kc.prototype),{constructor:lu,isLightProbe:!0,copy:function(t){return Kc.prototype.copy.call(this,t),this.sh.copy(t.sh),this},fromJSON:function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this},toJSON:function(t){const e=Kc.prototype.toJSON.call(this,t);return e.object.sh=this.sh.toArray(),e}}),cu.prototype=Object.assign(Object.create(yc.prototype),{constructor:cu,load:function(t,e,i,n){const r=this,s=new bc(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)},parse:function(t){const e=this.textures;function i(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const n=new $l[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&void 0!==n.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.sheen&&(n.sheen=(new yr).setHex(t.sheen)),void 0!==t.emissive&&void 0!==n.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==n.specular&&n.specular.setHex(t.specular),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearcoat&&(n.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(n.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.combine&&(n.combine=t.combine),void 0!==t.side&&(n.side=t.side),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(n.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(n.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(n.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(n.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(n.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(n.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(n.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(n.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(n.rotation=t.rotation),1!==t.linewidth&&(n.linewidth=t.linewidth),void 0!==t.dashSize&&(n.dashSize=t.dashSize),void 0!==t.gapSize&&(n.gapSize=t.gapSize),void 0!==t.scale&&(n.scale=t.scale),void 0!==t.polygonOffset&&(n.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(n.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(n.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(n.skinning=t.skinning),void 0!==t.morphTargets&&(n.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(n.morphNormals=t.morphNormals),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.vertexTangents&&(n.vertexTangents=t.vertexTangents),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.toneMapped&&(n.toneMapped=t.toneMapped),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?n.vertexColors=t.vertexColors>0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(n.uniforms[e]={},r.type){case"t":n.uniforms[e].value=i(r.value);break;case"c":n.uniforms[e].value=(new yr).setHex(r.value);break;case"v2":n.uniforms[e].value=(new Ui).fromArray(r.value);break;case"v3":n.uniforms[e].value=(new Ki).fromArray(r.value);break;case"v4":n.uniforms[e].value=(new ji).fromArray(r.value);break;case"m3":n.uniforms[e].value=(new zi).fromArray(r.value);break;case"m4":n.uniforms[e].value=(new Sn).fromArray(r.value);break;default:n.uniforms[e].value=r.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const e in t.extensions)n.extensions[e]=t.extensions[e];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=i(t.map)),void 0!==t.matcap&&(n.matcap=i(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),n.normalScale=(new Ui).fromArray(e)}return void 0!==t.displacementMap&&(n.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=i(t.specularMap)),void 0!==t.envMap&&(n.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new Ui).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(n.transmission=t.transmission),void 0!==t.transmissionMap&&(n.transmissionMap=i(t.transmissionMap)),n},setTextures:function(t){return this.textures=t,this}});const uu={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let i=0,n=t.length;i<n;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch(t){return e}},extractUrlBase:function(t){const e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function du(){jr.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function pu(t,e,i,n){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Sr.call(this,t,e,i),this.meshPerAttribute=n||1}function fu(t){yc.call(this,t)}du.prototype=Object.assign(Object.create(jr.prototype),{constructor:du,isInstancedBufferGeometry:!0,copy:function(t){return jr.prototype.copy.call(this,t),this.instanceCount=t.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){const t=jr.prototype.toJSON.call(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}),pu.prototype=Object.assign(Object.create(Sr.prototype),{constructor:pu,isInstancedBufferAttribute:!0,copy:function(t){return Sr.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){const t=Sr.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),fu.prototype=Object.assign(Object.create(yc.prototype),{constructor:fu,load:function(t,e,i,n){const r=this,s=new bc(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)},parse:function(t){const e={},i={};function n(t,n){if(void 0!==e[n])return e[n];const r=t.interleavedBuffers[n],s=function(t,e){if(void 0!==i[e])return i[e];const n=t.arrayBuffers[e],r=new Uint32Array(n).buffer;return i[e]=r,r}(t,r.buffer),o=new Na(Nr(r.type,s),r.stride);return o.uuid=r.uuid,e[n]=o,o}const r=t.isInstancedBufferGeometry?new du:new jr,s=t.data.index;if(void 0!==s){const t=Nr(s.type,s.array);r.setIndex(new Sr(t,1))}const o=t.data.attributes;for(const e in o){const i=o[e];let s;if(i.isInterleavedBufferAttribute){s=new za(n(t.data,i.data),i.itemSize,i.offset,i.normalized)}else{const t=Nr(i.type,i.array);s=new(i.isInstancedBufferAttribute?pu:Sr)(t,i.itemSize,i.normalized)}void 0!==i.name&&(s.name=i.name),r.setAttribute(e,s)}const a=t.data.morphAttributes;if(a)for(const e in a){const i=a[e],s=[];for(let e=0,r=i.length;e<r;e++){const r=i[e];let o;if(r.isInterleavedBufferAttribute){o=new za(n(t.data,r.data),r.itemSize,r.offset,r.normalized)}else{o=new Sr(Nr(r.type,r.array),r.itemSize,r.normalized)}void 0!==r.name&&(o.name=r.name),s.push(o)}r.morphAttributes[e]=s}t.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const h=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==h)for(let t=0,e=h.length;t!==e;++t){const e=h[t];r.addGroup(e.start,e.count,e.materialIndex)}const l=t.data.boundingSphere;if(void 0!==l){const t=new Ki;void 0!==l.center&&t.fromArray(l.center),r.boundingSphere=new gn(t,l.radius)}return t.name&&(r.name=t.name),t.userData&&(r.userData=t.userData),r}});class mu extends yc{constructor(t){super(t)}load(t,e,i,n){const r=this,s=""===this.path?uu.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||s;const o=new bc(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,(function(i){let s=null;try{s=JSON.parse(i)}catch(e){return void 0!==n&&n(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}const o=s.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?r.parse(s,e):console.error("THREE.ObjectLoader: Can't load "+t)}),i,n)}parse(t,e){const i=this.parseAnimations(t.animations),n=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,n),s=this.parseImages(t.images,(function(){void 0!==e&&e(h)})),o=this.parseTextures(t.textures,s),a=this.parseMaterials(t.materials,o),h=this.parseObject(t.object,r,a,i),l=this.parseSkeletons(t.skeletons,h);if(this.bindSkeletons(h,l),void 0!==e){let t=!1;for(const e in s)if(s[e]instanceof HTMLImageElement){t=!0;break}!1===t&&e(h)}return h}parseShapes(t){const e={};if(void 0!==t)for(let i=0,n=t.length;i<n;i++){const n=(new Zc).fromJSON(t[i]);e[n.uuid]=n}return e}parseSkeletons(t,e){const i={},n={};if(e.traverse((function(t){t.isBone&&(n[t.uuid]=t)})),void 0!==t)for(let e=0,r=t.length;e<r;e++){const r=(new mh).fromJSON(t[e],n);i[r.uuid]=r}return i}parseGeometries(t,e){const i={};let n;if(void 0!==t){const r=new fu;for(let s=0,o=t.length;s<o;s++){let o;const a=t[s];switch(a.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Vl[a.type](a.width,a.height,a.widthSegments,a.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":o=new Vl[a.type](a.width,a.height,a.depth,a.widthSegments,a.heightSegments,a.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Vl[a.type](a.radius,a.segments,a.thetaStart,a.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Vl[a.type](a.radiusTop,a.radiusBottom,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Vl[a.type](a.radius,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Vl[a.type](a.radius,a.widthSegments,a.heightSegments,a.phiStart,a.phiLength,a.thetaStart,a.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Vl[a.type](a.radius,a.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Vl[a.type](a.innerRadius,a.outerRadius,a.thetaSegments,a.phiSegments,a.thetaStart,a.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Vl[a.type](a.radius,a.tube,a.radialSegments,a.tubularSegments,a.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Vl[a.type](a.radius,a.tube,a.tubularSegments,a.radialSegments,a.p,a.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Vl[a.type]((new jc[a.path.type]).fromJSON(a.path),a.tubularSegments,a.radius,a.radialSegments,a.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Vl[a.type](a.points,a.segments,a.phiStart,a.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Vl[a.type](a.vertices,a.indices,a.radius,a.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":n=[];for(let t=0,i=a.shapes.length;t<i;t++){const i=e[a.shapes[t]];n.push(i)}o=new Vl[a.type](n,a.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":n=[];for(let t=0,i=a.shapes.length;t<i;t++){const i=e[a.shapes[t]];n.push(i)}const t=a.options.extrudePath;void 0!==t&&(a.options.extrudePath=(new jc[t.type]).fromJSON(t)),o=new Vl[a.type](n,a.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(a);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+a.type+'"');continue}o.uuid=a.uuid,void 0!==a.name&&(o.name=a.name),!0===o.isBufferGeometry&&void 0!==a.userData&&(o.userData=a.userData),i[a.uuid]=o}}return i}parseMaterials(t,e){const i={},n={};if(void 0!==t){const r=new cu;r.setTextures(e);for(let e=0,s=t.length;e<s;e++){const s=t[e];if("MultiMaterial"===s.type){const t=[];for(let e=0;e<s.materials.length;e++){const n=s.materials[e];void 0===i[n.uuid]&&(i[n.uuid]=r.parse(n)),t.push(i[n.uuid])}n[s.uuid]=t}else void 0===i[s.uuid]&&(i[s.uuid]=r.parse(s)),n[s.uuid]=i[s.uuid]}}return n}parseAnimations(t){const e={};if(void 0!==t)for(let i=0;i<t.length;i++){const n=t[i],r=pc.parse(n);e[r.uuid]=r}return e}parseImages(t,e){const i=this,n={};let r;function s(t){if("string"==typeof t){const e=t;return function(t){return i.manager.itemStart(t),r.load(t,(function(){i.manager.itemEnd(t)}),void 0,(function(){i.manager.itemError(t),i.manager.itemEnd(t)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:i.resourcePath+e)}return t.data?{data:Nr(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){const i=new gc(e);r=new _c(i),r.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.url;if(Array.isArray(r)){n[i.uuid]=[];for(let t=0,e=r.length;t<e;t++){const e=s(r[t]);null!==e&&(e instanceof HTMLImageElement?n[i.uuid].push(e):n[i.uuid].push(new Ts(e.data,e.width,e.height)))}}else{const t=s(i.url);null!==t&&(n[i.uuid]=t)}}}return n}parseTextures(t,e){function i(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}const n={};if(void 0!==t)for(let r=0,s=t.length;r<s;r++){const s=t[r];let o;void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);const a=e[s.image];Array.isArray(a)?(o=new bs(a),6===a.length&&(o.needsUpdate=!0)):(o=a&&a.data?new Ts(a.data,a.width,a.height):new Wi(a),a&&(o.needsUpdate=!0)),o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=i(s.mapping,gu)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=i(s.wrap[0],vu),o.wrapT=i(s.wrap[1],vu)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=i(s.minFilter,yu)),void 0!==s.magFilter&&(o.magFilter=i(s.magFilter,yu)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),n[s.uuid]=o}return n}parseObject(t,e,i,n){let r,s,o;function a(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function h(t){if(void 0!==t){if(Array.isArray(t)){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];void 0===i[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(i[r])}return e}return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}}switch(t.type){case"Scene":r=new ka,void 0!==t.background&&Number.isInteger(t.background)&&(r.background=new yr(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?r.fog=new Ba(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(r.fog=new Fa(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":r=new ys(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(r.focus=t.focus),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.filmGauge&&(r.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(r.filmOffset=t.filmOffset),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"OrthographicCamera":r=new nu(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(r.zoom=t.zoom),void 0!==t.view&&(r.view=Object.assign({},t.view));break;case"AmbientLight":r=new ou(t.color,t.intensity);break;case"DirectionalLight":r=new su(t.color,t.intensity);break;case"PointLight":r=new iu(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":r=new au(t.color,t.intensity,t.width,t.height);break;case"SpotLight":r=new tu(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":r=new Jc(t.color,t.groundColor,t.intensity);break;case"LightProbe":r=(new lu).fromJSON(t);break;case"SkinnedMesh":s=a(t.geometry),o=h(t.material),r=new uh(s,o),void 0!==t.bindMode&&(r.bindMode=t.bindMode),void 0!==t.bindMatrix&&r.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(r.skeleton=t.skeleton);break;case"Mesh":s=a(t.geometry),o=h(t.material),r=new cs(s,o);break;case"InstancedMesh":s=a(t.geometry),o=h(t.material);const e=t.count,i=t.instanceMatrix;r=new bh(s,o,e),r.instanceMatrix=new Sr(new Float32Array(i.array),16);break;case"LOD":r=new sh;break;case"Line":r=new Ah(a(t.geometry),h(t.material));break;case"LineLoop":r=new Lh(a(t.geometry),h(t.material));break;case"LineSegments":r=new Rh(a(t.geometry),h(t.material));break;case"PointCloud":case"Points":r=new kh(a(t.geometry),h(t.material));break;case"Sprite":r=new eh(h(t.material));break;case"Group":r=new Pa;break;case"Bone":r=new dh;break;default:r=new Kn}if(r.uuid=t.uuid,void 0!==t.name&&(r.name=t.name),void 0!==t.matrix?(r.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(r.matrixAutoUpdate=t.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==t.position&&r.position.fromArray(t.position),void 0!==t.rotation&&r.rotation.fromArray(t.rotation),void 0!==t.quaternion&&r.quaternion.fromArray(t.quaternion),void 0!==t.scale&&r.scale.fromArray(t.scale)),void 0!==t.castShadow&&(r.castShadow=t.castShadow),void 0!==t.receiveShadow&&(r.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(r.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(r.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(r.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&r.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(r.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.frustumCulled&&(r.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(r.renderOrder=t.renderOrder),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.layers&&(r.layers.mask=t.layers),void 0!==t.children){const s=t.children;for(let t=0;t<s.length;t++)r.add(this.parseObject(s[t],e,i,n))}if(void 0!==t.animations){const e=t.animations;for(let t=0;t<e.length;t++){const i=e[t];r.animations.push(n[i])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(r.autoUpdate=t.autoUpdate);const e=t.levels;for(let t=0;t<e.length;t++){const i=e[t],n=r.getObjectByProperty("uuid",i.object);void 0!==n&&r.addLevel(n,i.distance)}}return r}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse((function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){const i=e[t.skeleton];void 0===i?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",t.skeleton):t.bind(i,t.bindMatrix)}}))}setTexturePath(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}const gu={UVMapping:rt,CubeReflectionMapping:st,CubeRefractionMapping:ot,EquirectangularReflectionMapping:at,EquirectangularRefractionMapping:ht,CubeUVReflectionMapping:lt,CubeUVRefractionMapping:ct},vu={RepeatWrapping:ut,ClampToEdgeWrapping:dt,MirroredRepeatWrapping:pt},yu={NearestFilter:ft,NearestMipmapNearestFilter:mt,NearestMipmapLinearFilter:vt,LinearFilter:xt,LinearMipmapNearestFilter:bt,LinearMipmapLinearFilter:Tt};function xu(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),yc.call(this,t),this.options={premultiplyAlpha:"none"}}function bu(){this.type="ShapePath",this.color=new yr,this.subPaths=[],this.currentPath=null}xu.prototype=Object.assign(Object.create(yc.prototype),{constructor:xu,isImageBitmapLoader:!0,setOptions:function(t){return this.options=t,this},load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=mc.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",fetch(t,o).then((function(t){return t.blob()})).then((function(t){return createImageBitmap(t,r.options)})).then((function(i){mc.add(t,i),e&&e(i),r.manager.itemEnd(t)})).catch((function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)})),r.manager.itemStart(t)}}),Object.assign(bu.prototype,{moveTo:function(t,e){return this.currentPath=new qc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,i,n){return this.currentPath.quadraticCurveTo(t,e,i,n),this},bezierCurveTo:function(t,e,i,n,r,s){return this.currentPath.bezierCurveTo(t,e,i,n,r,s),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function i(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i],r=new Zc;r.curves=n.curves,e.push(r)}return e}function n(t,e){const i=e.length;let n=!1;for(let r=i-1,s=0;s<i;r=s++){let i=e[r],o=e[s],a=o.x-i.x,h=o.y-i.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(i=e[s],a=-a,o=e[r],h=-h),t.y<i.y||t.y>o.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{const e=h*(t.x-i.x)-a*(t.y-i.y);if(0===e)return!0;if(e<0)continue;n=!n}}else{if(t.y!==i.y)continue;if(o.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=o.x)return!0}}return n}const r=El.isClockWise,s=this.subPaths;if(0===s.length)return[];if(!0===e)return i(s);let o,a,h;const l=[];if(1===s.length)return a=s[0],h=new Zc,h.curves=a.curves,l.push(h),l;let c=!r(s[0].getPoints());c=t?!c:c;const u=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let e=0,i=s.length;e<i;e++)a=s[e],p=a.getPoints(),o=r(p),o=t?!o:o,o?(!c&&d[g]&&g++,d[g]={s:new Zc,p:p},d[g].s.curves=a.curves,c&&g++,m[g]=[]):m[g].push({h:a,p:p[0]});if(!d[0])return i(s);if(d.length>1){let t=!1;const e=[];for(let t=0,e=d.length;t<e;t++)u[t]=[];for(let i=0,r=d.length;i<r;i++){const r=m[i];for(let s=0;s<r.length;s++){const o=r[s];let a=!0;for(let r=0;r<d.length;r++)n(o.p,d[r].p)&&(i!==r&&e.push({froms:i,tos:r,hole:s}),a?(a=!1,u[r].push(o)):t=!0);a&&u[i].push(o)}}e.length>0&&(t||(m=u))}for(let t=0,e=d.length;t<e;t++){h=d[t].s,l.push(h),f=m[t];for(let t=0,e=f.length;t<e;t++)h.holes.push(f[t].h)}return l}});class wu{constructor(t){Object.defineProperty(this,"isFont",{value:!0}),this.type="Font",this.data=t}generateShapes(t,e=100){const i=[],n=function(t,e,i){const n=Array.from?Array.from(t):String(t).split(""),r=e/i.resolution,s=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*r,o=[];let a=0,h=0;for(let t=0;t<n.length;t++){const e=n[t];if("\n"===e)a=0,h-=s;else{const t=Tu(e,r,a,h,i);a+=t.offsetX,o.push(t.path)}}return o}(t,e,this.data);for(let t=0,e=n.length;t<e;t++)Array.prototype.push.apply(i,n[t].toShapes());return i}}function Tu(t,e,i,n,r){const s=r.glyphs[t]||r.glyphs["?"];if(!s)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");const o=new bu;let a,h,l,c,u,d,p,f;if(s.o){const t=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let r=0,s=t.length;r<s;){switch(t[r++]){case"m":a=t[r++]*e+i,h=t[r++]*e+n,o.moveTo(a,h);break;case"l":a=t[r++]*e+i,h=t[r++]*e+n,o.lineTo(a,h);break;case"q":l=t[r++]*e+i,c=t[r++]*e+n,u=t[r++]*e+i,d=t[r++]*e+n,o.quadraticCurveTo(u,d,l,c);break;case"b":l=t[r++]*e+i,c=t[r++]*e+n,u=t[r++]*e+i,d=t[r++]*e+n,p=t[r++]*e+i,f=t[r++]*e+n,o.bezierCurveTo(u,d,p,f,l,c)}}}return{offsetX:s.ha*e,path:o}}function _u(t){yc.call(this,t)}let Eu;_u.prototype=Object.assign(Object.create(yc.prototype),{constructor:_u,load:function(t,e,i,n){const r=this,s=new bc(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(t){let i;try{i=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(t.substring(65,t.length-2))}const n=r.parse(i);e&&e(n)}),i,n)},parse:function(t){return new wu(t)}});const Su={getContext:function(){return void 0===Eu&&(Eu=new(window.AudioContext||window.webkitAudioContext)),Eu},setContext:function(t){Eu=t}};function Mu(t){yc.call(this,t)}function Au(t,e,i){lu.call(this,void 0,i);const n=(new yr).set(t),r=(new yr).set(e),s=new Ki(n.r,n.g,n.b),o=new Ki(r.r,r.g,r.b),a=Math.sqrt(Math.PI),h=a*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(o).multiplyScalar(a),this.sh.coefficients[1].copy(s).sub(o).multiplyScalar(h)}function Cu(t,e){lu.call(this,void 0,e);const i=(new yr).set(t);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}Mu.prototype=Object.assign(Object.create(yc.prototype),{constructor:Mu,load:function(t,e,i,n){const r=this,s=new bc(r.manager);s.setResponseType("arraybuffer"),s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(i){try{const t=i.slice(0);Su.getContext().decodeAudioData(t,(function(t){e(t)}))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)}}),Au.prototype=Object.assign(Object.create(lu.prototype),{constructor:Au,isHemisphereLightProbe:!0,copy:function(t){return lu.prototype.copy.call(this,t),this},toJSON:function(t){return lu.prototype.toJSON.call(this,t)}}),Cu.prototype=Object.assign(Object.create(lu.prototype),{constructor:Cu,isAmbientLightProbe:!0,copy:function(t){return lu.prototype.copy.call(this,t),this},toJSON:function(t){return lu.prototype.toJSON.call(this,t)}});const Pu=new Sn,Ru=new Sn;function Lu(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ys,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ys,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}Object.assign(Lu.prototype,{update:function(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;const i=t.projectionMatrix.clone(),n=e.eyeSep/2,r=n*e.near/e.focus,s=e.near*Math.tan(Ni.DEG2RAD*e.fov*.5)/e.zoom;let o,a;Ru.elements[12]=-n,Pu.elements[12]=n,o=-s*e.aspect+r,a=s*e.aspect+r,i.elements[0]=2*e.near/(a-o),i.elements[8]=(a+o)/(a-o),this.cameraL.projectionMatrix.copy(i),o=-s*e.aspect-r,a=s*e.aspect-r,i.elements[0]=2*e.near/(a-o),i.elements[8]=(a+o)/(a-o),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Ru),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Pu)}});class Ou{constructor(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Du(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=Du();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function Du(){return("undefined"==typeof performance?Date:performance).now()}const Iu=new Ki,Fu=new Zi,Bu=new Ki,ku=new Ki;class Nu extends Kn{constructor(){super(),this.type="AudioListener",this.context=Su.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Ou}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Iu,Fu,Bu),ku.set(0,0,-1).applyQuaternion(Fu),e.positionX){const t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Iu.x,t),e.positionY.linearRampToValueAtTime(Iu.y,t),e.positionZ.linearRampToValueAtTime(Iu.z,t),e.forwardX.linearRampToValueAtTime(ku.x,t),e.forwardY.linearRampToValueAtTime(ku.y,t),e.forwardZ.linearRampToValueAtTime(ku.z,t),e.upX.linearRampToValueAtTime(i.x,t),e.upY.linearRampToValueAtTime(i.y,t),e.upZ.linearRampToValueAtTime(i.z,t)}else e.setPosition(Iu.x,Iu.y,Iu.z),e.setOrientation(ku.x,ku.y,ku.z,i.x,i.y,i.z)}}class Uu extends Kn{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}const zu=new Ki,Gu=new Zi,Vu=new Ki,Hu=new Ki;class Wu extends Uu{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(zu,Gu,Vu),Hu.set(0,0,1).applyQuaternion(Gu);const e=this.panner;if(e.positionX){const t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(zu.x,t),e.positionY.linearRampToValueAtTime(zu.y,t),e.positionZ.linearRampToValueAtTime(zu.z,t),e.orientationX.linearRampToValueAtTime(Hu.x,t),e.orientationY.linearRampToValueAtTime(Hu.y,t),e.orientationZ.linearRampToValueAtTime(Hu.z,t)}else e.setPosition(zu.x,zu.y,zu.z),e.setOrientation(Hu.x,Hu.y,Hu.z)}}class Xu{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let i=0;i<e.length;i++)t+=e[i];return t/e.length}}function ju(t,e,i){let n,r,s;switch(this.binding=t,this.valueSize=i,e){case"quaternion":n=this._slerp,r=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Object.assign(ju.prototype,{accumulate:function(t,e){const i=this.buffer,n=this.valueSize,r=t*n+n;let s=this.cumulativeWeight;if(0===s){for(let t=0;t!==n;++t)i[r+t]=i[t];s=e}else{s+=e;const t=e/s;this._mixBufferRegion(i,r,0,t,n)}this.cumulativeWeight=s},accumulateAdditive:function(t){const e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t},apply:function(t){const e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const t=e*this._origIndex;this._mixBufferRegion(i,n,t,1-r,e)}s>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){o.setValue(i,n);break}},saveOriginalState:function(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,r=n;t!==r;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1},_setAdditiveIdentityOther:function(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]},_select:function(t,e,i,n,r){if(n>=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]},_slerp:function(t,e,i,n){Zi.slerpFlat(t,e,t,e,t,i,n)},_slerpAdditive:function(t,e,i,n,r){const s=this._workIndex*r;Zi.multiplyQuaternionsFlat(t,s,t,e,t,i),Zi.slerpFlat(t,e,t,e,t,s,n)},_lerp:function(t,e,i,n,r){const s=1-n;for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]*s+t[i+o]*n}},_lerpAdditive:function(t,e,i,n,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[i+s]*n}}});const Yu=new RegExp("[\\[\\]\\.:\\/]","g"),qu="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Zu=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ku=/(WCOD+)?/.source.replace("WCOD",qu),Ju=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Qu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),$u=new RegExp("^"+Zu+Ku+Ju+Qu+"$"),td=["material","materials","bones"];function ed(t,e,i){const n=i||id.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function id(t,e,i){this.path=e,this.parsedPath=i||id.parseTrackName(e),this.node=id.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function nd(){this.uuid=Ni.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}Object.assign(ed.prototype,{getValue:function(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)},bind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()},unbind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}),Object.assign(id,{Composite:ed,create:function(t,e,i){return t&&t.isAnimationObjectGroup?new id.Composite(t,e,i):new id(t,e,i)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Yu,"")},parseTrackName:function(t){const e=$u.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==td.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.name===e||r.uuid===e)return r;const s=i(r.children);if(s)return s}return null},n=i(t.children);if(n)return n}return null}}),Object.assign(id.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)t[e++]=i[n]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++]},function(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){let t=this.node;const e=this.parsedPath,i=e.objectName,n=e.propertyName;let r=e.propertyIndex;if(t||(t=id.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let n=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===n){n=e;break}break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==n){if(void 0===t[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[n]}}const s=t[n];if(void 0===s){const i=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+n+" but it wasn't found.",t)}let o=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(a=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(id.prototype,{_getValue_unbound:id.prototype.getValue,_setValue_unbound:id.prototype.setValue}),Object.assign(nd.prototype,{isAnimationObjectGroup:!0,add:function(){const t=this._objects,e=this._indicesByUUID,i=this._paths,n=this._parsedPaths,r=this._bindings,s=r.length;let o=void 0,a=t.length,h=this.nCachedObjects_;for(let l=0,c=arguments.length;l!==c;++l){const c=arguments[l],u=c.uuid;let d=e[u];if(void 0===d){d=a++,e[u]=d,t.push(c);for(let t=0,e=s;t!==e;++t)r[t].push(new id(c,i[t],n[t]))}else if(d<h){o=t[d];const a=--h,l=t[a];e[l.uuid]=d,t[d]=l,e[u]=a,t[a]=c;for(let t=0,e=s;t!==e;++t){const e=r[t],s=e[a];let o=e[d];e[d]=s,void 0===o&&(o=new id(c,i[t],n[t])),e[a]=o}}else t[d]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=h},remove:function(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){const o=arguments[s],a=o.uuid,h=e[a];if(void 0!==h&&h>=r){const s=r++,l=t[s];e[l.uuid]=h,t[h]=l,e[a]=s,t[s]=o;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[s],r=e[h];e[h]=n,e[s]=r}}}this.nCachedObjects_=r},uncache:function(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,h=e[a];if(void 0!==h)if(delete e[a],h<r){const o=--r,a=t[o],l=--s,c=t[l];e[a.uuid]=h,t[h]=a,e[c.uuid]=o,t[o]=c,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[o],r=e[l];e[h]=n,e[o]=r,e.pop()}}else{const r=--s,o=t[r];r>0&&(e[o.uuid]=h),t[h]=o,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t];e[h]=e[r],e.pop()}}}this.nCachedObjects_=r},subscribe_:function(t,e){const i=this._bindingsIndicesByPath;let n=i[t];const r=this._bindings;if(void 0!==n)return r[n];const s=this._paths,o=this._parsedPaths,a=this._objects,h=a.length,l=this.nCachedObjects_,c=new Array(h);n=r.length,i[t]=n,s.push(t),o.push(e),r.push(c);for(let i=l,n=a.length;i!==n;++i){const n=a[i];c[i]=new id(n,t,e)}return c},unsubscribe_:function(t){const e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){const n=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=i,s[i]=a,s.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}});class rd{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,s=r.length,o=new Array(s),a={endingStart:Ve,endingEnd:Ve};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ke,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,s=i/n;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,h=o.sampleValues;return a[0]=r,a[1]=r+i,h[0]=t/s,h[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case je:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(o);break;case Xe:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const s=i===Ne;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(i===Be){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=He,n.endingEnd=He):(n.endingStart=t?this.zeroSlopeAtStart?He:Ve:We,n.endingEnd=e?this.zeroSlopeAtEnd?He:Ve:We)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=e,o[1]=r+t,a[1]=i,this}}function sd(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}sd.prototype=Object.assign(Object.create(Fi.prototype),{constructor:sd,_bindAction:function(t,e){const i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,s=t._propertyBindings,o=t._interpolants,a=i.uuid,h=this._bindingsByRootAndName;let l=h[a];void 0===l&&(l={},h[a]=l);for(let t=0;t!==r;++t){const r=n[t],h=r.name;let c=l[h];if(void 0!==c)s[t]=c;else{if(c=s[t],void 0!==c){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,a,h));continue}const n=e&&e._propertyBindings[t].binding.parsedPath;c=new ju(id.create(i,h,n),r.ValueTypeName,r.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,a,h),s[t]=c}o[t].resultBuffer=c.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];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;const 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){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,i){const n=this._actions,r=this._actionsByClip;let s=r[e];if(void 0===s)s={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=s;else{const e=s.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=n.length,n.push(t),s.actionByRoot[i]=t},_removeInactiveAction:function(t){const e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;const r=t._clip.uuid,s=this._actionsByClip,o=s[r],a=o.knownActions,h=a[a.length-1],l=t._byClipCacheIndex;h._byClipCacheIndex=l,a[l]=h,a.pop(),t._byClipCacheIndex=null;delete o.actionByRoot[(t._localRoot||this._root).uuid],0===a.length&&delete s[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){const e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackAction:function(t){const e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_addInactiveBinding:function(t,e,i){const n=this._bindingsByRootAndName,r=this._bindings;let s=n[e];void 0===s&&(s={},n[e]=s),s[i]=t,t._cacheIndex=r.length,r.push(t)},_removeInactiveBinding:function(t){const e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,s=this._bindingsByRootAndName,o=s[n],a=e[e.length-1],h=t._cacheIndex;a._cacheIndex=h,e[h]=a,e.pop(),delete o[r],0===Object.keys(o).length&&delete s[n]},_lendBinding:function(t){const e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackBinding:function(t){const e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_lendControlInterpolant:function(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return void 0===i&&(i=new nc(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=e,t[e]=i),i},_takeBackControlInterpolant:function(t){const e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e,i){const n=e||this._root,r=n.uuid;let s="string"==typeof t?pc.findByName(n,t):t;const o=null!==s?s.uuid:t,a=this._actionsByClip[o];let h=null;if(void 0===i&&(i=null!==s?s.blendMode:Xe),void 0!==a){const t=a.actionByRoot[r];if(void 0!==t&&t.blendMode===i)return t;h=a.knownActions[0],null===s&&(s=h._clip)}if(null===s)return null;const l=new rd(this,s,e,i);return this._bindAction(l,h),this._addInactiveAction(l,o,r),l},existingAction:function(t,e){const i=e||this._root,n=i.uuid,r="string"==typeof t?pc.findByName(i,t):t,s=r?r.uuid:t,o=this._actionsByClip[s];return void 0!==o&&o.actionByRoot[n]||null},stopAllAction:function(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==i;++o){e[o]._update(n,t,r,s)}const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this},setTime:function(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){const e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){const t=r.knownActions;for(let i=0,n=t.length;i!==n;++i){const n=t[i];this._deactivateAction(n);const r=n._cacheIndex,s=e[e.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,s._cacheIndex=r,e[r]=s,e.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}},uncacheRoot:function(t){const e=t.uuid,i=this._actionsByClip;for(const t in i){const n=i[t].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[e];if(void 0!==n)for(const t in n){const e=n[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}},uncacheAction:function(t,e){const i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}});class od{constructor(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}clone(){return new od(void 0===this.value.clone?this.value:this.value.clone())}}function ad(t,e,i){Na.call(this,t,e),this.meshPerAttribute=i||1}function hd(t,e,i,n,r){this.buffer=t,this.type=e,this.itemSize=i,this.elementSize=n,this.count=r,this.version=0}function ld(t,e,i,n){this.ray=new En(t,e),this.near=i||0,this.far=n||1/0,this.camera=null,this.layers=new Bn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function cd(t,e){return t.distance-e.distance}function ud(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n){const n=t.children;for(let t=0,r=n.length;t<r;t++)ud(n[t],e,i,!0)}}ad.prototype=Object.assign(Object.create(Na.prototype),{constructor:ad,isInstancedInterleavedBuffer:!0,copy:function(t){return Na.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},clone:function(t){const e=Na.prototype.clone.call(this,t);return e.meshPerAttribute=this.meshPerAttribute,e},toJSON:function(t){const e=Na.prototype.toJSON.call(this,t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}),Object.defineProperty(hd.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(hd.prototype,{isGLBufferAttribute:!0,setBuffer:function(t){return this.buffer=t,this},setType:function(t,e){return this.type=t,this.elementSize=e,this},setItemSize:function(t){return this.itemSize=t,this},setCount:function(t){return this.count=t,this}}),Object.assign(ld.prototype,{set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)},intersectObject:function(t,e,i){const n=i||[];return ud(t,this,n,e),n.sort(cd),n},intersectObjects:function(t,e,i){const n=i||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(let i=0,r=t.length;i<r;i++)ud(t[i],this,n,e);return n.sort(cd),n}});class dd{constructor(t=1,e=0,i=0){return this.radius=t,this.phi=e,this.theta=i,this}set(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this}clone(){return(new this.constructor).copy(this)}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(Ni.clamp(e/this.radius,-1,1))),this}}class pd{constructor(t,e,i){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==i?i:0,this}set(t,e,i){return this.radius=t,this.theta=e,this.y=i,this}clone(){return(new this.constructor).copy(this)}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}}const fd=new Ui;class md{constructor(t,e){Object.defineProperty(this,"isBox2",{value:!0}),this.min=void 0!==t?t:new Ui(1/0,1/0),this.max=void 0!==e?e:new Ui(-1/0,-1/0)}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=fd.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new Ui),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new Ui),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(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(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new Ui),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new Ui),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return fd.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const gd=new Ki,vd=new Ki;class yd{constructor(t,e){this.start=void 0!==t?t:new Ki,this.end=void 0!==e?e:new Ki}set(t,e){return this.start.copy(t),this.end.copy(e),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Ki),t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Ki),t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Ki),this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){gd.subVectors(t,this.start),vd.subVectors(this.end,this.start);const i=vd.dot(vd);let n=vd.dot(gd)/i;return e&&(n=Ni.clamp(n,0,1)),n}closestPointToPoint(t,e,i){const n=this.closestPointToPointParameter(t,e);return void 0===i&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),i=new Ki),this.delta(i).multiplyScalar(n).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}function xd(t){Kn.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}xd.prototype=Object.create(Kn.prototype),xd.prototype.constructor=xd,xd.prototype.isImmediateRenderObject=!0;const bd=new Ki;class wd extends Kn{constructor(t,e){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;const i=new jr,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,i=32;t<i;t++,e++){const r=t/i*Math.PI*2,s=e/i*Math.PI*2;n.push(Math.cos(r),Math.sin(r),1,Math.cos(s),Math.sin(s),1)}i.setAttribute("position",new Ir(n,3));const r=new wh({fog:!1,toneMapped:!1});this.cone=new Rh(i,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),bd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(bd),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Td=new Ki,_d=new Sn,Ed=new Sn;class Sd extends Rh{constructor(t){const e=function t(e){const i=[];e&&e.isBone&&i.push(e);for(let n=0;n<e.children.length;n++)i.push.apply(i,t(e.children[n]));return i}(t),i=new jr,n=[],r=[],s=new yr(0,0,1),o=new yr(0,1,0);for(let t=0;t<e.length;t++){const i=e[t];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(s.r,s.g,s.b),r.push(o.r,o.g,o.b))}i.setAttribute("position",new Ir(n,3)),i.setAttribute("color",new Ir(r,3));super(i,new wh({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){const e=this.bones,i=this.geometry,n=i.getAttribute("position");Ed.copy(this.root.matrixWorld).invert();for(let t=0,i=0;t<e.length;t++){const r=e[t];r.parent&&r.parent.isBone&&(_d.multiplyMatrices(Ed,r.matrixWorld),Td.setFromMatrixPosition(_d),n.setXYZ(i,Td.x,Td.y,Td.z),_d.multiplyMatrices(Ed,r.parent.matrixWorld),Td.setFromMatrixPosition(_d),n.setXYZ(i+1,Td.x,Td.y,Td.z),i+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}}class Md extends cs{constructor(t,e,i){super(new Fl(e,4,2),new Tr({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const Ad=new Ki,Cd=new yr,Pd=new yr;class Rd extends Kn{constructor(t,e,i){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const n=new Ll(e);n.rotateY(.5*Math.PI),this.material=new Tr({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=n.getAttribute("position"),s=new Float32Array(3*r.count);n.setAttribute("color",new Sr(s,3)),this.add(new cs(n,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");Cd.copy(this.light.color),Pd.copy(this.light.groundColor);for(let t=0,i=e.count;t<i;t++){const n=t<i/2?Cd:Pd;e.setXYZ(t,n.r,n.g,n.b)}e.needsUpdate=!0}t.lookAt(Ad.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Ld extends Rh{constructor(t=10,e=10,i=4473924,n=8947848){i=new yr(i),n=new yr(n);const r=e/2,s=t/e,o=t/2,a=[],h=[];for(let t=0,l=0,c=-o;t<=e;t++,c+=s){a.push(-o,0,c,o,0,c),a.push(c,0,-o,c,0,o);const e=t===r?i:n;e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3}const l=new jr;l.setAttribute("position",new Ir(a,3)),l.setAttribute("color",new Ir(h,3));super(l,new wh({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class Od extends Rh{constructor(t=10,e=16,i=8,n=64,r=4473924,s=8947848){r=new yr(r),s=new yr(s);const o=[],a=[];for(let i=0;i<=e;i++){const n=i/e*(2*Math.PI),h=Math.sin(n)*t,l=Math.cos(n)*t;o.push(0,0,0),o.push(h,0,l);const c=1&i?r:s;a.push(c.r,c.g,c.b),a.push(c.r,c.g,c.b)}for(let e=0;e<=i;e++){const h=1&e?r:s,l=t-t/i*e;for(let t=0;t<n;t++){let e=t/n*(2*Math.PI),i=Math.sin(e)*l,r=Math.cos(e)*l;o.push(i,0,r),a.push(h.r,h.g,h.b),e=(t+1)/n*(2*Math.PI),i=Math.sin(e)*l,r=Math.cos(e)*l,o.push(i,0,r),a.push(h.r,h.g,h.b)}}const h=new jr;h.setAttribute("position",new Ir(o,3)),h.setAttribute("color",new Ir(a,3));super(h,new wh({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const Dd=new Ki,Id=new Ki,Fd=new Ki;class Bd extends Kn{constructor(t,e,i){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===e&&(e=1);let n=new jr;n.setAttribute("position",new Ir([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const r=new wh({fog:!1,toneMapped:!1});this.lightPlane=new Ah(n,r),this.add(this.lightPlane),n=new jr,n.setAttribute("position",new Ir([0,0,0,0,0,1],3)),this.targetLine=new Ah(n,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Dd.setFromMatrixPosition(this.light.matrixWorld),Id.setFromMatrixPosition(this.light.target.matrixWorld),Fd.subVectors(Id,Dd),this.lightPlane.lookAt(Id),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Id),this.targetLine.scale.z=Fd.length()}}const kd=new Ki,Nd=new vs;class Ud extends Rh{constructor(t){const e=new jr,i=new wh({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],s={},o=new yr(16755200),a=new yr(16711680),h=new yr(43775),l=new yr(16777215),c=new yr(3355443);function u(t,e,i){d(t,i),d(e,i)}function d(t,e){n.push(0,0,0),r.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(n.length/3-1)}u("n1","n2",o),u("n2","n4",o),u("n4","n3",o),u("n3","n1",o),u("f1","f2",o),u("f2","f4",o),u("f4","f3",o),u("f3","f1",o),u("n1","f1",o),u("n2","f2",o),u("n3","f3",o),u("n4","f4",o),u("p","n1",a),u("p","n2",a),u("p","n3",a),u("p","n4",a),u("u1","u2",h),u("u2","u3",h),u("u3","u1",h),u("c","t",l),u("p","c",c),u("cn1","cn2",c),u("cn3","cn4",c),u("cf1","cf2",c),u("cf3","cf4",c),e.setAttribute("position",new Ir(n,3)),e.setAttribute("color",new Ir(r,3)),super(e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){const t=this.geometry,e=this.pointMap;Nd.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),zd("c",e,t,Nd,0,0,-1),zd("t",e,t,Nd,0,0,1),zd("n1",e,t,Nd,-1,-1,-1),zd("n2",e,t,Nd,1,-1,-1),zd("n3",e,t,Nd,-1,1,-1),zd("n4",e,t,Nd,1,1,-1),zd("f1",e,t,Nd,-1,-1,1),zd("f2",e,t,Nd,1,-1,1),zd("f3",e,t,Nd,-1,1,1),zd("f4",e,t,Nd,1,1,1),zd("u1",e,t,Nd,.7,1.1,-1),zd("u2",e,t,Nd,-.7,1.1,-1),zd("u3",e,t,Nd,0,2,-1),zd("cf1",e,t,Nd,-1,0,1),zd("cf2",e,t,Nd,1,0,1),zd("cf3",e,t,Nd,0,-1,1),zd("cf4",e,t,Nd,0,1,1),zd("cn1",e,t,Nd,-1,0,-1),zd("cn2",e,t,Nd,1,0,-1),zd("cn3",e,t,Nd,0,-1,-1),zd("cn4",e,t,Nd,0,1,-1),t.getAttribute("position").needsUpdate=!0}}function zd(t,e,i,n,r,s,o){kd.set(r,s,o).unproject(n);const a=e[t];if(void 0!==a){const t=i.getAttribute("position");for(let e=0,i=a.length;e<i;e++)t.setXYZ(a[e],kd.x,kd.y,kd.z)}}const Gd=new $i;class Vd extends Rh{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new jr;r.setIndex(new Sr(i,1)),r.setAttribute("position",new Sr(n,3)),super(r,new wh({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Gd.setFromObject(this.object),Gd.isEmpty())return;const e=Gd.min,i=Gd.max,n=this.geometry.attributes.position,r=n.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=e.x,r[4]=i.y,r[5]=i.z,r[6]=e.x,r[7]=e.y,r[8]=i.z,r[9]=i.x,r[10]=e.y,r[11]=i.z,r[12]=i.x,r[13]=i.y,r[14]=e.z,r[15]=e.x,r[16]=i.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=i.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t){return Rh.prototype.copy.call(this,t),this.object=t.object,this}}class Hd extends Rh{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new jr;n.setIndex(new Sr(i,1)),n.setAttribute("position",new Ir([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new wh({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}}class Wd extends Ah{constructor(t,e=1,i=16776960){const n=i,r=new jr;r.setAttribute("position",new Ir([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),super(r,new wh({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const s=new jr;s.setAttribute("position",new Ir([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new cs(s,new Tr({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){let e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?m:f,this.lookAt(this.plane.normal),super.updateMatrixWorld(t)}}const Xd=new Ki;let jd,Yd;class qd extends Kn{constructor(t,e,i,n,r,s){super(),this.type="ArrowHelper",void 0===t&&(t=new Ki(0,0,1)),void 0===e&&(e=new Ki(0,0,0)),void 0===i&&(i=1),void 0===n&&(n=16776960),void 0===r&&(r=.2*i),void 0===s&&(s=.2*r),void 0===jd&&(jd=new jr,jd.setAttribute("position",new Ir([0,0,0,0,1,0],3)),Yd=new Wh(0,.5,1,5,1),Yd.translate(0,-.5,0)),this.position.copy(e),this.line=new Ah(jd,new wh({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new cs(Yd,new Tr({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,s)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Xd.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Xd,e)}}setLength(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}}class Zd extends Rh{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new jr;i.setAttribute("position",new Ir(e,3)),i.setAttribute("color",new Ir([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(i,new wh({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}}const Kd=new Float32Array(1),Jd=new Int32Array(Kd.buffer),Qd={toHalfFloat:function(t){Kd[0]=t;const e=Jd[0];let i=e>>16&32768,n=e>>12&2047;const r=e>>23&255;return r<103?i:r>142?(i|=31744,i|=(255==r?0:1)&&8388607&e,i):r<113?(n|=2048,i|=(n>>114-r)+(n>>113-r&1),i):(i|=r-112<<10|n>>1,i+=1&n,i)}},$d=Math.pow(2,8),tp=[.125,.215,.35,.446,.526,.582],ep=5+tp.length,ip={[Ke]:0,[Je]:1,[$e]:2,[ei]:3,[ii]:4,[ni]:5,[Qe]:6},np=new Tr({side:m,depthWrite:!1,depthTest:!1}),rp=new cs(new ds,np),sp=new nu,{_lodPlanes:op,_sizeLods:ap,_sigmas:hp}=vp(),lp=new yr;let cp=null;const up=(1+Math.sqrt(5))/2,dp=1/up,pp=[new Ki(1,1,1),new Ki(-1,1,1),new Ki(1,1,-1),new Ki(-1,1,-1),new Ki(0,up,dp),new Ki(0,up,-dp),new Ki(dp,0,up),new Ki(-dp,0,up),new Ki(up,dp,0),new Ki(-up,dp,0)];function fp(t){const e=Math.max(t.r,t.g,t.b),i=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);t.multiplyScalar(Math.pow(2,-i));return(i+128)/255}class mp{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const e=new Float32Array(t),i=new Ki(0,1,0);return new Wl({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i},inputEncoding:{value:ip[Ke]},outputEncoding:{value:ip[Ke]}},vertexShader:Tp(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t${_p()}\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:x,depthTest:!1,depthWrite:!1})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,n=100){cp=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t){return this._fromTexture(t)}fromCubemap(t){return this._fromTexture(t)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=wp(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=bp(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t<op.length;t++)op[t].dispose()}_cleanup(t){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(cp),t.scissorTest=!1,xp(t,0,0,t.width,t.height)}_fromTexture(t){cp=this._renderer.getRenderTarget();const e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e}_allocateTargets(t){const e={magFilter:ft,minFilter:ft,generateMipmaps:!1,type:Et,format:Gt,encoding:gp(t)?t.encoding:$e,depthBuffer:!1},i=yp(e);return i.depthBuffer=!t,this._pingPongRenderTarget=yp(e),i}_compileMaterial(t){const e=new cs(op[0],t);this._renderer.compile(e,sp)}_sceneToCubeUV(t,e,i,n){const r=new ys(90,1,e,i),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,h=a.autoClear,l=a.outputEncoding,c=a.toneMapping;a.getClearColor(lp),a.toneMapping=Q,a.outputEncoding=Ke,a.autoClear=!1;let u=!1;const d=t.background;if(d){if(d.isColor){np.color.copy(d).convertSRGBToLinear(),t.background=null;const e=fp(np.color);np.opacity=e,u=!0}}else{np.color.copy(lp).convertSRGBToLinear();const t=fp(np.color);np.opacity=t,u=!0}for(let e=0;e<6;e++){const i=e%3;0==i?(r.up.set(0,s[e],0),r.lookAt(o[e],0,0)):1==i?(r.up.set(0,0,s[e]),r.lookAt(0,o[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,o[e])),xp(n,i*$d,e>2?$d:0,$d,$d),a.setRenderTarget(n),u&&a.render(rp,r),a.render(t,r)}a.toneMapping=c,a.outputEncoding=l,a.autoClear=h}_textureToCubeUV(t,e){const i=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=wp()):null==this._equirectShader&&(this._equirectShader=bp());const n=t.isCubeTexture?this._cubemapShader:this._equirectShader,r=new cs(op[0],n),s=n.uniforms;s.envMap.value=t,t.isCubeTexture||s.texelSize.value.set(1/t.image.width,1/t.image.height),s.inputEncoding.value=ip[t.encoding],s.outputEncoding.value=ip[e.texture.encoding],xp(e,0,0,3*$d,2*$d),i.setRenderTarget(e),i.render(r,sp)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e<ep;e++){const i=Math.sqrt(hp[e]*hp[e]-hp[e-1]*hp[e-1]),n=pp[(e-1)%pp.length];this._blur(t,e-1,e,i,n)}e.autoClear=i}_blur(t,e,i,n,r){const s=this._pingPongRenderTarget;this._halfBlur(t,s,e,i,n,"latitudinal",r),this._halfBlur(s,t,i,i,n,"longitudinal",r)}_halfBlur(t,e,i,n,r,s,o){const a=this._renderer,h=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const l=new cs(op[n],h),c=h.uniforms,u=ap[i]-1,d=isFinite(r)?Math.PI/(2*u):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):20;f>20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/p,i=Math.exp(-e*e/2);m.push(i),0==t?g+=i:t<f&&(g+=2*i)}for(let t=0;t<m.length;t++)m[t]=m[t]/g;c.envMap.value=t.texture,c.samples.value=f,c.weights.value=m,c.latitudinal.value="latitudinal"===s,o&&(c.poleAxis.value=o),c.dTheta.value=d,c.mipInt.value=8-i,c.inputEncoding.value=ip[t.texture.encoding],c.outputEncoding.value=ip[t.texture.encoding];const v=ap[n];xp(e,3*Math.max(0,$d-2*v),(0===n?0:2*$d)+2*v*(n>4?n-8+4:0),3*v,2*v),a.setRenderTarget(e),a.render(l,sp)}}function gp(t){return void 0!==t&&t.type===Et&&(t.encoding===Ke||t.encoding===Je||t.encoding===Qe)}function vp(){const t=[],e=[],i=[];let n=8;for(let r=0;r<ep;r++){const s=Math.pow(2,n);e.push(s);let o=1/s;r>4?o=tp[r-8+4-1]:0==r&&(o=0),i.push(o);const a=1/(s-1),h=-a/2,l=1+a/2,c=[h,h,l,h,l,l,h,h,l,l,h,l],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let t=0;t<u;t++){const e=t%3*2/3-1,i=t>2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];g.set(n,p*d*t),v.set(c,f*d*t);const r=[t,t,t,t,t,t];y.set(r,m*d*t)}const x=new jr;x.setAttribute("position",new Sr(g,p)),x.setAttribute("uv",new Sr(v,f)),x.setAttribute("faceIndex",new Sr(y,m)),t.push(x),n>4&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:i}}function yp(t){const e=new Yi(3*$d,3*$d,t);return e.texture.mapping=lt,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function xp(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function bp(){return new Wl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new Ui(1,1)},inputEncoding:{value:ip[Ke]},outputEncoding:{value:ip[Ke]}},vertexShader:Tp(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t${_p()}\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:x,depthTest:!1,depthWrite:!1})}function wp(){return new Wl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:ip[Ke]},outputEncoding:{value:ip[Ke]}},vertexShader:Tp(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t${_p()}\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:x,depthTest:!1,depthWrite:!1})}function Tp(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function _p(){return"\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t"}function Ep(t,e,i,n,r,s,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new xr(t,e,i,r,s,o)}const Sp=0,Mp=1,Ap=0,Cp=1,Pp=2;function Rp(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function Lp(t=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function Op(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new kh(t,e)}function Dp(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new eh(t)}function Ip(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new kh(t,e)}function Fp(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Oh(t)}function Bp(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Oh(t)}function kp(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Oh(t)}function Np(t,e,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Ki(t,e,i)}function Up(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Sr(t,e).setUsage(Si)}function zp(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Mr(t,e)}function Gp(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Ar(t,e)}function Vp(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Cr(t,e)}function Hp(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Pr(t,e)}function Wp(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Rr(t,e)}function Xp(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Lr(t,e)}function jp(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Or(t,e)}function Yp(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Ir(t,e)}function qp(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Fr(t,e)}function Zp(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Fc.call(this,t),this.type="catmullrom",this.closed=!0}function Kp(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Fc.call(this,t),this.type="catmullrom"}function Jp(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Fc.call(this,t),this.type="catmullrom"}function Qp(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Zd(t)}function $p(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Vd(t,e)}function tf(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Rh(new Qh(t.geometry),new wh({color:void 0!==e?e:16777215}))}function ef(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Rh(new Gl(t.geometry),new wh({color:void 0!==e?e:16777215}))}function nf(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new bc(t)}function rf(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Sc(t)}function sf(t,e,i){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new ws(t,i)}Ac.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Ac.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(qc.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Zp.prototype=Object.create(Fc.prototype),Kp.prototype=Object.create(Fc.prototype),Jp.prototype=Object.create(Fc.prototype),Object.assign(Jp.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Ld.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Sd.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(yc.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),uu.extractUrlBase(t)}}),yc.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(md.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign($i.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(gn.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ss.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},yd.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(Ni,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Ni.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Ni.ceilPowerOfTwo(t)}}),Object.assign(zi.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),Object.assign(Sn.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Ki).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,i,n,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,i,r,s)},getInverse:function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),tr.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Object.assign(Zi.prototype,{multiplyVector3:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(En.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(ur.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(ur,{barycoordFromPoint:function(t,e,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ur.getBarycoord(t,e,i,n,r)},normal:function(t,e,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ur.getNormal(t,e,i,n)}}),Object.assign(Zc.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Al(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Il(this,t)}}),Object.assign(Ui.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ki.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ji.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Kn.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(Kn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(cs.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(cs.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),Ye},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(sh.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(mh.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),uh.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Ac.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),ys.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Kc.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Sr.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Si},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Si)}}}),Object.assign(Sr.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Si:Ei),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(jr.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Sr(arguments[1],arguments[2])))},addDrawCall:function(t,e,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(jr.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(du.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(ld.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(Na.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===Si},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(Na.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Si:Ei),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Al.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(ka.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(od.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(wr.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new yr}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===v}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Yl.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(jl.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(gs.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Da.prototype,{clearTarget:function(t,e,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,i,n)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Da.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?Je:Ke}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Ea.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Yi.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Uu.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return(new Mu).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Xu.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},xs.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},xs.prototype.clear=function(t,e,i,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(t,e,i,n)};const of={merge:function(t,e,i){let n;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),n=e.matrix,e=e.geometry),t.merge(e,n,i)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};function af(){console.error("THREE.CanvasRenderer has been removed")}function hf(){console.error("THREE.JSONLoader has been removed.")}Vi.crossOrigin=void 0,Vi.loadTexture=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new Mc;r.setCrossOrigin(this.crossOrigin);const s=r.load(t,i,void 0,n);return e&&(s.mapping=e),s},Vi.loadTextureCube=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new Ec;r.setCrossOrigin(this.crossOrigin);const s=r.load(t,i,void 0,n);return e&&(s.mapping=e),s},Vi.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Vi.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const lf={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function cf(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:n}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=n)},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.DotScreenShader=e.GlitchPass=e.ShaderPass=e.RenderPass=e.EffectComposer=e.PointerDrag=e.PointerLock=e.FirstPersonControls=e.ThirdPersonControls=e.JoyStick=e.Types=e.THREE=e.ExtendedGroup=e.ExtendedObject3D=e.ExtendedMesh=e.Canvas=e.PhysicsLoader=e.enable3d=e.Scene3D=void 0;var n=i(23);Object.defineProperty(e,"Scene3D",{enumerable:!0,get:function(){return n.Scene3D}});var r=i(67);Object.defineProperty(e,"enable3d",{enumerable:!0,get:function(){return r.enable3d}});var s=i(11);Object.defineProperty(e,"PhysicsLoader",{enumerable:!0,get:function(){return s.PhysicsLoader}});const o=i(68);e.Canvas=o.default;var a=i(6);Object.defineProperty(e,"ExtendedMesh",{enumerable:!0,get:function(){return a.ExtendedMesh}});var h=i(10);Object.defineProperty(e,"ExtendedObject3D",{enumerable:!0,get:function(){return h.ExtendedObject3D}});var l=i(15);Object.defineProperty(e,"ExtendedGroup",{enumerable:!0,get:function(){return l.ExtendedGroup}});const c=i(2);e.THREE=c;const u=i(4);e.Types=u;var d=i(69);Object.defineProperty(e,"JoyStick",{enumerable:!0,get:function(){return d.JoyStick}});var p=i(70);Object.defineProperty(e,"ThirdPersonControls",{enumerable:!0,get:function(){return p.ThirdPersonControls}});var f=i(71);Object.defineProperty(e,"FirstPersonControls",{enumerable:!0,get:function(){return f.FirstPersonControls}});var m=i(72);Object.defineProperty(e,"PointerLock",{enumerable:!0,get:function(){return m.PointerLock}});var g=i(73);Object.defineProperty(e,"PointerDrag",{enumerable:!0,get:function(){return g.PointerDrag}});var v=i(2);Object.defineProperty(e,"EffectComposer",{enumerable:!0,get:function(){return v.EffectComposer}}),Object.defineProperty(e,"RenderPass",{enumerable:!0,get:function(){return v.RenderPass}}),Object.defineProperty(e,"ShaderPass",{enumerable:!0,get:function(){return v.ShaderPass}}),Object.defineProperty(e,"GlitchPass",{enumerable:!0,get:function(){return v.GlitchPass}}),Object.defineProperty(e,"DotScreenShader",{enumerable:!0,get:function(){return v.DotScreenShader}})},function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),r=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),e.DotScreenShader=e.GlitchPass=e.ShaderPass=e.RenderPass=e.EffectComposer=e.WEBGL=e.OrbitControls=e.Water=e.Sky=e.AnimationAction=e.VRButton=e.SVGLoader=e.XRControllerModelFactory=e.GLTFLoader=e.FBXLoader=e.ConvexGeometry=e.Face3=e.Geometry=void 0,r(i(0),e);var s=i(27);Object.defineProperty(e,"Geometry",{enumerable:!0,get:function(){return s.Geometry}});var o=i(28);Object.defineProperty(e,"Face3",{enumerable:!0,get:function(){return o.Face3}});var a=i(95);Object.defineProperty(e,"ConvexGeometry",{enumerable:!0,get:function(){return a.ConvexGeometry}});var h=i(90);Object.defineProperty(e,"FBXLoader",{enumerable:!0,get:function(){return h.FBXLoader}});var l=i(12);Object.defineProperty(e,"GLTFLoader",{enumerable:!0,get:function(){return l.GLTFLoader}});var c=i(93);Object.defineProperty(e,"XRControllerModelFactory",{enumerable:!0,get:function(){return c.XRControllerModelFactory}});var u=i(29);Object.defineProperty(e,"SVGLoader",{enumerable:!0,get:function(){return u.SVGLoader}});var d=i(30);Object.defineProperty(e,"VRButton",{enumerable:!0,get:function(){return d.VRButton}});var p=i(94);Object.defineProperty(e,"AnimationAction",{enumerable:!0,get:function(){return p.AnimationAction}});var f=i(31);Object.defineProperty(e,"Sky",{enumerable:!0,get:function(){return f.Sky}});var m=i(91);Object.defineProperty(e,"Water",{enumerable:!0,get:function(){return m.Water}});var g=i(32);Object.defineProperty(e,"OrbitControls",{enumerable:!0,get:function(){return g.OrbitControls}});var v=i(33);Object.defineProperty(e,"WEBGL",{enumerable:!0,get:function(){return v.WEBGL}});var y=i(92);Object.defineProperty(e,"EffectComposer",{enumerable:!0,get:function(){return y.EffectComposer}});var x=i(34);Object.defineProperty(e,"RenderPass",{enumerable:!0,get:function(){return x.RenderPass}});var b=i(8);Object.defineProperty(e,"ShaderPass",{enumerable:!0,get:function(){return b.ShaderPass}});var w=i(96);Object.defineProperty(e,"GlitchPass",{enumerable:!0,get:function(){return w.GlitchPass}});var T=i(35);Object.defineProperty(e,"DotScreenShader",{enumerable:!0,get:function(){return T.DotScreenShader}});const _="Three.js r"+i(0).REVISION;console.log(`%c %c %c %c %c ${_} %c https://threejs.org/`,"background: #ff0000","background: #ffff00","background: #00ff00","background: #00ffff","color: #fff; background: #000000;","background: none")},function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var n,r,s,o=i(0);function a(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}Object.assign(a.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),a.FullScreenQuad=(n=new o.OrthographicCamera(-1,1,1,-1,0,1),r=new o.PlaneGeometry(2,2),s=function(t){this._mesh=new o.Mesh(r,t)},Object.defineProperty(s.prototype,"material",{get:function(){return this._mesh.material},set:function(t){this._mesh.material=t}}),Object.assign(s.prototype,{dispose:function(){this._mesh.geometry.dispose()},render:function(t){t.render(this._mesh,n)}}),s)},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.Points=e.Line=e.Material=e.Mesh=e.Object3D=e.AnimationAction=e.AnimationClip=e.AnimationMixer=e.ExtendedMesh=e.ExtendedObject3D=void 0;const n=i(10);Object.defineProperty(e,"ExtendedObject3D",{enumerable:!0,get:function(){return n.ExtendedObject3D}});const r=i(6);Object.defineProperty(e,"ExtendedMesh",{enumerable:!0,get:function(){return r.ExtendedMesh}});var s=i(2);Object.defineProperty(e,"AnimationMixer",{enumerable:!0,get:function(){return s.AnimationMixer}}),Object.defineProperty(e,"AnimationClip",{enumerable:!0,get:function(){return s.AnimationClip}}),Object.defineProperty(e,"AnimationAction",{enumerable:!0,get:function(){return s.AnimationAction}}),Object.defineProperty(e,"Object3D",{enumerable:!0,get:function(){return s.Object3D}}),Object.defineProperty(e,"Mesh",{enumerable:!0,get:function(){return s.Mesh}}),Object.defineProperty(e,"Material",{enumerable:!0,get:function(){return s.Material}}),Object.defineProperty(e,"Line",{enumerable:!0,get:function(){return s.Line}}),Object.defineProperty(e,"Points",{enumerable:!0,get:function(){return s.Points}}),Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return s.Group}})},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,r="~";function s(){}function o(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,i,n,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new o(i,n||t,s),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(r=!1)),l.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=new Array(s);n<s;n++)o[n]=i[n].fn;return o},l.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},l.prototype.emit=function(t,e,i,n,s,o){var a=r?r+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,n),!0;case 5:return c.fn.call(c.context,e,i,n,s),!0;case 6:return c.fn.call(c.context,e,i,n,s,o),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,i);break;case 4:c[l].fn.call(c[l].context,e,i,n);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},l.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},l.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},l.prototype.removeListener=function(t,e,i,n){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return h(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||n&&!o.once||i&&o.context!==i||h(this,s);else{for(var a=0,l=[],c=o.length;a<c;a++)(o[a].fn!==e||n&&!o[a].once||i&&o[a].context!==i)&&l.push(o[a]);l.length?this._events[s]=1===l.length?l[0]:l:h(this,s)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&h(this,e)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,t.exports=l},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedMesh=void 0;const n=i(2);class r extends n.Mesh{constructor(t,e){super(t,e),this.vector3=new n.Vector3,this.isGroup=!1,this.hasBody=!1,this.name="object-"+this.id}get world(){return{theta:this.worldTheta,phi:this.worldPhi}}get worldTheta(){return this.getWorldDirection(this.vector3),Math.atan2(this.vector3.x,this.vector3.z)}get worldPhi(){return this.getWorldDirection(this.vector3),Math.acos(this.vector3.y)}}e.ExtendedMesh=r},,function(t,e,i){"use strict";i.r(e),i.d(e,"ShaderPass",(function(){return s}));var n=i(0),r=i(3),s=function(t,e){r.a.call(this),this.textureID=void 0!==e?e:"tDiffuse",t instanceof n.ShaderMaterial?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=n.UniformsUtils.clone(t.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new r.a.FullScreenQuad(this.material)};s.prototype=Object.assign(Object.create(r.a.prototype),{constructor:s,render:function(t,e,i){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=t=>{console.error(`%c [enable3d] ${t} `,"background: #222; color: #bada55")}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedObject3D=void 0;const n=i(2);class r extends n.Object3D{constructor(){super(),this.vector3=new n.Vector3,this.isGroup=!1,this.hasBody=!1,this.anims={},this._currentAnimation="",this._animationActions=new Map,this.name="object-"+this.id}setAction(t){console.warn("[enable3d] setAction(name) is deprecated. Use animation.play(name) instead!"),this.animationPlay(t)}get world(){return{theta:this.worldTheta,phi:this.worldPhi}}get worldTheta(){return this.getWorldDirection(this.vector3),Math.atan2(this.vector3.x,this.vector3.z)}get worldPhi(){return this.getWorldDirection(this.vector3),Math.acos(this.vector3.y)}get animation(){return{current:this._currentAnimation,add:(t,e)=>this.animationAdd(t,e),play:(t,e=500,i=!0)=>this.animationPlay(t,e,i),mixer:this.animationMixer}}set animationMixer(t){this._animationMixer=t}get animationMixer(){return this._animationMixer||(this._animationMixer=new n.AnimationMixer(this)),this._animationMixer}animationAdd(t,e){this._animationActions.set(t,this.animationMixer.clipAction(e))}animationPlay(t,e=500,i=!0){const r=this._animationActions.get(t),s=this._animationActions.get(this._currentAnimation);r&&(r.reset(),s&&(r.crossFadeFrom(s,e/1e3,!0),r.clampWhenFinished=!0),i||r.setLoop(n.LoopOnce,0),r.play()),this._currentAnimation=t}}e.ExtendedObject3D=r,e.default=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PhysicsLoader=void 0;const n=i(18);e.PhysicsLoader=(t,e)=>{"undefined"!=typeof window&&(window.__loadPhysics=!0),n.default(t,()=>{Ammo().then(()=>{e()})})}},function(t,e,i){"use strict";i.r(e),i.d(e,"GLTFLoader",(function(){return r}));var n=i(0),r=function(){function t(t){n.Loader.call(this,t),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(t){return new a(t)})),this.register((function(t){return new l(t)})),this.register((function(t){return new c(t)})),this.register((function(t){return new h(t)})),this.register((function(t){return new s(t)})),this.register((function(t){return new u(t)}))}function e(){var t={};return{get:function(e){return t[e]},add:function(e,i){t[e]=i},remove:function(e){delete t[e]},removeAll:function(){t={}}}}t.prototype=Object.assign(Object.create(n.Loader.prototype),{constructor:t,load:function(t,e,i,r){var s,o=this;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(t),this.manager.itemStart(t);var a=function(e){r?r(e):console.error(e),o.manager.itemError(t),o.manager.itemEnd(t)},h=new n.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(t,(function(i){try{o.parse(i,s,(function(i){e(i),o.manager.itemEnd(t)}),a)}catch(t){a(t)}}),i,a)},setDRACOLoader:function(t){return this.dracoLoader=t,this},setDDSLoader:function(t){return this.ddsLoader=t,this},setKTX2Loader:function(t){return this.ktx2Loader=t,this},setMeshoptDecoder:function(t){return this.meshoptDecoder=t,this},register:function(t){return-1===this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.push(t),this},unregister:function(t){return-1!==this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this},parse:function(t,e,s,a){var h,l={},c={};if("string"==typeof t)h=t;else if(n.LoaderUtils.decodeText(new Uint8Array(t,0,4))===d){try{l[i.KHR_BINARY_GLTF]=new m(t)}catch(t){return void(a&&a(t))}h=l[i.KHR_BINARY_GLTF].content}else h=n.LoaderUtils.decodeText(new Uint8Array(t));var u=JSON.parse(h);if(void 0===u.asset||u.asset.version[0]<2)a&&a(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var p=new W(u,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});p.fileLoader.setRequestHeader(this.requestHeader);for(var f=0;f<this.pluginCallbacks.length;f++){var y=this.pluginCallbacks[f](p);c[y.name]=y,l[y.name]=!0}if(u.extensionsUsed)for(f=0;f<u.extensionsUsed.length;++f){var w=u.extensionsUsed[f],T=u.extensionsRequired||[];switch(w){case i.KHR_MATERIALS_UNLIT:l[w]=new o;break;case i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:l[w]=new x;break;case i.KHR_DRACO_MESH_COMPRESSION:l[w]=new g(u,this.dracoLoader);break;case i.MSFT_TEXTURE_DDS:l[w]=new r(this.ddsLoader);break;case i.KHR_TEXTURE_TRANSFORM:l[w]=new v;break;case i.KHR_MESH_QUANTIZATION:l[w]=new b;break;default:T.indexOf(w)>=0&&void 0===c[w]&&console.warn('THREE.GLTFLoader: Unknown extension "'+w+'".')}}p.setExtensions(l),p.setPlugins(c),p.parse(s,a)}}});var i={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function r(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=i.MSFT_TEXTURE_DDS,this.ddsLoader=t}function s(t){this.parser=t,this.name=i.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}function o(){this.name=i.KHR_MATERIALS_UNLIT}function a(t){this.parser=t,this.name=i.KHR_MATERIALS_CLEARCOAT}function h(t){this.parser=t,this.name=i.KHR_MATERIALS_TRANSMISSION}function l(t){this.parser=t,this.name=i.KHR_TEXTURE_BASISU}function c(t){this.parser=t,this.name=i.EXT_TEXTURE_WEBP,this.isSupported=null}function u(t){this.name=i.EXT_MESHOPT_COMPRESSION,this.parser=t}s.prototype._markDefs=function(){for(var t=this.parser,e=this.parser.json.nodes||[],i=0,n=e.length;i<n;i++){var r=e[i];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&t._addNodeRef(this.cache,r.extensions[this.name].light)}},s.prototype._loadLight=function(t){var e=this.parser,i="light:"+t,r=e.cache.get(i);if(r)return r;var s,o=e.json,a=((o.extensions&&o.extensions[this.name]||{}).lights||[])[t],h=new n.Color(16777215);void 0!==a.color&&h.fromArray(a.color);var l=void 0!==a.range?a.range:0;switch(a.type){case"directional":(s=new n.DirectionalLight(h)).target.position.set(0,0,-1),s.add(s.target);break;case"point":(s=new n.PointLight(h)).distance=l;break;case"spot":(s=new n.SpotLight(h)).distance=l,a.spot=a.spot||{},a.spot.innerConeAngle=void 0!==a.spot.innerConeAngle?a.spot.innerConeAngle:0,a.spot.outerConeAngle=void 0!==a.spot.outerConeAngle?a.spot.outerConeAngle:Math.PI/4,s.angle=a.spot.outerConeAngle,s.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,s.target.position.set(0,0,-1),s.add(s.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+a.type)}return s.position.set(0,0,0),s.decay=2,void 0!==a.intensity&&(s.intensity=a.intensity),s.name=e.createUniqueName(a.name||"light_"+t),r=Promise.resolve(s),e.cache.add(i,r),r},s.prototype.createNodeAttachment=function(t){var e=this,i=this.parser,n=i.json.nodes[t],r=(n.extensions&&n.extensions[this.name]||{}).light;return void 0===r?null:this._loadLight(r).then((function(t){return i._getNodeRef(e.cache,r,t)}))},o.prototype.getMaterialType=function(){return n.MeshBasicMaterial},o.prototype.extendParams=function(t,e,i){var r=[];t.color=new n.Color(1,1,1),t.opacity=1;var s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){var o=s.baseColorFactor;t.color.fromArray(o),t.opacity=o[3]}void 0!==s.baseColorTexture&&r.push(i.assignTexture(t,"map",s.baseColorTexture))}return Promise.all(r)},a.prototype.getMaterialType=function(t){var e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?n.MeshPhysicalMaterial:null},a.prototype.extendMaterialParams=function(t,e){var i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var s=[],o=r.extensions[this.name];if(void 0!==o.clearcoatFactor&&(e.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&s.push(i.assignTexture(e,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(e.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&s.push(i.assignTexture(e,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(s.push(i.assignTexture(e,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){var a=o.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new n.Vector2(a,-a)}return Promise.all(s)},h.prototype.getMaterialType=function(t){var e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?n.MeshPhysicalMaterial:null},h.prototype.extendMaterialParams=function(t,e){var i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();var r=[],s=n.extensions[this.name];return void 0!==s.transmissionFactor&&(e.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&r.push(i.assignTexture(e,"transmissionMap",s.transmissionTexture)),Promise.all(r)},l.prototype.loadTexture=function(t){var e=this.parser,i=e.json,n=i.textures[t];if(!n.extensions||!n.extensions[this.name])return null;var r=n.extensions[this.name],s=i.images[r.source],o=e.options.ktx2Loader;if(!o){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s,o)},c.prototype.loadTexture=function(t){var e=this.name,i=this.parser,n=i.json,r=n.textures[t];if(!r.extensions||!r.extensions[e])return null;var s=r.extensions[e],o=n.images[s.source],a=o.uri?i.options.manager.getHandler(o.uri):i.textureLoader;return this.detectSupport().then((function(r){if(r)return i.loadTextureImage(t,o,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(t)}))},c.prototype.detectSupport=function(){return this.isSupported||(this.isSupported=new Promise((function(t){var e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported},u.prototype.loadBufferView=function(t){var e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){var n=i.extensions[this.name],r=this.parser.getDependency("buffer",n.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([r,s.ready]).then((function(t){var e=n.byteOffset||0,i=n.byteLength||0,r=n.count,o=n.byteStride,a=new ArrayBuffer(r*o),h=new Uint8Array(t[0],e,i);return s.decodeGltfBuffer(new Uint8Array(a),r,o,h,n.mode,n.filter),a}))}return null};var d="glTF",p=1313821514,f=5130562;function m(t){this.name=i.KHR_BINARY_GLTF,this.content=null,this.body=null;var e=new DataView(t,0,12);if(this.header={magic:n.LoaderUtils.decodeText(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==d)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var r=this.header.length-12,s=new DataView(t,12),o=0;o<r;){var a=s.getUint32(o,!0);o+=4;var h=s.getUint32(o,!0);if(o+=4,h===p){var l=new Uint8Array(t,12+o,a);this.content=n.LoaderUtils.decodeText(l)}else if(h===f){var c=12+o;this.body=t.slice(c,c+a)}o+=a}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function g(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=i.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}function v(){this.name=i.KHR_TEXTURE_TRANSFORM}function y(t){n.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var e=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),i=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),a={specular:{value:(new n.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=a,this.onBeforeCompile=function(t){for(var n in a)t.uniforms[n]=a[n];t.fragmentShader=t.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",e).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(t){a.specular.value=t}},specularMap:{get:function(){return a.specularMap.value},set:function(t){a.specularMap.value=t,t?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(t){a.glossiness.value=t}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(t){a.glossinessMap.value=t,t?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function x(){return{name:i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return y},extendParams:function(t,e,i){var r=e.extensions[this.name];t.color=new n.Color(1,1,1),t.opacity=1;var s=[];if(Array.isArray(r.diffuseFactor)){var o=r.diffuseFactor;t.color.fromArray(o),t.opacity=o[3]}if(void 0!==r.diffuseTexture&&s.push(i.assignTexture(t,"map",r.diffuseTexture)),t.emissive=new n.Color(0,0,0),t.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,t.specular=new n.Color(1,1,1),Array.isArray(r.specularFactor)&&t.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var a=r.specularGlossinessTexture;s.push(i.assignTexture(t,"glossinessMap",a)),s.push(i.assignTexture(t,"specularMap",a))}return Promise.all(s)},createMaterial:function(t){var e=new y(t);return e.fog=!0,e.color=t.color,e.map=void 0===t.map?null:t.map,e.lightMap=null,e.lightMapIntensity=1,e.aoMap=void 0===t.aoMap?null:t.aoMap,e.aoMapIntensity=1,e.emissive=t.emissive,e.emissiveIntensity=1,e.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,e.bumpMap=void 0===t.bumpMap?null:t.bumpMap,e.bumpScale=1,e.normalMap=void 0===t.normalMap?null:t.normalMap,e.normalMapType=n.TangentSpaceNormalMap,t.normalScale&&(e.normalScale=t.normalScale),e.displacementMap=null,e.displacementScale=1,e.displacementBias=0,e.specularMap=void 0===t.specularMap?null:t.specularMap,e.specular=t.specular,e.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,e.glossiness=t.glossiness,e.alphaMap=null,e.envMap=void 0===t.envMap?null:t.envMap,e.envMapIntensity=1,e.refractionRatio=.98,e}}}function b(){this.name=i.KHR_MESH_QUANTIZATION}function w(t,e,i,r){n.Interpolant.call(this,t,e,i,r)}g.prototype.decodePrimitive=function(t,e){var i=this.json,n=this.dracoLoader,r=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,o={},a={},h={};for(var l in s){var c=D[l]||l.toLowerCase();o[c]=s[l]}for(l in t.attributes){c=D[l]||l.toLowerCase();if(void 0!==s[l]){var u=i.accessors[t.attributes[l]],d=P[u.componentType];h[c]=d,a[c]=!0===u.normalized}}return e.getDependency("bufferView",r).then((function(t){return new Promise((function(e){n.decodeDracoFile(t,(function(t){for(var i in t.attributes){var n=t.attributes[i],r=a[i];void 0!==r&&(n.normalized=r)}e(t)}),o,h)}))}))},v.prototype.extendTexture=function(t,e){return t=t.clone(),void 0!==e.offset&&t.offset.fromArray(e.offset),void 0!==e.rotation&&(t.rotation=e.rotation),void 0!==e.scale&&t.repeat.fromArray(e.scale),void 0!==e.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.needsUpdate=!0,t},y.prototype=Object.create(n.MeshStandardMaterial.prototype),y.prototype.constructor=y,y.prototype.copy=function(t){return n.MeshStandardMaterial.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},w.prototype=Object.create(n.Interpolant.prototype),w.prototype.constructor=w,w.prototype.copySampleValue_=function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n*3+n,s=0;s!==n;s++)e[s]=i[r+s];return e},w.prototype.beforeStart_=w.prototype.copySampleValue_,w.prototype.afterEnd_=w.prototype.copySampleValue_,w.prototype.interpolate_=function(t,e,i,n){for(var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=2*o,h=3*o,l=n-e,c=(i-e)/l,u=c*c,d=u*c,p=t*h,f=p-h,m=-2*d+3*u,g=d-u,v=1-m,y=g-u+c,x=0;x!==o;x++){var b=s[f+x+o],w=s[f+x+a]*l,T=s[p+x+o],_=s[p+x]*l;r[x]=v*b+y*w+m*T+g*_}return r};var T=0,_=1,E=2,S=3,M=4,A=5,C=6,P={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},R={9728:n.NearestFilter,9729:n.LinearFilter,9984:n.NearestMipmapNearestFilter,9985:n.LinearMipmapNearestFilter,9986:n.NearestMipmapLinearFilter,9987:n.LinearMipmapLinearFilter},L={33071:n.ClampToEdgeWrapping,33648:n.MirroredRepeatWrapping,10497:n.RepeatWrapping},O={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},D={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},I={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},F={CUBICSPLINE:void 0,LINEAR:n.InterpolateLinear,STEP:n.InterpolateDiscrete},B="OPAQUE",k="MASK",N="BLEND";function U(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}function z(t,e,i){for(var n in i.extensions)void 0===t[n]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=i.extensions[n])}function G(t,e){void 0!==e.extras&&("object"==typeof e.extras?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function V(t,e){if(t.updateMorphTargets(),void 0!==e.weights)for(var i=0,n=e.weights.length;i<n;i++)t.morphTargetInfluences[i]=e.weights[i];if(e.extras&&Array.isArray(e.extras.targetNames)){var r=e.extras.targetNames;if(t.morphTargetInfluences.length===r.length){t.morphTargetDictionary={};for(i=0,n=r.length;i<n;i++)t.morphTargetDictionary[r[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function H(t){for(var e="",i=Object.keys(t).sort(),n=0,r=i.length;n<r;n++)e+=i[n]+":"+t[i[n]]+";";return e}function W(t,i){this.json=t||{},this.extensions={},this.plugins={},this.options=i||{},this.cache=new e,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.nodeNamesUsed={},"undefined"!=typeof createImageBitmap&&!1===/Firefox/.test(navigator.userAgent)?this.textureLoader=new n.ImageBitmapLoader(this.options.manager):this.textureLoader=new n.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function X(t,e,i){var r=e.attributes,s=[];function o(e,n){return i.getDependency("accessor",e).then((function(e){t.setAttribute(n,e)}))}for(var a in r){var h=D[a]||a.toLowerCase();h in t.attributes||s.push(o(r[a],h))}if(void 0!==e.indices&&!t.index){var l=i.getDependency("accessor",e.indices).then((function(e){t.setIndex(e)}));s.push(l)}return G(t,e),function(t,e,i){var r=e.attributes,s=new n.Box3;if(void 0!==r.POSITION){var o=(f=i.json.accessors[r.POSITION]).min,a=f.max;if(void 0!==o&&void 0!==a){s.set(new n.Vector3(o[0],o[1],o[2]),new n.Vector3(a[0],a[1],a[2]));var h=e.targets;if(void 0!==h){for(var l=new n.Vector3,c=new n.Vector3,u=0,d=h.length;u<d;u++){var p=h[u];if(void 0!==p.POSITION){var f;o=(f=i.json.accessors[p.POSITION]).min,a=f.max;void 0!==o&&void 0!==a?(c.setX(Math.max(Math.abs(o[0]),Math.abs(a[0]))),c.setY(Math.max(Math.abs(o[1]),Math.abs(a[1]))),c.setZ(Math.max(Math.abs(o[2]),Math.abs(a[2]))),l.max(c)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(l)}t.boundingBox=s;var m=new n.Sphere;s.getCenter(m.center),m.radius=s.min.distanceTo(s.max)/2,t.boundingSphere=m}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(t,e,i),Promise.all(s).then((function(){return void 0!==e.targets?function(t,e,i){for(var n=!1,r=!1,s=0,o=e.length;s<o;s++){if(void 0!==(l=e[s]).POSITION&&(n=!0),void 0!==l.NORMAL&&(r=!0),n&&r)break}if(!n&&!r)return Promise.resolve(t);var a=[],h=[];for(s=0,o=e.length;s<o;s++){var l=e[s];if(n){var c=void 0!==l.POSITION?i.getDependency("accessor",l.POSITION):t.attributes.position;a.push(c)}if(r){c=void 0!==l.NORMAL?i.getDependency("accessor",l.NORMAL):t.attributes.normal;h.push(c)}}return Promise.all([Promise.all(a),Promise.all(h)]).then((function(e){var i=e[0],s=e[1];return n&&(t.morphAttributes.position=i),r&&(t.morphAttributes.normal=s),t.morphTargetsRelative=!0,t}))}(t,e.targets,i):t}))}function j(t,e){var i=t.getIndex();if(null===i){var r=[],s=t.getAttribute("position");if(void 0===s)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var o=0;o<s.count;o++)r.push(o);t.setIndex(r),i=t.getIndex()}var a=i.count-2,h=[];if(e===n.TriangleFanDrawMode)for(o=1;o<=a;o++)h.push(i.getX(0)),h.push(i.getX(o)),h.push(i.getX(o+1));else for(o=0;o<a;o++)o%2==0?(h.push(i.getX(o)),h.push(i.getX(o+1)),h.push(i.getX(o+2))):(h.push(i.getX(o+2)),h.push(i.getX(o+1)),h.push(i.getX(o)));h.length/3!==a&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var l=t.clone();return l.setIndex(h),l}return W.prototype.setExtensions=function(t){this.extensions=t},W.prototype.setPlugins=function(t){this.plugins=t},W.prototype.parse=function(t,e){var i=this,n=this.json,r=this.extensions;this.cache.removeAll(),this._invokeAll((function(t){return t._markDefs&&t._markDefs()})),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(e){var s={scene:e[0][n.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:n.asset,parser:i,userData:{}};z(r,s,n),G(s,n),t(s)})).catch(e)},W.prototype._markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[],n=0,r=e.length;n<r;n++)for(var s=e[n].joints,o=0,a=s.length;o<a;o++)t[s[o]].isBone=!0;for(var h=0,l=t.length;h<l;h++){var c=t[h];void 0!==c.mesh&&(this._addNodeRef(this.meshCache,c.mesh),void 0!==c.skin&&(i[c.mesh].isSkinnedMesh=!0)),void 0!==c.camera&&this._addNodeRef(this.cameraCache,c.camera)}},W.prototype._addNodeRef=function(t,e){void 0!==e&&(void 0===t.refs[e]&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)},W.prototype._getNodeRef=function(t,e,i){if(t.refs[e]<=1)return i;var n=i.clone();return n.name+="_instance_"+t.uses[e]++,n},W.prototype._invokeOne=function(t){var e=Object.values(this.plugins);e.push(this);for(var i=0;i<e.length;i++){var n=t(e[i]);if(n)return n}},W.prototype._invokeAll=function(t){var e=Object.values(this.plugins);e.unshift(this);for(var i=[],n=0;n<e.length;n++){var r=t(e[n]);r&&i.push(r)}return i},W.prototype.getDependency=function(t,e){var i=t+":"+e,n=this.cache.get(i);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this.loadNode(e);break;case"mesh":n=this._invokeOne((function(t){return t.loadMesh&&t.loadMesh(e)}));break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne((function(t){return t.loadBufferView&&t.loadBufferView(e)}));break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne((function(t){return t.loadMaterial&&t.loadMaterial(e)}));break;case"texture":n=this._invokeOne((function(t){return t.loadTexture&&t.loadTexture(e)}));break;case"skin":n=this.loadSkin(e);break;case"animation":n=this.loadAnimation(e);break;case"camera":n=this.loadCamera(e);break;default:throw new Error("Unknown type: "+t)}this.cache.add(i,n)}return n},W.prototype.getDependencies=function(t){var e=this.cache.get(t);if(!e){var i=this,n=this.json[t+("mesh"===t?"es":"s")]||[];e=Promise.all(n.map((function(e,n){return i.getDependency(t,n)}))),this.cache.add(t,e)}return e},W.prototype.loadBuffer=function(t){var e=this.json.buffers[t],n=this.fileLoader;if(e.type&&"arraybuffer"!==e.type)throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(void 0===e.uri&&0===t)return Promise.resolve(this.extensions[i.KHR_BINARY_GLTF].body);var r=this.options;return new Promise((function(t,i){n.load(U(e.uri,r.path),t,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))}))}))},W.prototype.loadBufferView=function(t){var e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then((function(t){var i=e.byteLength||0,n=e.byteOffset||0;return t.slice(n,n+i)}))},W.prototype.loadAccessor=function(t){var e=this,i=this.json,r=this.json.accessors[t];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);var s=[];return void 0!==r.bufferView?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),void 0!==r.sparse&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then((function(t){var s,o,a=t[0],h=O[r.type],l=P[r.componentType],c=l.BYTES_PER_ELEMENT,u=c*h,d=r.byteOffset||0,p=void 0!==r.bufferView?i.bufferViews[r.bufferView].byteStride:void 0,f=!0===r.normalized;if(p&&p!==u){var m=Math.floor(d/p),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+m+":"+r.count,v=e.cache.get(g);v||(s=new l(a,m*p,r.count*p/c),v=new n.InterleavedBuffer(s,p/c),e.cache.add(g,v)),o=new n.InterleavedBufferAttribute(v,h,d%p/c,f)}else s=null===a?new l(r.count*h):new l(a,d,r.count*h),o=new n.BufferAttribute(s,h,f);if(void 0!==r.sparse){var y=O.SCALAR,x=P[r.sparse.indices.componentType],b=r.sparse.indices.byteOffset||0,w=r.sparse.values.byteOffset||0,T=new x(t[1],b,r.sparse.count*y),_=new l(t[2],w,r.sparse.count*h);null!==a&&(o=new n.BufferAttribute(o.array.slice(),o.itemSize,o.normalized));for(var E=0,S=T.length;E<S;E++){var M=T[E];if(o.setX(M,_[E*h]),h>=2&&o.setY(M,_[E*h+1]),h>=3&&o.setZ(M,_[E*h+2]),h>=4&&o.setW(M,_[E*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},W.prototype.loadTexture=function(t){var e,n,r=this.json,s=this.options,o=r.textures[t],a=o.extensions||{};return(e=a[i.MSFT_TEXTURE_DDS]?r.images[a[i.MSFT_TEXTURE_DDS].source]:r.images[o.source]).uri&&(n=s.manager.getHandler(e.uri)),n||(n=a[i.MSFT_TEXTURE_DDS]?this.extensions[i.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(t,e,n)},W.prototype.loadTextureImage=function(t,e,i){var r=this,s=this.json,o=this.options,a=s.textures[t],h=self.URL||self.webkitURL,l=e.uri,c=!1,u=!0;return"image/jpeg"===e.mimeType&&(u=!1),void 0!==e.bufferView&&(l=r.getDependency("bufferView",e.bufferView).then((function(t){if("image/png"===e.mimeType){var i=new DataView(t,25,1).getUint8(0,!1);u=6===i||4===i||3===i}c=!0;var n=new Blob([t],{type:e.mimeType});return l=h.createObjectURL(n)}))),Promise.resolve(l).then((function(t){return new Promise((function(e,r){var s=e;!0===i.isImageBitmapLoader&&(s=function(t){e(new n.CanvasTexture(t))}),i.load(U(t,o.path),s,void 0,r)}))})).then((function(e){!0===c&&h.revokeObjectURL(l),e.flipY=!1,a.name&&(e.name=a.name),u||(e.format=n.RGBFormat);var i=(s.samplers||{})[a.sampler]||{};return e.magFilter=R[i.magFilter]||n.LinearFilter,e.minFilter=R[i.minFilter]||n.LinearMipmapLinearFilter,e.wrapS=L[i.wrapS]||n.RepeatWrapping,e.wrapT=L[i.wrapT]||n.RepeatWrapping,r.associations.set(e,{type:"textures",index:t}),e}))},W.prototype.assignTexture=function(t,e,n){var r=this;return this.getDependency("texture",n.index).then((function(s){if(void 0===n.texCoord||0==n.texCoord||"aoMap"===e&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+e+" not yet supported."),r.extensions[i.KHR_TEXTURE_TRANSFORM]){var o=void 0!==n.extensions?n.extensions[i.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var a=r.associations.get(s);s=r.extensions[i.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,a)}}t[e]=s}))},W.prototype.assignFinalMaterial=function(t){var e=t.geometry,i=t.material,r=void 0!==e.attributes.tangent,s=void 0!==e.attributes.color,o=void 0===e.attributes.normal,a=!0===t.isSkinnedMesh,h=Object.keys(e.morphAttributes).length>0,l=h&&void 0!==e.morphAttributes.normal;if(t.isPoints){var c="PointsMaterial:"+i.uuid,u=this.cache.get(c);u||(u=new n.PointsMaterial,n.Material.prototype.copy.call(u,i),u.color.copy(i.color),u.map=i.map,u.sizeAttenuation=!1,this.cache.add(c,u)),i=u}else if(t.isLine){c="LineBasicMaterial:"+i.uuid;var d=this.cache.get(c);d||(d=new n.LineBasicMaterial,n.Material.prototype.copy.call(d,i),d.color.copy(i.color),this.cache.add(c,d)),i=d}if(r||s||o||a||h){c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),a&&(c+="skinning:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),h&&(c+="morph-targets:"),l&&(c+="morph-normals:");var p=this.cache.get(c);p||(p=i.clone(),a&&(p.skinning=!0),s&&(p.vertexColors=!0),o&&(p.flatShading=!0),h&&(p.morphTargets=!0),l&&(p.morphNormals=!0),r&&(p.vertexTangents=!0,p.normalScale&&(p.normalScale.y*=-1),p.clearcoatNormalScale&&(p.clearcoatNormalScale.y*=-1)),this.cache.add(c,p),this.associations.set(p,this.associations.get(i))),i=p}i.aoMap&&void 0===e.attributes.uv2&&void 0!==e.attributes.uv&&e.setAttribute("uv2",e.attributes.uv),t.material=i},W.prototype.getMaterialType=function(){return n.MeshStandardMaterial},W.prototype.loadMaterial=function(t){var e,r=this,s=this.json,o=this.extensions,a=s.materials[t],h={},l=a.extensions||{},c=[];if(l[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];e=u.getMaterialType(),c.push(u.extendParams(h,a,r))}else if(l[i.KHR_MATERIALS_UNLIT]){var d=o[i.KHR_MATERIALS_UNLIT];e=d.getMaterialType(),c.push(d.extendParams(h,a,r))}else{var p=a.pbrMetallicRoughness||{};if(h.color=new n.Color(1,1,1),h.opacity=1,Array.isArray(p.baseColorFactor)){var f=p.baseColorFactor;h.color.fromArray(f),h.opacity=f[3]}void 0!==p.baseColorTexture&&c.push(r.assignTexture(h,"map",p.baseColorTexture)),h.metalness=void 0!==p.metallicFactor?p.metallicFactor:1,h.roughness=void 0!==p.roughnessFactor?p.roughnessFactor:1,void 0!==p.metallicRoughnessTexture&&(c.push(r.assignTexture(h,"metalnessMap",p.metallicRoughnessTexture)),c.push(r.assignTexture(h,"roughnessMap",p.metallicRoughnessTexture))),e=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),c.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,h)}))))}!0===a.doubleSided&&(h.side=n.DoubleSide);var m=a.alphaMode||B;return m===N?(h.transparent=!0,h.depthWrite=!1):(h.transparent=!1,m===k&&(h.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&e!==n.MeshBasicMaterial&&(c.push(r.assignTexture(h,"normalMap",a.normalTexture)),h.normalScale=new n.Vector2(1,-1),void 0!==a.normalTexture.scale&&h.normalScale.set(a.normalTexture.scale,-a.normalTexture.scale)),void 0!==a.occlusionTexture&&e!==n.MeshBasicMaterial&&(c.push(r.assignTexture(h,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(h.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&e!==n.MeshBasicMaterial&&(h.emissive=(new n.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&e!==n.MeshBasicMaterial&&c.push(r.assignTexture(h,"emissiveMap",a.emissiveTexture)),Promise.all(c).then((function(){var s;return s=e===y?o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(h):new e(h),a.name&&(s.name=a.name),s.map&&(s.map.encoding=n.sRGBEncoding),s.emissiveMap&&(s.emissiveMap.encoding=n.sRGBEncoding),G(s,a),r.associations.set(s,{type:"materials",index:t}),a.extensions&&z(o,s,a),s}))},W.prototype.createUniqueName=function(t){for(var e=n.PropertyBinding.sanitizeNodeName(t||""),i=e,r=1;this.nodeNamesUsed[i];++r)i=e+"_"+r;return this.nodeNamesUsed[i]=!0,i},W.prototype.loadGeometries=function(t){var e=this,r=this.extensions,s=this.primitiveCache;function o(t){return r[i.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(i){return X(i,t,e)}))}for(var a,h,l=[],c=0,u=t.length;c<u;c++){var d,p=t[c],f=(h=void 0,(h=(a=p).extensions&&a.extensions[i.KHR_DRACO_MESH_COMPRESSION])?"draco:"+h.bufferView+":"+h.indices+":"+H(h.attributes):a.indices+":"+H(a.attributes)+":"+a.mode),m=s[f];if(m)l.push(m.promise);else d=p.extensions&&p.extensions[i.KHR_DRACO_MESH_COMPRESSION]?o(p):X(new n.BufferGeometry,p,e),s[f]={primitive:p,promise:d},l.push(d)}return Promise.all(l)},W.prototype.loadMesh=function(t){for(var e,i=this,r=this.json,s=this.extensions,o=r.meshes[t],a=o.primitives,h=[],l=0,c=a.length;l<c;l++){var u=void 0===a[l].material?(void 0===(e=this.cache).DefaultMaterial&&(e.DefaultMaterial=new n.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:n.FrontSide})),e.DefaultMaterial):this.getDependency("material",a[l].material);h.push(u)}return h.push(i.loadGeometries(a)),Promise.all(h).then((function(e){for(var r=e.slice(0,e.length-1),h=e[e.length-1],l=[],c=0,u=h.length;c<u;c++){var d,p=h[c],f=a[c],m=r[c];if(f.mode===M||f.mode===A||f.mode===C||void 0===f.mode)d=!0===o.isSkinnedMesh?new n.SkinnedMesh(p,m):new n.Mesh(p,m),!0===m.isMeshStandardMaterial&&m.side===n.DoubleSide&&null!==p.getIndex()&&!0===p.hasAttribute("position")&&!0===p.hasAttribute("normal")&&!0===p.hasAttribute("uv")&&!1===p.hasAttribute("tangent")&&(p.computeTangents(),m.vertexTangents=!0),!0!==d.isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),f.mode===A?d.geometry=j(d.geometry,n.TriangleStripDrawMode):f.mode===C&&(d.geometry=j(d.geometry,n.TriangleFanDrawMode));else if(f.mode===_)d=new n.LineSegments(p,m);else if(f.mode===S)d=new n.Line(p,m);else if(f.mode===E)d=new n.LineLoop(p,m);else{if(f.mode!==T)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+f.mode);d=new n.Points(p,m)}Object.keys(d.geometry.morphAttributes).length>0&&V(d,o),d.name=i.createUniqueName(o.name||"mesh_"+t),G(d,o),f.extensions&&z(s,d,f),i.assignFinalMaterial(d),l.push(d)}if(1===l.length)return l[0];var g=new n.Group;for(c=0,u=l.length;c<u;c++)g.add(l[c]);return g}))},W.prototype.loadCamera=function(t){var e,i=this.json.cameras[t],r=i[i.type];if(r)return"perspective"===i.type?e=new n.PerspectiveCamera(n.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===i.type&&(e=new n.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(e.name=this.createUniqueName(i.name)),G(e,i),Promise.resolve(e);console.warn("THREE.GLTFLoader: Missing camera parameters.")},W.prototype.loadSkin=function(t){var e=this.json.skins[t],i={joints:e.joints};return void 0===e.inverseBindMatrices?Promise.resolve(i):this.getDependency("accessor",e.inverseBindMatrices).then((function(t){return i.inverseBindMatrices=t,i}))},W.prototype.loadAnimation=function(t){for(var e=this.json.animations[t],i=[],r=[],s=[],o=[],a=[],h=0,l=e.channels.length;h<l;h++){var c=e.channels[h],u=e.samplers[c.sampler],d=c.target,p=void 0!==d.node?d.node:d.id,f=void 0!==e.parameters?e.parameters[u.input]:u.input,m=void 0!==e.parameters?e.parameters[u.output]:u.output;i.push(this.getDependency("node",p)),r.push(this.getDependency("accessor",f)),s.push(this.getDependency("accessor",m)),o.push(u),a.push(d)}return Promise.all([Promise.all(i),Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(a)]).then((function(i){for(var r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=[],c=0,u=r.length;c<u;c++){var d=r[c],p=s[c],f=o[c],m=a[c],g=h[c];if(void 0!==d){var v;switch(d.updateMatrix(),d.matrixAutoUpdate=!0,I[g.path]){case I.weights:v=n.NumberKeyframeTrack;break;case I.rotation:v=n.QuaternionKeyframeTrack;break;case I.position:case I.scale:default:v=n.VectorKeyframeTrack}var y=d.name?d.name:d.uuid,x=void 0!==m.interpolation?F[m.interpolation]:n.InterpolateLinear,b=[];I[g.path]===I.weights?d.traverse((function(t){!0===t.isMesh&&t.morphTargetInfluences&&b.push(t.name?t.name:t.uuid)})):b.push(y);var T=f.array;if(f.normalized){var _;if(T.constructor===Int8Array)_=1/127;else if(T.constructor===Uint8Array)_=1/255;else if(T.constructor==Int16Array)_=1/32767;else{if(T.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");_=1/65535}for(var E=new Float32Array(T.length),S=0,M=T.length;S<M;S++)E[S]=T[S]*_;T=E}for(S=0,M=b.length;S<M;S++){var A=new v(b[S]+"."+I[g.path],p.array,T,x);"CUBICSPLINE"===m.interpolation&&(A.createInterpolant=function(t){return new w(this.times,this.values,this.getValueSize()/3,t)},A.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(A)}}}var C=e.name?e.name:"animation_"+t;return new n.AnimationClip(C,void 0,l)}))},W.prototype.loadNode=function(t){var e,i=this.json,r=this.extensions,s=this,o=i.nodes[t],a=o.name?s.createUniqueName(o.name):"";return(e=[],void 0!==o.mesh&&e.push(s.getDependency("mesh",o.mesh).then((function(t){var e=s._getNodeRef(s.meshCache,o.mesh,t);return void 0!==o.weights&&e.traverse((function(t){if(t.isMesh)for(var e=0,i=o.weights.length;e<i;e++)t.morphTargetInfluences[e]=o.weights[e]})),e}))),void 0!==o.camera&&e.push(s.getDependency("camera",o.camera).then((function(t){return s._getNodeRef(s.cameraCache,o.camera,t)}))),s._invokeAll((function(e){return e.createNodeAttachment&&e.createNodeAttachment(t)})).forEach((function(t){e.push(t)})),Promise.all(e)).then((function(e){var i;if((i=!0===o.isBone?new n.Bone:e.length>1?new n.Group:1===e.length?e[0]:new n.Object3D)!==e[0])for(var h=0,l=e.length;h<l;h++)i.add(e[h]);if(o.name&&(i.userData.name=o.name,i.name=a),G(i,o),o.extensions&&z(r,i,o),void 0!==o.matrix){var c=new n.Matrix4;c.fromArray(o.matrix),i.applyMatrix4(c)}else void 0!==o.translation&&i.position.fromArray(o.translation),void 0!==o.rotation&&i.quaternion.fromArray(o.rotation),void 0!==o.scale&&i.scale.fromArray(o.scale);return s.associations.set(i,{type:"nodes",index:t}),i}))},W.prototype.loadScene=function(){function t(e,i,r,s){var o=r.nodes[e];return s.getDependency("node",e).then((function(t){return void 0===o.skin?t:s.getDependency("skin",o.skin).then((function(t){for(var i=[],n=0,r=(e=t).joints.length;n<r;n++)i.push(s.getDependency("node",e.joints[n]));return Promise.all(i)})).then((function(i){return t.traverse((function(t){if(t.isMesh){for(var r=[],s=[],o=0,a=i.length;o<a;o++){var h=i[o];if(h){r.push(h);var l=new n.Matrix4;void 0!==e.inverseBindMatrices&&l.fromArray(e.inverseBindMatrices.array,16*o),s.push(l)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[o])}t.bind(new n.Skeleton(r,s),t.matrixWorld)}})),t}));var e})).then((function(e){i.add(e);var n=[];if(o.children)for(var a=o.children,h=0,l=a.length;h<l;h++){var c=a[h];n.push(t(c,e,r,s))}return Promise.all(n)}))}return function(e){var i=this.json,r=this.extensions,s=this.json.scenes[e],o=new n.Group;s.name&&(o.name=this.createUniqueName(s.name)),G(o,s),s.extensions&&z(r,o,s);for(var a=s.nodes||[],h=[],l=0,c=a.length;l<c;l++)h.push(t(a[l],o,i,this));return Promise.all(h).then((function(){return o}))}}(),t}()},function(t,e,i){var n;window,n=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1497)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function r(t,e,r,s){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,r);if(!1!==h){if(n((s||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)r(t,e[i].prototype||e[i])}}function o(t){var e,i;if(t||(t={}),t.initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var n=t.Extends;e=function(){n.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,i=t.Extends,delete t.Extends):e.prototype.constructor=e;var o=null;return t.Mixins&&(o=t.Mixins,delete t.Mixins),s(e,o),r(e,t,!0,i),e}o.extend=r,o.mixin=s,o.ignoreFinals=!1,t.exports=o},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(123),s=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new s(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)}});s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(55),s=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(24),s=i(21),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},r.register("GameObjectFactory",o,"add"),t.exports=o},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,s=i,o=0;o<n.length;o++){if(!r.hasOwnProperty(n[o])){s=i;break}s=r[n[o]],r=r[n[o]]}return s}return i}return i}},function(t,e){t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={},n={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=n},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,r="~";function s(){}function o(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,i,n,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new o(i,n||t,s),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(r=!1)),l.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=new Array(s);n<s;n++)o[n]=i[n].fn;return o},l.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},l.prototype.emit=function(t,e,i,n,s,o){var a=r?r+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,n),!0;case 5:return c.fn.call(c.context,e,i,n,s),!0;case 6:return c.fn.call(c.context,e,i,n,s,o),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,i);break;case 4:c[l].fn.call(c[l].context,e,i,n);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},l.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},l.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},l.prototype.removeListener=function(t,e,i,n){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return h(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||n&&!o.once||i&&o.context!==i||h(this,s);else{for(var a=0,l=[],c=o.length;a<c;a++)(o[a].fn!==e||n&&!o[a].once||i&&o[a].context!==i)&&l.push(o[a]);l.length?this._events[s]=1===l.length?l[0]:l:h(this,s)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&h(this,e)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(56),s=i(167),o=i(300),a=i(55),h=i(45),l=i(170),c=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Alpha:i(605),AlphaSingle:i(297),BlendMode:i(298),ComputedSize:i(606),Crop:i(607),Depth:i(299),Flip:i(608),GetBounds:i(609),Mask:i(303),Origin:i(630),PathFollower:i(631),Pipeline:i(171),ScrollFactor:i(306),Size:i(632),Texture:i(633),TextureCrop:i(634),Tint:i(635),ToJSON:i(173),Transform:i(307),TransformMatrix:i(25),Visible:i(308)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @author Matthew Groves <@doormat>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
function i(t){for(var e="",i=0;i<t;++i)i>0&&(e+="\nelse "),i<t-1&&(e+="if(test == "+i+".0){}");return e}t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){e&&-1!==e||(e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));for(var n=t.createShader(t.FRAGMENT_SHADER),r=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");;){var s=r.replace(/%forloop%/gi,i(e));if(t.shaderSource(n,s),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))break;e=e/2|0}return e},parseFragmentShaderMaxTextures:function(t,e){if(!t)return"";for(var i="",n=0;n<e;n++)n>0&&(i+="\n\telse "),n<e-1&&(i+="if (outTexId < "+n+".5)"),i+="\n\t{",i+="\n\t\ttexture = texture2D(uMainSampler["+n+"], outTexCoord);",i+="\n\t}";return(t=t.replace(/%count%/gi,e.toString())).replace(/%forloop%/gi,i)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(190),r=i(6);t.exports=function(t,e,i){var s=r(t,e,null);if(null===s)return i;if(Array.isArray(s))return n.RND.pick(s);if("object"==typeof s){if(s.hasOwnProperty("randInt"))return n.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return n.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"==typeof s)return s(e);return s}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=i},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(173),s=i(98),o=i(9),a=i(75),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(){this.scene&&!this.ignoreDestroy&&(this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.displayList&&(this.displayList.queueDepthSort(),this.displayList.remove(this)),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.displayList=void 0,this.parentContainer=void 0)}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(24),s=i(21),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},r.register("GameObjectCreator",o,"make"),t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(7),r=function(){var t,e,i,s,o,a,h=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof h&&(u=h,h=arguments[1]||{},l=2),c===l&&(h=this,--l);l<c;l++)if(null!=(t=arguments[l]))for(e in t)i=h[e],h!==(s=t[e])&&(u&&s&&(n(s)||(o=Array.isArray(s)))?(o?(o=!1,a=i&&Array.isArray(i)?i:[]):a=i&&n(i)?i:{},h[e]=r(u,a,s)):void 0!==s&&(h[e]=s));return h};t.exports=r},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(25),r=new n,s=new n,o=new n,a={camera:r,sprite:s,calc:o};t.exports=function(t,e,i){var n=r,h=s,l=o;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),n.multiply(h,l),a}},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ADDED_TO_SCENE:i(782),BOOT:i(783),CREATE:i(784),DESTROY:i(785),PAUSE:i(786),POST_UPDATE:i(787),PRE_UPDATE:i(788),READY:i(789),REMOVED_FROM_SCENE:i(790),RENDER:i(791),RESUME:i(792),SHUTDOWN:i(793),SLEEP:i(794),START:i(795),TRANSITION_COMPLETE:i(796),TRANSITION_INIT:i(797),TRANSITION_OUT:i(798),TRANSITION_START:i(799),TRANSITION_WAKE:i(800),UPDATE:i(801),WAKE:i(802)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={BLUR:i(610),BOOT:i(611),CONTEXT_LOST:i(612),CONTEXT_RESTORED:i(613),DESTROY:i(614),FOCUS:i(615),HIDDEN:i(616),PAUSE:i(617),POST_RENDER:i(618),POST_STEP:i(619),PRE_RENDER:i(620),PRE_STEP:i(621),READY:i(622),RESUME:i(623),STEP:i(624),VISIBLE:i(625)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(91),o=i(2),a=i(153),h=i(237),l=i(511),c=i(154),u=new n({initialize:function(t,e){this.loader=t,this.cache=o(e,"cache",!1),this.type=o(e,"type",!1),this.key=o(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Invalid Loader."+this.type+" key");var n=o(e,"url");void 0===n?n=t.path+i+"."+o(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=c(o(e,"responseType",void 0)),o(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,o(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=a(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&0===t.responseURL.indexOf("file://")&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,e,i,t),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={},n={},r={register:function(t,e,n,r){void 0===r&&(r=!1),i[t]={plugin:e,mapping:n,custom:r}},registerCustom:function(t,e,i,r){n[t]={plugin:e,mapping:i,data:r}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return n.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return n[t]},getCustomClass:function(t){return n.hasOwnProperty(t)?n[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){n.hasOwnProperty(t)&&delete n[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in n)n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(14),s=i(3),o=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||s?r.TAU-(s>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,r=n[0],s=n[1],o=n[2],a=n[3];return n[0]=r*i+o*e,n[1]=s*i+a*e,n[2]=r*-e+o*i,n[3]=s*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=i[5],c=n[0],u=n[1],d=n[2],p=n[3],f=n[4],m=n[5],g=void 0===e?this:e;return g.a=c*r+u*o,g.b=c*s+u*a,g.c=d*r+p*o,g.d=d*s+p*a,g.e=f*r+m*o+h,g.f=f*s+m*a+l,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,r=t.matrix,s=n[0],o=n[1],a=n[2],h=n[3],l=e*s+i*a+n[4],c=e*o+i*h+n[5],u=r[0],d=r[1],p=r[2],f=r[3],m=r[4],g=r[5];return n[0]=u*s+d*a,n[1]=u*o+d*h,n[2]=p*s+f*a,n[3]=p*o+f*h,n[4]=m*s+g*a+l,n[5]=m*o+g*h+c,this},transform:function(t,e,i,n,r,s){var o=this.matrix,a=o[0],h=o[1],l=o[2],c=o[3],u=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*c,o[2]=i*a+n*l,o[3]=i*h+n*c,o[4]=r*a+s*l+u,o[5]=r*h+s*c+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*r+e*o+h,i.y=t*s+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=e*r-i*n;return t[0]=r/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-r*s)/a,t[5]=-(e*o-i*s)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,r,s){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=r,o[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],r=e[2],s=e[3],o=i*s-n*r;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,r){var s=this.matrix,o=Math.sin(i),a=Math.cos(i);return s[4]=t,s[5]=e,s[0]=a*n,s[1]=o*n,s[2]=-o*r,s[3]=a*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],c=n[5],u=1/(r*h+a*-o);return i.x=h*u*t+-a*u*e+(c*a-l*h)*u,i.y=r*u*e+-o*u*t+(-c*r+l*o)*u,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var n=this.getX(t,e);return i&&(n=Math.round(n)),n},getYRound:function(t,e,i){var n=this.getY(t,e);return i&&(n=Math.round(n)),n},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(2);t.exports=function(t,e,i,r,s,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===r&&(r=o.height),s||(s={});var a=n(s,"isNotEmpty",!1),h=n(s,"isColliding",!1),l=n(s,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(r+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+r>o.height&&(r=Math.max(o.height-e,0));for(var c=[],u=e;u<e+r;u++)for(var d=t;d<t+i;d++){var p=o.data[u][d];if(null!==p){if(a&&-1===p.index)continue;if(h&&!p.collides)continue;if(l&&!p.hasInterestingFace)continue;c.push(p)}}return c}},function(t,e){t.exports=function(t,e,i,n,r,s){var o;void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=1);var a=0,h=t.length;if(1===s)for(o=r;o<h;o++)t[o][e]=i+a*n,a++;else for(o=r;o>=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(34),r=i(13);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var s=r(i,"scale",null);"number"==typeof s?e.setScale(s):null!==s&&(e.scaleX=r(s,"x",1),e.scaleY=r(s,"y",1));var o=r(i,"scrollFactor",null);"number"==typeof o?e.setScrollFactor(o):null!==o&&(e.scrollFactorX=r(o,"x",1),e.scrollFactorY=r(o,"y",1)),e.rotation=r(i,"rotation",0);var a=r(i,"angle",null);null!==a&&(e.angle=a),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),c=r(h,"y",.5);e.setOrigin(l,c)}return e.blendMode=r(i,"blendMode",n.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19);t.exports=function(t,e,i,r,s){var o=r.alpha*i.alpha;if(o<=0)return!1;var a=n(i,r,s).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=o,e.save(),a.setToContext(e),e.imageSmoothingEnabled=!(!t.antialias||i.frame&&i.frame.source.scaleMode),!0}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n,r,s,o=i(32),a=i(189),h=[],l=!1;t.exports=(s=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return n(t,e,i,o.CANVAS)},create:n=function(t,e,i,n,s){var c;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=o.CANVAS),void 0===s&&(s=!1);var u=r(n);return null===u?(u={parent:t,canvas:document.createElement("canvas"),type:n},n===o.CANVAS&&h.push(u),c=u.canvas):(u.parent=t,c=u.canvas),s&&(u.parent=c),c.width=e,c.height=i,l&&n===o.CANVAS&&a.disable(c.getContext("2d")),c},createWebGL:function(t,e,i){return n(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e<h.length;e++){var i=h[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return h.length-s()},pool:h,remove:function(t){var e=t instanceof HTMLCanvasElement;h.forEach((function(i){(e&&i.canvas===t||!e&&i.parent===t)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)}))},total:s})},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n={VERSION:"3.52.0",BlendModes:i(34),ScaleModes:i(164),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(15),o=i(45),a=i(65),h=new n({Extends:s,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Transform,r.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),s.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.initPipeline(a.GRAPHICS_PIPELINE)},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=h},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={DESTROY:i(719),FADE_IN_COMPLETE:i(720),FADE_IN_START:i(721),FADE_OUT_COMPLETE:i(722),FADE_OUT_START:i(723),FLASH_COMPLETE:i(724),FLASH_START:i(725),FOLLOW_UPDATE:i(726),PAN_COMPLETE:i(727),PAN_START:i(728),POST_RENDER:i(729),PRE_RENDER:i(730),ROTATE_COMPLETE:i(731),ROTATE_START:i(732),SHAKE_COMPLETE:i(733),SHAKE_START:i(734),ZOOM_COMPLETE:i(735),ZOOM_START:i(736)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(100),s=i(322),o=i(185),a=i(323),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(r)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=r(e,i,n),this._color32=s(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),r=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,r)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,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},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},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},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},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z;return this.x=i*o-n*s,this.y=n*r-e*o,this.z=e*s-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+n*r[6],this.y=e*r[1]+i*r[4]+n*r[7],this.z=e*r[2]+i*r[5]+n*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=e*r[0]+i*r[4]+n*r[8]+r[12],o=e*r[1]+i*r[5]+n*r[9]+r[13],a=e*r[2]+i*r[6]+n*r[10]+r[14],h=e*r[3]+i*r[7]+n*r[11]+r[15];return this.x=s/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*n-o*i,l=a*i+o*e-r*n,c=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=h*a+u*-r+l*-o-c*-s,this.y=l*a+u*-s+c*-r-h*-o,this.z=c*a+u*-o+h*-s-l*-r,this},project:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=r[0],o=r[1],a=r[2],h=r[3],l=r[4],c=r[5],u=r[6],d=r[7],p=r[8],f=r[9],m=r[10],g=r[11],v=r[12],y=r[13],x=r[14],b=1/(e*h+i*d+n*g+r[15]);return this.x=(e*s+i*l+n*p+v)*b,this.y=(e*o+i*c+n*f+y)*b,this.z=(e*a+i*u+n*m+x)*b,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,o=this.x-i,a=s-this.y-1-n,h=this.z;return this.x=2*o/r-1,this.y=2*a/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n,r,s){var o;void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=1);var a=0,h=t.length;if(1===s)for(o=r;o<h;o++)t[o][e]+=i+a*n,a++;else for(o=r;o>=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(301),s=i(168),o=i(55),a=i(169),h=i(3),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return s(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e){t.exports=function(t,e,i,n){var r=i||e.fillColor,s=n||e.fillAlpha,o=(16711680&r)>>>16,a=(65280&r)>>>8,h=255&r;t.fillStyle="rgba("+o+","+a+","+h+","+s+")"}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e,i,n){var r=[];n.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var s=0;s<r.length;s++)r[s].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),t.multiFile=this,this.pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&this.failed++}});t.exports=n},function(t,e){t.exports=function(t,e,i,n){var r=t-i,s=e-n;return Math.sqrt(r*r+s*s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={BOOT:i(918),DESTROY:i(919),DRAG_END:i(920),DRAG_ENTER:i(921),DRAG:i(922),DRAG_LEAVE:i(923),DRAG_OVER:i(924),DRAG_START:i(925),DROP:i(926),GAME_OUT:i(927),GAME_OVER:i(928),GAMEOBJECT_DOWN:i(929),GAMEOBJECT_DRAG_END:i(930),GAMEOBJECT_DRAG_ENTER:i(931),GAMEOBJECT_DRAG:i(932),GAMEOBJECT_DRAG_LEAVE:i(933),GAMEOBJECT_DRAG_OVER:i(934),GAMEOBJECT_DRAG_START:i(935),GAMEOBJECT_DROP:i(936),GAMEOBJECT_MOVE:i(937),GAMEOBJECT_OUT:i(938),GAMEOBJECT_OVER:i(939),GAMEOBJECT_POINTER_DOWN:i(940),GAMEOBJECT_POINTER_MOVE:i(941),GAMEOBJECT_POINTER_OUT:i(942),GAMEOBJECT_POINTER_OVER:i(943),GAMEOBJECT_POINTER_UP:i(944),GAMEOBJECT_POINTER_WHEEL:i(945),GAMEOBJECT_UP:i(946),GAMEOBJECT_WHEEL:i(947),MANAGER_BOOT:i(948),MANAGER_PROCESS:i(949),MANAGER_UPDATE:i(950),POINTER_DOWN:i(951),POINTER_DOWN_OUTSIDE:i(952),POINTER_MOVE:i(953),POINTER_OUT:i(954),POINTER_OVER:i(955),POINTER_UP:i(956),POINTER_UP_OUTSIDE:i(957),POINTER_WHEEL:i(958),POINTERLOCK_CHANGE:i(959),PRE_UPDATE:i(960),SHUTDOWN:i(961),START:i(962),UPDATE:i(963)}},function(t,e){var i={};t.exports=i,function(){i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i.extend=function(t,e){var n,r;"boolean"==typeof e?(n=2,r=e):(n=1,r=!0);for(var s=n;s<arguments.length;s++){var o=arguments[s];if(o)for(var a in o)r&&o[a]&&o[a].constructor===Object?t[a]&&t[a].constructor!==Object?t[a]=o[a]:(t[a]=t[a]||{},i.extend(t[a],r,o[a])):t[a]=o[a]}return t},i.clone=function(t,e){return i.extend({},e,t)},i.keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var i in t)e.push(i);return e},i.values=function(t){var e=[];if(Object.keys){for(var i=Object.keys(t),n=0;n<i.length;n++)e.push(t[i[n]]);return e}for(var r in t)e.push(t[r]);return e},i.get=function(t,e,i,n){e=e.split(".").slice(i,n);for(var r=0;r<e.length;r+=1)t=t[e[r]];return t},i.set=function(t,e,n,r,s){var o=e.split(".").slice(r,s);return i.get(t,e,0,-1)[o[o.length-1]]=n,n},i.shuffle=function(t){for(var e=t.length-1;e>0;e--){var n=Math.floor(i.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===Object.prototype.toString.call(t)},i.clamp=function(t,e,i){return t<e?e:t>i?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},i.map=function(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n<t.length;n+=1)i.push(e(t[n]));return i},i.topologicalSort=function(t){var e=[],n=[],r=[];for(var s in t)n[s]||r[s]||i._topologicalSort(s,n,r,t,e);return e},i._topologicalSort=function(t,e,n,r,s){var o=r[t]||[];n[t]=!0;for(var a=0;a<o.length;a+=1){var h=o[a];n[h]||e[h]||i._topologicalSort(h,e,n,r,s)}n[t]=!1,e[t]=!0,s.push(t)},i.chain=function(){for(var t=[],e=0;e<arguments.length;e+=1){var i=arguments[e];i._chained?t.push.apply(t,i._chained):t.push(i)}var n=function(){for(var e,i=new Array(arguments.length),n=0,r=arguments.length;n<r;n++)i[n]=arguments[n];for(n=0;n<t.length;n+=1){var s=t[n].apply(e,i);void 0!==s&&(e=s)}return e};return n._chained=t,n},i.chainPathBefore=function(t,e,n){return i.set(t,e,i.chain(n,i.get(t,e)))},i.chainPathAfter=function(t,e,n){return i.set(t,e,i.chain(i.get(t,e),n))}}()},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(172),s=i(9),o=i(368),a=i(2),h=i(67),l=i(88),c=i(139),u=i(12),d=i(369),p=new n({Extends:s,initialize:function(t){s.call(this);var e=t.game,i=e.renderer,n=i.gl;this.name=a(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=n,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.topology=a(t,"topology",n.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.currentUnit=0,this.forceZero=a(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t},boot:function(){var t,e=this.gl,i=this.config,n=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var r=this.renderTargets,s=a(i,"renderTarget",!1);"boolean"==typeof s&&s&&(s=1);var u=n.width,d=n.height;if("number"==typeof s)for(t=0;t<s;t++)r.push(new c(n,u,d,1,0,!0));else if(Array.isArray(s))for(t=0;t<s.length;t++){var p=a(s[t],"scale",1),f=a(s[t],"minFilter",0),m=a(s[t],"autoClear",1);r.push(new c(n,u,d,p,f,m))}r.length&&(this.currentRenderTarget=r[0]),this.setShadersFromConfig(i);var g=this.shaders,v=0;for(t=0;t<g.length;t++)g[t].vertexSize>v&&(v=g[t].vertexSize);var y=a(i,"batchSize",n.config.batchSize);this.vertexCapacity=6*y;var x=new ArrayBuffer(this.vertexCapacity*v);this.vertexData=x,this.bytes=new Uint8Array(x),this.vertexViewF32=new Float32Array(x),this.vertexViewU32=new Uint32Array(x);var b=a(i,"vertices",null);for(b?(this.vertexViewF32.set(b),this.vertexBuffer=n.createVertexBuffer(x,e.STATIC_DRAW)):this.vertexBuffer=n.createVertexBuffer(x.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=g.length-1;t>=0;t--)g[t].rebind();this.hasBooted=!0,n.on(l.RESIZE,this.resize,this),n.on(l.PRE_RENDER,this.onPreRender,this),n.on(l.RENDER,this.onRender,this),n.on(l.POST_RENDER,this.onPostRender,this),this.emit(o.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e){var i=this.renderer;return t===this.currentShader&&i.currentProgram===this.currentShader.program||(this.flush(),i.resetTextures(),this.setVertexBuffer()&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t),this},getShaderByName:function(t){for(var e=this.shaders,i=0;i<e.length;i++)if(e[i].name===t)return e[i]},setShadersFromConfig:function(t){var e,i=this.shaders,n=this.renderer;for(e=0;e<i.length;e++)i[e].destroy();var s=a(t,"vertShader",null),o=u.parseFragmentShaderMaxTextures(a(t,"fragShader",null),n.maxTextures),h=a(t,"attributes",null),l=a(t,"shaders",[]),c=l.length;if(0===c)s&&o&&(this.shaders=[new d(this,"default",s,o,r(h))]);else{var p=[];for(e=0;e<c;e++){var f=l[e],m=a(f,"name","default"),g=a(f,"vertShader",s),v=u.parseFragmentShaderMaxTextures(a(f,"fragShader",o),n.maxTextures),y=a(f,"attributes",h);g&&v&&p.push(new d(this,m,g,v,r(y)))}this.shaders=p}return 0===this.shaders.length?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},setGameObject:function(t,e){return void 0===e&&(e=t.frame),this.currentUnit=this.renderer.setTextureSource(e.source),this.currentUnit},shouldFlush:function(t){return void 0===t&&(t=0),this.vertexCount+t>this.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,n=0;n<i.length;n++)i[n].resize(t,e);return this.setProjectionMatrix(t,e),this.emit(o.RESIZE,t,e,this),this.onResize(t,e),this},setProjectionMatrix:function(t,e){var i=this.projectionMatrix;if(!i)return this;this.projectionWidth=t,this.projectionHeight=e,i.ortho(0,t,e,0,-1e3,1e3);for(var n=this.shaders,r="uProjectionMatrix",s=0;s<n.length;s++){var o=n[s];o.hasUniform(r)&&(o.resetUniform(r),o.setMatrix4fv(r,!1,i.val,o))}return this},updateProjectionMatrix:function(){if(this.projectionMatrix){var t=this.renderer.projectionWidth,e=this.renderer.projectionHeight;this.projectionWidth===t&&this.projectionHeight===e||this.setProjectionMatrix(t,e)}},bind:function(t){void 0===t&&(t=this.currentShader);var e=this.setVertexBuffer();return t.bind(e),this.currentShader=t,this.emit(o.BIND,this,t),this.onActive(t),this},rebind:function(){this.setVertexBuffer();for(var t=this.shaders,e=t.length-1;e>=0;e--)this.currentShader=t[e].rebind();return this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this},setVertexBuffer:function(){var t=this.gl,e=this.vertexBuffer;return t.getParameter(t.ARRAY_BUFFER_BINDING)!==e&&(t.bindBuffer(t.ARRAY_BUFFER,e),!0)},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(o.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,n=this.currentShader.vertexSize;this.active&&(this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*n)),e.drawArrays(this.topology,0,i)),this.vertexCount=0,this.emit(o.AFTER_FLUSH,this,t),this.onAfterFlush(t)}return this},onActive:function(){},onBind:function(){},onRebind:function(){},onBatch:function(){},onPreBatch:function(){},onPostBatch:function(){},onPreRender:function(){},onRender:function(){},onPostRender:function(){},onBeforeFlush:function(){},onAfterFlush:function(){},batchVert:function(t,e,i,n,r,s,o){var a=this.vertexViewF32,h=this.vertexViewU32,l=this.vertexCount*this.currentShader.vertexComponentCount-1;a[++l]=t,a[++l]=e,a[++l]=i,a[++l]=n,a[++l]=r,a[++l]=s,h[++l]=o,this.vertexCount++},batchQuad:function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x){void 0===x&&(x=this.currentUnit);var b=!1;return this.shouldFlush(6)&&(this.flush(),b=!0,x=this.setTexture2D(y)),this.batchVert(e,i,l,c,x,v,p),this.batchVert(n,r,l,d,x,v,m),this.batchVert(s,o,u,d,x,v,g),this.batchVert(e,i,l,c,x,v,p),this.batchVert(s,o,u,d,x,v,g),this.batchVert(a,h,u,c,x,v,f),this.onBatch(t),b},batchTri:function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m,g){void 0===g&&(g=this.currentUnit);var v=!1;return this.shouldFlush(3)&&(this.flush(),v=!0,g=this.setTexture2D(m)),this.batchVert(e,i,a,h,g,f,u),this.batchVert(n,r,a,c,g,f,d),this.batchVert(s,o,l,c,g,f,p),this.onBatch(t),v},drawFillRect:function(t,e,i,n,r,s,o,a){void 0===o&&(o=this.renderer.whiteTexture.glTexture),void 0===a&&(a=!0),t=Math.floor(t),e=Math.floor(e);var h=Math.floor(t+i),l=Math.floor(e+n),c=this.setTexture2D(o),d=u.getTintAppendFloatAlphaAndSwap(r,s),p=0,f=1;a&&(p=1,f=0),this.batchQuad(null,t,e,t,l,h,l,h,e,0,p,1,f,d,d,d,d,0,o,c)},setTexture2D:function(t){return void 0===t&&(t=this.renderer.whiteTexture.glTexture),this.currentUnit=this.renderer.setTexture2D(t),this.currentUnit},bindTexture:function(t,e){void 0===e&&(e=0);var i=this.gl;return i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),this},bindRenderTarget:function(t,e){return this.bindTexture(t.texture,e)},setTime:function(t){return this.set1f(t,this.game.loop.getDuration()),this},set1f:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1f(t,e),this},set2f:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.set2f(t,e,i),this},set3f:function(t,e,i,n,r){return void 0===r&&(r=this.currentShader),r.set3f(t,e,i,n),this},set4f:function(t,e,i,n,r,s){return void 0===s&&(s=this.currentShader),s.set4f(t,e,i,n,r),this},set1fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1fv(t,e),this},set2fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2fv(t,e),this},set3fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3fv(t,e),this},set4fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4fv(t,e),this},set1iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1iv(t,e),this},set2iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2iv(t,e),this},set3iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3iv(t,e),this},set4iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4iv(t,e),this},set1i:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1i(t,e),this},set2i:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.set2i(t,e,i),this},set3i:function(t,e,i,n,r){return void 0===r&&(r=this.currentShader),r.set3i(t,e,i,n),this},set4i:function(t,e,i,n,r,s){return void 0===s&&(s=this.currentShader),s.set4i(t,e,i,n,r),this},setMatrix2fv:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.setMatrix2fv(t,e,i),this},setMatrix3fv:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.setMatrix3fv(t,e,i),this},setMatrix4fv:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.setMatrix4fv(t,e,i),this},destroy:function(){var t;this.emit(o.DESTROY,this);var e=this.shaders;for(t=0;t<e.length;t++)e[t].destroy();var i=this.renderTargets;for(t=0;t<i.length;t++)i[t].destroy();this.gl.deleteBuffer(this.vertexBuffer);var n=this.renderer;return n.off(l.RESIZE,this.resize,this),n.off(l.PRE_RENDER,this.onPreRender,this),n.off(l.RENDER,this.onRender,this),n.off(l.POST_RENDER,this.onPostRender,this),this.removeAllListeners(),this.game=null,this.renderer=null,this.manager=null,this.gl=null,this.view=null,this.shaders=null,this.renderTargets=null,this.bytes=null,this.vertexViewF32=null,this.vertexViewU32=null,this.vertexData=null,this.vertexBuffer=null,this.currentShader=null,this.currentRenderTarget=null,this}});t.exports=p},function(t,e){t.exports=function(t,e,i,n){var r=i||e.strokeColor,s=n||e.strokeAlpha,o=(16711680&r)>>>16,a=(65280&r)>>>8,h=255&r;t.strokeStyle="rgba("+o+","+a+","+h+","+s+")",t.lineWidth=e.lineWidth}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(6),l=i(7),c=new n({Extends:s,initialize:function(t,e,i,n,o){var c="json";if(l(e)){var u=e;e=a(u,"key"),i=a(u,"url"),n=a(u,"xhrSettings"),c=a(u,"extension",c),o=a(u,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:c,responseType:"text",key:e,url:i,xhrSettings:n,config:o};s.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new c(this,t[r]));else this.addFile(new c(this,t,e,n,i));return this})),t.exports=c},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(156),r=i(26);t.exports=function(t,e,i,s,o){for(var a=null,h=null,l=null,c=null,u=r(t,e,i,s,null,o),d=0;d<u.length;d++){var p=u[d];p&&(p.collides?(a=n(p.x,p.y-1,!0,o),h=n(p.x,p.y+1,!0,o),l=n(p.x-1,p.y,!0,o),c=n(p.x+1,p.y,!0,o),p.faceTop=!a||!a.collides,p.faceBottom=!h||!h.collides,p.faceLeft=!l||!l.collides,p.faceRight=!c||!c.collides):p.resetFaces())}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(63),s=i(294),o=i(295),a=i(55),h=i(166),l=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(38),s=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=o,g[7]=a,g[8]=h,g[9]=l,g[10]=c,g[11]=u,g[12]=d,g[13]=p,g[14]=f,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=o.fromQuat(i).val,r=e.x,s=e.y,a=e.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=n,t[13]=s,t[14]=o,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=e*o-i*s,y=e*a-n*s,x=e*h-r*s,b=i*a-n*o,w=i*h-r*o,T=n*h-r*a,_=l*f-c*p,E=l*m-u*p,S=l*g-d*p,M=c*m-u*f,A=c*g-d*f,C=u*g-d*m,P=v*C-y*A+x*M+b*S-w*E+T*_;return P?(P=1/P,this.setValues((o*C-a*A+h*M)*P,(n*A-i*C-r*M)*P,(f*T-m*w+g*b)*P,(u*w-c*T-d*b)*P,(a*S-s*C-h*E)*P,(e*C-n*S+r*E)*P,(m*x-p*T-g*y)*P,(l*T-u*x+d*y)*P,(s*A-o*S+h*_)*P,(i*S-e*A-r*_)*P,(p*w-f*x+g*v)*P,(c*x-l*w-d*v)*P,(o*E-s*M-a*_)*P,(e*M-i*E+n*_)*P,(f*y-p*b-m*v)*P,(l*b-c*y+u*v)*P)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return this.setValues(o*(u*g-d*m)-c*(a*g-h*m)+f*(a*d-h*u),-(i*(u*g-d*m)-c*(n*g-r*m)+f*(n*d-r*u)),i*(a*g-h*m)-o*(n*g-r*m)+f*(n*h-r*a),-(i*(a*d-h*u)-o*(n*d-r*u)+c*(n*h-r*a)),-(s*(u*g-d*m)-l*(a*g-h*m)+p*(a*d-h*u)),e*(u*g-d*m)-l*(n*g-r*m)+p*(n*d-r*u),-(e*(a*g-h*m)-s*(n*g-r*m)+p*(n*h-r*a)),e*(a*d-h*u)-s*(n*d-r*u)+l*(n*h-r*a),s*(c*g-d*f)-l*(o*g-h*f)+p*(o*d-h*c),-(e*(c*g-d*f)-l*(i*g-r*f)+p*(i*d-r*c)),e*(o*g-h*f)-s*(i*g-r*f)+p*(i*h-r*o),-(e*(o*d-h*c)-s*(i*d-r*c)+l*(i*h-r*o)),-(s*(c*m-u*f)-l*(o*m-a*f)+p*(o*u-a*c)),e*(c*m-u*f)-l*(i*m-n*f)+p*(i*u-n*c),-(e*(o*m-a*f)-s*(i*m-n*f)+p*(i*a-n*o)),e*(o*u-a*c)-s*(i*u-n*c)+l*(i*a-n*o))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return(e*o-i*s)*(u*g-d*m)-(e*a-n*s)*(c*g-d*f)+(e*h-r*s)*(c*m-u*f)+(i*a-n*o)*(l*g-d*p)-(i*h-r*o)*(l*m-u*p)+(n*h-r*a)*(l*f-c*p)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],v=e[15],y=t.val,x=y[0],b=y[1],w=y[2],T=y[3];return e[0]=x*i+b*o+w*c+T*f,e[1]=x*n+b*a+w*u+T*m,e[2]=x*r+b*h+w*d+T*g,e[3]=x*s+b*l+w*p+T*v,x=y[4],b=y[5],w=y[6],T=y[7],e[4]=x*i+b*o+w*c+T*f,e[5]=x*n+b*a+w*u+T*m,e[6]=x*r+b*h+w*d+T*g,e[7]=x*s+b*l+w*p+T*v,x=y[8],b=y[9],w=y[10],T=y[11],e[8]=x*i+b*o+w*c+T*f,e[9]=x*n+b*a+w*u+T*m,e[10]=x*r+b*h+w*d+T*g,e[11]=x*s+b*l+w*p+T*v,x=y[12],b=y[13],w=y[14],T=y[15],e[12]=x*i+b*o+w*c+T*f,e[13]=x*n+b*a+w*u+T*m,e[14]=x*r+b*h+w*d+T*g,e[15]=x*s+b*l+w*p+T*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,r=i[0],s=i[4],o=i[8],a=i[12],h=i[1],l=i[5],c=i[9],u=i[13],d=i[2],p=i[6],f=i[10],m=i[14],g=i[3],v=i[7],y=i[11],x=i[15],b=n[0],w=n[4],T=n[8],_=n[12],E=n[1],S=n[5],M=n[9],A=n[13],C=n[2],P=n[6],R=n[10],L=n[14],O=n[3],D=n[7],I=n[11],F=n[15];return this.setValues(r*b+s*E+o*C+a*O,h*b+l*E+c*C+u*O,d*b+p*E+f*C+m*O,g*b+v*E+y*C+x*O,r*w+s*S+o*P+a*D,h*w+l*S+c*P+u*D,d*w+p*S+f*P+m*D,g*w+v*S+y*P+x*D,r*T+s*M+o*R+a*I,h*T+l*M+c*R+u*I,d*T+p*M+f*R+m*I,g*T+v*M+y*R+x*I,r*_+s*A+o*L+a*F,h*_+l*A+c*L+u*F,d*_+p*A+f*L+m*F,g*_+v*A+y*L+x*F)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,o=t.y,a=t.z,h=r*s,l=r*o;return this.setValues(h*s+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*s,0,h*a-n*o,l*a+n*s,r*a*a+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,s=e.z,o=Math.sqrt(n*n+r*r+s*s);if(Math.abs(o)<1e-6)return this;n*=o=1/o,r*=o,s*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,c=i[0],u=i[1],d=i[2],p=i[3],f=i[4],m=i[5],g=i[6],v=i[7],y=i[8],x=i[9],b=i[10],w=i[11],T=i[12],_=i[13],E=i[14],S=i[15],M=n*n*l+h,A=r*n*l+s*a,C=s*n*l-r*a,P=n*r*l-s*a,R=r*r*l+h,L=s*r*l+n*a,O=n*s*l+r*a,D=r*s*l-n*a,I=s*s*l+h;return this.setValues(c*M+f*A+y*C,u*M+m*A+x*C,d*M+g*A+b*C,p*M+v*A+w*C,c*P+f*R+y*L,u*P+m*R+x*L,d*P+g*R+b*L,p*P+v*R+w*L,c*O+f*D+y*I,u*O+m*D+x*I,d*O+g*D+b*I,p*O+v*D+w*I,T,_,E,S)},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[4],s=e[5],o=e[6],a=e[7],h=e[8],l=e[9],c=e[10],u=e[11];return e[4]=r*n+h*i,e[5]=s*n+l*i,e[6]=o*n+c*i,e[7]=a*n+u*i,e[8]=h*n-r*i,e[9]=l*n-s*i,e[10]=c*n-o*i,e[11]=u*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[8],l=e[9],c=e[10],u=e[11];return e[0]=r*n-h*i,e[1]=s*n-l*i,e[2]=o*n-c*i,e[3]=a*n-u*i,e[8]=r*i+h*n,e[9]=s*i+l*n,e[10]=o*i+c*n,e[11]=a*i+u*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[4],l=e[5],c=e[6],u=e[7];return e[0]=r*n+h*i,e[1]=s*n+l*i,e[2]=o*n+c*i,e[3]=a*n+u*i,e[4]=h*n-r*i,e[5]=l*n-s*i,e[6]=c*n-o*i,e[7]=u*n-a*i,this},fromRotationTranslation:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,o=i+i,a=n+n,h=r+r,l=i*o,c=i*a,u=i*h,d=n*a,p=n*h,f=r*h,m=s*o,g=s*a,v=s*h;return this.setValues(1-(d+f),c+v,u-g,0,c-v,1-(l+f),p+m,0,u+g,p-m,1-(l+d),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,o=i+i,a=n+n,h=e*s,l=e*o,c=e*a,u=i*o,d=i*a,p=n*a,f=r*s,m=r*o,g=r*a;return this.setValues(1-(u+p),l+g,c-m,0,l-g,1-(h+p),d+f,0,c+m,d-f,1-(h+u),0,0,0,0,1)},frustum:function(t,e,i,n,r,s){var o=1/(e-t),a=1/(n-i),h=1/(r-s);return this.setValues(2*r*o,0,0,0,0,2*r*a,0,0,(e+t)*o,(n+i)*a,(s+r)*h,-1,0,0,s*r*2*h,0)},perspective:function(t,e,i,n){var r=1/Math.tan(t/2),s=1/(i-n);return this.setValues(r/e,0,0,0,0,r,0,0,0,0,(n+i)*s,-1,0,0,2*n*i*s,0)},perspectiveLH:function(t,e,i,n){return this.setValues(2*i/t,0,0,0,0,2*i/e,0,0,0,0,-n/(i-n),1,0,0,i*n/(i-n),0)},ortho:function(t,e,i,n,r,s){var o=t-e,a=i-n,h=r-s;return o=0===o?o:1/o,a=0===a?a:1/a,h=0===h?h:1/h,this.setValues(-2*o,0,0,0,0,-2*a,0,0,0,0,2*h,0,(t+e)*o,(n+i)*a,(s+r)*h,1)},lookAtRH:function(t,e,i){var n=this.val;return c.subVectors(t,e),0===c.getLengthSquared()&&(c.z=1),c.normalize(),h.crossVectors(i,c),0===h.getLengthSquared()&&(1===Math.abs(i.z)?c.x+=1e-4:c.z+=1e-4,c.normalize(),h.crossVectors(i,c)),h.normalize(),l.crossVectors(c,h),n[0]=h.x,n[1]=h.y,n[2]=h.z,n[4]=l.x,n[5]=l.y,n[6]=l.z,n[8]=c.x,n[9]=c.y,n[10]=c.z,this},lookAt:function(t,e,i){var n=t.x,r=t.y,s=t.z,o=i.x,a=i.y,h=i.z,l=e.x,c=e.y,u=e.z;if(Math.abs(n-l)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(s-u)<1e-6)return this.identity();var d=n-l,p=r-c,f=s-u,m=1/Math.sqrt(d*d+p*p+f*f),g=a*(f*=m)-h*(p*=m),v=h*(d*=m)-o*f,y=o*p-a*d;(m=Math.sqrt(g*g+v*v+y*y))?(g*=m=1/m,v*=m,y*=m):(g=0,v=0,y=0);var x=p*y-f*v,b=f*g-d*y,w=d*v-p*g;return(m=Math.sqrt(x*x+b*b+w*w))?(x*=m=1/m,b*=m,w*=m):(x=0,b=0,w=0),this.setValues(g,x,d,0,v,b,p,0,y,w,f,0,-(g*n+v*r+y*s),-(x*n+b*r+w*s),-(d*n+p*r+f*s),1)},yawPitchRoll:function(t,e,i){this.zero(),o.zero(),a.zero();var n=this.val,r=o.val,s=a.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),r[0]=1,r[15]=1,r[5]=l,r[10]=l,r[9]=-h,r[6]=h,h=Math.sin(t),l=Math.cos(t),s[5]=1,s[15]=1,s[0]=l,s[2]=-h,s[8]=h,s[10]=l,this.multiplyLocal(o),this.multiplyLocal(a),this},setWorldMatrix:function(t,e,i,n,r){return this.yawPitchRoll(t.y,t.x,t.z),o.scaling(i.x,i.y,i.z),a.xyz(e.x,e.y,e.z),this.multiplyLocal(o),this.multiplyLocal(a),n&&this.multiplyLocal(n),r&&this.multiplyLocal(r),this},multiplyToMat4:function(t,e){var i=this.val,n=t.val,r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=i[5],c=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],b=n[0],w=n[1],T=n[2],_=n[3],E=n[4],S=n[5],M=n[6],A=n[7],C=n[8],P=n[9],R=n[10],L=n[11],O=n[12],D=n[13],I=n[14],F=n[15];return e.setValues(b*r+w*h+T*d+_*g,w*s+w*l+T*p+_*v,T*o+w*c+T*f+_*y,_*a+w*u+T*m+_*x,E*r+S*h+M*d+A*g,E*s+S*l+M*p+A*v,E*o+S*c+M*f+A*y,E*a+S*u+M*m+A*x,C*r+P*h+R*d+L*g,C*s+P*l+R*p+L*v,C*o+P*c+R*f+L*y,C*a+P*u+R*m+L*x,O*r+D*h+I*d+F*g,O*s+D*l+I*p+F*v,O*o+D*c+I*f+F*y,O*a+D*u+I*m+F*x)},fromRotationXYTranslation:function(t,e,i){var n=e.x,r=e.y,s=e.z,o=Math.sin(t.x),a=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),c=n,u=r,d=s,p=-o,f=0-p*h,m=0-a*h,g=p*l,v=a*l;return i||(c=l*n+h*s,u=f*n+a*r+g*s,d=m*n+o*r+v*s),this.setValues(l,f,m,0,0,a,o,0,h,g,v,0,c,u,d,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}}),o=new s,a=new s,h=new r,l=new r,c=new r;t.exports=s},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/function n(t,e,i){i=i||2;var n,a,h,l,c,p,f,g=e&&e.length,v=g?e[0]*i:t.length,y=r(t,0,v,i,!0),x=[];if(!y||y.next===y.prev)return x;if(g&&(y=function(t,e,i,n){var o,a,h,l,c,p=[];for(o=0,a=e.length;o<a;o++)h=e[o]*n,l=o<a-1?e[o+1]*n:t.length,(c=r(t,h,l,n,!1))===c.next&&(c.steiner=!0),p.push(m(c));for(p.sort(u),o=0;o<p.length;o++)d(p[o],i),i=s(i,i.next);return i}(t,e,y,i)),t.length>80*i){n=h=t[0],a=l=t[1];for(var b=i;b<v;b+=i)(c=t[b])<n&&(n=c),(p=t[b+1])<a&&(a=p),c>h&&(h=c),p>l&&(l=p);f=0!==(f=Math.max(h-n,l-a))?1/f:0}return o(y,x,i,n,a,f),x}function r(t,e,i,n,r){var s,o;if(r===C(t,e,i,n)>0)for(s=e;s<i;s+=n)o=S(s,t[s],t[s+1],o);else for(s=i-n;s>=e;s-=n)o=S(s,t[s],t[s+1],o);return o&&x(o,o.next)&&(M(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!x(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,r,u,d){if(t){!d&&u&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=f(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,s,o,a,h,l=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e<l&&(a++,n=n.nextZ);e++);for(h=l;a>0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,h--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,l*=2}while(o>1)}(r)}(t,n,r,u);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,u?h(t,n,r,u):a(t))e.push(p.i/i),e.push(t.i/i),e.push(m.i/i),M(t),t=m.next,g=m.next;else if((t=m)===g){d?1===d?o(t=l(s(t),e,i),e,i,n,r,u,2):2===d&&c(t,e,i,n,r,u):o(s(t),e,i,n,r,u,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(y(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&y(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function h(t,e,i,n){var r=t.prev,s=t,o=t.next;if(y(r,s,o)>=0)return!1;for(var a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,h=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,l=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=f(a,h,e,i,n),d=f(l,c,e,i,n),p=t.prevZ,m=t.nextZ;p&&p.z>=u&&m&&m.z<=d;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,m!==t.prev&&m!==t.next&&g(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==t.prev&&m!==t.next&&g(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function l(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!x(r,o)&&b(r,n,n.next,o)&&_(r,o)&&_(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),M(n),M(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function c(t,e,i,n,r,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var c=E(h,l);return h=s(h,h.next),c=s(c,c.next),o(h,e,i,n,r,a),void o(c,e,i,n,r,a)}l=l.next}h=h.next}while(h!==t)}function u(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,r=t.x,s=t.y,o=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var a=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>o){if(o=a,a===r){if(s===n.y)return n;if(s===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===o)return i;var h,l=i,c=i.x,u=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=c&&r!==n.x&&g(s<u?r:o,s,c,u,s<u?o:r,s,n.x,n.y)&&(h=Math.abs(s-n.y)/(r-n.x),_(n,t)&&(h<d||h===d&&(n.x>i.x||n.x===i.x&&p(i,n)))&&(i=n,d=h)),n=n.next}while(n!==l);return i}(t,e)){var i=E(e,t);s(e,e.next),s(i,i.next)}}function p(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function f(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function m(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function g(t,e,i,n,r,s,o,a){return(r-o)*(e-a)-(t-o)*(s-a)>=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&b(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(_(t,e)&&_(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||x(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,i,n){var r=T(y(t,e,i)),s=T(y(t,e,n)),o=T(y(i,n,t)),a=T(y(i,n,e));return r!==s&&o!==a||!(0!==r||!w(t,i,e))||!(0!==s||!w(t,n,e))||!(0!==o||!w(i,t,n))||!(0!==a||!w(i,e,n))}function w(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function _(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function E(t,e){var i=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function S(t,e,i,n){var r=new A(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(t,e,i,n){for(var r=0,s=e,o=i-n;s<i;s+=n)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}n.deviation=function(t,e,i,n){var r=e&&e.length,s=r?e[0]*i:t.length,o=Math.abs(C(t,0,s,i));if(r)for(var a=0,h=e.length;a<h;a++){var l=e[a]*i,c=a<h-1?e[a+1]*i:t.length;o-=Math.abs(C(t,l,c,i))}var u=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,p=n[a+1]*i,f=n[a+2]*i;u+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var s=0;s<t[r].length;s++)for(var o=0;o<e;o++)i.vertices.push(t[r][s][o]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i},t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={COMPLETE:i(983),DECODED:i(984),DECODED_ALL:i(985),DESTROY:i(986),DETUNE:i(987),GLOBAL_DETUNE:i(988),GLOBAL_MUTE:i(989),GLOBAL_RATE:i(990),GLOBAL_VOLUME:i(991),LOOP:i(992),LOOPED:i(993),MUTE:i(994),PAN:i(995),PAUSE_ALL:i(996),PAUSE:i(997),PLAY:i(998),RATE:i(999),RESUME_ALL:i(1e3),RESUME:i(1001),SEEK:i(1002),STOP_ALL:i(1003),STOP:i(1004),UNLOCKED:i(1005),VOLUME:i(1006)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function t(e,i,n,r,o){var l,c="png";if(h(i)){var u=i;i=a(u,"key"),n=a(u,"url"),l=a(u,"normalMap"),r=a(u,"xhrSettings"),c=a(u,"extension",c),o=a(u,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:c,responseType:"blob",key:i,url:n,xhrSettings:r,config:o};if(s.call(this,e,d),l){var p=new t(e,this.key,l,r,o);p.type="normalMap",this.setLink(p),e.addFile(p)}},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){s.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(t.data),t.onProcessError()},s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===r.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){var n={};t.exports=n;var r=i(94),s=i(116),o=i(267),a=i(50),h=i(117),l=i(585);!function(){n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=r.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=r.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var n=a.extend(i,e);return t(n,e),n.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},n},n.nextGroup=function(t){return t?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var t=function(t,e){e=e||{},n.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||s.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t});var i=t.bounds;if(r.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(i,t.vertices,t.velocity),n.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var o=t.centerOfMass,a=t.centerOffset,c=i.max.x-i.min.x,u=i.max.y-i.min.y;o.x=-(i.min.x-t.position.x)/c,o.y=-(i.min.y-t.position.y)/u,a.x=c*o.x,a.y=u*o.y}};n.set=function(t,e,i){var r;for(r in"string"==typeof e&&(r=e,(e={})[r]=i),e)if(Object.prototype.hasOwnProperty.call(e,r))switch(i=e[r],r){case"isStatic":n.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":n.setMass(t,i);break;case"density":n.setDensity(t,i);break;case"inertia":n.setInertia(t,i);break;case"vertices":n.setVertices(t,i);break;case"position":n.setPosition(t,i);break;case"angle":n.setAngle(t,i);break;case"velocity":n.setVelocity(t,i);break;case"angularVelocity":n.setAngularVelocity(t,i);break;case"parts":n.setParts(t,i);break;case"centre":n.setCentre(t,i);break;default:t[r]=i}},n.setStatic=function(t,e){for(var i=0;i<t.parts.length;i++){var n=t.parts[i];n.isStatic=e,e?(n._original={restitution:n.restitution,friction:n.friction,mass:n.mass,inertia:n.inertia,density:n.density,inverseMass:n.inverseMass,inverseInertia:n.inverseInertia},n.restitution=0,n.friction=1,n.mass=n.inertia=n.density=1/0,n.inverseMass=n.inverseInertia=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.angularVelocity=0,n.speed=0,n.angularSpeed=0,n.motion=0):n._original&&(n.restitution=n._original.restitution,n.friction=n._original.friction,n.mass=n._original.mass,n.inertia=n._original.inertia,n.density=n._original.density,n.inverseMass=n._original.inverseMass,n.inverseInertia=n._original.inverseInertia,n._original=null)}},n.setMass=function(t,e){var i=t.inertia/(t.mass/6);t.inertia=i*(e/6),t.inverseInertia=1/t.inertia,t.mass=e,t.inverseMass=1/t.mass,t.density=t.mass/t.area},n.setDensity=function(t,e){n.setMass(t,e*t.area),t.density=e},n.setInertia=function(t,e){t.inertia=e,t.inverseInertia=1/t.inertia},n.setVertices=function(t,e){e[0].body===t?t.vertices=e:t.vertices=r.create(e,t),t.axes=l.fromVertices(t.vertices),t.area=r.area(t.vertices),n.setMass(t,t.density*t.area);var i=r.centre(t.vertices);r.translate(t.vertices,i,-1),n.setInertia(t,n._inertiaScale*r.inertia(t.vertices,t.mass)),r.translate(t.vertices,t.position),h.update(t.bounds,t.vertices,t.velocity)},n.setParts=function(t,e,i){var s;for(e=e.slice(0),t.parts.length=0,t.parts.push(t),t.parent=t,s=0;s<e.length;s++){var o=e[s];o!==t&&(o.parent=t,t.parts.push(o))}if(1!==t.parts.length){if(i=void 0===i||i){var a=[];for(s=0;s<e.length;s++)a=a.concat(e[s].vertices);r.clockwiseSort(a);var l=r.hull(a),c=r.centre(l);n.setVertices(t,l),r.translate(t.vertices,c)}var u=n._totalProperties(t),d=u.centre.x,p=u.centre.y,f=t.bounds,m=t.centerOfMass,g=t.centerOffset;h.update(f,t.vertices,t.velocity),m.x=-(f.min.x-d)/(f.max.x-f.min.x),m.y=-(f.min.y-p)/(f.max.y-f.min.y),g.x=d,g.y=p,t.area=u.area,t.parent=t,t.position.x=d,t.position.y=p,t.positionPrev.x=d,t.positionPrev.y=p,n.setMass(t,u.mass),n.setInertia(t,u.inertia),n.setPosition(t,u.centre)}},n.setCentre=function(t,e,i){i?(t.positionPrev.x+=e.x,t.positionPrev.y+=e.y,t.position.x+=e.x,t.position.y+=e.y):(t.positionPrev.x=e.x-(t.position.x-t.positionPrev.x),t.positionPrev.y=e.y-(t.position.y-t.positionPrev.y),t.position.x=e.x,t.position.y=e.y)},n.setPosition=function(t,e){var i=s.sub(e,t.position);t.positionPrev.x+=i.x,t.positionPrev.y+=i.y;for(var n=0;n<t.parts.length;n++){var o=t.parts[n];o.position.x+=i.x,o.position.y+=i.y,r.translate(o.vertices,i),h.update(o.bounds,o.vertices,t.velocity)}},n.setAngle=function(t,e){var i=e-t.angle;t.anglePrev+=i;for(var n=0;n<t.parts.length;n++){var o=t.parts[n];o.angle+=i,r.rotate(o.vertices,i,t.position),l.rotate(o.axes,i),h.update(o.bounds,o.vertices,t.velocity),n>0&&s.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=s.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,s.add(t.position,e))},n.rotate=function(t,e,i){if(i){var r=Math.cos(e),s=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*r-a*s),y:i.y+(o*s+a*r)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,s){var o=0,a=0;s=s||t.position;for(var c=0;c<t.parts.length;c++){var u=t.parts[c];u.scale.x=e,u.scale.y=i,r.scale(u.vertices,e,i,s),u.axes=l.fromVertices(u.vertices),u.area=r.area(u.vertices),n.setMass(u,t.density*u.area),r.translate(u.vertices,{x:-u.position.x,y:-u.position.y}),n.setInertia(u,n._inertiaScale*r.inertia(u.vertices,u.mass)),r.translate(u.vertices,{x:u.position.x,y:u.position.y}),c>0&&(o+=u.area,a+=u.inertia),u.position.x=s.x+(u.position.x-s.x)*e,u.position.y=s.y+(u.position.y-s.y)*i,h.update(u.bounds,u.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,c=t.position.x-t.positionPrev.x,u=t.position.y-t.positionPrev.y;t.velocity.x=c*a*n+t.force.x/t.mass*o,t.velocity.y=u*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=s.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d<t.parts.length;d++){var p=t.parts[d];r.translate(p.vertices,t.velocity),d>0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(r.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),d>0&&s.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,r=e.y-t.position.y;t.torque+=n*i.y-r*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i<t.parts.length;i++){var n=t.parts[i],r=n.mass!==1/0?n.mass:1;e.mass+=r,e.area+=n.area,e.inertia+=n.inertia,e.centre=s.add(e.centre,s.mult(n.position,r))}return e.centre=s.div(e.centre,e.mass),e}}()},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(162),r=i(0),s=i(11),o=i(15),a=i(1059),h=new r({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,a],initialize:function(t,e,i,r,s){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new n(this),this.setTexture(r,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],r=e;r<i;r++)t[r]=t[r+1];return t.length=i,n}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ADDED_TO_SCENE:i(641),DESTROY:i(642),REMOVED_FROM_SCENE:i(643),VIDEO_COMPLETE:i(644),VIDEO_CREATED:i(645),VIDEO_ERROR:i(646),VIDEO_LOOP:i(647),VIDEO_PLAY:i(648),VIDEO_SEEKED:i(649),VIDEO_SEEKING:i(650),VIDEO_STOP:i(651),VIDEO_TIMEOUT:i(652),VIDEO_UNLOCKED:i(653)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e){t.exports=function(t,e,i,n){var r=t.length;if(e<0||e>r||e>=i||i>r||e+i>r){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Angry Bytes (and contributors)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
function i(t,e){return String(t).localeCompare(e)}function n(t,e,i,n){var r,s,o,a,h,l=t.length,c=0,u=2*i;for(r=0;r<l;r+=u)for(o=(s=r+i)+i,s>l&&(s=l),o>l&&(o=l),a=r,h=s;;)if(a<s&&h<o)e(t[a],t[h])<=0?n[c++]=t[a++]:n[c++]=t[h++];else if(a<s)n[c++]=t[a++];else{if(!(h<o))break;n[c++]=t[h++]}}t.exports=function(t,e){void 0===e&&(e=i);var r=function(t,e){var i=t.length;if(i<=1)return t;for(var r=new Array(i),s=1;s<i;s*=2){n(t,e,s,r);var o=t;t=r,r=o}return t}(t,e);return r!==t&&n(r,null,t.length,t),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(132),r=i(202);t.exports=function(t,e){var i=n.Power0;if("string"==typeof t)if(n.hasOwnProperty(t))i=n[t];else{var s="";t.indexOf(".")&&("in"===(s=t.substr(t.indexOf(".")+1)).toLowerCase()?s="easeIn":"out"===s.toLowerCase()?s="easeOut":"inout"===s.toLowerCase()&&(s="easeInOut")),t=r(t.substr(0,t.indexOf(".")+1)+s),n.hasOwnProperty(t)&&(i=n[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(12);t.exports=function(t,e,i,r,s){var o=t.strokeTint,a=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,c=e.lineWidth,u=c/2,d=h[0]-r,p=h[1]-s;e.closePath||(l-=2);for(var f=2;f<l;f+=2){var m=h[f]-r,g=h[f+1]-s;t.batchLine(d,p,m,g,u,u,c,f-2,!!e.closePath&&f===l-1),d=m,p=g}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(112),s=i(470),o=i(471),a=i(55),h=i(45),l=i(178),c=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),this.type=a.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=r,this.y3=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n,r,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=r,this.y3=s,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(29),r=i(0),s=i(11),o=i(496),a=new r({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,r,s,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=r,this.height=s,this.right,this.bottom,this.baseWidth=void 0!==o?o:r,this.baseHeight=void 0!==a?a:s,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(t<this.pixelX||e<this.pixelY||t>this.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,r){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===r&&(r=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,r&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===n.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===n.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===n.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===n.HEXAGONAL){var e=this.layer.hexSideLength,i=(this.baseHeight-e)/2+e;this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*i}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=a},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={POST_RENDER:i(626),PRE_RENDER:i(627),RENDER:i(628),RESIZE:i(629)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(74);t.exports=function(t,e,i,r){var s;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(n(t,s),i&&i.call(r,e),e):null;for(var o=e.length-1,a=[];o>=0;){var h=e[o];-1!==(s=t.indexOf(h))&&(n(t,s),a.push(h),i&&i.call(r,h)),o--}return a}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(196),s=i(10),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new s),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var n=Math.max(1,Math.round(i/e));return r(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),r=0;i.push(0);for(var s=1;s<=t;s++)r+=(e=this.getPoint(s/t,this._tmpVec2B)).distance(n),i.push(r),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var n=0;n<=t;n++)i.push(this.getPoint(n/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var n=0;n<=t;n++){var r=this.getUtoTmapping(n/t,null,t);i.push(this.getPoint(r))}return i},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,r=this.getLengths(i),s=0,o=r.length;n=e?Math.min(e,r[o-1]):t*r[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=r[s=Math.floor(h+(l-h)/2)]-n)<0)h=s+1;else{if(!(a>0)){l=s;break}l=s-1}if(r[s=l]===n)return s/(o-1);var c=r[s];return(s+(n-c)/(r[s+1]-c))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ADD:i(964),COMPLETE:i(965),FILE_COMPLETE:i(966),FILE_KEY_COMPLETE:i(967),FILE_LOAD_ERROR:i(968),FILE_LOAD:i(969),FILE_PROGRESS:i(970),POST_PROCESS:i(971),PROGRESS:i(972),START:i(973)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.x1,s=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,c=e.x2,u=e.y2,d=(u-l)*(o-r)-(c-h)*(a-s);if(0===d)return!1;var p=((c-h)*(s-l)-(u-l)*(r-h))/d,f=((o-r)*(s-l)-(a-s)*(r-h))/d;return p>=0&&p<=1&&f>=0&&f<=1&&(i.x=r+p*(o-r),i.y=s+p*(a-s),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e,i){var n={};t.exports=n;var r=i(116),s=i(50);n.create=function(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n],s={x:r.x,y:r.y,index:n,body:e,isInternal:!1,contact:null,offset:null};s.contact={vertex:s,normalImpulse:0,tangentImpulse:0},i.push(s)}return i},n.fromPath=function(t,e){var i=[];return t.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,(function(t,e,n){i.push({x:parseFloat(e),y:parseFloat(n)})})),n.create(i,e)},n.centre=function(t){for(var e,i,s,o=n.area(t,!0),a={x:0,y:0},h=0;h<t.length;h++)s=(h+1)%t.length,e=r.cross(t[h],t[s]),i=r.mult(r.add(t[h],t[s]),e),a=r.add(a,i);return r.div(a,6*o)},n.mean=function(t){for(var e={x:0,y:0},i=0;i<t.length;i++)e.x+=t[i].x,e.y+=t[i].y;return r.div(e,t.length)},n.area=function(t,e){for(var i=0,n=t.length-1,r=0;r<t.length;r++)i+=(t[n].x-t[r].x)*(t[n].y+t[r].y),n=r;return e?i/2:Math.abs(i)/2},n.inertia=function(t,e){for(var i,n,s=0,o=0,a=t,h=0;h<a.length;h++)n=(h+1)%a.length,s+=(i=Math.abs(r.cross(a[n],a[h])))*(r.dot(a[n],a[n])+r.dot(a[n],a[h])+r.dot(a[h],a[h])),o+=i;return e/6*(s/o)},n.translate=function(t,e,i){var n;if(i)for(n=0;n<t.length;n++)t[n].x+=e.x*i,t[n].y+=e.y*i;else for(n=0;n<t.length;n++)t[n].x+=e.x,t[n].y+=e.y;return t},n.rotate=function(t,e,i){if(0!==e){for(var n=Math.cos(e),r=Math.sin(e),s=0;s<t.length;s++){var o=t[s],a=o.x-i.x,h=o.y-i.y;o.x=i.x+(a*n-h*r),o.y=i.y+(a*r+h*n)}return t}},n.contains=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],r=t[(i+1)%t.length];if((e.x-n.x)*(r.y-n.y)+(e.y-n.y)*(n.x-r.x)>0)return!1}return!0},n.scale=function(t,e,i,s){if(1===e&&1===i)return t;var o,a;s=s||n.centre(t);for(var h=0;h<t.length;h++)o=t[h],a=r.sub(o,s),t[h].x=s.x+a.x*e,t[h].y=s.y+a.y*i;return t},n.chamfer=function(t,e,i,n,o){e="number"==typeof e?[e]:e||[8],i=void 0!==i?i:-1,n=n||2,o=o||14;for(var a=[],h=0;h<t.length;h++){var l=t[h-1>=0?h-1:t.length-1],c=t[h],u=t[(h+1)%t.length],d=e[h<e.length?h:e.length-1];if(0!==d){var p=r.normalise({x:c.y-l.y,y:l.x-c.x}),f=r.normalise({x:u.y-c.y,y:c.x-u.x}),m=Math.sqrt(2*Math.pow(d,2)),g=r.mult(s.clone(p),d),v=r.normalise(r.mult(r.add(p,f),.5)),y=r.sub(c,r.mult(v,m)),x=i;-1===i&&(x=1.75*Math.pow(d,.32)),(x=s.clamp(x,n,o))%2==1&&(x+=1);for(var b=Math.acos(r.dot(p,f))/x,w=0;w<x;w++)a.push(r.add(r.rotate(g,b*w),y))}else a.push(c)}return a},n.clockwiseSort=function(t){var e=n.mean(t);return t.sort((function(t,i){return r.angle(e,t)-r.angle(e,i)})),t},n.isConvex=function(t){var e,i,n,r,s=0,o=t.length;if(o<3)return null;for(e=0;e<o;e++)if(n=(e+2)%o,r=(t[i=(e+1)%o].x-t[e].x)*(t[n].y-t[i].y),(r-=(t[i].y-t[e].y)*(t[n].x-t[i].x))<0?s|=1:r>0&&(s|=2),3===s)return!1;return 0!==s||null},n.hull=function(t){var e,i,n=[],s=[];for((t=t.slice(0)).sort((function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y})),i=0;i<t.length;i+=1){for(e=t[i];s.length>=2&&r.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&r.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),s.pop(),n.concat(s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(309),s=new n({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n<t.length;n++)i.push(e[t[n]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},inc:function(t,e){if(this._frozen)return this;void 0===e&&(e=1);var i=this.get(t);return void 0===i&&(i=0),this.set(t,i+e),this},toggle:function(t){return this._frozen||this.set(t,!this.get(t)),this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var i=this,n=this.list,s=this.events,o=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return n[t]},set:function(e){if(!i._frozen){var a=n[t];n[t]=e,s.emit(r.CHANGE_DATA,o,t,e,a),s.emit(r.CHANGE_DATA_KEY+t,o,e,a)}}}),n[t]=e,s.emit(r.SET_DATA,o,t,e)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var r in this.list)i[1]=r,i[2]=this.list[r],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit(r.REMOVE_DATA,this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit(r.REMOVE_DATA,this.parent,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(r.CHANGE_DATA),this.events.off(r.SET_DATA),this.events.off(r.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e][0],t[e][1])},set:function(t,e){return this.has(t)||this.size++,this.entries[t]=e,this},get:function(t){if(this.has(t))return this.entries[t]},getArray:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},has:function(t){return this.entries.hasOwnProperty(t)},delete:function(t){return this.has(t)&&(delete this.entries[t],this.size--),this},clear:function(){return Object.keys(this.entries).forEach((function(t){delete this.entries[t]}),this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},dump:function(){var t=this.entries;for(var e in console.group("Map"),t)console.log(e,t[e]);console.groupEnd()},each:function(t){var e=this.entries;for(var i in e)if(!1===t(i,e[i]))break;return this},contains:function(t){var e=this.entries;for(var i in e)if(e[i]===t)return!0;return!1},merge:function(t,e){void 0===e&&(e=!1);var i=this.entries,n=t.entries;for(var r in n)i.hasOwnProperty(r)&&e?i[r]=n[r]:this.set(r,n[r]);return this}});t.exports=n},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ENTER_FULLSCREEN:i(776),FULLSCREEN_FAILED:i(777),FULLSCREEN_UNSUPPORTED:i(778),LEAVE_FULLSCREEN:i(779),ORIENTATION_CHANGE:i(780),RESIZE:i(781)}},function(t,e,i){(function(e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){var t=navigator.userAgent;/Windows/.test(t)?i.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(i.iOS=!0,i.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),i.iOSVersion=parseInt(RegExp.$1,10)):i.macOS=!0:/Android/.test(t)?i.android=!0:/Linux/.test(t)?i.linux=!0:/iP[ao]d|iPhone/i.test(t)?(i.iOS=!0,navigator.appVersion.match(/OS (\d+)/),i.iOSVersion=parseInt(RegExp.$1,10),i.iPhone=-1!==t.toLowerCase().indexOf("iphone"),i.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?i.kindle=!0:/CrOS/.test(t)&&(i.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(i.android=!1,i.iOS=!1,i.macOS=!1,i.windows=!0,i.windowsPhone=!0);var n=/Silk/.test(t);return(i.windows||i.macOS||i.linux&&!n||i.chromeOS)&&(i.desktop=!0),(i.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(i.desktop=!1),navigator.standalone&&(i.webApp=!0),void 0!==window.cordova&&(i.cordova=!0),void 0!==e&&e.versions&&e.versions.node&&(i.node=!0),i.node&&"object"==typeof e.versions&&(i.nodeWebkit=!!e.versions["node-webkit"],i.electron=!!e.versions.electron),void 0!==window.ejecta&&(i.ejecta=!0),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(804))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ADD:i(857),ERROR:i(858),LOAD:i(859),READY:i(860),REMOVE:i(861)}},function(t,e){t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=i(874),o=i(875),a=i(25),h=i(12),l=i(104),c=i(57),u=new n({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",s);t.fragShader=h.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",o),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:l.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new a,this._tempMatrix2=new a,this._tempMatrix3=new a},boot:function(){c.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var n=this._tempMatrix1,r=this._tempMatrix2,s=this._tempMatrix3,o=t.frame,a=o.glTexture,l=o.u0,c=o.v0,u=o.u1,d=o.v1,p=o.x,f=o.y,m=o.cutWidth,g=o.cutHeight,v=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,b=-y+p,w=-x+f;if(t.isCropped){var T=t._crop;T.flipX===t.flipX&&T.flipY===t.flipY||o.updateCropUVs(T,t.flipX,t.flipY),l=T.u0,c=T.v0,u=T.u1,d=T.v1,m=T.width,g=T.height,b=-y+(p=T.x),w=-x+(f=T.y)}var _=1,E=1;t.flipX&&(v||(b+=-o.realWidth+2*y),_=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(v||(w+=-o.realHeight+2*x),E=-1),r.applyITRS(t.x,t.y,t.rotation,t.scaleX*_,t.scaleY*E),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),r.e=t.x,r.f=t.y):(r.e-=e.scrollX*t.scrollFactorX,r.f-=e.scrollY*t.scrollFactorY),n.multiply(r,s);var S=b+m,M=w+g,A=e.roundPixels,C=s.getXRound(b,w,A),P=s.getYRound(b,w,A),R=s.getXRound(b,M,A),L=s.getYRound(b,M,A),O=s.getXRound(S,M,A),D=s.getYRound(S,M,A),I=s.getXRound(S,w,A),F=s.getYRound(S,w,A),B=h.getTintAppendFloatAlpha,k=e.alpha,N=B(t.tintTopLeft,k*t._alphaTL),U=B(t.tintTopRight,k*t._alphaTR),z=B(t.tintBottomLeft,k*t._alphaBL),G=B(t.tintBottomRight,k*t._alphaBR);this.shouldFlush(6)&&this.flush();var V=this.setGameObject(t,o);this.manager.preBatch(t),this.batchQuad(t,C,P,R,L,O,D,I,F,l,c,u,d,N,U,z,G,t.tintFill,a,V),this.manager.postBatch(t)},batchTexture:function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x,b,w,T,_,E,S,M,A,C,P,R,L){this.manager.set(this,t);var O=this._tempMatrix1,D=this._tempMatrix2,I=this._tempMatrix3,F=v/i+M,B=y/n+A,k=(v+x)/i+M,N=(y+b)/n+A,U=o,z=a,G=-m,V=-g;if(t.isCropped){var H=t._crop,W=H.width,X=H.height;U=W,z=X,o=W,a=X;var j=v=H.x,Y=y=H.y;u&&(j=x-H.x-W),d&&(Y=b-H.y-X),F=j/i+M,B=Y/n+A,k=(j+W)/i+M,N=(Y+X)/n+A,G=-m+v,V=-g+y}u&&(U*=-1,G+=o),(d^=!R&&e.isRenderTexture?1:0)&&(z*=-1,V+=a);var q=G+U,Z=V+z;D.applyITRS(r,s,c,h,l),O.copyFrom(C.matrix),P?(O.multiplyWithOffset(P,-C.scrollX*p,-C.scrollY*f),D.e=r,D.f=s):(D.e-=C.scrollX*p,D.f-=C.scrollY*f),O.multiply(D,I);var K=C.roundPixels,J=I.getXRound(G,V,K),Q=I.getYRound(G,V,K),$=I.getXRound(G,Z,K),tt=I.getYRound(G,Z,K),et=I.getXRound(q,Z,K),it=I.getYRound(q,Z,K),nt=I.getXRound(q,V,K),rt=I.getYRound(q,V,K);void 0===L&&(L=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,nt,rt,F,B,k,N,w,T,_,E,S,e,L),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,n,r,s,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(s),l=this._tempMatrix2,c=e+t.width,u=i+t.height;o?a.multiply(o,l):l=a;var d=l.getX(e,i),p=l.getY(e,i),f=l.getX(e,u),m=l.getY(e,u),g=l.getX(c,u),v=l.getY(c,u),y=l.getX(c,i),x=l.getY(c,i),b=this.renderer.setTextureSource(t.source);n=h.getTintAppendFloatAlpha(n,r),this.batchQuad(null,d,p,f,m,g,v,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,b)}});t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(18),s=i(17),o=new n({initialize:function(t,e,i,n,r,s,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(s,o,n,r)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,s=r.cut;s.x=i,s.y=n,s.w=t,s.h=e,s.r=i+t,s.b=n+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var o=r.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,r,s){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=r,a.h=s,a.r=i+r,a.b=n+s,this.x=i,this.y=n,this.width=r,this.height=s,this.halfWidth=.5*r,this.halfHeight=.5*s,this.centerX=Math.floor(r/2),this.centerY=Math.floor(s/2),this.updateUVs()},setCropUVs:function(t,e,i,n,s,o,a){var h=this.cutX,l=this.cutY,c=this.cutWidth,u=this.cutHeight,d=this.realWidth,p=this.realHeight,f=h+(e=r(e,0,d)),m=l+(i=r(i,0,p)),g=n=r(n,0,d-e),v=s=r(s,0,p-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,b=e+(n=r(n,0,c-e)),w=i+(s=r(s,0,u-i));if(x.r<e||x.b<i||x.x>b||x.y>w)f=0,m=0,g=0,v=0;else{var T=Math.max(x.x,e),_=Math.max(x.y,i),E=Math.min(x.r,b)-T,S=Math.min(x.b,w)-_;g=E,v=S,f=o?h+(c-(T-x.x)-E):h+(T-x.x),m=a?l+(u-(_-x.y)-S):l+(_-x.y),e=T,i=_,n=E,s=S}}else o&&(f=h+(c-e-n)),a&&(m=l+(u-i-s));var M=this.source.width,A=this.source.height;return t.u0=Math.max(0,f/M),t.v0=Math.max(0,m/A),t.u1=Math.min(1,(f+g)/M),t.v1=Math.min(1,(m+v)/A),t.x=e,t.y=i,t.cx=f,t.cy=m,t.cw=g,t.ch=v,t.width=n,t.height=s,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,r,s){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=n,this.u1=r,this.v1=s,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=n;var s=this.source.width,o=this.source.height;return this.u0=t/s,this.v0=e/o,this.u1=(t+i)/s,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(205),r=i(0),s=i(1),o=i(79),a=new r({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=s,this.removeCallback=s,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,r){return n.GetFirst(this.list,t,e,i,r)},getAll:function(t,e,i,r){return n.GetAll(this.list,t,e,i,r)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){for(var i=[null],n=2;n<arguments.length;n++)i.push(arguments[n]);for(n=0;n<this.list.length;n++)i[0]=this.list[n],t.apply(e,i)},shutdown:function(){this.removeAll(),this.list=[]},destroy:function(){this.removeAll(),this.parent=null,this.addCallback=null,this.removeCallback=null},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(109),s=i(439),o=i(440),a=i(55),h=i(177),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,r=(i-t.y)/t.height;return(n*=n)+(r*=r)<.25}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(269),r=i(0),s=i(75),o=i(9),a=i(204),h=i(2),l=i(6),c=i(7),u=i(431),d=i(148),p=i(73),f=new r({Extends:o,initialize:function(t,e,i){o.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?c(e[0])&&(i=e,e=null):c(e)&&(i=e,e=null),this.scene=t,this.children=new d,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",p),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,n,r,s){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===r&&(r=!0),void 0===s&&(s=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=r,o.setActive(s),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i<t.length;i++){var n=this.createFromConfig(t[i]);e=e.concat(n)}return e},createFromConfig:function(t){if(this.isFull())return[];this.classType=h(t,"classType",this.classType);var e=h(t,"key",void 0),i=h(t,"frame",null),r=h(t,"visible",!0),s=h(t,"active",!0),o=[];if(void 0===e)return o;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);var a=h(t,"repeat",0),c=h(t,"randomKey",!1),d=h(t,"randomFrame",!1),p=h(t,"yoyo",!1),f=h(t,"quantity",!1),m=h(t,"frameQuantity",1),g=h(t,"max",0),v=u(e,i,{max:g,qty:f||m,random:c,randomB:d,repeat:a,yoyo:p});t.createCallback&&(this.createCallback=t.createCallback),t.removeCallback&&(this.removeCallback=t.removeCallback);for(var y=0;y<v.length;y++){var x=this.create(0,0,v[y].a,v[y].b,r,s);if(!x)break;o.push(x)}var b=l(t,"setXY.x",0),w=l(t,"setXY.y",0),T=l(t,"setXY.stepX",0),_=l(t,"setXY.stepY",0);n.SetXY(o,b,w,T,_);var E=l(t,"setRotation.value",0),S=l(t,"setRotation.step",0);n.SetRotation(o,E,S);var M=l(t,"setScale.x",1),A=l(t,"setScale.y",M),C=l(t,"setScale.stepX",0),P=l(t,"setScale.stepY",0);n.SetScale(o,M,A,C,P);var R=l(t,"setOrigin.x",.5),L=l(t,"setOrigin.y",R),O=l(t,"setOrigin.stepX",0),D=l(t,"setOrigin.stepY",0);n.SetOrigin(o,R,L,O,D);var I=l(t,"setAlpha.value",1),F=l(t,"setAlpha.step",0);n.SetAlpha(o,I,F);var B=l(t,"setDepth.value",0),k=l(t,"setDepth.step",0);n.SetDepth(o,B,k);var N=l(t,"setScrollFactor.x",1),U=l(t,"setScrollFactor.y",N),z=l(t,"setScrollFactor.stepX",0),G=l(t,"setScrollFactor.stepY",0);n.SetScrollFactor(o,N,U,z,G);var V=h(t,"hitArea",null),H=h(t,"hitAreaCallback",null);V&&n.SetHitArea(o,V,H);var W=h(t,"gridAlign",!1);return W&&n.GridAlign(o,W),this.createMultipleCallback&&this.createMultipleCallback.call(this,o),o},preUpdate:function(t,e){if(this.runChildUpdate&&0!==this.children.size)for(var i=this.children.entries.slice(),n=0;n<i.length;n++){var r=i[n];r.active&&r.update(t,e)}},add:function(t,e){return void 0===e&&(e=!1),this.isFull()||(this.children.set(t),this.internalCreateCallback&&this.internalCreateCallback.call(this,t),this.createCallback&&this.createCallback.call(this,t),e&&(this.scene.sys.displayList.add(t),t.preUpdate&&this.scene.sys.updateList.add(t)),t.on(s.DESTROY,this.remove,this)),this},addMultiple:function(t,e){if(void 0===e&&(e=!1),Array.isArray(t))for(var i=0;i<t.length;i++)this.add(t[i],e);return this},remove:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.children.contains(t)?(this.children.delete(t),this.internalRemoveCallback&&this.internalRemoveCallback.call(this,t),this.removeCallback&&this.removeCallback.call(this,t),t.off(s.DESTROY,this.remove,this),i?t.destroy():e&&(t.scene.sys.displayList.remove(t),t.preUpdate&&t.scene.sys.updateList.remove(t)),this):this},clear:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.children,n=0;n<i.size;n++){var r=i.entries[n];r.off(s.DESTROY,this.remove,this),e?r.destroy():t&&(r.scene.sys.displayList.remove(r),r.preUpdate&&r.scene.sys.updateList.remove(r))}return this.children.clear(),this},contains:function(t){return this.children.contains(t)},getChildren:function(){return this.children.entries},getLength:function(){return this.children.size},getMatching:function(t,e,i,n){return a(this.children.entries,t,e,i,n)},getFirst:function(t,e,i,n,r,s,o){return this.getHandler(!0,1,t,e,i,n,r,s,o)},getFirstNth:function(t,e,i,n,r,s,o,a){return this.getHandler(!0,t,e,i,n,r,s,o,a)},getLast:function(t,e,i,n,r,s,o){return this.getHandler(!1,1,t,e,i,n,r,s,o)},getLastNth:function(t,e,i,n,r,s,o,a){return this.getHandler(!1,t,e,i,n,r,s,o,a)},getHandler:function(t,e,i,n,r,s,o,a,h){var l,c;void 0===i&&(i=!1),void 0===n&&(n=!1);var u=0,d=this.children.entries;if(t)for(c=0;c<d.length;c++)if((l=d[c]).active===i){if(++u===e)break}else l=null;else for(c=d.length-1;c>=0;c--)if((l=d[c]).active===i){if(++u===e)break}else l=null;return l?("number"==typeof r&&(l.x=r),"number"==typeof s&&(l.y=s),l):n?this.create(r,s,o,a,h):null},get:function(t,e,i,n,r){return this.getFirst(!1,!0,t,e,i,n,r)},getFirstAlive:function(t,e,i,n,r,s){return this.getFirst(!0,t,e,i,n,r,s)},getFirstDead:function(t,e,i,n,r,s){return this.getFirst(!1,t,e,i,n,r,s)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i<this.children.size;i++)this.children.entries[i].active===t&&e++;return e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,r,s){return n.PropertyValueSet(this.children.entries,t,e,i,r,s),this},propertyValueInc:function(t,e,i,r,s){return n.PropertyValueInc(this.children.entries,t,e,i,r,s),this},setX:function(t,e){return n.SetX(this.children.entries,t,e),this},setY:function(t,e){return n.SetY(this.children.entries,t,e),this},setXY:function(t,e,i,r){return n.SetXY(this.children.entries,t,e,i,r),this},incX:function(t,e){return n.IncX(this.children.entries,t,e),this},incY:function(t,e){return n.IncY(this.children.entries,t,e),this},incXY:function(t,e,i,r){return n.IncXY(this.children.entries,t,e,i,r),this},shiftPosition:function(t,e,i){return n.ShiftPosition(this.children.entries,t,e,i),this},angle:function(t,e){return n.Angle(this.children.entries,t,e),this},rotate:function(t,e){return n.Rotate(this.children.entries,t,e),this},rotateAround:function(t,e){return n.RotateAround(this.children.entries,t,e),this},rotateAroundDistance:function(t,e,i){return n.RotateAroundDistance(this.children.entries,t,e,i),this},setAlpha:function(t,e){return n.SetAlpha(this.children.entries,t,e),this},setTint:function(t,e,i,r){return n.SetTint(this.children.entries,t,e,i,r),this},setOrigin:function(t,e,i,r){return n.SetOrigin(this.children.entries,t,e,i,r),this},scaleX:function(t,e){return n.ScaleX(this.children.entries,t,e),this},scaleY:function(t,e){return n.ScaleY(this.children.entries,t,e),this},scaleXY:function(t,e,i,r){return n.ScaleXY(this.children.entries,t,e,i,r),this},setDepth:function(t,e){return n.SetDepth(this.children.entries,t,e),this},setBlendMode:function(t){return n.SetBlendMode(this.children.entries,t),this},setHitArea:function(t,e){return n.SetHitArea(this.children.entries,t,e),this},shuffle:function(){return n.Shuffle(this.children.entries),this},kill:function(t){this.children.contains(t)&&t.setActive(!1)},killAndHide:function(t){this.children.contains(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return n.SetVisible(this.children.entries,t,e,i),this},toggleVisible:function(){return n.ToggleVisible(this.children.entries),this},destroy:function(t){void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy&&(this.clear(!1,t),this.scene=void 0,this.children=void 0)}});t.exports=f},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(12);t.exports=function(t,e,i,r,s,o){for(var a=n.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*r),h=i.pathData,l=i.pathIndexes,c=0;c<l.length;c+=3){var u=2*l[c],d=2*l[c+1],p=2*l[c+2],f=h[u+0]-s,m=h[u+1]-o,g=h[d+0]-s,v=h[d+1]-o,y=h[p+0]-s,x=h[p+1]-o,b=e.getX(f,m),w=e.getY(f,m),T=e.getX(g,v),_=e.getY(g,v),E=e.getX(y,x),S=e.getY(y,x);t.batchTri(b,w,T,_,E,S,a,a,a)}}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,r=t.y3-t.y1,s=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+r*r,c=n*s+r*o,u=n*a+r*h,d=s*s+o*o,p=s*a+o*h,f=l*d-c*c,m=0===f?0:1/f,g=(d*u-c*p)*m,v=(l*p-c*u)*m;return g>=0&&v>=0&&g+v<1}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(10),s=i(114),o=i(3);function a(t,e,i,n){var r=t-i,s=e-n,o=r*r+s*s;return Math.sqrt(o)}var h=new n({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new r,this._inCenter=new o},getInCenter:function(t){void 0===t&&(t=!0);var e,i,n,r,s,o,h=this.vertex1,l=this.vertex2,c=this.vertex3;t?(e=h.x,i=h.y,n=l.x,r=l.y,s=c.x,o=c.y):(e=h.vx,i=h.vy,n=l.vx,r=l.vy,s=c.vx,o=c.vy);var u=a(s,o,n,r),d=a(e,i,s,o),p=a(n,r,e,i),f=u+d+p;return this._inCenter.set((e*u+n*d+s*p)/f,(i*u+r*d+o*p)/f)},contains:function(t,e,i){var n=this.vertex1,r=this.vertex2,s=this.vertex3,o=n.vx,a=n.vy,h=r.vx,l=r.vy,c=s.vx,u=s.vy;if(i){var d=i.a,p=i.b,f=i.c,m=i.d,g=i.e,v=i.f;o=n.vx*d+n.vy*f+g,a=n.vx*p+n.vy*m+v,h=r.vx*d+r.vy*f+g,l=r.vx*p+r.vy*m+v,c=s.vx*d+s.vy*f+g,u=s.vx*p+s.vy*m+v}var y=c-o,x=u-a,b=h-o,w=l-a,T=t-o,_=e-a,E=y*y+x*x,S=y*b+x*w,M=y*T+x*_,A=b*b+w*w,C=b*T+w*_,P=E*A-S*S,R=0===P?0:1/P,L=(A*M-S*C)*R,O=(E*C-S*M)*R;return L>=0&&O>=0&&L+O<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,n=this.vertex3,r=(i.vx-e.vx)*(n.vy-e.vy)-(i.vy-e.vy)*(n.vx-e.vx);return t<=0?r>=0:r<0},load:function(t,e,i,n,r){return i=this.vertex1.load(t,e,i,n,r),i=this.vertex2.load(t,e,i,n,r),i=this.vertex3.load(t,e,i,n,r)},transformCoordinatesLocal:function(t,e,i,n){return this.vertex1.transformCoordinatesLocal(t,e,i,n),this.vertex2.transformCoordinatesLocal(t,e,i,n),this.vertex3.transformCoordinatesLocal(t,e,i,n),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,n=this.bounds;return n.x=Math.min(t.vx,e.vx,i.vx),n.y=Math.min(t.vy,e.vy,i.vy),n.width=Math.max(t.vx,e.vx,i.vx)-n.x,n.height=Math.max(t.vy,e.vy,i.vy)-n.y,this},isInView:function(t,e,i,n,r,o,a,h,l,c,u){var d=this.vertex1.update(r,o,a,h,l,c,u,n),p=this.vertex2.update(r,o,a,h,l,c,u,n),f=this.vertex3.update(r,o,a,h,l,c,u,n);if(d.ta<=0&&p.ta<=0&&f.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var m=this.bounds;return m.x=Math.min(d.tx,p.tx,f.tx),m.y=Math.min(d.ty,p.ty,f.ty),m.width=Math.max(d.tx,p.tx,f.tx)-m.x,m.height=Math.max(d.ty,p.ty,f.ty)-m.y,s(m,t.worldView)},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,n=this.vertex2,r=this.vertex3;return i.x+=t,i.y+=e,n.x+=t,n.y+=e,r.x+=t,r.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=h},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.right<e.x||t.bottom<e.y||t.x>e.right||t.y>e.bottom)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(12),s=i(38),o=new n({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,c){void 0===o&&(o=16777215),void 0===a&&(a=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===c&&(c=0),s.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=c,this.u=n,this.v=r,this.color=o,this.alpha=a,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,n){var r=this.x,s=this.y,o=this.z,a=t.val,h=r*a[0]+s*a[4]+o*a[8]+a[12],l=r*a[1]+s*a[5]+o*a[9]+a[13],c=r*a[2]+s*a[6]+o*a[10]+a[14],u=r*a[3]+s*a[7]+o*a[11]+a[15];this.vx=h/u*e,this.vy=-l/u*i,this.vz=n<=0?c/u:-c/u},update:function(t,e,i,n,r,s,o,a){var h=this.vx*t+this.vy*i+r,l=this.vx*e+this.vy*n+s;return o&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*a,this},load:function(t,e,i,n,s){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=n,t[++i]=s,e[++i]=r.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=o},function(t,e){var i={};t.exports=i,i.create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),r=Math.sin(e);i||(i={});var s=t.x*n-t.y*r;return i.y=t.x*r+t.y*n,i.x=s,i},i.rotateAbout=function(t,e,i,n){var r=Math.cos(e),s=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*r-(t.y-i.y)*s);return n.y=i.y+((t.x-i.x)*s+(t.y-i.y)*r),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e){var i={};t.exports=i,i.create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;n<e.length;n++){var r=e[n];r.x>t.max.x&&(t.max.x=r.x),r.x<t.min.x&&(t.min.x=r.x),r.y>t.max.y&&(t.max.y=r.y),r.y<t.min.y&&(t.min.y=r.y)}i&&(i.x>0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){t.exports=function(t,e,i){return t>=0&&t<i.width&&e>=0&&e<i.height}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(29),s=i(2),o=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.orientation=s(t,"orientation",r.ORTHOGONAL),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",[]),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null),this.hexSideLength=s(t,"hexSideLength",0)}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(29),s=i(2),o=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.infinite=s(t,"infinite",!1),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation",r.ORTHOGONAL),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[]),this.hexSideLength=s(t,"hexSideLength",0)}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e,i,n,r,s,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=r,this.tileSpacing=s,this.tileProperties=o,this.tileData=a,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},getTileTextureCoordinates:function(t){return this.containsTileIndex(t)?this.texCoordinates[t-this.firstgid]:null},setImage:function(t){return this.image=t,this.glTexture=t.get().source.glTexture,this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e){var i=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);i%1==0&&n%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),i=Math.floor(i),n=Math.floor(n),this.rows=i,this.columns=n,this.total=i*n,this.texCoordinates.length=0;for(var r=this.tileMargin,s=this.tileMargin,o=0;o<this.rows;o++){for(var a=0;a<this.columns;a++)this.texCoordinates.push({x:r,y:s}),r+=this.tileWidth+this.tileSpacing;r=this.tileMargin,s+=this.tileHeight+this.tileSpacing}return this}});t.exports=n},function(t,e){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(15),o=i(1062),a=new n({Extends:s,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,o],initialize:function(t,e,i,n,r){s.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,i){var n={};t.exports=n;var r=i(94),s=i(50),o=i(71),a=i(117),h=i(116),l=i(1487);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:r.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=r.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(s.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,c=i*(a*=.5),u=c+(1-2*a)*i,d=u+c;l=a<.5?"L 0 0 L "+c+" "+-n+" L "+u+" "+-n+" L "+d+" 0":"L 0 0 L "+u+" "+-n+" L "+d+" 0";var p={label:"Trapezoid Body",position:{x:t,y:e},vertices:r.fromPath(l)};if(h.chamfer){var f=h.chamfer;p.vertices=r.chamfer(p.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete h.chamfer}return o.create(s.extend({},p,h))},n.circle=function(t,e,i,r,o){r=r||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,s.extend({},a,r))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,c="",u=.5*l,d=0;d<i;d+=1){var p=u+d*l,f=Math.cos(p)*a,m=Math.sin(p)*a;c+="L "+f.toFixed(3)+" "+m.toFixed(3)+" "}var g={label:"Polygon Body",position:{x:t,y:e},vertices:r.fromPath(c)};if(h.chamfer){var v=h.chamfer;g.vertices=r.chamfer(g.vertices,v.radius,v.quality,v.qualityMin,v.qualityMax),delete h.chamfer}return o.create(s.extend({},g,h))},n.fromVertices=function(t,e,i,a,h,c,u){var d,p,f,m,g,v;for(a=a||{},p=[],h=void 0!==h&&h,c=void 0!==c?c:.01,u=void 0!==u?u:10,l||s.warn("Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull."),s.isArray(i[0])||(i=[i]),v=0;v<i.length;v+=1)if(m=i[v],(f=r.isConvex(m))||!l)m=f?r.clockwiseSort(m):r.hull(m),p.push({position:{x:t,y:e},vertices:m});else{var y=m.map((function(t){return[t.x,t.y]}));l.makeCCW(y),!1!==c&&l.removeCollinearPoints(y,c);var x=l.quickDecomp(y);for(g=0;g<x.length;g++){var b=x[g].map((function(t){return{x:t[0],y:t[1]}}));u>0&&r.area(b)<u||p.push({position:r.centre(b),vertices:b})}}for(g=0;g<p.length;g++)p[g]=o.create(s.extend(p[g],a));return h&&n.flagCoincidentParts(p,5),p.length>1?(d=o.create(s.extend({parts:p.slice(0)},a)),o.setPosition(d,{x:t,y:e}),d):p[0]},n.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i<t.length;i++)for(var n=t[i],r=i+1;r<t.length;r++){var s=t[r];if(a.overlaps(n.bounds,s.bounds))for(var o=n.vertices,l=s.vertices,c=0;c<n.vertices.length;c++)for(var u=0;u<s.vertices.length;u++){var d=h.magnitudeSquared(h.sub(o[(c+1)%o.length],l[u])),p=h.magnitudeSquared(h.sub(o[c],l[(u+1)%l.length]));d<e&&p<e&&(o[c].isInternal=!0,l[u].isInternal=!0)}}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(34),r=i(62),s=i(63),o=i(0),a=i(11),h=i(15),l=i(10),c=i(56),u=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,r,s){void 0===r&&(r=1),void 0===s&&(s=r),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=r,this.height=s,this.blendMode=n.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var n=this.input;return i&&n&&!n.customHitArea&&(n.hitArea.width=t,n.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new r(0,0,t),s)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),c)},setDropZone:function(t,e){return void 0===t?this.setRectangleDropZone(this.width,this.height):this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(){},renderWebGL:function(){}});t.exports=u},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ADD_ANIMATION:i(700),ANIMATION_COMPLETE:i(701),ANIMATION_COMPLETE_KEY:i(702),ANIMATION_REPEAT:i(703),ANIMATION_RESTART:i(704),ANIMATION_START:i(705),ANIMATION_STOP:i(706),ANIMATION_UPDATE:i(707),PAUSE_ALL:i(708),REMOVE_ANIMATION:i(709),RESUME_ALL:i(710)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(35),o=i(9),a=i(36),h=i(10),l=i(25),c=i(184),u=i(3),d=new n({Extends:o,Mixins:[r.Alpha,r.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=c("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new u(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[]},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new u);var n=.5*this.width,r=.5*this.height;return i.x=t-n,i.y=e-r,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],r=e[2],s=e[3],o=i*s-n*r;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,c=this.scrollY,u=this.width,d=this.height,p=this.y,f=p+d,m=this.x,g=m+u,v=this.culledObjects,y=t.length;o=1/o,v.length=0;for(var x=0;x<y;++x){var b=t[x];if(b.hasOwnProperty("width")&&!b.parentContainer){var w=b.width,T=b.height,_=b.x-l*b.scrollFactorX-w*b.originX,E=b.y-c*b.scrollFactorY-T*b.originY;(_+w)*i+(E+T)*r+a>m&&_*i+E*r+a<g&&(_+w)*n+(E+T)*s+h>p&&_*n+E*s+h<f&&v.push(b)}else v.push(b)}return v},getWorldPoint:function(t,e,i){void 0===i&&(i=new u);var n=this.matrix.matrix,r=n[0],s=n[1],o=n[2],a=n[3],h=n[4],l=n[5],c=r*a-s*o;if(!c)return i.x=t,i.y=e,i;var d=a*(c=1/c),p=-s*c,f=-o*c,m=r*c,g=(o*l-a*h)*c,v=(s*h-r*l)*c,y=Math.cos(this.rotation),x=Math.sin(this.rotation),b=this.zoomX,w=this.zoomY,T=this.scrollX,_=this.scrollY,E=t+(T*y-_*x)*b,S=e+(T*x+_*y)*w;return i.x=E*d+S*f+g,i.y=E*p+S*m+v,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];Array.isArray(n)?this.ignore(n):n.isParent?this.ignore(n.getChildren()):n.cameraFilter|=e}return this},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,n=.5*e,r=this.zoomX,s=this.zoomY,o=this.matrix,a=t*this.originX,h=e*this.originY,l=this.scrollX,c=this.scrollY;this.useBounds&&(l=this.clampX(l),c=this.clampY(c)),this.roundPixels&&(a=Math.round(a),h=Math.round(h)),this.scrollX=l,this.scrollY=c;var u=l+i,d=c+n;this.midPoint.set(u,d);var p=t/r,f=e/s;this.worldView.setTo(u-p/2,d-f/2,p,f),o.applyITRS(this.x+a,this.y+h,this.rotation,r,s),o.translate(-a,-h)},clampX:function(t){var e=this._bounds,i=this.displayWidth,n=e.x+(i-this.width)/2,r=Math.max(n,n+e.width-i);return t<n?t=n:t>r&&(t=r),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,r=Math.max(n,n+e.height-i);return t<n?t=n:t>r&&(t=r),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=s(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=c(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,r){return void 0===r&&(r=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,r?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;return this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(328),r=i(329),s=i(330),o=i(331),a=i(332),h=i(333),l=i(334),c=i(335),u=i(336),d=i(337),p=i(338),f=i(339);t.exports={Power0:l,Power1:c.Out,Power2:o.Out,Power3:u.Out,Power4:d.Out,Linear:l,Quad:c.Out,Cubic:o.Out,Quart:u.Out,Quint:d.Out,Sine:p.Out,Expo:h.Out,Circ:s.Out,Elastic:a.Out,Back:n.Out,Bounce:r.Out,Stepped:f,"Quad.easeIn":c.In,"Cubic.easeIn":o.In,"Quart.easeIn":u.In,"Quint.easeIn":d.In,"Sine.easeIn":p.In,"Expo.easeIn":h.In,"Circ.easeIn":s.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":r.In,"Quad.easeOut":c.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":u.Out,"Quint.easeOut":d.Out,"Sine.easeOut":p.Out,"Expo.easeOut":h.Out,"Circ.easeOut":s.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":r.Out,"Quad.easeInOut":c.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":u.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":p.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":s.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":r.InOut}},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n,r=i(102),s={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?s.edge=!0:/Chrome\/(\d+)/.test(n)&&!r.windowsPhone?(s.chrome=!0,s.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(s.firefox=!0,s.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&r.iOS?s.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(s.ie=!0,s.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?s.opera=!0:/Safari/.test(n)&&!r.windowsPhone?s.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(s.ie=!0,s.trident=!0,s.tridentVersion=parseInt(RegExp.$1,10),s.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(s.silk=!0),s)},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=n*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+n*n+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*n-o*i,l=a*i+o*e-r*n,c=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=h*a+u*-r+l*-o-c*-s,this.y=l*a+u*-s+c*-r-h*-o,this.z=c*a+u*-o+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(88),s=new n({initialize:function(t,e,i,n,r,s,o){void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=!0),void 0===o&&(o=!1),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=n,this.minFilter=r,this.autoClear=s,this.autoResize=!1,this.resize(e,i),o&&this.setAutoResize(!0)},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(r.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(r.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){var i=t*this.scale,n=e*this.scale;if(i!==this.width||n!==this.height){var r=this.renderer;r.deleteFramebuffer(this.framebuffer),r.deleteTexture(this.texture),t*=this.scale,e*=this.scale,this.texture=r.createTextureFromSource(null,t,e,this.minFilter),this.framebuffer=r.createFramebuffer(t,e,this.texture,!1),this.width=t,this.height=e}return this},bind:function(t,e,i){if(void 0===t&&(t=!1),t&&this.renderer.flush(),e&&i&&this.resize(e,i),this.renderer.pushFramebuffer(this.framebuffer,!1,!1,!1),t&&this.adjustViewport(),this.autoClear){var n=this.renderer.gl;n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT)}},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),t.off(r.RESIZE,this.resize,this),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=s},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(77);t.exports=function(t,e){var i=n(t);for(var r in e)i.hasOwnProperty(r)||(i[r]=e[r]);return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(77),s=i(9),o=i(69),a=i(22),h=i(1),l=i(204),c=i(422),u=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,this.onGameBlur,this),t.events.on(a.FOCUS,this.onGameFocus,this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var s=r(e),o=i.spritemap[n];s.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:s})}return i},get:function(t){return c(this.sounds,"key",t)},getAll:function(t){return l(this.sounds,"key",t)},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(o.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(o.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(a.BLUR,this.onGameBlur,this),this.game.events.off(a.FOCUS,this.onGameFocus,this),this.game.events.off(a.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(n,r){n&&!n.pendingRemove&&t.call(e||i,n,r,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(9),s=i(69),o=i(17),a=i(1),h=new n({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,0)))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),1)))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying||(this.isPlaying=!1,this.isPaused=!0,0))},resume:function(){return!(!this.isPaused||this.isPlaying||(this.isPlaying=!0,this.isPaused=!1,0))},stop:function(){return!(!this.isPaused&&!this.isPlaying||(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),0))},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(s.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(206),r=i(429);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i<t.length;i++)t[i].reverse();t.reverse()}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(18),s=i(11),o=i(15),a=i(1037),h=i(1038),l=i(209),c=i(10),u=i(1039),d=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Texture,s.Tint,s.Transform,s.Visible,u],initialize:function(t,e,i,n,r,s,h){void 0===r&&(r=""),void 0===h&&(h=0),o.call(this,t,"BitmapText"),this.font=n;var l=this.scene.sys.cache.bitmapFont.get(n);l||console.warn("Invalid BitmapText key: "+n),this.fontData=l.data,this._text="",this._fontSize=s||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=a(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(r)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=n,this},setCharacterTint:function(t,e,i,n,s,o,a){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===n&&(n=-1),void 0===s&&(s=n,o=n,a=n);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=r(t,0,h-1);for(var l=r(t+e,t,h),c=this.charColors,u=t;u<l;u++){var d=c[u];if(-1===n)c[u]=null;else{var p=i?1:0;d?(d.tintEffect=p,d.tintTL=n,d.tintTR=s,d.tintBL=o,d.tintBR=a):c[u]={tintEffect:p,tintTL:n,tintTR:s,tintBL:o,tintBR:a}}}return this},setWordTint:function(t,e,i,n,r,s,o){void 0===e&&(e=1);for(var a=this.getTextBounds().words,h="number"==typeof t,l=0,c=0;c<a.length;c++){var u=a[c];if((h&&c===t||!h&&u.word===t)&&(this.setCharacterTint(u.i,u.word.length,i,n,r,s,o),++l===e))return this}return this},getTextBounds:function(t){var e=this._bounds;return(this._dirty||t||this.scaleX!==e.scaleX||this.scaleY!==e.scaleY)&&(a(this,t,!0,e),this._dirty=!1),e},getCharacterAt:function(t,e,i){for(var n=this.getLocalPoint(t,e,null,i),r=this.getTextBounds().characters,s=new c,o=0;o<r.length;o++){var a=r[o];if(s.setTo(a.x,a.t,a.r-a.x,a.b),s.contains(n.x,n.y))return a}return null},updateDisplayOrigin:function(){return this._dirty=!0,this.getTextBounds(!1),this},setFont:function(t,e,i){if(void 0===e&&(e=this._fontSize),void 0===i&&(i=this._align),t!==this.font){var n=this.scene.sys.cache.bitmapFont.get(t);n&&(this.font=t,this.fontData=n.data,this._fontSize=e,this._align=i,this.setTexture(n.texture,n.frame),a(this,!1,!0,this._bounds))}return this},setMaxWidth:function(t,e){return this._maxWidth=t,this._dirty=!0,void 0!==e&&(this.wordWrapCharCode=e),this},align:{set:function(t){this._align=t,this._dirty=!0},get:function(){return this._align}},text:{set:function(t){this.setText(t)},get:function(){return this._text}},fontSize:{set:function(t){this._fontSize=t,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(t){this._letterSpacing=t,this._dirty=!0},get:function(){return this._letterSpacing}},maxWidth:{set:function(t){this._maxWidth=t,this._dirty=!0},get:function(){return this._maxWidth}},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},toJSON:function(){var t=s.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,align:this.align};return t.data=e,t},preDestroy:function(){this.charColors.length=0,this._bounds=null,this.fontData=null}});d.ALIGN_LEFT=0,d.ALIGN_CENTER=1,d.ALIGN_RIGHT=2,d.ParseFromAtlas=h,d.ParseXMLBitmapFont=l,t.exports=d},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e])},set:function(t){return-1===this.entries.indexOf(t)&&this.entries.push(t),this},get:function(t,e){for(var i=0;i<this.entries.length;i++){var n=this.entries[i];if(n[t]===e)return n}},getArray:function(){return this.entries.slice(0)},delete:function(t){var e=this.entries.indexOf(t);return e>-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t<this.entries.length;t++){var e=this.entries[t];console.log(e)}console.groupEnd()},each:function(t,e){var i,n=this.entries.slice(),r=n.length;if(e)for(i=0;i<r&&!1!==t.call(e,n[i],i);i++);else for(i=0;i<r&&!1!==t(n[i],i);i++);return this},iterate:function(t,e){var i,n=this.entries.length;if(e)for(i=0;i<n&&!1!==t.call(e,this.entries[i],i);i++);else for(i=0;i<n&&!1!==t(this.entries[i],i);i++);return this},iterateLocal:function(t){var e,i=[];for(e=1;e<arguments.length;e++)i.push(arguments[e]);var n=this.entries.length;for(e=0;e<n;e++){var r=this.entries[e];r[t].apply(r,i)}return this},clear:function(){return this.entries.length=0,this},contains:function(t){return this.entries.indexOf(t)>-1},union:function(t){var e=new n;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new n;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new n;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t<this.entries.length?this.entries.length=t:this.entries.length}}});t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(15),o=i(186),a=i(65),h=i(1176),l=new n({Extends:s,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.GetBounds,r.Mask,r.Pipeline,r.ScrollFactor,r.Transform,r.Visible,h],initialize:function(t,e,i,n,r,h,l){void 0===n&&(n=16777215),void 0===r&&(r=128),void 0===h&&(h=1),void 0===l&&(l=.1),s.call(this,t,"PointLight"),this.initPipeline(a.POINTLIGHT_PIPELINE),this.setPosition(e,i),this.color=o(n),this.intensity=h,this.attenuation=l,this.width=2*r,this.height=2*r,this._radius=r},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,r=Math.abs(t.x-e.x-i),s=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(r>o||s>a)return!1;if(r<=i||s<=n)return!0;var h=r-i,l=s-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(6),r={},s={register:function(t,e,i,n,s){r[t]={plugin:e,mapping:i,settingsKey:n,configKey:s}},getPlugin:function(t){return r[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,s=e.game.config;for(var o in r){var a=r[o].plugin,h=r[o].mapping,l=r[o].settingsKey,c=r[o].configKey;n(i,l,s[c])&&(t[h]=new a(t))}},remove:function(t){r.hasOwnProperty(t)&&delete r[t]}};t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ANY_KEY_DOWN:i(1317),ANY_KEY_UP:i(1318),COMBO_MATCH:i(1319),DOWN:i(1320),KEY_DOWN:i(1321),KEY_UP:i(1322),UP:i(1323)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e){t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(240),s=i(73),o=new n({Extends:s,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,n,r){s.call(this,t,e,i,n,r),this.body=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(118);t.exports=function(t,e,i,r){if(void 0===i&&(i=!1),n(t,e,r)){var s=r.data[e][t]||null;return s?-1===s.index?i?s:null:s:null}return null}},function(t,e){t.exports=function(t,e,i,n){var r,s,o,a=t.data,h=t.width,l=t.height,c=t.tilemapLayer,u=Math.max(0,e.left),d=Math.min(h,e.right),p=Math.max(0,e.top),f=Math.min(l,e.bottom);if(0===i)for(s=p;s<f;s++)for(r=u;a[s]&&r<d;r++)(o=a[s][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&n.push(o);else if(1===i)for(s=p;s<f;s++)for(r=d;a[s]&&r>=u;r--)(o=a[s][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&n.push(o);else if(2===i)for(s=f;s>=p;s--)for(r=u;a[s]&&r<d;r++)(o=a[s][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&n.push(o);else if(3===i)for(s=f;s>=p;s--)for(r=d;a[s]&&r>=u;r--)(o=a[s][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&n.push(o);return c.tilesDrawn=n.length,c.tilesTotal=h*l,n}},function(t,e){t.exports=function(t,e,i){var n=i.collideIndexes.indexOf(t);e&&-1===n?i.collideIndexes.push(t):e||-1===n||i.collideIndexes.splice(n,1)}},function(t,e,i){
|
|
/**
|
|
* @author Seth Berrier <berriers@uwstout.edu>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(2);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var r=e.x+n(e,"startx",0)*t.tilewidth+n(e,"offsetx",0),s=e.y+n(e,"starty",0)*t.tileheight+n(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+r,y:i.y+s}}},function(t,e){t.exports=function(t,e,i){return t.hasOwnProperty(e)?"function"==typeof t[e]?function(i,n,r,s,o,a){return t[e](i,n,r,s,o,a)}:function(){return t[e]}:"function"==typeof i?i:function(){return i}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(261),r=i(13),s=i(96),o=i(80),a=i(160),h=i(579),l=i(259),c=i(6),u=i(260),d=i(262),p=i(264);t.exports=function(t,e,i){void 0===i&&(i=n);for(var f=i.targets?i.targets:l(e),m=h(e),g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),y=c(e,"easeParams",i.easeParams),x=o(c(e,"ease",i.ease),y),b=a(e,"hold",i.hold),w=a(e,"repeat",i.repeat),T=a(e,"repeatDelay",i.repeatDelay),_=s(e,"yoyo",i.yoyo),E=s(e,"flipX",i.flipX),S=s(e,"flipY",i.flipY),M=[],A=0;A<m.length;A++)for(var C=m[A].key,P=m[A].value,R=0;R<f.length;R++){var L=u(C,P),O=p(f[R],R,C,L.getEnd,L.getStart,L.getActive,o(c(P,"ease",x),c(P,"easeParams",y)),a(P,"delay",g),a(P,"duration",v),s(P,"yoyo",_),a(P,"hold",b),a(P,"repeat",w),a(P,"repeatDelay",T),s(P,"flipX",E),s(P,"flipY",S));M.push(O)}var D=new d(t,M,f);D.offset=r(e,"offset",null),D.completeDelay=r(e,"completeDelay",0),D.loop=Math.round(r(e,"loop",0)),D.loopDelay=Math.round(r(e,"loopDelay",0)),D.paused=s(e,"paused",!1),D.useFrames=s(e,"useFrames",!1);for(var I=c(e,"callbackScope",D),F=[D,null],B=d.TYPES,k=0;k<B.length;k++){var N=B[k],U=c(e,N,!1);if(U){var z=c(e,N+"Scope",I),G=c(e,N+"Params",[]);D.setCallback(N,U,F.concat(G),z)}}return D}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(99),s=i(2),o=i(130),a=i(182),h=new n({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(o.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];null===this.nextAnim?this.nextAnim=n:this.nextAnimsQueue.push(n)}return this.parent},getName:function(){return this.currentAnim?this.currentAnim.key:""},getFrameName:function(){return this.currentFrame?this.currentFrame.textureFrame:""},load:function(t){this.isPlaying&&this.stop();var e=this.animationManager,i="string"==typeof t?t:s(t,"key",null),n=this.exists(i)?this.get(i):e.get(i);if(n){this.currentAnim=n;var r=n.getTotalFrames(),o=s(t,"frameRate",n.frameRate),a=s(t,"duration",n.duration);n.calculateDuration(this,r,a,o),this.delay=s(t,"delay",n.delay),this.repeat=s(t,"repeat",n.repeat),this.repeatDelay=s(t,"repeatDelay",n.repeatDelay),this.yoyo=s(t,"yoyo",n.yoyo),this.showOnStart=s(t,"showOnStart",n.showOnStart),this.hideOnComplete=s(t,"hideOnComplete",n.hideOnComplete),this.skipMissedFrames=s(t,"skipMissedFrames",n.skipMissedFrames),this.timeScale=s(t,"timeScale",this.timeScale);var h=s(t,"startFrame",0);h>n.getTotalFrames()&&(h=0);var l=n.frames[h];0!==h||this.forward||(l=n.getLastFrame()),this.currentFrame=l}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,n=this.nextAnimsQueue;i&&n.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,n=this.nextAnimsQueue;i&&n.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,n=this.parent,r="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===r)return n;if(i&&this.isPlaying){var s=this.animationManager.getMix(i.key,t);if(s>0)return this.playAfterDelay(t,s)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter&&this.handleStart(),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim,n=this.currentFrame,r=this.parent,s=n.textureFrame;r.emit(t,i,n,r,s),e&&r.emit(e+i.key,i,n,r,s)},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,n=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):n},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var n=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),n++}while(this.accumulator>this.nextTick&&n<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new a(this,e,t),this.anims||(this.anims=new r),this.anims.set(e,i))),i},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=h},function(t,e,i){var n={};t.exports=n;var r=i(268),s=i(50),o=i(117),a=i(71);n.create=function(t){return s.extend({id:s.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},n.setModified=function(t,e,i,s){if(r.trigger(t,"compositeModified",t),t.isModified=e,i&&t.parent&&n.setModified(t.parent,e,i,s),s)for(var o=0;o<t.composites.length;o++){var a=t.composites[o];n.setModified(a,e,i,s)}},n.add=function(t,e){var i=[].concat(e);r.trigger(t,"beforeAdd",{object:e});for(var o=0;o<i.length;o++){var a=i[o];switch(a.type){case"body":if(a.parent!==a){s.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}n.addBody(t,a);break;case"constraint":n.addConstraint(t,a);break;case"composite":n.addComposite(t,a);break;case"mouseConstraint":n.addConstraint(t,a.constraint)}}return r.trigger(t,"afterAdd",{object:e}),t},n.remove=function(t,e,i){var s=[].concat(e);r.trigger(t,"beforeRemove",{object:e});for(var o=0;o<s.length;o++){var a=s[o];switch(a.type){case"body":n.removeBody(t,a,i);break;case"constraint":n.removeConstraint(t,a,i);break;case"composite":n.removeComposite(t,a,i);break;case"mouseConstraint":n.removeConstraint(t,a.constraint)}}return r.trigger(t,"afterRemove",{object:e}),t},n.addComposite=function(t,e){return t.composites.push(e),e.parent=t,n.setModified(t,!0,!0,!1),t},n.removeComposite=function(t,e,i){var r=t.composites.indexOf(e);if(-1!==r&&(n.removeCompositeAt(t,r),n.setModified(t,!0,!0,!1)),i)for(var s=0;s<t.composites.length;s++)n.removeComposite(t.composites[s],e,!0);return t},n.removeCompositeAt=function(t,e){return t.composites.splice(e,1),n.setModified(t,!0,!0,!1),t},n.addBody=function(t,e){return t.bodies.push(e),n.setModified(t,!0,!0,!1),t},n.removeBody=function(t,e,i){var r=t.bodies.indexOf(e);if(-1!==r&&(n.removeBodyAt(t,r),n.setModified(t,!0,!0,!1)),i)for(var s=0;s<t.composites.length;s++)n.removeBody(t.composites[s],e,!0);return t},n.removeBodyAt=function(t,e){return t.bodies.splice(e,1),n.setModified(t,!0,!0,!1),t},n.addConstraint=function(t,e){return t.constraints.push(e),n.setModified(t,!0,!0,!1),t},n.removeConstraint=function(t,e,i){var r=t.constraints.indexOf(e);if(-1!==r&&n.removeConstraintAt(t,r),i)for(var s=0;s<t.composites.length;s++)n.removeConstraint(t.composites[s],e,!0);return t},n.removeConstraintAt=function(t,e){return t.constraints.splice(e,1),n.setModified(t,!0,!0,!1),t},n.clear=function(t,e,i){if(i)for(var r=0;r<t.composites.length;r++)n.clear(t.composites[r],e,!0);return e?t.bodies=t.bodies.filter((function(t){return t.isStatic})):t.bodies.length=0,t.constraints.length=0,t.composites.length=0,n.setModified(t,!0,!0,!1),t},n.allBodies=function(t){for(var e=[].concat(t.bodies),i=0;i<t.composites.length;i++)e=e.concat(n.allBodies(t.composites[i]));return e},n.allConstraints=function(t){for(var e=[].concat(t.constraints),i=0;i<t.composites.length;i++)e=e.concat(n.allConstraints(t.composites[i]));return e},n.allComposites=function(t){for(var e=[].concat(t.composites),i=0;i<t.composites.length;i++)e=e.concat(n.allComposites(t.composites[i]));return e},n.get=function(t,e,i){var r,s;switch(i){case"body":r=n.allBodies(t);break;case"constraint":r=n.allConstraints(t);break;case"composite":r=n.allComposites(t).concat(t)}return r?0===(s=r.filter((function(t){return t.id.toString()===e.toString()}))).length?null:s[0]:null},n.move=function(t,e,i){return n.remove(t,e),n.add(i,e),t},n.rebase=function(t){for(var e=n.allBodies(t).concat(n.allConstraints(t)).concat(n.allComposites(t)),i=0;i<e.length;i++)e[i].id=s.nextId();return n.setModified(t,!0,!0,!1),t},n.translate=function(t,e,i){for(var r=i?n.allBodies(t):t.bodies,s=0;s<r.length;s++)a.translate(r[s],e);return n.setModified(t,!0,!0,!1),t},n.rotate=function(t,e,i,r){for(var s=Math.cos(e),o=Math.sin(e),h=r?n.allBodies(t):t.bodies,l=0;l<h.length;l++){var c=h[l],u=c.position.x-i.x,d=c.position.y-i.y;a.setPosition(c,{x:i.x+(u*s-d*o),y:i.y+(u*o+d*s)}),a.rotate(c,e)}return n.setModified(t,!0,!0,!1),t},n.scale=function(t,e,i,r,s){for(var o=s?n.allBodies(t):t.bodies,h=0;h<o.length;h++){var l=o[h],c=l.position.x-r.x,u=l.position.y-r.y;a.setPosition(l,{x:r.x+c*e,y:r.y+u*i}),a.scale(l,e,i)}return n.setModified(t,!0,!0,!1),t},n.bounds=function(t){for(var e=n.allBodies(t),i=[],r=0;r<e.length;r+=1){var s=e[r];i.push(s.bounds.min,s.bounds.max)}return o.create(i)}},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),r=Math.random()+Math.random(),s=r>1?2-r:r,o=s*Math.cos(i),a=s*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(128),r=i(4);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var s=n(t)*e;return e>.5?(s-=t.width+t.height)<=t.width?(i.x=t.right-s,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(s-t.width)):s<=t.width?(i.x=t.x+s,i.y=t.y):(i.x=t.right,i.y=t.y+(s-t.width)),i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(64),r=i(4);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,c=0;c<e;c++){var u=c/e,d=o+(h-o)*u,p=a+(l-a)*u;s.push(new r(d,p))}return s}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(172),r=i(65),s=i(74),o={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){void 0===t&&(t=r.MULTI_PIPELINE);var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){var n=i.get(t);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){var o=s.get(t);o&&(this.pipeline=o),e&&(this.pipelineData=i?n(e):e)}return this},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){Array.isArray(t)||(t=[t]);for(var o=0;o<t.length;o++){var a=s.getPostPipeline(t[o],this);a&&this.postPipelines.push(a)}e&&(this.pipelineData=i?n(e):e)}return this.hasPostPipeline=this.postPipelines.length>0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e=this.postPipelines,i=[],n=0;n<e.length;n++){var r=e[n];("string"==typeof t&&r.name===t||r instanceof t)&&i.push(r)}return 1===i.length?i[0]:i},resetPipeline:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.pipeline=this.defaultPipeline,t&&(this.postPipelines=[],this.hasPostPipeline=!1),e&&(this.pipelineData={}),null!==this.pipeline},resetPostPipeline:function(t){void 0===t&&(t=!1);for(var e=this.postPipelines,i=0;i<e.length;i++)e[i].destroy();this.postPipelines=[],this.hasPostPipeline=!1,t&&(this.pipelineData={})},removePostPipeline:function(t){for(var e=this.postPipelines,i=e.length-1;i>=0;i--){var n=e[i];("string"==typeof t&&n.name===t||"string"!=typeof t&&n instanceof t)&&(n.destroy(),s(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=o},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i=function(t){var e,n,r;if("object"!=typeof t||null===t)return t;for(r in e=Array.isArray(t)?[]:{},t)n=t[r],e[r]=i(n);return e};t.exports=i},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);t.exports=function(t,e,i,r,s,o,a,h){void 0===h&&(h=new n);var l=Math.sin(s),c=Math.cos(s),u=c*o,d=l*o,p=-l*a,f=c*a,m=1/(u*f+p*-d);return h.x=f*m*t+-p*m*e+(r*p-i*f)*m,h.y=u*m*e+-d*m*t+(-r*u+i*d)*m,h}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.shift(),t.push(i);return i}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.pop(),t.unshift(i);return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,r=Math.sqrt(Math.random());return e.x=t.x+r*Math.cos(i)*t.width/2,e.y=t.y+r*Math.sin(i)*t.height/2,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,r=t.y2-t.y1,s=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+s*h),e.y=t.y1+(r*a+o*h),e}},function(t,e){t.exports=function(t,e,i,n,r){var s=n+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(130),o=i(312),a=i(313),h=i(6),l=i(314),c=new r({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(s.PAUSE_ALL,this.pause,this),this.manager.on(s.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,n){null===i&&null===n?(t.frameRate=24,t.duration=24/e*1e3):i&&null===n?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=n,t.duration=e/n*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),r=this.frames.slice(t);this.frames=n.concat(i,r)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t<this.frames.length},getFirstTick:function(t){t.accumulator=0,t.nextTick=t.msPerFrame+t.currentFrame.duration},getFrameAt:function(t){return this.frames[t]},getFrames:function(t,e,i,n){void 0===n&&(n=!0);var r,s,o,c,u=[],d=1;if("string"==typeof e){c=e;var p=t.get(c).getFrameNames();n&&l(p),e=[],p.forEach((function(t){e.push({key:c,frame:t})}))}if(!Array.isArray(e)||0===e.length)return u;for(o=0;o<e.length;o++){var f=e[o],m=h(f,"key",i);if(m){var g=h(f,"frame",0),v=t.getFrame(m,g);(s=new a(m,g,d,v)).duration=h(f,"duration",0),s.isFirst=!r,r&&(r.nextFrame=s,s.prevFrame=r),u.push(s),r=s,d++}}if(u.length>0){s.isLast=!0,s.nextFrame=u[0],u[0].prevFrame=s;var y=1/(u.length-1);for(o=0;o<u.length;o++)u[o].progress=o*y}return u},getNextTick:function(t){t.accumulator-=t.nextTick,t.nextTick=t.msPerFrame+t.currentFrame.duration},getFrameByProgress:function(t){return t=n(t,0,1),o(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t.yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),n=0;n<e;n++)(t=this.frames[n]).index=n+1,t.isFirst=!1,t.isLast=!1,t.progress=n*i,0===n?(t.isFirst=!0,1===e?(t.isLast=!0,t.nextFrame=t,t.prevFrame=t):(t.isLast=!1,t.prevFrame=this.frames[e-1],t.nextFrame=this.frames[n+1])):n===e-1&&e>1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[n-1],t.nextFrame=this.frames[n+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(s.PAUSE_ALL,this.pause,this),this.manager.off(s.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t<this.frames.length;t++)this.frames[t].destroy();this.frames=[],this.manager=null}});t.exports=c},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var r=0;if(e+1>=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(r-s+1).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(321),r=i(186),s=i(325),o=i(326);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return r(t);case"object":return s(t)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(100);function r(t,e,i,n){var r=(t+6*e)%6,s=Math.min(r,4-r,1);return Math.round(255*(n-n*i*Math.max(0,s)))}t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var o=r(5,t,e,i),a=r(3,t,e,i),h=r(1,t,e,i);return s?s.setTo?s.setTo(o,a,h,s.alpha,!1):(s.r=o,s.g=a,s.b=h,s.color=n(o,a,h),s):{r:o,g:a,b:h,color:n(o,a,h)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(37),r=i(324);t.exports=function(t){var e=r(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(102),r=i(134),s=i(31),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=s.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=s.create2D(this),n=i.getContext("2d").createImageData(1,1);return a=n.data instanceof Uint8ClampedArray,s.remove(t),s.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(o.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i,n="";t.exports={disable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!1),t},enable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var n=e[i]+"mageSmoothingEnabled";if(n in t)return n}return null},isEnabled:function(t){return null!==n?t[n]:null}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14),r=i(17),s={Angle:i(809),Distance:i(818),Easing:i(823),Fuzzy:i(824),Interpolation:i(827),Pow2:i(832),Snap:i(834),RandomDataGenerator:i(836),Average:i(837),Bernstein:i(350),Between:i(192),CatmullRom:i(191),CeilTo:i(838),Clamp:i(18),DegToRad:i(35),Difference:i(839),Euler:i(840),Factorial:i(351),FloatBetween:i(135),FloorTo:i(841),FromPercent:i(95),GetSpeed:i(842),IsEven:i(843),IsEvenStrict:i(844),Linear:i(133),MaxAdd:i(845),MinSub:i(846),Percent:i(847),RadToDeg:i(193),RandomXY:i(848),RandomXYZ:i(849),RandomXYZW:i(850),Rotate:i(356),RotateAround:i(302),RotateAroundDistance:i(179),RotateTo:i(851),RoundAwayFromZero:i(357),RoundTo:i(852),SinCosTableGenerator:i(853),SmootherStep:i(180),SmoothStep:i(181),ToXY:i(854),TransformXY:i(174),Within:i(855),Wrap:i(66),Vector2:i(3),Vector3:i(38),Vector4:i(138),Matrix3:i(358),Matrix4:i(67),Quaternion:i(359),RotateVec3:i(856)};s=r(!1,s,n),t.exports=s},function(t,e){t.exports=function(t,e,i,n,r){var s=.5*(n-e),o=.5*(r-i),a=t*t;return(2*i-2*n+s+o)*(t*a)+(-3*i+3*n-2*s-o)*a+s*t+i}},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(){this._matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.alpha=1,this._dirty=!0,this._data},set:function(t){return this._matrix=t,this._dirty=!0,this},reset:function(){var t=this._matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=1,t[13]=0,t[14]=0,t[15]=0,t[16]=0,t[17]=0,t[18]=1,t[19]=0,this._dirty=!0,this},getData:function(){if(this._dirty){var t=new Float32Array(this._matrix);t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._data=t,this._dirty=!1}return this._data},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,n=-.5*(i-1);return this.multiply([i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),n=Math.sin(t);return this.multiply([.213+.787*i+-.213*n,.715+-.715*i+-.715*n,.072+-.072*i+.928*n,0,0,.213+-.213*i+.143*n,.715+i*(1-.715)+.14*n,.072+-.072*i+-.283*n,0,0,.213+-.213*i+-.787*n,.715+-.715*i+.715*n,.072+.928*i+.072*n,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,n=-.5*(i-1);return this.multiply([i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},brown:function(t){return void 0===t&&(t=!1),this.multiply([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},multiply:function(t,e){e||this.reset();for(var i=this._matrix,n=[],r=0;r<20;r++)n[r]=i[r];return i[0]=n[0]*t[0]+n[1]*t[5]+n[2]*t[10]+n[3]*t[15],i[1]=n[0]*t[1]+n[1]*t[6]+n[2]*t[11]+n[3]*t[16],i[2]=n[0]*t[2]+n[1]*t[7]+n[2]*t[12]+n[3]*t[17],i[3]=n[0]*t[3]+n[1]*t[8]+n[2]*t[13]+n[3]*t[18],i[4]=n[0]*t[4]+n[1]*t[9]+n[2]*t[14]+n[3]*t[19]+n[4],i[5]=n[5]*t[0]+n[6]*t[5]+n[7]*t[10]+n[8]*t[15],i[6]=n[5]*t[1]+n[6]*t[6]+n[7]*t[11]+n[8]*t[16],i[7]=n[5]*t[2]+n[6]*t[7]+n[7]*t[12]+n[8]*t[17],i[8]=n[5]*t[3]+n[6]*t[8]+n[7]*t[13]+n[8]*t[18],i[9]=n[5]*t[4]+n[6]*t[9]+n[7]*t[14]+n[8]*t[19]+n[9],i[10]=n[10]*t[0]+n[11]*t[5]+n[12]*t[10]+n[13]*t[15],i[11]=n[10]*t[1]+n[11]*t[6]+n[12]*t[11]+n[13]*t[16],i[12]=n[10]*t[2]+n[11]*t[7]+n[12]*t[12]+n[13]*t[17],i[13]=n[10]*t[3]+n[11]*t[8]+n[12]*t[13]+n[13]*t[18],i[14]=n[10]*t[4]+n[11]*t[9]+n[12]*t[14]+n[13]*t[19]+n[14],i[15]=n[15]*t[0]+n[16]*t[5]+n[17]*t[10]+n[18]*t[15],i[16]=n[15]*t[1]+n[16]*t[6]+n[17]*t[11]+n[18]*t[16],i[17]=n[15]*t[2]+n[16]*t[7]+n[17]*t[12]+n[18]*t[17],i[18]=n[15]*t[3]+n[16]*t[8]+n[17]*t[13]+n[18]*t[18],i[19]=n[15]*t[4]+n[16]*t[9]+n[17]*t[14]+n[18]*t[19]+n[19],this._dirty=!0,this}});t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10),r=i(14);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,o,a=Number.MAX_VALUE,h=Number.MAX_VALUE,l=r.MIN_SAFE_INTEGER,c=r.MIN_SAFE_INTEGER,u=0;u<t.length;u++)i=t[u],Array.isArray(i)?(s=i[0],o=i[1]):(s=i.x,o=i.y),a=Math.min(a,s),h=Math.min(h,o),l=Math.max(l,s),c=Math.max(c,o);return e.x=a,e.y=h,e.width=l-a,e.height=c-h,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(1),s=new n({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=r,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var n=this._rgb;return n.r===t&&n.g===e&&n.b===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n={CENTER:i(397),ORIENTATION:i(398),SCALE_MODE:i(399),ZOOM:i(400)};t.exports=n},function(t,e){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},function(t,e){t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(142),s=i(194),o=i(21),a=i(413),h=i(414),l=i(32),c=i(1),u=i(415),d=new n({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=c},init:function(t){this.settings.status=r.INIT,this.sceneUpdate=c,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,s.Global,[s.CoreScene,h(this),a(this)]),this.events.emit(o.BOOT,this),this.settings.isBooted=!0},install:function(t){Array.isArray(t)||(t=[t]),this.plugins.installLocal(this,t)},step:function(t,e){var i=this.events;i.emit(o.PRE_UPDATE,t,e),i.emit(o.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(o.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.cameras.render(t,e),this.events.emit(o.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.events,i=this.settings;return this.settings.active&&(i.status=r.PAUSED,i.active=!1,e.emit(o.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=r.RUNNING,i.active=!0,e.emit(o.RESUME,this,t)),this},sleep:function(t){var e=this.events,i=this.settings;return i.status=r.SLEEPING,i.active=!1,i.visible=!1,e.emit(o.SLEEP,this,t),this},wake:function(t){var e=this.events,i=this.settings;return i.status=r.RUNNING,i.active=!0,i.visible=!0,e.emit(o.WAKE,this,t),i.isTransition&&e.emit(o.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},isSleeping:function(){return this.settings.status===r.SLEEPING},isActive:function(){return this.settings.status===r.RUNNING},isPaused:function(){return this.settings.status===r.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=r.START,i.active=!0,i.visible=!0,e.emit(o.START,this),e.emit(o.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(o.TRANSITION_INIT),e.off(o.TRANSITION_START),e.off(o.TRANSITION_COMPLETE),e.off(o.TRANSITION_OUT),i.status=r.SHUTDOWN,i.active=!1,i.visible=!1,this.renderer===l.WEBGL&&this.renderer.resetTextures(!0),e.emit(o.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=r.DESTROYED,e.active=!1,e.visible=!1,t.emit(o.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],n=0;n<i.length;n++)this[i[n]]=null}});t.exports=d},function(t,e){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(32),r=i(0),s=i(106),o=i(418),a=new r({initialize:function(t,e,i,n,r){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var s=0;s<i.length;s++)this.source.push(new o(this,i[s],n,r))},add:function(t,e,i,n,r,o){if(this.has(t))return null;var a=new s(this,t,e,i,n,r,o);return this.frames[t]=a,"__BASE"===this.firstFrame&&(this.firstFrame=t),this.frameTotal++,a},remove:function(t){return!!this.has(t)&&(this.get(t).destroy(),delete this.frames[t],!0)},has:function(t){return this.frames[t]},get:function(t){t||(t=this.firstFrame);var e=this.frames[t];return e||(console.warn("Texture.frame missing: "+t),e=this.frames[this.firstFrame]),e},getTextureSourceIndex:function(t){for(var e=0;e<this.source.length;e++)if(this.source[e]===t)return e;return-1},getFramesFromTextureSource:function(t,e){void 0===e&&(e=!1);var i=[];for(var n in this.frames)if("__BASE"!==n||e){var r=this.frames[n];r.sourceIndex===t&&i.push(r)}return i},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn("Texture.frame missing: "+t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn("Texture.frame missing: "+t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setDataSource:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=this.source[e];this.dataSource.push(new o(this,t[e],i.width,i.height))}},setFilter:function(t){var e;for(e=0;e<this.source.length;e++)this.source[e].setFilter(t);for(e=0;e<this.dataSource.length;e++)this.dataSource[e].setFilter(t)},destroy:function(){var t;for(t=0;t<this.source.length;t++)this.source[t].destroy();for(t=0;t<this.dataSource.length;t++)this.dataSource[t].destroy();for(var e in this.frames)this.frames[e].destroy();this.source=[],this.dataSource=[],this.frames={},this.manager.removeKey(this.key);var i=this.manager.game.renderer;i.type===n.WEBGL&&i.resetTextures(!0),this.manager=null}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(78);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var o=[];if(n(t,r,s))for(var a=r;a<s;a++){var h=t[a];(!e||e&&void 0===i&&h.hasOwnProperty(e)||e&&void 0!==i&&h[e]===i)&&o.push(h)}return o}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Matrix:i(1009),Add:i(1017),AddAt:i(1018),BringToTop:i(1019),CountAllMatching:i(1020),Each:i(1021),EachInRange:i(1022),FindClosestInSorted:i(312),GetAll:i(204),GetFirst:i(422),GetRandom:i(207),MoveDown:i(1023),MoveTo:i(1024),MoveUp:i(1025),NumberArray:i(316),NumberArrayStep:i(1026),QuickSelect:i(430),Range:i(431),Remove:i(89),RemoveAt:i(1027),RemoveBetween:i(1028),RemoveRandomElement:i(1029),Replace:i(1030),RotateLeft:i(175),RotateRight:i(176),SafeRange:i(78),SendToBack:i(1031),SetAll:i(1032),Shuffle:i(129),SortByDigits:i(314),SpliceOne:i(74),StableSort:i(79),Swap:i(1033)}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i<t.length;i++)if(t[i].length!==e)return!1;return!0}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(9),s=i(432),o=new n({Extends:r,initialize:function(){r.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},add:function(t){return this._pending.push(t),this._toProcess++,t},remove:function(t){return this._destroy.push(t),this._toProcess++,t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t<i.length;t++){e=i[t];var r=n.indexOf(e);-1!==r&&(n.splice(r,1),this.emit(s.PROCESS_QUEUE_REMOVE,e))}for(i.length=0,i=this._pending,t=0;t<i.length;t++)e=i[t],(!this.checkQueue||this.checkQueue&&-1===n.indexOf(e))&&(n.push(e),this.emit(s.PROCESS_QUEUE_ADD,e));return i.length=0,this._toProcess=0,n},getActive:function(){return this._active},length:{get:function(){return this._active.length}},destroy:function(){this._toProcess=0,this._pending=[],this._active=[],this._destroy=[]}});t.exports=o},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
function i(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,e,n,r,s){void 0===n&&(n=0),void 0===r&&(r=0);var o=e.cutX,a=e.cutY,h=e.source.width,l=e.source.height,c=e.sourceIndex,u={},d=t.getElementsByTagName("info")[0],p=t.getElementsByTagName("common")[0];u.font=d.getAttribute("face"),u.size=i(d,"size"),u.lineHeight=i(p,"lineHeight")+r,u.chars={};var f=t.getElementsByTagName("char"),m=void 0!==e&&e.trimmed;if(m)var g=e.height,v=e.width;for(var y=0;y<f.length;y++){var x=f[y],b=i(x,"id"),w=String.fromCharCode(b),T=i(x,"x"),_=i(x,"y"),E=i(x,"width"),S=i(x,"height");m&&(T<v&&(v=T),_<g&&(g=_)),m&&0!==g&&0!==v&&(T-=e.x,_-=e.y);var M=(o+T)/h,A=(a+_)/l,C=(o+T+E)/h,P=(a+_+S)/l;if(u.chars[b]={x:T,y:_,width:E,height:S,centerX:Math.floor(E/2),centerY:Math.floor(S/2),xOffset:i(x,"xoffset"),yOffset:i(x,"yoffset"),xAdvance:i(x,"xadvance")+n,data:{},kerning:{},u0:M,v0:A,u1:C,v1:P},s&&0!==E&&0!==S){var R=s.add(w,c,T,_,E,S);R&&R.setUVs(E,S,M,A,C,P)}}var L=t.getElementsByTagName("kerning");for(y=0;y<L.length;y++){var O=L[y],D=i(O,"first"),I=i(O,"second"),F=i(O,"amount");u.chars[I].kerning[D]=F}return u}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1043),r=i(434),s=i(0),o=i(11),a=i(106),h=i(15),l=i(107),c=new s({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(t,e,i,n,r){h.call(this,t,"Blitter"),this.setTexture(n,r),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,s){void 0===n&&(n=!0),void 0===s&&(s=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new r(this,t,e,i,n);return this.children.addAt(o,s,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,n){for(var r=this.createMultiple(e,i,n),s=0;s<r.length;s++){var o=r[s];t.call(this,o,s)}return r},createMultiple:function(t,e,i){void 0===e&&(e=this.frame.name),void 0===i&&(i=!0),Array.isArray(e)||(e=[e]);var n=[],r=this;return e.forEach((function(e){for(var s=0;s<t;s++)n.push(r.create(0,0,e,i))})),n},childCanRender:function(t){return t.visible&&t.alpha>0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(205),r=i(34),s=i(0),o=i(11),a=i(75),h=i(15),l=i(10),c=i(1046),u=i(435),d=i(3),p=new s({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Pipeline,o.Transform,o.Visible,c],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,n=new l,r=!1;t.setEmpty();for(var s=0;s<i.length;s++){var o=i[s];o.getBounds&&(o.getBounds(n),r?u(n,t,t):(t.setTo(n.x,n.y,n.width,n.height),r=!0))}}return t},addHandler:function(t){t.once(a.DESTROY,this.remove,this),this.exclusive&&(t.displayList&&t.displayList.remove(t),t.parentContainer&&t.parentContainer.remove(t),this.displayList?t.displayList=this.displayList:t.displayList=this.scene.sys.displayList,t.parentContainer=this),this.scene.sys.displayList.exists(t)||t.emit(a.ADDED_TO_SCENE,t,this.scene)},removeHandler:function(t){t.off(a.DESTROY,this.remove),this.exclusive&&(t.parentContainer=null),this.scene.sys.displayList.exists(t)||t.emit(a.REMOVED_FROM_SCENE,t,this.scene)},pointToContainer:function(t,e){void 0===e&&(e=new d),this.parentContainer?this.parentContainer.pointToContainer(t,e):e=new d(t.x,t.y);var i=this.tempTransformMatrix;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(t.x,t.y,e),e},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(this.tempTransformMatrix,this.localTransform)},add:function(t){return n.Add(this.list,t,this.maxSize,this.addHandler,this),this},addAt:function(t,e){return n.AddAt(this.list,t,e,this.maxSize,this.addHandler,this),this},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),n.StableSort(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,r){return n.GetFirst(this.list,t,e,i,r)},getAll:function(t,e,i,r){return n.GetAll(this.list,t,e,i,r)},count:function(t,e,i,r){return n.CountAllMatching(this.list,t,e,i,r)},swap:function(t,e){return n.Swap(this.list,t,e),this},moveTo:function(t,e){return n.MoveTo(this.list,t,e),this},remove:function(t,e){var i=n.Remove(this.list,t,this.removeHandler,this);if(e&&i){Array.isArray(i)||(i=[i]);for(var r=0;r<i.length;r++)i[r].destroy()}return this},removeAt:function(t,e){var i=n.RemoveAt(this.list,t,this.removeHandler,this);return e&&i&&i.destroy(),this},removeBetween:function(t,e,i){var r=n.RemoveBetween(this.list,t,e,this.removeHandler,this);if(i)for(var s=0;s<r.length;s++)r[s].destroy();return this},removeAll:function(t){var e=n.RemoveBetween(this.list,0,this.list.length,this.removeHandler,this);if(t)for(var i=0;i<e.length;i++)e[i].destroy();return this},bringToTop:function(t){return n.BringToTop(this.list,t),this},sendToBack:function(t){return n.SendToBack(this.list,t),this},moveUp:function(t){return n.MoveUp(this.list,t),this},moveDown:function(t){return n.MoveDown(this.list,t),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e,i){return n.Replace(this.list,t,e)&&(this.addHandler(e),this.removeHandler(t),i&&t.destroy()),this},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<s;i++)n[0]=r[i],t.apply(e,n);return this},iterate:function(t,e){var i,n=[null];for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<this.list.length;i++)n[0]=this.list[i],t.apply(e,n);return this},setScrollFactor:function(t,e,i){return void 0===e&&(e=t),void 0===i&&(i=!1),this.scrollFactorX=t,this.scrollFactorY=e,i&&(n.SetAll(this.list,"scrollFactorX",t),n.SetAll(this.list,"scrollFactorY",e)),this},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=p},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(147),r=i(0),s=i(1051),o=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,r,s,o,a){n.call(this,t,e,i,r,s,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(131),r=i(0),s=i(214),o=i(297),a=i(298),h=i(299),l=i(303),c=i(171),u=i(306),d=i(307),p=i(308),f=i(108),m=i(15),g=i(2),v=i(6),y=i(14),x=i(65),b=i(1057),w=new r({Extends:m,Mixins:[o,a,h,l,c,d,p,u,b],initialize:function(t,e){var i=v(e,"x",0),n=v(e,"y",0);m.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(x.GRAPHICS_PIPELINE),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return v(t,"lineStyle",null)&&(this.defaultStrokeWidth=v(t,"lineStyle.width",1),this.defaultStrokeColor=v(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=v(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),v(t,"fillStyle",null)&&(this.defaultFillColor=v(t,"fillStyle.color",16777215),this.defaultFillAlpha=v(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(s.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(s.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,r,o,a,h){return void 0===r&&(r=1),void 0===o&&(o=r),void 0===a&&(a=r),void 0===h&&(h=r),this.commandBuffer.push(s.GRADIENT_FILL_STYLE,r,o,a,h,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,r,o){return void 0===o&&(o=1),this.commandBuffer.push(s.GRADIENT_LINE_STYLE,t,o,e,i,n,r),this},beginPath:function(){return this.commandBuffer.push(s.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(s.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(s.FILL_PATH),this},fill:function(){return this.commandBuffer.push(s.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(s.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(s.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(s.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var r=this._lineWidth/2,s=t-r,o=t+r;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(s,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(s,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,r){void 0===r&&(r=20);var s=r,o=r,a=r,h=r;return"number"!=typeof r&&(s=g(r,"tl",20),o=g(r,"tr",20),a=g(r,"bl",20),h=g(r,"br",20)),this.beginPath(),this.moveTo(t+s,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,y.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,y.TAU,Math.PI),this.lineTo(t,e+s),this.arc(t+s,e+s,s,-Math.PI,-y.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,r){void 0===r&&(r=20);var s=r,o=r,a=r,h=r;return"number"!=typeof r&&(s=g(r,"tl",20),o=g(r,"tr",20),a=g(r,"bl",20),h=g(r,"br",20)),this.beginPath(),this.moveTo(t+s,e),this.lineTo(t+i-o,e),this.moveTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+n-h),this.moveTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,y.TAU),this.lineTo(t+a,e+n),this.moveTo(t+a,e+n),this.arc(t+a,e+n-a,a,y.TAU,Math.PI),this.lineTo(t,e+s),this.moveTo(t,e+s),this.arc(t+s,e+s,s,-Math.PI,-y.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(s.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,r,o){return this.commandBuffer.push(s.FILL_TRIANGLE,t,e,i,n,r,o),this},strokeTriangle:function(t,e,i,n,r,o){return this.commandBuffer.push(s.STROKE_TRIANGLE,t,e,i,n,r,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(s.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(s.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var r=1;r<n;r++)this.lineTo(t[r].x,t[r].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.strokePath(),this},fillPoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var r=1;r<n;r++)this.lineTo(t[r].x,t[r].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.fillPath(),this},strokeEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.strokePoints(i,!0)},strokeEllipse:function(t,e,i,n,r){void 0===r&&(r=32);var s=new f(t,e,i,n).getPoints(r);return this.strokePoints(s,!0)},fillEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.fillPoints(i,!0)},fillEllipse:function(t,e,i,n,r){void 0===r&&(r=32);var s=new f(t,e,i,n).getPoints(r);return this.fillPoints(s,!0)},arc:function(t,e,i,n,r,o,a){return void 0===o&&(o=!1),void 0===a&&(a=0),this.commandBuffer.push(s.ARC,t,e,i,n,r,o,a),this},slice:function(t,e,i,n,r,o,a){return void 0===o&&(o=!1),void 0===a&&(a=0),this.commandBuffer.push(s.BEGIN_PATH),this.commandBuffer.push(s.MOVE_TO,t,e),this.commandBuffer.push(s.ARC,t,e,i,n,r,o,a),this.commandBuffer.push(s.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(s.SAVE),this},restore:function(){return this.commandBuffer.push(s.RESTORE),this},translateCanvas:function(t,e){return this.commandBuffer.push(s.TRANSLATE,t,e),this},scaleCanvas:function(t,e){return this.commandBuffer.push(s.SCALE,t,e),this},rotateCanvas:function(t){return this.commandBuffer.push(s.ROTATE,t),this},clear:function(){return this.commandBuffer.length=0,this.defaultFillColor>-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,r,s=this.scene.sys,o=s.game.renderer;if(void 0===e&&(e=s.scale.width),void 0===i&&(i=s.scale.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(s.textures.exists(t)){var a=(n=s.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(r=a.getContext("2d"))}else r=(n=s.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(r=t.getContext("2d"));return r&&(this.renderCanvas(o,this,w.TargetCamera,null,r,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.width/2,s=t.height/2;return i.x=t.x+r*Math.cos(e),i.y=t.y+s*Math.sin(e),i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(34),r=i(0),s=i(11),o=i(173),a=i(98),h=i(9),l=i(75),c=i(107),u=i(1065),d=i(21),p=i(79),f=new r({Extends:c,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.Mask,s.Pipeline,s.Visible,h,u],initialize:function(t,e){c.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPipeline(),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),e&&this.add(e),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return o(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){t.emit(l.ADDED_TO_SCENE,t,this.scene),t.displayList&&t.displayList.remove(t),t.displayList=this,this.queueDepthSort(),this.events.emit(d.ADDED_TO_SCENE,t,this.scene)},removeChildCallback:function(t){t.emit(l.REMOVED_FROM_SCENE,t,this.scene),t.displayList=null,this.queueDepthSort(),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(p(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},destroy:function(){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var t=this.list.length;t--;)this.list[t].destroy();this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.queueDepthSort(),this.displayList.remove(this)),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(15),o=i(444),a=i(107),h=i(446),l=i(1069),c=new n({Extends:s,Mixins:[r.Depth,r.Mask,r.Pipeline,r.Transform,r.Visible,l],initialize:function(t,e,i,n){if(s.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var r=0;r<n.length;r++)this.createEmitter(n[r])}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){this.frame=this.texture.get(t);var e=this.texture.getFramesFromTextureSource(this.frame.sourceIndex),i=[];return e.forEach((function(t){i.push(t.name)})),this.frameNames=i,this.defaultFrame=this.frame,this},setEmitterFrames:function(t,e){Array.isArray(t)||(t=[t]);var i=e.frames;i.length=0;for(var n=0;n<t.length;n++){var r=t[n];-1!==this.frameNames.indexOf(r)&&i.push(this.texture.get(r))}return i.length>0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},removeEmitter:function(t){return this.emitters.remove(t,!0)},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,r=0;r<n.length;r++){var s=n[r];s.active&&s.emitParticle(t,e,i)}return this},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},getProcessors:function(){return this.wells.getAll("active",!0)},preUpdate:function(t,e){e*=this.timeScale;for(var i=this.emitters.list,n=0;n<i.length;n++){var r=i[n];r.active&&r.preUpdate(t,e)}},setAlpha:function(){},setScrollFactor:function(){},setBlendMode:function(){}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(34),r=i(131),s=i(31),o=i(0),a=i(11),h=i(32),l=i(106),c=i(15),u=i(1),d=i(65),p=i(1073),f=i(139),m=i(12),g=i(219),v=new o({Extends:c,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,p],initialize:function(t,e,i,n,o,a,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=32),void 0===o&&(o=32),c.call(this,t,"RenderTexture"),this.renderer=t.sys.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,void 0===a?(this.canvas=s.create2D(this,n,o),this.texture=t.sys.textures.addCanvas(g(),this.canvas),this.frame=this.texture.get()):(this.texture=t.sys.textures.get(a),this.frame=this.texture.get(l),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new r(0,0,n,o),this.renderTarget=null;var p=this.renderer;p?p.type===h.WEBGL?(this.drawGameObject=this.batchGameObjectWebGL,this.renderTarget=new f(p,n,o,1,0,!1)):p.type===h.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas):this.drawGameObject=u,this.camera.setScene(t),this.setPosition(e,i),void 0===a&&this.setSize(n,o),this.setOrigin(0,0),this.initPipeline(d.SINGLE_PIPELINE)},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){void 0===e&&(e=t);var i=this.frame;if(t!==this.width||e!==this.height){if("__BASE"===i.name){this.canvas.width=t,this.canvas.height=e,this.texture.width=t,this.texture.height=e;var n=this.renderTarget;n&&(n.resize(t,e),i.glTexture=n.texture,i.source.isRenderTexture=!0,i.source.isGLTexture=!0,i.source.glTexture=n.texture),this.camera.setSize(t,e),i.source.width=t,i.source.height=e,i.setSize(t,e),this.width=t,this.height=e}}else{var r=this.texture.getSourceImage();i.cutX+t>r.width&&(t=r.width-i.cutX),i.cutY+e>r.height&&(e=r.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}this.updateDisplayOrigin();var s=this.input;return s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,r,s){var o=this.frame,a=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=o.cutWidth),void 0===s&&(s=o.cutHeight);var l=(t>>16&255)/255,c=(t>>8&255)/255,u=(255&t)/255,d=this.renderTarget;if(a.preRender(),d){d.bind(!0);var p=this.pipeline;p.manager.set(p);var f=d.width,g=d.height,v=h.width/f,y=h.height/g;p.drawFillRect(i*v,n*y,r*v,s*y,m.getTintFromFloats(u,c,l,1),e),d.unbind(!0)}else{var x=this.context;h.setContext(x),x.fillStyle="rgba("+l+","+c+","+u+","+e+")",x.fillRect(i+o.cutX,n+o.cutY,r,s),h.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.renderTarget;if(t)t.clear();else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()}this.dirty=!1}return this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i,1,16777215),this._eraseMode=!1,this},draw:function(t,e,i,n,r){return this.beginDraw(),this.batchDraw(t,e,i,n,r),this.endDraw(),this},drawFrame:function(t,e,i,n,r,s){return this.beginDraw(),this.batchDrawFrame(t,e,i,n,r,s),this.endDraw(),this},beginDraw:function(){var t=this.camera,e=this.renderer,i=this.renderTarget;return t.preRender(),i?e.beginCapture(i.width,i.height):e.setContext(this.context),this},batchDraw:function(t,e,i,n,r){return void 0===n&&(n=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16),Array.isArray(t)||(t=[t]),this.batchList(t,e,i,n,r),this},batchDrawFrame:function(t,e,i,n,r,s){void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16);var o=this.textureManager.getFrame(t,e);return o&&(this.renderTarget?this.pipeline.batchTextureFrame(o,i,n,s,r,this.camera.matrix,null):this.batchTextureFrame(o,i+this.frame.cutX,n+this.frame.cutY,r,s)),this},endDraw:function(){var t=this.renderer,e=this.renderTarget;if(e){var i=t.endCapture();t.pipelines.setUtility().blitFrame(i,e,1,!1,!1,this._eraseMode),t.resetScissor(),t.resetViewport()}else t.setContext();return this.dirty=!0,this},batchList:function(t,e,i,n,r){for(var s=0;s<t.length;s++){var o=t[s];o&&o!==this&&(o.renderWebGL||o.renderCanvas?this.drawGameObject(o,e,i):o.isParent||o.list?this.batchGroup(o.getChildren(),e,i):"string"==typeof o?this.batchTextureFrameKey(o,null,e,i,n,r):o instanceof l?this.batchTextureFrame(o,e,i,n,r):Array.isArray(o)&&this.batchList(o,e,i,n,r))}},batchGroup:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),e+=this.frame.cutX,i+=this.frame.cutY;for(var n=0;n<t.length;n++){var r=t[n];if(r.willRender(this.camera)){var s=r.x+e,o=r.y+i;this.drawGameObject(r,s,o)}}},batchGameObjectWebGL:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var n=t.x,r=t.y;t.setPosition(e+this.frame.cutX,i+this.frame.cutY),t.renderDirect?t.renderDirect(this.renderer,t,this.camera):t.renderWebGL(this.renderer,t,this.camera),t.setPosition(n,r)},batchGameObjectCanvas:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var r=t.x,s=t.y;if(this._eraseMode){var o=t.blendMode;t.blendMode=n.ERASE}t.setPosition(e+this.frame.cutX,i+this.frame.cutY),t.renderCanvas(this.renderer,t,this.camera,null),t.setPosition(r,s),this._eraseMode&&(t.blendMode=o)},batchTextureFrameKey:function(t,e,i,n,r,s){var o=this.textureManager.getFrame(t,e);o&&this.batchTextureFrame(o,i,n,r,s)},batchTextureFrame:function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=0),e+=this.frame.cutX,i+=this.frame.cutY,this.renderTarget)this.pipeline.batchTextureFrame(t,e,i,r,n,this.camera.matrix,null);else{var s=this.context,o=t.canvasData,a=t.source.image,h=this.camera.matrix;s.save(),s.globalCompositeOperation=this._eraseMode?"destination-out":"source-over",s.globalAlpha=n,h.setToContext(s),s.drawImage(a,o.x,o.y,o.width,o.height,e,i,o.width,o.height),s.restore()}},snapshotArea:function(t,e,i,n,r,s,o){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,r,!1,t,e,i,n,s,o):this.renderer.snapshotCanvas(this.canvas,r,!1,t,e,i,n,s,o),this},snapshot:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,t,!1,0,0,this.width,this.height,e,i):this.renderer.snapshotCanvas(this.canvas,t,!1,0,0,this.width,this.height,e,i),this},snapshotPixel:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,i,!0,t,e):this.renderer.snapshotCanvas(this.canvas,i,!0,t,e),this},preDestroy:function(){this._saved||(s.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.texture.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.texture=null)}});t.exports=v},function(t,e){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(162),r=i(0),s=i(11),o=i(15),a=i(65),h=i(1079),l=i(3),c=new r({Extends:o,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.Flip,s.Mask,s.Pipeline,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,h],initialize:function(t,e,i,r,s,h,c,u,d){void 0===r&&(r="__DEFAULT"),void 0===h&&(h=2),void 0===c&&(c=!0),o.call(this,t,"Rope"),this.anims=new n(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===r,this.dirty=!1,this.horizontal=c,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(r,s),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(a.ROPE_PIPELINE),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,u,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var n,r=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var s=0;if(void 0!==e)for(n=0;n<i;n++)r[s=2*n]=t,r[s+1]=e;else if(t.length===i)for(n=0;n<i;n++)r[s=2*n]=t[n],r[s+1]=t[n];else{var o=t[0];for(n=0;n<i;n++)s=2*n,t.length>s&&(o=t[s]),r[s]=o,t.length>s+1&&(o=t[s+1]),r[s+1]=o}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,n=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var r=0;if(t.length===e)for(i=0;i<e;i++)n[r=2*i]=t[i],n[r+1]=t[i];else{var s=t[0];for(i=0;i<e;i++)r=2*i,t.length>r&&(s=t[r]),n[r]=s,t.length>r+1&&(s=t[r+1]),n[r+1]=s}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var n,r,s,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(s=-this.frame.halfWidth,r=this.frame.width/(o-1),n=0;n<o;n++)t.push({x:s+n*r,y:0});else for(s=-this.frame.halfHeight,r=this.frame.height/(o-1),n=0;n<o;n++)t.push({x:0,y:s+n*r})}var a=t.length,h=this.points.length;return a<1?(console.warn("Rope: Not enough points given"),this):(1===a&&(t.unshift({x:0,y:0}),a++),h!==a&&this.resizeArrays(a),this.points=t,this.updateUVs(),null!=e&&this.setColors(e),null!=i&&this.setAlphas(i),this)},updateUVs:function(){for(var t=this.uv,e=this.points.length,i=this.frame.u0,n=this.frame.v0,r=this.frame.u1,s=this.frame.v1,o=(r-i)/(e-1),a=(s-n)/(e-1),h=0;h<e;h++){var l,c,u,d,p=4*h;this.horizontal?(this._flipX?(l=r-h*o,u=r-h*o):(l=i+h*o,u=i+h*o),this._flipY?(c=s,d=n):(c=n,d=s)):(this._flipX?(l=i,u=r):(l=r,u=i),this._flipY?(c=s-h*a,d=s-h*a):(c=n+h*a,d=n+h*a)),t[p+0]=l,t[p+1]=c,t[p+2]=u,t[p+3]=d}return this},resizeArrays:function(t){var e=this.colors,i=this.alphas;this.vertices=new Float32Array(4*t),this.uv=new Float32Array(4*t),e=new Uint32Array(2*t),i=new Float32Array(2*t);for(var n=0;n<2*t;n++)e[n]=16777215,i[n]=1;return this.colors=e,this.alphas=i,this.dirty=!0,this},updateVertices:function(){var t=this._perp,e=this.points,i=this.vertices,n=e.length;if(this.dirty=!1,!(n<1)){for(var r,s=e[0],o=this.horizontal?this.frame.halfHeight:this.frame.halfWidth,a=0;a<n;a++){var h=e[a],l=4*a;r=a<n-1?e[a+1]:h,t.x=r.y-s.y,t.y=-(r.x-s.x);var c=t.length();t.x/=c,t.y/=c,t.x*=o,t.y*=o,i[l]=h.x+t.x,i[l+1]=h.y+t.y,i[l+2]=h.x-t.x,i[l+3]=h.y-t.y,s=h}return this}},setDebug:function(t,e){return this.debugGraphic=t,this.debugCallback=t||e?e||this.renderDebugVerts:null,this},renderDebugVerts:function(t,e,i){var n=t.debugGraphic,r=i[0],s=i[1],o=i[2],a=i[3];n.lineBetween(r,s,o,a);for(var h=4;h<e;h+=4){var l=i[h+0],c=i[h+1],u=i[h+2],d=i[h+3];n.lineBetween(r,s,l,c),n.lineBetween(o,a,u,d),n.lineBetween(o,a,l,c),n.lineBetween(l,c,u,d),r=l,s=c,o=u,a=d}},preDestroy:function(){this.anims.destroy(),this.anims=void 0,this.points=null,this.vertices=null,this.uv=null,this.colors=null,this.alphas=null,this.debugCallback=null,this.debugGraphic=null},flipX:{get:function(){return this._flipX},set:function(t){return this._flipX=t,this.updateUVs()}},flipY:{get:function(){return this._flipY},set:function(t){return this._flipY=t,this.updateUVs()}}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(140),r=i(31),s=i(0),o=i(11),a=i(22),h=i(15),l=i(452),c=i(6),u=i(199),d=i(1082),p=i(453),f=new s({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,d],initialize:function(t,e,i,n,s){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=r.create(this),this.context=this.canvas.getContext("2d"),this.style=new p(this,s),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(n),s&&s.padding&&this.setPadding(s.padding),s&&s.lineSpacing&&this.setLineSpacing(s.lineSpacing),t.sys.game.events.on(a.CONTEXT_RESTORED,(function(){this.dirty=!0}),this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",n(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var n="",r=t.replace(/ +/gi," ").split(this.splitRegExp),s=r.length,o=0;o<s;o++){var a=r[o],h="";if(a=a.replace(/^ *|\s*$/gi,""),e.measureText(a).width<i)n+=a+"\n";else{for(var l=i,c=a.split(" "),u=0;u<c.length;u++){var d=c[u],p=d+" ",f=e.measureText(p).width;if(f>l){if(0===u){for(var m=p;m.length&&(m=m.slice(0,-1),!((f=e.measureText(m).width)<=l)););if(!m.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var g=d.substr(m.length);c[u]=g,h+=m}var v=c[u].length?u:u+1,y=c.slice(v).join(" ").replace(/[ \n]*$/gi,"");r[o+1]=y+" "+(r[o+1]||""),s=r.length;break}h+=p,l-=f}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",r=t.split(this.splitRegExp),s=r.length-1,o=e.measureText(" ").width,a=0;a<=s;a++){for(var h=i,l=r[a].split(" "),c=l.length-1,u=0;u<=c;u++){var d=l[u],p=e.measureText(d).width,f=p;u<c&&(f+=o),f>h&&u>0&&(n+="\n",h=i),n+=d,u<c?(n+=" ",h-=f):h-=p}a<s&&(n+="\n")}return n},getWrappedText:function(t){return void 0===t&&(t=this._text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(t).split(this.splitRegExp)},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this._text&&(this._text=t.toString(),this.updateText()),this},setStyle:function(t){return this.style.setStyle(t)},setFont:function(t){return this.style.setFont(t)},setFontFamily:function(t){return this.style.setFontFamily(t)},setFontSize:function(t){return this.style.setFontSize(t)},setFontStyle:function(t){return this.style.setFontStyle(t)},setFixedSize:function(t,e){return this.style.setFixedSize(t,e)},setBackgroundColor:function(t){return this.style.setBackgroundColor(t)},setFill:function(t){return this.style.setFill(t)},setColor:function(t){return this.style.setColor(t)},setStroke:function(t,e){return this.style.setStroke(t,e)},setShadow:function(t,e,i,n,r,s){return this.style.setShadow(t,e,i,n,r,s)},setShadowOffset:function(t,e){return this.style.setShadowOffset(t,e)},setShadowColor:function(t){return this.style.setShadowColor(t)},setShadowBlur:function(t){return this.style.setShadowBlur(t)},setShadowStroke:function(t){return this.style.setShadowStroke(t)},setShadowFill:function(t){return this.style.setShadowFill(t)},setWordWrapWidth:function(t,e){return this.style.setWordWrapWidth(t,e)},setWordWrapCallback:function(t,e){return this.style.setWordWrapCallback(t,e)},setAlign:function(t){return this.style.setAlign(t)},setResolution:function(t){return this.style.setResolution(t)},setLineSpacing:function(t){return this.lineSpacing=t,this.updateText()},setPadding:function(t,e,i,n){if("object"==typeof t){var r=t,s=c(r,"x",null);null!==s?(t=s,i=s):(t=c(r,"left",0),i=c(r,"right",t));var o=c(r,"y",null);null!==o?(e=o,n=o):(e=c(r,"top",0),n=c(r,"bottom",e))}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=e);return this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=n,this.updateText()},setMaxLines:function(t){return this.style.setMaxLines(t)},updateText:function(){var t=this.canvas,e=this.context,i=this.style,n=i.resolution,r=i.metrics;i.syncFont(t,e);var s=this._text;(i.wordWrapWidth||i.wordWrapCallback)&&(s=this.runWordWrap(this._text));var o,a=s.split(this.splitRegExp),h=l(this,r,a),c=this.padding;0===i.fixedWidth?(this.width=h.width+c.left+c.right,o=h.width):(this.width=i.fixedWidth,(o=this.width-c.left-c.right)<h.width&&(o=h.width)),0===i.fixedHeight?this.height=h.height+c.top+c.bottom:this.height=i.fixedHeight;var u,d,p=this.width,f=this.height;this.updateDisplayOrigin(),p*=n,f*=n,p=Math.max(p,1),f=Math.max(f,1),t.width!==p||t.height!==f?(t.width=p,t.height=f,this.frame.setSize(p,f),i.syncFont(t,e)):e.clearRect(0,0,p,f),e.save(),e.scale(n,n),i.backgroundColor&&(e.fillStyle=i.backgroundColor,e.fillRect(0,0,p,f)),i.syncStyle(t,e),e.textBaseline="alphabetic",e.translate(c.left,c.top);for(var m=0;m<h.lines;m++){if(u=i.strokeThickness/2,d=i.strokeThickness/2+m*h.lineHeight+r.ascent,m>0&&(d+=h.lineSpacing*m),i.rtl)u=p-u;else if("right"===i.align)u+=o-h.lineWidths[m];else if("center"===i.align)u+=(o-h.lineWidths[m])/2;else if("justify"===i.align&&h.lineWidths[m]/h.width>=.85){var g=h.width-h.lineWidths[m],v=e.measureText(" ").width,y=a[m].trim(),x=y.split(" ");g+=(a[m].length-y.length)*v;for(var b=Math.floor(g/v),w=0;b>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--b;a[m]=x.join(" ")}this.autoRound&&(u=Math.round(u),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[m],u,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[m],u,d))}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var T=this.input;return T&&!T.customHitArea&&(T.hitArea.width=this.width,T.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&u(this.canvas),r.remove(this.canvas),this.texture.destroy()}});t.exports=f},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(31),r=i(0),s=i(11),o=i(22),a=i(15),h=i(355),l=i(189),c=i(1085),u=i(3),d=new r({Extends:a,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Crop,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Tint,s.Transform,s.Visible,c],initialize:function(t,e,i,r,s,l,c){var d=t.sys.renderer;a.call(this,t,"TileSprite");var p=t.sys.textures.get(l),f=p.get(c);r&&s?(r=Math.floor(r),s=Math.floor(s)):(r=f.width,s=f.height),this._tilePosition=new u,this._tileScale=new u(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,r,s),this.context=this.canvas.getContext("2d"),this.displayTexture=p,this.displayFrame=f,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(f.width),this.potHeight=h(f.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(r,s),this.setFrame(c),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,(function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)}),this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=h(e.width),this.potHeight=h(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,n=this.potWidth,r=this.potHeight;this.renderer.gl||(n=t.cutWidth,r=t.cutHeight),e.clearRect(0,0,n,r),i.width=n,i.height=r,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,r),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,r=this._tilePosition.x,s=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-r,-s),e.fillStyle=this.fillPattern,e.fillRect(r,s,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(18),s=i(11),o=i(75),a=i(22),h=i(49),l=i(15),c=i(69),u=i(219),d=i(1088),p=i(14),f=new n({Extends:l,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,d],initialize:function(t,e,i,n){l.call(this,t,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=u(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=p.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.removeVideoElementOnDestroy=!1,this.setPosition(e,i),this.initPipeline(),n&&this.changeSource(n,!1);var r=t.sys.game.events;r.on(a.PAUSE,this.globalPause,this),r.on(a.RESUME,this.globalResume,this);var s=t.sys.sound;s&&s.on(c.GLOBAL_MUTE,this.globalMute,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},play:function(t,e,i){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var n=this.video;if(!n)return console.warn("Video not loaded"),this;void 0===t&&(t=n.loop);var r=this.scene.sys.sound;r&&r.mute&&this.setMute(!0),isNaN(e)||(this._markerIn=e),!isNaN(i)&&i>e&&(this._markerOut=i),n.loop=t;var s=this._callbacks,o=n.play();return void 0!==o?o.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(n.addEventListener("playing",s.play,!0),n.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),n.addEventListener("ended",s.end,!0),n.addEventListener("timeupdate",s.time,!0),n.addEventListener("seeking",s.seeking,!0),n.addEventListener("seeked",s.seeked,!0),this},changeSource:function(t,e,i,n,r){void 0===e&&(e=!0),this.video&&this.stop();var s=this.scene.sys.cache.video.get(t);return s?(this.video=s,this._cacheKey=t,this._codePaused=s.paused,this._codeMuted=s.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,s,s.videoWidth,s.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,s.videoWidth,s.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,s.videoWidth,s.videoHeight)):this.updateTexture(),s.currentTime=0,this._lastUpdate=0,e&&this.play(i,n,r)):this.video=null,this},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,n,r,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=this.height),void 0===r&&(r=i),void 0===s&&(s=n);var o=this.video,a=this.snapshotTexture;return a?(a.setSize(r,s),o&&a.context.drawImage(o,t,e,i,n,0,0,r,s)):(a=this.scene.sys.textures.createCanvas(u(),r,s),this.snapshotTexture=a,o&&a.context.drawImage(o,t,e,i,n,0,0,r,s)),a.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},loadURL:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");return n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),n.addEventListener("error",this._callbacks.error,!0),n.src=t,n.load(),this.video=n,this},loadMediaStream:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),n.addEventListener("error",this._callbacks.error,!0);try{n.srcObject=t}catch(e){n.src=window.URL.createObjectURL(t)}return n.load(),this.video=n,this},playPromiseSuccessHandler:function(){this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(t){this.scene.sys.input.once(h.POINTER_DOWN,this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(o.VIDEO_ERROR,this,t)},playHandler:function(){this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(t){this.stop(),this.emit(o.VIDEO_ERROR,this,t)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(o.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(o.VIDEO_PLAY,this)},completeHandler:function(){this.emit(o.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime<this._lastUpdate&&(this.emit(o.VIDEO_LOOP,this),this._lastUpdate=0)},preUpdate:function(){var t=this.video;if(t){var e=t.currentTime;e!==this._lastUpdate&&(this._lastUpdate=e,this.updateTexture(),e>=this._markerOut&&(t.loop?(t.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=e,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(o.VIDEO_TIMEOUT,this))},updateTexture:function(){var t=this.video,e=t.videoWidth,i=t.videoHeight;if(this.videoTexture){var n=this.videoTextureSource;n.source!==t&&(n.source=t,n.width=e,n.height=i),n.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,t,e,i),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,e,i),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,e,i)},getVideoKey:function(){return this._cacheKey},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var n=i*t;this.setCurrentTime(n)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],n=parseFloat(t.substr(1));"+"===i?t=e.currentTime+n:"-"===i&&(t=e.currentTime-n)}e.currentTime=t,this._lastUpdate=t}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(o.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var t=this.video;if(t){var e=t.currentTime,i=t.duration;if(i!==1/0&&!isNaN(i))return e/i}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&(t?e.paused||e.pause():t||e.paused&&!this._systemPaused&&e.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=r(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,t),this._key=t,this.flipY=e,this.videoTextureSource&&this.videoTextureSource.setFlipY(e),this.videoTexture},stop:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i],!0);t.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(),this.removeVideoElementOnDestroy&&this.removeVideoElement();var t=this.scene.sys.game.events;t.off(a.PAUSE,this.globalPause,this),t.off(a.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(c.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=f},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(225),s=i(464),o=i(55),a=new n({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return r(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n<t.length;n++)e={x:0,y:0},"number"==typeof t[n]||"string"==typeof t[n]?(e.x=parseFloat(t[n]),e.y=parseFloat(t[n+1]),n++):Array.isArray(t[n])?(e.x=t[n][0],e.y=t[n][1]):(e.x=t[n].x,e.y=t[n].y),this.points.push(e),e.y<i&&(i=e.y);return this.calculateArea(i),this},calculateArea:function(){if(this.points.length<3)return this.area=0,this.area;for(var t,e,i=0,n=0;n<this.points.length-1;n++)t=this.points[n],i+=((e=this.points[n+1]).x-t.x)*(t.y+e.y);return t=this.points[0],e=this.points[this.points.length-1],i+=(t.x-e.x)*(e.y+t.y),this.area=.5*-i,this.area},getPoints:function(t,e,i){return s(this,t,e,i)}});t.exports=a},function(t,e){t.exports=function(t,e,i){for(var n=!1,r=-1,s=t.points.length-1;++r<t.points.length;s=r){var o=t.points[r].x,a=t.points[r].y,h=t.points[s].x,l=t.points[s].y;(a<=i&&i<l||l<=i&&i<a)&&e<(h-o)*(i-a)/(l-a)+o&&(n=!n)}return n}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(15),o=i(2),a=i(17),h=i(472),l=i(1170),c=i(25),u=new n({Extends:s,Mixins:[r.ComputedSize,r.Depth,r.GetBounds,r.Mask,r.Origin,r.ScrollFactor,r.Transform,r.Visible,l],initialize:function(t,e,i,n,r,o,a,h){void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=128),void 0===o&&(o=128),s.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,n),this.setSize(r,o),this.setOrigin(.5,.5),this.setShader(e,a,h)},willRender:function(t){return!!this.renderToTexture||!(s.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,n=this.height,r=this.renderer;this.glTexture=r.createTextureFromSource(null,i,n,0),this.glTexture.flipY=e,this.framebuffer=r.createFramebuffer(i,n,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=n,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture,i,n))}return this.shader&&(r.pipelines.clear(),this.load(),this.flush(),r.pipelines.rebind()),this},setShader:function(t,e,i){if(void 0===e&&(e=[]),"string"==typeof t){var n=this.scene.sys.cache.shader;if(!n.has(t))return console.warn("Shader missing: "+t),this;this.shader=n.get(t)}else this.shader=t;var r=this.gl,s=this.renderer;this.program&&r.deleteProgram(this.program);var o=s.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);r.uniformMatrix4fv(r.getUniformLocation(o,"uViewMatrix"),!1,this.viewMatrix),r.uniformMatrix4fv(r.getUniformLocation(o,"uProjectionMatrix"),!1,this.projectionMatrix),r.uniform2f(r.getUniformLocation(o,"uResolution"),this.width,this.height),this.program=o;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=a(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var c=0;c<4;c++)e[c]&&this.setSampler2D("iChannel"+c,e[c],c,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,n){var r=1/(t-e),s=1/(i-n),o=this.projectionMatrix;o[0]=-2*r,o[5]=-2*s,o[10]=-.001,o[12]=(t+e)*r,o[13]=(n+i)*s,o[14]=-0;var a=this.program,h=this.gl;this.renderer.setProgram(a),h.uniformMatrix4fv(h.getUniformLocation(a,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i},initUniforms:function(){var t=this.gl,e=this.renderer.glFuncMap,i=this.program;for(var n in this._textureCount=0,this.uniforms){var r=this.uniforms[n],s=r.type,o=e[s];r.uniformLocation=t.getUniformLocation(i,n),"sampler2D"!==s&&(r.glMatrix=o.matrix,r.glValueLength=o.length,r.glFunc=o.func)}},setSampler2DBuffer:function(t,e,i,n,r,s){void 0===r&&(r=0),void 0===s&&(s={});var o=this.uniforms[t];return o.value=e,s.width=i,s.height=n,o.textureData=s,this._textureCount=r,this.initSampler2D(o),this},setSampler2D:function(t,e,i,n){void 0===i&&(i=0);var r=this.scene.sys.textures;if(r.exists(e)){var s=r.getFrame(e);if(s.glTexture&&s.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,s.glTexture,s.width,s.height,i,n);var o=this.uniforms[t],a=s.source;o.textureKey=e,o.source=a.image,o.value=s.glTexture,a.isGLTexture&&(n||(n={}),n.width=a.width,n.height=a.height),n&&(o.textureData=n),this._textureCount=i,this.initSampler2D(o)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return o(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value);var i=t.textureData;if(i&&!t.value.isRenderTexture){var n=e[o(i,"magFilter","linear").toUpperCase()],r=e[o(i,"minFilter","linear").toUpperCase()],s=e[o(i,"wrapS","repeat").toUpperCase()],a=e[o(i,"wrapT","repeat").toUpperCase()],h=e[o(i,"format","rgba").toUpperCase()];if(i.repeat&&(s=e.REPEAT,a=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var l=o(i,"width",512),c=o(i,"height",2),u=o(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,c,u,h,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,h,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a)}this.renderer.setProgram(this.program),e.uniform1i(t.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var t,e,i,n,r,s=this.gl,o=this.uniforms,a=0;for(var h in o)i=(t=o[h]).glFunc,e=t.glValueLength,n=t.uniformLocation,null!==(r=t.value)&&(1===e?t.glMatrix?i.call(s,n,t.transpose,r):i.call(s,n,r):2===e?i.call(s,n,r.x,r.y):3===e?i.call(s,n,r.x,r.y,r.z):4===e?i.call(s,n,r.x,r.y,r.z,r.w):"sampler2D"===t.type&&(s.activeTexture(s.TEXTURE0+a),s.bindTexture(s.TEXTURE_2D,r),s.uniform1i(n,a),a++))},load:function(t){var e=this.gl,i=this.width,n=this.height,r=this.renderer,s=this.program,o=this.viewMatrix;if(!this.renderToTexture){var a=-this._displayOriginX,h=-this._displayOriginY;o[0]=t[0],o[1]=t[1],o[4]=t[2],o[5]=t[3],o[8]=t[4],o[9]=t[5],o[12]=o[0]*a+o[4]*h,o[13]=o[1]*a+o[5]*h}e.useProgram(s),e.uniformMatrix4fv(e.getUniformLocation(s,"uViewMatrix"),!1,o),e.uniform2f(e.getUniformLocation(s,"uResolution"),this.width,this.height);var l=this.uniforms,c=l.resolution;c.value.x=i,c.value.y=n,l.time.value=r.game.loop.getDuration();var u=this.pointer;if(u){var d=l.mouse,p=u.x/i,f=1-u.y/n;d.value.x=p.toFixed(2),d.value.y=f.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,n=this.gl,r=this.vertexBuffer,s=this.renderer,o=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(s.setFramebuffer(this.framebuffer),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT)),n.bindBuffer(n.ARRAY_BUFFER,r);var a=n.getAttribLocation(i,"inPosition");-1!==a&&(n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,!1,o,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t,n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,6*o)),n.drawArrays(n.TRIANGLES,0,6),this.renderToTexture&&s.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var t=this.gl;t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}});t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(35),o=i(113),a=i(15),h=i(473),l=i(474),c=i(19),u=i(67),d=i(1173),p=i(79),f=i(38),m=i(115),g=new n({Extends:a,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,d],initialize:function(t,e,i,n,r,s,o,h,l,c,d,p){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n="__WHITE"),a.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new f,this.modelScale=new f(1,1,1),this.modelRotation=new f,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new u,this.viewPosition=new f,this.viewMatrix=new u,this.projectionMatrix=new u,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1;var m=t.sys.renderer;this.setPosition(e,i),this.setTexture(n,r),this.setSize(m.width,m.height),this.initPipeline(),this.setPerspective(m.width,m.height),s&&this.addVertices(s,o,h,l,c,d,p)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(f.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=f.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,n,r){return void 0===i&&(i=45),void 0===n&&(n=.01),void 0===r&&(r=1e3),this.projectionMatrix.perspective(s(i),t/e,n,r),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,n){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===n&&(n=1e3),this.projectionMatrix.ortho(-t,t,-e,e,i,n),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,n,r,s,o,a,h){var c=this.scene.sys.cache.obj.get(t);return c&&l(c,this,e,i,n,r,s,o,a,h),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return p(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,n,r,s,o){var a=new m(t,e,i,n,r,s,o);return this.vertices.push(a),a},addFace:function(t,e,i){var n=new o(t,e,i);return this.faces.push(n),this.dirtyCache[9]=-1,n},addVertices:function(t,e,i,n,r,s,o){var a=h(t,e,i,n,r,s,o);return a&&(this.faces=this.faces.concat(a.faces),this.vertices=this.vertices.concat(a.vertices)),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},getFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var n=c(this,i).calc,r=this.faces,s=[],o=0;o<r.length;o++){var a=r[o];a.contains(t,e,n)&&s.push(a)}return p(s,this.sortByDepth)},setDebug:function(t,e){return this.debugGraphic=t,this.debugCallback=t||e?e||this.renderDebug:null,this},isDirty:function(){var t=this.modelPosition,e=this.modelRotation,i=this.modelScale,n=this.dirtyCache,r=t.x,s=t.y,o=t.z,a=e.x,h=e.y,l=e.z,c=i.x,u=i.y,d=i.z,p=this.getFaceCount(),f=n[0],m=n[1],g=n[2],v=n[3],y=n[4],x=n[5],b=n[6],w=n[7],T=n[8],_=n[9];return n[0]=r,n[1]=s,n[2]=o,n[3]=a,n[4]=h,n[5]=l,n[6]=c,n[7]=u,n[8]=d,n[9]=p,f!==r||m!==s||g!==o||v!==a||y!==h||x!==l||b!==c||w!==u||T!==d||_!==p},preUpdate:function(){this.totalRendered=this.totalFrame,this.totalFrame=0;var t=this.dirtyCache;if(this.ignoreDirtyCache||t[10]||this.isDirty()){var e=this.width,i=this.height,n=this.viewMatrix,r=this.viewPosition;t[10]&&(n.identity(),n.translate(r),n.invert(),t[10]=0);var s=this.transformMatrix;s.setWorldMatrix(this.modelRotation,this.modelPosition,this.modelScale,this.viewMatrix,this.projectionMatrix);for(var o=r.z,a=this.faces,h=0;h<a.length;h++)a[h].transformCoordinatesLocal(s,e,i,o);this.depthSort()}},renderDebug:function(t,e){for(var i=t.debugGraphic,n=0;n<e.length;n++){var r=e[n],s=r.vertex1.tx,o=r.vertex1.ty,a=r.vertex2.tx,h=r.vertex2.ty,l=r.vertex3.tx,c=r.vertex3.ty;i.strokeTriangle(s,o,a,h,l,c)}},preDestroy:function(){this.clear(),this.debugCallback=null,this.debugGraphic=null}});t.exports=g},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(48);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e,i){
|
|
/**
|
|
* @author Florian Vazelle
|
|
* @author Geoffrey Glaive
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4),r=i(230);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s,o,a=t.x1,h=t.y1,l=t.x2,c=t.y2,u=e.x,d=e.y,p=e.radius,f=l-a,m=c-h,g=a-u,v=h-d,y=f*f+m*m,x=2*(f*g+m*v),b=x*x-4*y*(g*g+v*v-p*p);if(0===b){var w=-x/(2*y);s=a+w*f,o=h+w*m,w>=0&&w<=1&&i.push(new n(s,o))}else if(b>0){var T=(-x-Math.sqrt(b))/(2*y);s=a+T*f,o=h+T*m,T>=0&&T<=1&&i.push(new n(s,o));var _=(-x+Math.sqrt(b))/(2*y);s=a+_*f,o=h+_*m,_>=0&&_<=1&&i.push(new n(s,o))}}return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(63),r=new(i(4));t.exports=function(t,e,i){if(void 0===i&&(i=r),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var s=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=s*s+o*o,c=s,u=o;if(l>0){var d=(a*s+h*o)/l;c*=d,u*=d}return i.x=t.x1+c,i.y=t.y1+u,c*c+u*u<=l&&c*s+u*o>=0&&n(e,i.x,i.y)}},function(t,e,i){
|
|
/**
|
|
* @author Florian Vazelle
|
|
* @author Geoffrey Glaive
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4),r=i(92),s=i(482);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),c=[new n,new n,new n,new n],u=[r(o,t,c[0]),r(a,t,c[1]),r(h,t,c[2]),r(l,t,c[3])],d=0;d<4;d++)u[d]&&i.push(c[d]);return i}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var r,s,o,a,h,l,c=t.x3-t.x1,u=t.y3-t.y1,d=t.x2-t.x1,p=t.y2-t.y1,f=c*c+u*u,m=c*d+u*p,g=d*d+p*p,v=f*g-m*m,y=0===v?0:1/v,x=t.x1,b=t.y1,w=0;w<e.length&&(s=(f*(l=d*(o=e[w].x-x)+p*(a=e[w].y-b))-m*(h=c*o+u*a))*y,!((r=(g*h-m*l)*y)>=0&&s>=0&&r+s<1&&(n.push({x:e[w].x,y:e[w].y}),i)));w++);return n}},function(t,e){t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*r-a*s+e,t.y1=o*s+a*r+i,o=t.x2-e,a=t.y2-i,t.x2=o*r-a*s+e,t.y2=o*s+a*r+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*r-a*s+e,t.y1=o*s+a*r+i,o=t.x2-e,a=t.y2-i,t.x2=o*r-a*s+e,t.y2=o*s+a*r+i,o=t.x3-e,a=t.y3-i,t.x3=o*r-a*s+e,t.y3=o*s+a*r+i,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={BUTTON_DOWN:i(1304),BUTTON_UP:i(1305),CONNECTED:i(1306),DISCONNECTED:i(1307),GAMEPAD_BUTTON_DOWN:i(1308),GAMEPAD_BUTTON_UP:i(1309)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(17),r=i(154);t.exports=function(t,e){var i=void 0===t?r():n({},t);if(e)for(var s in e)void 0!==e[s]&&(i[s]=e[s]);return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=i(402),c=new n({Extends:s,initialize:function(t,e,i,n){var r="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"xml",cache:t.cacheManager.xml,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new c(this,t[n]));else this.addFile(new c(this,t,e,i));return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="text",o="txt",l=t.cacheManager.text;if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),o=a(c,"extension",o),r=a(c,"type",r),l=a(c,"cache",l)}var u={type:r,cache:l,extension:o,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,u)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Acceleration:i(1362),Angular:i(1363),Bounce:i(1364),Debug:i(1365),Drag:i(1366),Enable:i(1367),Friction:i(1368),Gravity:i(1369),Immovable:i(1370),Mass:i(1371),OverlapCirc:i(517),OverlapRect:i(241),Pushable:i(1372),Size:i(1373),Velocity:i(1374)}},function(t,e){t.exports=function(t,e,i,n,r,s,o){void 0===s&&(s=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+n,l.maxY=i+r,o&&(h=t.staticTree.search(l)),s&&t.useTree)a=t.tree.search(l);else if(s){var c=t.bodies,u={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+r,isCircle:!1},d=t.intersects;c.iterate((function(t){d(t,u)&&a.push(t)}))}return h.concat(a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={COLLIDE:i(1375),OVERLAP:i(1376),PAUSE:i(1377),RESUME:i(1378),TILE_COLLIDE:i(1379),TILE_OVERLAP:i(1380),WORLD_BOUNDS:i(1381),WORLD_STEP:i(1382)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(60);t.exports=function(t,e,i,r){var s=0,o=t.deltaAbsX()+e.deltaAbsX()+r;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(s=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dx<e._dx&&(-(s=t.x-e.width-e.x)>o&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?s=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=s,e.overlapX=s,s}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(60);t.exports=function(t,e,i,r){var s=0,o=t.deltaAbsY()+e.deltaAbsY()+r;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(s=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dy<e._dy&&(-(s=t.y-e.bottom)>o&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?s=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=s,e.overlapY=s,s}},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n={};t.exports=n;var r=i(94),s=i(116),o=i(267),a=i(117),h=i(585),l=i(50);n._warming=.4,n._torqueDampen=1,n._minLength=1e-6,n.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?s.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?s.add(e.bodyB.position,e.pointB):e.pointB,r=s.magnitude(s.sub(i,n));e.length=void 0!==e.length?e.length:r,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e<t.length;e+=1){var i=t[e],n=i.constraintImpulse;i.isStatic||0===n.x&&0===n.y&&0===n.angle||(i.position.x+=n.x,i.position.y+=n.y,i.angle+=n.angle)}},n.solveAll=function(t,e){for(var i=0;i<t.length;i+=1){var r=t[i],s=!r.bodyA||r.bodyA&&r.bodyA.isStatic,o=!r.bodyB||r.bodyB&&r.bodyB.isStatic;(s||o)&&n.solve(t[i],e)}for(i=0;i<t.length;i+=1)s=!(r=t[i]).bodyA||r.bodyA&&r.bodyA.isStatic,o=!r.bodyB||r.bodyB&&r.bodyB.isStatic,s||o||n.solve(t[i],e)},n.solve=function(t,e){var i=t.bodyA,r=t.bodyB,o=t.pointA,a=t.pointB;if(i||r){i&&!i.isStatic&&(s.rotate(o,i.angle-t.angleA,o),t.angleA=i.angle),r&&!r.isStatic&&(s.rotate(a,r.angle-t.angleB,a),t.angleB=r.angle);var h=o,l=a;if(i&&(h=s.add(i.position,o)),r&&(l=s.add(r.position,a)),h&&l){var c=s.sub(h,l),u=s.magnitude(c);u<n._minLength&&(u=n._minLength);var d,p,f,m,g,v=(u-t.length)/u,y=t.stiffness<1?t.stiffness*e:t.stiffness,x=s.mult(c,v*y),b=(i?i.inverseMass:0)+(r?r.inverseMass:0),w=b+((i?i.inverseInertia:0)+(r?r.inverseInertia:0));if(t.damping){var T=s.create();f=s.div(c,u),g=s.sub(r&&s.sub(r.position,r.positionPrev)||T,i&&s.sub(i.position,i.positionPrev)||T),m=s.dot(f,g)}i&&!i.isStatic&&(p=i.inverseMass/b,i.constraintImpulse.x-=x.x*p,i.constraintImpulse.y-=x.y*p,i.position.x-=x.x*p,i.position.y-=x.y*p,t.damping&&(i.positionPrev.x-=t.damping*f.x*m*p,i.positionPrev.y-=t.damping*f.y*m*p),d=s.cross(o,x)/w*n._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=d,i.angle-=d),r&&!r.isStatic&&(p=r.inverseMass/b,r.constraintImpulse.x+=x.x*p,r.constraintImpulse.y+=x.y*p,r.position.x+=x.x*p,r.position.y+=x.y*p,t.damping&&(r.positionPrev.x+=t.damping*f.x*m*p,r.positionPrev.y+=t.damping*f.y*m*p),d=s.cross(a,x)/w*n._torqueDampen*r.inverseInertia*(1-t.angularStiffness),r.constraintImpulse.angle+=d,r.angle+=d)}}},n.postSolveAll=function(t){for(var e=0;e<t.length;e++){var i=t[e],l=i.constraintImpulse;if(!(i.isStatic||0===l.x&&0===l.y&&0===l.angle)){o.set(i,!1);for(var c=0;c<i.parts.length;c++){var u=i.parts[c];r.translate(u.vertices,l),c>0&&(u.position.x+=l.x,u.position.y+=l.y),0!==l.angle&&(r.rotate(u.vertices,l.angle,i.position),h.rotate(u.axes,l.angle),c>0&&s.rotateAbout(u.position,l.angle,i.position,u.position)),a.update(u.bounds,u.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}},n.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+t.pointA.x,y:(t.bodyA?t.bodyA.position.y:0)+t.pointA.y}},n.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+t.pointB.x,y:(t.bodyB?t.bodyB.position.y:0)+t.pointB.y}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={CalculateFacesAt:i(248),CalculateFacesWithin:i(61),CheckIsoBounds:i(537),Copy:i(1414),CreateFromTiles:i(1415),CullBounds:i(539),CullTiles:i(540),Fill:i(1416),FilterTiles:i(1417),FindByIndex:i(1418),FindTile:i(1419),ForEachTile:i(1420),GetCullTilesFunction:i(1421),GetTileAt:i(156),GetTileAtWorldXY:i(1422),GetTilesWithin:i(26),GetTilesWithinShape:i(1423),GetTilesWithinWorldXY:i(523),GetTileToWorldXFunction:i(1424),GetTileToWorldXYFunction:i(1425),GetTileToWorldYFunction:i(1426),GetWorldToTileXFunction:i(1427),GetWorldToTileXYFunction:i(1428),GetWorldToTileYFunction:i(1429),HasTileAt:i(558),HasTileAtWorldXY:i(1430),HexagonalCullBounds:i(542),HexagonalCullTiles:i(541),HexagonalTileToWorldXY:i(546),HexagonalTileToWorldY:i(550),HexagonalWorldToTileXY:i(552),HexagonalWorldToTileY:i(556),IsInLayerBounds:i(118),IsometricCullTiles:i(543),IsometricTileToWorldXY:i(547),IsometricWorldToTileXY:i(553),PutTileAt:i(253),PutTileAtWorldXY:i(1431),PutTilesAt:i(1432),Randomize:i(1433),RemoveTileAt:i(559),RemoveTileAtWorldXY:i(1434),RenderDebug:i(1435),ReplaceByIndex:i(538),RunCull:i(157),SetCollision:i(1436),SetCollisionBetween:i(1437),SetCollisionByExclusion:i(1438),SetCollisionByProperty:i(1439),SetCollisionFromCollisionGroup:i(1440),SetLayerCollisionIndex:i(158),SetTileCollision:i(72),SetTileIndexCallback:i(1441),SetTileLocationCallback:i(1442),Shuffle:i(1443),StaggeredCullBounds:i(545),StaggeredCullTiles:i(544),StaggeredTileToWorldXY:i(548),StaggeredTileToWorldY:i(551),StaggeredWorldToTileXY:i(554),StaggeredWorldToTileY:i(557),SwapByIndex:i(1444),TileToWorldX:i(249),TileToWorldXY:i(549),TileToWorldY:i(250),WeightedRandomize:i(1445),WorldToTileX:i(251),WorldToTileXY:i(555),WorldToTileY:i(252)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(156);t.exports=function(t,e,i){var r=n(t,e,!0,i),s=n(t,e-1,!0,i),o=n(t,e+1,!0,i),a=n(t-1,e,!0,i),h=n(t+1,e,!0,i),l=r&&r.collides;return l&&(r.faceTop=!0,r.faceBottom=!0,r.faceLeft=!0,r.faceRight=!0),s&&s.collides&&(l&&(r.faceTop=!1),s.faceBottom=!l),o&&o.collides&&(l&&(r.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(r.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(r.faceRight=!1),h.faceLeft=!l),r&&!r.collides&&r.resetFaces(),r}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,r=i.tilemapLayer,s=0;return r&&(e||(e=r.scene.cameras.main),s=r.x+e.scrollX*(1-r.scrollFactorX),n*=r.scaleX),s+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,r=i.tilemapLayer,s=0;return r&&(e||(e=r.scene.cameras.main),s=r.y+e.scrollY*(1-r.scrollFactorY),n*=r.scaleY),s+t*n}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var r=n.baseTileWidth,s=n.tilemapLayer;return s&&(i||(i=s.scene.cameras.main),t-=s.x+i.scrollX*(1-s.scrollFactorX),r*=s.scaleX),e?Math.floor(t/r):t/r}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var r=n.baseTileHeight,s=n.tilemapLayer;return s&&(i||(i=s.scene.cameras.main),t-=s.y+i.scrollY*(1-s.scrollFactorY),r*=s.scaleY),e?Math.floor(t/r):t/r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(83),r=i(118),s=i(248),o=i(72);t.exports=function(t,e,i,a,h){if(void 0===a&&(a=!0),!r(e,i,h))return null;var l=h.data[i][e],c=l&&l.collides;if(t instanceof n)null===h.data[i][e]&&(h.data[i][e]=new n(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t);else{var u=t;null===h.data[i][e]?h.data[i][e]=new n(h,u,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=u}var d=h.data[i][e],p=-1!==h.collideIndexes.indexOf(d.index);return o(d,p),a&&c!==d.collides&&s(e,i,h),d}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(29);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?n.ISOMETRIC:"staggered"===t?n.STAGGERED:"hexagonal"===t?n.HEXAGONAL:n.ORTHOGONAL}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(39),r=i(119),s=i(120),o=i(83);t.exports=function(t,e,i,a,h){for(var l=new r({tileWidth:i,tileHeight:a}),c=new s({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),u=[],d=e.length,p=0,f=0;f<e.length;f++){u[f]=[];for(var m=e[f],g=0;g<m.length;g++){var v=parseInt(m[g],10);isNaN(v)||-1===v?u[f][g]=h?null:new o(l,-1,g,f,i,a):u[f][g]=new o(l,v,g,f,i,a)}0===p&&(p=m.length)}return c.width=l.width=p,c.height=l.height=d,c.widthInPixels=l.widthInPixels=p*i,c.heightInPixels=l.heightInPixels=d*a,l.data=u,c}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(567),r=i(257),s=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=n(t,o);if(a.x+=e,a.y+=i,t.gid){var h=r(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(s):t.polygon?a.polygon=t.polygon.map(s):t.ellipse?a.ellipse=t.ellipse:t.text?a.text=t.text:t.point?a.point=!0:a.rectangle=!0;return a}},function(t,e){t.exports=function(t){var e=Boolean(2147483648&t),i=Boolean(1073741824&t),n=Boolean(536870912&t);t&=536870911;var r=0,s=!1;return e&&i&&n?(r=Math.PI/2,s=!0):e&&i&&!n?(r=Math.PI,s=!1):e&&!i&&n?(r=Math.PI/2,s=!1):!e||i||n?!e&&i&&n?(r=3*Math.PI/2,s=!1):e||!i||n?e||i||!n?e||i||n||(r=0,s=!1):(r=3*Math.PI/2,s=!0):(r=Math.PI,s=!0):(r=0,s=!0),{gid:t,flippedHorizontal:e,flippedVertical:i,flippedAntiDiagonal:n,rotation:r,flipped:s}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(39),r=i(120),s=i(560),o=i(576);t.exports=function(t,e,i,a,h,l,c,u){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===u&&(u=!1);var d=null;if(Array.isArray(c))d=s(void 0!==e?e:"map",n.ARRAY_2D,c,i,a,u);else if(void 0!==e){var p=t.cache.tilemap.get(e);p?d=s(e,p.format,p.data,i,a,u):console.warn("No map data found for key "+e)}return null===d&&(d=new r({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(6);t.exports=function(t){var e=n(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
function i(t){return!!t.getActive&&"function"==typeof t.getActive}function n(t){return!!t.getStart&&"function"==typeof t.getStart}function r(t){return!!t.getEnd&&"function"==typeof t.getEnd}var s=function(t,e){var o,a,h=function(t,e,i){return i},l=function(t,e,i){return i},c=null,u=typeof e;if("number"===u)h=function(){return e};else if("string"===u){var d=e[0],p=parseFloat(e.substr(2));switch(d){case"+":h=function(t,e,i){return i+p};break;case"-":h=function(t,e,i){return i-p};break;case"*":h=function(t,e,i){return i*p};break;case"/":h=function(t,e,i){return i/p};break;default:h=function(){return parseFloat(e)}}}else if("function"===u)h=e;else if("object"===u)if(n(a=e)||r(a)||i(a))i(e)&&(c=e.getActive),r(e)&&(h=e.getEnd),n(e)&&(l=e.getStart);else if(e.hasOwnProperty("value"))o=s(t,e.value);else{var f=e.hasOwnProperty("to"),m=e.hasOwnProperty("from"),g=e.hasOwnProperty("start");if(f&&(m||g)){if(o=s(t,e.to),g){var v=s(t,e.start);o.getActive=v.getEnd}if(m){var y=s(t,e.from);o.getStart=y.getEnd}}}return o||(o={getActive:c,getEnd:h,getStart:l}),o};t.exports=s},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(9),s=i(263),o=i(16),a=i(5),h=i(97),l=i(14),c=new n({Extends:r,initialize:function(t,e,i){r.call(this),this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.startDelay=0,this.hasStarted=!1,this.isSeeking=!1,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=h.PENDING_ADD,this._pausedState=h.INIT,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onActive:null,onComplete:null,onLoop:null,onRepeat:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(t){return void 0===t&&(t=0),this.data[t].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===h.ACTIVE},isPaused:function(){return this.state===h.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){void 0===i&&(i=!1);for(var n=0;n<this.totalData;n++){var r=this.data[n];r.key===t&&(r.end=e,i&&(r.start=r.current))}return this},restart:function(){return this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0,this.state===h.ACTIVE?this.seek(0):this.state===h.REMOVED?(this.seek(0),this.parent.makeActive(this),this):this.state===h.PENDING_ADD?this:this.play()},calcDuration:function(){for(var t=0,e=l.MAX_SAFE_INTEGER,i=this.data,n=0;n<this.totalData;n++){var r=i[n];r.t1=r.duration+r.hold,r.yoyo&&(r.t1+=r.duration),r.t2=r.t1+r.repeatDelay,r.totalDuration=r.delay+r.t1,-1===r.repeat?r.totalDuration+=999999999999*r.t2:r.repeat>0&&(r.totalDuration+=r.t2*r.repeat),r.totalDuration>t&&(t=r.totalDuration),r.delay<e&&(e=r.delay)}this.duration=Math.max(t,.001),this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i<this.totalData;i++){var n=t[i],r=n.target,s=n.gen,o=n.key,a=n.index;n.delay=s.delay(r,o,0,a,e,this),n.duration=Math.max(s.duration(r,o,0,a,e,this),.001),n.hold=s.hold(r,o,0,a,e,this),n.repeat=s.repeat(r,o,0,a,e,this),n.repeatDelay=s.repeatDelay(r,o,0,a,e,this)}return this.calcDuration(),this.progress=0,this.totalProgress=0,this.elapsed=0,this.totalElapsed=0,this.state=h.INIT,!0},makeActive:function(){this.parent.makeActive(this),this.dispatchTweenEvent(s.TWEEN_ACTIVE,this.callbacks.onActive)},nextState:function(){this.loopCounter>0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(s.TWEEN_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(s.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED||(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED),this},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD?this:this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?(this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(t),this.state=h.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=h.ACTIVE,this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,n=this.totalTargets,r=0;r<i;r++){var s=e[r],o=s.target,a=s.key,l=s.index;s.progress=0,s.elapsed=0,s.repeatCounter=-1===s.repeat?999999999999:s.repeat,t?(s.start=s.getStartValue(o,a,s.start,l,n,this),s.end=s.getEndValue(o,a,s.end,l,n,this),s.current=s.start,s.state=h.PLAYING_FORWARD):s.state=h.PENDING_RENDER,s.delay>0&&(s.elapsed=s.delay,s.state=h.DELAY),s.getActiveValue&&(o[a]=s.getActiveValue(s.target,s.key,s.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){void 0===e&&(e=16.6),this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,n=this.totalTargets,r=0;r<this.totalData;r++){var s=i[r],o=s.target,a=s.gen,l=s.key,c=s.index;s.progress=0,s.elapsed=0,s.repeatCounter=-1===s.repeat?999999999999:s.repeat,s.delay=a.delay(o,l,0,c,n,this),s.duration=Math.max(a.duration(o,l,0,c,n,this),.001),s.hold=a.hold(o,l,0,c,n,this),s.repeat=a.repeat(o,l,0,c,n,this),s.repeatDelay=a.repeatDelay(o,l,0,c,n,this),s.current=s.start,s.state=h.PLAYING_FORWARD,this.updateTweenData(this,s,0,c,n),s.delay>0&&(s.elapsed=s.delay,s.state=h.DELAY)}this.calcDuration();var u=!1;this.state===h.PAUSED&&(u=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress<t);return this.isSeeking=!1,u&&(this.state=h.PAUSED),this},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){return void 0===t&&(t=0),t?(this.state=h.COMPLETE_DELAY,this.countdown=t):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(s.TWEEN_COMPLETE,this.callbacks.onComplete)),this},remove:function(){return this.parent.remove(this),this},stop:function(t){return this.state===h.ACTIVE&&void 0!==t&&this.seek(t),this.state!==h.REMOVED&&(this.state!==h.PAUSED&&this.state!==h.PENDING_ADD||(this.parentIsTimeline?(this.parent.manager._destroy.push(this),this.parent.manager._toProcess++):(this.parent._destroy.push(this),this.parent._toProcess++)),this.dispatchTweenEvent(s.TWEEN_STOP,this.callbacks.onStop),this.removeAllListeners(),this.state=h.PENDING_REMOVE),this},update:function(t,e){if(this.state===h.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case h.ACTIVE:this.hasStarted||this.isSeeking||(this.startDelay-=e,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchTweenEvent(s.TWEEN_START,this.callbacks.onStart)));for(var i=!1,n=0;n<this.totalData;n++){var r=this.data[n];this.updateTweenData(this,r,e)&&(i=!0)}i||this.nextState();break;case h.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=h.ACTIVE,this.dispatchTweenEvent(s.TWEEN_LOOP,this.callbacks.onLoop));break;case h.OFFSET_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=h.ACTIVE);break;case h.COMPLETE_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(s.TWEEN_COMPLETE,this.callbacks.onComplete))}return this.state===h.PENDING_REMOVE},dispatchTweenDataEvent:function(t,e,i){this.isSeeking||(this.emit(t,this,i.key,i.target,i.current,i.previous),e&&(e.params[1]=i.target,e.func.apply(e.scope,e.params)))},dispatchTweenEvent:function(t,e){this.isSeeking||(this.emit(t,this,this.targets),e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)))},setStateFromEnd:function(t,e,i){return e.yoyo?(e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),this.dispatchTweenDataEvent(s.TWEEN_YOYO,t.callbacks.onYoyo,e),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),h.PLAYING_BACKWARD):e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(s.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(s.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var n=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!n){e.state=h.COMPLETE;break}var r=e.elapsed,o=e.duration,a=0;(r+=i)>o&&(a=r-o,r=o);var l=e.state===h.PLAYING_FORWARD,c=r/o;if(e.elapsed=r,e.progress=c,e.previous=e.current,1===c)l?(e.current=e.end,n[e.key]=e.end,e.hold>0?(e.elapsed=e.hold-a,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,a)):(e.current=e.start,n[e.key]=e.start,e.state=this.setStateFromStart(t,e,a));else{var u=l?e.ease(c):e.ease(1-c);e.current=e.start+(e.end-e.start)*u,n[e.key]=e.current}this.dispatchTweenDataEvent(s.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(s.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:n?(e.start=e.getStartValue(n,e.key,n[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(n,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,n[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});c.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onStop","onUpdate","onYoyo"],a.register("tween",(function(t){return this.scene.sys.tweens.add(t)})),o.register("tween",(function(t){return this.scene.sys.tweens.create(t)})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={TIMELINE_COMPLETE:i(1459),TIMELINE_LOOP:i(1460),TIMELINE_PAUSE:i(1461),TIMELINE_RESUME:i(1462),TIMELINE_START:i(1463),TIMELINE_UPDATE:i(1464),TWEEN_ACTIVE:i(1465),TWEEN_COMPLETE:i(1466),TWEEN_LOOP:i(1467),TWEEN_REPEAT:i(1468),TWEEN_START:i(1469),TWEEN_STOP:i(1470),TWEEN_UPDATE:i(1471),TWEEN_YOYO:i(1472)}},function(t,e){t.exports=function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){return{target:t,index:e,key:i,getActiveValue:s,getEndValue:n,getStartValue:r,ease:o,duration:0,totalDuration:0,delay:0,yoyo:l,hold:0,repeat:0,repeatDelay:0,flipX:p,flipY:f,progress:0,elapsed:0,repeatCounter:0,start:0,previous:0,current:0,end:0,t1:0,t2:0,gen:{delay:a,duration:h,hold:c,repeat:u,repeatDelay:d},state:0}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(66);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(66);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n={};t.exports=n;var r=i(268);n._motionWakeThreshold=.18,n._motionSleepThreshold=.08,n._minBias=.9,n.update=function(t,e){for(var i=e*e*e,r=0;r<t.length;r++){var s=t[r],o=s.speed*s.speed+s.angularSpeed*s.angularSpeed;if(0===s.force.x&&0===s.force.y){var a=Math.min(s.motion,o),h=Math.max(s.motion,o);s.motion=n._minBias*a+(1-n._minBias)*h,s.sleepThreshold>0&&s.motion<n._motionSleepThreshold*i?(s.sleepCounter+=1,s.sleepCounter>=s.sleepThreshold&&n.set(s,!0)):s.sleepCounter>0&&(s.sleepCounter-=1)}else n.set(s,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,r=0;r<t.length;r++){var s=t[r];if(s.isActive){var o=s.collision,a=o.bodyA.parent,h=o.bodyB.parent;if(!(a.isSleeping&&h.isSleeping||a.isStatic||h.isStatic)&&(a.isSleeping||h.isSleeping)){var l=a.isSleeping&&!a.isStatic?a:h,c=l===a?h:a;!l.isStatic&&c.motion>n._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||r.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&r.trigger(t,"sleepEnd"))}},function(t,e,i){var n={};t.exports=n;var r=i(50);n.on=function(t,e,i){for(var n,r=e.split(" "),s=0;s<r.length;s++)n=r[s],t.events=t.events||{},t.events[n]=t.events[n]||[],t.events[n].push(i);return i},n.off=function(t,e,i){if(e){"function"==typeof e&&(i=e,e=r.keys(t.events).join(" "));for(var n=e.split(" "),s=0;s<n.length;s++){var o=t.events[n[s]],a=[];if(i&&o)for(var h=0;h<o.length;h++)o[h]!==i&&a.push(o[h]);t.events[n[s]]=a}}else t.events={}},n.trigger=function(t,e,i){var n,s,o,a,h=t.events;if(h&&r.keys(h).length>0){i||(i={}),n=e.split(" ");for(var l=0;l<n.length;l++)if(o=h[s=n[l]]){(a=r.clone(i,!1)).name=s,a.source=t;for(var c=0;c<o.length;c++)o[c].apply(t,[a])}}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={AlignTo:i(599),Angle:i(600),Call:i(601),GetFirst:i(602),GetLast:i(603),GridAlign:i(604),IncAlpha:i(654),IncX:i(655),IncXY:i(656),IncY:i(657),PlaceOnCircle:i(658),PlaceOnEllipse:i(659),PlaceOnLine:i(660),PlaceOnRectangle:i(661),PlaceOnTriangle:i(662),PlayAnimation:i(663),PropertyValueInc:i(44),PropertyValueSet:i(27),RandomCircle:i(664),RandomEllipse:i(665),RandomLine:i(666),RandomRectangle:i(667),RandomTriangle:i(668),Rotate:i(669),RotateAround:i(670),RotateAroundDistance:i(671),ScaleX:i(672),ScaleXY:i(673),ScaleY:i(674),SetAlpha:i(675),SetBlendMode:i(676),SetDepth:i(677),SetHitArea:i(678),SetOrigin:i(679),SetRotation:i(680),SetScale:i(681),SetScaleX:i(682),SetScaleY:i(683),SetScrollFactor:i(684),SetScrollFactorX:i(685),SetScrollFactorY:i(686),SetTint:i(687),SetVisible:i(688),SetX:i(689),SetXY:i(690),SetY:i(691),ShiftPosition:i(692),Shuffle:i(693),SmootherStep:i(694),SmoothStep:i(695),Spread:i(696),ToggleVisible:i(697),WrapInRectangle:i(698)}},function(t,e,i){
|
|
/**
|
|
* @author samme
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(122),r=[];r[n.BOTTOM_CENTER]=i(271),r[n.BOTTOM_LEFT]=i(272),r[n.BOTTOM_RIGHT]=i(273),r[n.LEFT_BOTTOM]=i(274),r[n.LEFT_CENTER]=i(275),r[n.LEFT_TOP]=i(276),r[n.RIGHT_BOTTOM]=i(277),r[n.RIGHT_CENTER]=i(278),r[n.RIGHT_TOP]=i(279),r[n.TOP_CENTER]=i(280),r[n.TOP_LEFT]=i(281),r[n.TOP_RIGHT]=i(282),t.exports=function(t,e,i,n,s){return r[i](t,e,n,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(40),r=i(84),s=i(85),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)+i),o(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(40),r=i(41),s=i(52),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)-i),o(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(40),r=i(42),s=i(53),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)+i),o(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(40),r=i(41),s=i(54),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)-i),s(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(86),r=i(41),s=i(87),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)-i),s(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(41),r=i(43),s=i(53),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)-i),o(t,r(e)-a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(40),r=i(42),s=i(54),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(86),r=i(42),s=i(87),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(42),r=i(43),s=i(52),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)+i),o(t,r(e)-a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(84),r=i(43),s=i(54),o=i(85);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),s(t,r(e)-a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(41),r=i(43),s=i(54),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),s(t,r(e)-a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(42),r=i(43),s=i(54),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),s(t,r(e)-a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(122),r=[];r[n.BOTTOM_CENTER]=i(284),r[n.BOTTOM_LEFT]=i(285),r[n.BOTTOM_RIGHT]=i(286),r[n.CENTER]=i(287),r[n.LEFT_CENTER]=i(289),r[n.RIGHT_CENTER]=i(290),r[n.TOP_CENTER]=i(291),r[n.TOP_LEFT]=i(292),r[n.TOP_RIGHT]=i(293),r[n.LEFT_BOTTOM]=r[n.BOTTOM_LEFT],r[n.LEFT_TOP]=r[n.TOP_LEFT],r[n.RIGHT_BOTTOM]=r[n.BOTTOM_RIGHT],r[n.RIGHT_TOP]=r[n.TOP_RIGHT],t.exports=function(t,e,i,n,s){return r[i](t,e,n,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(40),r=i(84),s=i(54),o=i(85);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(40),r=i(41),s=i(54),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)-i),s(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(40),r=i(42),s=i(54),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(288),r=i(84),s=i(86);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i,s(e)+o),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(85),r=i(87);t.exports=function(t,e,i){return n(t,e),r(t,i)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(86),r=i(41),s=i(87),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)-i),s(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(86),r=i(42),s=i(87),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(84),r=i(43),s=i(85),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)+i),o(t,r(e)-a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(41),r=i(43),s=i(52),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)-i),o(t,r(e)-a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(42),r=i(43),s=i(53),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)+i),o(t,r(e)-a),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(165),r=i(95),s=i(14),o=i(4);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=r(e,0,s.PI2);return n(t,a,i)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(296),r=i(165),s=i(95),o=i(14);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=n(t)/i);for(var h=0;h<e;h++){var l=s(h/e,0,o.PI2);a.push(r(t,l))}return a}},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(34),r={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(167),r=i(128);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=r(t)/i);for(var o=0;o<e;o++){var a=o/e;s.push(n(t,a))}return s}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e){t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*r-a*s+e,t.y=o*s+a*r+i,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(304),r=i(305),s={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&(this.texture||this.shader)&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new r(this.scene,t)}};t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(22),s=i(88),o=new n({initialize:function(t,e){var i=t.sys.renderer;this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,this.createMask(),t.sys.game.events.on(r.CONTEXT_RESTORED,this.createMask,this),i.on(s.RESIZE,this.createMask,this)},createMask:function(){var t=this.renderer;if(t.gl){this.mainTexture&&this.clearMask();var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),r=t.gl,s=n?r.REPEAT:r.CLAMP_TO_EDGE,o=r.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,s,s,r.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,s,s,r.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!0),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!0)}},clearMask:function(){var t=this.renderer;t.gl&&this.mainTexture&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null)},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.clearMask(),this.renderer.off(s.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,r=this.geometryMask,s=t.maskCount;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,s,255),n.stencilOp(n.KEEP,n.KEEP,n.INCR)):(n.stencilFunc(n.EQUAL,s+1,255),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),r.renderWebGL(t,r,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),i?this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s+1,255):n.stencilFunc(n.EQUAL,s+1,255):this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s,255):n.stencilFunc(n.EQUAL,s,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var n=t.maskStack[t.maskStack.length-1];n.mask.applyStencil(t,n.camera,!1),t.currentCameraMask.mask!==n.mask?(i.mask=n.mask,i.camera=n.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14),r=i(25),s=i(174),o=i(265),a=i(266),h=i(3),l={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=o(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i||(i=new h),n||(n=this.scene.sys.cameras.main);var r=n.scrollX,o=n.scrollY,a=t+r*this.scrollFactorX-r,l=e+o*this.scrollFactorY-o;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,l,i):s(a,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={CHANGE_DATA:i(636),CHANGE_DATA_KEY:i(637),DESTROY:i(638),REMOVE_DATA:i(639),SET_DATA:i(640)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(128),r=i(4);t.exports=function(t,e,i,s){if(void 0===s&&(s=[]),!e&&!i)return s;e?i=Math.round(n(t)/e):e=n(t)/i;for(var o=t.x,a=t.y,h=0,l=0;l<i;l++)switch(s.push(new r(o,a)),h){case 0:(o+=e)>=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return s}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var n=Math.round(t.x1),r=Math.round(t.y1),s=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(s-n),h=Math.abs(o-r),l=n<s?1:-1,c=r<o?1:-1,u=a-h;i.push({x:n,y:r});for(var d=1;n!==s||r!==o;){var p=u<<1;p>-h&&(u-=h,n+=l),p<a&&(u+=a,r+=c),d%e==0&&i.push({x:n,y:r}),d++}return i}},function(t,e){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,r,s=1;if(i){if(t<e[0][i])return e[0];for(;e[s][i]<t;)s++}else for(;e[s]<t;)s++;return s>e.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e,i,n,r){void 0===r&&(r=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=r},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e){t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(182),r=i(0),s=i(99),o=i(9),a=i(130),h=i(22),l=i(2),c=i(6),u=i(183),d=i(316),p=new r({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new s,this.mixes=new s,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var n=this.anims,r=this.mixes,s="string"==typeof t?t:t.key,o="string"==typeof e?e:e.key;if(n.has(s)&&n.has(o)){var a=r.get(s);a||(a={}),a[o]=i,r.set(s,a)}return this},removeMix:function(t,e){var i=this.mixes,n="string"==typeof t?t:t.key,r=i.get(n);if(r)if(e){var s="string"==typeof e?e:e.key;r.hasOwnProperty(s)&&delete r[s]}else e||i.delete(n);return this},getMix:function(t,e){var i=this.mixes,n="string"==typeof t?t:t.key,r="string"==typeof e?e:e.key,s=i.get(n);return s&&s.hasOwnProperty(r)?s[r]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e){var i=[],n=this.game.cache.json.get(t);if(!n)return i;var r=this,s=c(n,"meta",null),o=c(n,"frames",null);return s&&o&&c(s,"frameTags",[]).forEach((function(n){var s=[],a=l(n,"name",null),h=l(n,"from",0),c=l(n,"to",0),u=l(n,"direction","forward");if(a&&(!e||e&&e.indexOf(a)>-1)){for(var d=[],p=Number.MAX_SAFE_INTEGER,f=h;f<=c;f++){var m=f.toString(),g=o[m];if(g){var v=l(g,"duration",Number.MAX_SAFE_INTEGER);v<p&&(p=v),d.push({frame:m,duration:v})}}d.forEach((function(e){s.push({key:t,frame:e.frame,duration:p-e.duration})}));var y=p*s.length;"reverse"===u&&(s=s.reverse());var x={key:a,frames:s,duration:y,yoyo:"pingpong"===u},b=r.create(x);b&&i.push(b)}})),i},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new n(this,e,t),this.anims.set(e,i),this.emit(a.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var n=0;n<t.anims.length;n++)i.push(this.create(t.anims[n]));t.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=t.globalTimeScale)}else t.hasOwnProperty("key")&&"frame"===t.type&&i.push(this.create(t));return i},generateFrameNames:function(t,e){var i,n=c(e,"prefix",""),r=c(e,"start",0),s=c(e,"end",0),o=c(e,"suffix",""),a=c(e,"zeroPad",0),h=c(e,"outputArray",[]),l=c(e,"frames",!1),p=this.textureManager.get(t);if(!p)return h;if(e)for(l||(l=d(r,s)),i=0;i<l.length;i++){var f=n+u(l[i],a,"0",1)+o;p.has(f)?h.push({key:t,frame:f}):console.warn("generateFrameNames: Frame missing: "+f+" from texture: "+t)}else for(l=p.getFrameNames(),i=0;i<l.length;i++)h.push({key:t,frame:l[i]});return h},generateFrameNumbers:function(t,e){var i=c(e,"start",0),n=c(e,"end",-1),r=c(e,"first",!1),s=c(e,"outputArray",[]),o=c(e,"frames",!1),a=this.textureManager.get(t);if(!a)return s;r&&a.has(r)&&s.push({key:t,frame:r}),o||(-1===n&&(n=a.frameTotal-2),o=d(i,n));for(var h=0;h<o.length;h++)a.has(o[h])?s.push({key:t,frame:o[h]}):console.warn("generateFrameNumbers: Frame "+h+" missing from texture: "+t);return s},get:function(t){return this.anims.get(t)},pauseAll:function(){return this.paused||(this.paused=!0,this.emit(a.PAUSE_ALL)),this},play:function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)e[i].anims.play(t);return this},staggerPlay:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=!0),Array.isArray(e)||(e=[e]);var r=e.length;n||r--;for(var s=0;s<e.length;s++){var o=i<0?Math.abs(i)*(r-s):i*s;e[s].anims.playAfterDelay(t,o)}return this},remove:function(t){var e=this.get(t);return e&&(this.emit(a.REMOVE_ANIMATION,t,e),this.anims.delete(t),this.removeMix(t)),e},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit(a.RESUME_ALL)),this},toJSON:function(t){var e={anims:[],globalTimeScale:this.globalTimeScale};return void 0!==t&&""!==t?e.anims.push(this.anims.get(t).toJSON()):this.anims.each((function(t,i){e.anims.push(i.toJSON())})),e},destroy:function(){this.anims.clear(),this.mixes.clear(),this.textureManager=null,this.game=null}});t.exports=p},function(t,e){t.exports=function(t,e,i,n){var r,s=[],o=!1;if((i||n)&&(o=!0,i||(i=""),n||(n="")),e<t)for(r=t;r>=e;r--)o?s.push(i+r.toString()+n):s.push(r);else for(r=t;r<=e;r++)o?s.push(i+r.toString()+n):s.push(r);return s}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(99),s=i(9),o=i(318),a=new n({initialize:function(){this.entries=new r,this.events=new s},add:function(t,e){return this.entries.set(t,e),this.events.emit(o.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(o.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ADD:i(712),REMOVE:i(713)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(317),r=i(0),s=i(22),o=new r({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.video=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once(s.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e<t.length;e++)this[t[e]].destroy(),this[t[e]]=null;for(var i in this.custom)this.custom[i].destroy();this.custom=null,this.game=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(131),r=i(187),s=i(18),o=i(0),a=i(11),h=i(327),l=i(36),c=i(133),u=i(10),d=i(3),p=new o({Extends:n,Mixins:[a.Flip,a.Tint,a.Pipeline],initialize:function(t,e,i,r){n.call(this,t,e,i,r),this.postPipelines=[],this.pipelineData={},this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new u(0,0,t,e),this._follow){var i=this.width/2,n=this.height/2,s=this._follow.x-this.followOffset.x,o=this._follow.y-this.followOffset.y;this.midPoint.set(s,o),this.scrollX=s-i,this.scrollY=o-n}r(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,n,r,s){return this.fadeEffect.start(!1,t,e,i,n,!0,r,s)},fadeOut:function(t,e,i,n,r,s){return this.fadeEffect.start(!0,t,e,i,n,!0,r,s)},fadeFrom:function(t,e,i,n,r,s,o){return this.fadeEffect.start(!1,t,e,i,n,r,s,o)},fade:function(t,e,i,n,r,s,o){return this.fadeEffect.start(!0,t,e,i,n,r,s,o)},flash:function(t,e,i,n,r,s,o){return this.flashEffect.start(t,e,i,n,r,s,o)},shake:function(t,e,i,n,r){return this.shakeEffect.start(t,e,i,n,r)},pan:function(t,e,i,n,r,s,o){return this.panEffect.start(t,e,i,n,r,s,o)},rotateTo:function(t,e,i,n,r,s,o){return this.rotateToEffect.start(t,e,i,n,r,s,o)},zoomTo:function(t,e,i,n,r,s){return this.zoomEffect.start(t,e,i,n,r,s)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,n=.5*e,s=this.zoom,o=this.matrix,a=t*this.originX,h=e*this.originY,u=this._follow,d=this.deadzone,p=this.scrollX,f=this.scrollY;d&&r(d,this.midPoint.x,this.midPoint.y);var m=!1;if(u&&!this.panEffect.isRunning){var g=u.x-this.followOffset.x,v=u.y-this.followOffset.y;d?(g<d.x?p=c(p,p-(d.x-g),this.lerp.x):g>d.right&&(p=c(p,p+(g-d.right),this.lerp.x)),v<d.y?f=c(f,f-(d.y-v),this.lerp.y):v>d.bottom&&(f=c(f,f+(v-d.bottom),this.lerp.y))):(p=c(p,g-a,this.lerp.x),f=c(f,v-h,this.lerp.y)),m=!0}this.useBounds&&(p=this.clampX(p),f=this.clampY(f)),this.roundPixels&&(a=Math.round(a),h=Math.round(h),p=Math.round(p),f=Math.round(f)),this.scrollX=p,this.scrollY=f;var y=p+i,x=f+n;this.midPoint.set(y,x);var b=t/s,w=e/s,T=y-b/2,_=x-w/2;this.roundPixels&&(T=Math.round(T),_=Math.round(_)),this.worldView.setTo(T,_,b,w),o.applyITRS(this.x+a,this.y+h,this.rotation,s,s),o.translate(-a,-h),this.shakeEffect.preRender(),m&&this.emit(l.FOLLOW_UPDATE,this,u)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,r,o){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===r&&(r=0),void 0===o&&(o=r),this._follow=t,this.roundPixels=e,i=s(i,0,1),n=s(n,0,1),this.lerp.set(i,n),this.followOffset.set(r,o);var a=this.width/2,h=this.height/2,l=t.x-r,c=t.y-o;return this.midPoint.set(l,c),this.scrollX=l-a,this.scrollY=c-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=p},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(37);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return e+e+i+i+n+n}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var r=parseInt(i[1],16),s=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(r,s,o)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var r=Math.min(t,e,i),s=Math.max(t,e,i),o=s-r,a=0,h=0===s?0:o/s,l=s;return s!==r&&(s===t?a=(e-i)/o+(e<i?6:0):s===e?a=(i-t)/o+2:s===i&&(a=(t-e)/o+4),a/=6),n.hasOwnProperty("_h")?(n._h=a,n._s=h,n._v=l):(n.h=a,n.s=h,n.v=l),n}},function(t,e){t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(37);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(37);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var r=parseInt(i[1],10),s=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(r,s,o,255*a)}return e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Fade:i(737),Flash:i(738),Pan:i(739),Shake:i(772),RotateTo:i(773),Zoom:i(774)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(740),Out:i(741),InOut:i(742)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(743),Out:i(744),InOut:i(745)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(746),Out:i(747),InOut:i(748)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(749),Out:i(750),InOut:i(751)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(752),Out:i(753),InOut:i(754)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(755),Out:i(756),InOut:i(757)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports=i(758)},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(759),Out:i(760),InOut:i(761)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(762),Out:i(763),InOut:i(764)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(765),Out:i(766),InOut:i(767)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={In:i(768),Out:i(769),InOut:i(770)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports=i(771)},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(32),s=i(341),o=i(2),a=i(6),h=i(7),l=i(190),c=i(1),u=i(194),d=i(184),p=new n({initialize:function(t){void 0===t&&(t={}),this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",r.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=a(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=a(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=a(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=a(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=a(t,"input.touch",s.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio",{}),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.pipeline=a(i,"pipeline",null),this.antialias=a(i,"antialias",!0),this.antialiasGL=a(i,"antialiasGL",!0),this.mipmapFilter=a(i,"mipmapFilter","LINEAR"),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",4096),this.maxTextures=a(i,"maxTextures",-1),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",c),this.postBoot=a(t,"callbacks.postBoot",c),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path","");var p=s.os.android?6:32;this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",p),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.loaderWithCredentials=a(t,"loader.withCredentials",!1),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),m=u.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?m=f.default:Array.isArray(f.defaultMerge)&&(m=m.concat(f.defaultMerge)))),this.defaultPlugins=m;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=a(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=r.WEBGL:window.FORCE_CANVAS&&(this.renderType=r.CANVAS))}});t.exports=p},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={os:i(102),browser:i(134),features:i(188),input:i(805),audio:i(806),video:i(807),fullscreen:i(808),canvasFeatures:i(342)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n,r,s,o=i(31),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(s=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(s,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+r},s.src=n+"AP804Oa6"+r,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},function(t,e){t.exports=function(t,e,i,n){var r=t-i,s=e-n;return r*r+s*s}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t<e+i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(351);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e){t.exports=function(t,e,i,n,r){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}},function(t,e){t.exports=function(t,e,i,n){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(181);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<<Math.ceil(e)}},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=l*s-o*h,u=-l*r+o*a,d=h*r-s*a,p=e*c+i*u+n*d;return p?(p=1/p,t[0]=c*p,t[1]=(-l*i+n*h)*p,t[2]=(o*i-n*s)*p,t[3]=u*p,t[4]=(l*e-n*a)*p,t[5]=(-o*e+n*r)*p,t[6]=d*p,t[7]=(-h*e+i*a)*p,t[8]=(s*e-i*r)*p,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=s*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*s,t[3]=o*a-r*l,t[4]=e*l-n*a,t[5]=n*r-e*o,t[6]=r*h-s*a,t[7]=i*a-e*h,t[8]=e*s-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*s-o*h)+i*(-l*r+o*a)+n*(h*r-s*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],c=e[8],u=t.val,d=u[0],p=u[1],f=u[2],m=u[3],g=u[4],v=u[5],y=u[6],x=u[7],b=u[8];return e[0]=d*i+p*s+f*h,e[1]=d*n+p*o+f*l,e[2]=d*r+p*a+f*c,e[3]=m*i+g*s+v*h,e[4]=m*n+g*o+v*l,e[5]=m*r+g*a+v*c,e[6]=y*i+x*s+b*h,e[7]=y*n+x*o+b*l,e[8]=y*r+x*a+b*c,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*s,e[1]=l*n+h*o,e[2]=l*r+h*a,e[3]=l*s-h*i,e[4]=l*o-h*n,e[5]=l*a-h*r,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,o=i+i,a=n+n,h=e*s,l=e*o,c=e*a,u=i*o,d=i*a,p=n*a,f=r*s,m=r*o,g=r*a,v=this.val;return v[0]=1-(u+p),v[3]=l+g,v[6]=c-m,v[1]=l-g,v[4]=1-(h+p),v[7]=d+f,v[2]=c+m,v[5]=d-f,v[8]=1-(h+u),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],v=e[14],y=e[15],x=n*h-r*a,b=n*l-s*a,w=n*c-o*a,T=r*l-s*h,_=r*c-o*h,E=s*c-o*l,S=u*g-d*m,M=u*v-p*m,A=u*y-f*m,C=d*v-p*g,P=d*y-f*g,R=p*y-f*v,L=x*R-b*P+w*C+T*A-_*M+E*S;return L?(L=1/L,i[0]=(h*R-l*P+c*C)*L,i[1]=(l*A-a*R-c*M)*L,i[2]=(a*P-h*A+c*S)*L,i[3]=(s*P-r*R-o*C)*L,i[4]=(n*R-s*A+o*M)*L,i[5]=(r*A-n*P-o*S)*L,i[6]=(g*E-v*_+y*T)*L,i[7]=(v*w-m*E-y*b)*L,i[8]=(m*_-g*w+y*x)*L,this):null}});t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(358),s=i(1),o=i(38),a=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),l=new o(1,0,0),c=new o(0,1,0),u=new o,d=new r,p=new n({initialize:function(t,e,i,n){this.onChangeCallback=s,this.set(t,e,i,n)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,n,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=n||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=n*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.set(i+e*(t.x-i),n+e*(t.y-n),r+e*(t.z-r),s+e*(t.w-s))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(l).cross(t).length()<1e-6&&u.copy(c).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?this.set(0,0,0,1):(u.copy(t).cross(e),this._x=u.x,this._y=u.y,this._z=u.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var n=d.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(d).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,o=t.y,a=t.z,h=t.w;return this.set(e*h+r*s+i*a-n*o,i*h+r*o+n*s-e*a,n*h+r*a+e*o-i*s,r*h-e*s-i*o-n*a)},slerp:function(t,e){var i=this.x,n=this.y,r=this.z,s=this.w,o=t.x,a=t.y,h=t.z,l=t.w,c=i*o+n*a+r*h+s*l;c<0&&(c=-c,o=-o,a=-a,h=-h,l=-l);var u=1-e,d=e;if(1-c>1e-6){var p=Math.acos(c),f=Math.sin(p);u=Math.sin((1-e)*p)/f,d=Math.sin(e*p)/f}return this.set(u*i+d*o,u*n+d*a,u*r+d*h,u*s+d*l)},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n,s=r?1/r:0;return this.set(-t*s,-e*s,-i*s,n*s)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.set(e*o+r*s,i*o+n*s,n*o-i*s,r*o-e*s)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.set(e*o-n*s,i*o+r*s,n*o+e*s,r*o-i*s)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.set(e*o+i*s,i*o-e*s,n*o+r*s,r*o-n*s)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,n=t.y/2,r=t.z/2,s=Math.cos(i),o=Math.cos(n),a=Math.cos(r),h=Math.sin(i),l=Math.sin(n),c=Math.sin(r);switch(t.order){case"XYZ":this.set(h*o*a+s*l*c,s*l*a-h*o*c,s*o*c+h*l*a,s*o*a-h*l*c,e);break;case"YXZ":this.set(h*o*a+s*l*c,s*l*a-h*o*c,s*o*c-h*l*a,s*o*a+h*l*c,e);break;case"ZXY":this.set(h*o*a-s*l*c,s*l*a+h*o*c,s*o*c+h*l*a,s*o*a-h*l*c,e);break;case"ZYX":this.set(h*o*a-s*l*c,s*l*a+h*o*c,s*o*c-h*l*a,s*o*a+h*l*c,e);break;case"YZX":this.set(h*o*a+s*l*c,s*l*a+h*o*c,s*o*c-h*l*a,s*o*a-h*l*c,e);break;case"XZY":this.set(h*o*a-s*l*c,s*l*a-h*o*c,s*o*c+h*l*a,s*o*a+h*l*c,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,n=i[0],r=i[4],s=i[8],o=i[1],a=i[5],h=i[9],l=i[2],c=i[6],u=i[10],d=n+a+u;return d>0?(e=.5/Math.sqrt(d+1),this.set((c-h)*e,(s-l)*e,(o-r)*e,.25/e)):n>a&&n>u?(e=2*Math.sqrt(1+n-a-u),this.set(.25*e,(r+o)/e,(s+l)/e,(c-h)/e)):a>u?(e=2*Math.sqrt(1+a-n-u),this.set((r+o)/e,.25*e,(h+c)/e,(s-l)/e)):(e=2*Math.sqrt(1+u-n-a),this.set((s+l)/e,(h+c)/e,.25*e,(o-r)/e)),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var s=a[r],o=a[s];e=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*o+o]+1),h[r]=.5*e,e=.5/e,h[s]=(i[3*s+r]+i[3*r+s])*e,h[o]=(i[3*o+r]+i[3*r+o])*e,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(i[3*o+s]-i[3*s+o])*e}return this.onChangeCallback(this),this}});t.exports=p},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(361),r=i(31),s=i(32),o=i(188);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===s.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==s.HEADLESS)if(e.renderType===s.CANVAS||e.renderType!==s.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=s.CANVAS}else e.renderType=s.WEBGL;e.antialias||r.disableSmoothing();var a,h,l=t.scale.baseSize,c=l.width,u=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=c,t.canvas.height=u):t.canvas=r.create(t,c,u,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==s.HEADLESS&&(a=i(362),h=i(365),e.renderType===s.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(36),r=i(363),s=i(0),o=i(32),a=i(9),h=i(88),l=i(364),c=i(101),u=i(103),d=i(25),p=new s({Extends:a,initialize:function(t){a.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(u.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(c.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var r=e.length;this.emit(h.RENDER,t,i);var s=i.x,o=i.y,a=i.width,l=i.height,c=i.renderToTexture?i.context:t.sys.context;c.save(),this.game.scene.customViewports&&(c.beginPath(),c.rect(s,o,a,l),c.clip()),this.currentContext=c;var u=i.mask;u&&u.preRenderCanvas(this,null,i._maskCamera),i.transparent||(c.fillStyle=i.backgroundColor.rgba,c.fillRect(s,o,a,l)),c.globalAlpha=i.alpha,c.globalCompositeOperation="source-over",this.drawCount+=r,i.renderToTexture&&i.emit(n.PRE_RENDER,i),i.matrix.copyToContext(c);for(var d=0;d<r;d++){var p=e[d];p.mask&&p.mask.preRenderCanvas(this,p,i),p.renderCanvas(this,p,i),p.mask&&p.mask.postRenderCanvas(this,p,i)}c.setTransform(1,0,0,1,0,0),c.globalCompositeOperation="source-over",c.globalAlpha=1,i.flashEffect.postRenderCanvas(c),i.fadeEffect.postRenderCanvas(c),i.dirty=!1,u&&u.postRenderCanvas(this),c.restore(),i.renderToTexture&&(i.emit(n.POST_RENDER,i),i.renderToGame&&t.sys.context.drawImage(i.canvas,s,o))},postRender:function(){this.gameContext.restore(),this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(r(this.gameCanvas,t),t.callback=null)},snapshotCanvas:function(t,e,i,n,s,o,a,h,l){void 0===i&&(i=!1),this.snapshotArea(n,s,o,a,e,h,l);var c=this.snapshotState;return c.getPixel=i,r(this.canvas,c),c.callback=null,this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gameCanvas.width,this.gameCanvas.height,t,e,i)},snapshotArea:function(t,e,i,n,r,s,o){var a=this.snapshotState;return a.callback=r,a.type=s,a.encoder=o,a.getPixel=!1,a.x=t,a.y=e,a.width=Math.min(i,this.gameCanvas.width),a.height=Math.min(n,this.gameCanvas.height),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},batchSprite:function(t,e,i,n){var r=i.alpha*t.alpha;if(0!==r){var s=this.currentContext,o=this._tempMatrix1,a=this._tempMatrix2,h=e.canvasData,l=h.x,c=h.y,u=e.cutWidth,d=e.cutHeight,p=e.customPivot,f=e.source.resolution,m=t.displayOriginX,g=t.displayOriginY,v=-m+e.x,y=-g+e.y;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||e.updateCropUVs(x,t.flipX,t.flipY),u=x.cw,d=x.ch,l=x.cx,c=x.cy,v=-m+x.x,y=-g+x.y,t.flipX&&(v>=0?v=-(v+u):v<0&&(v=Math.abs(v)-u)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var b=1,w=1;t.flipX&&(p||(v+=-e.realWidth+2*m),b=-1),t.flipY&&(p||(y+=-e.realHeight+2*g),w=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*b,t.scaleY*w),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY),o.multiply(a),s.save(),o.setToContext(s),s.globalCompositeOperation=this.blendModes[t.blendMode],s.globalAlpha=r,s.imageSmoothingEnabled=!(!this.antialias||e.source.scaleMode),t.mask&&t.mask.preRenderCanvas(this,t,i),s.drawImage(e.source.image,l,c,u,d,v,y,u/f,d/f),t.mask&&t.mask.postRenderCanvas(this,t,i),s.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(31),r=i(37),s=i(2);t.exports=function(t,e){var i=s(e,"callback"),o=s(e,"type","image/png"),a=s(e,"encoder",.92),h=Math.abs(Math.round(s(e,"x",0))),l=Math.abs(Math.round(s(e,"y",0))),c=s(e,"width",t.width),u=s(e,"height",t.height);if(s(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new r(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||c!==t.width||u!==t.height){var p=n.createWebGL(this,c,u);p.getContext("2d").drawImage(t,h,l,c,u,0,0,c,u);var f=new Image;f.onerror=function(){i.call(null),n.remove(p)},f.onload=function(){i.call(null,f),n.remove(p)},f.src=p.toDataURL(o,a)}else{var m=new Image;m.onerror=function(){i.call(null)},m.onload=function(){i.call(null,m)},m.src=t.toDataURL(o,a)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(34),r=i(342);t.exports=function(){var t=[],e=r.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(89),r=i(36),s=i(0),o=i(32),a=i(9),h=i(88),l=i(22),c=i(136),u=i(67),d=i(1),p=i(366),f=i(139),m=i(101),g=i(103),v=i(12),y=i(377),x=new s({Extends:a,initialize:function(t){a.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=o.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTexture=0,this.startActiveTexture=0,this.maxTextures=0,this.textureIndexes,this.tempTextures,this.textureZero,this.normalTexture,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.textureFlush=0,this.isTextureClean=!1,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.init(this.config)},init:function(t){var e,i=this.game,n=this.canvas,r=t.backgroundColor;if(!(e=i.config.context?i.config.context:n.getContext("webgl",t.contextCreation)||n.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var s=this;this.contextLostHandler=function(t){s.contextLost=!0,s.game.events.emit(l.CONTEXT_LOST,s),t.preventDefault()},this.contextRestoredHandler=function(){s.contextLost=!1,s.init(s.config),s.game.events.emit(l.CONTEXT_RESTORED,s)},n.addEventListener("webglcontextlost",this.contextLostHandler,!1),n.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var a=0;a<=27;a++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var h=e.getSupportedExtensions();t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var c="WEBGL_compressed_texture_",d="WEBKIT_"+c;this.compression.ETC1=e.getExtension(c+"etc1")||e.getExtension(d+"etc1"),this.compression.PVRTC=e.getExtension(c+"pvrtc")||e.getExtension(d+"pvrtc"),this.compression.S3TC=e.getExtension(c+"s3tc")||e.getExtension(d+"s3tc"),this.supportedExtensions=h,this.instancedArraysExtension=h.indexOf("ANGLE_instanced_arrays")>-1?e.getExtension("ANGLE_instanced_arrays"):null,this.vaoExtension=h.indexOf("OES_vertex_array_object")>-1?e.getExtension("OES_vertex_array_object"):null,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(r.redGL,r.greenGL,r.blueGL,r.alphaGL),this.mipmapFilter=e[t.mipmapFilter],this.maxTextures=v.checkShaderMax(e,t.maxTextures),this.textureIndexes=[];var f=this.tempTextures;if(Array.isArray(f))for(var m=0;a<this.maxTextures;m++)e.deleteTexture(f[m]);else f=new Array(this.maxTextures);for(var y=0;y<this.maxTextures;y++){var x=e.createTexture();e.activeTexture(e.TEXTURE0+y),e.bindTexture(e.TEXTURE_2D,x),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),f[y]=x,this.textureIndexes.push(y)}return this.tempTextures=f,this.currentActiveTexture=1,this.startActiveTexture++,e.activeTexture(e.TEXTURE1),this.pipelines=new p(this),this.setBlendMode(o.BlendModes.NORMAL),this.projectionMatrix=(new u).identity(),i.textures.once(g.READY,this.boot,this),this},boot:function(){var t=this.game,e=this.pipelines,i=t.scale.baseSize;this.width=i.width,this.height=i.height,this.isBooted=!0,this.renderTarget=new f(this,this.width,this.height,1,0,!0,!0),e.boot(t.config.pipeline),this.blankTexture=t.textures.getFrame("__DEFAULT"),this.whiteTexture=t.textures.getFrame("__WHITE");var n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,null),n.enable(n.SCISSOR_TEST),t.scale.on(m.RESIZE,this.onResize,this),this.resize(i.width,i.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},beginCapture:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.renderTarget.bind(!0,t,e),this.setProjectionMatrix(t,e),this.resetTextures()},endCapture:function(){return this.renderTarget.unbind(!0),this.resetProjectionMatrix(),this.renderTarget},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),i.viewport(0,0,t,e),this.drawingBufferHeight=i.drawingBufferHeight,i.scissor(0,i.drawingBufferHeight-e,t,e),this.defaultScissor[2]=t,this.defaultScissor[3]=e,this.emit(h.RESIZE,t,e),this},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e){return t===this.projectionWidth&&e===this.projectionHeight||(this.projectionWidth=t,this.projectionHeight=e,this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},resetProjectionMatrix:function(){this.projectionWidth=this.width,this.projectionHeight=this.height,this.projectionMatrix.ortho(0,this.width,this.height,0,-1e3,1e3)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},flush:function(){this.pipelines.flush()},pushScissor:function(t,e,i,n,r){void 0===r&&(r=this.drawingBufferHeight);var s=[t,e,i,n];return this.scissorStack.push(s),this.setScissor(t,e,i,n,r),this.currentScissor=s,s},setScissor:function(t,e,i,n,r){void 0===r&&(r=this.drawingBufferHeight);var s=this.gl,o=this.currentScissor,a=i>0&&n>0;if(o&&a){var h=o[0],l=o[1],c=o[2],u=o[3];a=h!==t||l!==e||c!==i||u!==n}a&&(this.flush(),s.scissor(t,r-e-n,i,n))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],n=e[1],r=e[2],s=e[3];r>0&&s>0&&t.scissor(i,this.drawingBufferHeight-n-s,r,s)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),n.func.length>2?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(){this.setTexture2D(this.blankTexture.glTexture)},setTextureSource:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t.glTexture,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter<this.startActiveTexture&&(t.glIndexCounter=this.startActiveTexture,i<this.maxTextures?(t.glIndex=i,e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,t.glTexture),this.currentActiveTexture++):(this.flush(),this.startActiveTexture++,this.textureFlush++,t.glIndexCounter=this.startActiveTexture,t.glIndex=1,e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,t.glTexture),this.currentActiveTexture=2)),this.isTextureClean=!1,t.glIndex},isNewNormalMap:function(t,e){return this.textureZero!==t||this.normalTexture!==e},setTextureZero:function(t,e){if(this.textureZero!==t){e&&this.flush();var i=this.gl;i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t),this.textureZero=t}},clearTextureZero:function(){this.textureZero=null},setNormalMap:function(t){if(this.normalTexture!==t){var e=this.gl;e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,t),this.normalTexture=t,1===this.currentActiveTexture&&(this.currentActiveTexture=2)}},clearNormalMap:function(){this.normalTexture=null,this.startActiveTexture++,this.currentActiveTexture=1,this.textureFlush++},unbindTextures:function(){for(var t=this.gl,e=this.tempTextures,i=0;i<e.length;i++)t.activeTexture(t.TEXTURE0+i),t.bindTexture(t.TEXTURE_2D,null);this.normalTexture=null,this.textureZero=null,this.currentActiveTexture=1,this.startActiveTexture++,this.textureFlush++},resetTextures:function(t){if(void 0===t&&(t=!1),!this.isTextureClean){this.flush();var e=this.gl,i=this.tempTextures;if(t){for(var n=0;n<i.length;n++)e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_2D,i[n]);e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,i[1]),this.isTextureClean=!0}else e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,i[0]),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,i[1]);this.normalTexture=null,this.textureZero=null,this.currentActiveTexture=1,this.startActiveTexture++,this.textureFlush++}},setTexture2D:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter<this.startActiveTexture&&(t.glIndexCounter=this.startActiveTexture,i<this.maxTextures?(t.glIndex=i,e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,t),this.currentActiveTexture++):(this.flush(),this.startActiveTexture++,this.textureFlush++,t.glIndexCounter=this.startActiveTexture,t.glIndex=1,e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,t),this.currentActiveTexture=2)),this.isTextureClean=!1,t.glIndex},pushFramebuffer:function(t,e,i,n){return t===this.currentFramebuffer?this:(this.fboStack.push(t),this.setFramebuffer(t,e,i,n))},setFramebuffer:function(t,e,i,n){if(void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=!0),t===this.currentFramebuffer)return this;var r=this.gl,s=this.width,o=this.height;return t&&t.renderTexture&&n?(s=t.renderTexture.width,o=t.renderTexture.height):this.flush(),r.bindFramebuffer(r.FRAMEBUFFER,t),n&&r.viewport(0,0,s,o),e&&(t?(this.drawingBufferHeight=o,this.pushScissor(0,0,s,o)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t,i&&this.resetTextures(),this},popFramebuffer:function(t,e,i){void 0===t&&(t=!1),void 0===e&&(e=!1),void 0===i&&(i=!0);var n=this.fboStack;n.pop();var r=n[n.length-1];return r||(r=null),this.setFramebuffer(r,t,e,i),r},setProgram:function(t){return t!==this.currentProgram&&(this.flush(),this.gl.useProgram(t),this.currentProgram=t,!0)},resetProgram:function(){return this.gl.useProgram(this.currentProgram),this},createTextureFromSource:function(t,e,i,n){var r=this.gl,s=r.NEAREST,a=r.NEAREST,h=r.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var l=c(e,i);return l&&(h=r.REPEAT),n===o.ScaleModes.LINEAR&&this.config.antialias&&(s=l?this.mipmapFilter:r.LINEAR,a=r.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,s,a,h,h,r.RGBA,t):this.createTexture2D(0,s,a,h,h,r.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,r,s,o,a,h,l,u,d){l=null==l||l,void 0===u&&(u=!1),void 0===d&&(d=!1);var p=this.gl,f=p.createTexture();p.activeTexture(p.TEXTURE0);var m=p.getParameter(p.TEXTURE_BINDING_2D);return p.bindTexture(p.TEXTURE_2D,f),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,e),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,i),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,r),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,n),p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,d),null==o?p.texImage2D(p.TEXTURE_2D,t,s,a,h,0,s,p.UNSIGNED_BYTE,null):(u||(a=o.width,h=o.height),p.texImage2D(p.TEXTURE_2D,t,s,s,p.UNSIGNED_BYTE,o)),c(a,h)&&p.generateMipmap(p.TEXTURE_2D),m&&p.bindTexture(p.TEXTURE_2D,m),f.isAlphaPremultiplied=l,f.isRenderTexture=!1,f.width=a,f.height=h,f.glIndex=0,f.glIndexCounter=-1,f},createFramebuffer:function(t,e,i,n){var r,s=this.gl,o=s.createFramebuffer();if(this.setFramebuffer(o),n){var a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,t,e),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,i,0),(r=s.checkFramebufferStatus(s.FRAMEBUFFER))!==s.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[r]);return o.renderTexture=i,this.setFramebuffer(null),this.resetTextures(),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),r=i.createShader(i.VERTEX_SHADER),s=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(r,t),i.shaderSource(s,e),i.compileShader(r),i.compileShader(s),!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Vertex Shader failed:\n"+i.getShaderInfoLog(r));if(!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Fragment Shader failed:\n"+i.getShaderInfoLog(s));if(i.attachShader(n,r),i.attachShader(n,s),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Link Program failed:\n"+i.getProgramInfoLog(n));return i.useProgram(n),n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,n),i.bufferData(i.ARRAY_BUFFER,t,e),i.bindBuffer(i.ARRAY_BUFFER,null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null),n},deleteTexture:function(t,e){return t&&this.gl.deleteTexture(t),e&&this.resetTextures(),this},deleteFramebuffer:function(t){return t&&(this.gl.deleteFramebuffer(t),n(this.fboStack,t),this.currentFramebuffer===t&&(this.currentFramebuffer=null)),this},deleteProgram:function(t){return t&&this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t.x,i=t.y,n=t.width,s=t.height,o=t.backgroundColor;t.emit(r.PRE_RENDER,t),this.pipelines.preBatchCamera(t),this.pushScissor(e,i,n,s),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),o.alphaGL>0&&this.pipelines.setMulti().drawFillRect(e,i,n,s,v.getTintFromFloats(o.blueGL,o.greenGL,o.redGL,1),o.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var n=this.pipelines.setMulti();e.postRenderWebGL(n,v.getTintFromFloats),i.postRenderWebGL(n,v.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(r.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.textureFlush=0,this.emit(h.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var n=e.length;if(this.emit(h.RENDER,t,i),this.preRenderCamera(i),0===n)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var r=this.currentMask,s=0;s<n;s++){this.finalType=s===n-1;var a=e[s],l=a.mask;(r=this.currentMask).mask&&r.mask!==l&&r.mask.postRenderWebGL(this,r.camera),l&&r.mask!==l&&l.preRenderWebGL(this,a,i),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode);var c=a.type;c!==this.currentType&&(this.newType=!0,this.currentType=c),this.finalType?this.nextTypeMatch=!1:this.nextTypeMatch=e[s+1].type===this.currentType,a.renderWebGL(this,a,i),this.newType=!1}(r=this.currentMask).mask&&r.mask.postRenderWebGL(this,r.camera),this.setBlendMode(o.BlendModes.NORMAL),this.postRenderCamera(i)}},postRender:function(){if(!this.contextLost){this.flush(),this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(y(this.canvas,t),t.callback=null),this.textureFlush>0&&(this.startActiveTexture++,this.currentActiveTexture=1)}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,n,r,s,o){var a=this.snapshotState;return a.callback=r,a.type=s,a.encoder=o,a.getPixel=!1,a.x=t,a.y=e,a.width=Math.min(i,this.gl.drawingBufferWidth),a.height=Math.min(n,this.gl.drawingBufferHeight),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,n,r,s,o,a,h,l,c){void 0===r&&(r=!1),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=e),void 0===h&&(h=i);var u=this.currentFramebuffer;this.snapshotArea(s,o,a,h,n,l,c);var d=this.snapshotState;return d.getPixel=r,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,this.setFramebuffer(t),y(this.canvas,d),this.setFramebuffer(u),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,n){return void 0===i&&(i=!1),void 0===n&&(n=!1),e?this.updateCanvasTexture(t,e,n):this.createCanvasTexture(t,i,n)},createCanvasTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=this.gl,r=n.NEAREST,s=n.NEAREST,o=t.width,a=t.height,h=n.CLAMP_TO_EDGE,l=c(o,a);return!e&&l&&(h=n.REPEAT),this.config.antialias&&(r=l?this.mipmapFilter:n.LINEAR,s=n.LINEAR),this.createTexture2D(0,r,s,h,h,n.RGBA,t,o,a,!0,!1,i)},updateCanvasTexture:function(t,e,i){void 0===i&&(i=!1);var n=this.gl,r=t.width,s=t.height;if(r>0&&s>0){n.activeTexture(n.TEXTURE0);var o=n.getParameter(n.TEXTURE_BINDING_2D);n.bindTexture(n.TEXTURE_2D,e),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,i),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=r,e.height=s,o&&n.bindTexture(n.TEXTURE_2D,o)}return e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=this.gl,r=n.NEAREST,s=n.NEAREST,o=t.videoWidth,a=t.videoHeight,h=n.CLAMP_TO_EDGE,l=c(o,a);return!e&&l&&(h=n.REPEAT),this.config.antialias&&(r=l?this.mipmapFilter:n.LINEAR,s=n.LINEAR),this.createTexture2D(0,r,s,h,h,n.RGBA,t,o,a,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var n=this.gl,r=t.videoWidth,s=t.videoHeight;if(r>0&&s>0){n.activeTexture(n.TEXTURE0);var o=n.getParameter(n.TEXTURE_BINDING_2D);n.bindTexture(n.TEXTURE_2D,e),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=r,e.height=s,o&&n.bindTexture(n.TEXTURE_2D,o)}return e},setTextureFilter:function(t,e){var i=this.gl,n=[i.LINEAR,i.NEAREST][e];i.activeTexture(i.TEXTURE0);var r=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,n),r&&i.bindTexture(i.TEXTURE_2D,r),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);for(var t=this.gl,e=this.tempTextures,i=0;i<e.length;i++)t.deleteTexture(e[i]);this.pipelines.destroy(),this.removeAllListeners(),this.fboStack=[],this.maskStack=[],this.extensions={},this.textureIndexes=[],this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0,this.currentMask=null,this.currentCameraMask=null}});t.exports=x},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(65),s=i(99),o=i(367),a=i(370),h=i(371),l=i(105),c=i(372),u=i(373),d=i(374),p=i(375),f=new n({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new s([[r.UTILITY_PIPELINE,p],[r.MULTI_PIPELINE,l],[r.BITMAPMASK_PIPELINE,o],[r.SINGLE_PIPELINE,d],[r.ROPE_PIPELINE,u],[r.LIGHT_PIPELINE,h],[r.POINTLIGHT_PIPELINE,c],[r.GRAPHICS_PIPELINE,a]]),this.postPipelineClasses=new s,this.pipelines=new s,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(t){var e,i,n=this,s=this.game;if(this.classes.each((function(t,i){e=n.add(t,new i({game:s})),t===r.UTILITY_PIPELINE&&(n.UTILITY_PIPELINE=e,n.fullFrame1=e.fullFrame1,n.fullFrame2=e.fullFrame2,n.halfFrame1=e.halfFrame1,n.halfFrame2=e.halfFrame2)})),this.MULTI_PIPELINE=this.get(r.MULTI_PIPELINE),this.BITMAPMASK_PIPELINE=this.get(r.BITMAPMASK_PIPELINE),t)for(i in t){var o=t[i];(e=new o(s)).isPostFX?this.postPipelineClasses.set(i,o):this.has(i)||(this.classes.set(i,o),this.add(i,e))}},add:function(t,e){if(!e.isPostFX){var i=this.pipelines,n=this.renderer;return i.has(t)?console.warn("Pipeline exists: "+t):(e.name=t,e.manager=this,i.set(t,e)),e.hasBooted||e.boot(),0!==n.width&&0!==n.height&&e.resize(n.width,n.height),e}console.warn(t+" is a Post Pipeline. Use `addPostPipeline` instead")},addPostPipeline:function(t,e){this.postPipelineClasses.has(t)||this.postPipelineClasses.set(t,e)},flush:function(){this.current&&this.current.flush()},has:function(t){var e=this.pipelines;return"string"==typeof t?e.has(t):!!e.contains(t)},get:function(t){var e=this.pipelines;return"string"==typeof t?e.get(t):e.contains(t)?t:void 0},getPostPipeline:function(t,e){var i,n=this.postPipelineClasses;if("string"==typeof t?i=n.get(t):"function"==typeof t?n.contains(t)&&(i=t):"object"==typeof t&&(i=n.get(t.name)),i){var r=new i(this.game);return e&&(r.gameObject=e),r}},remove:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0),this.pipelines.delete(t),e&&this.classes.delete(t),i&&this.postPipelineClasses.delete(t)},set:function(t,e,i){if(!t.isPostFX)return this.isCurrent(t,i)||(this.flush(),this.current&&this.current.unbind(),this.current=t,t.bind(i)),t.updateProjectionMatrix(),t.onBind(e),t},preBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=e.length-1;i>=0;i--){var n=e[i];n.active&&n.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i<e.length;i++){var n=e[i];n.active&&n.postBatch(t)}}},preBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=e.length-1;i>=0;i--){var n=e[i];n.active&&n.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i<e.length;i++){var n=e[i];n.active&&n.postBatch(t)}}},isCurrent:function(t,e){var i=this.renderer,n=this.current;return n&&!e&&(e=n.currentShader),!(n!==t||e.program!==i.currentProgram)},copyFrame:function(t,e,i,n,r){return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyFrame(t,e,i,n,r),this},copyToGame:function(t){return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyToGame(t),this},drawFrame:function(t,e,i,n){return this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader).drawFrame(t,e,i,n),this},blendFrames:function(t,e,i,n,r){return this.setUtility(this.UTILITY_PIPELINE.linearShader).blendFrames(t,e,i,n,r),this},blendFramesAdditive:function(t,e,i,n,r){return this.setUtility(this.UTILITY_PIPELINE.addShader).blendFramesAdditive(t,e,i,n,r),this},clearFrame:function(t,e){return this.UTILITY_PIPELINE.clearFrame(t,e),this},blitFrame:function(t,e,i,n,r,s){return this.setUtility(this.UTILITY_PIPELINE.copyShader).blitFrame(t,e,i,n,r,s),this},copyFrameRect:function(t,e,i,n,r,s,o,a){return this.UTILITY_PIPELINE.copyFrameRect(t,e,i,n,r,s,o,a),this},forceZero:function(){return this.current&&this.current.forceZero},setMulti:function(){return this.set(this.MULTI_PIPELINE)},setUtility:function(t){return this.UTILITY_PIPELINE.bind(t)},rebind:function(t){void 0===t&&this.previous&&(t=this.previous);var e=this.renderer,i=e.gl;i.disable(i.DEPTH_TEST),i.disable(i.CULL_FACE),e.hasActiveStencilMask()?i.clear(i.DEPTH_BUFFER_BIT):(i.disable(i.STENCIL_TEST),i.clear(i.DEPTH_BUFFER_BIT|i.STENCIL_BUFFER_BIT)),i.viewport(0,0,e.width,e.height),e.currentProgram=null,e.setBlendMode(0,!0),t&&(this.current=t,t.rebind()),e.resetTextures()},clear:function(){var t=this.renderer;this.flush(),this.current?(this.current.unbind(),this.previous=this.current,this.current=null):this.previous=null,t.currentProgram=null,t.setBlendMode(0,!0)},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.current=null,this.previous=null}});t.exports=f},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=i(862),o=i(863),a=i(104),h=i(57),l=new n({Extends:h,initialize:function(t){t.fragShader=r(t,"fragShader",s),t.vertShader=r(t,"vertShader",o),t.batchSize=r(t,"batchSize",1),t.vertices=r(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=r(t,"attributes",[{name:"inPosition",size:2,type:a.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){var n=this.gl;if(t.bitmapMask&&n){var r=this.renderer;r.flush(),r.pushFramebuffer(t.mainFramebuffer),n.disable(n.STENCIL_TEST),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),r.currentCameraMask.mask!==t&&(r.currentMask.mask=t,r.currentMask.camera=i)}},endMask:function(t,e){var i=this.gl,n=this.renderer,r=t.bitmapMask;if(r&&i){n.flush(),n.pushFramebuffer(t.maskFramebuffer),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),n.setBlendMode(0,!0),r.renderWebGL(n,r,e),n.flush(),n.popFramebuffer(),n.popFramebuffer();var s=n.getCurrentStencilMask();s?(i.enable(i.STENCIL_TEST),s.mask.applyStencil(n,s.camera,!0)):n.currentMask.mask=null,n.pipelines.set(this),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.maskTexture),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.mainTexture),this.set1i("uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3),n.resetTextures()}}});t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={AFTER_FLUSH:i(864),BEFORE_FLUSH:i(865),BIND:i(866),BOOT:i(867),DESTROY:i(868),REBIND:i(869),RESIZE:i(870)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=i(104),o=new n({initialize:function(t,e,i,n,r){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.program=this.renderer.createProgram(i,n),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(r),this.createUniforms()},createAttributes:function(t){var e=0,i=0,n=[];this.vertexComponentCount=0;for(var o=0;o<t.length;o++){var a=t[o],h=a.name,l=r(a,"size",1),c=r(a,"type",s.FLOAT),u=c.enum,d=c.size,p=!!a.normalized;n.push({name:h,size:l,type:u,normalized:p,offset:i,enabled:!1,location:-1}),4===d?e+=l:e++,i+=l*d}this.vertexSize=i,this.vertexComponentCount=e,this.attributes=n},bind:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),e&&this.pipeline.flush(),this.renderer.setProgram(this.program),t&&this.setAttribPointers(),this},rebind:function(){return this.renderer.setProgram(this.program),this.setAttribPointers(!0),this},setAttribPointers:function(t){void 0===t&&(t=!1);for(var e=this.gl,i=this.vertexSize,n=this.attributes,r=this.program,s=0;s<n.length;s++){var o=n[s],a=o.size,h=o.type,l=o.offset,c=o.enabled,u=o.location,d=!!o.normalized;if(t){var p=e.getAttribLocation(r,o.name);p>=0?(e.enableVertexAttribArray(p),e.vertexAttribPointer(p,a,h,d,i,l),o.enabled=!0,o.location=p):-1!==p&&e.disableVertexAttribArray(p)}else c?e.vertexAttribPointer(u,a,h,d,i,l):!c&&u>-1&&(e.disableVertexAttribArray(u),o.location=-1)}return this},createUniforms:function(){var t,e,i,n=this.gl,r=this.program,s=this.uniforms,o=n.getProgramParameter(r,n.ACTIVE_UNIFORMS);for(t=0;t<o;t++){var a=n.getActiveUniform(r,t);if(a){e=a.name,null!==(i=n.getUniformLocation(r,e))&&(s[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null});var h=e.indexOf("[");h>0&&(e=e.substr(0,h),s.hasOwnProperty(e)||null!==(i=n.getUniformLocation(r,e))&&(s[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i){var n=this.uniforms[e];return n?(n.value1!==i&&(n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,n){var r=this.uniforms[e];return r?(r.value1===i&&r.value2===n||(r.value1=i,r.value2=n,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i,n),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,n,r){var s=this.uniforms[e];return s?(s.value1===i&&s.value2===n&&s.value3===r||(s.value1=i,s.value2=n,s.value3=r,this.renderer.setProgram(this.program),t.call(this.gl,s.location,i,n,r),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,n,r,s){var o=this.uniforms[e];return o?(o.value1===i&&o.value2===n&&o.value3===r&&o.value4===s||(o.value1=i,o.value2=n,o.value3=r,o.value4=s,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,n,r,s),this.pipeline.currentShader=this),this):this},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,n){return this.setUniform3(this.gl.uniform3f,t,e,i,n)},set4f:function(t,e,i,n,r){return this.setUniform4(this.gl.uniform4f,t,e,i,n,r)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,n){return this.setUniform3(this.gl.uniform3i,t,e,i,n)},set4i:function(t,e,i,n,r){return this.setUniform4(this.gl.uniform4i,t,e,i,n,r)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i)},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(68),s=i(2),o=i(871),a=i(872),h=i(25),l=i(104),c=i(57),u=new n({Extends:c,initialize:function(t){t.fragShader=s(t,"fragShader",o),t.vertShader=s(t,"vertShader",a),t.attributes=s(t,"attributes",[{name:"inPosition",size:2},{name:"inColor",size:4,type:l.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},batchFillRect:function(t,e,i,n,r,s){this.renderer.pipelines.set(this);var o=this.calcMatrix;s&&s.multiply(r,o);var a=t+i,h=e+n,l=o.getX(t,e),c=o.getY(t,e),u=o.getX(t,h),d=o.getY(t,h),p=o.getX(a,h),f=o.getY(a,h),m=o.getX(a,e),g=o.getY(a,e),v=this.fillTint;this.batchQuad(l,c,u,d,p,f,m,g,v.TL,v.TR,v.BL,v.BR)},batchFillTriangle:function(t,e,i,n,r,s,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),c=h.getY(t,e),u=h.getX(i,n),d=h.getY(i,n),p=h.getX(r,s),f=h.getY(r,s),m=this.fillTint;this.batchTri(l,c,u,d,p,f,m.TL,m.TR,m.BL)},batchStrokeTriangle:function(t,e,i,n,r,s,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=r,l[2].y=s,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var n=this.calcMatrix;i&&i.multiply(e,n);for(var s,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,c=this.fillTint.TR,u=this.fillTint.BL,d=0;d<a;++d)o=t[d],h.push(o.x,o.y);a=(s=r(h)).length;for(var p=0;p<a;p+=3){var f=2*s[p+0],m=2*s[p+1],g=2*s[p+2],v=h[f+0],y=h[f+1],x=h[m+0],b=h[m+1],w=h[g+0],T=h[g+1],_=n.getX(v,y),E=n.getY(v,y),S=n.getX(x,b),M=n.getY(x,b),A=n.getX(w,T),C=n.getY(w,T);this.batchTri(_,E,S,M,A,C,l,c,u)}h.length=0},batchStrokePath:function(t,e,i,n,r){this.renderer.pipelines.set(this),this.prevQuad[4]=0,this.firstQuad[4]=0;for(var s=t.length-1,o=0;o<s;o++){var a=t[o],h=t[o+1];this.batchLine(a.x,a.y,h.x,h.y,a.width/2,h.width/2,e,o,!i&&o===s-1,n,r)}},batchLine:function(t,e,i,n,r,s,o,a,h,l,c){this.renderer.pipelines.set(this);var u=this.calcMatrix;c&&c.multiply(l,u);var d=i-t,p=n-e,f=Math.sqrt(d*d+p*p),m=r*(n-e)/f,g=r*(t-i)/f,v=s*(n-e)/f,y=s*(t-i)/f,x=i-v,b=n-y,w=t-m,T=e-g,_=i+v,E=n+y,S=t+m,M=e+g,A=u.getX(x,b),C=u.getY(x,b),P=u.getX(w,T),R=u.getY(w,T),L=u.getX(_,E),O=u.getY(_,E),D=u.getX(S,M),I=u.getY(S,M),F=this.strokeTint,B=F.TL,k=F.TR,N=F.BL,U=F.BR;if(this.batchQuad(D,I,P,R,A,C,L,O,B,k,N,U),!(o<=2)){var z=this.prevQuad,G=this.firstQuad;a>0&&z[4]?this.batchQuad(D,I,P,R,z[0],z[1],z[2],z[3],B,k,N,U):(G[0]=D,G[1]=I,G[2]=P,G[3]=R,G[4]=1),h&&G[4]?this.batchQuad(A,C,L,O,G[0],G[1],G[2],G[3],B,k,N,U):(z[0]=A,z[1]=C,z[2]=L,z[3]=O,z[4]=1)}},batchVert:function(t,e,i){var n=this.vertexViewF32,r=this.vertexViewU32,s=this.vertexCount*this.currentShader.vertexComponentCount-1;n[++s]=t,n[++s]=e,r[++s]=i,this.vertexCount++},batchQuad:function(t,e,i,n,r,s,o,a,h,l,c,u){var d=!1;return this.shouldFlush(6)&&(this.flush(),d=!0),this.batchVert(t,e,h),this.batchVert(i,n,c),this.batchVert(r,s,u),this.batchVert(t,e,h),this.batchVert(r,s,u),this.batchVert(o,a,l),d},batchTri:function(t,e,i,n,r,s,o,a,h){var l=!1;return this.shouldFlush(3)&&(this.flush(),l=!0),this.batchVert(t,e,o),this.batchVert(i,n,a),this.batchVert(r,s,h),l},destroy:function(){return c.prototype.destroy.call(this),this.polygonCache=null,this}});t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=i(873),o=i(105),a=i(3),h=i(57),l=10,c=new a,u=new n({Extends:o,initialize:function(t){l=t.game.renderer.config.maxLights;for(var e=r(t,"fragShader",s),i=[],n=1;n<=l;n++)i.push({name:"lights"+n,fragShader:e.replace("%LIGHT_COUNT%",n.toString())});t.shaders=i,o.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap},boot:function(){h.prototype.boot.call(this);var t=this.gl,e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:e};for(var i=0;i<this.shaders.length;i++)this["lightShader"+(i+1)]=this.shaders[i]},onRender:function(t,e){var i=t.sys.lights;if(i&&i.active){var n=i.getLights(e),r=n.length;if(0!==r){var s;this.setShader(this["lightShader"+r],!0);var o=this.renderer.height,a=e.matrix;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",e.x,e.y,e.rotation,e.zoom),this.set3f("uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),s=0;s<r;s++){var h=n[s].light,l=h.color,u="uLights["+s+"].";a.transformPoint(h.x,h.y,c),this.set2f(u+"position",c.x-e.scrollX*h.scrollFactorX*e.zoom,o-(c.y-e.scrollY*h.scrollFactorY*e.zoom)),this.set3f(u+"color",l.r,l.g,l.b),this.set1f(u+"intensity",h.intensity),this.set1f(u+"radius",h.radius)}this.currentNormalMapRotation=null}}},setNormalMapRotation:function(t){if(t!==this.currentNormalMapRotation||0===this.vertexCount){this.vertexCount>0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,n=Math.cos(i),r=Math.sin(i);e[1]=r,e[3]=-r,e[0]=e[4]=n}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.tempTextures[0]);var n=this.getNormalMap(e);i.isNewNormalMap(t,n)&&(this.flush(),i.setTextureZero(t),i.setNormalMap(n));var r=e?e.rotation:0;return this.setNormalMapRotation(r),this.currentUnit=0,0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=this.renderer,n=e.glTexture,r=this.getNormalMap(t);return i.isNewNormalMap()&&(this.flush(),i.setTextureZero(n),i.setNormalMap(r)),this.setNormalMapRotation(t.rotation),this.currentUnit=0,0},getNormalMap:function(t){var e;return t?t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]):e=this.defaultNormalMap,e||(e=this.defaultNormalMap),e.glTexture}});u.LIGHT_COUNT=l,t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=i(876),o=i(877),a=i(57),h=new n({Extends:a,initialize:function(t){t.vertShader=r(t,"vertShader",o),t.fragShader=r(t,"fragShader",s),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),a.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,n,r,s,o,a,h,l,c,u){var d=t.color,p=t.intensity,f=t.radius,m=t.attenuation,g=d.r*p,v=d.g*p,y=d.b*p,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.batchLightVert(i,n,c,u,f,m,g,v,y,x),this.batchLightVert(r,s,c,u,f,m,g,v,y,x),this.batchLightVert(o,a,c,u,f,m,g,v,y,x),this.batchLightVert(i,n,c,u,f,m,g,v,y,x),this.batchLightVert(o,a,c,u,f,m,g,v,y,x),this.batchLightVert(h,l,c,u,f,m,g,v,y,x)},batchLightVert:function(t,e,i,n,r,s,o,a,h,l){var c=this.vertexViewF32,u=this.vertexCount*this.currentShader.vertexComponentCount-1;c[++u]=t,c[++u]=e,c[++u]=i,c[++u]=n,c[++u]=r,c[++u]=s,c[++u]=o,c[++u]=a,c[++u]=h,c[++u]=l,this.vertexCount++}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=i(105),o=new n({Extends:s,initialize:function(t){t.topology=5,t.batchSize=r(t,"batchSize",256),s.call(this,t)}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=i(105),o=i(878),a=i(879),h=i(57),l=new n({Extends:s,initialize:function(t){t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.forceZero=!0,s.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0)}});t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(880),r=i(34),s=i(0),o=i(195),a=i(881),h=i(882),l=i(2),c=i(883),u=i(376),d=i(57),p=new s({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),t.vertShader=l(t,"vertShader",u),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:n},{name:"LinearBlend",fragShader:c},{name:"ColorMatrix",fragShader:a}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new o,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,n,r){void 0===i&&(i=1),void 0===n&&(n=!0),void 0===r&&(r=!0);var s=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,t.texture),e?(s.viewport(0,0,e.width,e.height),s.bindFramebuffer(s.FRAMEBUFFER,e.framebuffer),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e.texture,0)):s.viewport(0,0,t.width,t.height),n&&(r?s.clearColor(0,0,0,0):s.clearColor(0,0,0,1),s.clear(s.COLOR_BUFFER_BIT)),s.bufferData(s.ARRAY_BUFFER,this.vertexData,s.STATIC_DRAW),s.drawArrays(s.TRIANGLES,0,6),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindTexture(s.TEXTURE_2D,null)},blitFrame:function(t,e,i,n,s,o){void 0===i&&(i=1),void 0===n&&(n=!0),void 0===s&&(s=!0),void 0===o&&(o=!1);var a=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),t.height>e.height)a.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var h=e.height-t.height;a.viewport(0,h,t.width,t.height)}if(a.bindFramebuffer(a.FRAMEBUFFER,e.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e.texture,0),n&&(s?a.clearColor(0,0,0,0):a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT)),o){var l=this.renderer.currentBlendMode;this.renderer.setBlendMode(r.ERASE)}a.bufferData(a.ARRAY_BUFFER,this.vertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),o&&this.renderer.setBlendMode(l),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindTexture(a.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,n,r,s,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture,0),o&&(a?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,n,r,s),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6),this.renderer.resetTextures()},drawFrame:function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=this.colorMatrix);var r=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",n.getData()),this.set1f("uAlpha",n.alpha),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0)):r.viewport(0,0,t.width,t.height),i?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blendFrames:function(t,e,i,n,r,s){void 0===n&&(n=1),void 0===r&&(r=!0),void 0===s&&(s=this.linearShader);var o=this.gl;this.setShader(s),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",n),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,e.texture),i?(o.bindFramebuffer(o.FRAMEBUFFER,i.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,i.texture,0),o.viewport(0,0,i.width,i.height)):o.viewport(0,0,t.width,t.height),r?o.clearColor(0,0,0,0):o.clearColor(0,0,0,1),o.clear(o.COLOR_BUFFER_BIT),o.bufferData(o.ARRAY_BUFFER,this.vertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,n,r){this.blendFrames(t,e,i,n,r,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var n=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,n)},setUVs:function(t,e,i,n,r,s,o,a){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=n,h[10]=r,h[11]=s,h[14]=t,h[15]=e,h[18]=r,h[19]=s,h[22]=o,h[23]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=p},function(t,e){t.exports=["#define SHADER_NAME PHASER_QUAD_VS","","precision mediump float;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","","varying vec2 outFragCoord;","varying vec2 outTexCoord;","","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;",""," gl_Position = vec4(inPosition, 0, 1);","}",""].join("\n")},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(31),r=i(37),s=i(2);t.exports=function(t,e){var i=t.getContext("experimental-webgl"),o=s(e,"callback"),a=s(e,"type","image/png"),h=s(e,"encoder",.92),l=s(e,"x",0),c=s(e,"y",0),u=s(e,"getPixel",!1),d=s(e,"isFramebuffer",!1),p=d?s(e,"bufferWidth",1):i.drawingBufferWidth,f=d?s(e,"bufferHeight",1):i.drawingBufferHeight;if(u){var m=new Uint8Array(4),g=d?c:f-c;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,m),o.call(null,new r(m[0],m[1],m[2],m[3]/255))}else{var v=s(e,"width",p),y=s(e,"height",f),x=new Uint8Array(v*y*4);i.readPixels(l,f-c-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var b=n.createWebGL(this,v,y),w=b.getContext("2d"),T=w.getImageData(0,0,v,y),_=T.data,E=0;E<y;E++)for(var S=0;S<v;S++){var M=4*((y-E-1)*v+S),A=4*(E*v+S);_[A+0]=x[M+0],_[A+1]=x[M+1],_[A+2]=x[M+2],_[A+3]=x[M+3]}w.putImageData(T,0,0);var C=new Image;C.onerror=function(){o.call(null),n.remove(b)},C.onload=function(){o.call(null,C),n.remove(b)},C.src=b.toDataURL(a,h)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(32);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===n.CANVAS?i="Canvas":e.renderType===n.HEADLESS&&(i="Headless");var r,s=e.audio,o=t.device.audio;if(r=o.webAudio&&!s.disableWebAudio?"Web Audio":s.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),a=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+r+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(6),s=i(1),o=i(380),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=r(e,"min",5),this.targetFps=r(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=s,this.forceSetTimeOut=r(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=r(e,"deltaHistory",10),this.panicMax=r(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=r(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=Math.min(this._target,this.deltaHistory[e]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(t){if(this.started)return this;this.started=!0,this.running=!0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=t,this.raf.start(this.step.bind(this),this.forceSetTimeOut,this._target)},step:function(){var t=window.performance.now();this.now=t;var e=t-this.lastTime;e<0&&(e=0),this.rawDelta=e;var i=this.deltaIndex,n=this.deltaHistory,r=this.deltaSmoothingMax,s=e,o=e;if(this.smoothStep){(this._coolDown>0||!this.inFocus)&&(this._coolDown--,s=Math.min(s,this._target)),s>this._min&&(s=n[i],s=Math.min(s,this._min)),n[i]=s,this.deltaIndex++,this.deltaIndex>r&&(this.deltaIndex=0),o=0;for(var a=0;a<r;a++)o+=n[a];o/=r}this.delta=o,this.time+=this.rawDelta,t>this.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=s,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(1),s=new n({initialize:function(){this.isRunning=!1,this.callback=r,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.min(Math.max(2*t.target+t.tick-i,0),t.target);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=r}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(22);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})),e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)}),!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(383),r=i(31),s=i(6);t.exports=function(t){var e=s(t,"data",[]),i=s(t,"canvas",null),o=s(t,"palette",n),a=s(t,"pixelWidth",1),h=s(t,"pixelHeight",a),l=s(t,"resizeCanvas",!0),c=s(t,"clearCanvas",!0),u=s(t,"preRender",null),d=s(t,"postRender",null),p=Math.floor(Math.abs(e[0].length*a)),f=Math.floor(Math.abs(e.length*h));i||(i=r.create2D(this,p,f),l=!1,c=!1),l&&(i.width=p,i.height=f);var m=i.getContext("2d");c&&m.clearRect(0,0,p,f),u&&u(i,m);for(var g=0;g<e.length;g++)for(var v=e[g],y=0;y<v.length;y++){var x=v[y];"."!==x&&" "!==x&&(m.fillStyle=o[x],m.fillRect(y*a,g*h,a,h))}return d&&d(i,m),i}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(352),s=i(90),o=i(3),a=new n({Extends:s,initialize:function(t,e,i,n){s.call(this,"CubicBezierCurve"),Array.isArray(t)&&(n=new o(t[6],t[7]),i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=n},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,n=this.p1,s=this.p2,a=this.p3;return e.set(r(t,i.x,n.x,s.x,a.x),r(t,i.y,n.y,s.y,a.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y,this.p3.x,this.p3.y]}}});a.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),n=new o(e[2],e[3]),r=new o(e[4],e[5]),s=new o(e[6],e[7]);return new a(i,n,r,s)},t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(90),s=i(35),o=i(6),a=i(193),h=i(3),l=new n({Extends:r,initialize:function(t,e,i,n,a,l,c,u){if("object"==typeof t){var d=t;t=o(d,"x",0),e=o(d,"y",0),i=o(d,"xRadius",0),n=o(d,"yRadius",i),a=o(d,"startAngle",0),l=o(d,"endAngle",360),c=o(d,"clockwise",!1),u=o(d,"rotation",0)}else void 0===n&&(n=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===c&&(c=!1),void 0===u&&(u=0);r.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=n,this._startAngle=s(a),this._endAngle=s(l),this._clockwise=c,this._rotation=s(u)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,n=this._endAngle-this._startAngle,r=Math.abs(n)<Number.EPSILON;n<0;)n+=i;for(;n>i;)n-=i;n<Number.EPSILON&&(n=r?0:i),this._clockwise&&!r&&(n===i?n=-i:n-=i);var s=this._startAngle+t*n,o=this.p0.x+this._xRadius*Math.cos(s),a=this.p0.y+this._yRadius*Math.sin(s);if(0!==this._rotation){var l=Math.cos(this._rotation),c=Math.sin(this._rotation),u=o-this.p0.x,d=a-this.p0.y;o=u*l-d*c+this.p0.x,a=u*c+d*l+this.p0.y}return e.set(o,a)},setXRadius:function(t){return this.xRadius=t,this},setYRadius:function(t){return this.yRadius=t,this},setWidth:function(t){return this.xRadius=t/2,this},setHeight:function(t){return this.yRadius=t/2,this},setStartAngle:function(t){return this.startAngle=t,this},setEndAngle:function(t){return this.endAngle=t,this},setClockwise:function(t){return this.clockwise=t,this},setRotation:function(t){return this.rotation=t,this},x:{get:function(){return this.p0.x},set:function(t){this.p0.x=t}},y:{get:function(){return this.p0.y},set:function(t){this.p0.y=t}},xRadius:{get:function(){return this._xRadius},set:function(t){this._xRadius=t}},yRadius:{get:function(){return this._yRadius},set:function(t){this._yRadius=t}},startAngle:{get:function(){return a(this._startAngle)},set:function(t){this._startAngle=s(t)}},endAngle:{get:function(){return a(this._endAngle)},set:function(t){this._endAngle=s(t)}},clockwise:{get:function(){return this._clockwise},set:function(t){this._clockwise=t}},angle:{get:function(){return a(this._rotation)},set:function(t){this._rotation=s(t)}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t}},toJSON:function(){return{type:this.type,x:this.p0.x,y:this.p0.y,xRadius:this._xRadius,yRadius:this._yRadius,startAngle:a(this._startAngle),endAngle:a(this._endAngle),clockwise:this._clockwise,rotation:a(this._rotation)}}});l.fromJSON=function(t){return new l(t)},t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(90),s=i(196),o=i(10),a=i(3),h=new a,l=new n({Extends:r,initialize:function(t,e){r.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new o),s([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(){return h.copy(this.p1).subtract(this.p0).normalize()},getUtoTmapping:function(t,e,i){var n;if(e){var r=this.getLengths(i),s=r[r.length-1];n=Math.min(e,s)/s}else n=t;return n},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});l.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),n=new a(e[2],e[3]);return new l(i,n)},t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(3),s=new n({initialize:function(t,e){this.active=!1,this.p0=new r(t,e)},getPoint:function(t,e){return void 0===e&&(e=new r),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(90),s=i(353),o=i(3),a=new n({Extends:r,initialize:function(t,e,i){r.call(this,"QuadraticBezier"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,n=this.p1,r=this.p2;return e.set(s(t,i.x,n.x,r.x),s(t,i.y,n.y,r.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y]}}});a.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),n=new o(e[2],e[3]),r=new o(e[4],e[5]);return new a(i,n,r)},t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(191),r=i(0),s=i(90),o=i(3),a=new r({Extends:s,initialize:function(t){void 0===t&&(t=[]),s.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;e<t.length;e++){var i=new o;"number"==typeof t[e]?(i.x=t[e],i.y=t[e+1],e++):Array.isArray(t[e])?(i.x=t[e][0],i.y=t[e][1]):(i.x=t[e].x,i.y=t[e].y),this.points.push(i)}return this},addPoint:function(t,e){var i=new o(t,e);return this.points.push(i),i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.points[0])},getResolution:function(t){return t*this.points.length},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.points,r=(i.length-1)*t,s=Math.floor(r),a=r-s,h=i[0===s?s:s-1],l=i[s],c=i[s>i.length-2?i.length-1:s+1],u=i[s>i.length-3?i.length-1:s+2];return e.set(n(a,h.x,l.x,c.x,u.x),n(a,h.y,l.y,c.y,u.y))},toJSON:function(){for(var t=[],e=0;e<this.points.length;e++)t.push(this.points[e].x),t.push(this.points[e].y);return{type:this.type,points:t}}});a.fromJSON=function(t){return new a(t.points)},t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e,i,n){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===n&&(n=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=n}});t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(37);n.ColorSpectrum=i(905),n.ColorToRGBA=i(906),n.ComponentToHex=i(392),n.GetColor=i(100),n.GetColor32=i(322),n.HexStringToColor=i(321),n.HSLToColor=i(907),n.HSVColorWheel=i(908),n.HSVToRGB=i(185),n.HueToComponent=i(393),n.IntegerToColor=i(186),n.IntegerToRGB=i(324),n.Interpolate=i(909),n.ObjectToColor=i(325),n.RandomRGB=i(910),n.RGBStringToColor=i(326),n.RGBToHSV=i(323),n.RGBToString=i(911),n.ValueToColor=i(184),t.exports=n},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e){t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(102);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(198);t.exports=function(t,e){var i=window.screen,r=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return r&&"string"==typeof r.type?r.type:"string"==typeof r?r:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?n.ORIENTATION.PORTRAIT:n.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?n.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?n.ORIENTATION.LANDSCAPE:void 0:e>t?n.ORIENTATION.PORTRAIT:n.ORIENTATION.LANDSCAPE}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(200),s=i(9),o=i(49),a=i(22),h=i(404),l=i(405),c=i(406),u=i(407),d=i(25),p=i(174),f=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new s,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new u(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new c(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var n=0;n<i.length;n++){var r=i[n];if(r.sys.input&&r.sys.input.updatePoll(t,e)&&this.globalTopOnly)return}},setDefaultCursor:function(t){this.defaultCursor=t,this.canvas.style.cursor!==t&&(this.canvas.style.cursor=t)},setCursor:function(t){t.cursor&&(this.canvas.style.cursor=t.cursor)},resetCursor:function(t){t.cursor&&this.canvas&&(this.canvas.style.cursor=this.defaultCursor)},addPointer:function(t){void 0===t&&(t=1);var e=[];this.pointersTotal+t>10&&(t=10-this.pointersTotal);for(var i=0;i<t;i++){var n=this.pointers.length,r=new c(this,n);r.smoothFactor=this.config.inputSmoothFactor,this.pointers.push(r),this.pointersTotal++,e.push(r)}return e},updateInputPlugins:function(t,e){var i=this.game.scene.getScenes(!0,!0);this._tempSkip=!1;for(var n=0;n<i.length;n++){var r=i[n];if(r.sys.input&&(r.sys.input.update(t,e)&&this.globalTopOnly||this._tempSkip))return}},onTouchStart:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],o=1;o<this.pointersTotal;o++){var a=e[o];if(!a.active){a.touchstart(s,t),this.activePointer=a,i.push(a);break}}this.updateInputPlugins(r.TOUCH_START,i)},onTouchMove:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],o=1;o<this.pointersTotal;o++){var a=e[o];if(a.active&&a.identifier===s.identifier){a.touchmove(s,t),this.activePointer=a,i.push(a);break}}this.updateInputPlugins(r.TOUCH_MOVE,i)},onTouchEnd:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],o=1;o<this.pointersTotal;o++){var a=e[o];if(a.active&&a.identifier===s.identifier){a.touchend(s,t),i.push(a);break}}this.updateInputPlugins(r.TOUCH_END,i)},onTouchCancel:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],o=1;o<this.pointersTotal;o++){var a=e[o];if(a.active&&a.identifier===s.identifier){a.touchcancel(s,t),i.push(a);break}}this.updateInputPlugins(r.TOUCH_CANCEL,i)},onMouseDown:function(t){var e=this.mousePointer;e.down(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(r.MOUSE_DOWN,this.mousePointerContainer)},onMouseMove:function(t){var e=this.mousePointer;e.move(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(r.MOUSE_MOVE,this.mousePointerContainer)},onMouseUp:function(t){var e=this.mousePointer;e.up(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(r.MOUSE_UP,this.mousePointerContainer)},onMouseWheel:function(t){var e=this.mousePointer;e.wheel(t),this.activePointer=e,this.updateInputPlugins(r.MOUSE_WHEEL,this.mousePointerContainer)},onPointerLockChange:function(t){var e=this.mouse.locked;this.mousePointer.locked=e,this.events.emit(o.POINTERLOCK_CHANGE,t,e)},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!i.alwaysEnabled&&!t.willRender(e))return!1;var n=!0,r=t.parentContainer;if(r)do{if(!r.willRender(e)){n=!1;break}r=r.parentContainer}while(r);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var r=this._tempPoint,s=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;i.getWorldPoint(a,h,r),t.worldX=r.x,t.worldY=r.y;for(var l={x:0,y:0},c=this._tempMatrix,u=this._tempMatrix2,d=0;d<e.length;d++){var f=e[d];if(this.inputCandidate(f,i)){var m=r.x+s*f.scrollFactorX-s,g=r.y+o*f.scrollFactorY-o;f.parentContainer?(f.getWorldTransformMatrix(c,u),c.applyInverse(m,g,l)):p(m,g,f.x,f.y,f.rotation,f.scaleX,f.scaleY,l),this.pointWithinHitArea(f,l.x,l.y)&&n.push(f)}}return n},pointWithinHitArea:function(t,e,i){e+=t.displayOriginX,i+=t.displayOriginY;var n=t.input;return!(!n||!n.hitAreaCallback(n.hitArea,e,i,t)||(n.localX=e,n.localY=i,0))},pointWithinInteractiveObject:function(t,e,i){return!!t.hitArea&&(e+=t.gameObject.displayOriginX,i+=t.gameObject.displayOriginY,t.localX=e,t.localY=i,t.hitAreaCallback(t.hitArea,e,i,t))},transformPointer:function(t,e,i,n){var r=t.position,s=t.prevPosition;s.x=r.x,s.y=r.y;var o=this.scaleManager.transformX(e),a=this.scaleManager.transformY(i),h=t.smoothFactor;n&&0!==h?(r.x=o*h+s.x*(1-h),r.y=a*h+s.y*(1-h)):(r.x=o,r.y=a)},destroy:function(){this.events.removeAllListeners(),this.game.events.off(a.PRE_RENDER),this.keyboard&&this.keyboard.destroy(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var t=0;t<this.pointers.length;t++)this.pointers[t].destroy();this.pointers=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}});t.exports=f},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(89),r=i(0),s=i(22),o=i(49),a=i(141),h=i(1),l=new r({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(o.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(s.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i<t.length;i++){var n=t[i];"string"==typeof n&&(n=a[n.trim().toUpperCase()]),-1===e.indexOf(n)&&e.push(n)}this.preventDefault=e.length>0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i<t.length;i++){var r=t[i];"string"==typeof r&&(r=a[r.toUpperCase()]),n(e,r)}this.preventDefault=e.length>0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(s.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(188),s=i(49),o=i(1),a=new n({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,this.isTop=!0,t.events.once(s.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(r.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){r.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,n=i.canvas,s=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){s&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===n&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==n&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===n&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==n&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===n&&t.preventDefault()};var o={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,o),t.addEventListener("mouseout",this.onMouseOut,o),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,o),window.top.addEventListener("mouseup",this.onMouseUpWindow,o)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o),this.isTop=!1}r.pointerLock&&(this.pointerLockChange=function(t){var n=e.target;e.locked=document.pointerLockElement===n||document.mozPointerLockElement===n||document.webkitPointerLockElement===n,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),r.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(343),r=i(0),s=i(48),o=i(123),a=i(354),h=i(3),l=i(102),c=new r({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,r=this.midPoint.y;if(t!==i||e!==r){var s=a(this.motionFactor,i,t),h=a(this.motionFactor,r,e);o(s,t,.1)&&(s=t),o(h,e,.1)&&(h=e),this.midPoint.set(s,h);var l=t-s,c=e-h;this.velocity.set(l,c),this.angle=n(s,h,t,e),this.distance=Math.sqrt(l*l+c*c)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,r=this.position.x,s=this.position.y,o=0;o<t;o++){var h=1/t*o;e[o]={x:a(h,i,r),y:a(h,n,s)}}return e},destroy:function(){this.camera=null,this.manager=null,this.position=null},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},time:{get:function(){return this.event?this.event.timeStamp:0}}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(49),s=i(1),o=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=s,this.onTouchStartWindow=s,this.onTouchMove=s,this.onTouchEnd=s,this.onTouchEndWindow=s,this.onTouchCancel=s,this.onTouchCancelWindow=s,this.onTouchOver=s,this.onTouchOut=s,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onTouchStart=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchStart(n),t.capture&&n.cancelable&&n.target===e&&n.preventDefault())},this.onTouchStartWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchStart(i)},this.onTouchMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchMove(e),t.capture&&e.cancelable&&e.preventDefault())},this.onTouchEnd=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchEnd(i),t.capture&&i.cancelable&&i.target===e&&i.preventDefault())},this.onTouchEndWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchEnd(i)},this.onTouchCancel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchCancel(e),t.capture&&e.preventDefault())},this.onTouchCancelWindow=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onTouchCancel(e)},this.onTouchOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onTouchOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)};var n=this.target;if(n){var r={passive:!0},s={passive:!1};n.addEventListener("touchstart",this.onTouchStart,this.capture?s:r),n.addEventListener("touchmove",this.onTouchMove,this.capture?s:r),n.addEventListener("touchend",this.onTouchEnd,this.capture?s:r),n.addEventListener("touchcancel",this.onTouchCancel,this.capture?s:r),n.addEventListener("touchover",this.onTouchOver,this.capture?s:r),n.addEventListener("touchout",this.onTouchOut,this.capture?s:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("touchstart",this.onTouchStartWindow,s),window.addEventListener("touchend",this.onTouchEndWindow,s),window.addEventListener("touchcancel",this.onTouchCancelWindow,s)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),t.removeEventListener("touchover",this.onTouchOver),t.removeEventListener("touchout",this.onTouchOut),window&&(window.removeEventListener("touchstart",this.onTouchStartWindow),window.removeEventListener("touchend",this.onTouchEndWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(22),s=i(9),o=i(8),a=i(16),h=i(5),l=i(2),c=i(24),u=i(89),d=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(r.BOOT,this.boot,this)},boot:function(){var t,e,i,n,s,o,a,h=this.game.config,c=h.installGlobalPlugins;for(c=c.concat(this._pendingGlobal),t=0;t<c.length;t++)e=c[t],i=l(e,"key",null),n=l(e,"plugin",null),s=l(e,"start",!1),o=l(e,"mapping",null),a=l(e,"data",null),i&&(n?this.install(i,n,s,o,a):console.warn("Missing `plugin` for key: "+i));for(c=(c=h.installScenePlugins).concat(this._pendingScene),t=0;t<c.length;t++)e=c[t],i=l(e,"key",null),n=l(e,"plugin",null),o=l(e,"mapping",null),i&&(n?this.installScenePlugin(i,n,o):console.warn("Missing `plugin` for key: "+i));this._pendingGlobal=[],this._pendingScene=[],this.game.events.once(r.DESTROY,this.destroy,this)},addToScene:function(t,e,i){var n,r,s,o=this.game,a=t.scene,h=t.settings.map,l=t.settings.isBooted;for(n=0;n<e.length;n++)o[r=e[n]]?(t[r]=o[r],h.hasOwnProperty(r)&&(a[h[r]]=t[r])):"game"===r&&h.hasOwnProperty(r)&&(a[h[r]]=o);for(var u=0;u<i.length;u++)for(s=i[u],n=0;n<s.length;n++)if(r=s[n],c.hasCore(r)){var d=c.getCore(r),p=new d.plugin(a,this);t[d.mapping]=p,d.custom?a[d.mapping]=p:h.hasOwnProperty(d.mapping)&&(a[h[d.mapping]]=p),l&&p.boot()}for(s=this.plugins,n=0;n<s.length;n++){var f=s[n];f.mapping&&(a[f.mapping]=f.plugin)}},getDefaultScenePlugins:function(){var t=this.game.config.defaultPlugins;return t=t.concat(this.scenePlugins)},installScenePlugin:function(t,e,i,n,r){if(void 0===r&&(r=!1),"function"==typeof e){if(c.hasCore(t)){if(!r&&c.hasCore(t))return void console.warn("Scene Plugin key in use: "+t)}else c.register(t,e,i,!0),this.scenePlugins.push(t);if(n){var s=new e(n,this);n.sys[t]=s,i&&""!==i&&(n[i]=s),s.boot()}}else console.warn("Invalid Scene Plugin: "+t)},install:function(t,e,i,n,r){if(void 0===i&&(i=!1),void 0===n&&(n=null),void 0===r&&(r=null),"function"!=typeof e)return console.warn("Invalid Plugin: "+t),null;if(c.hasCustom(t))return console.warn("Plugin key in use: "+t),null;if(null!==n&&(i=!0),this.game.isBooted){if(c.registerCustom(t,e,n,r),i)return this.start(t)}else this._pendingGlobal.push({key:t,plugin:e,start:i,mapping:n,data:r});return null},getIndex:function(t){for(var e=this.plugins,i=0;i<e.length;i++)if(e[i].key===t)return i;return-1},getEntry:function(t){var e=this.getIndex(t);if(-1!==e)return this.plugins[e]},isActive:function(t){var e=this.getEntry(t);return e&&e.active},start:function(t,e){void 0===e&&(e=t);var i=this.getEntry(e);return i&&!i.active?(i.active=!0,i.plugin.start()):i||(i=this.createEntry(t,e)),i?i.plugin:null},createEntry:function(t,e){var i=c.getCustom(t);if(i){var n=new i.plugin(this);i={key:e,plugin:n,active:!0,mapping:i.mapping,data:i.data},this.plugins.push(i),n.init(i.data),n.start()}return i},stop:function(t){var e=this.getEntry(t);return e&&e.active&&(e.active=!1,e.plugin.stop()),this},get:function(t,e){void 0===e&&(e=!0);var i=this.getEntry(t);if(i)return i.plugin;var n=this.getClass(t);return n&&e?(i=this.createEntry(t,t))?i.plugin:null:n||null},getClass:function(t){return c.getCustomClass(t)},removeGlobalPlugin:function(t){var e=this.getEntry(t);e&&u(this.plugins,e),c.removeCustom(t)},removeScenePlugin:function(t){u(this.scenePlugins,t),c.remove(t)},registerGameObject:function(t,e,i){return e&&h.register(t,e),i&&a.register(t,i),this},removeGameObject:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),e&&h.remove(t),i&&a.remove(t),this},registerFileType:function(t,e,i){o.register(t,e),i&&i.sys.load&&(i.sys.load[t]=e)},destroy:function(){for(var t=0;t<this.plugins.length;t++)this.plugins[t].plugin.destroy();c.destroyCustomPlugins(),this.game.noReturn&&c.destroyCorePlugins(),this.game=null,this.plugins=[],this.scenePlugins=[]}});t.exports=d},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(198),r=i(0),s=i(9),o=i(101),a=i(22),h=i(395),l=i(401),c=i(396),u=i(1),d=i(10),p=i(410),f=i(76),m=i(3),g=new r({Extends:s,initialize:function(t){s.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=n.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new m(1,1),this.autoRound=!1,this.autoCenter=n.CENTER.NO_CENTER,this.orientation=n.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:u,windowResize:u,fullScreenChange:u,fullScreenError:u}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==n.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===n.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),t.events.once(a.READY,this.refresh,this),t.events.once(a.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,r=t.scaleMode,s=t.zoom,o=t.autoRound;if("string"==typeof e){var a=this.parentSize.width;0===a&&(a=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(a*h)}if("string"==typeof i){var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=r,this.autoRound=o,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,o&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),s===n.ZOOM.MAX_ZOOM&&(s=this.getMaxZoom()),this.zoom=s,1!==s&&(this._resetZoom=!0),this.baseSize.setSize(e,i),o&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*s,t.minHeight*s),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*s,t.maxHeight*s),this.displaySize.setSize(e,i),this.orientation=c(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,n=e.height;return(t.width!==i||t.height!==n)&&(t.setSize(i,n),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(n,r)},resize:function(t,e){var i=this.zoom,n=this.autoRound;n&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,s=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),n&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var o=this.canvas.style,a=t*i,h=e*i;return n&&(a=Math.floor(a),h=Math.floor(h)),a===t&&h===e||(o.width=a+"px",o.height=h+"px"),this.refresh(r,s)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,r=i.style;r.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",r.marginLeft=n.marginLeft,r.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=c(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,r=this.gameSize.width,s=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(r*o,s*o),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=f(this.parentSize.width,this.gameSize.width,0,!0),e=f(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,r=e.getBoundingClientRect(),s=r.width,o=r.height,a=Math.floor((this.parentSize.width-s)/2),h=Math.floor((this.parentSize.height-o)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}return this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas)),this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.updateBounds(),t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available&&(e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)},["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1))},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1),["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=g},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(76),o=i(3),a=new r({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(s(t,this.snapTo.x)),this._height=this.getNewHeight(s(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(s(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(s(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(s(t,this.snapTo.x)),this._height=this.getNewHeight(s(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,r=0===e?1:t/e;return i&&this.aspectRatio>r||!i&&this.aspectRatio<r?(e=(t=s(t,n.x))/this.aspectRatio,n.y>0&&(t=(e=s(e,n.y))*this.aspectRatio)):(i&&this.aspectRatio<r||!i&&this.aspectRatio>r)&&(t=(e=s(e,n.y))*this.aspectRatio,n.x>0&&(e=(t=s(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(142),s=i(21),o=i(22),a=i(6),h=i(91),l=i(1),c=i(412),u=i(201),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)this._pending.push({key:"default",scene:e[i],autoStart:0===i,data:{}})}t.events.once(o.READY,this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var t,e,i,n;for(t=0;t<this._pending.length;t++){var r;i=(e=this._pending[t]).key,(n=e.scene)instanceof c?r=this.createSceneFromInstance(i,n):"object"==typeof n?r=this.createSceneFromObject(i,n):"function"==typeof n&&(r=this.createSceneFromFunction(i,n)),i=r.sys.settings.key,this.keys[i]=r,this.scenes.push(r),this._data[i]&&(r.sys.settings.data=this._data[i].data,this._data[i].autoStart&&(e.autoStart=!0)),(e.autoStart||r.sys.settings.active)&&this._start.push(i)}for(this._pending.length=0,this._data={},this.isBooted=!0,t=0;t<this._start.length;t++)e=this._start[t],this.start(e);this._start.length=0}},processQueue:function(){var t=this._pending.length,e=this._queue.length;if(0!==t||0!==e){var i,n;if(t){for(i=0;i<t;i++)n=this._pending[i],this.add(n.key,n.scene,n.autoStart,n.data);for(i=0;i<this._start.length;i++)n=this._start[i],this.start(n);return this._start.length=0,void(this._pending.length=0)}for(i=0;i<this._queue.length;i++)this[(n=this._queue[i]).op](n.keyA,n.keyB);this._queue.length=0}},add:function(t,e,i,n){return void 0===i&&(i=!1),void 0===n&&(n={}),this.isProcessing||!this.isBooted?(this._pending.push({key:t,scene:e,autoStart:i,data:n}),this.isBooted||(this._data[t]={data:n}),null):(t=this.getKey(t,e),e instanceof c?r=this.createSceneFromInstance(t,e):"object"==typeof e?(e.key=t,r=this.createSceneFromObject(t,e)):"function"==typeof e&&(r=this.createSceneFromFunction(t,e)),r.sys.settings.data=n,t=r.sys.settings.key,this.keys[t]=r,this.scenes.push(r),(i||r.sys.settings.active)&&(this._pending.length?this._start.push(t):this.start(t)),r);var r},remove:function(t){if(this.isProcessing)this._queue.push({op:"remove",keyA:t,keyB:null});else{var e=this.getScene(t);if(!e||e.sys.isTransitioning())return this;var i=this.scenes.indexOf(e),n=e.sys.settings.key;i>-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,n.data),n.status=r.INIT,n.isTransition&&i.events.emit(s.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=r.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>r.START&&n.settings.status<=r.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e<this.scenes.length;e++){var i=this.scenes[e].sys;i.settings.visible&&i.settings.status>=r.LOADING&&i.settings.status<r.SLEEPING&&i.render(t)}this.isProcessing=!1},create:function(t){var e=t.sys,i=e.settings;t.create&&(i.status=r.CREATING,t.create.call(t,i.data),i.status===r.DESTROYED)||(i.isTransition&&e.events.emit(s.TRANSITION_START,i.transitionFrom,i.transitionDuration),t.update&&(e.sceneUpdate=t.update),i.status=r.RUNNING,e.events.emit(s.CREATE,t))},createSceneFromFunction:function(t,e){var i=new e;if(i instanceof c){var n=i.sys.settings.key;if(""!==n&&(t=n),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return this.createSceneFromInstance(t,i)}return i.sys=new u(i),i.sys.settings.key=t,i.sys.init(this.game),i},createSceneFromInstance:function(t,e){return""===e.sys.settings.key&&(e.sys.settings.key=t),e.sys.init(this.game),e},createSceneFromObject:function(t,e){var i=new c(e),n=i.sys.settings.key;""!==n?t=n:i.sys.settings.key=t,i.sys.init(this.game);for(var r=["init","preload","create","update","render"],s=0;s<r.length;s++){var o=a(e,r[s],null);o&&(i[r[s]]=o)}if(e.hasOwnProperty("extend"))for(var h in e.extend)if(e.extend.hasOwnProperty(h)){var l=e.extend[h];"data"===h&&i.hasOwnProperty("data")&&"object"==typeof l?i.data.merge(l):"sys"!==h&&(i[h]=l)}return i},getKey:function(t,e){if(t||(t="default"),"function"==typeof e)return t;if(e instanceof c?t=e.sys.settings.key:"object"==typeof e&&e.hasOwnProperty("key")&&(t=e.key),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return t},getScenes:function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1);for(var i=[],n=this.scenes,r=0;r<n.length;r++){var s=n[r];s&&(!t||t&&s.sys.isActive())&&i.push(s)}return e?i.reverse():i},getScene:function(t){if("string"==typeof t){if(this.keys[t])return this.keys[t]}else for(var e=0;e<this.scenes.length;e++)if(t===this.scenes[e])return t;return null},isActive:function(t){var e=this.getScene(t);return e?e.sys.isActive():null},isPaused:function(t){var e=this.getScene(t);return e?e.sys.isPaused():null},isVisible:function(t){var e=this.getScene(t);return e?e.sys.isVisible():null},isSleeping:function(t){var e=this.getScene(t);return e?e.sys.isSleeping():null},pause:function(t,e){var i=this.getScene(t);return i&&i.sys.pause(e),this},resume:function(t,e){var i=this.getScene(t);return i&&i.sys.resume(e),this},sleep:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.sleep(e),this},wake:function(t,e){var i=this.getScene(t);return i&&i.sys.wake(e),this},run:function(t,e){var i=this.getScene(t);if(!i){for(var n=0;n<this._pending.length;n++)if(this._pending[n].key===t){this.queueOp("start",t,e);break}return this}i.sys.isSleeping()?i.sys.wake(e):i.sys.isPaused()?i.sys.resume(e):this.start(t,e)},start:function(t,e){if(!this.isBooted)return this._data[t]={autoStart:!0,data:e},this;var i=this.getScene(t);if(i){var n,s=i.sys;if(s.isActive()||s.isPaused())s.shutdown(),s.sceneUpdate=l,s.start(e);else if(s.sceneUpdate=l,s.start(e),s.load&&(n=s.load),n&&s.settings.hasOwnProperty("pack")&&(n.reset(),n.addPack({payload:s.settings.pack})))return s.settings.status=r.LOADING,n.once(h.COMPLETE,this.payloadComplete,this),n.start(),this;this.bootScene(i)}return this},stop:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.shutdown(e),this},switch:function(t,e){var i=this.getScene(t),n=this.getScene(e);return i&&n&&i!==n&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e<this.scenes.length){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.push(i)}}return this},sendToBack:function(t){if(this.isProcessing)this._queue.push({op:"sendToBack",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e>0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),r=this.getAt(i);this.scenes[e]=r,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e<this.scenes.length-1){var i=e+1,n=this.getScene(t),r=this.getAt(i);this.scenes[e]=r,this.scenes[i]=n}}return this},moveAbove:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveAbove",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var r=this.getAt(n);this.scenes.splice(n,1),this.scenes.splice(i+1,0,r)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var r=this.getAt(n);this.scenes.splice(n,1),0===i?this.scenes.unshift(r):this.scenes.splice(i,0,r)}}return this},queueOp:function(t,e,i){return this._queue.push({op:t,keyA:e,keyB:i}),this},swapPosition:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"swapPosition",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(i!==n&&-1!==i&&-1!==n){var r=this.getAt(i);this.scenes[i]=this.scenes[n],this.scenes[n]=r}}return this},dump:function(){for(var t=[],e=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var n=this.scenes[i].sys,s=!n.settings.visible||n.settings.status!==r.RUNNING&&n.settings.status!==r.PAUSED?"[-] ":"[*] ";s+=n.settings.key+" ("+e[n.settings.status]+")",t.push(s)}console.log(t.join("\n"))},destroy:function(){for(var t=0;t<this.scenes.length;t++)this.scenes[t].sys.destroy();this.update=l,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null}});t.exports=d},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(201),s=new n({initialize:function(t){this.sys=new r(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(2),r=i(202);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var s=[];if(e&&s.push(r(e+"Physics")),i)for(var o in i)o=r(o.concat("Physics")),-1===s.indexOf(o)&&s.push(o);return s}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(2);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(142),r=i(6),s=i(143),o=i(974),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:n.PENDING,key:r(t,"key",""),active:r(t,"active",!1),visible:r(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:r(t,"pack",!1),cameras:r(t,"cameras",null),map:r(t,"map",s(o,r(t,"mapAdd",{}))),physics:r(t,"physics",{}),loader:r(t,"loader",{}),plugins:r(t,"plugins",!1),input:r(t,"input",{})}}};t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(31),r=i(417),s=i(0),o=i(37),a=i(32),h=i(9),l=i(103),c=i(22),u=i(382),d=i(6),p=i(419),f=i(203),m=new s({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=n.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once(c.BOOT,this.boot,this)},boot:function(){this.on(l.LOAD,this.updatePending,this),this.on(l.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this._pending=3,this.game.events.once(c.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(l.LOAD),this.off(l.ERROR),this.emit(l.READY))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(t.destroy(),this.emit(l.REMOVE,t.key)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,n=new Image;n.onerror=function(){i.emit(l.ERROR,t)},n.onload=function(){var e=i.create(t,n);p.Image(e,0),i.emit(l.ADD,t,e),i.emit(l.LOAD,t,e)},n.src=e}return this},getBase64:function(t,e,i,r){void 0===i&&(i="image/png"),void 0===r&&(r=.92);var s="",o=this.getFrame(t,e);if(o&&(o.source.isRenderTexture||o.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(o){var a=o.canvasData,h=n.create2D(this,a.width,a.height);h.getContext("2d").drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),s=h.toDataURL(i,r),n.remove(h)}return s},addImage:function(t,e,i){var n=null;return this.checkKey(t)&&(n=this.create(t,e),p.Image(n,0),i&&n.setDataSource(i),this.emit(l.ADD,t,n)),n},addGLTexture:function(t,e,i,n){var r=null;return this.checkKey(t)&&(void 0===i&&(i=e.width),void 0===n&&(n=e.height),(r=this.create(t,e,i,n)).add("__BASE",0,0,0,i,n),this.emit(l.ADD,t,r)),r},addRenderTexture:function(t,e){var i=null;return this.checkKey(t)&&((i=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),this.emit(l.ADD,t,i)),i},generate:function(t,e){if(this.checkKey(t)){var i=n.create(this,1,1);return e.canvas=i,u(e),this.addCanvas(t,i)}return null},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var r=n.create(this,e,i,a.CANVAS,!0);return this.addCanvas(t,r)}return null},addCanvas:function(t,e,i){void 0===i&&(i=!1);var n=null;return i?n=new r(this,t,e,e.width,e.height):this.checkKey(t)&&(n=new r(this,t,e,e.width,e.height),this.list[t]=n,this.emit(l.ADD,t,n)),n},addAtlas:function(t,e,i,n){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,n):this.addAtlasJSONHash(t,e,i,n)},addAtlasJSONArray:function(t,e,i,n){var r=null;if(this.checkKey(t)){if(r=this.create(t,e),Array.isArray(i))for(var s=1===i.length,o=0;o<r.source.length;o++){var a=s?i[0]:i[o];p.JSONArray(r,o,a)}else p.JSONArray(r,0,i);n&&r.setDataSource(n),this.emit(l.ADD,t,r)}return r},addAtlasJSONHash:function(t,e,i,n){var r=null;if(this.checkKey(t)){if(r=this.create(t,e),Array.isArray(i))for(var s=0;s<i.length;s++)p.JSONHash(r,s,i[s]);else p.JSONHash(r,0,i);n&&r.setDataSource(n),this.emit(l.ADD,t,r)}return r},addAtlasXML:function(t,e,i,n){var r=null;return this.checkKey(t)&&(r=this.create(t,e),p.AtlasXML(r,0,i),n&&r.setDataSource(n),this.emit(l.ADD,t,r)),r},addUnityAtlas:function(t,e,i,n){var r=null;return this.checkKey(t)&&(r=this.create(t,e),p.UnityYAML(r,0,i),n&&r.setDataSource(n),this.emit(l.ADD,t,r)),r},addSpriteSheet:function(t,e,i){var n=null;if(this.checkKey(t)){var r=(n=this.create(t,e)).source[0].width,s=n.source[0].height;p.SpriteSheet(n,0,0,0,r,s,i),this.emit(l.ADD,t,n)}return n},addSpriteSheetFromAtlas:function(t,e){if(!this.checkKey(t))return null;var i=d(e,"atlas",null),n=d(e,"frame",null);if(i&&n){var r=this.get(i).get(n);if(r){var s=this.create(t,r.source.image);return r.trimmed?p.SpriteSheetFromAtlas(s,r,e):p.SpriteSheet(s,0,r.cutX,r.cutY,r.cutWidth,r.cutHeight,e),this.emit(l.ADD,t,s),s}}},create:function(t,e,i,n){var r=null;return this.checkKey(t)&&(r=new f(this,t,e,i,n),this.list[t]=r),r},exists:function(t){return this.list.hasOwnProperty(t)},get:function(t){return void 0===t&&(t="__DEFAULT"),this.list[t]?this.list[t]:t instanceof f?t:this.list.__MISSING},cloneFrame:function(t,e){if(this.list[t])return this.list[t].get(e).clone()},getFrame:function(t,e){if(this.list[t])return this.list[t].get(e)},getTextureKeys:function(){var t=[];for(var e in this.list)"__DEFAULT"!==e&&"__MISSING"!==e&&t.push(e);return t},getPixel:function(t,e,i,n){var r=this.getFrame(i,n);if(r){t-=r.x,e-=r.y;var s=r.data.cut;if(t+=s.x,e+=s.y,t>=s.x&&t<s.r&&e>=s.y&&e<s.b){var a=this._tempContext;a.clearRect(0,0,1,1),a.drawImage(r.source.image,t,e,1,1,0,0,1,1);var h=a.getImageData(0,0,1,1);return new o(h.data[0],h.data[1],h.data[2],h.data[3])}}return null},getPixelAlpha:function(t,e,i,n){var r=this.getFrame(i,n);if(r){t-=r.x,e-=r.y;var s=r.data.cut;if(t+=s.x,e+=s.y,t>=s.x&&t<s.r&&e>=s.y&&e<s.b){var o=this._tempContext;return o.clearRect(0,0,1,1),o.drawImage(r.source.image,t,e,1,1,0,0,1,1),o.getImageData(0,0,1,1).data[3]}}return null},setTexture:function(t,e,i){return this.list[e]&&(t.texture=this.list[e],t.frame=t.texture.get(i)),t},renameTexture:function(t,e){var i=this.get(t);return!(!i||t===e||(i.key=e,this.list[e]=i,delete this.list[t],0))},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var r in this.list)i[0]=this.list[r],t.apply(e,i)},destroy:function(){for(var t in this.list)this.list[t].destroy();this.list={},this.game=null,n.remove(this._tempCanvas)}});t.exports=m},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(18),s=i(37),o=i(32),a=i(136),h=i(203),l=new n({Extends:h,initialize:function(t,e,i,n,r){h.call(this,t,e,i,n,r),this.add("__BASE",0,0,0,n,r),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=n,this.height=r,this.imageData=this.context.getImageData(0,0,n,r),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===o.WEBGL&&this.refresh(),this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var r=this.manager.getFrame(t,e);if(r){var s=r.canvasData,o=r.cutWidth,a=r.cutHeight,h=r.source.resolution;return this.context.drawImage(r.source.image,s.x,s.y,o,a,i,n,o/h,a/h),this.update()}return this},setPixel:function(t,e,i,n,r,s){if(void 0===s&&(s=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=n,o.data[2]=r,o.data[3]=s,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,n,r,s,o){return void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,n,r,s,o),this},getData:function(t,e,i,n){return t=r(Math.floor(t),0,this.width-1),e=r(Math.floor(e),0,this.height-1),i=r(i,1,this.width-t),n=r(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i||(i=new s);var n=this.getIndex(t,e);if(n>-1){var r=this.data,o=r[n+0],a=r[n+1],h=r[n+2],l=r[n+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=r(t,0,this.width),a=r(t+i,0,this.width),h=r(e,0,this.height),l=r(e+n,0,this.height),c=new s,u=[],d=h;d<l;d++){for(var p=[],f=o;f<a;f++)c=this.getPixel(f,d,c),p.push({x:f,y:d,color:c.color,alpha:c.alphaGL});u.push(p)}return u},getIndex:function(t,e){return t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e)),t<this.width&&e<this.height?4*(t+e*this.width):-1},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=this.height),this.context.clearRect(t,e,i,n),this.update()},setSize:function(t,e){return void 0===e&&(e=t),t===this.width&&e===this.height||(this.canvas.width=t,this.canvas.height=e,this._source.width=t,this._source.height=e,this._source.isPowerOf2=a(t,e),this.frames.__BASE.setSize(t,e,0,0),this.width=t,this.height=e,this.refresh()),this},destroy:function(){h.prototype.destroy.call(this),this._source=null,this.canvas=null,this.context=null,this.imageData=null,this.data=null,this.pixels=null,this.buffer=null}});t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(31),r=i(0),s=i(136),o=i(164),a=new r({initialize:function(t,e,i,n,r){void 0===r&&(r=!1);var a=t.manager.game;this.renderer=a.renderer,this.texture=t,this.source=e,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=n||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=s(this.width,this.height),this.glTexture=null,this.glIndex=0,this.glIndexCounter=-1,this.flipY=r,this.init(a)},init:function(t){var e=this.renderer;e&&(e.gl?this.isCanvas?this.glTexture=e.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=e.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=e.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.glTexture=e.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer.gl;t&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):t&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture,!1),this.isCanvas&&n.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={AtlasXML:i(975),Canvas:i(976),Image:i(977),JSONArray:i(978),JSONHash:i(979),SpriteSheet:i(980),SpriteSheetFromAtlas:i(981),UnityYAML:i(982)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(421),r=i(424),s=i(426),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new r(t):i.webAudio&&!e.disableWebAudio?new s(t):new n(t)}};t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(144),r=i(0),s=i(69),o=i(423),a=new r({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var n=0;n<i.length;n++)if("true"===i[n].dataset.locked)return t.locked=!0,!1;return!0})),this.locked){var e=!1,i=function(){e=!0},n=function(){if(e)e=!1;else{document.body.removeEventListener("touchmove",i),document.body.removeEventListener("touchend",n);var r=[];if(t.game.cache.audio.entries.each((function(t,e){for(var i=0;i<e.length;i++){var n=e[i];"true"===n.dataset.locked&&r.push(n)}return!0})),0!==r.length){var s=r[r.length-1];s.oncanplaythrough=function(){s.oncanplaythrough=null,r.forEach((function(t){t.dataset.locked="false"})),t.unlocked=!0},r.forEach((function(t){t.load()}))}}};this.once(s.UNLOCKED,(function(){for(this.forEachActiveSound((function(t){null===t.currentMarker&&0===t.duration&&(t.duration=t.tags[0].duration),t.totalDuration=t.tags[0].duration}));this.lockedActionsQueue.length;){var t=this.lockedActionsQueue.shift();t.sound[t.prop].apply?t.sound[t.prop].apply(t.sound,t.value||[]):t.sound[t.prop]=t.value}}),this),document.body.addEventListener("touchmove",i,!1),document.body.addEventListener("touchend",n,!1)}},onBlur:function(){this.forEachActiveSound((function(t){t.isPlaying&&(this.onBlurPausedSounds.push(t),t.onBlur())}))},onFocus:function(){this.onBlurPausedSounds.forEach((function(t){t.onFocus()})),this.onBlurPausedSounds.length=0},destroy:function(){n.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(t,e,i){return"true"===t.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:t,prop:e,value:i}),!0)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return this._mute},set:function(t){this._mute=t,this.forEachActiveSound((function(t){t.updateMute()})),this.emit(s.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this._volume},set:function(t){this._volume=t,this.forEachActiveSound((function(t){t.updateVolume()})),this.emit(s.GLOBAL_VOLUME,this,t)}}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(78);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var o=r;o<s;o++){var a=t[o];if(!e||e&&void 0===i&&a.hasOwnProperty(e)||e&&void 0!==i&&a[e]===i)return a}return null}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(145),r=i(0),s=i(69),o=i(18),a=new r({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,n.call(this,t,e,i)},play:function(t,e){return!(this.manager.isLocked(this,"play",[t,e])||!n.prototype.play.call(this,t,e)||!this.pickAndPlayAudioTag()||(this.emit(s.PLAY,this),0))},pause:function(){return!(this.manager.isLocked(this,"pause")||this.startTime>0||!n.prototype.pause.call(this)||(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(s.PAUSE,this),0))},resume:function(){return!(this.manager.isLocked(this,"resume")||this.startTime>0||!n.prototype.resume.call(this)||!this.pickAndPlayAudioTag()||(this.emit(s.RESUME,this),0))},stop:function(){return!this.manager.isLocked(this,"stop")&&!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(s.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t<this.tags.length;t++){var e=this.tags[t];if("false"===e.dataset.used)return e.dataset.used="true",this.audio=e,!0}if(!this.manager.override)return!1;var i=[];this.manager.forEachActiveSound((function(t){t.key===this.key&&t.audio&&i.push(t)}),this),i.sort((function(t,e){return t.loop===e.loop?e.seek/e.duration-t.seek/t.duration:t.loop?1:-1}));var n=i[0];return this.audio=n.audio,n.reset(),n.audio=null,n.startTime=0,n.previousTime=0,!0},playCatchPromise:function(){var t=this.audio.play();t&&t.catch((function(t){console.warn(t)}))},stopAndReleaseAudioTag:function(){this.startTime=0,this.previousTime=0,this.audio&&(this.audio.pause(),this.audio.dataset.used="false",this.audio=null)},reset:function(){n.prototype.stop.call(this)},onBlur:function(){this.isPlaying=!1,this.isPaused=!0,this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.currentConfig.delay=Math.max(0,(this.startTime-window.performance.now())/1e3),this.stopAndReleaseAudioTag()},onFocus:function(){this.isPlaying=!0,this.isPaused=!1,this.pickAndPlayAudioTag()},update:function(t){if(this.isPlaying)if(this.startTime>0)this.startTime<t-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,t-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var e=this.currentMarker?this.currentMarker.start:0,i=e+this.duration,n=this.audio.currentTime;if(this.currentConfig.loop)n>=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,n-i),n=this.audio.currentTime):n<e&&(this.audio.currentTime+=e,n=this.audio.currentTime),n<this.previousTime&&this.emit(s.LOOPED,this);else if(n>=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(s.COMPLETE,this);this.previousTime=n}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=o(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(s.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(s.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,s.RATE,t)||(this.calculateRate(),this.emit(s.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,s.DETUNE,t)||(this.calculateRate(),this.emit(s.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(s.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(s.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(s.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(144),r=i(0),s=i(9),o=i(425),a=i(1),h=new r({Extends:s,initialize:function(t){s.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(145),r=i(0),s=i(9),o=i(17),a=function(){return!1},h=function(){return this},l=new r({Extends:s,initialize:function(t,e,i){void 0===i&&(i={}),s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:a,updateMarker:a,removeMarker:function(){return null},play:a,pause:a,resume:a,stop:a,destroy:function(){n.prototype.destroy.call(this)},setMute:h,setVolume:h,setRate:h,setDetune:h,setSeek:h,setLoop:h,setPan:h});t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(427),r=i(144),s=i(0),o=i(69),a=i(22),h=i(428),l=new s({Extends:r,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),r.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(a.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):new AudioContext},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var r=this.game.cache.audio,s=i.length,a=0;a<i.length;a++){var h=i[a],l=h.key,c=h.data;"string"==typeof c&&(c=n(c));var u=function(t,e){r.add(t,e),this.emit(o.DECODED,t),0==--s&&this.emit(o.DECODED_ALL)}.bind(this,l),d=function(t,e){console.error("Error decoding audio: "+t+" - ",e?e.message:""),0==--s&&this.emit(o.DECODED_ALL)}.bind(this,l);this.context.decodeAudioData(c,u,d)}},unlock:function(){var t=this,e=document.body,i=function i(){t.context&&t.context.resume().then((function(){e.removeEventListener("touchstart",i),e.removeEventListener("touchend",i),e.removeEventListener("click",i),e.removeEventListener("keydown",i),t.unlocked=!0}),(function(){e.removeEventListener("touchstart",i),e.removeEventListener("touchend",i),e.removeEventListener("click",i),e.removeEventListener("keydown",i)}))};e&&(e.addEventListener("touchstart",i,!1),e.addEventListener("touchend",i,!1),e.addEventListener("click",i,!1),e.addEventListener("keydown",i,!1))},onBlur:function(){this.locked||this.context.suspend()},onFocus:function(){this.locked||this.context.resume()},destroy:function(){if(this.destination=null,this.masterVolumeNode.disconnect(),this.masterVolumeNode=null,this.masterMuteNode.disconnect(),this.masterMuteNode=null,this.game.config.audio.context)this.context.suspend();else{var t=this;this.context.close().then((function(){t.context=null}))}r.prototype.destroy.call(this)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(t){this.masterMuteNode.gain.setValueAtTime(t?0:1,0),this.emit(o.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(t){this.masterVolumeNode.gain.setValueAtTime(t,0),this.emit(o.GLOBAL_VOLUME,this,t)}}});t.exports=l},function(t,e){for(
|
|
/**
|
|
* @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer)
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r<i.length;r++)n[i.charCodeAt(r)]=r;t.exports=function(t){var e,i,r,s,o=(t=t.substr(t.indexOf(",")+1)).length,a=.75*o,h=0;"="===t[o-1]&&(a--,"="===t[o-2]&&a--);for(var l=new ArrayBuffer(a),c=new Uint8Array(l),u=0;u<o;u+=4)e=n[t.charCodeAt(u)],i=n[t.charCodeAt(u+1)],r=n[t.charCodeAt(u+2)],s=n[t.charCodeAt(u+3)],c[h++]=e<<2|i>>4,c[h++]=(15&i)<<4|r>>2,c[h++]=(3&r)<<6|63&s;return l}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(145),r=i(0),s=i(69),o=new r({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(s.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime<this.startTime||!n.prototype.pause.call(this)||(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit(s.PAUSE,this),0))},resume:function(){return!(this.manager.context.currentTime<this.startTime||!n.prototype.resume.call(this)||(this.createAndStartBufferSource(),this.emit(s.RESUME,this),0))},stop:function(){return!!n.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit(s.STOP,this),!0)},createAndStartBufferSource:function(){var t=this.currentConfig.seek,e=this.currentConfig.delay,i=this.manager.context.currentTime+e,n=(this.currentMarker?this.currentMarker.start:0)+t,r=this.duration-t;this.playTime=i-t,this.startTime=i,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,i),Math.max(0,n),Math.max(0,r)),this.resetConfig()},createAndStartLoopBufferSource:function(){var t=this.getLoopTime(),e=this.currentMarker?this.currentMarker.start:0,i=this.duration;this.loopTime=t,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,t),Math.max(0,e),Math.max(0,i))},createBufferSource:function(){var t=this,e=this.manager.context.createBufferSource();return e.buffer=this.audioBuffer,e.connect(this.muteNode),e.onended=function(e){e.target===t.source&&(t.currentConfig.loop?t.hasLooped=!0:t.hasEnded=!0)},e},stopAndRemoveBufferSource:function(){this.source&&(this.source.stop(),this.source.disconnect(),this.source=null),this.playTime=0,this.startTime=0,this.stopAndRemoveLoopBufferSource()},stopAndRemoveLoopBufferSource:function(){this.loopSource&&(this.loopSource.stop(),this.loopSource.disconnect(),this.loopSource=null),this.loopTime=0},applyConfig:function(){this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:1}),n.prototype.applyConfig.call(this)},update:function(){this.hasEnded?(this.hasEnded=!1,n.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit(s.COMPLETE,this)):this.hasLooped&&(this.hasLooped=!1,this.source=this.loopSource,this.loopSource=null,this.playTime=this.startTime=this.loopTime,this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:this.totalRate}),this.createAndStartLoopBufferSource(),this.emit(s.LOOPED,this))},destroy:function(){n.prototype.destroy.call(this),this.audioBuffer=null,this.stopAndRemoveBufferSource(),this.muteNode.disconnect(),this.muteNode=null,this.volumeNode.disconnect(),this.volumeNode=null,this.pannerNode&&(this.pannerNode.disconnect(),this.pannerNode=null),this.rateUpdates.length=0,this.rateUpdates=null},calculateRate:function(){n.prototype.calculateRate.call(this);var t=this.manager.context.currentTime;this.source&&"number"==typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,t),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,t)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var t=0,e=0;e<this.rateUpdates.length;e++)t+=((e<this.rateUpdates.length-1?this.rateUpdates[e+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[e].time)*this.rateUpdates[e].rate;return t},getLoopTime:function(){for(var t=0,e=0;e<this.rateUpdates.length-1;e++)t+=(this.rateUpdates[e+1].time-this.rateUpdates[e].time)*this.rateUpdates[e].rate;var i=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+i.time+(this.duration-t)/i.rate},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.calculateRate(),this.emit(s.RATE,this,t)}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.calculateRate(),this.emit(s.DETUNE,this,t)}},setDetune:function(t){return this.detune=t,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(t){this.currentConfig.mute=t,this.muteNode.gain.setValueAtTime(t?0:1,0),this.emit(s.MUTE,this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(t){this.currentConfig.volume=t,this.volumeNode.gain.setValueAtTime(t,0),this.emit(s.VOLUME,this,t)}},setVolume:function(t){return this.volume=t,this},seek:{get:function(){return this.isPlaying?this.manager.context.currentTime<this.startTime?this.startTime-this.playTime:this.getCurrentTime():this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.currentConfig.seek=t,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),this.emit(s.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.isPlaying&&(this.stopAndRemoveLoopBufferSource(),t&&this.createAndStartLoopBufferSource()),this.emit(s.LOOP,this,t)}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.pannerNode?this.pannerNode.pan.value:0},set:function(t){this.currentConfig.pan=t,this.pannerNode&&this.pannerNode.pan.setValueAtTime(t,this.manager.context.currentTime),this.emit(s.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r<i;r++){n[r]=new Array(e);for(var s=e-1;s>-1;s--)n[r][s]=t[s][r]}return n}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return t<e?-1:t>e?1:0}var r=function(t,e,s,o,a){for(void 0===s&&(s=0),void 0===o&&(o=t.length-1),void 0===a&&(a=n);o>s;){if(o-s>600){var h=o-s+1,l=e-s+1,c=Math.log(h),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(h-u)/h)*(l-h/2<0?-1:1),p=Math.max(s,Math.floor(e-l*u/h+d)),f=Math.min(o,Math.floor(e+(h-l)*u/h+d));r(t,e,p,f,a)}var m=t[e],g=s,v=o;for(i(t,s,e),a(t[o],m)>0&&i(t,s,o);g<v;){for(i(t,g,v),g++,v--;a(t[g],m)<0;)g++;for(;a(t[v],m)>0;)v--}0===a(t[s],m)?i(t,s,v):i(t,++v,o),v<=e&&(s=v+1),e<=v&&(o=v-1)}};t.exports=r},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(6),r=i(129),s=function(t,e,i){for(var n=[],r=0;r<t.length;r++)for(var s=0;s<e.length;s++)for(var o=0;o<i;o++)n.push({a:t[r],b:e[s]});return n};t.exports=function(t,e,i){var o=n(i,"max",0),a=n(i,"qty",1),h=n(i,"random",!1),l=n(i,"randomB",!1),c=n(i,"repeat",0),u=n(i,"yoyo",!1),d=[];if(l&&r(e),-1===c)if(0===o)c=0;else{var p=t.length*e.length*a;u&&(p*=2),c=Math.ceil(o/p)}for(var f=0;f<=c;f++){var m=s(t,e,a);h&&r(m),d=d.concat(m),u&&(m.reverse(),d=d.concat(m))}return o&&d.splice(o),d}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={PROCESS_QUEUE_ADD:i(1035),PROCESS_QUEUE_REMOVE:i(1036)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(13);t.exports=function(t,e){var i=n(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var r=t.anims,s=n(i,"key",void 0);if(s){var o=n(i,"startFrame",void 0),a=n(i,"delay",0),h=n(i,"repeat",0),l=n(i,"repeatDelay",0),c=n(i,"yoyo",!1),u=n(i,"play",!1),d=n(i,"delayedPlay",0),p={key:s,delay:a,repeat:h,repeatDelay:l,yoyo:c,startFrame:o};u?r.play(p):d>0?r.playAfterDelay(p,d):r.load(p)}}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(106),s=new n({initialize:function(t,e,i,n,r){this.parent=t,this.x=e,this.y=i,this.frame=n,this.data={},this.tint=16777215,this._visible=r,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof r&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=Math.min(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-r,a=Math.max(t.bottom,e.bottom)-s;return i.setTo(r,s,o,a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(1049),o=i(15),a=i(7),h=i(199),l=i(21),c=i(138),u=new n({Extends:o,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Origin,r.ScrollFactor,r.Transform,r.Visible,s],initialize:function(t,e,i,n,r,s){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new c,this.rotate3dAngle="deg",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof n?"#"===n[0]?this.setElement(n.substr(1),r,s):this.createElement(n,r,s):n&&this.setElement(n,r,s),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e<t.length;e++)this.node.addEventListener(t[e],this.handler,!1)}return this},removeListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e<t.length;e++)this.node.removeEventListener(t[e],this.handler)}return this},dispatchNativeEvent:function(t){this.emit(t.type,t)},createElement:function(t,e,i){return this.setElement(document.createElement(t),e,i)},setElement:function(t,e,i){var n;if(this.removeElement(),"string"==typeof t?("#"===t[0]&&(t=t.substr(1)),n=document.getElementById(t)):"object"==typeof t&&1===t.nodeType&&(n=t),!n)return this;if(this.node=n,e&&a(e))for(var r in e)n.style[r]=e[r];else"string"==typeof e&&(n.style=e);return n.style.zIndex="0",n.style.display="inline",n.style.position="absolute",n.phaser=this,this.parent&&this.parent.appendChild(n),i&&(n.innerText=i),this.updateSize()},createFromCache:function(t,e){var i=this.cache.get(t);return i&&this.createFromHTML(i,e),this},createFromHTML:function(t,e){void 0===e&&(e="div"),this.removeElement();var i=document.createElement(e);return this.node=i,i.style.zIndex="0",i.style.display="inline",i.style.position="absolute",i.phaser=this,this.parent&&this.parent.appendChild(i),i.innerHTML=t,this.updateSize()},removeElement:function(){return this.node&&(h(this.node),this.node=null),this},updateSize:function(){var t=this.node,e=t.getBoundingClientRect();return this.width=t.clientWidth,this.height=t.clientHeight,this.displayWidth=e.width||0,this.displayHeight=e.height||0,this},getChildByProperty:function(t,e){if(this.node)for(var i=this.node.querySelectorAll("*"),n=0;n<i.length;n++)if(i[n][t]===e)return i[n];return null},getChildByID:function(t){return this.getChildByProperty("id",t)},getChildByName:function(t){return this.getChildByProperty("name",t)},setClassName:function(t){return this.node&&(this.node.className=t,this.updateSize()),this},setText:function(t){return this.node&&(this.node.innerText=t,this.updateSize()),this},setHTML:function(t){return this.node&&(this.node.innerHTML=t,this.updateSize()),this},preUpdate:function(){var t=this.parentContainer,e=this.node;e&&t&&!t.willRender()&&(e.style.display="none")},willRender:function(){return!0},preDestroy:function(){this.removeElement(),this.scene.sys.events.off(l.SLEEP,this.handleSceneEvent,this),this.scene.sys.events.off(l.WAKE,this.handleSceneEvent,this)}});t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1050),r=i(15),s=i(25),o=new s,a=new s,h=new s;t.exports=function(t,e,i,s){var l=e.node,c=l.style,u=e.scene.sys.settings;if(!(l&&c&&u.visible&&r.RENDER_MASK===e.renderFlags)||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l&&(c.display="none");else{var d=e.parentContainer,p=i.alpha*e.alpha;d&&(p*=d.alpha);var f=o,m=a,g=h,v=0,y=0,x="0%",b="0%";s?(v=e.width*e.scaleX*e.originX,y=e.height*e.scaleY*e.originY,m.applyITRS(e.x-v,e.y-y,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),f.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),m.e=e.x-v,m.f=e.y-y,f.multiply(m,g)):(v=e.width*e.originX,y=e.height*e.originY,m.applyITRS(e.x-v,e.y-y,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),x=100*e.originX+"%",b=100*e.originY+"%",m.e-=i.scrollX*e.scrollFactorX,m.f-=i.scrollY*e.scrollFactorY,f.multiply(m,g)),e.transformOnly||(c.display="block",c.opacity=p,c.zIndex=e._depth,c.pointerEvents="auto",c.mixBlendMode=n[e._blendMode]),c.transform=g.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",c.transformOrigin=x+" "+b}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(15),o=i(1054),a=new n({Extends:s,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.Origin,r.ScrollFactor,r.Size,r.Texture,r.Tint,r.Transform,r.Visible,o],initialize:function(t){s.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(215),r=i(95),s=i(14),o=i(4);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=r(e,0,s.PI2);return n(t,a,i)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(441),r=i(215),s=i(95),o=i(14);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=n(t)/i);for(var h=0;h<e;h++){var l=s(h/e,0,o.PI2);a.push(r(t,l))}return a}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(214),r=i(30);t.exports=function(t,e,i,s,o,a){var h=e.commandBuffer,l=h.length,c=o||t.currentContext;if(0!==l&&r(t,c,e,i,s)){i.addToRenderList(e);var u=1,d=1,p=0,f=0,m=1,g=0,v=0,y=0;c.beginPath();for(var x=0;x<l;++x)switch(h[x]){case n.ARC:c.arc(h[x+1],h[x+2],h[x+3],h[x+4],h[x+5],h[x+6]),x+=7;break;case n.LINE_STYLE:m=h[x+1],p=h[x+2],u=h[x+3],g=(16711680&p)>>>16,v=(65280&p)>>>8,y=255&p,c.strokeStyle="rgba("+g+","+v+","+y+","+u+")",c.lineWidth=m,x+=3;break;case n.FILL_STYLE:f=h[x+1],d=h[x+2],g=(16711680&f)>>>16,v=(65280&f)>>>8,y=255&f,c.fillStyle="rgba("+g+","+v+","+y+","+d+")",x+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:a||c.fill();break;case n.STROKE_PATH:a||c.stroke();break;case n.FILL_RECT:a?c.rect(h[x+1],h[x+2],h[x+3],h[x+4]):c.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(h[x+1],h[x+2]),c.lineTo(h[x+3],h[x+4]),c.lineTo(h[x+5],h[x+6]),c.closePath(),a||c.fill(),x+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(h[x+1],h[x+2]),c.lineTo(h[x+3],h[x+4]),c.lineTo(h[x+5],h[x+6]),c.closePath(),a||c.stroke(),x+=6;break;case n.LINE_TO:c.lineTo(h[x+1],h[x+2]),x+=2;break;case n.MOVE_TO:c.moveTo(h[x+1],h[x+2]),x+=2;break;case n.LINE_FX_TO:c.lineTo(h[x+1],h[x+2]),x+=5;break;case n.MOVE_FX_TO:c.moveTo(h[x+1],h[x+2]),x+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(h[x+1],h[x+2]),x+=2;break;case n.SCALE:c.scale(h[x+1],h[x+2]),x+=2;break;case n.ROTATE:c.rotate(h[x+1]),x+=1;break;case n.GRADIENT_FILL_STYLE:x+=5;break;case n.GRADIENT_LINE_STYLE:x+=6}c.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(135),s=i(80),o=i(2),a=i(66),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if(this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,"number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&this.hasBoth(t,"start","end")){this.start=t.start,this.end=t.end;var i=this.has(t,"random");if(i&&(this.onEmit=this.randomRangedValueEmit),this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var n=this.has(t,"ease")?t.ease:"Linear";this.ease=s(n,t.easeParams),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else if("object"===e&&this.hasBoth(t,"min","max"))this.start=t.min,this.end=t.max,this.onEmit=this.randomRangedValueEmit;else if("object"===e&&this.has(t,"random")){var r=t.random;Array.isArray(r)&&(this.start=r[0],this.end=r[1]),this.onEmit=this.randomRangedValueEmit}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=r(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=new n({initialize:function(t,e,i,n,s){if("object"==typeof t){var o=t;t=r(o,"x",0),e=r(o,"y",0),i=r(o,"power",0),n=r(o,"epsilon",100),s=r(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===s&&(s=50);this.x=t,this.y=e,this.active=!0,this._gravity=s,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,r=i*i+n*n;if(0!==r){var s=Math.sqrt(r);r<this._epsilon&&(r=this._epsilon);var o=this._power*e/(r*s)*100;t.velocityX+=i*o,t.velocityY+=n*o}},epsilon:{get:function(){return Math.sqrt(this._epsilon)},set:function(t){this._epsilon=t*t}},power:{get:function(){return this._power/this._gravity},set:function(t){this._power=t*this._gravity}},gravity:{get:function(){return this._gravity},set:function(t){var e=this.power;this._gravity=t,this.power=e}}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(35),s=i(48),o=new n({initialize:function(t){this.emitter=t,this.frame=null,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),this.x+=void 0===t?i.x.onEmit(this,"x"):t,this.y+=void 0===e?i.y.onEmit(this,"y"):e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=r(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,c=Math.atan2(l-this.y,h-this.x),u=s(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(c)*u,this.velocityY=Math.sin(c)*u}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=r(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,n){var r=this.velocityX,s=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;r+=t.gravityX*i,s+=t.gravityY*i,o&&(r+=o*i),a&&(s+=a*i),r>h?r=h:r<-h&&(r=-h),s>l?s=l:s<-l&&(s=-l),this.velocityX=r,this.velocityY=s;for(var c=0;c<n.length;c++)n[c].update(this,e,i)},checkBounds:function(t){var e=t.bounds,i=-this.bounce;this.x<e.x&&t.collideLeft?(this.x=e.x,this.velocityX*=i):this.x>e.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.y<e.y&&t.collideTop?(this.y=e.y,this.velocityY*=i):this.y>e.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,s=1-this.lifeCurrent/this.life;return this.lifeT=s,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",s,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",s,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",s,this.angle),this.rotation=r(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",s,this.alpha),this.tint=n.tint.onUpdate(this,"tint",s,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(34),r=i(0),s=i(11),o=i(447),a=i(448),h=i(443),l=i(2),c=i(207),u=i(449),d=i(125),p=i(445),f=i(450),m=i(10),g=i(79),v=i(3),y=i(66),x=new r({Mixins:[s.BlendMode,s.Mask,s.ScrollFactor,s.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=p,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",16777215),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new v,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e<this.configFastMap.length;e++)i=this.configFastMap[e],d(t,i)&&(this[i]=l(t,i));for(e=0;e<this.configOpMap.length;e++)i=this.configOpMap[e],d(t,i)&&this[i].loadConfig(t);if(this.acceleration=0!==this.accelerationX.propertyValue||0!==this.accelerationY.propertyValue,this.moveTo=0!==this.moveToX.propertyValue||0!==this.moveToY.propertyValue,d(t,"speed")&&(this.speedX.loadConfig(t,"speed"),this.speedY=null),(u(t,["speedX","speedY"])||this.moveTo)&&(this.radial=!1),d(t,"scale")&&(this.scaleX.loadConfig(t,"scale"),this.scaleY=null),d(t,"callbackScope")){var n=l(t,"callbackScope",null);this.emitCallbackScope=n,this.deathCallbackScope=n}return d(t,"emitZone")&&this.setEmitZone(t.emitZone),d(t,"deathZone")&&this.setDeathZone(t.deathZone),d(t,"bounds")&&this.setBounds(t.bounds),d(t,"followOffset")&&this.followOffset.setFromObject(l(t,"followOffset",0)),d(t,"frame")&&this.setFrame(t.frame),d(t,"reserve")&&this.reserve(t.reserve),this},toJSON:function(t){void 0===t&&(t={});var e=0,i="";for(e=0;e<this.configFastMap.length;e++)t[i=this.configFastMap[e]]=this[i];for(e=0;e<this.configOpMap.length;e++)this[i=this.configOpMap[e]]&&(t[i]=this[i].toJSON());return this.speedY||(delete t.speedX,t.speed=this.speedX.toJSON()),this.scaleY||(delete t.scaleX,t.scale=this.scaleX.toJSON()),t},startFollow:function(t,e,i,n){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=!1),this.follow=t,this.followOffset.set(e,i),this.trackVisible=n,this},stopFollow:function(){return this.follow=null,this.followOffset.set(0,0),this.trackVisible=!1,this},getFrame:function(){if(1===this.frames.length)return this.defaultFrame;if(this.randomFrame)return c(this.frames);var t=this.frames[this.currentFrame];return this._frameCounter++,this._frameCounter===this.frameQuantity&&(this._frameCounter=0,this.currentFrame=y(this.currentFrame+1,0,this._frameLength)),t},setFrame:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomFrame=e,this.frameQuantity=i,this.currentFrame=0,this._frameCounter=0;var n=typeof t;if(Array.isArray(t)||"string"===n||"number"===n)this.manager.setEmitterFrames(t,this);else if("object"===n){var r=t;(t=l(r,"frames",null))&&this.manager.setEmitterFrames(t,this);var s=l(r,"cycle",!1);this.randomFrame=!s,this.frameQuantity=l(r,"quantity",i)}return this._frameLength=this.frames.length,1===this._frameLength&&(this.frameQuantity=1,this.randomFrame=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},setPosition:function(t,e){return this.x.onChange(t),this.y.onChange(e),this},setBounds:function(t,e,i,n){if("object"==typeof t){var r=t;t=r.x,e=r.y,i=d(r,"w")?r.w:r.width,n=d(r,"h")?r.h:r.height}return this.bounds?this.bounds.setTo(t,e,i,n):this.bounds=new m(t,e,i,n),this},setSpeedX:function(t){return this.speedX.onChange(t),this.radial=!1,this},setSpeedY:function(t){return this.speedY&&(this.speedY.onChange(t),this.radial=!1),this},setSpeed:function(t){return this.speedX.onChange(t),this.speedY=null,this.radial=!0,this},setScaleX:function(t){return this.scaleX.onChange(t),this},setScaleY:function(t){return this.scaleY.onChange(t),this},setScale:function(t){return this.scaleX.onChange(t),this.scaleY=null,this},setGravityX:function(t){return this.gravityX=t,this},setGravityY:function(t){return this.gravityY=t,this},setGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setAlpha:function(t){return this.alpha.onChange(t),this},setTint:function(t){return this.tint.onChange(t),this},setEmitterAngle:function(t){return this.angle.onChange(t),this},setAngle:function(t){return this.angle.onChange(t),this},setLifespan:function(t){return this.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity.onChange(t),this},setFrequency:function(t,e){return this.frequency=t,this._counter=0,e&&this.quantity.onChange(e),this},setEmitZone:function(t){if(void 0===t)this.emitZone=null;else{var e=l(t,"type","random"),i=l(t,"source",null);switch(e){case"random":this.emitZone=new f(i);break;case"edge":var n=l(t,"quantity",1),r=l(t,"stepRate",0),s=l(t,"yoyo",!1),o=l(t,"seamless",!0);this.emitZone=new a(i,n,r,s,o)}}return this},setDeathZone:function(t){if(void 0===t)this.deathZone=null;else{var e=l(t,"type","onEnter"),i=l(t,"source",null);if(i&&"function"==typeof i.contains){var n="onEnter"===e;this.deathZone=new o(i,n)}}return this},reserve:function(t){for(var e=this.dead,i=0;i<t;i++)e.push(new this.particleClass(this));return this},getAliveParticleCount:function(){return this.alive.length},getDeadParticleCount:function(){return this.dead.length},getParticleCount:function(){return this.getAliveParticleCount()+this.getDeadParticleCount()},atLimit:function(){return this.maxParticles>0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,r=0;r<n;++r)t.call(e,i[r],this);return this},forEachDead:function(t,e){for(var i=this.dead,n=i.length,r=0;r<n;++r)t.call(e,i[r],this);return this},start:function(){return this.on=!0,this._counter=0,this},stop:function(){return this.on=!1,this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},remove:function(){return this.manager.removeEmitter(this),this},depthSort:function(){return g(this.alive,this.depthSortCallback),this},flow:function(t,e){return void 0===e&&(e=1),this.frequency=t,this.quantity.onChange(e),this.start()},explode:function(t,e,i){return this.frequency=-1,this.emitParticle(t,e,i)},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.quantity.onEmit());for(var n=this.dead,r=this.follow?this.follow.x+this.followOffset.x:e,s=this.follow?this.follow.y+this.followOffset.y:i,o=0;o<t;o++){var a=n.pop();if(a||(a=new this.particleClass(this)),a.fire(r,s),this.particleBringToTop?this.alive.push(a):this.alive.unshift(a),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,a,this),this.atLimit())break}return a}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);var n=this.manager.getProcessors(),r=this.alive,s=this.dead,o=0,a=[],h=r.length;for(o=0;o<h;o++){var l=r[o];l.update(e,i,n)&&a.push({index:o,particle:l})}if((h=a.length)>0){var c=this.deathCallback,u=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];r.splice(d.index,1),s.push(d.particle),c&&c.call(u,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e,i,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=r,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._length<i&&this.counter>this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(t.hasOwnProperty(e[i]))return!0;return!1}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(3),s=new n({initialize:function(t){this.source=t,this._tempVec=new r},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(73),o=new n({Extends:s,Mixins:[r.PathFollower],initialize:function(t,e,i,n,r,o){s.call(this,t,i,n,r,o),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=o},function(t,e){t.exports=function(t,e,i){var n=t.canvas,r=t.context,s=t.style,o=[],a=0,h=i.length;s.maxLines>0&&s.maxLines<i.length&&(h=s.maxLines),s.syncFont(n,r);for(var l=0;l<h;l++){var c=s.strokeThickness;c+=r.measureText(i[l]).width,s.wordWrap&&(c-=r.measureText(" ").width),o[l]=Math.ceil(c),a=Math.max(a,o[l])}var u=e.fontSize+s.strokeThickness,d=u*h,p=t.lineSpacing;return h>1&&(d+=p*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:p,lineHeight:u}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(13),s=i(6),o=i(454),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0);var i=s(e,"metrics",!1);this.metrics=i?{ascent:s(i,"ascent",0),descent:s(i,"descent",0),fontSize:s(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?s(t,a[n][0],o):r(t,a[n][0],o)}var h=s(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=s(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",r="";if("string"!=typeof t)i=s(t,"fontFamily","Courier"),n=s(t,"fontSize","16px"),r=s(t,"fontStyle","");else{var o=t.split(" "),a=0;r=o.length>2?o[a++]:"",n=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&r===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=r,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,r,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===r&&(r=!1),void 0===s&&(s=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=r,this.shadowFill=s,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(31);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var r=i.measureText(t.testString);if(r.hasOwnProperty("actualBoundingBoxAscent")){var s=r.actualBoundingBoxAscent,o=r.actualBoundingBoxDescent;return n.remove(e),{ascent:s,descent:o,fontSize:s+o}}var a=Math.ceil(r.width*t.baselineX),h=a,l=2*h;h=h*t.baselineY|0,e.width=a,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,a,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var c={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,a,l))return c.ascent=h,c.descent=h+6,c.fontSize=c.ascent+c.descent,n.remove(e),c;var u,d,p=i.getImageData(0,0,a,l).data,f=p.length,m=4*a,g=0,v=!1;for(u=0;u<h;u++){for(d=0;d<m;d+=4)if(255!==p[g+d]){v=!0;break}if(v)break;g+=m}for(c.ascent=h-u,g=f-m,v=!1,u=l;u>h;u--){for(d=0;d<m;d+=4)if(255!==p[g+d]){v=!0;break}if(v)break;g-=m}return c.descent=u-h,c.fontSize=c.ascent+c.descent,n.remove(e),c}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1091),r=i(0),s=i(35),o=i(68),a=i(62),h=i(14),l=i(33),c=new r({Extends:l,Mixins:[n],initialize:function(t,e,i,n,r,s,o,h,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===r&&(r=0),void 0===s&&(s=360),void 0===o&&(o=!1),l.call(this,t,"Arc",new a(0,0,n)),this._startAngle=r,this._endAngle=s,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i);var u=2*this.geom.radius;this.setSize(u,u),void 0!==h&&this.setFillStyle(h,c),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,n=s(this._startAngle),r=s(this._endAngle),a=i,l=i;r-=n,this._anticlockwise?r<-h.PI2?r=-h.PI2:r>0&&(r=-h.PI2+r%h.PI2):r>h.PI2?r=h.PI2:r<0&&(r=h.PI2+r%h.PI2);for(var c,u=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)c=r*e+n,u.push(a+Math.cos(c)*i,l+Math.sin(c)*i),e+=t;return c=r+n,u.push(a+Math.cos(c)*i,l+Math.sin(c)*i),u.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(u),this.pathData=u,this}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(1094),s=i(68),o=i(10),a=i(33),h=new n({Extends:a,Mixins:[r],initialize:function(t,e,i,n,r,s){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==r&&this.setFillStyle(r,s),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),r=0;r<n.length;r++)i.push(n[r].x,n[r].y);return i.push(n[0].x,n[0].y),this.pathIndexes=s(i),this.pathData=i,this}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(68),s=i(1097),o=i(108),a=i(33),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,r,s,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===r&&(r=128),a.call(this,t,"Ellipse",new o(n/2,r/2,n,r)),this._smoothness=64,this.setPosition(e,i),this.width=n,this.height=r,void 0!==s&&this.setFillStyle(s,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=r(t),this.pathData=t,this}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(33),s=i(1100),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s,o,a,h,l,c,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===s&&(s=128),void 0===o&&(o=32),void 0===a&&(a=32),r.call(this,t,"Grid",null),this.cellWidth=o,this.cellHeight=a,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(n,s),this.setFillStyle(h,l),void 0!==c&&this.setOutlineStyle(c,u),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1103),r=i(0),s=i(33),o=new r({Extends:s,Mixins:[n],initialize:function(t,e,i,n,r,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===r&&(r=32),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),s.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(n,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(1106),s=i(33),o=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===r&&(r=32),void 0===o&&(o=!1),void 0===a&&(a=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),s.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=a,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=o,this.isFilled=!0,this.setPosition(e,i),this.setSize(n,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(33),s=i(45),o=i(1109),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=0),r.call(this,t,"Line",new s(n,o,a,h));var u=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(u,d),void 0!==l&&this.setStrokeStyle(1,l,c),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,n){return this.geom.setTo(t,e,i,n),this}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1112),r=i(0),s=i(68),o=i(463),a=i(224),h=i(33),l=i(466),c=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,n,r,s){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new a(n));var l=o(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==r&&this.setFillStyle(r,s),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e<t;e++)l(this.geom);return this.updateData()},updateData:function(){for(var t=[],e=this.geom.points,i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=s(t),this.pathData=t,this}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10);t.exports=function(t,e){void 0===e&&(e=new n);for(var i,r=1/0,s=1/0,o=-r,a=-s,h=0;h<t.points.length;h++)i=t.points[h],r=Math.min(r,i.x),s=Math.min(s,i.y),o=Math.max(o,i.x),a=Math.max(a,i.y);return e.x=r,e.y=s,e.width=o-r,e.height=a-s,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(64),r=i(45),s=i(465);t.exports=function(t,e,i,o){void 0===o&&(o=[]);var a=t.points,h=s(t);!e&&i>0&&(e=h/i);for(var l=0;l<e;l++)for(var c=h*(l/e),u=0,d=0;d<a.length;d++){var p=a[d],f=a[(d+1)%a.length],m=new r(p.x,p.y,f.x,f.y),g=n(m);if(!(c<u||c>u+g)){var v=m.getPoint((c-u)/g);o.push(v);break}u+=g}return o}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(64),r=i(45);t.exports=function(t){for(var e=t.points,i=0,s=0;s<e.length;s++){var o=e[s],a=e[(s+1)%e.length],h=new r(o.x,o.y,a.x,a.y);i+=n(h)}return i}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Igor Ognichenko <ognichenko.igor@gmail.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var e,n=[],r=t.points;for(e=0;e<r.length;e++)n.push([r[e].x,r[e].y]);var s=[];for(n.length>0&&s.push(i([0,0],n[0])),e=0;e<n.length-1;e++){var o=n[e],a=n[e+1],h=o[0],l=o[1],c=a[0],u=a[1];s.push([.85*h+.15*c,.85*l+.15*u]),s.push([.15*h+.85*c,.15*l+.85*u])}return n.length>1&&s.push(i([0,0],n[n.length-1])),t.setTo(s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(10),s=i(33),o=i(1115),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),s.call(this,t,"Rectangle",new r(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1118),r=i(0),s=i(68),o=i(33),a=new r({Extends:o,Mixins:[n],initialize:function(t,e,i,n,r,s,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===r&&(r=32),void 0===s&&(s=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=r,this._outerRadius=s,this.setPosition(e,i),this.setSize(2*s,2*s),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,r=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l<e;l++)t.push(a+Math.cos(r)*n,h+Math.sin(r)*n),r+=o,t.push(a+Math.cos(r)*i,h+Math.sin(r)*i),r+=o;return t.push(a,h+-n),this.pathIndexes=s(t),this.pathData=t,this}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(33),s=i(82),o=i(1121),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,c,u,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===c&&(c=128),r.call(this,t,"Triangle",new s(n,o,a,h,l,c));var p=this.geom.right-this.geom.left,f=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(p,f),void 0!==u&&this.setFillStyle(u,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,r,s){return this.geom.setTo(t,e,i,n,r,s),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4),r=i(64);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=s.x1,i.y=s.y1,i;var h=r(s),l=r(o),c=r(a),u=(h+l+c)*e,d=0;return u<h?(d=u/h,i.x=s.x1+(s.x2-s.x1)*d,i.y=s.y1+(s.y2-s.y1)*d):u>h+l?(d=(u-=h+l)/c,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(u-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(64),r=i(4);t.exports=function(t,e,i,s){void 0===s&&(s=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),c=n(a),u=n(h),d=l+c+u;!e&&i>0&&(e=d/i);for(var p=0;p<e;p++){var f=d*(p/e),m=0,g=new r;f<l?(m=f/l,g.x=o.x1+(o.x2-o.x1)*m,g.y=o.y1+(o.y2-o.y1)*m):f>l+c?(m=(f-=l+c)/u,g.x=h.x1+(h.x2-h.x1)*m,g.y=h.y1+(h.y2-h.y1)*m):(m=(f-=l)/c,g.x=a.x1+(a.x2-a.x1)*m,g.y=a.y1+(a.y2-a.y1)*m),s.push(g)}return s}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,s=t,o=0;o<n.length;o++){if(!r.hasOwnProperty(n[o]))return!1;s=r,r=r[n[o]]}return s[n[n.length-1]]=i,!0}return!1}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(113),r=i(115);t.exports=function(t,e,i,s,o,a,h){if(void 0===s&&(s=!1),void 0===a&&(a=16777215),void 0===h&&(h=1),t.length===e.length){var l,c,u,d,p,f,m,g,v,y,x,b={faces:[],vertices:[]},w=s?3:2,T=Array.isArray(a),_=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(l=0;l<i.length;l++){var E=i[l],S=2*i[l],M=i[l]*w;c=t[M],u=t[M+1],d=s?t[M+2]:0,p=e[S],f=e[S+1],m=T?a[E]:a,g=_?h[E]:h,v=0,y=0,x=0,o&&(v=o[M],y=o[M+1],x=s?o[M+2]:0),b.vertices.push(new r(c,u,d,p,f,m,g,v,y,x))}else{var A=0,C=0;for(l=0;l<t.length;l+=w)c=t[l],u=t[l+1],d=s?t[l+2]:0,p=e[A],f=e[A+1],m=T?a[C]:a,g=_?h[C]:h,v=0,y=0,x=0,o&&(v=o[l],y=o[l+1],x=s?o[l+2]:0),b.vertices.push(new r(c,u,d,p,f,m,g,v,y,x)),A+=2,C++}for(l=0;l<b.vertices.length;l+=3){var P=b.vertices[l],R=b.vertices[l+1],L=b.vertices[l+2];b.faces.push(new n(P,R,L))}return b}console.warn("GenerateVerts: vertices and uvs count not equal")}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(113),r=i(67),s=i(38),o=i(115),a=new s,h=new s,l=new r;t.exports=function(t,e,i,r,s,c,u,d,p,f){void 0===i&&(i=1),void 0===r&&(r=0),void 0===s&&(s=0),void 0===c&&(c=0),void 0===u&&(u=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===f&&(f=!0);var m={faces:[],verts:[]},g=t.materials;a.set(r,s,c),h.set(u,d,p),l.fromRotationXYTranslation(h,a,f);for(var v=0;v<t.models.length;v++)for(var y=t.models[v],x=y.vertices,b=y.textureCoords,w=y.faces,T=0;T<w.length;T++){var _=w[T],E=_.vertices[0],S=_.vertices[1],M=_.vertices[2],A=x[E.vertexIndex],C=x[S.vertexIndex],P=x[M.vertexIndex],R=E.textureCoordsIndex,L=S.textureCoordsIndex,O=M.textureCoordsIndex,D=-1===R?{u:0,v:1}:b[R],I=-1===L?{u:0,v:0}:b[L],F=-1===O?{u:1,v:1}:b[O],B=16777215;""!==_.material&&g[_.material]&&(B=g[_.material]);var k=new o(A.x*i,A.y*i,A.z*i,D.u,D.v,B).transformMat4(l),N=new o(C.x*i,C.y*i,C.z*i,I.u,I.v,B).transformMat4(l),U=new o(P.x*i,P.y*i,P.z*i,F.u,F.v,B).transformMat4(l);m.verts.push(k,N,U),m.faces.push(new n(k,N,U))}return e&&(e.faces=e.faces.concat(m.faces),e.vertices=e.vertices.concat(m.verts)),m}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(62),r=i(0),s=i(11),o=i(197),a=i(12),h=new r({Extends:n,Mixins:[s.ScrollFactor,s.Visible],initialize:function(t,e,i,r,s,a,h){n.call(this,t,e,i),this.color=new o(r,s,a),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=a.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(150),r=i(0),s=i(48),o=i(475),a=i(149),h=i(197),l=i(74),c=i(79),u=i(12),d=new r({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,n,r){return this.systems.displayList.add(new a(this.scene,t,e,i,n,r))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.scene.sys.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,r=[],o=0;o<e.length;o++){var a=e[o];a.willRender(t)&&n(a,i)&&r.push({light:a,distance:s(a.x,a.y,i.centerX,i.centerY)})}return r.length>this.maxLights&&(c(r,this.sortByDistance),r=r.slice(0,this.maxLights)),this.visibleLights=r.length,r},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=u.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===n&&(n=16777215),void 0===r&&(r=1);var s=u.getFloatsFromUintRGB(n),a=new o(t,e,i,s[0],s[1],s[2],r);return this.lights.push(a),a},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(55),r=i(17),s={Circle:i(1185),Ellipse:i(1195),Intersects:i(478),Line:i(1215),Mesh:i(1237),Point:i(1240),Polygon:i(1254),Rectangle:i(496),Triangle:i(1287)};s=r(!1,s,n),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={CircleToCircle:i(228),CircleToRectangle:i(150),GetCircleToCircle:i(1205),GetCircleToRectangle:i(1206),GetLineToCircle:i(229),GetLineToLine:i(479),GetLineToPoints:i(480),GetLineToPolygon:i(481),GetLineToRectangle:i(231),GetRaysFromPointToPolygon:i(1207),GetRectangleIntersection:i(1208),GetRectangleToRectangle:i(1209),GetRectangleToTriangle:i(1210),GetTriangleToCircle:i(1211),GetTriangleToLine:i(486),GetTriangleToTriangle:i(1212),LineToCircle:i(230),LineToLine:i(92),LineToRectangle:i(482),PointToLine:i(490),PointToLineSegment:i(1213),RectangleToRectangle:i(114),RectangleToTriangle:i(483),RectangleToValues:i(1214),TriangleToCircle:i(485),TriangleToLine:i(487),TriangleToTriangle:i(488)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(38);t.exports=function(t,e,i){var r=t.x1,s=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,c=o-r,u=a-s,d=e.x2-h,p=e.y2-l;if(0===c||0==p*c-d*u)return!1;var f=(c*(l-s)+u*(r-h))/(d*u-p*c),m=(h+d*f-r)/c;return m<0||f<0||f>1?null:(void 0===i&&(i=new n),i.set(r+c*m,s+u*m,m))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(38),r=i(479),s=new(i(45)),o=new n;t.exports=function(t,e,i){void 0===i&&(i=new n);var a=!1;i.set(),o.set();for(var h=e[0],l=1;l<e.length;l++){var c=e[l];s.setTo(h.x,h.y,c.x,c.y),h=c,r(t,s,o)&&(!a||o.z<i.z)&&(i.copy(o),a=!0)}return a?i:null}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(38),r=i(138),s=i(480),o=new n;t.exports=function(t,e,i){void 0===i&&(i=new r),Array.isArray(e)||(e=[e]);var n=!1;i.set(),o.set();for(var a=0;a<e.length;a++)s(t,e[a].points,o)&&(!n||o.z<i.z)&&(i.set(o.x,o.y,o.z,a),n=!0);return n?i:null}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,r=t.x2,s=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,c=0;if(i>=o&&i<=h&&n>=a&&n<=l||r>=o&&r<=h&&s>=a&&s<=l)return!0;if(i<o&&r>=o){if((c=n+(s-n)*(o-i)/(r-i))>a&&c<=l)return!0}else if(i>h&&r<=h&&(c=n+(s-n)*(h-i)/(r-i))>=a&&c<=l)return!0;if(n<a&&s>=a){if((c=i+(r-i)*(a-n)/(s-n))>=o&&c<=h)return!0}else if(n>l&&s<=l&&(c=i+(r-i)*(l-n)/(s-n))>=o&&c<=h)return!0;return!1}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(92),r=i(56),s=i(232),o=i(484);t.exports=function(t,e){if(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)return!1;var i=e.getLineA(),a=e.getLineB(),h=e.getLineC();if(r(t,i.x1,i.y1)||r(t,i.x2,i.y2))return!0;if(r(t,a.x1,a.y1)||r(t,a.x2,a.y2))return!0;if(r(t,h.x1,h.y1)||r(t,h.x2,h.y2))return!0;var l=t.getLineA(),c=t.getLineB(),u=t.getLineC(),d=t.getLineD();if(n(i,l)||n(i,c)||n(i,u)||n(i,d))return!0;if(n(a,l)||n(a,c)||n(a,u)||n(a,d))return!0;if(n(h,l)||n(h,c)||n(h,u)||n(h,d))return!0;var p=o(t);return s(e,p,!0).length>0}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(230),r=i(112);t.exports=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top||!r(t,e.x,e.y)&&!n(t.getLineA(),e)&&!n(t.getLineB(),e)&&!n(t.getLineC(),e))}},function(t,e,i){
|
|
/**
|
|
* @author Florian Vazelle
|
|
* @author Geoffrey Glaive
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4),r=i(487),s=i(92);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=[new n,new n,new n],c=[s(o,e,l[0]),s(a,e,l[1]),s(h,e,l[2])],u=0;u<3;u++)c[u]&&i.push(l[u]);return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(92);t.exports=function(t,e){return!!(t.contains(e.x1,e.y1)||t.contains(e.x2,e.y2)||n(t.getLineA(),e)||n(t.getLineB(),e)||n(t.getLineC(),e))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(232),r=i(489),s=i(92);t.exports=function(t,e){if(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)return!1;var i=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=e.getLineA(),l=e.getLineB(),c=e.getLineC();if(s(i,h)||s(i,l)||s(i,c))return!0;if(s(o,h)||s(o,l)||s(o,c))return!0;if(s(a,h)||s(a,l)||s(a,c))return!0;var u=r(t),d=n(e,u,!0);return d.length>0||(u=r(e),(d=n(t,u,!0)).length>0)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=1);var n=e.x1,r=e.y1,s=e.x2,o=e.y2,a=t.x,h=t.y,l=(s-n)*(s-n)+(o-r)*(o-r);if(0===l)return!1;var c=((a-n)*(s-n)+(h-r)*(o-r))/l;if(c<0)return Math.sqrt((n-a)*(n-a)+(r-h)*(r-h))<=i;if(c>=0&&c<=1){var u=((r-h)*(s-n)-(n-a)*(o-r))/l;return Math.abs(u)*Math.sqrt(l)<=i}return Math.sqrt((s-a)*(s-a)+(o-h)*(o-h))<=i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14),r=i(66),s=i(93);t.exports=function(t){var e=s(t)-n.TAU;return r(e,-Math.PI,Math.PI)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i=!0,n="",r="";function s(t){var e=t.indexOf("#");return e>-1?t.substring(0,e):t}function o(t){return 0===t.models.length&&t.models.push({faces:[],name:"untitled",textureCoords:[],vertexNormals:[],vertices:[]}),n="",t.models[t.models.length-1]}function a(t,e){var i=t.length>=2?t[1]:"untitled";e.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),n=""}function h(t){2===t.length&&(n=t[1])}function l(t,e){var i=t.length,n=i>=2?parseFloat(t[1]):0,r=i>=3?parseFloat(t[2]):0,s=i>=4?parseFloat(t[3]):0;o(e).vertices.push({x:n,y:r,z:s})}function c(t,e){var n=t.length,r=n>=2?parseFloat(t[1]):0,s=n>=3?parseFloat(t[2]):0,a=n>=4?parseFloat(t[3]):0;isNaN(r)&&(r=0),isNaN(s)&&(s=0),isNaN(a)&&(a=0),i&&(s=1-s),o(e).textureCoords.push({u:r,v:s,w:a})}function u(t,e){var i=t.length,n=i>=2?parseFloat(t[1]):0,r=i>=3?parseFloat(t[2]):0,s=i>=4?parseFloat(t[3]):0;o(e).vertexNormals.push({x:n,y:r,z:s})}function d(t,e){var i=t.length-1;if(!(i<3)){for(var s={group:n,material:r,vertices:[]},a=0;a<i;a++){var h=t[a+1].split("/"),l=h.length;if(!(l<1||l>3)){var c=0,u=0,d=0;c=parseInt(h[0],10),l>1&&""!==h[1]&&(u=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==c&&(c<0&&(c=o(e).vertices.length+1+c),u-=1,c-=1,d-=1,s.vertices.push({textureCoordsIndex:u,vertexIndex:c,vertexNormalIndex:d}))}}o(e).faces.push(s)}}function p(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function f(t){t.length>=2&&(r=t[1])}t.exports=function(t,e){void 0===e&&(e=!0),i=e;var o={materials:{},materialLibraries:[],models:[]};n="",r="";for(var m=t.split("\n"),g=0;g<m.length;g++){var v=s(m[g]).replace(/\s\s+/g," ").trim().split(" ");switch(v[0].toLowerCase()){case"o":a(v,o);break;case"g":h(v);break;case"v":l(v,o);break;case"vt":c(v,o);break;case"vn":u(v,o);break;case"f":d(v,o);break;case"mtllib":p(v,o);break;case"usemtl":f(v)}}return o}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(100);t.exports=function(t){for(var e={},i=t.split("\n"),r="",s=0;s<i.length;s++){var o=i[s].trim();if(0!==o.indexOf("#")&&""!==o){var a=o.replace(/\s\s+/g," ").trim().split(" ");switch(a[0].toLowerCase()){case"newmtl":r=a[1];break;case"kd":var h=Math.floor(255*a[1]),l=a.length>=2?Math.floor(255*a[2]):h,c=a.length>=3?Math.floor(255*a[3]):h;e[r]=n(h,l,c)}}}return e}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10);n.Area=i(1261),n.Ceil=i(1262),n.CeilAll=i(1263),n.CenterOn=i(187),n.Clone=i(1264),n.Contains=i(56),n.ContainsPoint=i(1265),n.ContainsRect=i(497),n.CopyFrom=i(1266),n.Decompose=i(484),n.Equals=i(1267),n.FitInside=i(1268),n.FitOutside=i(1269),n.Floor=i(1270),n.FloorAll=i(1271),n.FromPoints=i(196),n.FromXY=i(1272),n.GetAspectRatio=i(234),n.GetCenter=i(1273),n.GetPoint=i(167),n.GetPoints=i(300),n.GetSize=i(1274),n.Inflate=i(1275),n.Intersection=i(1276),n.MarchingAnts=i(310),n.MergePoints=i(1277),n.MergeRect=i(1278),n.MergeXY=i(1279),n.Offset=i(1280),n.OffsetPoint=i(1281),n.Overlaps=i(1282),n.Perimeter=i(128),n.PerimeterPoint=i(1283),n.Random=i(170),n.RandomOutside=i(1284),n.SameDimensions=i(1285),n.Scale=i(1286),n.Union=i(435),t.exports=n},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.x<t.right&&e.right>t.x&&e.right<t.right&&e.y>t.y&&e.y<t.bottom&&e.bottom>t.y&&e.bottom<t.bottom}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);function r(t,e,i,n){var r=t-i,s=e-n,o=r*r+s*s;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x1,s=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,c=r(h,l,o,a),u=r(i,s,h,l),d=r(o,a,i,s),p=c+u+d;return e.x=(i*c+o*u+h*d)/p,e.y=(s*c+a*u+l*d)/p,e}},function(t,e){t.exports=function(t,e){return function(i,n,r,s){var o=t.getPixelAlpha(n,r,s.texture.key,s.frame.name);return o&&o>=e}}},function(t,e){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(236),s=new n({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(r.BUTTON_DOWN,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(r.BUTTON_UP,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(503),r=i(504),s=i(0),o=i(9),a=i(3),h=new s({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],s=0;s<e.buttons.length;s++)i.push(new r(this,s));this.buttons=i;var h=[];for(s=0;s<e.axes.length;s++)h.push(new n(this,s));this.axes=h,this.vibration=e.vibrationActuator;var l={value:0,pressed:!1};this._LCLeft=i[14]?i[14]:l,this._LCRight=i[15]?i[15]:l,this._LCTop=i[12]?i[12]:l,this._LCBottom=i[13]?i[13]:l,this._RCLeft=i[2]?i[2]:l,this._RCRight=i[1]?i[1]:l,this._RCTop=i[3]?i[3]:l,this._RCBottom=i[0]?i[0]:l,this._FBLeftTop=i[4]?i[4]:l,this._FBLeftBottom=i[6]?i[6]:l,this._FBRightTop=i[5]?i[5]:l,this._FBRightBottom=i[7]?i[7]:l;var c={value:0};this._HAxisLeft=h[0]?h[0]:c,this._VAxisLeft=h[1]?h[1]:c,this._HAxisRight=h[2]?h[2]:c,this._VAxisRight=h[3]?h[3]:c,this.leftStick=new a,this.rightStick=new a,this._created=performance.now()},getAxisTotal:function(){return this.axes.length},getAxisValue:function(t){return this.axes[t].getValue()},setAxisThreshold:function(t){for(var e=0;e<this.axes.length;e++)this.axes[e].threshold=t},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(t){return this.buttons[t].value},isButtonDown:function(t){return this.buttons[t].pressed},update:function(t){if(!(t.timestamp<this._created)){var e,i=this.buttons,n=t.buttons,r=i.length;for(e=0;e<r;e++)i[e].update(n[e].value);var s=this.axes,o=t.axes;for(r=s.length,e=0;e<r;e++)s[e].update(o[e]);r>=2&&(this.leftStick.set(s[0].getValue(),s[1].getValue()),r>=4&&this.rightStick.set(s[2].getValue(),s[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t<this.buttons.length;t++)this.buttons[t].destroy();for(t=0;t<this.axes.length;t++)this.axes[t].destroy();this.buttons=[],this.axes=[]},connected:{get:function(){return this.pad.connected}},timestamp:{get:function(){return this.pad.timestamp}},left:{get:function(){return this._LCLeft.pressed}},right:{get:function(){return this._LCRight.pressed}},up:{get:function(){return this._LCTop.pressed}},down:{get:function(){return this._LCBottom.pressed}},A:{get:function(){return this._RCBottom.pressed}},Y:{get:function(){return this._RCTop.pressed}},X:{get:function(){return this._RCLeft.pressed}},B:{get:function(){return this._RCRight.pressed}},L1:{get:function(){return this._FBLeftTop.value}},L2:{get:function(){return this._FBLeftBottom.value}},R1:{get:function(){return this._FBRightTop.value}},R2:{get:function(){return this._FBRightBottom.value}}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(9),s=i(152),o=new n({Extends:r,initialize:function(t,e){r.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(s.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(s.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(s.UP,this,t))},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(152),s=i(2),o=i(508),a=i(510),h=new n({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var n=0;n<e.length;n++){var h=e[n];"string"==typeof h?this.keyCodes.push(h.toUpperCase().charCodeAt(0)):"number"==typeof h?this.keyCodes.push(h):h.hasOwnProperty("keyCode")&&this.keyCodes.push(h.keyCode)}this.current=this.keyCodes[0],this.index=0,this.size=this.keyCodes.length,this.timeLastMatched=0,this.matched=!1,this.timeMatched=0,this.resetOnWrongKey=s(i,"resetOnWrongKey",!0),this.maxKeyDelay=s(i,"maxKeyDelay",0),this.resetOnMatch=s(i,"resetOnMatch",!1),this.deleteOnMatch=s(i,"deleteOnMatch",!1);var l=this;this.onKeyDown=function(t){!l.matched&&l.enabled&&o(t,l)&&(l.manager.emit(r.COMBO_MATCH,l,t),l.resetOnMatch?a(l):l.deleteOnMatch&&l.destroy())},this.manager.on(r.ANY_KEY_DOWN,this.onKeyDown)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off(r.ANY_KEY_DOWN,this.onKeyDown),this.manager=null}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(509);t.exports=function(t,e){if(e.matched)return!0;var i=!1,r=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var s=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=s&&(r=!0,i=n(t,e))}else r=!0,i=n(t,e);return!r&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(237);t.exports=function(t,e){var i=n(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var s in i.headers)r.setRequestHeader(s,i.headers[s]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(513),l=i(7),c=new n({Extends:s,initialize:function(t,e,i,n,r){if(l(e)){var o=e;e=a(o,"key"),n=a(o,"xhrSettings"),r=a(o,"context",r)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:n,config:{context:r}};s.call(this,t,h)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});c.create=function(t,e,i,n,r){var s=t.systems.game,o=s.config.audio,u=s.device.audio;l(e)&&(i=a(e,"url",[]),n=a(e,"config",{}));var d=c.getAudioURL(s,i);return d?u.webAudio&&!o.disableWebAudio?new c(t,e,d,r,s.sound.context):new h(t,e,d,n):null},c.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=a(e[i],"url",e[i]);if(0===n.indexOf("blob:")||0===n.indexOf("data:"))return{url:n,type:""};var r=n.match(/\.([a-zA-Z0-9]+)($|\?)/);if(r=a(e[i],"type",r?r[1]:"").toLowerCase(),t.device.audio[r])return{url:n,type:r}}return null},o.register("audio",(function(t,e,i,n){var r,s=this.systems.game,o=s.config.audio,a=s.device.audio;if(o.noAudio||!a.webAudio&&!a.audioData)return this;if(Array.isArray(t))for(var h=0;h<t.length;h++)(r=c.create(this,t[h]))&&this.addFile(r);else(r=c.create(this,t,e,i,n))&&this.addFile(r);return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(91),s=i(23),o=i(2),a=i(153),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){if(h(e)){var r=e;e=o(r,"key"),n=o(r,"config",n)}var a={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:n};s.call(this,t,a),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t<this.data.length;t++){var e=this.data[t];e.oncanplaythrough=null,e.onerror=null}this.loader.nextFile(this,!1)},onProgress:function(t){var e=t.target;e.oncanplaythrough=null,e.onerror=null,this.filesLoaded++,this.percentComplete=Math.min(this.filesLoaded/this.filesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete),this.filesLoaded===this.filesTotal&&this.onLoad()},load:function(){this.data=[];var t=this.config&&this.config.instances||1;this.filesTotal=t,this.filesLoaded=0,this.percentComplete=0;for(var e=0;e<t;e++){var i=new Audio;i.dataset||(i.dataset={}),i.dataset.name=this.key+("0"+e).slice(-2),i.dataset.used="false",this.locked?i.dataset.locked="true":(i.dataset.locked="false",i.preload="auto",i.oncanplaythrough=this.onProgress.bind(this),i.onerror=this.onError.bind(this)),this.data.push(i)}for(e=0;e<this.data.length;e++)(i=this.data[e]).src=a(this,this.loader.baseURL),this.locked||i.load();this.locked&&setTimeout(this.onLoad.bind(this))}});t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"script",cache:!1,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(516),r=i(155),s=i(0),o=i(60),a=i(518),h=i(519),l=new s({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,n,r){return this.world.addCollider(t,e,i,n,r)},overlap:function(t,e,i,n,r){return this.world.addOverlap(t,e,i,n,r)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,r){var s=new n(this.scene,t,e,i,r);return this.sys.displayList.add(s),this.world.enableBody(s,o.STATIC_BODY),s},image:function(t,e,i,r){var s=new n(this.scene,t,e,i,r);return this.sys.displayList.add(s),this.world.enableBody(s,o.DYNAMIC_BODY),s},staticSprite:function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,o.STATIC_BODY),s},sprite:function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,o.DYNAMIC_BODY),s},staticGroup:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new a(this.world,this.world.scene,t,e))},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(240),s=i(124),o=new n({Extends:s,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,n,r){s.call(this,t,e,i,n,r),this.body=null}});t.exports=o},function(t,e,i){var n=i(241),r=i(62),s=i(228),o=i(150);t.exports=function(t,e,i,a,h,l){var c=n(t,e-a,i-a,2*a,2*a,h,l);if(0===c.length)return c;for(var u=new r(e,i,a),d=new r,p=[],f=0;f<c.length;f++){var m=c[f];m.isCircle?(d.setTo(m.center.x,m.center.y,m.halfWidth),s(u,d)&&p.push(m)):o(u,m)&&p.push(m)}return p}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(155),r=i(0),s=i(60),o=i(2),a=i(110),h=i(7),l=new r({Extends:a,initialize:function(t,e,i,r){if(i||r)if(h(i))r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&h(i[0])){r=i[0];var l=this;i.forEach((function(t){t.internalCreateCallback=l.createCallbackHandler,t.internalRemoveCallback=l.removeCallbackHandler})),i=null}else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,r.classType=o(r,"classType",n),this.physicsType=s.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:o(r,"collideWorldBounds",!1),setBoundsRectangle:o(r,"customBoundsRectangle",null),setAccelerationX:o(r,"accelerationX",0),setAccelerationY:o(r,"accelerationY",0),setAllowDrag:o(r,"allowDrag",!0),setAllowGravity:o(r,"allowGravity",!0),setAllowRotation:o(r,"allowRotation",!0),setBounceX:o(r,"bounceX",0),setBounceY:o(r,"bounceY",0),setDragX:o(r,"dragX",0),setDragY:o(r,"dragY",0),setEnable:o(r,"enable",!0),setGravityX:o(r,"gravityX",0),setGravityY:o(r,"gravityY",0),setFrictionX:o(r,"frictionX",0),setFrictionY:o(r,"frictionY",0),setMaxVelocityX:o(r,"maxVelocityX",1e4),setMaxVelocityY:o(r,"maxVelocityY",1e4),setVelocityX:o(r,"velocityX",0),setVelocityY:o(r,"velocityY",0),setAngularVelocity:o(r,"angularVelocity",0),setAngularAcceleration:o(r,"angularAcceleration",0),setAngularDrag:o(r,"angularDrag",0),setMass:o(r,"mass",1),setImmovable:o(r,"immovable",!1)},a.call(this,e,i,r),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,s.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var n=this.getChildren(),r=0;r<n.length;r++)n[r].body.velocity.set(t+r*i,e+r*i);return this},setVelocityX:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.x=t+n*e;return this},setVelocityY:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.y=t+n*e;return this}});t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(155),r=i(0),s=i(60),o=i(2),a=i(110),h=i(7),l=new r({Extends:a,initialize:function(t,e,i,r){i||r?h(i)?(r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler,r.createMultipleCallback=this.createMultipleCallbackHandler,r.classType=o(r,"classType",n)):Array.isArray(i)&&h(i[0])?(r=i,i=null,r.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",n)}))):r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:n},this.world=t,this.physicsType=s.STATIC_BODY,a.call(this,e,i,r),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,s.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e<t.length;e++)t[e].body.reset();return this}});t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(344),r=i(521),s=i(18),o=i(0),a=i(522),h=i(60),l=i(48),c=i(9),u=i(242),d=i(123),p=i(348),f=i(349),m=i(243),g=i(244),v=i(523),y=i(6),x=i(14),b=i(208),w=i(524),T=i(10),_=i(525),E=i(526),S=i(531),M=i(532),A=i(148),C=i(533),P=i(245),R=i(25),L=i(3),O=i(66),D=new o({Extends:c,initialize:function(t,e){c.call(this),this.scene=t,this.bodies=new A,this.staticBodies=new A,this.pendingDestroy=new A,this.colliders=new b,this.gravity=new L(y(e,"gravity.x",0),y(e,"gravity.y",0)),this.bounds=new T(y(e,"x",0),y(e,"y",0),y(e,"width",t.sys.scale.width),y(e,"height",t.sys.scale.height)),this.checkCollision={up:y(e,"checkCollision.up",!0),down:y(e,"checkCollision.down",!0),left:y(e,"checkCollision.left",!0),right:y(e,"checkCollision.right",!0)},this.fps=y(e,"fps",60),this.fixedStep=y(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=y(e,"timeScale",1),this.OVERLAP_BIAS=y(e,"overlapBias",4),this.TILE_BIAS=y(e,"tileBias",16),this.forceX=y(e,"forceX",!1),this.isPaused=y(e,"isPaused",!1),this._total=0,this.drawDebug=y(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(e,"debugShowBody",!0),debugShowStaticBody:y(e,"debugShowStaticBody",!0),debugShowVelocity:y(e,"debugShowVelocity",!0),bodyDebugColor:y(e,"debugBodyColor",16711935),staticBodyDebugColor:y(e,"debugStaticBodyColor",255),velocityDebugColor:y(e,"debugVelocityColor",65280)},this.maxEntries=y(e,"maxEntries",16),this.useTree=y(e,"useTree",!0),this.tree=new _(this.maxEntries),this.staticTree=new _(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new R,this._tempMatrix2=new R,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(n.isParent)for(var r=n.getChildren(),s=0;s<r.length;s++){var o=r[s];o.isParent?this.enable(o,e):this.enableBody(o,e)}else this.enableBody(n,e)}},enableBody:function(t,e){return void 0===e&&(e=h.DYNAMIC_BODY),t.body||(e===h.DYNAMIC_BODY?t.body=new r(this,t):e===h.STATIC_BODY&&(t.body=new C(this,t))),this.add(t.body),t},add:function(t){return t.physicsType===h.DYNAMIC_BODY?this.bodies.set(t):t.physicsType===h.STATIC_BODY&&(this.staticBodies.set(t),this.staticTree.insert(t)),t.enable=!0,t},disable:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.isParent)for(var n=i.getChildren(),r=0;r<n.length;r++){var s=n[r];s.isParent?this.disable(s):this.disableBody(s.body)}else this.disableBody(i.body)}},disableBody:function(t){this.remove(t),t.enable=!1},remove:function(t){t.physicsType===h.DYNAMIC_BODY?(this.tree.remove(t),this.bodies.delete(t)):t.physicsType===h.STATIC_BODY&&(this.staticBodies.delete(t),this.staticTree.remove(t))},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},setBounds:function(t,e,i,n,r,s,o,a){return this.bounds.setTo(t,e,i,n),void 0!==r&&this.setBoundsCollision(r,s,o,a),this},setBoundsCollision:function(t,e,i,n){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===n&&(n=!0),this.checkCollision.left=t,this.checkCollision.right=e,this.checkCollision.up=i,this.checkCollision.down=n,this},pause:function(){return this.isPaused=!0,this.emit(u.PAUSE),this},resume:function(){return this.isPaused=!1,this.emit(u.RESUME),this},addCollider:function(t,e,i,n,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i);var s=new a(this,!1,t,e,i,n,r);return this.colliders.add(s),s},addOverlap:function(t,e,i,n,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i);var s=new a(this,!0,t,e,i,n,r);return this.colliders.add(s),s},removeCollider:function(t){return this.colliders.remove(t),this},setFPS:function(t){return this.fps=t,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this},update:function(t,e){if(!this.isPaused&&0!==this.bodies.size){var i,n,r=this._frameTime,s=this._frameTimeMS*this.timeScale;this._elapsed+=e;var o=this.bodies.entries,a=this._elapsed>=s;for(this.fixedStep||(r=.001*e,a=!0,this._elapsed=0),i=0;i<o.length;i++)(n=o[i]).enable&&n.preUpdate(a,r);if(a){this._elapsed-=s,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(o));var h=this.colliders.update();for(i=0;i<h.length;i++){var l=h[i];l.active&&l.update()}this.emit(u.WORLD_STEP,r)}for(;this._elapsed>=s;)this._elapsed-=s,this.step(r)}},step:function(t){var e,i,n=this.bodies.entries,r=n.length;for(e=0;e<r;e++)(i=n[e]).enable&&i.update(t);this.useTree&&(this.tree.clear(),this.tree.load(n));var s=this.colliders.update();for(e=0;e<s.length;e++){var o=s[e];o.active&&o.update()}this.emit(u.WORLD_STEP,t),this.stepsLastFrame++},postUpdate:function(){var t,e,i=this.bodies.entries,n=i.length,r=this.bodies,s=this.staticBodies;if(this.stepsLastFrame)for(this.stepsLastFrame=0,t=0;t<n;t++)(e=i[t]).enable&&e.postUpdate();if(this.drawDebug){var o=this.debugGraphic;for(o.clear(),t=0;t<n;t++)(e=i[t]).willDrawDebug()&&e.drawDebug(o);for(n=(i=s.entries).length,t=0;t<n;t++)(e=i[t]).willDrawDebug()&&e.drawDebug(o)}var a=this.pendingDestroy;if(a.size>0){var l=this.tree,c=this.staticTree;for(n=(i=a.entries).length,t=0;t<n;t++)(e=i[t]).physicsType===h.DYNAMIC_BODY?(l.remove(e),r.delete(e)):e.physicsType===h.STATIC_BODY&&(c.remove(e),s.delete(e)),e.world=void 0,e.gameObject=void 0;a.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,n=t.angularAcceleration,r=t.angularDrag,o=t.maxAngular;n?i+=n*e:t.allowDrag&&r&&(p(i-(r*=e),0,.1)?i-=r:f(i+r,0,.1)?i+=r:i=0);var a=(i=s(i,-o,o))-t.angularVelocity;t.angularVelocity+=a,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,n=t.acceleration.x,r=t.drag.x,o=t.maxVelocity.x,a=t.velocity.y,h=t.acceleration.y,l=t.drag.y,c=t.maxVelocity.y,u=t.speed,m=t.maxSpeed,g=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,a+=(this.gravity.y+t.gravity.y)*e),n?i+=n*e:g&&r&&(v?(i*=r=Math.pow(r,e),u=Math.sqrt(i*i+a*a),d(u,0,.001)&&(i=0)):p(i-(r*=e),0,.01)?i-=r:f(i+r,0,.01)?i+=r:i=0),h?a+=h*e:g&&l&&(v?(a*=l=Math.pow(l,e),u=Math.sqrt(i*i+a*a),d(u,0,.001)&&(a=0)):p(a-(l*=e),0,.01)?a-=l:f(a+l,0,.01)?a+=l:a=0),i=s(i,-o,o),a=s(a,-c,c),t.velocity.set(i,a),m>-1&&u>m&&(t.velocity.normalize().scale(m),u=m),t.speed=u},separate:function(t,e,i,n,r,s){if(!s&&!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,r);if(t.isCircle!==e.isCircle){var o=t.isCircle?e:t,a=t.isCircle?t:e,h={x:o.x,y:o.y,right:o.right,bottom:o.bottom},l=a.center;if((l.y<h.y||l.y>h.bottom)&&(l.x<h.x||l.x>h.right))return this.separateCircle(t,e,r)}var c=!1,d=!1;r?(c=S(t,e,r,this.OVERLAP_BIAS),d=M(t,e,r,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)<Math.abs(this.gravity.x+t.gravity.x)?(c=S(t,e,r,this.OVERLAP_BIAS),this.intersects(t,e)&&(d=M(t,e,r,this.OVERLAP_BIAS))):(d=M(t,e,r,this.OVERLAP_BIAS),this.intersects(t,e)&&(c=S(t,e,r,this.OVERLAP_BIAS)));var p=c||d;return p&&(r?(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e):(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e)),p},separateCircle:function(t,e,i,r){m(t,e,!1,r),g(t,e,!1,r);var s=0;if(t.isCircle!==e.isCircle){var o={x:e.isCircle?t.position.x:e.position.x,y:e.isCircle?t.position.y:e.position.y,right:e.isCircle?t.right:e.right,bottom:e.isCircle?t.bottom:e.bottom},a={x:t.isCircle?t.center.x:e.center.x,y:t.isCircle?t.center.y:e.center.y,radius:t.isCircle?t.halfWidth:e.halfWidth};a.y<o.y?a.x<o.x?s=l(a.x,a.y,o.x,o.y)-a.radius:a.x>o.right&&(s=l(a.x,a.y,o.right,o.y)-a.radius):a.y>o.bottom&&(a.x<o.x?s=l(a.x,a.y,o.x,o.bottom)-a.radius:a.x>o.right&&(s=l(a.x,a.y,o.right,o.bottom)-a.radius)),s*=-1}else s=t.halfWidth+e.halfWidth-l(t.center.x,t.center.y,e.center.x,e.center.y);if(t.overlapR=s,e.overlapR=s,i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s&&(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var h=t.center.x-e.center.x,c=t.center.y-e.center.y,d=Math.sqrt(Math.pow(h,2)+Math.pow(c,2)),p=(e.center.x-t.center.x)/d||0,f=(e.center.y-t.center.y)/d||0,v=2*(t.velocity.x*p+t.velocity.y*f-e.velocity.x*p-e.velocity.y*f)/(t.mass+e.mass);(t.immovable||e.immovable)&&(v*=2),t.immovable||(t.velocity.x=t.velocity.x-v/t.mass*p,t.velocity.y=t.velocity.y-v/t.mass*f),e.immovable||(e.velocity.x=e.velocity.x+v/e.mass*p,e.velocity.y=e.velocity.y+v/e.mass*f),t.immovable||e.immovable||(s/=2);var y=n(t.center,e.center),b=(s+x.EPSILON)*Math.cos(y),w=(s+x.EPSILON)*Math.sin(y);return t.immovable||(t.x-=b,t.y-=w,t.updateCenter()),e.immovable||(e.x+=b,e.y+=w,e.updateCenter()),t.velocity.x*=t.bounce.x,t.velocity.y*=t.bounce.y,e.velocity.x*=e.bounce.x,e.velocity.y*=e.bounce.y,(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?l(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.collideObjects(t,e,i,n,r,!0)},collide:function(t,e,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.collideObjects(t,e,i,n,r,!1)},collideObjects:function(t,e,i,n,r,s){var o,a;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o<e.length;o++)this.collideHandler(t,e[o],i,n,r,s);else if(h&&!l)if(e)for(o=0;o<t.length;o++)this.collideHandler(t[o],e,i,n,r,s);else for(o=0;o<t.length;o++){var c=t[o];for(a=o+1;a<t.length;a++)o!==a&&this.collideHandler(c,t[a],i,n,r,s)}else for(o=0;o<t.length;o++)for(a=0;a<e.length;a++)this.collideHandler(t[o],e[a],i,n,r,s);else this.collideHandler(t,e,i,n,r,s);return this._total>0},collideHandler:function(t,e,i,n,r,s){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,r,s);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,r,s);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,r,s);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,r,s)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,r,s);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,r,s);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,r,s)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,r,s);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,r,s)}},collideSpriteVsSprite:function(t,e,i,n,r,s){return!(!t.body||!e.body||(this.separate(t.body,e.body,n,r,s)&&(i&&i.call(r,t,e),this._total++),0))},collideSpriteVsGroup:function(t,e,i,n,r,s){var o,a,l,c=t.body;if(0!==e.length&&c&&c.enable&&!c.checkCollision.none)if(this.useTree||e.physicsType===h.STATIC_BODY){var u=this.treeMinMax;u.minX=c.left,u.minY=c.top,u.maxX=c.right,u.maxY=c.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(u):this.staticTree.search(u);for(a=d.length,o=0;o<a;o++)c!==(l=d[o])&&l.enable&&!l.checkCollision.none&&e.contains(l.gameObject)&&this.separate(c,l,n,r,s,!0)&&(i&&i.call(r,c.gameObject,l.gameObject),this._total++)}else{var p=e.getChildren(),f=e.children.entries.indexOf(t);for(a=p.length,o=0;o<a;o++)(l=p[o].body)&&o!==f&&l.enable&&this.separate(c,l,n,r,s)&&(i&&i.call(r,c.gameObject,l.gameObject),this._total++)}},collideGroupVsTilemapLayer:function(t,e,i,n,r,s){var o=t.getChildren();if(0===o.length)return!1;for(var a=!1,h=0;h<o.length;h++)o[h].body&&this.collideSpriteVsTilemapLayer(o[h],e,i,n,r,s)&&(a=!0);return a},collideTiles:function(t,e,i,n,r){return!(!t.body.enable||0===e.length)&&this.collideSpriteVsTilesHandler(t,e,i,n,r,!1,!1)},overlapTiles:function(t,e,i,n,r){return!(!t.body.enable||0===e.length)&&this.collideSpriteVsTilesHandler(t,e,i,n,r,!0,!1)},collideSpriteVsTilemapLayer:function(t,e,i,n,r,s){var o=t.body;if(!o.enable||o.checkCollision.none)return!1;var a=o.position.x,h=o.position.y,l=o.width,c=o.height,u=e.layer;if(u.tileWidth>u.baseTileWidth){var d=(u.tileWidth-u.baseTileWidth)*e.scaleX;a-=d,l+=d}u.tileHeight>u.baseTileHeight&&(c+=(u.tileHeight-u.baseTileHeight)*e.scaleY);var p=v(a,h,l,c,null,e.scene.cameras.main,e.layer);return 0!==p.length&&this.collideSpriteVsTilesHandler(t,p,i,n,r,s,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,r,s,o){for(var a,h,l=t.body,c={left:0,right:0,top:0,bottom:0},d=!1,p=0;p<e.length;p++){var f=(h=(a=e[p]).tilemapLayer).tileToWorldXY(a.x,a.y);c.left=f.x,c.top=f.y,a.baseHeight!==a.height&&(c.top-=(a.height-a.baseHeight)*h.scaleY),c.right=c.left+a.width*h.scaleX,c.bottom=c.top+a.height*h.scaleY,P(c,l)&&(!n||n.call(r,t,a))&&w(a,t)&&(s||E(p,l,a,c,h,this.TILE_BIAS,o))&&(this._total++,d=!0,i&&i.call(r,t,a),s&&l.onOverlap?this.emit(u.TILE_OVERLAP,t,a,l):l.onCollide&&this.emit(u.TILE_COLLIDE,t,a,l))}return d},collideGroupVsGroup:function(t,e,i,n,r,s){if(0!==t.length&&0!==e.length)for(var o=t.getChildren(),a=0;a<o.length;a++)this.collideSpriteVsGroup(o[a],e,i,n,r,s)},wrap:function(t,e){t.body?this.wrapObject(t,e):t.getChildren?this.wrapArray(t.getChildren(),e):Array.isArray(t)?this.wrapArray(t,e):this.wrapObject(t,e)},wrapArray:function(t,e){for(var i=0;i<t.length;i++)this.wrapObject(t[i],e)},wrapObject:function(t,e){void 0===e&&(e=0),t.x=O(t.x,this.bounds.left-e,this.bounds.right+e),t.y=O(t.y,this.bounds.top-e,this.bounds.bottom+e)},shutdown:function(){this.tree.clear(),this.staticTree.clear(),this.bodies.clear(),this.staticBodies.clear(),this.colliders.destroy(),this.removeAllListeners()},destroy:function(){this.shutdown(),this.scene=null}});t.exports=D},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Benjamin D. Richards <benjamindrichards@gmail.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(60),s=i(242),o=i(193),a=i(10),h=i(56),l=i(3),c=new n({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,n=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.maxSpeed=-1,this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.pushable=!0,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.physicsType=r.DYNAMIC_BODY,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var n=!1;if(this.syncBounds){var r=t.getBounds(this._bounds);this.width=r.width,this.height=r.height,n=!0}else{var s=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===s&&this._sy===a||(this.width=this.sourceWidth*s,this.height=this.sourceHeight*a,this._sx=s,this._sy=a,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,n=this.blocked;t?(e.none=!0,e.up=!1,e.down=!1,e.left=!1,e.right=!1):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),i.none=!0,i.up=!1,i.down=!1,i.left=!1,i.right=!1,n.none=!0,n.up=!1,n.down=!1,n.left=!1,n.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){t&&this.resetFlags(),this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves&&(this.prev.x=this.position.x,this.prev.y=this.position.y,this.prevFrame.x=this.position.x,this.prevFrame.y=this.position.y),t&&this.update(e)},update:function(t){if(this.prev.x=this.position.x,this.prev.y=this.position.y,this.moves){this.world.updateMotion(this,t);var e=this.velocity.x,i=this.velocity.y;this.newVelocity.set(e*t,i*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(i,e),this.speed=Math.sqrt(e*e+i*i),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit(s.WORLD_BOUNDS,this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){var t=this.position.x-this.prevFrame.x,e=this.position.y-this.prevFrame.y;if(this.moves){var i=this.deltaMax.x,n=this.deltaMax.y;0!==i&&0!==t&&(t<0&&t<-i?t=-i:t>0&&t>i&&(t=i)),0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),this.gameObject.x+=t,this.gameObject.y+=e}t<0?this.facing=r.FACING_LEFT:t>0&&(this.facing=r.FACING_RIGHT),e<0?this.facing=r.FACING_UP:e>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this._tx=t,this._ty=e},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.customBoundsRectangle,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,r=this.worldBounce?-this.worldBounce.y:-this.bounce.y,s=!1;return t.x<e.x&&i.left?(t.x=e.x,this.velocity.x*=n,this.blocked.left=!0,s=!0):this.right>e.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,s=!0),t.y<e.y&&i.up?(t.y=e.y,this.velocity.y*=r,this.blocked.up=!0,s=!0):this.bottom>e.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=r,this.blocked.down=!0,s=!0),s&&(this.blocked.none=!1,this.updateCenter()),s},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var r=(n.width-t)/2,s=(n.height-e)/2;this.offset.set(r,s)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.prevFrame.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i,n){void 0===t&&(t=!0),this.collideWorldBounds=t;var r=void 0!==e,s=void 0!==i;return(r||s)&&(this.worldBounce||(this.worldBounce=new l),r&&(this.worldBounce.x=e),s&&(this.worldBounce.y=i)),void 0!==n&&(this.onWorldBounds=n),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,n){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e);var r=this.blocked;i&&(r.left=!0),n&&(r.right=!0)},processY:function(t,e,i,n){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e);var r=this.blocked;i&&(r.up=!0),n&&(r.down=!0)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e,i,n,r,s,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=r,this.processCallback=s,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26),r=i(3),s=new r,o=new r;t.exports=function(t,e,i,r,a,h,l){var c=l.tilemapLayer.tilemap._convert.WorldToTileXY;c(t,e,!0,s,h,l);var u=s.x,d=s.y;c(t+i,e+r,!1,o,h,l);var p=Math.ceil(o.x),f=Math.ceil(o.y);return n(u,d,p-u,f-d,a,l)}},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e,i){
|
|
/**
|
|
* @author Vladimir Agafonkin
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(430);function r(t){if(!(this instanceof r))return new r(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function s(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,i,n,r){r||(r=m(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var s,o=e;o<i;o++)s=t.children[o],h(r,t.leaf?n(s):s);return r}function h(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function u(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,r,s){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=r||(o=e+Math.ceil((i-e)/r/2)*r,n(t,o,e,i,s),a.push(e,o,o,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!f(t,e))return i;for(var r,s,o,a,h=[];e;){for(r=0,s=e.children.length;r<s;r++)o=e.children[r],f(t,a=e.leaf?n(o):o)&&(e.leaf?i.push(o):p(t,a)?this._all(o,i):h.push(o));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!f(t,e))return!1;for(var n,r,s,o,a=[];e;){for(n=0,r=e.children.length;n<r;n++)if(s=e.children[n],f(t,o=e.leaf?i(s):s)){if(e.leaf||p(t,o))return!0;a.push(s)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(t,e){if(!t)return this;for(var i,n,r,o,a=this.data,h=this.toBBox(t),l=[],c=[];a||l.length;){if(a||(a=l.pop(),n=l[l.length-1],i=c.pop(),o=!0),a.leaf&&-1!==(r=s(t,a.children,e)))return a.children.splice(r,1),l.push(a),this._condense(l),this;o||a.leaf||!p(a,h)?n?(i++,a=n.children[i],o=!1):a=null:(l.push(a),c.push(i),i=0,n=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:c,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,n){var r,s=i-e+1,a=this._maxEntries;if(s<=a)return o(r=m(t.slice(e,i+1)),this.toBBox),r;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),(r=m([])).leaf=!1,r.height=n;var h,l,c,u,d=Math.ceil(s/a),p=d*Math.ceil(Math.sqrt(a));for(g(t,e,i,p,this.compareMinX),h=e;h<=i;h+=p)for(g(t,h,c=Math.min(h+p-1,i),d,this.compareMinY),l=h;l<=c;l+=d)u=Math.min(l+d-1,c),r.children.push(this._build(t,l,u,n-1));return o(r,this.toBBox),r},_chooseSubtree:function(t,e,i,n){for(var r,s,o,a,h,l,c,d,p,f;n.push(e),!e.leaf&&n.length-1!==i;){for(c=d=1/0,r=0,s=e.children.length;r<s;r++)h=u(o=e.children[r]),p=t,f=o,(l=(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-h)<d?(d=l,c=h<c?h:c,a=o):l===d&&h<c&&(c=h,a=o);e=a||e.children[0]}return e},_insert:function(t,e,i){var n=this.toBBox,r=i?t:n(t),s=[],o=this._chooseSubtree(r,this.data,e,s);for(o.children.push(t),h(o,r);e>=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(r,s,e)},_split:function(t,e){var i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var s=this._chooseSplitIndex(i,r,n),a=m(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,r,s,o,h,l,c,d,p,f,m,g,v,y;for(l=c=1/0,n=e;n<=i-e;n++)r=a(t,0,n,this.toBBox),s=a(t,n,i,this.toBBox),p=r,f=s,m=void 0,g=void 0,v=void 0,y=void 0,m=Math.max(p.minX,f.minX),g=Math.max(p.minY,f.minY),v=Math.min(p.maxX,f.maxX),y=Math.min(p.maxY,f.maxY),o=Math.max(0,v-m)*Math.max(0,y-g),h=u(r)+u(s),o<l?(l=o,d=n,c=h<c?h:c):o===l&&h<c&&(c=h,d=n);return d},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:l,r=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)},_allDistMargin:function(t,e,i,n){t.children.sort(n);var r,s,o=this.toBBox,l=a(t,0,e,o),c=a(t,i-e,i,o),u=d(l)+d(c);for(r=e;r<i-e;r++)s=t.children[r],h(l,t.leaf?o(s):s),u+=d(l);for(r=i-e-1;r>=e;r--)s=t.children[r],h(c,t.leaf?o(s):s),u+=d(c);return u},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=r},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(527),r=i(529),s=i(245);t.exports=function(t,e,i,o,a,h,l){var c=o.left,u=o.top,d=o.right,p=o.bottom,f=i.faceLeft||i.faceRight,m=i.faceTop||i.faceBottom;if(l||(f=!0,m=!0),!f&&!m)return!1;var g=0,v=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()<e.deltaAbsY()&&(x=-1),0!==e.deltaX()&&0!==e.deltaY()&&f&&m&&(y=Math.min(Math.abs(e.position.x-d),Math.abs(e.right-c)),x=Math.min(Math.abs(e.position.y-p),Math.abs(e.bottom-u))),y<x){if(f&&0!==(g=n(e,i,c,d,h,l))&&!s(o,e))return!0;m&&(v=r(e,i,u,p,h,l))}else{if(m&&0!==(v=r(e,i,u,p,h,l))&&!s(o,e))return!0;f&&(g=n(e,i,c,d,h,l))}return 0!==g||0!==v}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(528);t.exports=function(t,e,i,r,s,o){var a=0,h=e.faceLeft,l=e.faceRight,c=e.collideLeft,u=e.collideRight;return o||(h=!0,l=!0,c=!0,u=!0),t.deltaX()<0&&u&&t.checkCollision.left?l&&t.x<r&&(a=t.x-r)<-s&&(a=0):t.deltaX()>0&&c&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>s&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(530);t.exports=function(t,e,i,r,s,o){var a=0,h=e.faceTop,l=e.faceBottom,c=e.collideUp,u=e.collideDown;return o||(h=!0,l=!0,c=!0,u=!0),t.deltaY()<0&&u&&t.checkCollision.up?l&&t.y<r&&(a=t.y-r)<-s&&(a=0):t.deltaY()>0&&c&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>s&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(243),r=i(1383);t.exports=function(t,e,i,s){var o=n(t,e,i,s),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateX||e.customSeparateX)return 0!==o||t.embedded&&e.embedded;var l=r.Set(t,e,o);return a||h?(a?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(244),r=i(1384);t.exports=function(t,e,i,s){var o=n(t,e,i,s),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateY||e.customSeparateY)return 0!==o||t.embedded&&e.embedded;var l=r.Set(t,e,o);return a||h?(a?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(63),r=i(0),s=i(60),o=i(56),a=i(3),h=new r({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,n=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-i*e.originX,e.y-n*e.originY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=s.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&n.getCenter){var r=n.displayWidth/2,s=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(r-this.halfWidth,s-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Bounce:i(1500),Collision:i(1501),Force:i(1502),Friction:i(1503),Gravity:i(1504),Mass:i(1505),Sensor:i(1506),SetBody:i(1507),Sleep:i(1508),Static:i(1525),Transform:i(1526),Velocity:i(1527)}},function(t,e){var i={};t.exports=i,i.create=function(t,e){var n=t.bodyA,r=t.bodyB,s={id:i.id(n,r),bodyA:n,bodyB:r,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||r.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(s,t,e),s},i.update=function(t,e,n){if(t.collision=e,e.collided){var r=e.supports,s=t.activeContacts,o=e.parentA,a=e.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h<r.length;h++)s[h]=r[h].contact;var l=r.length;l<s.length&&(s.length=l),t.separation=e.depth,i.setActive(t,!0,n)}else!0===t.isActive&&i.setActive(t,!1,n)},i.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.activeContacts.length=0)},i.id=function(t,e){return t.id<e.id?"A"+t.id+"B"+e.id:"A"+e.id+"B"+t.id}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(3));t.exports=function(t,e,i,r){var s=i.tilemapLayer,o=s.cullPaddingX,a=s.cullPaddingY,h=s.tilemap.tileToWorldXY(t,e,n,r,s);return h.x>r.worldView.x+s.scaleX*i.tileWidth*(-o-.5)&&h.x<r.worldView.right+s.scaleX*i.tileWidth*(o-.5)&&h.y>r.worldView.y+s.scaleY*i.tileHeight*(-a-1)&&h.y<r.worldView.bottom+s.scaleY*i.tileHeight*(a-.5)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26);t.exports=function(t,e,i,r,s,o,a){for(var h=n(i,r,s,o,null,a),l=0;l<h.length;l++)h[l]&&h[l].index===t&&(h[l].index=e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10),r=i(137),s=i(76),o=new n;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,n=t.tilemapLayer,a=Math.floor(i.tileWidth*n.scaleX),h=Math.floor(i.tileHeight*n.scaleY),l=s(e.worldView.x-n.x,a,0,!0)-n.cullPaddingX,c=r(e.worldView.right-n.x,a,0,!0)+n.cullPaddingX,u=s(e.worldView.y-n.y,h,0,!0)-n.cullPaddingY,d=r(e.worldView.bottom-n.y,h,0,!0)+n.cullPaddingY;return o.setTo(l,u,c-l,d-u)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(539),r=i(157);t.exports=function(t,e,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var o=t.tilemapLayer,a=n(t,e);return(o.skipCull||1!==o.scrollFactorX||1!==o.scrollFactorY)&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),r(t,a,s,i),i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(542),r=i(157);t.exports=function(t,e,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=n(t,e);r(t,a,s,i)}return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(137),r=i(76);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,o=Math.floor(i.tileWidth*s.scaleX),a=Math.floor(i.tileHeight*s.scaleY),h=t.hexSideLength,l=(a-h)/2+h;return{left:r(e.worldView.x-s.x,o,0,!0)-s.cullPaddingX,right:n(e.worldView.right-s.x,o,0,!0)+s.cullPaddingX,top:r(e.worldView.y-s.y,l,0,!0)-s.cullPaddingY,bottom:n(e.worldView.bottom-s.y,l,0,!0)+s.cullPaddingY}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(537);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var s,o,a,h=t.tilemapLayer,l=t.data,c=t.width,u=t.height,d=c,p=u;if(!h.skipCull)if(0===r){for(o=0;o<p;o++)for(s=0;l[o]&&s<d;s++)if(n(s,o,t,e)){if(!(a=l[o][s])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}}else if(1===r){for(o=0;o<p;o++)for(s=d;l[o]&&s>=0;s--)if(n(s,o,t,e)){if(!(a=l[o][s])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}}else if(2===r){for(o=p;o>=0;o--)for(s=0;l[o]&&s<d;s++)if(n(s,o,t,e)){if(!(a=l[o][s])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}}else if(3===r)for(o=p;o>=0;o--)for(s=d;l[o]&&s>=0;s--)if(n(s,o,t,e)){if(!(a=l[o][s])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}return h.tilesDrawn=i.length,h.tilesTotal=c*u,i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(545),r=i(157);t.exports=function(t,e,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=n(t,e);r(t,a,s,i)}return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(137),r=i(76);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,o=Math.floor(i.tileWidth*s.scaleX),a=Math.floor(i.tileHeight*s.scaleY);return{left:r(e.worldView.x-s.x,o,0,!0)-s.cullPaddingX,right:n(e.worldView.right-s.x,o,0,!0)+s.cullPaddingX,top:r(e.worldView.y-s.y,a/2,0,!0)-s.cullPaddingY,bottom:n(e.worldView.bottom-s.y,a/2,0,!0)+s.cullPaddingY}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);t.exports=function(t,e,i,r,s){i||(i=new n);var o=s.baseTileWidth,a=s.baseTileHeight,h=s.tilemapLayer,l=0,c=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),o*=h.scaleX,c=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var u=s.hexSideLength,d=l+t*o+e%2*(o/2),p=c+e*((a-u)/2+u);return i.set(d,p)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);t.exports=function(t,e,i,r,s){i||(i=new n);var o=s.baseTileWidth,a=s.baseTileHeight,h=s.tilemapLayer,l=0,c=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),o*=h.scaleX,c=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var u=l+o/2*(t-e),d=c+(t+e)*(a/2);return i.set(u,d)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);t.exports=function(t,e,i,r,s){i||(i=new n);var o=s.baseTileWidth,a=s.baseTileHeight,h=s.tilemapLayer,l=0,c=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),o*=h.scaleX,c=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var u=l+t*o+e%2*(o/2),d=c+e*(a/2);return i.set(u,d)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(249),r=i(250),s=i(3);t.exports=function(t,e,i,o,a){return i||(i=new s(0,0)),i.x=n(t,o,a),i.y=r(e,o,a),i}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,r=i.tilemapLayer,s=0;r&&(void 0===e&&(e=r.scene.cameras.main),s=r.y+e.scrollY*(1-r.scrollFactorY),n*=r.scaleY);var o=r.tilemap.hexSideLength;return s+t*((n-o)/2+o)}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,r=i.tilemapLayer,s=0;return r&&(void 0===e&&(e=r.scene.cameras.main),s=r.y+e.scrollY*(1-r.scrollFactorY),n*=r.scaleY),s+t*(n/2)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);t.exports=function(t,e,i,r,s,o){r||(r=new n);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(s||(s=l.scene.cameras.main),e-=l.y+s.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+s.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var c=o.hexSideLength,u=(h-c)/2+c,d=i?Math.floor(e/u):e/u,p=i?Math.floor((t-d%2*.5*a)/a):(t-d%2*.5*a)/a;return r.set(p,d)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);t.exports=function(t,e,i,r,s,o){r||(r=new n);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(s||(s=l.scene.cameras.main),e-=l.y+s.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+s.scrollX*(1-l.scrollFactorX),a*=l.scaleX),t-=a/2;var c=i?Math.floor((t/(a/2)+e/(h/2))/2):(t/(a/2)+e/(h/2))/2,u=i?Math.floor((e/(h/2)-t/(a/2))/2):(e/(h/2)-t/(a/2))/2;return r.set(c,u)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);t.exports=function(t,e,i,r,s,o){r||(r=new n);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(s||(s=l.scene.cameras.main),e-=l.y+s.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+s.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var c=i?Math.floor(e/(h/2)):e/(h/2),u=i?Math.floor((t+c%2*.5*a)/a):(t+c%2*.5*a)/a;return r.set(u,c)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(251),r=i(252),s=i(3);t.exports=function(t,e,i,o,a,h){return void 0===i&&(i=!0),o||(o=new s(0,0)),o.x=n(t,i,a,h),o.y=r(e,i,a,h),o}},function(t,e){t.exports=function(t,e,i,n){var r=n.baseTileHeight,s=n.tilemapLayer;s&&(i||(i=s.scene.cameras.main),t-=s.y+i.scrollY*(1-s.scrollFactorY),r*=s.scaleY);var o=n.hexSideLength,a=(r-o)/2+o;return e?Math.floor(t/a):t/a}},function(t,e){t.exports=function(t,e,i,n){var r=n.baseTileHeight,s=n.tilemapLayer;return s&&(i||(i=s.scene.cameras.main),t-=s.y+i.scrollY*(1-s.scrollFactorY),r*=s.scaleY),e?Math.floor(t/(r/2)):t/(r/2)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(118);t.exports=function(t,e,i){if(n(t,e,i)){var r=i.data[e][t];return null!==r&&r.index>-1}return!1}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(83),r=i(118),s=i(248);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!0),void 0===o&&(o=!0),!r(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new n(a,-1,t,e,a.tileWidth,a.tileHeight),o&&h&&h.collides&&s(t,e,a),h):null}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(39),r=i(255),s=i(561),o=i(562),a=i(573);t.exports=function(t,e,i,h,l,c){var u;switch(e){case n.ARRAY_2D:u=r(t,i,h,l,c);break;case n.CSV:u=s(t,i,h,l,c);break;case n.TILED_JSON:u=o(t,i,c);break;case n.WELTMEISTER:u=a(t,i,c);break;default:console.warn("Unrecognized tilemap data format: "+e),u=null}return u}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(39),r=i(255);t.exports=function(t,e,i,s,o){var a=e.trim().split("\n").map((function(t){return t.split(",")})),h=r(t,a,i,s,o);return h.format=n.CSV,h}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(563),r=i(564),s=i(29),o=i(39),a=i(254),h=i(120),l=i(565),c=i(566),u=i(569),d=i(571);t.exports=function(t,e,i){var p=new h({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:a(e.orientation),format:o.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});p.orientation===s.HEXAGONAL&&(p.hexSideLength=e.hexsidelength),p.layers=u(e,i),p.images=l(e);var f=d(e);return p.tilesets=f.tilesets,p.imageCollections=f.imageCollections,p.objects=c(e),p.tiles=r(p),n(p),p}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(17);t.exports=function(t){for(var e,i,r,s,o,a=0;a<t.layers.length;a++){e=t.layers[a],s=null;for(var h=0;h<e.data.length;h++){o=e.data[h];for(var l=0;l<o.length;l++)null===(i=o[l])||i.index<0||(r=t.tiles[i.index][2],s=t.tilesets[r],i.width=s.tileWidth,i.height=s.tileHeight,s.tileProperties&&s.tileProperties[i.index-s.firstgid]&&(i.properties=n(i.properties,s.tileProperties[i.index-s.firstgid])))}}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(121);t.exports=function(t){var e,i,r=[];for(e=0;e<t.imageCollections.length;e++)for(var s=t.imageCollections[e],o=s.images,a=0;a<o.length;a++){var h=o[a];(i=new n(h.image,h.gid,s.imageWidth,s.imageHeight,0,0)).updateTileData(s.imageWidth,s.imageHeight),t.tilesets.push(i)}for(e=0;e<t.tilesets.length;e++)for(var l=(i=t.tilesets[e]).tileMargin,c=i.tileMargin,u=0,d=0,p=0,f=i.firstgid;f<i.firstgid+i.total&&(r[f]=[l,c,e],l+=i.tileWidth+i.tileSpacing,++u!==i.total)&&(++d!==i.columns||(l=i.tileMargin,c+=i.tileHeight+i.tileSpacing,d=0,++p!==i.rows));f++);return r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(2),r=i(159);t.exports=function(t){for(var e=[],i=[],s=r(t);s.i<s.layers.length||i.length>0;)if(s.i>=s.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}s=i.pop()}else{var o=s.layers[s.i];if(s.i++,"imagelayer"===o.type){var a=n(o,"offsetx",0)+n(o,"startx",0),h=n(o,"offsety",0)+n(o,"starty",0);e.push({name:s.name+o.name,image:o.image,x:s.x+a+o.x,y:s.y+h+o.y,alpha:s.opacity*o.opacity,visible:s.visible&&o.visible,properties:n(o,"properties",{})})}else if("group"===o.type){var l=r(t,o,s);i.push(s),s=l}}return e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(2),r=i(256),s=i(568),o=i(159);t.exports=function(t){for(var e=[],i=[],a=o(t);a.i<a.layers.length||i.length>0;)if(a.i>=a.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}a=i.pop()}else{var h=a.layers[a.i];if(a.i++,h.opacity*=a.opacity,h.visible=a.visible&&h.visible,"objectgroup"===h.type){h.name=a.name+h.name;for(var l=a.x+n(h,"startx",0)+n(h,"offsetx",0),c=a.y+n(h,"starty",0)+n(h,"offsety",0),u=[],d=0;d<h.objects.length;d++){var p=r(h.objects[d],l,c);u.push(p)}var f=new s(h);f.objects=u,e.push(f)}else if("group"===h.type){var m=o(t,h,a);i.push(a),a=m}}return e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(125);t.exports=function(t,e){for(var i={},r=0;r<e.length;r++){var s=e[r];n(t,s)&&(i[s]=t[s])}return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=new n({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","object layer"),this.opacity=r(t,"opacity",1),this.properties=r(t,"properties",{}),this.propertyTypes=r(t,"propertytypes",{}),this.type=r(t,"type","objectgroup"),this.visible=r(t,"visible",!0),this.objects=r(t,"objects",[])}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(570),r=i(29),s=i(159),o=i(254),a=i(2),h=i(119),l=i(257),c=i(83);t.exports=function(t,e){for(var i=a(t,"infinite",!1),u=[],d=[],p=s(t);p.i<p.layers.length||d.length>0;)if(p.i>=p.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}p=d.pop()}else{var f=p.layers[p.i];if(p.i++,"tilelayer"===f.type)if(f.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+f.name+"'");else{if(f.encoding&&"base64"===f.encoding){if(f.chunks)for(var m=0;m<f.chunks.length;m++)f.chunks[m].data=n(f.chunks[m].data);f.data&&(f.data=n(f.data)),delete f.encoding}var g,v,y,x,b=[],w=0;if(i){var T=a(f,"startx",0)+f.x,_=a(f,"starty",0)+f.y;(g=new h({name:p.name+f.name,x:p.x+a(f,"offsetx",0)+T*t.tilewidth,y:p.y+a(f,"offsety",0)+_*t.tileheight,width:f.width,height:f.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:p.opacity*f.opacity,visible:p.visible&&f.visible,properties:a(f,"properties",[]),orientation:o(t.orientation)})).orientation===r.HEXAGONAL&&(g.hexSideLength=t.hexsidelength);for(var E=0;E<f.height;E++){b.push([null]);for(var S=0;S<f.width;S++)b[E][S]=null}for(E=0,B=f.chunks.length;E<B;E++)for(var M=f.chunks[E],A=M.x-T,C=M.y-_,P=0,R=0,L=M.data.length;R<L;R++){var O=w+A,D=P+C;(v=l(M.data[R])).gid>0?((y=new c(g,v.gid,O,D,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,b[D][O]=y):(x=e?null:new c(g,-1,O,D,t.tilewidth,t.tileheight),b[D][O]=x),++w===M.width&&(P++,w=0)}}else{(g=new h({name:p.name+f.name,x:p.x+a(f,"offsetx",0)+f.x,y:p.y+a(f,"offsety",0)+f.y,width:f.width,height:f.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:p.opacity*f.opacity,visible:p.visible&&f.visible,properties:a(f,"properties",[]),orientation:o(t.orientation)})).orientation===r.HEXAGONAL&&(g.hexSideLength=t.hexsidelength);for(var I=[],F=0,B=f.data.length;F<B;F++)(v=l(f.data[F])).gid>0?((y=new c(g,v.gid,w,b.length,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,I.push(y)):(x=e?null:new c(g,-1,w,b.length,t.tilewidth,t.tileheight),I.push(x)),++w===f.width&&(b.push(I),w=0,I=[])}g.data=b,u.push(g)}else if("group"===f.type){var k=s(t,f,p);d.push(p),p=k}}return u}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),r=0;r<i;r+=4)n[r/4]=(e.charCodeAt(r)|e.charCodeAt(r+1)<<8|e.charCodeAt(r+2)<<16|e.charCodeAt(r+3)<<24)>>>0;return n}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(121),r=i(572),s=i(256);t.exports=function(t){for(var e,i=[],o=[],a=null,h=0;h<t.tilesets.length;h++){var l=t.tilesets[h];if(l.source)console.warn("External tilesets unsupported. Use Embed Tileset and re-export");else if(l.image){var c=new n(l.name,l.firstgid,l.tilewidth,l.tileheight,l.margin,l.spacing);if(t.version>1){if(Array.isArray(l.tiles)){for(var u={},d={},p=0;p<l.tiles.length;p++){var f=l.tiles[p];if(f.properties){var m={};f.properties.forEach((function(t){m[t.name]=t.value})),d[f.id]=m}if(f.objectgroup&&(u[f.id]={objectgroup:f.objectgroup},f.objectgroup.objects)){var g=f.objectgroup.objects.map((function(t){return s(t)}));u[f.id].objectgroup.objects=g}f.animation&&(u.hasOwnProperty(f.id)?u[f.id].animation=f.animation:u[f.id]={animation:f.animation})}c.tileData=u,c.tileProperties=d}}else if(l.tileproperties&&(c.tileProperties=l.tileproperties),l.tiles)for(e in c.tileData=l.tiles,c.tileData){var v=c.tileData[e].objectgroup;if(v&&v.objects){var y=v.objects.map((function(t){return s(t)}));c.tileData[e].objectgroup.objects=y}}c.updateTileData(l.imagewidth,l.imageheight),i.push(c)}else{var x=new r(l.name,l.firstgid,l.tilewidth,l.tileheight,l.margin,l.spacing,l.properties),b=0;for(p=0;p<l.tiles.length;p++){var w=(f=l.tiles[p]).image,T=parseInt(f.id,10),_=l.firstgid+T;x.addImage(_,w),b=Math.max(T,b)}x.maxId=b,o.push(x)}a&&(a.lastgid=l.firstgid-1),a=l}return{tilesets:i,imageCollections:o}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t,e,i,n,r,s,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===r&&(r=0),void 0===s&&(s=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|r,this.imageSpacing=0|s,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t<this.firstgid+this.total},addImage:function(t,e){return this.images.push({gid:t,image:e}),this.total++,this}});t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(39),r=i(120),s=i(574),o=i(575);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var a=0,h=0,l=0;l<e.layer.length;l++)e.layer[l].width>a&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var c=new r({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return c.layers=s(e,i),c.tilesets=o(e),c}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(119),r=i(83);t.exports=function(t,e){for(var i=[],s=0;s<t.layer.length;s++){for(var o=t.layer[s],a=new n({name:o.name,width:o.width,height:o.height,tileWidth:o.tilesize,tileHeight:o.tilesize,visible:1===o.visible}),h=[],l=[],c=0;c<o.data.length;c++){for(var u=0;u<o.data[c].length;u++){var d,p=o.data[c][u]-1;d=p>-1?new r(a,p,u,c,o.tilesize,o.tilesize):e?null:new r(a,-1,u,c,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(121);t.exports=function(t){for(var e=[],i=[],r=0;r<t.layer.length;r++){var s=t.layer[r],o=s.tilesetName;""!==o&&-1===i.indexOf(o)&&(i.push(o),e.push(new n(o,0,s.tilesize,s.tilesize,0,0)))}return e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(35),s=i(39),o=i(2),a=i(119),h=i(29),l=i(356),c=i(74),u=i(73),d=i(83),p=i(247),f=i(577),m=i(121),g=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:p.GetWorldToTileXYFunction(i),WorldToTileX:p.GetWorldToTileXFunction(i),WorldToTileY:p.GetWorldToTileYFunction(i),TileToWorldXY:p.GetTileToWorldXYFunction(i),TileToWorldX:p.GetTileToWorldXFunction(i),TileToWorldY:p.GetTileToWorldYFunction(i)}},createBlankDynamicLayer:function(t,e,i,n,r,s,o,a){return console.warn("createBlankDynamicLayer is deprecated. Use createBlankLayer"),this.createBlankLayer(t,e,i,n,r,s,o,a)},createDynamicLayer:function(t,e,i,n){return console.warn("createDynamicLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,n)},createStaticLayer:function(t,e,i,n){return console.warn("createStaticLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,n)},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,r,o,a){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===s.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var c=this.tilesets[l];return c?(c.setTileSize(i,n),c.setSpacing(r,o),c.setImage(h),c):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),(c=new m(t,a,i,n,r,o)).setImage(h),this.tilesets.push(c),c)},copy:function(t,e,i,n,r,s,o,a){return null!==(a=this.getLayer(a))?(p.Copy(t,e,i,n,r,s,o,a),this):null},createBlankLayer:function(t,e,i,n,r,s,o,h){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=this.width),void 0===s&&(s=this.height),void 0===o&&(o=this.tileWidth),void 0===h&&(h=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,c=new a({name:t,tileWidth:o,tileHeight:h,width:r,height:s,orientation:this.orientation}),u=0;u<s;u++){l=[];for(var p=0;p<r;p++)l.push(new d(c,-1,p,u,o,h,this.tileWidth,this.tileHeight));c.data.push(l)}this.layers.push(c),this.currentLayerIndex=this.layers.length-1;var m=new f(this.scene,this,this.currentLayerIndex,e,i,n);return m.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(m),m},createLayer:function(t,e,i,n){var r=this.getLayerIndex(t);if(null===r)return console.warn("Invalid Tilemap Layer ID: "+t),"string"==typeof t&&console.warn("Valid tilelayer names:\n\t"+this.getTileLayerNames().join(",\n\t")),null;var s=this.layers[r];if(s.tilemapLayer)return console.warn("Tilemap Layer ID already exists:"+t),null;this.currentLayerIndex=r,void 0===i&&(i=s.x),void 0===n&&(n=s.y);var o=new f(this.scene,this,r,e,i,n);return o.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(o),o},createFromObjects:function(t,e){var i=[],n=this.getObjectLayer(t);if(!n)return console.warn("createFromObjects: Invalid objectLayerName given: "+t),i;Array.isArray(e)||(e=[e]);for(var s=n.objects,a=0;a<e.length;a++){for(var h,c=e[a],d=o(c,"id",null),p=o(c,"gid",null),f=o(c,"name",null),m=[],g=0;g<s.length;g++)h=s[g],(null===d&&null===p&&null===f||null!==d&&h.id===d||null!==p&&h.gid===p||null!==f&&h.name===f)&&m.push(h);for(var v=o(c,"classType",u),y=o(c,"scene",this.scene),x=o(c,"container",null),b=o(c,"key",null),w=o(c,"frame",null),T=0;T<m.length;T++){h=m[T];var _=new v(y);_.setName(h.name),_.setPosition(h.x,h.y),_.setTexture(b,w),h.width&&(_.displayWidth=h.width),h.height&&(_.displayHeight=h.height);var E={x:_.originX*h.width,y:(_.originY-1)*h.height};if(h.rotation){var S=r(h.rotation);l(E,S),_.rotation=S}for(var M in _.x+=E.x,_.y+=E.y,void 0===h.flippedHorizontal&&void 0===h.flippedVertical||_.setFlip(h.flippedHorizontal,h.flippedVertical),h.visible||(_.visible=!1),h.properties)void 0!==_[M]?_[M]=h.properties[M]:_.setData(M,h.properties[M]);x?x.add(_):y.add.existing(_),i.push(_)}}return i},createFromTiles:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:p.CreateFromTiles(t,e,i,n,r,s)},fill:function(t,e,i,n,r,s,o){return void 0===s&&(s=!0),null===(o=this.getLayer(o))?null:(p.Fill(t,e,i,n,r,s,o),this)},filterObjects:function(t,e,i){if("string"==typeof t){var n=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+n),null}return t.objects.filter(e,i)},filterTiles:function(t,e,i,n,r,s,o,a){return null===(a=this.getLayer(a))?null:p.FilterTiles(t,e,i,n,r,s,o,a)},findByIndex:function(t,e,i,n){return null===(n=this.getLayer(n))?null:p.FindByIndex(t,e,i,n)},findObject:function(t,e,i){if("string"==typeof t){var n=t;if(!(t=this.getObjectLayer(t)))return console.warn("No object layer found with the name: "+n),null}return t.objects.find(e,i)||null},findTile:function(t,e,i,n,r,s,o,a){return null===(a=this.getLayer(a))?null:p.FindTile(t,e,i,n,r,s,o,a)},forEachTile:function(t,e,i,n,r,s,o,a){return null===(a=this.getLayer(a))?null:(p.ForEachTile(t,e,i,n,r,s,o,a),this)},getImageIndex:function(t){return this.getIndex(this.images,t)},getImageLayerNames:function(){return this.images&&Array.isArray(this.images)?this.images.map((function(t){return t.name})):[]},getIndex:function(t,e){for(var i=0;i<t.length;i++)if(t[i].name===e)return i;return null},getLayer:function(t){var e=this.getLayerIndex(t);return null!==e?this.layers[e]:null},getObjectLayer:function(t){var e=this.getIndex(this.objects,t);return null!==e?this.objects[e]:null},getObjectLayerNames:function(){return this.objects&&Array.isArray(this.objects)?this.objects.map((function(t){return t.name})):[]},getLayerIndex:function(t){return void 0===t?this.currentLayerIndex:"string"==typeof t?this.getLayerIndexByName(t):"number"==typeof t&&t<this.layers.length?t:t instanceof f?t.layerIndex:null},getLayerIndexByName:function(t){return this.getIndex(this.layers,t)},getTileAt:function(t,e,i,n){return null===(n=this.getLayer(n))?null:p.GetTileAt(t,e,i,n)},getTileAtWorldXY:function(t,e,i,n,r){return null===(r=this.getLayer(r))?null:p.GetTileAtWorldXY(t,e,i,n,r)},getTileLayerNames:function(){return this.layers&&Array.isArray(this.layers)?this.layers.map((function(t){return t.name})):[]},getTilesWithin:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:p.GetTilesWithin(t,e,i,n,r,s)},getTilesWithinShape:function(t,e,i,n){return null===(n=this.getLayer(n))?null:p.GetTilesWithinShape(t,e,i,n)},getTilesWithinWorldXY:function(t,e,i,n,r,s,o){return null===(o=this.getLayer(o))?null:p.GetTilesWithinWorldXY(t,e,i,n,r,s,o)},getTileset:function(t){var e=this.getIndex(this.tilesets,t);return null!==e?this.tilesets[e]:null},getTilesetIndex:function(t){return this.getIndex(this.tilesets,t)},hasTileAt:function(t,e,i){return null===(i=this.getLayer(i))?null:p.HasTileAt(t,e,i)},hasTileAtWorldXY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:p.HasTileAtWorldXY(t,e,i,n)},layer:{get:function(){return this.layers[this.currentLayerIndex]},set:function(t){this.setLayer(t)}},putTileAt:function(t,e,i,n,r){return void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:p.PutTileAt(t,e,i,n,r)},putTileAtWorldXY:function(t,e,i,n,r,s){return void 0===n&&(n=!0),null===(s=this.getLayer(s))?null:p.PutTileAtWorldXY(t,e,i,n,r,s)},putTilesAt:function(t,e,i,n,r){return void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:(p.PutTilesAt(t,e,i,n,r),this)},randomize:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:(p.Randomize(t,e,i,n,r,s),this)},calculateFacesAt:function(t,e,i){return null===(i=this.getLayer(i))?null:(p.CalculateFacesAt(t,e,i),this)},calculateFacesWithin:function(t,e,i,n,r){return null===(r=this.getLayer(r))?null:(p.CalculateFacesWithin(t,e,i,n,r),this)},removeLayer:function(t){var e=this.getLayerIndex(t);if(null!==e){c(this.layers,e);for(var i=e;i<this.layers.length;i++)this.layers[i].tilemapLayer&&this.layers[i].tilemapLayer.layerIndex--;return this.currentLayerIndex===e&&(this.currentLayerIndex=0),this}return null},destroyLayer:function(t){var e=this.getLayerIndex(t);return null!==e?((t=this.layers[e]).destroy(),c(this.layers,e),this.currentLayerIndex===e&&(this.currentLayerIndex=0),this):null},removeAllLayers:function(){for(var t=this.layers,e=0;e<t.length;e++)t[e].tilemapLayer&&t[e].tilemapLayer.destroy(!1);return t.length=0,this.currentLayerIndex=0,this},removeTile:function(t,e,i){void 0===e&&(e=-1),void 0===i&&(i=!0);var n=[];Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var s=t[r];n.push(this.removeTileAt(s.x,s.y,!0,i,s.tilemapLayer)),e>-1&&this.putTileAt(e,s.x,s.y,i,s.tilemapLayer)}return n},removeTileAt:function(t,e,i,n,r){return void 0===i&&(i=!0),void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:p.RemoveTileAt(t,e,i,n,r)},removeTileAtWorldXY:function(t,e,i,n,r,s){return void 0===i&&(i=!0),void 0===n&&(n=!0),null===(s=this.getLayer(s))?null:p.RemoveTileAtWorldXY(t,e,i,n,r,s)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===h.ORTHOGONAL&&p.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,n=0;n<i.length;n++)p.RenderDebug(t,e,i[n]);return this},replaceByIndex:function(t,e,i,n,r,s,o){return null===(o=this.getLayer(o))?null:(p.ReplaceByIndex(t,e,i,n,r,s,o),this)},setCollision:function(t,e,i,n,r){return void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===r&&(r=!0),null===(n=this.getLayer(n))?null:(p.SetCollision(t,e,i,n,r),this)},setCollisionBetween:function(t,e,i,n,r){return void 0===i&&(i=!0),void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:(p.SetCollisionBetween(t,e,i,n,r),this)},setCollisionByProperty:function(t,e,i,n){return void 0===e&&(e=!0),void 0===i&&(i=!0),null===(n=this.getLayer(n))?null:(p.SetCollisionByProperty(t,e,i,n),this)},setCollisionByExclusion:function(t,e,i,n){return void 0===e&&(e=!0),void 0===i&&(i=!0),null===(n=this.getLayer(n))?null:(p.SetCollisionByExclusion(t,e,i,n),this)},setCollisionFromCollisionGroup:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),null===(i=this.getLayer(i))?null:(p.SetCollisionFromCollisionGroup(t,e,i),this)},setTileIndexCallback:function(t,e,i,n){return null===(n=this.getLayer(n))?null:(p.SetTileIndexCallback(t,e,i,n),this)},setTileLocationCallback:function(t,e,i,n,r,s,o){return null===(o=this.getLayer(o))?null:(p.SetTileLocationCallback(t,e,i,n,r,s,o),this)},setLayer:function(t){var e=this.getLayerIndex(t);return null!==e&&(this.currentLayerIndex=e),this},setBaseTileSize:function(t,e){this.tileWidth=t,this.tileHeight=e,this.widthInPixels=this.width*t,this.heightInPixels=this.height*e;for(var i=0;i<this.layers.length;i++){this.layers[i].baseTileWidth=t,this.layers[i].baseTileHeight=e;for(var n=this.layers[i].data,r=this.layers[i].width,s=this.layers[i].height,o=0;o<s;o++)for(var a=0;a<r;a++){var h=n[o][a];null!==h&&h.setSize(void 0,void 0,t,e)}}return this},setLayerTileSize:function(t,e,i){if(null===(i=this.getLayer(i)))return this;i.tileWidth=t,i.tileHeight=e;for(var n=i.data,r=i.width,s=i.height,o=0;o<s;o++)for(var a=0;a<r;a++){var h=n[o][a];null!==h&&h.setSize(t,e)}return this},shuffle:function(t,e,i,n,r){return null===(r=this.getLayer(r))?null:(p.Shuffle(t,e,i,n,r),this)},swapByIndex:function(t,e,i,n,r,s,o){return null===(o=this.getLayer(o))?null:(p.SwapByIndex(t,e,i,n,r,s,o),this)},tileToWorldX:function(t,e,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldX(t,e,i)},tileToWorldY:function(t,e,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldY(t,e,i)},tileToWorldXY:function(t,e,i,n,r){return null===(r=this.getLayer(r))?null:this._convert.TileToWorldXY(t,e,i,n,r)},weightedRandomize:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:(p.WeightedRandomize(e,i,n,r,t,s),this)},worldToTileX:function(t,e,i,n){return null===(n=this.getLayer(n))?null:this._convert.WorldToTileX(t,e,i,n)},worldToTileY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:this._convert.WorldToTileY(t,e,i,n)},worldToTileXY:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:this._convert.WorldToTileXY(t,e,i,n,r,s)},destroy:function(){this.removeAllLayers(),this.tilesets.length=0,this.objects.length=0,this.scene=null}});t.exports=g},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(11),s=i(15),o=i(247),a=i(1449),h=new n({Extends:s,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Origin,r.Pipeline,r.Transform,r.Visible,r.ScrollFactor,a],initialize:function(t,e,i,n,r,a){s.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=o.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(r,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline()},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var s=t[r];if("string"==typeof s&&(s=n.getTileset(s)),s){i.push(s);for(var o=s.firstgid,a=0;a<s.total;a++)e[o+a]=s}}this.gidMap=e,this.tileset=i},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return o.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,r){return o.CreateFromTiles(t,e,i,n,r,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,r,s,a){return o.Copy(t,e,i,n,r,s,a,this.layer),this},fill:function(t,e,i,n,r,s){return o.Fill(t,e,i,n,r,s,this.layer),this},filterTiles:function(t,e,i,n,r,s,a){return o.FilterTiles(t,e,i,n,r,s,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,r,s,a){return o.FindTile(t,e,i,n,r,s,a,this.layer)},forEachTile:function(t,e,i,n,r,s,a){return o.ForEachTile(t,e,i,n,r,s,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return o.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,r){return o.GetTilesWithin(t,e,i,n,r,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,r,s){return o.GetTilesWithinWorldXY(t,e,i,n,r,s,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return o.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,r){return o.PutTileAtWorldXY(t,e,i,n,r,this.layer)},putTilesAt:function(t,e,i,n){return o.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,r){return o.Randomize(t,e,i,n,r,this.layer),this},removeTileAt:function(t,e,i,n){return o.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,r){return o.RemoveTileAtWorldXY(t,e,i,n,r,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,r,s){return o.ReplaceByIndex(t,e,i,n,r,s,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,n){return o.SetCollision(t,e,i,this.layer,n),this},setCollisionBetween:function(t,e,i,n){return o.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,r,s){return o.SetTileLocationCallback(t,e,i,n,r,s,this.layer),this},shuffle:function(t,e,i,n){return o.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,r,s){return o.SwapByIndex(t,e,i,n,r,s,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,n){return this.tilemap.tileToWorldXY(t,e,i,n,this)},weightedRandomize:function(t,e,i,n,r){return o.WeightedRandomize(e,i,n,r,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,n,r){return this.tilemap.worldToTileXY(t,e,i,n,r,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],s.prototype.destroy.call(this))}});t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(2),s=new n({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=r(t,"delay",0),this.repeat=r(t,"repeat",0),this.loop=r(t,"loop",!1),this.callback=r(t,"callback",void 0),this.callbackScope=r(t,"callbackScope",this.callback),this.args=r(t,"args",[]),this.timeScale=r(t,"timeScale",1),this.startAt=r(t,"startAt",0),this.paused=r(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1458);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(6);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(261),r=i(13),s=i(96),o=i(80),a=i(160),h=i(6),l=i(260),c=i(262),u=i(264);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),p=h(e,"to",1),f=[{value:d}],m=a(e,"delay",i.delay),g=a(e,"duration",i.duration),v=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),v),x=a(e,"hold",i.hold),b=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),T=s(e,"yoyo",i.yoyo),_=[],E=l("value",p),S=u(f[0],0,"value",E.getEnd,E.getStart,E.getActive,y,m,g,T,x,b,w,!1,!1);S.start=d,S.current=d,S.to=p,_.push(S);var M=new c(t,_,f);M.offset=r(e,"offset",null),M.completeDelay=r(e,"completeDelay",0),M.loop=Math.round(r(e,"loop",0)),M.loopDelay=Math.round(r(e,"loopDelay",0)),M.paused=s(e,"paused",!1),M.useFrames=s(e,"useFrames",!1);for(var A=h(e,"callbackScope",M),C=[M,null],P=c.TYPES,R=0;R<P.length;R++){var L=P[R],O=h(e,L,!1);if(O){var D=h(e,L+"Scope",A),I=h(e,L+"Params",[]);M.setCallback(L,O,C.concat(I),D)}}return M}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(80),r=i(6),s=i(14);t.exports=function(t,e){void 0===e&&(e={});var i=r(e,"start",0),o=r(e,"ease",null),a=r(e,"grid",null),h=r(e,"from",0),l="first"===h,c="center"===h,u="last"===h,d="number"==typeof h,p=Array.isArray(t),f=p?parseFloat(t[0]):parseFloat(t),m=p?parseFloat(t[1]):0,g=Math.max(f,m);if(p&&(i+=f),a){var v=a[0],y=a[1],x=0,b=0,w=0,T=0,_=[];u?(x=v-1,b=y-1):d?(x=h%v,b=Math.floor(h/v)):c&&(x=(v-1)/2,b=(y-1)/2);for(var E=s.MIN_SAFE_INTEGER,S=0;S<y;S++){_[S]=[];for(var M=0;M<v;M++){w=x-M,T=b-S;var A=Math.sqrt(w*w+T*T);A>E&&(E=A),_[S][M]=A}}}var C=o?n(o):null;return a?function(t,e,n,r){var s,o=0,a=r%v,h=Math.floor(r/v);if(a>=0&&a<v&&h>=0&&h<y&&(o=_[h][a]),p){var l=m-f;s=C?o/E*l*C(o/E):o/E*l}else s=C?o*f*C(o/E):o*f;return s+i}:function(t,e,n,r,s){var o,a,v;return s--,l?o=r:c?o=Math.abs(s/2-r):u?o=s-r:d&&(o=Math.abs(h-r)),p?(v=c?(m-f)/s*(2*o):(m-f)/s*o,a=C?v*C(o/s):v):a=C?s*g*C(o/s):o*f,a+i}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(77),r=i(261),s=i(13),o=i(96),a=i(80),h=i(160),l=i(259),c=i(580),u=i(6),d=i(584),p=i(161);t.exports=function(t,e){var i=new d(t);i.completeDelay=s(e,"completeDelay",0),i.loop=Math.round(s(e,"loop",0)),i.loopDelay=Math.round(s(e,"loopDelay",0)),i.paused=o(e,"paused",!1),i.useFrames=o(e,"useFrames",!1);var f=u(e,"callbackScope",i),m=[i],g=u(e,"onStart",!1);if(g){var v=u(e,"onStartScope",f),y=u(e,"onStartParams",[]);i.setCallback("onStart",g,m.concat(y),v)}var x=u(e,"onUpdate",!1);if(x){var b=u(e,"onUpdateScope",f),w=u(e,"onUpdateParams",[]);i.setCallback("onUpdate",x,m.concat(w),b)}var T=u(e,"onLoop",!1);if(T){var _=u(e,"onLoopScope",f),E=u(e,"onLoopParams",[]);i.setCallback("onLoop",T,m.concat(E),_)}var S=u(e,"onYoyo",!1);if(S){var M=u(e,"onYoyoScope",f),A=u(e,"onYoyoParams",[]);i.setCallback("onYoyo",S,m.concat(null,A),M)}var C=u(e,"onComplete",!1);if(C){var P=u(e,"onCompleteScope",f),R=u(e,"onCompleteParams",[]);i.setCallback("onComplete",C,m.concat(R),P)}var L=c(e);if(0===L.length)return i.paused=!0,i;var O=n(r);O.targets=l(e);var D=s(e,"totalDuration",0);O.duration=D>0?Math.floor(D/L.length):h(e,"duration",O.duration),O.delay=h(e,"delay",O.delay),O.easeParams=u(e,"easeParams",O.easeParams),O.ease=a(u(e,"ease",O.ease),O.easeParams),O.hold=h(e,"hold",O.hold),O.repeat=h(e,"repeat",O.repeat),O.repeatDelay=h(e,"repeatDelay",O.repeatDelay),O.yoyo=o(e,"yoyo",O.yoyo),O.flipX=o(e,"flipX",O.flipX),O.flipY=o(e,"flipY",O.flipY);for(var I=0;I<L.length;I++)i.queue(p(i,L[I],O));return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(9),s=i(263),o=i(161),a=i(97),h=new n({Extends:r,initialize:function(t){r.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=a.PENDING_ADD,this._pausedState=a.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},dispatchTimelineEvent:function(t,e){this.emit(t,this),e&&e.func.apply(e.scope,e.params)},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===a.ACTIVE},add:function(t){return this.queue(o(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"==typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),r=e;switch(i){case"+":r+=n;break;case"-":r-=n}return Math.max(0,r)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n<this.totalData;n++){var r=this.data[n];r.init(),this.hasOffset(r)?this.isOffsetAbsolute(r.offset)?(r.calculatedOffset=r.offset,0===r.offset&&(i=0)):this.isOffsetRelative(r.offset)&&(r.calculatedOffset=this.getRelativeOffset(r.offset,t)):r.calculatedOffset=i,t=r.totalDuration+r.calculatedOffset,e+=r.totalDuration,i+=r.totalDuration}this.duration=e,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e<this.totalData;e++)this.data[e].play(t)},setCallback:function(t,e,i,n){return-1!==h.TYPES.indexOf(t)&&(this.callbacks[t]={func:e,scope:n,params:i}),this},makeActive:function(t){return this.manager.makeActive(t)},play:function(){if(this.state!==a.ACTIVE){if(this.paused)return this.paused=!1,void this.manager.makeActive(this);this.resetTweens(!1),this.state=a.ACTIVE,this.dispatchTimelineEvent(s.TIMELINE_START,this.callbacks.onStart)}},nextState:function(){this.loopCounter>0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):(this.state=a.ACTIVE,this.dispatchTimelineEvent(s.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=a.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(s.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,n=0;n<this.totalData;n++)this.data[n].update(t,e)&&i--;this.dispatchTimelineEvent(s.TIMELINE_UPDATE,this.callbacks.onUpdate),0===i&&this.nextState();break;case a.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=a.ACTIVE,this.dispatchTimelineEvent(s.TIMELINE_LOOP,this.callbacks.onLoop));break;case a.COMPLETE_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(s.TIMELINE_COMPLETE,this.callbacks.onComplete))}return this.state===a.PENDING_REMOVE}},stop:function(){this.state=a.PENDING_REMOVE},pause:function(){if(this.state!==a.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=a.PAUSED,this.emit(s.TIMELINE_PAUSE,this),this},resume:function(){return this.state===a.PAUSED&&(this.paused=!1,this.state=this._pausedState,this.emit(s.TIMELINE_RESUME,this)),this},hasTarget:function(t){for(var e=0;e<this.data.length;e++)if(this.data[e].hasTarget(t))return!0;return!1},destroy:function(){for(var t=0;t<this.data.length;t++)this.data[t].stop()}});h.TYPES=["onStart","onUpdate","onLoop","onComplete","onYoyo"],t.exports=h},function(t,e,i){var n={};t.exports=n;var r=i(116),s=i(50);n.fromVertices=function(t){for(var e={},i=0;i<t.length;i++){var n=(i+1)%t.length,o=r.normalise({x:t[n].y-t[i].y,y:t[i].x-t[n].x}),a=0===o.y?1/0:o.x/o.y;e[a=a.toFixed(3).toString()]=o}return s.values(e)},n.rotate=function(t,e){if(0!==e)for(var i=Math.cos(e),n=Math.sin(e),r=0;r<t.length;r++){var s,o=t[r];s=o.x*i-o.y*n,o.y=o.x*n+o.y*i,o.x=s}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={AFTER_ADD:i(1509),AFTER_REMOVE:i(1510),AFTER_UPDATE:i(1511),BEFORE_ADD:i(1512),BEFORE_REMOVE:i(1513),BEFORE_UPDATE:i(1514),COLLISION_ACTIVE:i(1515),COLLISION_END:i(1516),COLLISION_START:i(1517),DRAG_END:i(1518),DRAG:i(1519),DRAG_START:i(1520),PAUSE:i(1521),RESUME:i(1522),SLEEP_END:i(1523),SLEEP_START:i(1524)}},function(t,e,i){var n={};t.exports=n;var r=i(588),s=i(535),o=i(117);n.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l<t.length;l++){var c=t[l][0],u=t[l][1];if((!c.isStatic&&!c.isSleeping||!u.isStatic&&!u.isSleeping)&&n.canCollide(c.collisionFilter,u.collisionFilter)&&(h.midphaseTests+=1,o.overlaps(c.bounds,u.bounds)))for(var d=c.parts.length>1?1:0;d<c.parts.length;d++)for(var p=c.parts[d],f=u.parts.length>1?1:0;f<u.parts.length;f++){var m=u.parts[f];if(p===c&&m===u||o.overlaps(p.bounds,m.bounds)){var g,v=a[s.id(p,m)];g=v&&v.isActive?v.collision:null;var y=r.collides(p,m,g);h.narrowphaseTests+=1,y.reused&&(h.narrowReuseCount+=1),y.collided&&(i.push(y),h.narrowDetections+=1)}}}return i},n.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n={};t.exports=n;var r=i(94),s=i(116);n.collides=function(t,e,i){var o,a,h,l,c=!1;if(i){var u=t.parent,d=e.parent,p=u.speed*u.speed+u.angularSpeed*u.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;c=i&&i.collided&&p<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&c){var f=l.axisBody,m=f===t?e:t,g=[f.axes[i.axisNumber]];if(h=n._overlapAxes(f.vertices,m.vertices,g),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlap<a.overlap?(h=o,l.axisBody=t):(h=a,l.axisBody=e),l.axisNumber=h.axisNumber}l.bodyA=t.id<e.id?t:e,l.bodyB=t.id<e.id?e:t,l.collided=!0,l.depth=h.overlap,l.parentA=l.bodyA.parent,l.parentB=l.bodyB.parent,t=l.bodyA,e=l.bodyB,s.dot(h.axis,s.sub(e.position,t.position))<0?l.normal={x:h.axis.x,y:h.axis.y}:l.normal={x:-h.axis.x,y:-h.axis.y},l.tangent=s.perp(l.normal),l.penetration=l.penetration||{},l.penetration.x=l.normal.x*l.depth,l.penetration.y=l.normal.y*l.depth;var v=n._findSupports(t,e,l.normal),y=[];if(r.contains(t.vertices,v[0])&&y.push(v[0]),r.contains(t.vertices,v[1])&&y.push(v[1]),y.length<2){var x=n._findSupports(e,t,s.neg(l.normal));r.contains(e.vertices,x[0])&&y.push(x[0]),y.length<2&&r.contains(e.vertices,x[1])&&y.push(x[1])}return y.length<1&&(y=[v[0]]),l.supports=y,l},n._overlapAxes=function(t,e,i){for(var r,o,a=s._temp[0],h=s._temp[1],l={overlap:Number.MAX_VALUE},c=0;c<i.length;c++){if(o=i[c],n._projectToAxis(a,t,o),n._projectToAxis(h,e,o),(r=Math.min(a.max-h.min,h.max-a.min))<=0)return l.overlap=r,l;r<l.overlap&&(l.overlap=r,l.axis=o,l.axisNumber=c)}return l},n._projectToAxis=function(t,e,i){for(var n=s.dot(e[0],i),r=n,o=1;o<e.length;o+=1){var a=s.dot(e[o],i);a>r?r=a:a<n&&(n=a)}t.min=n,t.max=r},n._findSupports=function(t,e,i){for(var n,r,o,a,h=Number.MAX_VALUE,l=s._temp[0],c=e.vertices,u=t.position,d=0;d<c.length;d++)r=c[d],l.x=r.x-u.x,l.y=r.y-u.y,(n=-s.dot(i,l))<h&&(h=n,o=r);return r=c[o.index-1>=0?o.index-1:c.length-1],l.x=r.x-u.x,l.y=r.y-u.y,h=-s.dot(i,l),a=r,r=c[(o.index+1)%c.length],l.x=r.x-u.x,l.y=r.y-u.y,(n=-s.dot(i,l))<h&&(a=r),[o,a]}},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){i(591),i(592),i(593),i(594),i(595),i(596),i(597),i(598)},function(t,e){Array.prototype.forEach||(Array.prototype.forEach=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,r=0;r<i;r++)r in e&&t.call(n,e[r],r,e)})},function(t,e){Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)})},function(t,e){!function(){function t(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=webkitAudioContext,AudioContext.prototype.hasOwnProperty("createGain")||(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),AudioContext.prototype.hasOwnProperty("createDelay")||(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),AudioContext.prototype.hasOwnProperty("createScriptProcessor")||(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),AudioContext.prototype.hasOwnProperty("createPeriodicWave")||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var e=this.internal_createGain();return t(e.gain),e},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(e){var i=e?this.internal_createDelay(e):this.internal_createDelay();return t(i.delayTime),i},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var e=this.internal_createBufferSource();return e.start?(e.internal_start=e.start,e.start=function(t,i,n){void 0!==n?e.internal_start(t||0,i,n):e.internal_start(t||0,i||0)}):e.start=function(t,e,i){e||i?this.noteGrainOn(t||0,e,i):this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},t(e.playbackRate),e},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var e=this.internal_createDynamicsCompressor();return t(e.threshold),t(e.knee),t(e.ratio),t(e.reduction),t(e.attack),t(e.release),e},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var e=this.internal_createBiquadFilter();return t(e.frequency),t(e.detune),t(e.Q),t(e.gain),e},AudioContext.prototype.hasOwnProperty("createOscillator")&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var e=this.internal_createOscillator();return e.start?(e.internal_start=e.start,e.start=function(t){e.internal_start(t||0)}):e.start=function(t){this.noteOn(t||0)},e.stop?(e.internal_stop=e.stop,e.stop=function(t){e.internal_stop(t||0)}):e.stop=function(t){this.noteOff(t||0)},e.setPeriodicWave||(e.setPeriodicWave=e.setWaveTable),t(e.frequency),t(e.detune),e})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=webkitOfflineAudioContext)}()},function(t,e){window.console||(window.console={},window.console.log=window.console.assert=function(){},window.console.warn=window.console.assert=function(){})},function(t,e){Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)})},function(t,e){!function(){if("performance"in window==0&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==0){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-t}}}()},function(t,e){for(var i=Date.now(),n=["ms","moz","webkit","o"],r=0;r<n.length&&!window.requestAnimationFrame;r++)window.requestAnimationFrame=window[n[r]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[n[r]+"CancelAnimationFrame"]||window[n[r]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),n=16+i-e;return n<0&&(n=0),i=e,setTimeout((function(){i=Date.now(),t(performance.now())}),n)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})},function(t,e){if("function"!=typeof window.Uint32Array&&"object"!=typeof window.Uint32Array){var i=function(t){var e=new Array;window[t]=function(t){if("number"==typeof t){Array.call(this,t),this.length=t;for(var e=0;e<this.length;e++)this[e]=0}else for(Array.call(this,t.length),this.length=t.length,e=0;e<this.length;e++)this[e]=t[e]},window[t].prototype=e,window[t].constructor=window[t]};i("Float32Array"),i("Uint32Array"),i("Uint16Array"),i("Int16Array"),i("ArrayBuffer")}},function(t,e,i){
|
|
/**
|
|
* @author samme
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(270);t.exports=function(t,e,i,r){for(var s=t[0],o=1;o<t.length;o++){var a=t[o];n(a,s,e,i,r),s=a}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"angle",e,i,r,s)}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++){var r=t[n];e.call(i,r)}return t}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var r=t[n],s=!0;for(var o in e)r[o]!==e[o]&&(s=!1);if(s)return r}return null}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var r=t[n],s=!0;for(var o in e)r[o]!==e[o]&&(s=!1);if(s)return r}return null}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(283),r=i(122),s=i(2),o=i(1),a=new(i(127))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),o=e.hasOwnProperty("height"),h=s(e,"width",-1),l=s(e,"height",-1),c=s(e,"cellWidth",1),u=s(e,"cellHeight",c),d=s(e,"position",r.TOP_LEFT),p=s(e,"x",0),f=s(e,"y",0),m=0,g=0,v=h*c,y=l*u;a.setPosition(p,f),a.setSize(c,u);for(var x=0;x<t.length;x++)if(n(t[x],a,d),i&&-1===h)a.x+=c;else if(o&&-1===l)a.y+=u;else if(o&&!i){if(g+=u,a.y+=u,g===y&&(g=0,m+=c,a.y=f,a.x+=c,m===v))break}else if(m+=c,a.x+=c,m===v&&(m=0,g+=u,a.x=p,a.y+=u,g===y))break;return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10),r=i(302),s=i(3),o={prepareBoundsOutput:function(t,e){return void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getCenter:function(t){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,s,o,a,h,l;if(void 0===t&&(t=new n),this.parentContainer){var c=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),c.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),c.transformPoint(t.x,t.y,t),r=t.x,s=t.y,this.getBottomLeft(t),c.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),c.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,s=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,o,h),t.y=Math.min(i,s,a,l),t.width=Math.max(e,r,o,h)-t.x,t.height=Math.max(i,s,a,l)-t.y,t}};t.exports=o},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="blur"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="boot"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="contextlost"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="contextrestored"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="destroy"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="focus"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="hidden"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pause"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="postrender"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="poststep"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="prerender"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="prestep"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="ready"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resume"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="step"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="visible"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="postrender"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="prerender"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="render"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resize"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=i},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(35),r=i(96),s=i(6),o=i(97),a=i(3),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:o.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=s(t,"from",0),t.to=s(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=s(t,"rotationOffset",0);var l=s(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.target[e.key]=e.current}),this.pathOffset||(this.pathOffset=new a(this.x,this.y)),this.pathVector||(this.pathVector=new a),this.pathDelta||(this.pathDelta=new a),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=o.PLAYING_FORWARD,this.rotateToPath){var c=this.path.getPoint(.1);this.rotation=Math.atan2(c.y-this.y,c.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===o.COMPLETE)return this.path.getPoint(1,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==o.PLAYING_FORWARD&&e.state!==o.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var s=this.x,a=this.y;this.setPosition(r.x,r.y);var h=this.x-s,l=this.y-a;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+n(this.pathRotationOffset))}}};t.exports=h},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=i},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,n=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=n,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this.tintFill||16777215!==this.tintTopLeft||16777215!==this.tintTopRight||16777215!==this.tintBottomLeft||16777215!==this.tintBottomRight}}};t.exports=i},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="changedata"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="changedata-"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="destroy"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="removedata"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="setdata"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="addedtoscene"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="destroy"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="removedfromscene"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="complete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="created"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="error"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="loop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="play"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="seeked"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="seeking"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="stop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="timeout"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="unlocked"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"alpha",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"x",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(44);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"x",e,r,o,a),n(t,"y",i,s,o,a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"y",e,i,r,s)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var r=i,s=(n-i)/t.length,o=0;o<t.length;o++)t[o].x=e.x+e.radius*Math.cos(r),t[o].y=e.y+e.radius*Math.sin(r),r+=s;return t}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var r=i,s=(n-i)/t.length,o=e.width/2,a=e.height/2,h=0;h<t.length;h++)t[h].x=e.x+o*Math.cos(r),t[h].y=e.y+a*Math.sin(r),r+=s;return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(168);t.exports=function(t,e){for(var i=n(e,t.length),r=0;r<t.length;r++){var s=t[r],o=i[r];s.x=o.x,s.y=o.y}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(310),r=i(175),s=i(176);t.exports=function(t,e,i){void 0===i&&(i=0);var o=n(e,!1,t.length);i>0?r(o,i):i<0&&s(o,Math.abs(i));for(var a=0;a<t.length;a++)t[a].x=o[a].x,t[a].y=o[a].y;return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(311);t.exports=function(t,e,i){var r=n({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),s=n({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),o=n({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);r.pop(),s.pop(),o.pop();for(var a=(r=r.concat(s,o)).length/t.length,h=0,l=0;l<t.length;l++){var c=t[l],u=r[Math.floor(h)];c.x=u.x,c.y=u.y,h+=a}return t}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++)t[n].anims.play(e,i);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(166);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(177);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(169);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(170);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(178);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"rotation",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(179),r=i(48);t.exports=function(t,e,i){for(var s=e.x,o=e.y,a=0;a<t.length;a++){var h=t[a];n(h,s,o,i,Math.max(1,r(h.x,h.y,s,o)))}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(179);t.exports=function(t,e,i,r){var s=e.x,o=e.y;if(0===r)return t;for(var a=0;a<t.length;a++)n(t[a],s,o,i,r);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"scaleX",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(44);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"scaleX",e,r,o,a),n(t,"scaleY",i,s,o,a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"scaleY",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"alpha",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r){return n(t,"blendMode",e,0,i,r)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"depth",e,i,r,s)}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++)t[n].setInteractive(e,i);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"originX",e,r,o,a),n(t,"originY",i,s,o,a),t.forEach((function(t){t.updateDisplayOrigin()})),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"rotation",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"scaleX",e,r,o,a),n(t,"scaleY",i,s,o,a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scaleX",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scaleY",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"scrollFactorX",e,r,o,a),n(t,"scrollFactorY",i,s,o,a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scrollFactorX",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scrollFactorY",e,i,r,s)}},function(t,e){t.exports=function(t,e,i,n,r){for(var s=0;s<t.length;s++)t[s].setTint(e,i,n,r);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r){return n(t,"visible",e,0,i,r)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"x",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"x",e,r,o,a),n(t,"y",i,s,o,a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"y",e,i,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);t.exports=function(t,e,i,r,s){var o,a,h,l,c,u;if(void 0===r&&(r=0),void 0===s&&(s=new n),t.length>1)if(0===r){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(u=t[h]).x,c=u.y,u.x=o,u.y=a,o=l,a=c;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h<t.length;h++)l=(u=t[h]).x,c=u.y,u.x=o,u.y=a,o=l,a=c;t[0].x=e,t[0].y=i}else o=t[0].x,a=t[0].y,t[0].x=e,t[0].y=i;return s.x=o,s.y=a,s}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(129);t.exports=function(t){return n(t)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(180);t.exports=function(t,e,i,r,s){void 0===s&&(s=!1);var o,a=Math.abs(r-i)/t.length;if(s)for(o=0;o<t.length;o++)t[o][e]+=n(o*a,i,r);else for(o=0;o<t.length;o++)t[o][e]=n(o*a,i,r);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(181);t.exports=function(t,e,i,r,s){void 0===s&&(s=!1);var o,a=Math.abs(r-i)/t.length;if(s)for(o=0;o<t.length;o++)t[o][e]+=n(o*a,i,r);else for(o=0;o<t.length;o++)t[o][e]=n(o*a,i,r);return t}},function(t,e){t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var s,o=Math.abs(n-i)/t.length;if(r)for(s=0;s<t.length;s++)t[s][e]+=s*o+i;else for(s=0;s<t.length;s++)t[s][e]=s*o+i;return t}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].visible=!t[e].visible;return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author samme <samme.npm@gmail.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(66);t.exports=function(t,e,i){void 0===i&&(i=0);for(var r=0;r<t.length;r++){var s=t[r];s.x=n(s.x,e.left-i,e.right+i),s.y=n(s.y,e.top-i,e.bottom+i)}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Animation:i(182),AnimationFrame:i(313),AnimationManager:i(315),AnimationState:i(162),Events:i(130)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="add"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="animationcomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="animationcomplete-"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="animationrepeat"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="animationrestart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="animationstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="animationstop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="animationupdate"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pauseall"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="remove"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resumeall"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={BaseCache:i(317),CacheManager:i(319),Events:i(318)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="add"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="remove"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Controls:i(715),Scene2D:i(718)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={FixedKeyControl:i(716),SmoothedKeyControl:i(717)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(6),s=new n({initialize:function(t){this.camera=r(t,"camera",null),this.left=r(t,"left",null),this.right=r(t,"right",null),this.up=r(t,"up",null),this.down=r(t,"down",null),this.zoomIn=r(t,"zoomIn",null),this.zoomOut=r(t,"zoomOut",null),this.zoomSpeed=r(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=r(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=r(t,"speed.x",0),this.speedY=r(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(6),s=new n({initialize:function(t){this.camera=r(t,"camera",null),this.left=r(t,"left",null),this.right=r(t,"right",null),this.up=r(t,"up",null),this.down=r(t,"down",null),this.zoomIn=r(t,"zoomIn",null),this.zoomOut=r(t,"zoomOut",null),this.zoomSpeed=r(t,"zoomSpeed",.01),this.accelX=0,this.accelY=0;var e=r(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=r(t,"acceleration.x",0),this.accelY=r(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=r(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=r(t,"drag.x",0),this.dragY=r(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var n=r(t,"maxSpeed",null);"number"==typeof n?(this.maxSpeedX=n,this.maxSpeedY=n):(this.maxSpeedX=r(t,"maxSpeed.x",0),this.maxSpeedY=r(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Camera:i(320),BaseCamera:i(131),CameraManager:i(775),Effects:i(327),Events:i(36)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="cameradestroy"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerafadeincomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerafadeinstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerafadeoutcomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerafadeoutstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="cameraflashcomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="cameraflashstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="followupdate"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerapancomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerapanstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="postrender"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="prerender"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerarotatecomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerarotatestart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerashakecomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerashakestart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerazoomcomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="camerazoomstart"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(36),o=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=r,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?s.FADE_OUT_START:s.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,n,r),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=this.direction?this.progress:1-this.progress:(this.alpha=this.direction?1:0,this.effectComplete()))},postRenderCanvas:function(t){if(!this.isRunning&&!this.isComplete)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(t,e){if(!this.isRunning&&!this.isComplete)return!1;var i=this.camera,n=this.red/255,r=this.green/255,s=this.blue/255;return t.drawFillRect(i.x,i.y,i.width,i.height,e(s,r,n,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var t=this.direction?s.FADE_OUT_COMPLETE:s.FADE_IN_COMPLETE;this.camera.emit(t,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(36),o=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r,o,a){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===n&&(n=255),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!r&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=n,this.alpha=1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a,this.camera.emit(s.FLASH_START,this.camera,this,t,e,i,n)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration?this.alpha=1-this.progress:this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(t,e){if(!this.isRunning)return!1;var i=this.camera,n=this.red/255,r=this.green/255,s=this.blue/255;return t.drawFillRect(i.x,i.y,i.width,i.height,e(s,r,n,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(s.FLASH_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(132),o=i(36),a=i(3),h=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new a,this.current=new a,this.destination=new a,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r,a,h){void 0===i&&(i=1e3),void 0===n&&(n=s.Linear),void 0===r&&(r=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!r&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof n&&s.hasOwnProperty(n)?this.ease=s[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.camera.emit(o.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsed<this.duration){var s=this.ease(i);r.getScroll(this.destination.x,this.destination.y,this.current);var o=this.source.x+(this.current.x-this.source.x)*s,a=this.source.y+(this.current.y-this.source.y)*s;r.setScroll(o,a),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,o,a)}else r.centerOn(this.destination.x,this.destination.y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,r.scrollX,r.scrollY),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(o.PAN_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=h},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(36),o=i(3),a=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===r&&(r=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=r,this.camera.emit(s.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed<this.duration){var i=this.intensity,r=this.camera.width,s=this.camera.height,o=this.camera.zoom;this._offsetX=(Math.random()*i.x*r*2-i.x*r)*o,this._offsetY=(Math.random()*i.y*s*2-i.y*s)*o,this.camera.roundPixels&&(this._offsetX=Math.round(this._offsetX),this._offsetY=Math.round(this._offsetY))}else this.effectComplete()},effectComplete:function(){this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(s.SHAKE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.intensity=null}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Jason Nicholls <nicholls.jason@gmail.com>
|
|
* @copyright 2018 Photon Storm Ltd.
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(36),o=i(132),a=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,n,r,a,h){void 0===i&&(i=1e3),void 0===n&&(n=o.Linear),void 0===r&&(r=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var c=360*Math.PI/180;l-=Math.floor(l/c)*c;var u=this.camera;if(!r&&this.isRunning)return u;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=u.rotation,this.destination=l,"string"==typeof n&&o.hasOwnProperty(n)?this.ease=o[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.shortestPath){var d=0,p=0;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+c)-this.source)<(p=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+c)-this.destination)?this.clockwise=!0:d>p&&(this.clockwise=!1)}return this.camera.emit(s.ROTATE_START,this.camera,this,i,l),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsed<this.duration){var s=this.ease(i);this.current=r.rotation;var o=0,a=360*Math.PI/180,h=this.destination,l=this.current;!1===this.clockwise&&(h=this.current,l=this.destination),o=h>=l?Math.abs(h-l):Math.abs(h+a)-l;var c=0;c=this.clockwise?r.rotation+o*s:r.rotation-o*s,r.rotation=c,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,c)}else r.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(s.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(132),o=i(36),a=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r,a){void 0===e&&(e=1e3),void 0===i&&(i=s.Linear),void 0===n&&(n=!1),void 0===r&&(r=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&s.hasOwnProperty(i)?this.ease=s[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=a,this.camera.emit(o.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._elapsed<this.duration?(this.camera.zoom=this.source+(this.destination-this.source)*this.ease(this.progress),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.camera.zoom)):(this.camera.zoom=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.destination),this.effectComplete()))},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(o.ZOOM_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(320),r=i(0),s=i(2),o=i(24),a=i(56),h=i(101),l=i(21),c=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new n(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,r,s,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===s&&(s=!1),void 0===o&&(o="");var a=new n(t,e,i,r);return a.setName(o),a.setScene(this.scene),a.setRoundPixels(this.roundPixels),a.id=this.getNextID(),this.cameras.push(a),s&&(this.main=a),a},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var n=!1,r=0;r<t.length;r++){var s=t[r];s&&s.id===e&&(n=!0)}if(!n)return e;e<<=1}return 0},getTotal:function(t){void 0===t&&(t=!1);for(var e=0,i=this.cameras,n=0;n<i.length;n++){var r=i[n];(!t||t&&r.visible)&&e++}return e},fromJSON:function(t){Array.isArray(t)||(t=[t]);for(var e=this.scene.sys.scale.width,i=this.scene.sys.scale.height,n=0;n<t.length;n++){var r=t[n],o=s(r,"x",0),a=s(r,"y",0),h=s(r,"width",e),l=s(r,"height",i),c=this.add(o,a,h,l);c.name=s(r,"name",""),c.zoom=s(r,"zoom",1),c.rotation=s(r,"rotation",0),c.scrollX=s(r,"scrollX",0),c.scrollY=s(r,"scrollY",0),c.roundPixels=s(r,"roundPixels",!1),c.visible=s(r,"visible",!0);var u=s(r,"backgroundColor",!1);u&&c.setBackgroundColor(u);var d=s(r,"bounds",null);if(d){var p=s(d,"x",0),f=s(d,"y",0),m=s(d,"width",e),g=s(d,"height",i);c.setBounds(p,f,m,g)}}return this},getCamera:function(t){for(var e=this.cameras,i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},getCamerasBelowPointer:function(t){for(var e=this.cameras,i=t.x,n=t.y,r=[],s=0;s<e.length;s++){var o=e[s];o.visible&&o.inputEnabled&&a(o,i,n)&&r.unshift(o)}return r},remove:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0,n=this.cameras,r=0;r<t.length;r++){var s=n.indexOf(t[r]);-1!==s&&(e?n[s].destroy():n[s].renderList=[],n.splice(s,1),i++)}return!this.main&&n[0]&&(this.main=n[0]),i},render:function(t,e){for(var i=this.scene,n=this.cameras,r=0;r<this.cameras.length;r++){var s=n[r];if(s.visible&&s.alpha>0){s.preRender();var o=this.getVisibleChildren(e.getChildren(),s);t.render(i,o,s)}}},getVisibleChildren:function(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n];r.willRender(e)&&i.push(r)}return i},resetAll:function(){for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();return this.cameras=[],this.main=this.add(),this.main},update:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].update(t,e)},onResize:function(t,e,i,n,r){for(var s=0;s<this.cameras.length;s++){var o=this.cameras[s];0===o._x&&0===o._y&&o._width===n&&o._height===r&&o.setSize(e.width,e.height)}},resize:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].setSize(t,e)},shutdown:function(){this.main=void 0;for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();this.cameras=[];var e=this.systems.events;e.off(l.UPDATE,this.update,this),e.off(l.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.default.destroy(),this.scene.sys.events.off(l.START,this.start,this),this.scene=null,this.systems=null}});o.register("CameraManager",c,"cameras"),t.exports=c},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="enterfullscreen"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="fullscreenfailed"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="fullscreenunsupported"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="leavefullscreen"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="orientationchange"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resize"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="addedtoscene"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="boot"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="create"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="destroy"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pause"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="postupdate"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="preupdate"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="ready"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="removedfromscene"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="render"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resume"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="shutdown"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="sleep"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="start"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="transitioncomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="transitioninit"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="transitionout"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="transitionstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="transitionwake"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="update"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="wake"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Config:i(340),CreateRenderer:i(360),DebugHeader:i(378),Events:i(22),TimeStep:i(379),VisibilityHandler:i(381)}},function(t,e){var i,n,r=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],c=!1,u=-1;function d(){c&&h&&(c=!1,h.length?l=h.concat(l):u=-1,l.length&&p())}function p(){if(!c){var t=a(d);c=!0;for(var e=l.length;e;){for(h=l,l=[];++u<e;)h&&h[u].run();u=-1,e=l.length}h=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new f(t,e)),1!==l.length||c||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(134),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll"),r)},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(134),r={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(r.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(r.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(r.mp3=!0),t.canPlayType("audio/wav").replace(/^no$/,"")&&(r.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(r.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(r.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(n.edge)r.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),s=parseInt(RegExp.$2,10);(10===i&&s>=11||i>10)&&(r.dolby=!0)}}catch(t){}return r}()},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={h264:!1,hls:!1,mp4:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264=!0,i.mp4=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hls=!0))}catch(t){}return i}()},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){var t,e="Fullscreen",n="FullScreen",r=["request"+e,"request"+n,"webkitRequest"+e,"webkitRequest"+n,"msRequest"+e,"msRequest"+n,"mozRequest"+n,"mozRequest"+e];for(t=0;t<r.length;t++)if(document.documentElement[r[t]]){i.available=!0,i.request=r[t];break}var s=["cancel"+n,"exit"+e,"webkitCancel"+n,"webkitExit"+e,"msCancel"+n,"msExit"+e,"mozCancel"+n,"mozExit"+e];if(i.available)for(t=0;t<s.length;t++)if(document[s[t]]){i.cancel=s[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(i.keyboard=!0),Object.defineProperty(i,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),i}()},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Between:i(343),BetweenPoints:i(344),BetweenPointsY:i(810),BetweenY:i(811),CounterClockwise:i(812),Normalize:i(345),Random:i(813),RandomDegrees:i(814),Reverse:i(815),RotateTo:i(816),ShortestBetween:i(817),Wrap:i(265),WrapDegrees:i(266)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author @samme
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(135);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author @samme
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(135);t.exports=function(){return n(-180,180)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(345);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=n.PI2:e-=n.PI2),e>t?t+=i:e<t&&(t-=i))),t}},function(t,e){t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Between:i(48),BetweenPoints:i(346),BetweenPointsSquared:i(819),Chebyshev:i(820),Power:i(821),Snake:i(822),Squared:i(347)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(t,e){t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},function(t,e){t.exports=function(t,e,i,n,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(n-e,r))}},function(t,e){t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Back:i(328),Bounce:i(329),Circular:i(330),Cubic:i(331),Elastic:i(332),Expo:i(333),Linear:i(334),Quadratic:i(335),Quartic:i(336),Quintic:i(337),Sine:i(338),Stepped:i(339)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Ceil:i(825),Equal:i(123),Floor:i(826),GreaterThan:i(348),LessThan:i(349)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Bezier:i(828),CatmullRom:i(829),CubicBezier:i(352),Linear:i(830),QuadraticBezier:i(353),SmoothStep:i(354),SmootherStep:i(831)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(350);t.exports=function(t,e){for(var i=0,r=t.length-1,s=0;s<=r;s++)i+=Math.pow(1-e,r-s)*Math.pow(e,s)*t[s]*n(r,s);return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(191);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return t[0]===t[i]?(e<0&&(s=Math.floor(r=i*(1+e))),n(r-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(n(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(r-s,t[s?s-1:0],t[s],t[i<s+1?i:s+1],t[i<s+2?i:s+2])}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(133);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return e<0?n(t[0],t[1],r):e>1?n(t[i],t[i-1],i-r):n(t[s],t[s+1>i?i:s+1],r-s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(180);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={GetNext:i(355),IsSize:i(136),IsValue:i(833)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Ceil:i(137),Floor:i(76),To:i(835)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n<t.length;n++)e=.02519603282416938*(i+=t.charCodeAt(n)),e-=i=e>>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+11102230246251565e-32*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},function(t,e){t.exports=function(t){for(var e=0,i=0;i<t.length;i++)e+=+t[i];return e/t.length}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.ceil(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(67),o=i(1),a=new s,h=new r({initialize:function t(e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=n,this._order=r,this.onChangeCallback=o},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,n){return void 0===n&&(n=this._order),this._x=t,this._y=e,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),a.fromQuat(t),this.setFromRotationMatrix(a,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,s=r[0],o=r[4],a=r[8],h=r[1],l=r[5],c=r[9],u=r[2],d=r[6],p=r[10],f=0,m=0,g=0;switch(e){case"XYZ":m=Math.asin(n(a,-1,1)),Math.abs(a)<.99999?(f=Math.atan2(-c,p),g=Math.atan2(-o,s)):f=Math.atan2(d,l);break;case"YXZ":f=Math.asin(-n(c,-1,1)),Math.abs(c)<.99999?(m=Math.atan2(a,p),g=Math.atan2(h,l)):m=Math.atan2(-u,s);break;case"ZXY":f=Math.asin(n(d,-1,1)),Math.abs(d)<.99999?(m=Math.atan2(-u,p),g=Math.atan2(-o,l)):g=Math.atan2(h,s);break;case"ZYX":m=Math.asin(-n(u,-1,1)),Math.abs(u)<.99999?(f=Math.atan2(d,p),g=Math.atan2(h,s)):g=Math.atan2(-o,l);break;case"YZX":g=Math.asin(n(h,-1,1)),Math.abs(h)<.99999?(f=Math.atan2(-c,l),m=Math.atan2(-u,s)):m=Math.atan2(a,p);break;case"XZY":g=Math.asin(-n(o,-1,1)),Math.abs(o)<.99999?(f=Math.atan2(d,l),m=Math.atan2(a,s)):f=Math.atan2(-c,p)}return this._x=f,this._y=m,this._z=g,this._order=e,i&&this.onChangeCallback(this),this}});h.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],h.DefaultOrder="XYZ",t.exports=h},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==n?(r=(n-t)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,r=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=n*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e,i,n,r){return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var r=[],s=[],o=0;o<t;o++)e+=(i-=e*n)*n,r[o]=i,s[o]=e;return{sin:s,cos:r,length:t}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);t.exports=function(t,e,i,r){void 0===r&&(r=new n);var s=0,o=0;return t>0&&t<=e*i&&(s=t>e-1?t-(o=Math.floor(t/e))*e:t,r.set(s,o)),r}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(38),r=i(67),s=i(359),o=new r,a=new s,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="addtexture"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="onerror"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="onload"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="ready"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="removetexture"},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pipelineafterflush"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pipelinebeforeflush"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pipelinebind"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pipelineboot"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pipelinedestroy"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pipelinerebind"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pipelineresize"},function(t,e){t.exports=["#define SHADER_NAME PHASER_GRAPHICS_FS","","precision mediump float;","","varying vec4 outColor;","","void main ()","{"," gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_GRAPHICS_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec4 inColor;","","varying vec4 outColor;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outColor = inColor;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",""," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_MULTI_FS","","precision mediump float;","","uniform sampler2D uMainSampler[%count%];","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture;",""," %forloop%",""," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_MULTI_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform float uCameraZoom;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",""," float distToSurf = length(center - gl_FragCoord.xy);",""," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",""," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",""," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",""," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",""," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = frame1 + frame2 * uStrength;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);",""," if (uAlpha == 0.0)"," {"," gl_FragColor = c;",""," return;"," }",""," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={GenerateTexture:i(382),Palettes:i(885)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ARNE16:i(383),C64:i(886),CGA:i(887),JMP:i(888),MSX:i(889)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Path:i(891),MoveTo:i(387),CubicBezier:i(384),Curve:i(90),Ellipse:i(385),Line:i(386),QuadraticBezier:i(388),Spline:i(389)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(384),s=i(385),o=i(5),a=i(386),h=i(387),l=i(388),c=i(10),u=i(389),d=i(3),p=i(14),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,s,o){var a,h,l,c=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(s,o),l=new d(t,e)),this.add(new r(c,a,h,l))},quadraticBezierTo:function(t,e,i,n){var r,s,o=this.getEndPoint();return t instanceof d?(r=t,s=e):(r=new d(i,n),s=new d(t,e)),this.add(new l(o,r,s))},draw:function(t,e){for(var i=0;i<this.curves.length;i++){var n=this.curves[i];n.active&&n.draw(t,e)}return t},ellipseTo:function(t,e,i,n,r,o){var a=new s(0,0,t,e,i,n,r,o),h=this.getEndPoint(this._tmpVec2A),l=a.getStartPoint(this._tmpVec2B);return h.subtract(l),a.x=h.x,a.y=h.y,this.add(a)},fromJSON:function(t){this.curves=[],this.cacheLengths=[],this.startPoint.set(t.x,t.y),this.autoClose=t.autoClose;for(var e=0;e<t.curves.length;e++){var i=t.curves[e];switch(i.type){case"LineCurve":this.add(a.fromJSON(i));break;case"EllipseCurve":this.add(s.fromJSON(i));break;case"SplineCurve":this.add(u.fromJSON(i));break;case"CubicBezierCurve":this.add(r.fromJSON(i));break;case"QuadraticBezierCurve":this.add(l.fromJSON(i))}}return this},getBounds:function(t,e){void 0===t&&(t=new c),void 0===e&&(e=16),t.x=Number.MAX_VALUE,t.y=Number.MAX_VALUE;for(var i=new c,n=p.MIN_SAFE_INTEGER,r=p.MIN_SAFE_INTEGER,s=0;s<this.curves.length;s++){var o=this.curves[s];o.active&&(o.getBounds(i,e),t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),n=Math.max(n,i.right),r=Math.max(r,i.bottom))}return t.right=n,t.bottom=r,t},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0;i<this.curves.length;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getEndPoint:function(t){return void 0===t&&(t=new d),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=i){var s=n[r]-i,o=this.curves[r],a=o.getLength(),h=0===a?0:1-s/a;return o.getPointAt(h,e)}r++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n<this.curves.length;n++){var r=this.curves[n];if(r.active)for(var s=r.getResolution(t),o=r.getPoints(s),a=0;a<o.length;a++){var h=o[a];e&&e.equals(h)||(i.push(h),e=h)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=i){var s=n[r]-i,o=this.curves[r],a=o.getLength(),h=0===a?0:1-s/a;return o.getTangentAt(h,e)}r++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new u(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e<this.curves.length;e++)t.push(this.curves[e].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:t}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});o.register("path",(function(t,e){return new f(t,e)})),t.exports=f},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={DataManager:i(98),DataManagerPlugin:i(893),Events:i(309)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(98),s=i(24),o=i(21),a=new n({Extends:r,initialize:function(t){r.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){r.prototype.destroy.call(this),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});s.register("DataManagerPlugin",a,"data"),t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Align:i(895),BaseShader:i(390),Bounds:i(898),Canvas:i(902),Color:i(391),ColorMatrix:i(195),Masks:i(912),RGB:i(197)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(122),r=i(17),s={In:i(896),To:i(897)};s=r(!1,s,n),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={BottomCenter:i(284),BottomLeft:i(285),BottomRight:i(286),Center:i(287),LeftCenter:i(289),QuickSet:i(283),RightCenter:i(290),TopCenter:i(291),TopLeft:i(292),TopRight:i(293)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={BottomCenter:i(271),BottomLeft:i(272),BottomRight:i(273),LeftBottom:i(274),LeftCenter:i(275),LeftTop:i(276),QuickSet:i(270),RightBottom:i(277),RightCenter:i(278),RightTop:i(279),TopCenter:i(280),TopLeft:i(281),TopRight:i(282)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={CenterOn:i(288),GetBottom:i(40),GetBounds:i(899),GetCenterX:i(84),GetCenterY:i(86),GetLeft:i(41),GetOffsetX:i(900),GetOffsetY:i(901),GetRight:i(42),GetTop:i(43),SetBottom:i(54),SetCenterX:i(85),SetCenterY:i(87),SetLeft:i(52),SetRight:i(53),SetTop:i(51)}},function(t,e,i){
|
|
/**
|
|
* @author samme
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(40),r=i(41),s=i(42),o=i(43);t.exports=function(t,e){void 0===e&&(e={});var i=r(t),a=o(t);return e.x=i,e.y=a,e.width=s(t)-i,e.height=n(t)-a,e}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={CanvasInterpolation:i(361),CanvasPool:i(31),Smoothing:i(189),TouchAction:i(903),UserSelect:i(904)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(100);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],r=255,s=0,o=0;for(e=0;e<=255;e++)i.push({r:r,g:e,b:o,color:n(r,e,o)});for(s=255,e=255;e>=0;e--)i.push({r:e,g:s,b:o,color:n(e,s,o)});for(r=0,e=0;e<=255;e++,s--)i.push({r:r,g:s,b:e,color:n(r,s,e)});for(s=0,o=255,e=0;e<=255;e++,o--,r++)i.push({r:r,g:s,b:o,color:n(r,s,o)});if(1024===t)return i;var a=[],h=0,l=1024/t;for(e=0;e<t;e++)a.push(i[Math.floor(h)]),h+=l;return a}},function(t,e){t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(37),r=i(393);t.exports=function(t,e,i){var s=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;s=r(l,h,t+1/3),o=r(l,h,t),a=r(l,h,t-1/3)}return(new n).setGLTo(s,o,a,1)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(185);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],r=0;r<=359;r++)i.push(n(r/359,t,e));return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(133),r=function(t,e,i,r,s,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,r,l),g:n(e,s,l),b:n(i,o,l)}};t.exports={RGBWithRGB:r,ColorWithRGB:function(t,e,i,n,s,o){return void 0===s&&(s=100),void 0===o&&(o=0),r(t.r,t.g,t.b,e,i,n,s,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),r(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(192),r=i(37);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new r(n(t,e),n(t,e),n(t,e))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(392);t.exports=function(t,e,i,r,s){return void 0===r&&(r=255),void 0===s&&(s="#"),"#"===s?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(r)+n(t)+n(e)+n(i)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={BitmapMask:i(304),GeometryMask:i(305)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n={AddToDOM:i(140),DOMContentLoaded:i(394),GetInnerHeight:i(395),GetScreenOrientation:i(396),GetTarget:i(401),ParseXML:i(402),RemoveFromDOM:i(199),RequestAnimationFrame:i(380)};t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={EventEmitter:i(915)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(9),s=i(24),o=new n({Extends:r,initialize:function(){r.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});s.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(140),r=i(315),s=i(319),o=i(31),a=i(0),h=i(340),l=i(917),c=i(360),u=i(98),d=i(378),p=i(341),f=i(394),m=i(9),g=i(22),v=i(403),y=i(24),x=i(408),b=i(409),w=i(411),T=i(103),_=i(416),E=i(379),S=i(381),M=i(420),A=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new m,this.anims=new r(this),this.textures=new _(this),this.cache=new s(this),this.registry=new u(this),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=p,this.scale=new b(this,this.config),this.sound=null,this.sound=M.create(this),this.loop=new E(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,f(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),c(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(T.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),S(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(g.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(g.POST_RENDER,n,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),i.emit(g.PRE_RENDER),i.emit(g.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=A},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(140);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="boot"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="destroy"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragend"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragenter"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="drag"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragleave"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragover"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="drop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="gameout"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="gameover"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="gameobjectdown"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragend"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragenter"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="drag"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragleave"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragover"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="drop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="gameobjectmove"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="gameobjectout"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="gameobjectover"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerdown"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointermove"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerout"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerover"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerup"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="wheel"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="gameobjectup"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="gameobjectwheel"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="boot"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="process"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="update"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerdown"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerdownoutside"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointermove"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerout"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerover"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerup"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerupoutside"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="wheel"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pointerlockchange"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="preupdate"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="shutdown"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="start"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="update"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="addfile"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="complete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="filecomplete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="filecomplete-"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="loaderror"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="load"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="fileprogress"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="postprocess"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="progress"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="start"},function(t,e,i){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,s=i.getElementsByTagName("SubTexture"),o=0;o<s.length;o++){var a=s[o].attributes,h=a.name.value,l=parseInt(a.x.value,10),c=parseInt(a.y.value,10),u=parseInt(a.width.value,10),d=parseInt(a.height.value,10);if(r=t.add(h,e,l,c,u,d),a.frameX){var p=Math.abs(parseInt(a.frameX.value,10)),f=Math.abs(parseInt(a.frameY.value,10)),m=parseInt(a.frameWidth.value,10),g=parseInt(a.frameHeight.value,10);r.setTrim(u,d,p,f,m,g)}}return t}console.warn("Invalid Texture Atlas XML given")}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(77);t.exports=function(t,e,i){if(i.frames||i.textures){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height);for(var s,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a<o.length;a++){var h=o[a];s=t.add(h.filename,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&s.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(s.rotated=!0,s.updateUVsInverted());var l=h.anchor||h.pivot;l&&(s.customPivot=!0,s.pivotX=l.x,s.pivotY=l.y),s.customData=n(h)}for(var c in i)"frames"!==c&&(Array.isArray(i[c])?t.customData[c]=i[c].slice(0):t.customData[c]=i[c]);return t}console.warn("Invalid Texture Atlas JSON Array")}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(77);t.exports=function(t,e,i){if(i.frames){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height);var s,o=i.frames;for(var a in o)if(o.hasOwnProperty(a)){var h=o[a];s=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&s.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(s.rotated=!0,s.updateUVsInverted());var l=h.anchor||h.pivot;l&&(s.customPivot=!0,s.pivotX=l.x,s.pivotY=l.y),s.customData=n(h)}for(var c in i)"frames"!==c&&(Array.isArray(i[c])?t.customData[c]=i[c].slice(0):t.customData[c]=i[c]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(2);t.exports=function(t,e,i,r,s,o,a){var h=n(a,"frameWidth",null),l=n(a,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var c=t.source[e];t.add("__BASE",e,0,0,c.width,c.height);var u=n(a,"startFrame",0),d=n(a,"endFrame",-1),p=n(a,"margin",0),f=n(a,"spacing",0),m=Math.floor((s-p+f)/(h+f))*Math.floor((o-p+f)/(l+f));0===m&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(u>m||u<-m)&&(u=0),u<0&&(u=m+u),-1!==d&&(m=u+(d+1));for(var g=p,v=p,y=0,x=0,b=0;b<m;b++){y=0,x=0;var w=g+h,T=v+l;w>s&&(y=w-s),T>o&&(x=T-o),t.add(b,e,i+g,r+v,h-y,l-x),(g+=h+f)+h>s&&(g=p,v+=l+f)}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(2);t.exports=function(t,e,i){var r=n(i,"frameWidth",null),s=n(i,"frameHeight",r);if(!r)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=n(i,"startFrame",0),l=n(i,"endFrame",-1),c=n(i,"margin",0),u=n(i,"spacing",0),d=e.cutX,p=e.cutY,f=e.cutWidth,m=e.cutHeight,g=e.realWidth,v=e.realHeight,y=Math.floor((g-c+u)/(r+u)),x=Math.floor((v-c+u)/(s+u)),b=y*x,w=e.x,T=r-w,_=r-(g-f-w),E=e.y,S=s-E,M=s-(v-m-E);(h>b||h<-b)&&(h=0),h<0&&(h=b+h),-1!==l&&(b=h+(l+1));for(var A=c,C=c,P=0,R=e.sourceIndex,L=0;L<x;L++){for(var O=0===L,D=L===x-1,I=0;I<y;I++){var F=0===I,B=I===y-1;if(a=t.add(P,R,d+A,p+C,r,s),F||O||B||D){var k=F?w:0,N=O?E:0,U=0,z=0;F&&(U+=r-T),B&&(U+=r-_),O&&(z+=s-S),D&&(z+=s-M);var G=r-U,V=s-z;a.cutWidth=G,a.cutHeight=V,a.setTrim(r,s,k,N,G,V)}A+=u,A+=F?T:B?_:r,P++}A=c,C+=u,C+=O?S:D?M:s}return t}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i=0,n=function(t,e,n,r){var s=i-r.y-r.height;t.add(n,e,r.x,s,r.width,r.height)};t.exports=function(t,e,r){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height),i=s.height;for(var o=r.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",c={x:0,y:0,width:0,height:0},u=0;u<o.length;u++){var d=o[u].match(a);if(d){var p="- "===d[1],f=d[2],m=d[3];if(p&&(l!==h&&(n(t,e,l,c),h=l),c={x:0,y:0,width:0,height:0}),"name"!==f)switch(f){case"x":case"y":case"width":case"height":c[f]=parseInt(m,10)}else l=m}}return l!==h&&n(t,e,l,c),t}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="complete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="decoded"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="decodedall"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="destroy"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="detune"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="detune"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="mute"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="rate"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="volume"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="loop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="looped"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="mute"},function(t,e){
|
|
/**
|
|
* @author pi-kei
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pan"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pauseall"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pause"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="play"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="rate"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resumeall"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resume"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="seek"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="stopall"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="stop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="unlocked"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="volume"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n={Events:i(75),DisplayList:i(1008),GameObjectCreator:i(16),GameObjectFactory:i(5),UpdateList:i(1034),Components:i(11),GetCalcMatrix:i(19),BuildGameObject:i(28),BuildGameObjectAnimation:i(433),GameObject:i(15),BitmapText:i(147),Blitter:i(210),Bob:i(434),Container:i(211),DOMElement:i(436),DynamicBitmapText:i(212),Extern:i(438),Graphics:i(213),Group:i(110),Image:i(124),Layer:i(216),Particles:i(1068),PathFollower:i(451),RenderTexture:i(218),RetroFont:i(1076),Rope:i(220),Sprite:i(73),Text:i(221),GetTextSize:i(452),MeasureText:i(454),TextStyle:i(453),TileSprite:i(222),Zone:i(127),Video:i(223),Shape:i(33),Arc:i(455),Curve:i(456),Ellipse:i(457),Grid:i(458),IsoBox:i(459),IsoTriangle:i(460),Line:i(461),Polygon:i(462),Rectangle:i(467),Star:i(468),Triangle:i(469),Factories:{Blitter:i(1124),Container:i(1125),DOMElement:i(1126),DynamicBitmapText:i(1127),Extern:i(1128),Graphics:i(1129),Group:i(1130),Image:i(1131),Layer:i(1132),Particles:i(1133),PathFollower:i(1134),RenderTexture:i(1135),Rope:i(1136),Sprite:i(1137),StaticBitmapText:i(1138),Text:i(1139),TileSprite:i(1140),Zone:i(1141),Video:i(1142),Arc:i(1143),Curve:i(1144),Ellipse:i(1145),Grid:i(1146),IsoBox:i(1147),IsoTriangle:i(1148),Line:i(1149),Polygon:i(1150),Rectangle:i(1151),Star:i(1152),Triangle:i(1153)},Creators:{Blitter:i(1154),Container:i(1155),DynamicBitmapText:i(1156),Graphics:i(1157),Group:i(1158),Image:i(1159),Layer:i(1160),Particles:i(1161),RenderTexture:i(1162),Rope:i(1163),Sprite:i(1164),StaticBitmapText:i(1165),Text:i(1166),TileSprite:i(1167),Zone:i(1168),Video:i(1169)}};n.Shader=i(226),n.Mesh=i(227),n.PointLight=i(149),n.Factories.Shader=i(1178),n.Factories.Mesh=i(1179),n.Factories.PointLight=i(1180),n.Creators.Shader=i(1181),n.Creators.Mesh=i(1182),n.Creators.PointLight=i(1183),n.Light=i(475),n.LightsManager=i(476),n.LightsPlugin=i(1184),t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(107),s=i(24),o=i(75),a=i(21),h=i(79),l=new n({Extends:r,initialize:function(t){r.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(a.BOOT,this.boot,this),this.events.on(a.START,this.start,this)},boot:function(){this.events.once(a.DESTROY,this.destroy,this)},addChildCallback:function(t){t.emit(o.ADDED_TO_SCENE,t,this.scene),t.displayList&&t.displayList.remove(t),t.displayList=this,this.queueDepthSort(),this.events.emit(a.ADDED_TO_SCENE,t,this.scene)},removeChildCallback:function(t){t.emit(o.REMOVED_FROM_SCENE,t,this.scene),t.displayList=null,this.queueDepthSort(),this.events.emit(a.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e].destroy(!0);t.length=0,this.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});s.register("DisplayList",l,"displayList"),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={CheckMatrix:i(206),MatrixToString:i(1010),ReverseColumns:i(1011),ReverseRows:i(1012),Rotate180:i(1013),RotateLeft:i(1014),RotateMatrix:i(146),RotateRight:i(1015),Translate:i(1016),TransposeMatrix:i(429)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(183),r=i(206);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i<t.length;i++){for(var s=0;s<t[i].length;s++){var o=t[i][s].toString();e+="undefined"!==o?n(o,2):"?",s<t[i].length-1&&(e+=" |")}if(i<t.length-1){e+="\n";for(var a=0;a<t[i].length;a++)e+="---",a<t[i].length-1&&(e+="+");e+="\n"}}return e}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].reverse();return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(146);t.exports=function(t){return n(t,180)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(146);t.exports=function(t){return n(t,90)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(146);t.exports=function(t){return n(t,-90)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(175),r=i(176);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?n(t,Math.abs(i)):r(t,i)),0!==e)for(var s=0;s<t.length;s++){var o=t[s];e<0?n(o,Math.abs(e)):r(o,e)}return t}},function(t,e){t.exports=function(t,e,i,n,r){if(void 0===r&&(r=t),i>0){var s=i-t.length;if(s<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(r,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>s&&(e.splice(s),o=s);for(var a=0;a<o;a++){var h=e[a];t.push(h),n&&n.call(r,h)}return e}},function(t,e){t.exports=function(t,e,i,n,r,s){if(void 0===i&&(i=0),void 0===s&&(s=t),n>0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(s,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(s,l)}return e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i<t.length&&(t.splice(i,1),t.push(e)),e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(78);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var o=0;if(n(t,r,s))for(var a=r;a<s;a++)t[a][e]===i&&o++;return o}},function(t,e){t.exports=function(t,e,i){var n,r=[null];for(n=3;n<arguments.length;n++)r.push(arguments[n]);for(n=0;n<t.length;n++)r[0]=t[n],e.apply(i,r);return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(78);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s)){var o,a=[null];for(o=5;o<arguments.length;o++)a.push(arguments[o]);for(o=r;o<s;o++)a[0]=t[o],e.apply(i,a)}return t}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var n=t[i-1],r=t.indexOf(n);t[i]=n,t[r]=e}return t}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i<t.length-1){var n=t[i+1],r=t.indexOf(n);t[i]=n,t[r]=e}return t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(357);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],s=Math.max(n((e-t)/(i||1)),0),o=0;o<s;o++)r.push(t),t+=i;return r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(74);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=n(t,e);return i&&i.call(r,s),s}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(78);t.exports=function(t,e,i,r,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(r)for(var h=0;h<a.length;h++){var l=a[h];r.call(s,l)}return a}return[]}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(74);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return n(t,r)}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),r=t.indexOf(i);return-1!==n&&-1===r&&(t[n]=i,!0)}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(78);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var o=r;o<s;o++){var a=t[o];a.hasOwnProperty(e)&&(a[e]=i)}return t}},function(t,e){t.exports=function(t,e,i){if(e!==i){var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[r]=e,t}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(208),s=i(24),o=i(21),a=new n({Extends:r,initialize:function(t){r.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(o.PRE_UPDATE,this.update,this),t.on(o.UPDATE,this.sceneUpdate,this),t.once(o.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,n=i.length,r=0;r<n;r++){var s=i[r];s.active&&s.preUpdate.call(s,t,e)}},shutdown:function(){for(var t=this._active.length;t--;)this._active[t].destroy(!0);for(t=this._pending.length;t--;)this._pending[t].destroy(!0);for(t=this._destroy.length;t--;)this._destroy[t].destroy(!0);this._toProcess=0,this._pending=[],this._active=[],this._destroy=[],this.removeAllListeners();var e=this.systems.events;e.off(o.PRE_UPDATE,this.preUpdate,this),e.off(o.UPDATE,this.sceneUpdate,this),e.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.systems.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});s.register("UpdateList",a,"updateList"),t.exports=a},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="add"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="remove"},function(t,e){t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),void 0===n)return n={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var r,s,o,a,h=t.text,l=h.length,c=t.maxWidth,u=t.wordWrapCharCode,d=Number.MAX_VALUE,p=Number.MAX_VALUE,f=0,m=0,g=t.fontData.chars,v=t.fontData.lineHeight,y=t.letterSpacing,x=0,b=0,w=0,T=null,_=t._align,E=0,S=0,M=t.fontSize/t.fontData.size,A=M*t.scaleX,C=M*t.scaleY,P=null,R=0,L=[],O=Number.MAX_VALUE,D=0,I=0,F=0,B=[],k=[],N=null;if(c>0){for(r=0;r<l;r++)if(10!==(w=h.charCodeAt(r))){if(T=g[w]){if(null!==P)var U=T.kerning[R];w===u?null!==N&&(B.push({word:N.word,i:N.i,x:N.x*A,y:N.y*C,w:N.w*A,h:N.h*C,cr:!1}),N=null):(null===N&&(N={word:"",i:r,x:x,y:b,w:0,h:v,cr:!1}),N.word=N.word.concat(h[r]),N.w+=T.xOffset+T.xAdvance+(void 0!==U?U:0)),x+=T.xAdvance+y,P=T,R=w}}else null!==N&&(B.push({word:N.word,i:N.i,x:N.x*A,y:N.y*C,w:N.w*A,h:N.h*C,cr:!0}),N=null),x=0,b+=v,P=null;var z;null!==N&&B.push({word:N.word,i:N.i,x:N.x*A,y:N.y*C,w:N.w*A,h:N.h*C,cr:!1}),x=0,b=0,P=null,R=0;var G=0,V=[];for(r=0;r<B.length;r++){var H=B[r],W=H.x,X=H.x+H.w;z&&(G=W-(W-(z.x+z.w)+z.w),z=null),W-G>c||X-G>c?(V.push(H.i-1),H.cr?(V.push(H.i+H.word.length),G=0,z=null):z=H):H.cr&&(V.push(H.i+H.word.length),G=0,z=null)}for(r=V.length-1;r>=0;r--)s=h,o=V[r],a="\n",h=s.substr(0,o)+a+s.substr(o+1);n.wrappedText=h,l=h.length,B=[],N=null}var j=0;for(r=0;r<l;r++)if(10!==(w=h.charCodeAt(r))){if(T=g[w]){if(E=x,S=b,null!==P){var Y=T.kerning[R];E+=void 0!==Y?Y:0}d>E&&(d=E),p>S&&(p=S);var q=E+T.xAdvance,Z=S+v;f<q&&(f=q),m<Z&&(m=Z);var K=T.xOffset+T.xAdvance+(void 0!==Y?Y:0);w===u?null!==N&&(B.push({word:N.word,i:N.i,x:N.x*A,y:N.y*C,w:N.w*A,h:N.h*C}),N=null):(null===N&&(N={word:"",i:j,x:x,y:b,w:0,h:v}),N.word=N.word.concat(h[r]),N.w+=K),k.push({i:j,char:h[r],code:w,x:(T.xOffset+x)*M,y:(T.yOffset+b)*M,w:T.width*M,h:T.height*M,t:b*M,r:q*M,b:v*M,line:I,glyph:T}),x+=T.xAdvance+y,P=T,R=w,F=q*M,j++}}else null!==N&&(B.push({word:N.word,i:N.i,x:N.x*A,y:N.y*C,w:N.w*A,h:N.h*C}),N=null),x=0,b+=v,P=null,L[I]=F,F>D&&(D=F),F<O&&(O=F),I++,F=0;if(null!==N&&B.push({word:N.word,i:N.i,x:N.x*A,y:N.y*C,w:N.w*A,h:N.h*C}),L[I]=F,F>D&&(D=F),F<O&&(O=F),_>0)for(var J=0;J<k.length;J++){var Q=k[J];if(1===_){var $=(D-L[Q.line])/2;Q.x+=$,Q.r+=$}else if(2===_){var tt=D-L[Q.line];Q.x+=tt,Q.r+=tt}}var et=n.local,it=n.global,nt=n.lines;return et.x=d*M,et.y=p*M,et.width=f*M,et.height=m*M,it.x=t.x-t._displayOriginX+d*A,it.y=t.y-t._displayOriginY+p*C,it.width=f*A,it.height=m*C,nt.shortest=O,nt.longest=D,nt.lengths=L,e&&(et.x=Math.ceil(et.x),et.y=Math.ceil(et.y),et.width=Math.ceil(et.width),et.height=Math.ceil(et.height),it.x=Math.ceil(it.x),it.y=Math.ceil(it.y),it.width=Math.ceil(it.width),it.height=Math.ceil(it.height),nt.shortest=Math.ceil(O),nt.longest=Math.ceil(D)),i&&(t._displayOriginX=t.originX*et.width,t._displayOriginY=t.originY*et.height,it.x=t.x-t._displayOriginX*t.scaleX,it.y=t.y-t._displayOriginY*t.scaleY,e&&(it.x=Math.ceil(it.x),it.y=Math.ceil(it.y))),n.words=B,n.characters=k,n.lines.height=v,n.scale=M,n.scaleX=t.scaleX,n.scaleY=t.scaleY,n}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(209);t.exports=function(t,e,i,r,s,o,a){var h=t.sys.textures.get(i),l=h.get(r),c=t.sys.cache.xml.get(s);if(l&&c){var u=n(c,l,o,a,h);return t.sys.cache.bitmapFont.add(e,{data:u,texture:i,frame:r}),!0}return!1}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1040),r=i(1042),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1041),r=i(19),s=i(12);t.exports=function(t,e,i,o){if(0!==e._text.length){i.addToRenderList(e);var a,h,l,c=t.pipelines.set(e.pipeline,e),u=r(e,i,o).calc,d=i.roundPixels,p=i.alpha,f=e.charColors,m=e.tintFill,g=s.getTintAppendFloatAlpha,v=g(e.tintTopLeft,p*e._alphaTL),y=g(e.tintTopRight,p*e._alphaTR),x=g(e.tintBottomLeft,p*e._alphaBL),b=g(e.tintBottomRight,p*e._alphaBR),w=e.frame.glTexture,T=c.setGameObject(e),_=e.getTextBounds(!1).characters,E=e.dropShadowX,S=e.dropShadowY,M=0!==E||0!==S;if(t.pipelines.preBatch(e),M){var A=e.dropShadowColor,C=e.dropShadowAlpha,P=g(A,p*C*e._alphaTL),R=g(A,p*C*e._alphaTR),L=g(A,p*C*e._alphaBL),O=g(A,p*C*e._alphaBR);for(a=0;a<_.length;a++)l=(h=_[a]).glyph,32!==h.code&&0!==l.width&&0!==l.height&&n(c,e,h,l,E,S,u,d,P,R,L,O,1,w,T)}for(a=0;a<_.length;a++)if(l=(h=_[a]).glyph,32!==h.code&&0!==l.width&&0!==l.height)if(f[h.i]){var D=f[h.i],I=D.tintEffect,F=g(D.tintTL,p*e._alphaTL),B=g(D.tintTR,p*e._alphaTR),k=g(D.tintBL,p*e._alphaBL),N=g(D.tintBR,p*e._alphaBR);n(c,e,h,l,0,0,u,d,F,B,k,N,I,w,T)}else n(c,e,h,l,0,0,u,d,v,y,x,b,m,w,T);t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){var m=i.x-e.displayOriginX+r,g=i.y-e.displayOriginY+s,v=m+i.w,y=g+i.h,x=o.getXRound(m,g,a),b=o.getYRound(m,g,a),w=o.getXRound(m,y,a),T=o.getYRound(m,y,a),_=o.getXRound(v,y,a),E=o.getYRound(v,y,a),S=o.getXRound(v,g,a),M=o.getYRound(v,g,a);t.batchQuad(e,x,b,w,T,_,E,S,M,n.u0,n.v0,n.u1,n.v1,h,l,c,u,d,p,f)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(30);t.exports=function(t,e,i,r){var s=e._text,o=s.length,a=t.currentContext;if(0!==o&&n(t,a,e,i,r)){i.addToRenderList(e);var h=e.texture.frames.__BASE,l=e.fontData.chars,c=e.fontData.lineHeight,u=e._letterSpacing,d=0,p=0,f=0,m=null,g=0,v=0,y=0,x=0,b=0,w=0,T=null,_=0,E=h.source.image,S=h.cutX,M=h.cutY,A=e._fontSize/e.fontData.size,C=e._align,P=0,R=0,L=e.getTextBounds(!1);e.maxWidth>0&&(o=(s=L.wrappedText).length);var O=e._bounds.lines;1===C?R=(O.longest-O.lengths[0])/2:2===C&&(R=O.longest-O.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,I=0;I<o;I++)if(10!==(f=s.charCodeAt(I))){if(m=l[f]){if(g=S+m.x,v=M+m.y,y=m.width,x=m.height,b=m.xOffset+d,w=m.yOffset+p,null!==T){var F=m.kerning[_];b+=void 0!==F?F:0}b*=A,w*=A,b+=R,d+=m.xAdvance+u,T=m,_=f,0!==y&&0!==x&&32!==f&&(D&&(b=Math.round(b),w=Math.round(w)),a.save(),a.translate(b,w),a.scale(A,A),a.drawImage(E,g,v,y,x,0,0,y,x),a.restore())}}else P++,1===C?R=(O.longest-O.lengths[P])/2:2===C&&(R=O.longest-O.lengths[P]),d=0,p+=c,T=null;a.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1044),r=i(1045),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(25),r=i(12),s=new n;t.exports=function(t,e,i,n){var o=e.getRenderList();if(0===o.length)return e.clearRenderDepth(i);e.setRenderDepth(i);var a=t.pipelines.set(this.pipeline,e),h=i.scrollX*e.scrollFactorX,l=i.scrollY*e.scrollFactorY,c=s.copyFrom(i.matrix);n&&(c.multiplyWithOffset(n,-h,-l),h=0,l=0);var u=e.x-h,d=e.y-l,p=-1,f=i.alpha*e.alpha,m=i.roundPixels;t.pipelines.preBatch(e);for(var g=0;g<o.length;g++){var v=o[g],y=v.frame,x=v.alpha*f;if(0!==x){var b=y.width,w=y.height,T=u+v.x+y.x,_=d+v.y+y.y;v.flipX&&(b*=-1,T+=y.width),v.flipY&&(w*=-1,_+=y.height);var E=T+b,S=_+w,M=c.getX(T,_),A=c.getY(T,_),C=c.getX(E,S),P=c.getY(E,S),R=r.getTintAppendFloatAlpha(v.tint,x);if(y.sourceIndex!==p){var L=a.setGameObject(e,y);p=y.sourceIndex}m&&(M=Math.round(M),A=Math.round(A),C=Math.round(C),P=Math.round(P)),a.batchQuad(e,M,A,M,P,C,P,C,A,y.u0,y.v0,y.u1,y.v1,R,R,R,R,!1,y.glTexture,L)&&(p=-1)}}t.pipelines.postBatch(e)}},function(t,e){t.exports=function(t,e,i,n){var r=e.getRenderList();if(0!==r.length){var s=t.currentContext,o=i.alpha*e.alpha;if(0!==o){i.addToRenderList(e),s.globalCompositeOperation=t.blendModes[e.blendMode],s.imageSmoothingEnabled=!(!t.antialias||e.frame.source.scaleMode);var a=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;s.save(),n&&n.copyToContext(s);for(var l=i.roundPixels,c=0;c<r.length;c++){var u=r[c],d=u.flipX||u.flipY,p=u.frame,f=p.canvasData,m=p.x,g=p.y,v=1,y=1,x=u.alpha*o;0!==x&&(s.globalAlpha=x,d?(u.flipX&&(v=-1,m-=f.width),u.flipY&&(y=-1,g-=f.height),s.save(),s.translate(u.x+a,u.y+h),s.scale(v,y),s.drawImage(p.source.image,f.x,f.y,f.width,f.height,m,g,f.width,f.height),s.restore()):(l&&(m=Math.round(m),g=Math.round(g)),s.drawImage(p.source.image,f.x,f.y,f.width,f.height,m+u.x+a,g+u.y+h,f.width,f.height)))}s.restore()}}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1047),r=i(1048),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){var r=e.list,s=r.length;if(0!==s){var o=e.localTransform;n?(o.loadIdentity(),o.multiply(n),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,c=e.scrollFactorY,u=0;u<s;u++){var d=r[u];if(d.willRender(i)){var p,f,m,g;if(void 0!==d.alphaTopLeft)p=d.alphaTopLeft,f=d.alphaTopRight,m=d.alphaBottomLeft,g=d.alphaBottomRight;else{var v=d.alpha;p=v,f=v,m=v,g=v}var y=d.scrollFactorX,x=d.scrollFactorY;a||d.blendMode===t.currentBlendMode||t.setBlendMode(d.blendMode);var b=d.mask;b&&b.preRenderWebGL(t,d,i);var w=d.type;w!==t.currentType&&(t.newType=!0,t.currentType=w),t.nextTypeMatch=u<s-1&&r[u+1].type===t.currentType,d.setScrollFactor(y*l,x*c),d.setAlpha(p*h,f*h,m*h,g*h),d.renderWebGL(t,d,i,o),d.setAlpha(p,f,m,g),d.setScrollFactor(y,x),b&&b.postRenderWebGL(t,i),t.newType=!1}}t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,n){var r=e.list;if(0!==r.length){var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var c=0;c<r.length;c++){var u=r[c];if(u.willRender(i)){var d=u.alpha,p=u.scrollFactorX,f=u.scrollFactorY;o||u.blendMode===t.currentBlendMode||t.setBlendMode(u.blendMode),u.setScrollFactor(p*h,f*l),u.setAlpha(d*a),u.renderCanvas(t,u,i,s),u.setAlpha(d),u.setScrollFactor(p,f)}}e.mask&&e.mask.postRenderCanvas(t)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(437),r=i(437),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1052),r=i(1053),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19),r=i(25),s=i(12),o=new r;t.exports=function(t,e,i,r){var a=e.text,h=a.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),c=n(e,i,r),u=c.sprite,d=c.calc,p=o,f=e.cropWidth>0||e.cropHeight>0;f&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var m,g,v=e.frame.glTexture,y=e.tintFill,x=s.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),b=s.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),w=s.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),T=s.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),_=l.setGameObject(e),E=0,S=0,M=0,A=0,C=e.letterSpacing,P=0,R=0,L=e.scrollX,O=e.scrollY,D=e.fontData,I=D.chars,F=D.lineHeight,B=e.fontSize/D.size,k=0,N=e._align,U=0,z=0,G=e.getTextBounds(!1);e.maxWidth>0&&(h=(a=G.wrappedText).length);var V=e._bounds.lines;1===N?z=(V.longest-V.lengths[0])/2:2===N&&(z=V.longest-V.lengths[0]);var H=i.roundPixels,W=e.displayCallback,X=e.callbackData;t.pipelines.preBatch(e);for(var j=0;j<h;j++)if(10!==(M=a.charCodeAt(j))){if(m=I[M]){P=m.width,R=m.height;var Y=m.xOffset+E-L,q=m.yOffset+S-O;if(null!==g){var Z=m.kerning[A];Y+=void 0!==Z?Z:0}if(E+=m.xAdvance+C,g=m,A=M,0!==P&&0!==R&&32!==M){if(B=e.fontSize/e.fontData.size,k=0,W){X.color=0,X.tint.topLeft=x,X.tint.topRight=b,X.tint.bottomLeft=w,X.tint.bottomRight=T,X.index=j,X.charCode=M,X.x=Y,X.y=q,X.scale=B,X.rotation=k,X.data=m.data;var K=W(X);Y=K.x,q=K.y,B=K.scale,k=K.rotation,K.color?(x=K.color,b=K.color,w=K.color,T=K.color):(x=K.tint.topLeft,b=K.tint.topRight,w=K.tint.bottomLeft,T=K.tint.bottomRight),x=s.getTintAppendFloatAlpha(x,i.alpha*e._alphaTL),b=s.getTintAppendFloatAlpha(b,i.alpha*e._alphaTR),w=s.getTintAppendFloatAlpha(w,i.alpha*e._alphaBL),T=s.getTintAppendFloatAlpha(T,i.alpha*e._alphaBR)}Y*=B,q*=B,Y-=e.displayOriginX,q-=e.displayOriginY,Y+=z,p.applyITRS(Y,q,k,B,B),d.multiply(p,u);var J=m.u0,Q=m.v0,$=m.u1,tt=m.v1,et=P,it=R,nt=u.e,rt=u.f,st=it*u.c+u.e,ot=it*u.d+u.f,at=et*u.a+it*u.c+u.e,ht=et*u.b+it*u.d+u.f,lt=et*u.a+u.e,ct=et*u.b+u.f;H&&(nt=Math.round(nt),rt=Math.round(rt),st=Math.round(st),ot=Math.round(ot),at=Math.round(at),ht=Math.round(ht),lt=Math.round(lt),ct=Math.round(ct)),l.batchQuad(e,nt,rt,st,ot,at,ht,lt,ct,J,Q,$,tt,x,b,w,T,y,v,_)}}}else U++,1===N?z=(V.longest-V.lengths[U])/2:2===N&&(z=V.longest-V.lengths[U]),E=0,S+=F,g=null;f&&(l.flush(),t.popScissor()),t.pipelines.postBatch(e)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(30);t.exports=function(t,e,i,r){var s=e._text,o=s.length,a=t.currentContext;if(0!==o&&n(t,a,e,i,r)){i.addToRenderList(e);var h=e.frame,l=e.displayCallback,c=e.callbackData,u=e.fontData.chars,d=e.fontData.lineHeight,p=e._letterSpacing,f=0,m=0,g=0,v=null,y=0,x=0,b=0,w=0,T=0,_=0,E=null,S=0,M=e.frame.source.image,A=h.cutX,C=h.cutY,P=0,R=0,L=e._fontSize/e.fontData.size,O=e._align,D=0,I=0;e.getTextBounds(!1);var F=e._bounds.lines;1===O?I=(F.longest-F.lengths[0])/2:2===O&&(I=F.longest-F.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);var B=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(a.beginPath(),a.rect(0,0,e.cropWidth,e.cropHeight),a.clip());for(var k=0;k<o;k++)if(R=L,P=0,10!==(g=s.charCodeAt(k))){if(v=u[g]){if(y=A+v.x,x=C+v.y,b=v.width,w=v.height,T=v.xOffset+f-e.scrollX,_=v.yOffset+m-e.scrollY,null!==E){var N=v.kerning[S];T+=void 0!==N?N:0}if(l){c.index=k,c.charCode=g,c.x=T,c.y=_,c.scale=R,c.rotation=P,c.data=v.data;var U=l(c);T=U.x,_=U.y,R=U.scale,P=U.rotation}T*=R,_*=R,T+=I,f+=v.xAdvance+p,E=v,S=g,0!==b&&0!==w&&32!==g&&(B&&(T=Math.round(T),_=Math.round(_)),a.save(),a.translate(T,_),a.rotate(P),a.scale(R,R),a.drawImage(M,y,x,b,w,0,0,b,w),a.restore())}}else D++,1===O?I=(F.longest-F.lengths[D])/2:2===O&&(I=F.longest-F.lengths[D]),f=0,m+=d,E=null;a.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1055),r=i(1056),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19);t.exports=function(t,e,i,r){t.pipelines.clear();var s=n(e,i,r).calc;e.render.call(e,t,i,s),t.pipelines.rebind()}},function(t,e){},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1058),r=i(442),r=i(442),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(214),r=i(19),s=i(25),o=i(12),a=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new a(t,e,i)},l=[],c=new s;t.exports=function(t,e,i,s){if(0!==e.commandBuffer.length){i.addToRenderList(e);var u=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=r(e,i,s).calc,p=c.loadIdentity(),f=e.commandBuffer,m=i.alpha*e.alpha,g=1,v=u.fillTint,y=u.strokeTint,x=0,b=0,w=0,T=2*Math.PI,_=[],E=0,S=!0,M=null,A=o.getTintAppendFloatAlpha,C=0;C<f.length;C++)switch(f[C]){case n.BEGIN_PATH:_.length=0,M=null,S=!0;break;case n.CLOSE_PATH:S=!1,M&&M.points.length&&M.points.push(M.points[0]);break;case n.FILL_PATH:for(E=0;E<_.length;E++)u.batchFillPath(_[E].points,p,d);break;case n.STROKE_PATH:for(E=0;E<_.length;E++)u.batchStrokePath(_[E].points,g,S,p,d);break;case n.LINE_STYLE:g=f[++C];var P=A(f[++C],f[++C]*m);y.TL=P,y.TR=P,y.BL=P,y.BR=P;break;case n.FILL_STYLE:var R=A(f[++C],f[++C]*m);v.TL=R,v.TR=R,v.BL=R,v.BR=R;break;case n.GRADIENT_FILL_STYLE:var L=f[++C]*m,O=f[++C]*m,D=f[++C]*m,I=f[++C]*m;v.TL=A(f[++C],L),v.TR=A(f[++C],O),v.BL=A(f[++C],D),v.BR=A(f[++C],I);break;case n.GRADIENT_LINE_STYLE:g=f[++C];var F=f[++C]*m;y.TL=A(f[++C],F),y.TR=A(f[++C],F),y.BL=A(f[++C],F),y.BR=A(f[++C],F);break;case n.ARC:var B=0,k=f[++C],N=f[++C],U=f[++C],z=f[++C],G=f[++C],V=f[++C],H=f[++C];for(G-=z,V?G<-T?G=-T:G>0&&(G=G%T-T):G>T?G=T:G<0&&(G=T+G%T),null===M&&(M=new h(k+Math.cos(z)*U,N+Math.sin(z)*U,g),_.push(M),B+=.01);B<1+H;)w=G*B+z,x=k+Math.cos(w)*U,b=N+Math.sin(w)*U,M.points.push(new a(x,b,g)),B+=.01;w=G+z,x=k+Math.cos(w)*U,b=N+Math.sin(w)*U,M.points.push(new a(x,b,g));break;case n.FILL_RECT:u.batchFillRect(f[++C],f[++C],f[++C],f[++C],p,d);break;case n.FILL_TRIANGLE:u.batchFillTriangle(f[++C],f[++C],f[++C],f[++C],f[++C],f[++C],p,d);break;case n.STROKE_TRIANGLE:u.batchStrokeTriangle(f[++C],f[++C],f[++C],f[++C],f[++C],f[++C],g,p,d);break;case n.LINE_TO:null!==M?M.points.push(new a(f[++C],f[++C],g)):(M=new h(f[++C],f[++C],g),_.push(M));break;case n.MOVE_TO:M=new h(f[++C],f[++C],g),_.push(M);break;case n.SAVE:l.push(p.copyToArray());break;case n.RESTORE:p.copyFromArray(l.pop());break;case n.TRANSLATE:k=f[++C],N=f[++C],p.translate(k,N);break;case n.SCALE:k=f[++C],N=f[++C],p.scale(k,N);break;case n.ROTATE:p.rotate(f[++C])}t.pipelines.postBatch(e)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1060),r=i(1061),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),e.pipeline.batchSprite(e,i,n)}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),t.batchSprite(e,e.frame,i,n)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1063),r=i(1064),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),this.pipeline.batchSprite(e,i,n)}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),t.batchSprite(e,e.frame,i,n)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1066),r=i(1067),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i){var n=e.list,r=n.length;if(0!==r){e.depthSort(),t.pipelines.preBatch(e);var s=-1!==e.blendMode;s||t.setBlendMode(0);for(var o=e.alpha,a=0;a<r;a++){var h=n[a];if(h.willRender(i)){var l,c,u,d;if(void 0!==h.alphaTopLeft)l=h.alphaTopLeft,c=h.alphaTopRight,u=h.alphaBottomLeft,d=h.alphaBottomRight;else{var p=h.alpha;l=p,c=p,u=p,d=p}s||h.blendMode===t.currentBlendMode||t.setBlendMode(h.blendMode);var f=h.mask;f&&f.preRenderWebGL(t,h,i);var m=h.type;m!==t.currentType&&(t.newType=!0,t.currentType=m),t.nextTypeMatch=a<r-1&&n[a+1].type===t.currentType,h.setAlpha(l*o,c*o,u*o,d*o),h.renderWebGL(t,h,i),h.setAlpha(l,c,u,d),f&&f.postRenderWebGL(t,i),t.newType=!1}}t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i){var n=e.list;if(0!==n.length){e.depthSort();var r=-1!==e.blendMode;r||t.setBlendMode(0);var s=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var o=0;o<n.length;o++){var a=n[o];if(a.willRender(i)){var h=a.alpha;r||a.blendMode===t.currentBlendMode||t.setBlendMode(a.blendMode),a.setAlpha(h*s),a.renderCanvas(t,a,i),a.setAlpha(h)}}e.mask&&e.mask.postRenderCanvas(t)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={EmitterOp:i(443),GravityWell:i(444),Particle:i(445),ParticleEmitter:i(446),ParticleEmitterManager:i(217),Zones:i(1072)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1070),r=i(1071),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(25),r=i(12),s=new n,o=new n,a=new n,h=new n;t.exports=function(t,e,i,n){var l=e.emitters.list,c=l.length;if(0!==c){var u=t.pipelines.set(e.pipeline),d=s,p=o,f=a,m=h;n?(m.loadIdentity(),m.multiply(n),m.translate(e.x,e.y),m.rotate(e.rotation),m.scale(e.scaleX,e.scaleY)):m.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=i.roundPixels,v=e.defaultFrame.glTexture,y=r.getTintAppendFloatAlpha,x=u.setGameObject(e,e.defaultFrame);t.pipelines.preBatch(e);for(var b=0;b<c;b++){var w=l[b],T=w.alive,_=T.length;if(w.visible&&0!==_){i.addToRenderList(w);var E=w.scrollFactorX,S=w.scrollFactorY;t.setBlendMode(w.blendMode),w.mask&&(w.mask.preRenderWebGL(t,w,i),t.pipelines.set(e.pipeline));for(var M=0;M<_;M++){var A=T[M],C=A.alpha*i.alpha;if(!(C<=0)){f.applyITRS(A.x,A.y,A.rotation,A.scaleX,A.scaleY),d.copyFrom(i.matrix),d.multiplyWithOffset(m,-i.scrollX*E,-i.scrollY*S),f.e=A.x,f.f=A.y,d.multiply(f,p);var P=A.frame,R=-P.halfWidth,L=-P.halfHeight,O=R+P.width,D=L+P.height,I=p.getXRound(R,L,g),F=p.getYRound(R,L,g),B=p.getXRound(R,D,g),k=p.getYRound(R,D,g),N=p.getXRound(O,D,g),U=p.getYRound(O,D,g),z=p.getXRound(O,L,g),G=p.getYRound(O,L,g),V=y(A.tint,C);u.batchQuad(w,I,F,B,k,N,U,z,G,P.u0,P.v0,P.u1,P.v1,V,V,V,V,0,v,x)}}w.mask&&w.mask.postRenderWebGL(t,i)}}t.pipelines.postBatch(e)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(25),r=new n,s=new n,o=new n,a=new n;t.exports=function(t,e,i,n){var h=e.emitters.list,l=h.length;if(0!==l){var c=r.copyFrom(i.matrix),u=s,d=o,p=a;n?(p.loadIdentity(),p.multiply(n),p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.scaleX,e.scaleY)):p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);for(var f=t.currentContext,m=i.roundPixels,g=0;g<l;g++){var v=h[g],y=v.alive,x=y.length;if(v.visible&&0!==x){i.addToRenderList(v);var b=v.follow?v.follow.x+v.followOffset.x:0,w=v.follow?v.follow.y+v.followOffset.y:0,T=v.scrollFactorX,_=v.scrollFactorY;f.save(),f.globalCompositeOperation=t.blendModes[v.blendMode];for(var E=0;E<x;E++){var S=y[E],M=S.alpha*i.alpha;if(!(M<=0)){d.applyITRS(S.x,S.y,S.rotation,S.scaleX,S.scaleY),c.copyFrom(i.matrix),c.multiplyWithOffset(p,b+-i.scrollX*T,w+-i.scrollY*_),d.e=S.x,d.f=S.y,c.multiply(d,u);var A=S.frame,C=A.canvasData,P=-A.halfWidth,R=-A.halfHeight;f.globalAlpha=M,f.save(),u.setToContext(f),m&&(P=Math.round(P),R=Math.round(R)),f.imageSmoothingEnabled=!(!t.antialias||A.source.scaleMode),f.drawImage(A.source.image,C.x,C.y,C.width,C.height,P,R,C.width,C.height),f.restore()}}f.restore()}}}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={DeathZone:i(447),EdgeZone:i(448),RandomZone:i(450)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1074),r=i(1075),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(12);t.exports=function(t,e,i,r){i.addToRenderList(e);var s=i.alpha,o=e.renderTarget,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha,c=t.pipelines.set(e.pipeline),u=c.setTexture2D(o.texture);t.pipelines.preBatch(e),c.batchTexture(e,o.texture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e.tintTopLeft,s*e._alphaTL),l(e.tintTopRight,s*e._alphaTR),l(e.tintBottomLeft,s*e._alphaBL),l(e.tintBottomRight,s*e._alphaBR),e.tintFill,0,0,i,r,!0,u),t.resetTextures(),t.pipelines.postBatch(e)}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),t.batchSprite(e,e.frame,i,n)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1077),r=i(17),s={Parse:i(1078)};s=r(!1,s,n),t.exports=s},function(t,e){t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(6);t.exports=function(t,e){var i=e.width,r=e.height,s=Math.floor(i/2),o=Math.floor(r/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=t.sys.textures.getFrame(h),c=l.cutX,u=l.cutY,d=l.source.width,p=l.source.height,f=n(e,"offset.x",0),m=n(e,"offset.y",0),g=n(e,"spacing.x",0),v=n(e,"spacing.y",0),y=n(e,"lineSpacing",0),x=n(e,"charsPerRow",null);null===x&&(x=d/i)>a.length&&(x=a.length);for(var b=f,w=m,T={retroFont:!0,font:h,size:i,lineHeight:r+y,chars:{}},_=0,E=0;E<a.length;E++){var S=a.charCodeAt(E),M=(c+b)/d,A=(u+w)/p,C=(c+b+i)/d,P=(u+w+r)/p;T.chars[S]={x:b,y:w,width:i,height:r,centerX:s,centerY:o,xOffset:0,yOffset:0,xAdvance:i,data:{},kerning:{},u0:M,v0:A,u1:C,v1:P},++_===x?(_=0,b=f,w+=r+v):b+=i+g}return{data:T,frame:null,texture:h}}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1080),r=i(1081),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),a=n(e,i,s).calc,h=e.vertices,l=e.uv,c=e.colors,u=e.alphas,d=e.alpha,p=r.getTintAppendFloatAlpha,f=i.roundPixels,m=h.length,g=Math.floor(.5*m);o.flush(),t.pipelines.preBatch(e);var v=o.setGameObject(e),y=o.vertexViewF32,x=o.vertexViewU32,b=o.vertexCount*o.currentShader.vertexComponentCount-1,w=0,T=e.tintFill;e.dirty&&e.updateVertices();for(var _=e.debugCallback,E=[],S=0;S<m;S+=2){var M=h[S+0],A=h[S+1],C=M*a.a+A*a.c+a.e,P=M*a.b+A*a.d+a.f;f&&(C=Math.round(C),P=Math.round(P)),y[++b]=C,y[++b]=P,y[++b]=l[S+0],y[++b]=l[S+1],y[++b]=v,y[++b]=T,x[++b]=p(c[w],i.alpha*(u[w]*d)),w++,_&&(E[S+0]=C,E[S+1]=P)}_&&_.call(e,e,m,E),o.vertexCount+=g,t.pipelines.postBatch(e)}},function(t,e){t.exports=function(){}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1083),r=i(1084),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(12);t.exports=function(t,e,i,r){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var s=e.frame,o=s.width,a=s.height,h=n.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),c=l.setTexture2D(s.glTexture,e);t.pipelines.preBatch(e),l.batchTexture(e,s.glTexture,o,a,e.x,e.y,o/e.style.resolution,a/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,r,!1,c),t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,n){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1086),r=i(1087),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(12);t.exports=function(t,e,i,r){e.updateCanvas();var s=e.width,o=e.height;if(0!==s&&0!==o){i.addToRenderList(e),t.pipelines.preBatch(e);var a=n.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,s,o,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*s,e.originY*o,0,0,s,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,r,!1,l),t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,n){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,n)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1089),r=i(1090),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,n))}},function(t,e){t.exports=function(t,e,i,n){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1092),r=i(1093),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19),r=i(111),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&r(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(35),r=i(46),s=i(58),o=i(30);t.exports=function(t,e,i,a){i.addToRenderList(e);var h=t.currentContext;if(o(t,h,e,i,a)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,n(e._startAngle),n(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(r(h,e),h.fill()),e.isStroked&&(s(h,e),h.stroke()),h.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1095),r=i(1096),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(111),r=i(19),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=r(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX+e._curveBounds.x,u=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,c=e.pathData,u=c.length-1,d=c[0]-h,p=c[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(u-=2);for(var f=2;f<u;f+=2){var m=c[f]-h,g=c[f+1]-l;a.lineTo(m,g)}e.closePath&&a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1098),r=i(1099),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(111),r=i(19),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=r(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,c=e.pathData,u=c.length-1,d=c[0]-h,p=c[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(u-=2);for(var f=2;f<u;f+=2){var m=c[f]-h,g=c[f+1]-l;a.lineTo(m,g)}a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1101),r=i(1102),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=n(e,i,s);o.calcMatrix.copyFrom(a.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,c=i.alpha*e.alpha,u=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,m=Math.ceil(u/p),g=Math.ceil(d/f),v=p,y=f,x=p-(m*p-u),b=f-(g*f-d),w=e.showCells,T=e.showAltCells,_=e.showOutline,E=0,S=0,M=0,A=0,C=0;if(_&&(v--,y--,x===p&&x--,b===f&&b--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=o.fillTint,l=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c),h.TL=l,h.TR=l,h.BL=l,h.BR=l,S=0;S<g;S++)for(T&&(M=S%2),E=0;E<m;E++)T&&M?M=0:(M++,A=E<m-1?v:x,C=S<g-1?y:b,o.batchFillRect(E*p,S*f,A,C));if(T&&e.altFillAlpha>0)for(h=o.fillTint,l=r.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*c),h.TL=l,h.TR=l,h.BL=l,h.BR=l,S=0;S<g;S++)for(T&&(M=S%2),E=0;E<m;E++)!T||M?(M=0,A=E<m-1?v:x,C=S<g-1?y:b,o.batchFillRect(E*p,S*f,A,C)):M=1;if(_&&e.outlineFillAlpha>0){var P=o.strokeTint,R=r.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*c);for(P.TL=R,P.TR=R,P.BL=R,P.BR=R,E=1;E<m;E++){var L=E*p;o.batchLine(L,0,L,d,1,1,1,0,!1)}for(S=1;S<g;S++){var O=S*f;o.batchLine(0,O,u,O,1,1,1,0,!1)}}t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=-e._displayOriginX,l=-e._displayOriginY,c=i.alpha*e.alpha,u=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,m=Math.ceil(u/p),g=Math.ceil(d/f),v=p,y=f,x=p-(m*p-u),b=f-(g*f-d),w=e.showCells,T=e.showAltCells,_=e.showOutline,E=0,S=0,M=0,A=0,C=0;if(_&&(v--,y--,x===p&&x--,b===f&&b--),w&&e.fillAlpha>0)for(n(a,e),S=0;S<g;S++)for(T&&(M=S%2),E=0;E<m;E++)T&&M?M=0:(M++,A=E<m-1?v:x,C=S<g-1?y:b,a.fillRect(h+E*p,l+S*f,A,C));if(T&&e.altFillAlpha>0)for(n(a,e,e.altFillColor,e.altFillAlpha*c),S=0;S<g;S++)for(T&&(M=S%2),E=0;E<m;E++)!T||M?(M=0,A=E<m-1?v:x,C=S<g-1?y:b,a.fillRect(h+E*p,l+S*f,A,C)):M=1;if(_&&e.outlineFillAlpha>0){for(r(a,e,e.outlineFillColor,e.outlineFillAlpha*c),E=1;E<m;E++){var P=E*p;a.beginPath(),a.moveTo(P+h,l),a.lineTo(P+h,d+l),a.stroke()}for(S=1;S<g;S++){var R=S*f;a.beginPath(),a.moveTo(h,R+l),a.lineTo(h+u,R+l),a.stroke()}}a.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1104),r=i(1105),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o,a,h,l,c,u,d,p,f,m=t.pipelines.set(e.pipeline),g=n(e,i,s),v=m.calcMatrix.copyFrom(g.calc),y=e.width,x=e.height,b=y/2,w=y/e.projection,T=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(o=r.getTintAppendFloatAlpha(e.fillTop,T),a=v.getX(-b,-x),h=v.getY(-b,-x),l=v.getX(0,-w-x),c=v.getY(0,-w-x),u=v.getX(b,-x),d=v.getY(b,-x),p=v.getX(0,w-x),f=v.getY(0,w-x),m.batchQuad(a,h,l,c,u,d,p,f,o,o,o,o)),e.showLeft&&(o=r.getTintAppendFloatAlpha(e.fillLeft,T),a=v.getX(-b,0),h=v.getY(-b,0),l=v.getX(0,w),c=v.getY(0,w),u=v.getX(0,w-x),d=v.getY(0,w-x),p=v.getX(-b,-x),f=v.getY(-b,-x),m.batchQuad(a,h,l,c,u,d,p,f,o,o,o,o)),e.showRight&&(o=r.getTintAppendFloatAlpha(e.fillRight,T),a=v.getX(b,0),h=v.getY(b,0),l=v.getX(0,w),c=v.getY(0,w),u=v.getX(0,w-x),d=v.getY(0,w-x),p=v.getX(b,-x),f=v.getY(b,-x),m.batchQuad(a,h,l,c,u,d,p,f,o,o,o,o)),t.pipelines.postBatch(e))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(46),r=i(30);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,s)&&e.isFilled){var a=e.width,h=e.height,l=a/2,c=a/e.projection;e.showTop&&(n(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-c-h),o.lineTo(l,-h),o.lineTo(l,-1),o.lineTo(0,c-1),o.lineTo(-l,-1),o.lineTo(-l,-h),o.fill()),e.showLeft&&(n(o,e,e.fillLeft),o.beginPath(),o.moveTo(-l,0),o.lineTo(0,c),o.lineTo(0,c-h),o.lineTo(-l,-h),o.lineTo(-l,0),o.fill()),e.showRight&&(n(o,e,e.fillRight),o.beginPath(),o.moveTo(l,0),o.lineTo(0,c),o.lineTo(0,c-h),o.lineTo(l,-h),o.lineTo(l,0),o.fill()),o.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1107),r=i(1108),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=n(e,i,s),h=o.calcMatrix.copyFrom(a.calc),l=e.width,c=e.height,u=l/2,d=l/e.projection,p=e.isReversed,f=i.alpha*e.alpha;if(e.isFilled){var m,g,v,y,x,b,w;if(t.pipelines.preBatch(e),e.showTop&&p){m=r.getTintAppendFloatAlpha(e.fillTop,f),g=h.getX(-u,-c),v=h.getY(-u,-c),y=h.getX(0,-d-c),x=h.getY(0,-d-c),b=h.getX(u,-c),w=h.getY(u,-c);var T=h.getX(0,d-c),_=h.getY(0,d-c);o.batchQuad(g,v,y,x,b,w,T,_,m,m,m,m)}e.showLeft&&(m=r.getTintAppendFloatAlpha(e.fillLeft,f),p?(g=h.getX(-u,-c),v=h.getY(-u,-c),y=h.getX(0,d),x=h.getY(0,d),b=h.getX(0,d-c),w=h.getY(0,d-c)):(g=h.getX(-u,0),v=h.getY(-u,0),y=h.getX(0,d),x=h.getY(0,d),b=h.getX(0,d-c),w=h.getY(0,d-c)),o.batchTri(g,v,y,x,b,w,m,m,m)),e.showRight&&(m=r.getTintAppendFloatAlpha(e.fillRight,f),p?(g=h.getX(u,-c),v=h.getY(u,-c),y=h.getX(0,d),x=h.getY(0,d),b=h.getX(0,d-c),w=h.getY(0,d-c)):(g=h.getX(u,0),v=h.getY(u,0),y=h.getX(0,d),x=h.getY(0,d),b=h.getX(0,d-c),w=h.getY(0,d-c)),o.batchTri(g,v,y,x,b,w,m,m,m)),t.pipelines.postBatch(e)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(46),r=i(30);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,s)&&e.isFilled){var a=e.width,h=e.height,l=a/2,c=a/e.projection,u=e.isReversed;e.showTop&&u&&(n(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-c-h),o.lineTo(l,-h),o.lineTo(0,c-h),o.fill()),e.showLeft&&(n(o,e,e.fillLeft),o.beginPath(),u?(o.moveTo(-l,-h),o.lineTo(0,c),o.lineTo(0,c-h)):(o.moveTo(-l,0),o.lineTo(0,c),o.lineTo(0,c-h)),o.fill()),e.showRight&&(n(o,e,e.fillRight),o.beginPath(),u?(o.moveTo(l,-h),o.lineTo(0,c),o.lineTo(0,c-h)):(o.moveTo(l,0),o.lineTo(0,c),o.lineTo(0,c-h)),o.fill()),o.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1110),r=i(1111),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=n(e,i,s);o.calcMatrix.copyFrom(a.calc);var h=e._displayOriginX,l=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var u=o.strokeTint,d=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*c);u.TL=d,u.TR=d,u.BL=d,u.BR=d;var p=e._startWidth,f=e._endWidth;o.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,p,f,1,0,!1,a.sprite,a.camera)}t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(58),r=i(30);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,s)){var a=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(n(o,e),o.beginPath(),o.moveTo(e.geom.x1-a,e.geom.y1-h),o.lineTo(e.geom.x2-a,e.geom.y2-h),o.stroke()),o.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1113),r=i(1114),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(111),r=i(19),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=r(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,c=e.pathData,u=c.length-1,d=c[0]-h,p=c[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(u-=2);for(var f=2;f<u;f+=2){var m=c[f]-h,g=c[f+1]-l;a.lineTo(m,g)}a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1116),r=i(1117),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19),r=i(81),s=i(12);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,c=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u);d.TL=p,d.TR=p,d.BL=p,d.BR=p,a.batchFillRect(-l,-c,e.width,e.height)}e.isStroked&&r(a,e,u,l,c),t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(n(a,e),a.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(r(a,e),a.beginPath(),a.rect(-h,-l,e.width,e.height),a.stroke()),a.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1119),r=i(1120),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(111),r=i(19),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=r(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,c=e.pathData,u=c.length-1,d=c[0]-h,p=c[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(u-=2);for(var f=2;f<u;f+=2){var m=c[f]-h,g=c[f+1]-l;a.lineTo(m,g)}a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1122),r=i(1123),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19),r=i(81),s=i(12);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,c=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u);d.TL=p,d.TR=p,d.BL=p,d.BR=p;var f=e.geom.x1-l,m=e.geom.y1-c,g=e.geom.x2-l,v=e.geom.y2-c,y=e.geom.x3-l,x=e.geom.y3-c;a.batchFillTriangle(f,m,g,v,y,x,h.sprite,h.camera)}e.isStroked&&r(a,e,u,l,c),t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,c=e.geom.x1-h,u=e.geom.y1-l,d=e.geom.x2-h,p=e.geom.y2-l,f=e.geom.x3-h,m=e.geom.y3-l;a.beginPath(),a.moveTo(c,u),a.lineTo(d,p),a.lineTo(f,m),a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(210);i(5).register("blitter",(function(t,e,i,r){return this.displayList.add(new n(this.scene,t,e,i,r))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(211);i(5).register("container",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(436);i(5).register("dom",(function(t,e,i,r,s){var o=new n(this.scene,t,e,i,r,s);return this.displayList.add(o),o}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(212);i(5).register("dynamicBitmapText",(function(t,e,i,r,s){return this.displayList.add(new n(this.scene,t,e,i,r,s))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(438);i(5).register("extern",(function(){var t=new n(this.scene);return this.displayList.add(t),t}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(213);i(5).register("graphics",(function(t){return this.displayList.add(new n(this.scene,t))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(110);i(5).register("group",(function(t,e){return this.updateList.add(new n(this.scene,t,e))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(124);i(5).register("image",(function(t,e,i,r){return this.displayList.add(new n(this.scene,t,e,i,r))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(216);i(5).register("layer",(function(t){return this.displayList.add(new n(this.scene,t))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(217);n.register("particles",(function(t,e,i){return this.displayList.add(new r(this.scene,t,e,i))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(451);n.register("follower",(function(t,e,i,n,s){var o=new r(this.scene,t,e,i,n,s);return this.displayList.add(o),this.updateList.add(o),o}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(218);n.register("renderTexture",(function(t,e,i,n,s,o){return this.displayList.add(new r(this.scene,t,e,i,n,s,o))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(220);i(5).register("rope",(function(t,e,i,r,s,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a,h))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(73);n.register("sprite",(function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.displayList.add(s),s}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(147);i(5).register("bitmapText",(function(t,e,i,r,s,o){return this.displayList.add(new n(this.scene,t,e,i,r,s,o))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(221);i(5).register("text",(function(t,e,i,r){return this.displayList.add(new n(this.scene,t,e,i,r))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(222);i(5).register("tileSprite",(function(t,e,i,r,s,o){return this.displayList.add(new n(this.scene,t,e,i,r,s,o))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(127);i(5).register("zone",(function(t,e,i,r){return this.displayList.add(new n(this.scene,t,e,i,r))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(223);i(5).register("video",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(455),r=i(5);r.register("arc",(function(t,e,i,r,s,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a,h))})),r.register("circle",(function(t,e,i,r,s){return this.displayList.add(new n(this.scene,t,e,i,0,360,!1,r,s))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(456);n.register("curve",(function(t,e,i,n,s){return this.displayList.add(new r(this.scene,t,e,i,n,s))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(457);i(5).register("ellipse",(function(t,e,i,r,s,o){return this.displayList.add(new n(this.scene,t,e,i,r,s,o))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(458);n.register("grid",(function(t,e,i,n,s,o,a,h,l,c){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h,l,c))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(459);n.register("isobox",(function(t,e,i,n,s,o,a){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(460);n.register("isotriangle",(function(t,e,i,n,s,o,a,h){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(461);n.register("line",(function(t,e,i,n,s,o,a,h){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(462);n.register("polygon",(function(t,e,i,n,s){return this.displayList.add(new r(this.scene,t,e,i,n,s))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(467);n.register("rectangle",(function(t,e,i,n,s,o){return this.displayList.add(new r(this.scene,t,e,i,n,s,o))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(468);i(5).register("star",(function(t,e,i,r,s,o,a){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(469);n.register("triangle",(function(t,e,i,n,s,o,a,h,l,c){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h,l,c))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(210),r=i(28),s=i(16),o=i(13);s.register("blitter",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),s=o(t,"frame",null),a=new n(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,a,t),a}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Felipe Alfonso <@bitnenfer>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(211),s=i(16),o=i(13);s.register("container",(function(t,e){void 0===t&&(t={});var i=o(t,"x",0),s=o(t,"y",0),a=o(t,"children",null),h=new r(this.scene,i,s,a);return void 0!==e&&(t.add=e),n(this.scene,h,t),h}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(212),r=i(28),s=i(16),o=i(13);s.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),s=o(t,"text",""),a=o(t,"size",!1),h=new n(this.scene,0,0,i,s,a);return void 0!==e&&(t.add=e),r(this.scene,h,t),h}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(16),r=i(213);n.register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new r(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(16),r=i(110);n.register("group",(function(t){return new r(this.scene,null,t)}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(16),s=i(13),o=i(124);r.register("image",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=s(t,"frame",null),a=new o(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,a,t),a}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(216),s=i(16),o=i(13);s.register("layer",(function(t,e){void 0===t&&(t={});var i=o(t,"children",null),s=new r(this.scene,i);return void 0!==e&&(t.add=e),n(this.scene,s,t),s}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(16),r=i(13),s=i(2),o=i(217);n.register("particles",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),a=s(t,"emitters",null),h=new o(this.scene,i,n,a);return void 0!==e&&(t.add=e),s(t,"add",!1)?this.displayList.add(h):this.updateList.add(h),h}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(16),s=i(13),o=i(218);r.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=s(t,"x",0),r=s(t,"y",0),a=s(t,"width",32),h=s(t,"height",32),l=s(t,"key",void 0),c=s(t,"frame",void 0),u=new o(this.scene,i,r,a,h,l,c);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(16),s=i(13),o=i(6),a=i(220);r.register("rope",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=s(t,"frame",null),h=s(t,"horizontal",!0),l=o(t,"points",void 0),c=o(t,"colors",void 0),u=o(t,"alphas",void 0),d=new a(this.scene,0,0,i,r,l,h,c,u);return void 0!==e&&(t.add=e),n(this.scene,d,t),t.add||this.updateList.add(d),d}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(433),s=i(16),o=i(13),a=i(73);s.register("sprite",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),s=o(t,"frame",null),h=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),n(this.scene,h,t),r(h,t),h}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(147),r=i(28),s=i(16),o=i(13),a=i(6);s.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),s=o(t,"text",""),h=o(t,"size",!1),l=a(t,"align",0),c=new n(this.scene,0,0,i,s,h,l);return void 0!==e&&(t.add=e),r(this.scene,c,t),c}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(16),s=i(13),o=i(221);r.register("text",(function(t,e){void 0===t&&(t={});var i=s(t,"text",""),r=s(t,"style",null),a=s(t,"padding",null);null!==a&&(r.padding=a);var h=new o(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,h,t),h.autoRound=s(t,"autoRound",!0),h.resolution=s(t,"resolution",1),h}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(16),s=i(13),o=i(222);r.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=s(t,"x",0),r=s(t,"y",0),a=s(t,"width",512),h=s(t,"height",512),l=s(t,"key",""),c=s(t,"frame",""),u=new o(this.scene,i,r,a,h,l,c);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(16),r=i(13),s=i(127);n.register("zone",(function(t){var e=r(t,"x",0),i=r(t,"y",0),n=r(t,"width",1),o=r(t,"height",n);return new s(this.scene,e,i,n,o)}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(16),s=i(13),o=i(223);r.register("video",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),n(this.scene,r,t),t.add||this.updateList.add(r),r}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1171),r=i(1172),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19);t.exports=function(t,e,i,r){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var s=n(e,i,r).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(s.matrix),e.flush()}t.pipelines.rebind()}}},function(t,e){t.exports=function(){}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1174),r=i(1175),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19);t.exports=function(t,e,i,r){var s=e.faces,o=s.length;if(0!==o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),h=n(e,i,r).calc,l=a.setGameObject(e),c=a.vertexViewF32,u=a.vertexViewU32,d=a.vertexCount*a.currentShader.vertexComponentCount-1,p=e.tintFill,f=[],m=e.debugCallback,g=h.a,v=h.b,y=h.c,x=h.d,b=h.e,w=h.f,T=e.viewPosition.z,_=e.hideCCW,E=i.roundPixels,S=i.alpha*e.alpha,M=0;t.pipelines.preBatch(e);for(var A=0;A<o;A++){var C=s[A];C.isInView(i,_,T,S,g,v,y,x,b,w,E)&&(a.shouldFlush(3)&&(a.flush(),d=0),d=C.load(c,u,d,l,p),M++,a.vertexCount+=3,m&&f.push(C))}e.totalFrame+=M,m&&m.call(e,e,f),t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(){}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1177),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(19);t.exports=function(t,e,i,r){i.addToRenderList(e);var s=t.pipelines.set(e.pipeline),o=n(e,i,r).calc,a=e.width,h=e.height,l=-e._radius,c=-e._radius,u=l+a,d=c+h,p=o.getX(0,0),f=o.getY(0,0),m=o.getX(l,c),g=o.getY(l,c),v=o.getX(l,d),y=o.getY(l,d),x=o.getX(u,d),b=o.getY(u,d),w=o.getX(u,c),T=o.getY(u,c);t.pipelines.preBatch(e),s.batchPointLight(e,i,m,g,v,y,x,b,w,T,p,f),t.pipelines.postBatch(e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(226);i(5).register("shader",(function(t,e,i,r,s,o,a){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(227);i(5).register("mesh",(function(t,e,i,r,s,o,a,h,l,c,u){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a,h,l,c,u))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(149);n.register("pointlight",(function(t,e,i,n,s,o){return this.displayList.add(new r(this.scene,t,e,i,n,s,o))}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(16),s=i(13),o=i(226);r.register("shader",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=s(t,"x",0),a=s(t,"y",0),h=s(t,"width",128),l=s(t,"height",128),c=new o(this.scene,i,r,a,h,l);return void 0!==e&&(t.add=e),n(this.scene,c,t),c}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(16),s=i(13),o=i(6),a=i(227);r.register("mesh",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=s(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"uvs",[]),c=o(t,"indicies",[]),u=o(t,"containsZ",!1),d=o(t,"normals",[]),p=o(t,"colors",16777215),f=o(t,"alphas",1),m=new a(this.scene,0,0,i,r,h,l,c,u,d,p,f);return void 0!==e&&(t.add=e),n(this.scene,m,t),m}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(28),r=i(16),s=i(13),o=i(149);r.register("pointlight",(function(t,e){void 0===t&&(t={});var i=s(t,"color",16777215),r=s(t,"radius",128),a=s(t,"intensity",1),h=s(t,"attenuation",.1),l=new o(this.scene,0,0,i,r,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(476),s=i(24),o=i(21),a=new n({Extends:r,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(o.BOOT,this.boot,this),r.call(this)},boot:function(){var t=this.systems.events;t.on(o.SHUTDOWN,this.shutdown,this),t.on(o.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});s.register("LightsPlugin",a,"lights"),t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(62);n.Area=i(1186),n.Circumference=i(296),n.CircumferencePoint=i(165),n.Clone=i(1187),n.Contains=i(63),n.ContainsPoint=i(1188),n.ContainsRect=i(1189),n.CopyFrom=i(1190),n.Equals=i(1191),n.GetBounds=i(1192),n.GetPoint=i(294),n.GetPoints=i(295),n.Offset=i(1193),n.OffsetPoint=i(1194),n.Random=i(166),t.exports=n},function(t,e){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(62);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(63);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(63);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(108);n.Area=i(1196),n.Circumference=i(441),n.CircumferencePoint=i(215),n.Clone=i(1197),n.Contains=i(109),n.ContainsPoint=i(1198),n.ContainsRect=i(1199),n.CopyFrom=i(1200),n.Equals=i(1201),n.GetBounds=i(1202),n.GetPoint=i(439),n.GetPoints=i(440),n.Offset=i(1203),n.OffsetPoint=i(1204),n.Random=i(177),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(108);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(109);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(109);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){
|
|
/**
|
|
* @author Florian Vazelle
|
|
* @author Geoffrey Glaive
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4),r=i(228);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s,o,a,h,l=t.x,c=t.y,u=t.radius,d=e.x,p=e.y,f=e.radius;if(c===p)0==(a=(o=-2*p)*o-4*(s=1)*(d*d+(h=(f*f-u*u-d*d+l*l)/(2*(l-d)))*h-2*d*h+p*p-f*f))?i.push(new n(h,-o/(2*s))):a>0&&(i.push(new n(h,(-o+Math.sqrt(a))/(2*s))),i.push(new n(h,(-o-Math.sqrt(a))/(2*s))));else{var m=(l-d)/(c-p),g=(f*f-u*u-d*d+l*l-p*p+c*c)/(2*(c-p));0==(a=(o=2*c*m-2*g*m-2*l)*o-4*(s=m*m+1)*(l*l+c*c+g*g-u*u-2*c*g))?(h=-o/(2*s),i.push(new n(h,g-h*m))):a>0&&(h=(-o+Math.sqrt(a))/(2*s),i.push(new n(h,g-h*m)),h=(-o-Math.sqrt(a))/(2*s),i.push(new n(h,g-h*m)))}}return i}},function(t,e,i){
|
|
/**
|
|
* @author Florian Vazelle
|
|
* @author Geoffrey Glaive
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(229),r=i(150);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();n(s,t,i),n(o,t,i),n(a,t,i),n(h,t,i)}return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(138),r=i(481),s=new(i(45));function o(t,e,i,o,a){var h=Math.cos(t),l=Math.sin(t);s.setTo(e,i,e+h,i+l);var c=r(s,o);c&&a.push(new n(c.x,c.y,t,c.w))}function a(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var n=[],r=[],s=0;s<i.length;s++)for(var h=i[s].points,l=0;l<h.length;l++){var c=Math.atan2(h[l].y-e,h[l].x-t);-1===r.indexOf(c)&&(o(c,t,e,i,n),o(c-1e-5,t,e,i,n),o(c+1e-5,t,e,i,n),r.push(c))}return n.sort(a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10),r=i(114);t.exports=function(t,e,i){return void 0===i&&(i=new n),r(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e,i){
|
|
/**
|
|
* @author Florian Vazelle
|
|
* @author Geoffrey Glaive
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(231),r=i(114);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();n(s,e,i),n(o,e,i),n(a,e,i),n(h,e,i)}return i}},function(t,e,i){
|
|
/**
|
|
* @author Florian Vazelle
|
|
* @author Geoffrey Glaive
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(483),r=i(231);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var s=e.getLineA(),o=e.getLineB(),a=e.getLineC();r(s,t,i),r(o,t,i),r(a,t,i)}return i}},function(t,e,i){
|
|
/**
|
|
* @author Florian Vazelle
|
|
* @author Geoffrey Glaive
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(229),r=i(485);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s=t.getLineA(),o=t.getLineB(),a=t.getLineC();n(s,e,i),n(o,e,i),n(a,e,i)}return i}},function(t,e,i){
|
|
/**
|
|
* @author Florian Vazelle
|
|
* @author Geoffrey Glaive
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(488),r=i(486);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var s=e.getLineA(),o=e.getLineB(),a=e.getLineC();r(t,s,i),r(t,o,i),r(t,a,i)}return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(490);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),r=Math.max(e.x1,e.x2),s=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=r&&t.y>=s&&t.y<=o}},function(t,e){t.exports=function(t,e,i,n,r,s){return void 0===s&&(s=0),!(e>t.right+s||i<t.left-s||n>t.bottom+s||r<t.top-s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(45);n.Angle=i(93),n.BresenhamPoints=i(311),n.CenterOn=i(1216),n.Clone=i(1217),n.CopyFrom=i(1218),n.Equals=i(1219),n.Extend=i(1220),n.GetEasedPoints=i(1221),n.GetMidPoint=i(1222),n.GetNearestPoint=i(1223),n.GetNormal=i(1224),n.GetPoint=i(301),n.GetPoints=i(168),n.GetShortestDistance=i(1225),n.Height=i(1226),n.Length=i(64),n.NormalAngle=i(491),n.NormalX=i(1227),n.NormalY=i(1228),n.Offset=i(1229),n.PerpSlope=i(1230),n.Random=i(169),n.ReflectAngle=i(1231),n.Rotate=i(1232),n.RotateAroundPoint=i(1233),n.RotateAroundXY=i(233),n.SetToAngle=i(1234),n.Slope=i(1235),n.Width=i(1236),t.exports=n},function(t,e){t.exports=function(t,e,i){var n=e-(t.x1+t.x2)/2,r=i-(t.y1+t.y2)/2;return t.x1+=n,t.y1+=r,t.x2+=n,t.y2+=r,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(45);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(64);t.exports=function(t,e,i){void 0===i&&(i=e);var r=n(t),s=t.x2-t.x1,o=t.y2-t.y1;return e&&(t.x1=t.x1-s/r*e,t.y1=t.y1-o/r*e),i&&(t.x2=t.x2+s/r*i,t.y2=t.y2+o/r*i),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(346),r=i(80),s=i(4);t.exports=function(t,e,i,o,a){void 0===o&&(o=0),void 0===a&&(a=[]);var h,l,c=[],u=t.x1,d=t.y1,p=t.x2-u,f=t.y2-d,m=r(e,a),g=i-1;for(h=0;h<g;h++)l=m(h/g),c.push(new s(u+p*l,d+f*l));if(l=m(1),c.push(new s(u+p*l,d+f*l)),o>0){var v=c[0],y=[v];for(h=1;h<c.length-1;h++){var x=c[h];n(v,x)>=o&&(y.push(x),v=x)}var b=c[c.length-1];return n(v,b)<o&&y.pop(),y.push(b),y}return c}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Florian Mertens
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.x1,s=t.y1,o=t.x2,a=t.y2,h=(o-r)*(o-r)+(a-s)*(a-s);if(0===h)return i;var l=((e.x-r)*(o-r)+(e.y-s)*(a-s))/h;return i.x=r+l*(o-r),i.y=s+l*(a-s),i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14),r=i(93),s=i(4);t.exports=function(t,e){void 0===e&&(e=new s);var i=r(t)-n.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,r=t.x2,s=t.y2,o=(r-i)*(r-i)+(s-n)*(s-n);if(0===o)return!1;var a=((n-e.y)*(r-i)-(i-e.x)*(s-n))/o;return Math.abs(a)*Math.sqrt(o)}},function(t,e){t.exports=function(t){return Math.abs(t.y1-t.y2)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14),r=i(93);t.exports=function(t){return Math.cos(r(t)-n.TAU)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(14),r=i(93);t.exports=function(t){return Math.sin(r(t)-n.TAU)}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},function(t,e){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(93),r=i(491);t.exports=function(t,e){return 2*r(e)-Math.PI-n(t)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(233);t.exports=function(t,e){var i=(t.x1+t.x2)/2,r=(t.y1+t.y2)/2;return n(t,i,r,e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(233);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e){t.exports=function(t,e,i,n,r){return t.x1=e,t.y1=i,t.x2=e+Math.cos(n)*r,t.y2=i+Math.sin(n)*r,t}},function(t,e){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},function(t,e){t.exports=function(t){return Math.abs(t.x1-t.x2)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n={Face:i(113),GenerateGridVerts:i(1238),GenerateObjVerts:i(474),GenerateVerts:i(473),ParseObj:i(492),ParseObjMaterial:i(493),RotateFace:i(1239),Vertex:i(115)};t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(113),r=i(2),s=i(67),o=i(38),a=i(115),h=new o,l=new o,c=new s;t.exports=function(t){var e=r(t,"mesh"),i=r(t,"texture",null),s=r(t,"frame"),o=r(t,"width",1),u=r(t,"height",o),d=r(t,"widthSegments",1),p=r(t,"heightSegments",d),f=r(t,"x",0),m=r(t,"y",0),g=r(t,"z",0),v=r(t,"rotateX",0),y=r(t,"rotateY",0),x=r(t,"rotateZ",0),b=r(t,"zIsUp",!0),w=r(t,"isOrtho",!!e&&e.dirtyCache[11]),T=r(t,"colors",[16777215]),_=r(t,"alphas",[1]),E=r(t,"tile",!1),S=r(t,"flipY",!1),M=r(t,"width",null),A={faces:[],verts:[]};if(h.set(f,m,g),l.set(v,y,x),c.fromRotationXYTranslation(l,h,b),!i&&e)i=e.texture;else{if(!e||"string"!=typeof i)return A;i=e.scene.sys.textures.get(i)}var C=i.get(s);!M&&w&&i&&e&&(o=C.width/e.height,u=C.height/e.height);var P,R,L=o/2,O=u/2,D=Math.floor(d),I=Math.floor(p),F=D+1,B=I+1,k=o/D,N=u/I,U=[],z=[],G=0,V=1,H=0,W=1;C&&(G=C.u0,V=C.u1,S?(H=C.v1,W=C.v0):(H=C.v0,W=C.v1));var X=V-G,j=W-H;for(R=0;R<B;R++){var Y=R*N-O;for(P=0;P<F;P++){var q=P*k-L;z.push(q,-Y);var Z=G+X*(P/D),K=H+j*(R/I);U.push(Z,K)}}Array.isArray(T)||(T=[T]),Array.isArray(_)||(_=[_]);var J=0,Q=0;for(R=0;R<I;R++)for(P=0;P<D;P++){var $=2*(P+F*R),tt=2*(P+F*(R+1)),et=2*(P+1+F*(R+1)),it=2*(P+1+F*R),nt=T[Q],rt=_[J],st=new a(z[$],z[$+1],0,U[$],U[$+1],nt,rt).transformMat4(c),ot=new a(z[tt],z[tt+1],0,U[tt],U[tt+1],nt,rt).transformMat4(c),at=new a(z[it],z[it+1],0,U[it],U[it+1],nt,rt).transformMat4(c),ht=new a(z[tt],z[tt+1],0,U[tt],U[tt+1],nt,rt).transformMat4(c),lt=new a(z[et],z[et+1],0,U[et],U[et+1],nt,rt).transformMat4(c),ct=new a(z[it],z[it+1],0,U[it],U[it+1],nt,rt).transformMat4(c);E&&(st.setUVs(G,W),ot.setUVs(G,H),at.setUVs(V,W),ht.setUVs(G,H),lt.setUVs(V,H),ct.setUVs(V,W)),++Q===T.length&&(Q=0),++J===_.length&&(J=0),A.verts.push(st,ot,at,ht,lt,ct),A.faces.push(new n(st,ot,at),new n(ht,lt,ct))}return e&&(e.faces=e.faces.concat(A.faces),e.vertices=e.vertices.concat(A.verts)),A}},function(t,e){t.exports=function(t,e,i,n){var r,s;if(void 0===i&&void 0===n){var o=t.getInCenter();r=o.x,s=o.y}var a=Math.cos(e),h=Math.sin(e),l=t.vertex1,c=t.vertex2,u=t.vertex3,d=l.x-r,p=l.y-s;l.set(d*a-p*h+r,d*h+p*a+s),d=c.x-r,p=c.y-s,c.set(d*a-p*h+r,d*h+p*a+s),d=u.x-r,p=u.y-s,u.set(d*a-p*h+r,d*h+p*a+s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);n.Ceil=i(1241),n.Clone=i(1242),n.CopyFrom=i(1243),n.Equals=i(1244),n.Floor=i(1245),n.GetCentroid=i(1246),n.GetMagnitude=i(494),n.GetMagnitudeSq=i(495),n.GetRectangleFromPoints=i(1247),n.Interpolate=i(1248),n.Invert=i(1249),n.Negative=i(1250),n.Project=i(1251),n.ProjectUnit=i(1252),n.SetMagnitude=i(1253),t.exports=n},function(t,e){t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t){return new n(t.x,t.y)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},function(t,e){t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){if(void 0===e&&(e=new n),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var r=0;r<i;r++)e.x+=t[r].x,e.y+=t[r].y;e.x/=i,e.y/=i}return e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10);t.exports=function(t,e){void 0===e&&(e=new n);for(var i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=0;a<t.length;a++){var h=t[a];h.x>i&&(i=h.x),h.x<r&&(r=h.x),h.y>s&&(s=h.y),h.y<o&&(o=h.y)}return e.x=r,e.y=o,e.width=i-r,e.height=s-o,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e,i,r){return void 0===i&&(i=0),void 0===r&&(r=new n),r.x=t.x+(e.x-t.x)*i,r.y=t.y+(e.y-t.y)*i,r}},function(t,e){t.exports=function(t){return t.setTo(t.y,t.x)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.setTo(-t.x,-t.y)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4),r=i(495);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=(t.x*e.x+t.y*e.y)/r(e);return 0!==s&&(i.x=s*e.x,i.y=s*e.y),i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.x*e.x+t.y*e.y;return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(494);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=n(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(224);n.Clone=i(1255),n.Contains=i(225),n.ContainsPoint=i(1256),n.Earcut=i(68),n.GetAABB=i(463),n.GetNumberArray=i(1257),n.GetPoints=i(464),n.Perimeter=i(465),n.Reverse=i(1258),n.Simplify=i(1259),n.Smooth=i(466),n.Translate=i(1260),t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(224);t.exports=function(t){return new n(t.points)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(225);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i<t.points.length;i++)e.push(t.points[i].x),e.push(t.points[i].y);return e}},function(t,e){t.exports=function(t){return t.points.reverse(),t}},function(t,e){function i(t,e,i){var n=e.x,r=e.y,s=i.x-n,o=i.y-r;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-r)*o)/(s*s+o*o);a>1?(n=i.x,r=i.y):a>0&&(n+=s*a,r+=o*a)}return(s=t.x-n)*s+(o=t.y-r)*o}function n(t,e){var n=t.length-1,r=[t[0]];return function t(e,n,r,s,o){for(var a,h=s,l=n+1;l<r;l++){var c=i(e[l],e[n],e[r]);c>h&&(a=l,h=c)}h>s&&(a-n>1&&t(e,n,a,s,o),o.push(e[a]),r-a>1&&t(e,a,r,s,o))}(t,0,n,e,r),r.push(t[n]),r}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var r=t.points;if(r.length>2){var s=e*e;i||(r=function(t,e){for(var i,n,r,s,o,a=t[0],h=[a],l=1,c=t.length;l<c;l++)i=t[l],r=a,s=void 0,o=void 0,s=(n=i).x-r.x,o=n.y-r.y,s*s+o*o>e&&(h.push(i),a=i);return a!==i&&h.push(i),h}(r,s)),t.setTo(n(r,s))}return t}},function(t,e){t.exports=function(t,e,i){for(var n=t.points,r=0;r<n.length;r++)n[r].x+=e,n[r].y+=i;return t}},function(t,e){t.exports=function(t){return t.width*t.height}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(56);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(234);t.exports=function(t,e){var i=n(t);return i<n(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(234);t.exports=function(t,e){var i=n(t);return i>n(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){
|
|
/**
|
|
* @author samme
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10);t.exports=function(t,e,i,r,s){return void 0===s&&(s=new n),s.setTo(Math.min(t,i),Math.min(e,r),Math.abs(t-i),Math.abs(e-r))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(187);t.exports=function(t,e,i){var r=t.centerX,s=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,r,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(10),r=i(114);t.exports=function(t,e,i){return void 0===i&&(i=new n),r(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,r=t.y,s=t.bottom,o=0;o<e.length;o++)i=Math.min(i,e[o].x),n=Math.max(n,e[o].x),r=Math.min(r,e[o].y),s=Math.max(s,e[o].y);return t.x=i,t.y=r,t.width=n-i,t.height=s-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var r=Math.min(t.y,e.y),s=Math.max(t.bottom,e.bottom);return t.y=r,t.height=s-r,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),r=Math.max(t.right,e);t.x=n,t.width=r-n;var s=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=s,t.height=o-s,t}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e){t.exports=function(t,e){return t.x<e.right&&t.right>e.x&&t.y<e.bottom&&t.bottom>e.y}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(4),r=i(35);t.exports=function(t,e,i){void 0===i&&(i=new n),e=r(e);var s=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=s>0?t.height/2:t.height/-2;return Math.abs(a*s)<Math.abs(h*o)?h=a*s/o:a=h*o/s,i.x=a+t.centerX,i.y=h+t.centerY,i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(192),r=i(497),s=i(4);t.exports=function(t,e,i){if(void 0===i&&(i=new s),r(t,e))switch(n(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},function(t,e){t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(82);n.Area=i(1288),n.BuildEquilateral=i(1289),n.BuildFromPolygon=i(1290),n.BuildRight=i(1291),n.CenterOn=i(1292),n.Centroid=i(498),n.CircumCenter=i(1293),n.CircumCircle=i(1294),n.Clone=i(1295),n.Contains=i(112),n.ContainsArray=i(232),n.ContainsPoint=i(1296),n.CopyFrom=i(1297),n.Decompose=i(489),n.Equals=i(1298),n.GetPoint=i(470),n.GetPoints=i(471),n.InCenter=i(500),n.Perimeter=i(1299),n.Offset=i(499),n.Random=i(178),n.Rotate=i(1300),n.RotateAroundPoint=i(1301),n.RotateAroundXY=i(235),t.exports=n},function(t,e){t.exports=function(t){var e=t.x1,i=t.y1,n=t.x2,r=t.y2,s=t.x3,o=t.y3;return Math.abs(((s-e)*(r-i)-(n-e)*(o-i))/2)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(82);t.exports=function(t,e,i){var r=i*(Math.sqrt(3)/2);return new n(t,e,t+i/2,e+r,t-i/2,e+r)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(68),r=i(82);t.exports=function(t,e,i,s,o){void 0===e&&(e=null),void 0===i&&(i=1),void 0===s&&(s=1),void 0===o&&(o=[]);for(var a,h,l,c,u,d,p,f,m,g=n(t,e),v=0;v<g.length;v+=3)a=g[v],h=g[v+1],l=g[v+2],c=t[2*a]*i,u=t[2*a+1]*s,d=t[2*h]*i,p=t[2*h+1]*s,f=t[2*l]*i,m=t[2*l+1]*s,o.push(new r(c,u,d,p,f,m));return o}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(82);t.exports=function(t,e,i,r){return void 0===r&&(r=i),new n(t,e,t,e-r,t+i,e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(498),r=i(499);t.exports=function(t,e,i,s){void 0===s&&(s=n);var o=s(t),a=e-o.x,h=i-o.y;return r(t,a,h)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(3);function r(t,e,i,n){return t*n-e*i}t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x3,s=t.y3,o=t.x1-i,a=t.y1-s,h=t.x2-i,l=t.y2-s,c=2*r(o,a,h,l),u=r(a,o*o+a*a,l,h*h+l*l),d=r(o,o*o+a*a,h,h*h+l*l);return e.x=i-u/c,e.y=s+d/c,e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(62);t.exports=function(t,e){void 0===e&&(e=new n);var i,r,s=t.x1,o=t.y1,a=t.x2,h=t.y2,l=t.x3,c=t.y3,u=a-s,d=h-o,p=l-s,f=c-o,m=u*(s+a)+d*(o+h),g=p*(s+l)+f*(o+c),v=2*(u*(c-h)-d*(l-a));if(Math.abs(v)<1e-6){var y=Math.min(s,a,l),x=Math.min(o,h,c);i=.5*(Math.max(s,a,l)-y),r=.5*(Math.max(o,h,c)-x),e.x=y+i,e.y=x+r,e.radius=Math.sqrt(i*i+r*r)}else e.x=(f*m-d*g)/v,e.y=(u*g-p*m)/v,i=e.x-s,r=e.y-o,e.radius=Math.sqrt(i*i+r*r);return e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(82);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(112);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(64);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),r=t.getLineC();return n(e)+n(i)+n(r)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(235),r=i(500);t.exports=function(t,e){var i=r(t);return n(t,i.x,i.y,e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(235);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(200),r=i(17),s={CreatePixelPerfectHandler:i(501),CreateInteractiveObject:i(502),Events:i(49),Gamepad:i(1303),InputManager:i(403),InputPlugin:i(1315),InputPluginCache:i(151),Keyboard:i(1316),Mouse:i(1330),Pointer:i(406),Touch:i(1331)};s=r(!1,s,n),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Axis:i(503),Button:i(504),Events:i(236),Gamepad:i(505),GamepadPlugin:i(1310),Configs:i(1311)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="down"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="up"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="connected"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="disconnected"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="down"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="up"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(9),s=i(236),o=i(505),a=i(6),h=i(151),l=i(49),c=new n({Extends:r,initialize:function(t){r.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=a(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=a(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t<this.gamepads.length;t++)this.gamepads[t].removeAllListeners()},disconnectAll:function(){for(var t=0;t<this.gamepads.length;t++)this.gamepads[t].pad.connected=!1},refreshPads:function(){var t=navigator.getGamepads();if(t)for(var e=this.gamepads,i=0;i<t.length;i++){var n=t[i];if(n){var r=n.id,s=n.index,a=e[s];if(a)a.id!==r?(a.destroy(),e[s]=new o(this,n)):a.update(n);else{var h=new o(this,n);e[s]=h,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=h):this._pad3=h:this._pad2=h:this._pad1=h}}}else this.disconnectAll()},getAll:function(){for(var t=[],e=this.gamepads,i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},getPad:function(t){for(var e=this.gamepads,i=0;i<e.length;i++)if(e[i]&&e[i].index===t)return e[i]},update:function(){if(this.enabled){this.refreshPads();var t=this.queue.length;if(0!==t)for(var e=this.queue.splice(0,t),i=0;i<t;i++){var n=e[i],r=this.getPad(n.gamepad.index);"gamepadconnected"===n.type?this.emit(s.CONNECTED,r,n):"gamepaddisconnected"===n.type&&this.emit(s.DISCONNECTED,r,n)}}},shutdown:function(){this.stopListeners(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var t=0;t<this.gamepads.length;t++)this.gamepads[t]&&this.gamepads[t].destroy();this.gamepads=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null},total:{get:function(){return this.gamepads.length}},pad1:{get:function(){return this._pad1}},pad2:{get:function(){return this._pad2}},pad3:{get:function(){return this._pad3}},pad4:{get:function(){return this._pad4}}});h.register("GamepadPlugin",c,"gamepad","gamepad","inputGamepad"),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={DUALSHOCK_4:i(1312),SNES_USB:i(1313),XBOX_360:i(1314)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(62),r=i(63),s=i(0),o=i(200),a=i(502),h=i(501),l=i(48),c=i(108),u=i(109),d=i(49),p=i(9),f=i(2),m=i(55),g=i(151),v=i(7),y=i(24),x=i(10),b=i(56),w=i(21),T=i(82),_=i(112),E=new s({Extends:p,initialize:function(t){p.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new p,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var r=this._list,s=0;s<i;s++){var o=t[s],a=r.indexOf(o);a>-1&&(r.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=r.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,n=this.manager,r=n.pointers,s=n.pointersTotal;for(i=0;i<s;i++)r[i].updateMotion();if(0===this._list.length)return!1;var o=this.pollRate;if(-1===o)return!1;if(o>0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i<s;i++){var h=0,l=r[i];this._tempZones=[],this._temp=this.hitTestPointer(l),this.sortGameObjects(this._temp,l),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),h+=this.processOverOutEvents(l),2===this.getDragState(l)&&this.processDragThresholdEvent(l,t),h>0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,r=0;r<i;r++){var s=0,a=e[r];switch(this._tempZones=[],this._temp=this.hitTestPointer(a),this.sortGameObjects(this._temp,a),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),t){case o.MOUSE_DOWN:s+=this.processDragDownEvent(a),s+=this.processDownEvents(a),s+=this.processOverOutEvents(a);break;case o.MOUSE_UP:s+=this.processDragUpEvent(a),s+=this.processUpEvents(a),s+=this.processOverOutEvents(a);break;case o.TOUCH_START:s+=this.processDragDownEvent(a),s+=this.processDownEvents(a),s+=this.processOverEvents(a);break;case o.TOUCH_END:case o.TOUCH_CANCEL:s+=this.processDragUpEvent(a),s+=this.processUpEvents(a),s+=this.processOutEvents(a);break;case o.MOUSE_MOVE:case o.TOUCH_MOVE:s+=this.processDragMoveEvent(a),s+=this.processMoveEvents(a),s+=this.processOverOutEvents(a);break;case o.MOUSE_WHEEL:s+=this.processWheelEvent(a)}s>0&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null;var n=this._draggable.indexOf(t);return n>-1&&this._draggable.splice(n,1),(n=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(n,1),(n=this._over[0].indexOf(t))>-1&&(this._over[0].splice(n,1),this.manager.resetCursor(i)),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i<e.length;i++){for(var n=e[i],r=this.manager.hitTest(t,this._list,n),s=0;s<r.length;s++){var o=r[s];o.input.dropZone&&this._tempZones.push(o)}if(r.length>0)return t.camera=n,r}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,r=this._eventContainer;n.cancelled=!1;for(var s=!1,o=0;o<i.length;o++){var a=i[o];if(a.input){if(e++,a.emit(d.GAMEOBJECT_POINTER_DOWN,t,a.input.localX,a.input.localY,r),n.cancelled||!a.input){s=!0;break}if(this.emit(d.GAMEOBJECT_DOWN,t,a,r),n.cancelled||!a.input){s=!0;break}}}return!s&&this.manager&&(t.downElement===this.manager.game.canvas?this.emit(d.POINTER_DOWN,t,i):this.emit(d.POINTER_DOWN_OUTSIDE,t)),e},getDragState:function(t){return this._dragState[t.id]},setDragState:function(t,e){this._dragState[t.id]=e},processDragThresholdEvent:function(t,e){var i=!1,n=this.dragTimeThreshold,r=this.dragDistanceThreshold;if((r>0&&l(t.x,t.y,t.downX,t.downY)>=r||n>0&&e>=t.downTime+n)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i<e.length;i++){var n=e[i],r=n.input;r.dragState=2,r.dragStartX=n.x,r.dragStartY=n.y,r.dragStartXGlobal=t.worldX,r.dragStartYGlobal=t.worldY,r.dragX=r.dragStartXGlobal-r.dragStartX,r.dragY=r.dragStartYGlobal-r.dragStartY,n.emit(d.GAMEOBJECT_DRAG_START,t,r.dragX,r.dragY),this.emit(d.DRAG_START,t,n)}return this.setDragState(t,4),e.length},processDragDownEvent:function(t){var e=this._temp;if(0===this._draggable.length||0===e.length||!t.primaryDown||0!==this.getDragState(t))return 0;this.setDragState(t,1);for(var i=[],n=0;n<e.length;n++){var r=e[n];r.input.draggable&&0===r.input.dragState&&i.push(r)}return 0===i.length?(this.setDragState(t,0),0):(i.length>1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n<i.length;n++){var r,s,o=i[n],a=o.input,h=a.target;if(h){var l=e.indexOf(h);0===l?(o.emit(d.GAMEOBJECT_DRAG_OVER,t,h),this.emit(d.DRAG_OVER,t,o,h)):l>0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var c=t.worldX-a.dragStartXGlobal,u=t.worldY-a.dragStartYGlobal,p=o.getParentRotation(),f=c*Math.cos(p)+u*Math.sin(p),m=u*Math.cos(p)-c*Math.sin(p);f*=1/o.parentContainer.scaleX,m*=1/o.parentContainer.scaleY,r=f+a.dragStartX,s=m+a.dragStartY}else r=t.worldX-a.dragX,s=t.worldY-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,r,s),this.emit(d.DRAG,t,o,r,s)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i<e.length;i++){var n=e[i],r=n.input;if(r&&2===r.dragState){r.dragState=0,r.dragX=r.localX-n.displayOriginX,r.dragY=r.localY-n.displayOriginY;var s=!1,o=r.target;o&&(n.emit(d.GAMEOBJECT_DROP,t,o),this.emit(d.DROP,t,n,o),r.target=null,s=!0),n.input&&(n.emit(d.GAMEOBJECT_DRAG_END,t,r.dragX,r.dragY,s),this.emit(d.DRAG_END,t,n,s))}}return this.setDragState(t,0),e.splice(0),0},processMoveEvents:function(t){var e=0,i=this._temp,n=this._eventData,r=this._eventContainer;n.cancelled=!1;for(var s=!1,o=0;o<i.length;o++){var a=i[o];if(a.input){if(e++,a.emit(d.GAMEOBJECT_POINTER_MOVE,t,a.input.localX,a.input.localY,r),n.cancelled||!a.input){s=!0;break}if(this.emit(d.GAMEOBJECT_MOVE,t,a,r),n.cancelled||!a.input){s=!0;break}if(this.topOnly)break}}return s||this.emit(d.POINTER_MOVE,t,i),e},processWheelEvent:function(t){var e=0,i=this._temp,n=this._eventData,r=this._eventContainer;n.cancelled=!1;for(var s=!1,o=t.deltaX,a=t.deltaY,h=t.deltaZ,l=0;l<i.length;l++){var c=i[l];if(c.input){if(e++,c.emit(d.GAMEOBJECT_POINTER_WHEEL,t,o,a,h,r),n.cancelled||!c.input){s=!0;break}if(this.emit(d.GAMEOBJECT_WHEEL,t,c,o,a,h,r),n.cancelled||!c.input){s=!0;break}}}return s||this.emit(d.POINTER_WHEEL,t,i,o,a,h),e},processOverEvents:function(t){var e=this._temp,i=0,n=e.length,r=[];if(n>0){var s=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l<n;l++){var c=e[l];if(c.input){if(r.push(c),s.setCursor(c.input),c.emit(d.GAMEOBJECT_POINTER_OVER,t,c.input.localX,c.input.localY,a),i++,o.cancelled||!c.input){h=!0;break}if(this.emit(d.GAMEOBJECT_OVER,t,c,a),o.cancelled||!c.input){h=!0;break}}}h||this.emit(d.POINTER_OVER,t,r)}return this._over[t.id]=r,i},processOutEvents:function(t){var e=this._over[t.id],i=0,n=e.length;if(n>0){var r=this.manager,s=this._eventData,o=this._eventContainer;s.cancelled=!1;var a=!1;this.sortGameObjects(e,t);for(var h=0;h<n;h++){var l=e[h];if((l=e[h]).input){if(r.resetCursor(l.input),l.emit(d.GAMEOBJECT_POINTER_OUT,t,o),i++,s.cancelled||!l.input){a=!0;break}if(this.emit(d.GAMEOBJECT_OUT,t,l,o),s.cancelled||!l.input){a=!0;break}a||this.emit(d.POINTER_OUT,t,e)}}this._over[t.id]=[]}return i},processOverOutEvents:function(t){var e,i,n=this._temp,r=[],s=[],o=[],a=this._over[t.id],h=this._drag[t.id],l=this.manager;for(e=0;e<a.length;e++)i=a[e],-1===n.indexOf(i)&&-1===h.indexOf(i)?r.push(i):o.push(i);for(e=0;e<n.length;e++)i=n[e],-1===a.indexOf(i)&&s.push(i);var c=r.length,u=0,p=this._eventData,f=this._eventContainer;p.cancelled=!1;var m=!1;if(c>0){for(this.sortGameObjects(r,t),e=0;e<c;e++)if((i=r[e]).input){if(l.resetCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OUT,t,f),u++,p.cancelled||!i.input){m=!0;break}if(this.emit(d.GAMEOBJECT_OUT,t,i,f),p.cancelled||!i.input){m=!0;break}}m||this.emit(d.POINTER_OUT,t,r)}if(c=s.length,p.cancelled=!1,m=!1,c>0){for(this.sortGameObjects(s,t),e=0;e<c;e++)if((i=s[e]).input){if(l.setCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OVER,t,i.input.localX,i.input.localY,f),u++,p.cancelled||!i.input){m=!0;break}if(this.emit(d.GAMEOBJECT_OVER,t,i,f),p.cancelled||!i.input){m=!0;break}}m||this.emit(d.POINTER_OVER,t,s)}return a=o.concat(s),this._over[t.id]=this.sortGameObjects(a,t),u},processUpEvents:function(t){var e=this._temp,i=this._eventData,n=this._eventContainer;i.cancelled=!1;for(var r=!1,s=0;s<e.length;s++){var o=e[s];if(o.input){if(o.emit(d.GAMEOBJECT_POINTER_UP,t,o.input.localX,o.input.localY,n),i.cancelled||!o.input){r=!0;break}if(this.emit(d.GAMEOBJECT_UP,t,o,n),i.cancelled||!o.input){r=!0;break}}}return!r&&this.manager&&(t.upElement===this.manager.game.canvas?this.emit(d.POINTER_UP,t,e):this.emit(d.POINTER_UP_OUTSIDE,t)),e.length},queueForInsertion:function(t){return-1===this._pendingInsertion.indexOf(t)&&-1===this._list.indexOf(t)&&this._pendingInsertion.push(t),this},queueForRemoval:function(t){return this._pendingRemoval.push(t),this},setDraggable:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];n.input.draggable=e;var r=this._draggable.indexOf(n);e&&-1===r?this._draggable.push(n):!e&&r>-1&&this._draggable.splice(r,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,r=!1,s=!1,o=!1,h=!1,l=!0;if(v(e)){var c=e;e=f(c,"hitArea",null),i=f(c,"hitAreaCallback",null),n=f(c,"draggable",!1),r=f(c,"dropZone",!1),s=f(c,"cursor",!1),o=f(c,"useHandCursor",!1),h=f(c,"pixelPerfect",!1);var u=f(c,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(u)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d<t.length;d++){var p=t[d];if(h&&"Container"===p.type)console.warn("Cannot pixelPerfect test a Container. Use a custom callback.");else{var m=p.input?p.input:a(p,e,i);m.customHitArea=l,m.dropZone=r,m.cursor=o?"pointer":s,p.input=m,n&&this.setDraggable(p),this.queueForInsertion(p)}}return this},setHitAreaCircle:function(t,e,i,s,o){void 0===o&&(o=r);var a=new n(e,i,s);return this.setHitArea(t,a,o)},setHitAreaEllipse:function(t,e,i,n,r,s){void 0===s&&(s=u);var o=new c(e,i,n,r);return this.setHitArea(t,o,s)},setHitAreaFromTexture:function(t,e){void 0===e&&(e=b),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i],r=n.frame,s=0,o=0;n.width?(s=n.width,o=n.height):r&&(s=r.realWidth,o=r.realHeight),"Container"!==n.type||0!==s&&0!==o?0!==s&&0!==o&&(n.input=a(n,new x(0,0,s,o),e),this.queueForInsertion(n)):console.warn("Container.setInteractive must specify a Shape or call setSize() first")}return this},setHitAreaRectangle:function(t,e,i,n,r,s){void 0===s&&(s=b);var o=new x(e,i,n,r);return this.setHitArea(t,o,s)},setHitAreaTriangle:function(t,e,i,n,r,s,o,a){void 0===a&&(a=_);var h=new T(e,i,n,r,s,o);return this.setHitArea(t,h,a)},enableDebug:function(t,e){void 0===e&&(e=65280);var i=t.input;if(!i||!i.hitArea)return this;var n=i.hitArea,r=n.type,s=i.hitAreaDebug,o=this.systems.add,a=this.systems.updateList;s&&(a.remove(s),s.destroy(),s=null);var h=0,l=0;switch(r){case m.CIRCLE:s=o.arc(0,0,n.radius),h=n.x-n.radius,l=n.y-n.radius;break;case m.ELLIPSE:s=o.ellipse(0,0,n.width,n.height),h=n.x-n.width/2,l=n.y-n.height/2;break;case m.LINE:s=o.line(0,0,n.x1,n.y1,n.x2,n.y2);break;case m.POLYGON:s=o.polygon(0,0,n.points);break;case m.RECTANGLE:s=o.rectangle(0,0,n.width,n.height),h=n.x,l=n.y;break;case m.TRIANGLE:s=o.triangle(0,0,n.x1,n.y1,n.x2,n.y2,n.x3,n.y3)}return s&&(s.isFilled=!1,s.preUpdate=function(){s.setStrokeStyle(1/t.scale,e),s.setDisplayOrigin(t.displayOriginX,t.displayOriginY);var i=t.x,n=t.y,r=t.rotation,o=t.scaleX,a=t.scaleY;if(t.parentContainer){var c=t.getWorldTransformMatrix();i=c.tx,n=c.ty,r=c.rotation,o=c.scaleX,a=c.scaleY}s.setRotation(r),s.setScale(o,a),s.setPosition(i+h,n+l),s.setScrollFactor(t.scrollFactorX,t.scrollFactorY),s.setDepth(t.depth)},a.add(s),i.hitAreaDebug=s),this},removeDebug:function(t){var e=t.input;if(e&&e.hitAreaDebug){var i=e.hitAreaDebug;this.systems.updateList.remove(i),i.destroy(),e.hitAreaDebug=null}return this},setPollAlways:function(){return this.setPollRate(0)},setPollOnMove:function(){return this.setPollRate(-1)},setPollRate:function(t){return this.pollRate=t,this._pollTimer=0,this},setGlobalTopOnly:function(t){return this.manager.globalTopOnly=t,this},setTopOnly:function(t){return this.topOnly=t,this},sortGameObjects:function(t,e){if(t.length<2)return t;var i=e.camera.renderList;return t.sort((function(t,e){return i.indexOf(e)-i.indexOf(t)}))},sortDropZones:function(t){return t.length<2?t:(this.scene.sys.depthSort(),t.sort(this.sortDropZoneHandler.bind(this)))},sortDropZoneHandler:function(t,e){if(t.parentContainer||e.parentContainer){if(t.parentContainer===e.parentContainer)return e.parentContainer.getIndex(e)-t.parentContainer.getIndex(t);if(t.parentContainer===e)return-1;if(e.parentContainer===t)return 1;for(var i=t.getIndexList(),n=e.getIndexList(),r=Math.min(i.length,n.length),s=0;s<r;s++){var o=i[s],a=n[s];if(o!==a)return a-o}return n.length-i.length}return this.displayList.getIndex(e)-this.displayList.getIndex(t)},stopPropagation:function(){return this.manager._tempSkip=!0,this},addPointer:function(t){return this.manager.addPointer(t)},setDefaultCursor:function(t){return this.manager.setDefaultCursor(t),this},transitionIn:function(){this.enabled=this.settings.transitionAllowInput},transitionComplete:function(){this.settings.transitionAllowInput||(this.enabled=!0)},transitionOut:function(){this.enabled=this.settings.transitionAllowInput},shutdown:function(){this.pluginEvents.emit(d.SHUTDOWN),this._temp.length=0,this._list.length=0,this._draggable.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0,this._dragState.length=0;for(var t=0;t<10;t++)this._drag[t]=[],this._over[t]=[];this.removeAllListeners();var e=this.manager;e.canvas.style.cursor=e.defaultCursor;var i=this.systems.events;i.off(w.TRANSITION_START,this.transitionIn,this),i.off(w.TRANSITION_OUT,this.transitionOut,this),i.off(w.TRANSITION_COMPLETE,this.transitionComplete,this),i.off(w.PRE_UPDATE,this.preUpdate,this),e.events.off(d.GAME_OUT,this.onGameOut,this),e.events.off(d.GAME_OVER,this.onGameOver,this),i.off(w.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.pluginEvents.emit(d.DESTROY),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off(w.START,this.start,this),this.scene=null,this.cameras=null,this.manager=null,this.events=null,this.mouse=null},x:{get:function(){return this.manager.activePointer.x}},y:{get:function(){return this.manager.activePointer.y}},isOver:{get:function(){return this.manager.isOver}},mousePointer:{get:function(){return this.manager.mousePointer}},activePointer:{get:function(){return this.manager.activePointer}},pointer1:{get:function(){return this.manager.pointers[1]}},pointer2:{get:function(){return this.manager.pointers[2]}},pointer3:{get:function(){return this.manager.pointers[3]}},pointer4:{get:function(){return this.manager.pointers[4]}},pointer5:{get:function(){return this.manager.pointers[5]}},pointer6:{get:function(){return this.manager.pointers[6]}},pointer7:{get:function(){return this.manager.pointers[7]}},pointer8:{get:function(){return this.manager.pointers[8]}},pointer9:{get:function(){return this.manager.pointers[9]}},pointer10:{get:function(){return this.manager.pointers[10]}}});y.register("InputPlugin",E,"input"),t.exports=E},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Events:i(152),KeyboardManager:i(404),KeyboardPlugin:i(1324),Key:i(506),KeyCodes:i(141),KeyCombo:i(507),AdvanceKeyCombo:i(509),ProcessKeyCombo:i(508),ResetKeyCombo:i(510),JustDown:i(1326),JustUp:i(1327),DownDuration:i(1328),UpDuration:i(1329)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="keydown"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="keyup"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="keycombomatch"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="down"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="keydown-"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="keyup-"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="up"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(9),s=i(152),o=i(22),a=i(6),h=i(49),l=i(151),c=i(506),u=i(141),d=i(507),p=i(1325),f=i(21),m=i(76),g=new n({Extends:r,initialize:function(t){r.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this),this.scene.sys.events.on(f.PAUSE,this.resetKeys,this),this.scene.sys.events.on(f.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:u.UP,down:u.DOWN,left:u.LEFT,right:u.RIGHT,space:u.SPACE,shift:u.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var r=0;r<t.length;r++){var s=t[r].trim();s&&(n[s]=this.addKey(s,e,i))}}else for(var o in t)n[o]=this.addKey(t[o],e,i);return n},addKey:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n=this.keys;if(t instanceof c){var r=n.indexOf(t);return r>-1?n[r]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=u[t.toUpperCase()]),n[t]||(n[t]=new c(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof c){var r=n.indexOf(t);r>-1&&(i=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=u[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},removeAllKeys:function(t){for(var e=this.keys,i=0;i<e.length;i++){var n=e[i];n&&(e[i]=void 0,t&&n.destroy())}return this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(void 0===e&&(e=0),this.enabled&&t.isDown){var i=m(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n<e;n++){var r=t[n],o=r.keyCode,a=i[o],h=!1;void 0===r.cancelled&&(r.cancelled=0,r.stopImmediatePropagation=function(){r.cancelled=1},r.stopPropagation=function(){r.cancelled=-1}),-1!==r.cancelled&&(o===this.prevCode&&r.timeStamp===this.prevTime&&r.type===this.prevType||(this.prevCode=o,this.prevTime=r.timeStamp,this.prevType=r.type,"keydown"===r.type?(a&&(h=a.isDown,a.onDown(r)),r.cancelled||a&&h||(p[o]&&this.emit(s.KEY_DOWN+p[o],r),r.cancelled||this.emit(s.ANY_KEY_DOWN,r))):(a&&a.onUp(r),r.cancelled||(p[o]&&this.emit(s.KEY_UP+p[o],r),r.cancelled||this.emit(s.ANY_KEY_UP,r))),1===r.cancelled&&(r.cancelled=0)))}},resetKeys:function(){for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].reset();return this},shutdown:function(){this.resetKeys(),this.sceneInputPlugin.manager.events.off(h.MANAGER_PROCESS,this.update,this),this.game.events.off(o.BLUR,this.resetKeys),this.scene.sys.events.off(f.PAUSE,this.resetKeys,this),this.scene.sys.events.off(f.SLEEP,this.resetKeys,this),this.removeAllListeners(),this.queue=[]},destroy:function(){this.shutdown();for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].destroy();this.keys=[],this.combos=[],this.queue=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.manager=null},time:{get:function(){return this.sceneInputPlugin.manager.time}}});l.register("KeyboardPlugin",g,"keyboard","keyboard","inputKeyboard"),t.exports=g},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(141),r={};for(var s in n)r[n[s]]=s;t.exports=r},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i<e}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i<e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={MouseManager:i(405)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={TouchManager:i(407)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(20),r=i(17),s={Events:i(91),FileTypes:i(1333),File:i(23),FileTypesManager:i(8),GetURL:i(153),LoaderPlugin:i(1359),MergeXHRSettings:i(237),MultiFile:i(47),XHRLoader:i(511),XHRSettings:i(154)};s=r(!1,s,n),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={AnimationJSONFile:i(1334),AsepriteFile:i(1335),AtlasJSONFile:i(1336),AtlasXMLFile:i(1337),AudioFile:i(512),AudioSpriteFile:i(1338),BinaryFile:i(1339),BitmapFontFile:i(1340),CSSFile:i(1341),GLSLFile:i(1342),HTML5AudioFile:i(513),HTMLFile:i(1343),HTMLTextureFile:i(1344),ImageFile:i(70),JSONFile:i(59),MultiAtlasFile:i(1345),MultiScriptFile:i(1346),OBJFile:i(1347),PackFile:i(1348),PluginFile:i(1349),SceneFile:i(1350),ScenePluginFile:i(1351),ScriptFile:i(514),SpriteSheetFile:i(1352),SVGFile:i(1353),TextFile:i(239),TilemapCSVFile:i(1354),TilemapImpactFile:i(1355),TilemapJSONFile:i(1356),UnityAtlasFile:i(1357),VideoFile:i(1358),XMLFile:i(238)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(59),o=i(91),a=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,n,r),this.type="animationJSON"},onProcess:function(){this.loader.once(o.POST_PROCESS,this.onLoadComplete,this),s.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});r.register("animation",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new a(this,t[r]));else this.addFile(new a(this,t,e,n,i));return this})),t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(59),l=i(47),c=new n({Extends:l,initialize:function(t,e,i,n,r,c){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new h(t,{key:e,url:s(p,"atlasURL"),extension:s(p,"atlasExtension","json"),xhrSettings:s(p,"atlasXhrSettings")})}else u=new o(t,e,i,r),d=new h(t,e,n,c);u.linkFile?l.call(this,t,"atlasjson",e,[u,d,u.linkFile]):l.call(this,t,"atlasjson",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});r.register("aseprite",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o<t.length;o++)s=new c(this,t[o]),this.addFile(s.files);else s=new c(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(59),l=i(47),c=new n({Extends:l,initialize:function(t,e,i,n,r,c){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new h(t,{key:e,url:s(p,"atlasURL"),extension:s(p,"atlasExtension","json"),xhrSettings:s(p,"atlasXhrSettings")})}else u=new o(t,e,i,r),d=new h(t,e,n,c);u.linkFile?l.call(this,t,"atlasjson",e,[u,d,u.linkFile]):l.call(this,t,"atlasjson",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});r.register("atlas",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o<t.length;o++)s=new c(this,t[o]),this.addFile(s.files);else s=new c(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(47),l=i(238),c=new n({Extends:h,initialize:function(t,e,i,n,r,c){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new l(t,{key:e,url:s(p,"atlasURL"),extension:s(p,"atlasExtension","xml"),xhrSettings:s(p,"atlasXhrSettings")})}else u=new o(t,e,i,r),d=new l(t,e,n,c);u.linkFile?h.call(this,t,"atlasxml",e,[u,d,u.linkFile]):h.call(this,t,"atlasxml",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});r.register("atlasXML",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o<t.length;o++)s=new c(this,t[o]),this.addFile(s.files);else s=new c(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(512),r=i(0),s=i(8),o=i(2),a=i(7),h=i(59),l=i(47),c=new r({Extends:l,initialize:function(t,e,i,r,s,c,u){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),r=o(d,"audioURL"),s=o(d,"audioConfig"),c=o(d,"audioXhrSettings"),u=o(d,"jsonXhrSettings")}var p;if(r){var f=n.create(t,e,r,s,c);f&&(p=new h(t,e,i,u),l.call(this,t,"audiosprite",e,[f,p]),this.config.resourceLoad=!1)}else p=new h(t,e,i,u),l.call(this,t,"audiosprite",e,[p]),this.config.resourceLoad=!0,this.config.audioConfig=s,this.config.audioXhrSettings=c},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=o(this.config,"audioConfig"),r=o(this.config,"audioXhrSettings"),s=n.create(this.loader,t.key,e,i,r);s&&(this.addToMultiFile(s),this.loader.addFile(s))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});s.register("audioSprite",(function(t,e,i,n,r,s){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var u=0;u<t.length;u++)(o=new c(this,t[u])).files&&this.addFile(o.files);else(o=new c(this,t,e,i,n,r,s)).files&&this.addFile(o.files);return this}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,r){var o="bin";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),n=a(l,"xhrSettings"),o=a(l,"extension",o),r=a(l,"dataType",r)}var c={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:n,config:{dataType:r}};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,n,i));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(47),l=i(209),c=i(238),u=new n({Extends:h,initialize:function(t,e,i,n,r,l){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new c(t,{key:e,url:s(p,"fontDataURL"),extension:s(p,"fontDataExtension","xml"),xhrSettings:s(p,"fontDataXhrSettings")})}else u=new o(t,e,i,r),d=new c(t,e,n,l);u.linkFile?h.call(this,t,"bitmapfont",e,[u,d,u.linkFile]):h.call(this,t,"bitmapfont",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.pendingDestroy();var i=t.cache.get(t.key),n=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:n,texture:t.key,frame:null}),this.complete=!0}}});r.register("bitmapFont",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o<t.length;o++)s=new u(this,t[o]),this.addFile(s.files);else s=new u(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="css";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"script",cache:!1,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("css",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=i(390),c=new n({Extends:s,initialize:function(t,e,i,n,r){var o="glsl";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),n=a(l,"shaderType","fragment"),r=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===n&&(n="fragment");var c={type:"glsl",cache:t.cacheManager.shader,extension:o,responseType:"text",key:e,url:i,config:{shaderType:n},xhrSettings:r};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),n=this.getShaderType(e.header),r=this.getShaderUniforms(e.header),s=e.shader;if(this.cache.has(i)){var o=this.cache.get(i);"fragment"===n?o.fragmentSrc=s:o.vertexSrc=s,o.uniforms||(o.uniforms=r)}else"fragment"===n?this.cache.add(i,new l(i,s,"",r)):this.cache.add(i,new l(i,"",s,r));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data));this.pendingDestroy()},getShaderName:function(t){for(var e=0;e<t.length;e++){var i=t[e].trim();if("name:"===i.substring(0,5))return i.substring(5).trim()}return this.key},getShaderType:function(t){for(var e=0;e<t.length;e++){var i=t[e].trim();if("type:"===i.substring(0,5))return i.substring(5).trim()}return this.config.shaderType},getShaderUniforms:function(t){for(var e={},i=0;i<t.length;i++){var n=t[i].trim();if("uniform."===n.substring(0,8)){var r=n.indexOf(":");if(r){var s=n.substring(8,r);try{e[s]=JSON.parse(n.substring(r+1))}catch(t){console.warn("Invalid uniform JSON: "+s)}}}}return e},extractBlock:function(t,e){for(var i=-1,n=-1,r=-1,s=!1,o=!1,a=[],h=[],l=e;l<t.length;l++){var c=t[l].trim();if("---"===c)if(-1===i)i=l,s=!0;else{if(!s){o=!1;break}n=l,s=!1,o=!0}else s?a.push(c):o&&(h.push(c),r=l)}return s||-1===n?null:{header:a,shader:h.join("\n"),offset:r}}});o.register("glsl",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new c(this,t[r]));else this.addFile(new c(this,t,e,i,n));return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="html";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"text",cache:t.cacheManager.html,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,r,o){void 0===n&&(n=512),void 0===r&&(r=512);var l="html";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),o=a(c,"xhrSettings"),l=a(c,"extension",l),n=a(c,"width",n),r=a(c,"height",r)}var u={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:n,height:r}};s.call(this,t,u)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push('<svg width="'+t+'px" height="'+e+'px" viewBox="0 0 '+t+" "+e+'" xmlns="http://www.w3.org/2000/svg">'),i.push('<foreignObject width="100%" height="100%">'),i.push('<body xmlns="http://www.w3.org/1999/xhtml">'),i.push(this.xhrLoader.responseText),i.push("</body>"),i.push("</foreignObject>"),i.push("</svg>");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=r.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){s.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(o.data),o.onProcessError()},s.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",(function(t,e,i,n,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i,n,r));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(59),l=i(47),c=new n({Extends:l,initialize:function(t,e,i,n,r,o,c){if(a(e)){var u=e;e=s(u,"key"),i=s(u,"url",!1)?s(u,"url"):s(u,"atlasURL"),o=s(u,"xhrSettings"),n=s(u,"path"),r=s(u,"baseURL"),c=s(u,"textureXhrSettings")}var d=new h(t,e,i,o);l.call(this,t,"multiatlas",e,[d]),this.config.path=n,this.config.baseURL=r,this.config.textureXhrSettings=c},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,n=this.loader,r=n.baseURL,a=n.path,h=n.prefix,l=s(i,"baseURL",this.baseURL),c=s(i,"path",this.path),u=s(i,"prefix",this.prefix),d=s(i,"textureXhrSettings");n.setBaseURL(l),n.setPath(c),n.setPrefix(u);for(var p=0;p<e.length;p++){var f=e[p].image,m="MA"+this.multiKeyIndex+"_"+f,g=new o(n,m,f,d);if(this.addToMultiFile(g),n.addFile(g),e[p].normalMap){var v=new o(n,m,e[p].normalMap,d);v.type="normalMap",g.setLink(v),this.addToMultiFile(v),n.addFile(v)}}n.setBaseURL(r),n.setPath(a),n.setPrefix(h)}},addToCache:function(){if(this.isReadyToProcess()){for(var t=this.files[0],e=[],i=[],n=[],r=1;r<this.files.length;r++){var s=this.files[r];if("normalMap"!==s.type)for(var o=s.key.indexOf("_"),a=s.key.substr(o+1),h=s.data,l=0;l<t.data.textures.length;l++){var c=t.data.textures[l];if(c.image===a){i.push(h),e.push(c),s.linkFile&&n.push(s.linkFile.data);break}}}for(0===n.length&&(n=void 0),this.loader.textureManager.addAtlasJSONArray(this.key,i,e,n),this.complete=!0,r=0;r<this.files.length;r++)this.files[r].pendingDestroy()}}});r.register("multiatlas",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o<t.length;o++)s=new c(this,t[o]),this.addFile(s.files);else s=new c(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(2),o=i(7),a=i(47),h=i(514),l=new n({Extends:a,initialize:function(t,e,i,n){var r="js",l=[];if(o(e)){var c=e;e=s(c,"key"),i=s(c,"url"),n=s(c,"xhrSettings"),r=s(c,"extension",r)}Array.isArray(i)||(i=[i]);for(var u=0;u<i.length;u++){var d=new h(t,{key:e+"_"+u.toString(),url:i[u],extension:r,xhrSettings:n});d.onProcess=function(){this.onProcessComplete()},l.push(d)}a.call(this,t,"scripts",e,l)},addToCache:function(){if(this.isReadyToProcess()){for(var t=0;t<this.files.length;t++){var e=this.files[t];e.data=document.createElement("script"),e.data.language="javascript",e.data.type="text/javascript",e.data.defer=!1,e.data.text=e.xhrLoader.responseText,document.head.appendChild(e.data)}this.complete=!0}}});r.register("scripts",(function(t,e,i){var n;if(Array.isArray(t))for(var r=0;r<t.length;r++)n=new l(this,t[r]),this.addFile(n.files);else n=new l(this,t,e,i),this.addFile(n.files);return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(2),o=i(7),a=i(47),h=i(492),l=i(493),c=i(239),u=new n({Extends:a,initialize:function(t,e,i,n,r,h){var l,u,d=t.cacheManager.obj;if(o(e)){var p=e;e=s(p,"key"),l=new c(t,{key:e,type:"obj",cache:d,url:s(p,"url"),extension:s(p,"extension","obj"),xhrSettings:s(p,"xhrSettings"),config:{flipUV:s(p,"flipUV",r)}}),(n=s(p,"matURL"))&&(u=new c(t,{key:e,type:"mat",cache:d,url:n,extension:s(p,"matExtension","mat"),xhrSettings:s(p,"xhrSettings")}))}else l=new c(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:r}}),n&&(u=new c(t,{key:e,url:n,type:"mat",cache:d,extension:"mat",xhrSettings:h}));a.call(this,t,"obj",e,[l,u])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});r.register("obj",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o<t.length;o++)s=new u(this,t[o]),this.addFile(s.files);else s=new u(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(8),o=i(59),a=new n({Extends:o,initialize:function(t,e,i,n,r){o.call(this,t,e,i,n,r),this.type="packfile"},onProcess:function(){this.state!==r.FILE_POPULATED&&(this.state=r.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});s.register("pack",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new a(this,t[r]));else this.addFile(new a(this,t,e,n,i));return this})),t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,o,l){var c="js";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),l=a(u,"xhrSettings"),c=a(u,"extension",c),n=a(u,"start"),o=a(u,"mapping")}var d={type:"plugin",cache:!1,extension:c,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:n,mapping:o}};s.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=r.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=a(e,"start",!1),n=a(e,"mapping",null);if(this.state===r.FILE_POPULATED)t.install(this.key,this.data,i,n);else{this.state=r.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var s=t.install(this.key,window[this.key],i,n);(i||n)&&(this.loader.systems[n]=s,this.loader.scene[n]=s)}this.onProcessComplete()}});o.register("plugin",(function(t,e,i,n,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i,n,r));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"text",extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});o.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,o,l){var c="js";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),l=a(u,"xhrSettings"),c=a(u,"extension",c),n=a(u,"systemKey"),o=a(u,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:c,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:n,sceneKey:o}};s.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=r.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,n=a(e,"systemKey",i),s=a(e,"sceneKey",i);this.state===r.FILE_POPULATED?t.installScenePlugin(n,this.data,s,this.loader.scene,!0):(this.state=r.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(n,window[this.key],s,this.loader.scene,!0)),this.onProcessComplete()}});o.register("scenePlugin",(function(t,e,i,n,r){if(Array.isArray(t))for(var s=0;s<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i,n,r));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(70),o=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,r,n),this.type="spritesheet"},addToCache:function(){var t=this.cache.addSpriteSheet(this.key,this.data,this.config);this.pendingDestroy(t)}});r.register("spritesheet",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new o(this,t[r]));else this.addFile(new o(this,t,e,i,n));return this})),t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,r){var o="svg";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),n=a(l,"svgConfig",{}),r=a(l,"xhrSettings"),o=a(l,"extension",o)}var c={type:"svg",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:r,config:{width:a(n,"width"),height:a(n,"height"),scale:a(n,"scale")}};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,n=this.config.height,o=this.config.scale;t:if(i&&n||o){var a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=a.hasAttribute("viewBox"),l=parseFloat(a.getAttribute("width")),c=parseFloat(a.getAttribute("height"));if(!h&&l&&c)a.setAttribute("viewBox","0 0 "+l+" "+c);else if(h&&!l&&!c){var u=a.getAttribute("viewBox").split(/\s+|,/);l=u[2],c=u[3]}if(o){if(!l||!c)break t;i=l*o,n=c*o}a.setAttribute("width",i.toString()+"px"),a.setAttribute("height",n.toString()+"px"),e=[(new XMLSerializer).serializeToString(a)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var p=this,f=!1;this.data.onload=function(){f||s.revokeObjectURL(p.data),p.onProcessComplete()},this.data.onerror=function(){f?p.onProcessError():(f=!0,s.revokeObjectURL(p.data),p.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},s.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("svg",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i,n));return this})),t.exports=l},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=i(39),c=new n({Extends:s,initialize:function(t,e,i,n){var r="csv";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var c={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,c),this.tilemapFormat=l.CSV},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});o.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new c(this,t[n]));else this.addFile(new c(this,t,e,i));return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(59),o=i(39),a=new n({Extends:s,initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});r.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this})),t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(59),o=i(39),a=new n({Extends:s,initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});r.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this})),t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(47),l=i(239),c=new n({Extends:h,initialize:function(t,e,i,n,r,c){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new l(t,{key:e,url:s(p,"atlasURL"),extension:s(p,"atlasExtension","txt"),xhrSettings:s(p,"atlasXhrSettings")})}else u=new o(t,e,i,r),d=new l(t,e,n,c);u.linkFile?h.call(this,t,"unityatlas",e,[u,d,u.linkFile]):h.call(this,t,"unityatlas",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});r.register("unityAtlas",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o<t.length;o++)s=new c(this,t[o]),this.addFile(s.files);else s=new c(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(23),o=i(8),a=i(153),h=i(2),l=i(7),c=new n({Extends:s,initialize:function(t,e,i,n,r,o,a){void 0===n&&(n="loadeddata"),void 0===r&&(r=!1),void 0===o&&(o=!1),"loadeddata"!==n&&"canplay"!==n&&"canplaythrough"!==n&&(n="loadeddata");var h={type:"video",cache:t.cacheManager.video,extension:i.type,responseType:"blob",key:e,url:i.url,xhrSettings:a,config:{loadEvent:n,asBlob:r,noAudio:o}};this.onLoadCallback=this.onVideoLoadHandler.bind(this),this.onErrorCallback=this.onVideoErrorHandler.bind(this),s.call(this,t,h)},onProcess:function(){if(this.state=r.FILE_PROCESSING,this.config.asBlob){var t=this.createVideoElement();this.data=t;var e=this;this.data.onloadeddata=function(){e.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(e.data),e.onProcessError()},s.createObjectURL(t,this.xhrLoader.response,""),t.load()}else this.onProcessComplete()},createVideoElement:function(){var t=document.createElement("video");return t.controls=!1,t.crossOrigin=this.loader.crossOrigin,this.config.noAudio&&(t.muted=!0,t.defaultMuted=!0,t.setAttribute("autoplay","autoplay")),t.setAttribute("playsinline","playsinline"),t.setAttribute("preload","auto"),t},onVideoLoadHandler:function(t){var e=t.target;e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0),this.data=e,this.resetXHR(),this.loader.nextFile(this,!0)},onVideoErrorHandler:function(t){var e=t.target;e&&(e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0)),this.resetXHR(),this.loader.nextFile(this,!1)},load:function(){var t=this.config.loadEvent;if(this.config.asBlob)s.prototype.load.call(this);else{this.percentComplete=0;var e=this.createVideoElement();e.addEventListener(t,this.onLoadCallback,!0),e.addEventListener("error",this.onErrorCallback,!0),e.src=a(this,this.loader.baseURL),e.load()}}});c.create=function(t,e,i,n,r,s,o){var a=t.systems.game;l(e)&&(i=h(e,"url",[]),n=h(e,"loadEvent","loadeddata"),r=h(e,"asBlob",!1),s=h(e,"noAudio",!1),o=h(e,"xhrSettings"));var u=c.getVideoURL(a,i);if(u)return new c(t,e,u,n,r,s,o)},c.getVideoURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n,r=h(e[i],"url",e[i]);if(0===r.indexOf("blob:"))return{url:r,type:""};if(n=0===r.indexOf("data:")?r.split(",")[0].match(/\/(.*?);/):r.match(/\.([a-zA-Z0-9]+)($|\?)/),n=h(e[i],"type",n?n[1]:"").toLowerCase(),t.device.video[n])return{url:r,type:n}}return null},o.register("video",(function(t,e,i,n,r,s){var o;if(Array.isArray(t))for(var a=0;a<t.length;a++)(o=c.create(this,t[a]))&&this.addFile(o);else(o=c.create(this,t,e,i,n,r,s))&&this.addFile(o);return this})),t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(20),s=i(148),o=i(9),a=i(91),h=i(8),l=i(2),c=i(24),u=i(21),d=i(154),p=new n({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=d(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.totalToLoad=0,this.progress=0,this.list=new s,this.inflight=new s,this.queue=new s,this._deleteQueue=new s,this.totalFailed=0,this.totalComplete=0,this.state=r.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(u.BOOT,this.boot,this),t.sys.events.on(u.START,this.pluginStart,this)},boot:function(){this.systems.events.once(u.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(u.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];this.keyExists(i)||(this.list.set(i),this.emit(a.ADD,i.key,i.type,this,i),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(t){var e=t.hasCacheConflict();return e||this.list.iterate((function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1})),!e&&this.isLoading()&&(this.inflight.iterate((function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1})),this.queue.iterate((function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1}))),e},addPack:function(t,e){e&&t.hasOwnProperty(e)&&(t={packKey:t[e]});var i=0,n=this.baseURL,r=this.path,s=this.prefix;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=t[o],h=l(a,"baseURL",n),c=l(a,"path",r),u=l(a,"prefix",s),d=l(a,"files",null),p=l(a,"defaultType","void");if(Array.isArray(d)){this.setBaseURL(h),this.setPath(c),this.setPrefix(u);for(var f=0;f<d.length;f++){var m=d[f],g=m.hasOwnProperty("type")?m.type:p;this[g]&&(this[g](m),i++)}}}return this.setBaseURL(n),this.setPath(r),this.setPrefix(s),i>0},isLoading:function(){return this.state===r.LOADER_LOADING||this.state===r.LOADER_PROCESSING},isReady:function(){return this.state===r.LOADER_IDLE||this.state===r.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=r.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(u.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===r.LOADER_LOADING&&this.list.size>0&&this.inflight.size<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.each((function(t){if((t.state===r.FILE_POPULATED||t.state===r.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.set(t),this.list.delete(t),t.crossOrigin||(t.crossOrigin=this.crossOrigin),t.load()),this.inflight.size===this.maxParallelDownloads)return!1}),this)},nextFile:function(t,e){this.inflight&&(this.inflight.delete(t),this.updateProgress(),e?(this.totalComplete++,this.queue.set(t),this.emit(a.FILE_LOAD,t),t.onProcess()):(this.totalFailed++,this._deleteQueue.set(t),this.emit(a.FILE_LOAD_ERROR,t),this.fileProcessComplete(t)))},fileProcessComplete:function(t){this.scene&&this.systems&&this.systems.game&&!this.systems.game.pendingDestroy&&(t.state===r.FILE_ERRORED?t.multiFile&&t.multiFile.onFileFailed(t):t.state===r.FILE_COMPLETE&&(t.multiFile?t.multiFile.isReadyToProcess()&&t.multiFile.addToCache():t.addToCache()),this.queue.delete(t),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete())},loadComplete:function(){this.emit(a.POST_PROCESS,this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=r.LOADER_COMPLETE,this.systems.events.off(u.UPDATE,this.update,this),this._deleteQueue.iterateLocal("destroy"),this._deleteQueue.clear(),this.emit(a.COMPLETE,this,this.totalComplete,this.totalFailed)},flagForRemoval:function(t){this._deleteQueue.set(t)},saveJSON:function(t,e){return this.save(JSON.stringify(t),e)},save:function(t,e,i){void 0===e&&(e="file.json"),void 0===i&&(i="application/json");var n=new Blob([t],{type:i}),r=URL.createObjectURL(n),s=document.createElement("a");return s.download=e,s.textContent="Download "+e,s.href=r,s.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var t=this.systems.game.config,e=this.systems.settings.loader;this.setBaseURL(l(e,"baseURL",t.loaderBaseURL)),this.setPath(l(e,"path",t.loaderPath)),this.setPrefix(l(e,"prefix",t.loaderPrefix)),this.state=r.LOADER_IDLE},shutdown:function(){this.reset(),this.state=r.LOADER_SHUTDOWN,this.systems.events.off(u.UPDATE,this.update,this),this.systems.events.off(u.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.state=r.LOADER_DESTROYED,this.systems.events.off(u.UPDATE,this.update,this),this.systems.events.off(u.START,this.pluginStart,this),this.list=null,this.inflight=null,this.queue=null,this.scene=null,this.systems=null,this.textureManager=null,this.cacheManager=null,this.sceneManager=null}});c.register("Loader",p,"load"),t.exports=p},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(60),r=i(17),s={ArcadePhysics:i(1361),Body:i(521),Collider:i(522),Components:i(240),Events:i(242),Factory:i(515),GetOverlapX:i(243),GetOverlapY:i(244),SeparateX:i(531),SeparateY:i(532),Group:i(518),Image:i(516),Sprite:i(155),StaticBody:i(533),StaticGroup:i(519),Tilemap:i(1385),World:i(520)};s=r(!1,s,n),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(35),s=i(48),o=i(347),a=i(515),h=i(2),l=i(143),c=i(517),u=i(241),d=i(24),p=i(21),f=i(3),m=i(520),g=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once(p.BOOT,this.boot,this),t.sys.events.on(p.START,this.start,this)},boot:function(){this.world=new m(this.scene,this.config),this.add=new a(this.world),this.systems.events.once(p.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new m(this.scene,this.config),this.add=new a(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(p.UPDATE,this.world.update,this.world),t.on(p.POST_UPDATE,this.world.postUpdate,this.world),t.once(p.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(p.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(p.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},overlap:function(t,e,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,n,r,!0)},collide:function(t,e,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,n,r,!1)},collideTiles:function(t,e,i,n,r){return this.world.collideTiles(t,e,i,n,r)},overlapTiles:function(t,e,i,n,r){return this.world.overlapTiles(t,e,i,n,r)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,n,r,s){void 0===n&&(n=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,n),void 0!==r&&void 0!==s&&t.body.maxVelocity.set(r,s),o},accelerateToObject:function(t,e,i,n,r){return this.accelerateTo(t,e.x,e.y,i,n,r)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,n=null,r=t.x,s=t.y,a=e.length,h=0;h<a;h++){var l=e[h],c=l.body||l;if(t!==l&&t!==c&&t!==c.gameObject&&t!==c.center){var u=o(r,s,c.center.x,c.center.y);u<i&&(n=l,i=u)}}return n},furthest:function(t,e){e||(e=this.world.bodies.entries);for(var i=-1,n=null,r=t.x,s=t.y,a=e.length,h=0;h<a;h++){var l=e[h],c=l.body||l;if(t!==l&&t!==c&&t!==c.gameObject&&t!==c.center){var u=o(r,s,c.center.x,c.center.y);u>i&&(n=l,i=u)}}return n},moveTo:function(t,e,i,n,r){void 0===n&&(n=60),void 0===r&&(r=0);var o=Math.atan2(i-t.y,e-t.x);return r>0&&(n=s(t.x,t.y,e,i)/(r/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(r(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,n,r,s){return u(this.world,t,e,i,n,r,s)},overlapCirc:function(t,e,i,n,r){return c(this.world,t,e,i,n,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(p.UPDATE,this.world.update,this.world),t.off(p.POST_UPDATE,this.world.postUpdate,this.world),t.off(p.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(p.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={enableBody:function(t,e,i,n,r){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),r&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}};t.exports=i},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="collide"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="overlap"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pause"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resume"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="tilecollide"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="tileoverlap"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="worldbounds"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="worldstep"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i,n,r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x=function(){return u&&g&&n.blocked.right?(i.processX(-y,h,!1,!0),1):c&&v&&n.blocked.left?(i.processX(y,h,!0),1):f&&v&&i.blocked.right?(n.processX(-y,l,!1,!0),2):p&&g&&i.blocked.left?(n.processX(y,l,!0),2):0},b=function(t){if(r&&s)y*=.5,0===t||3===t?(i.processX(y,o),n.processX(-y,a)):(i.processX(-y,o),n.processX(y,a));else if(r&&!s)0===t||3===t?i.processX(y,h,!0):i.processX(-y,h,!1,!0);else if(!r&&s)0===t||3===t?n.processX(-y,l,!1,!0):n.processX(y,l,!0);else{var e=.5*y;0===t?m?(i.processX(y,0,!0),n.processX(0,null,!1,!0)):f?(i.processX(e,0,!0),n.processX(-e,0,!1,!0)):(i.processX(e,n.velocity.x,!0),n.processX(-e,null,!1,!0)):1===t?d?(i.processX(0,null,!1,!0),n.processX(y,0,!0)):u?(i.processX(-e,0,!1,!0),n.processX(e,0,!0)):(i.processX(-e,null,!1,!0),n.processX(e,i.velocity.x,!0)):2===t?m?(i.processX(-y,0,!1,!0),n.processX(0,null,!0)):p?(i.processX(-e,0,!1,!0),n.processX(e,0,!0)):(i.processX(-e,n.velocity.x,!1,!0),n.processX(e,null,!0)):3===t&&(d?(i.processX(0,null,!0),n.processX(-y,0,!1,!0)):c?(i.processX(e,0,!0),n.processX(-e,0,!1,!0)):(i.processX(e,n.velocity.y,!0),n.processX(-e,null,!1,!0)))}return!0};t.exports={BlockCheck:x,Check:function(){var t=i.velocity.x,e=n.velocity.x,r=Math.sqrt(e*e*n.mass/i.mass)*(e>0?1:-1),s=Math.sqrt(t*t*i.mass/n.mass)*(t>0?1:-1),h=.5*(r+s);return s-=h,o=h+(r-=h)*i.bounce.x,a=h+s*n.bounce.x,c&&v?b(0):p&&g?b(1):u&&g?b(2):!(!f||!v)&&b(3)},Set:function(t,e,o){n=e;var a=(i=t).velocity.x,b=n.velocity.x;return r=i.pushable,c=i._dx<0,u=i._dx>0,d=0===i._dx,g=Math.abs(i.right-n.x)<=Math.abs(n.right-i.x),h=b-a*i.bounce.x,s=n.pushable,p=n._dx<0,f=n._dx>0,m=0===n._dx,v=!g,l=a-b*n.bounce.x,y=Math.abs(o),x()},Run:b,RunImmovableBody1:function(t){1===t?n.velocity.x=0:g?n.processX(y,l,!0):n.processX(-y,l,!1,!0),i.moves&&(n.y+=(i.y-i.prev.y)*i.friction.y,n._dy=n.y-n.prev.y)},RunImmovableBody2:function(t){2===t&&(i.velocity.x=0),v?i.processX(y,h,!0):i.processX(-y,h,!1,!0),n.moves&&(i.y+=(n.y-n.prev.y)*n.friction.y,i._dy=i.y-i.prev.y)}}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i,n,r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x=function(){return u&&g&&n.blocked.down?(i.processY(-y,h,!1,!0),1):c&&v&&n.blocked.up?(i.processY(y,h,!0),1):f&&v&&i.blocked.down?(n.processY(-y,l,!1,!0),2):p&&g&&i.blocked.up?(n.processY(y,l,!0),2):0},b=function(t){if(r&&s)y*=.5,0===t||3===t?(i.processY(y,o),n.processY(-y,a)):(i.processY(-y,o),n.processY(y,a));else if(r&&!s)0===t||3===t?i.processY(y,h,!0):i.processY(-y,h,!1,!0);else if(!r&&s)0===t||3===t?n.processY(-y,l,!1,!0):n.processY(y,l,!0);else{var e=.5*y;0===t?m?(i.processY(y,0,!0),n.processY(0,null,!1,!0)):f?(i.processY(e,0,!0),n.processY(-e,0,!1,!0)):(i.processY(e,n.velocity.y,!0),n.processY(-e,null,!1,!0)):1===t?d?(i.processY(0,null,!1,!0),n.processY(y,0,!0)):u?(i.processY(-e,0,!1,!0),n.processY(e,0,!0)):(i.processY(-e,null,!1,!0),n.processY(e,i.velocity.y,!0)):2===t?m?(i.processY(-y,0,!1,!0),n.processY(0,null,!0)):p?(i.processY(-e,0,!1,!0),n.processY(e,0,!0)):(i.processY(-e,n.velocity.y,!1,!0),n.processY(e,null,!0)):3===t&&(d?(i.processY(0,null,!0),n.processY(-y,0,!1,!0)):c?(i.processY(e,0,!0),n.processY(-e,0,!1,!0)):(i.processY(e,n.velocity.y,!0),n.processY(-e,null,!1,!0)))}return!0};t.exports={BlockCheck:x,Check:function(){var t=i.velocity.y,e=n.velocity.y,r=Math.sqrt(e*e*n.mass/i.mass)*(e>0?1:-1),s=Math.sqrt(t*t*i.mass/n.mass)*(t>0?1:-1),h=.5*(r+s);return s-=h,o=h+(r-=h)*i.bounce.y,a=h+s*n.bounce.y,c&&v?b(0):p&&g?b(1):u&&g?b(2):!(!f||!v)&&b(3)},Set:function(t,e,o){n=e;var a=(i=t).velocity.y,b=n.velocity.y;return r=i.pushable,c=i._dy<0,u=i._dy>0,d=0===i._dy,g=Math.abs(i.bottom-n.y)<=Math.abs(n.bottom-i.y),h=b-a*i.bounce.y,s=n.pushable,p=n._dy<0,f=n._dy>0,m=0===n._dy,v=!g,l=a-b*n.bounce.y,y=Math.abs(o),x()},Run:b,RunImmovableBody1:function(t){1===t?n.velocity.y=0:g?n.processY(y,l,!0):n.processY(-y,l,!1,!0),i.moves&&(n.x+=(i.x-i.prev.x)*i.friction.x,n._dx=n.x-n.prev.x)},RunImmovableBody2:function(t){2===t?i.velocity.y=0:v?i.processY(y,h,!0):i.processY(-y,h,!1,!0),n.moves&&(i.x+=(n.x-n.prev.x)*n.friction.x,i._dx=i.x-i.prev.x)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n={ProcessTileCallbacks:i(524),ProcessTileSeparationX:i(528),ProcessTileSeparationY:i(530),SeparateTile:i(526),TileCheckX:i(527),TileCheckY:i(529),TileIntersectsBody:i(245)};t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Joachim Grill <joachim@codeandweb.com>
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2018 CodeAndWeb GmbH
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(126),r=i(71),s=i(50),o=i(2),a=i(94),h={parseBody:function(t,e,i,n){void 0===n&&(n={});for(var a=o(i,"fixtures",[]),h=[],l=0;l<a.length;l++)for(var c=this.parseFixture(a[l]),u=0;u<c.length;u++)h.push(c[u]);var d=s.clone(i,!0);s.extend(d,n,!0),delete d.fixtures,delete d.type;var p=r.create(d);return r.setParts(p,h),r.setPosition(p,{x:t,y:e}),p},parseFixture:function(t){var e,i=s.extend({},!1,t);if(delete i.circle,delete i.vertices,t.circle){var r=o(t.circle,"x"),a=o(t.circle,"y"),h=o(t.circle,"radius");e=[n.circle(r,a,h,i)]}else t.vertices&&(e=this.parseVertices(t.vertices,i));return e},parseVertices:function(t,e){void 0===e&&(e={});for(var i=[],o=0;o<t.length;o++)a.clockwiseSort(t[o]),i.push(r.create(s.extend({position:a.centre(t[o]),vertices:t[o]},e)));return n.flagCoincidentParts(i)}};t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(126),r=i(71),s={parseBody:function(t,e,i,s){var o;void 0===s&&(s={});var a=i.vertices;if(1===a.length)s.vertices=a[0],o=r.create(s),n.flagCoincidentParts(o.parts);else{for(var h=[],l=0;l<a.length;l++){var c=r.create({vertices:a[l]});h.push(c)}n.flagCoincidentParts(h),s.parts=h,o=r.create(s)}return o.label=i.label,r.setPosition(o,{x:t,y:e}),o}};t.exports=s},function(t,e,i){var n={};t.exports=n;var r=i(163),s=i(246),o=i(50),a=i(71),h=i(126);n.stack=function(t,e,i,n,s,o,h){for(var l,c=r.create({label:"Stack"}),u=t,d=e,p=0,f=0;f<n;f++){for(var m=0,g=0;g<i;g++){var v=h(u,d,g,f,l,p);if(v){var y=v.bounds.max.y-v.bounds.min.y,x=v.bounds.max.x-v.bounds.min.x;y>m&&(m=y),a.translate(v,{x:.5*x,y:.5*y}),u=v.bounds.max.x+s,r.addBody(c,v),l=v,p+=1}else u+=s}d+=m+o,u=t}return c},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,c=1;c<l.length;c++){var u=l[c-1],d=l[c],p=u.bounds.max.y-u.bounds.min.y,f=u.bounds.max.x-u.bounds.min.x,m=d.bounds.max.y-d.bounds.min.y,g={bodyA:u,pointA:{x:f*e,y:p*i},bodyB:d,pointB:{x:(d.bounds.max.x-d.bounds.min.x)*n,y:m*a}},v=o.extend(g,h);r.addConstraint(t,s.create(v))}return t.label+=" Chain",t},n.mesh=function(t,e,i,n,a){var h,l,c,u,d,p=t.bodies;for(h=0;h<i;h++){for(l=1;l<e;l++)c=p[l-1+h*e],u=p[l+h*e],r.addConstraint(t,s.create(o.extend({bodyA:c,bodyB:u},a)));if(h>0)for(l=0;l<e;l++)c=p[l+(h-1)*e],u=p[l+h*e],r.addConstraint(t,s.create(o.extend({bodyA:c,bodyB:u},a))),n&&l>0&&(d=p[l-1+(h-1)*e],r.addConstraint(t,s.create(o.extend({bodyA:d,bodyB:u},a)))),n&&l<e-1&&(d=p[l+1+(h-1)*e],r.addConstraint(t,s.create(o.extend({bodyA:d,bodyB:u},a))))}return t.label+=" Mesh",t},n.pyramid=function(t,e,i,r,s,o,h){return n.stack(t,e,i,r,s,o,(function(e,n,o,l,c,u){var d=Math.min(r,Math.ceil(i/2)),p=c?c.bounds.max.x-c.bounds.min.x:0;if(!(l>d||o<(l=d-l)||o>i-1-l))return 1===u&&a.translate(c,{x:(o+(i%2==1?1:-1))*p,y:0}),h(t+(c?o*p:0)+o*s,n,o,l,c,u)}))},n.newtonsCradle=function(t,e,i,n,o){for(var a=r.create({label:"Newtons Cradle"}),l=0;l<i;l++){var c=h.circle(t+l*(1.9*n),e+o,n,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),u=s.create({pointA:{x:t+l*(1.9*n),y:e},bodyB:c});r.addBody(a,c),r.addConstraint(a,u)}return a},n.car=function(t,e,i,n,o){var l=a.nextGroup(!0),c=.5*-i+20,u=.5*i-20,d=r.create({label:"Car"}),p=h.rectangle(t,e,i,n,{collisionFilter:{group:l},chamfer:{radius:.5*n},density:2e-4}),f=h.circle(t+c,e+0,o,{collisionFilter:{group:l},friction:.8}),m=h.circle(t+u,e+0,o,{collisionFilter:{group:l},friction:.8}),g=s.create({bodyB:p,pointB:{x:c,y:0},bodyA:f,stiffness:1,length:0}),v=s.create({bodyB:p,pointB:{x:u,y:0},bodyA:m,stiffness:1,length:0});return r.addBody(d,p),r.addBody(d,f),r.addBody(d,m),r.addConstraint(d,g),r.addConstraint(d,v),d},n.softBody=function(t,e,i,r,s,a,l,c,u,d){u=o.extend({inertia:1/0},u),d=o.extend({stiffness:.2,render:{type:"line",anchors:!1}},d);var p=n.stack(t,e,i,r,s,a,(function(t,e){return h.circle(t,e,c,u)}));return n.mesh(p,i,r,l,d),p.label="Soft Body",p}},function(t,e,i){var n={};t.exports=n,i(117);var r=i(50);n.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||r.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,s,o,a,h,l,c,u,d,p,f,m=[],g=0,v=0,y=0;e=e||15;var x=function(t,e,i){var n=i%2==1&&i>1;if(!d||t!=d.x||e!=d.y){d&&n?(p=d.x,f=d.y):(p=0,f=0);var r={x:p+t,y:f+e};!n&&d||(d=r),m.push(r),v=p+t,y=f+e}},b=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,y=t.y;break;case"H":v=t.x;break;case"V":y=t.y}x(v,y,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i<t.pathSegList.numberOfItems;i+=1)l.push(t.pathSegList.getItem(i));for(c=l.concat();g<o;){if((h=l[t.getPathSegAtLength(g)])!=u){for(;c.length&&c[0]!=h;)b(c.shift());u=h}switch(h.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":a=t.getPointAtLength(g),x(a.x,a.y,0)}g+=e}for(i=0,s=c.length;i<s;++i)b(c[i]);return m},n._svgPathToAbsolute=function(t){for(var e,i,n,r,s,o,a=t.pathSegList,h=0,l=0,c=a.numberOfItems,u=0;u<c;++u){var d=a.getItem(u),p=d.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(p))"x"in d&&(h=d.x),"y"in d&&(l=d.y);else switch("x1"in d&&(n=h+d.x1),"x2"in d&&(s=h+d.x2),"y1"in d&&(r=l+d.y1),"y2"in d&&(o=l+d.y2),"x"in d&&(h+=d.x),"y"in d&&(l+=d.y),p){case"m":a.replaceItem(t.createSVGPathSegMovetoAbs(h,l),u);break;case"l":a.replaceItem(t.createSVGPathSegLinetoAbs(h,l),u);break;case"h":a.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(h),u);break;case"v":a.replaceItem(t.createSVGPathSegLinetoVerticalAbs(l),u);break;case"c":a.replaceItem(t.createSVGPathSegCurvetoCubicAbs(h,l,n,r,s,o),u);break;case"s":a.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(h,l,s,o),u);break;case"q":a.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(h,l,n,r),u);break;case"t":a.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(h,l),u);break;case"a":a.replaceItem(t.createSVGPathSegArcAbs(h,l,d.r1,d.r2,d.angle,d.largeArcFlag,d.sweepFlag),u);break;case"z":case"Z":h=e,l=i}"M"!=p&&"m"!=p||(e=h,i=l)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(126),r=i(71),s=i(0),o=i(534),a=i(9),h=i(2),l=i(125),c=i(94),u=new s({Extends:a,Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){a.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var n=h(i,"body",null),r=h(i,"addToWorld",!0);if(n)this.setBody(n,r);else{var s=e.getCollisionGroup();h(s,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,r=e.y+e.height/2,s=n.rectangle(i,r,e.width,e.height,t);return this.setBody(s,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,s=this.tile.getLeft(),o=this.tile.getTop(),a=this.tile.getCollisionGroup(),u=h(a,"objects",[]),d=[],p=0;p<u.length;p++){var f=u[p],m=s+f.x*e,g=o+f.y*i,v=f.width*e,y=f.height*i,x=null;if(f.rectangle)x=n.rectangle(m+v/2,g+y/2,v,y,t);else if(f.ellipse)x=n.circle(m+v/2,g+y/2,v/2,t);else if(f.polygon||f.polyline){var b=(f.polygon?f.polygon:f.polyline).map((function(t){return{x:t.x*e,y:t.y*i}})),w=c.create(b),T=c.centre(w);m+=T.x,g+=T.y,x=n.fromVertices(m,g,w,t)}x&&d.push(x)}return 1===d.length?this.setBody(d[0],t.addToWorld):d.length>1&&(t.parts=d,this.setBody(r.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1493);n.Body=i(71),n.Composite=i(163),n.World=i(1393),n.Detector=i(587),n.Grid=i(1394),n.Pairs=i(1395),n.Pair=i(535),n.Query=i(1494),n.Resolver=i(1396),n.SAT=i(588),n.Constraint=i(246),n.Common=i(50),n.Engine=i(1495),n.Events=i(268),n.Sleeping=i(267),n.Plugin=i(1392),n.Bodies=i(126),n.Composites=i(1388),n.Axes=i(585),n.Bounds=i(117),n.Svg=i(1389),n.Vector=i(116),n.Vertices=i(94),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,t.exports=n},function(t,e,i){var n={};t.exports=n;var r=i(50);n._registry={},n.register=function(t){if(n.isPlugin(t)||r.warn("Plugin.register:",n.toString(t),"does not implement all required fields."),t.name in n._registry){var e=n._registry[t.name],i=n.versionParse(t.version).number,s=n.versionParse(e.version).number;i>s?(r.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i<s?r.warn("Plugin.register:",n.toString(e),"can not be downgraded to",n.toString(t)):t!==e&&r.warn("Plugin.register:",n.toString(t),"is already registered to different plugin object")}else n._registry[t.name]=t;return t},n.resolve=function(t){return n._registry[n.dependencyParse(t).name]},n.toString=function(t){return"string"==typeof t?t:(t.name||"anonymous")+"@"+(t.version||t.range||"0.0.0")},n.isPlugin=function(t){return t&&t.name&&t.version&&t.install},n.isUsed=function(t,e){return t.used.indexOf(e)>-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),s=r.topologicalSort(i),o=[],a=0;a<s.length;a+=1)if(s[a]!==t.name){var h=n.resolve(s[a]);h?n.isUsed(t,h.name)||(n.isFor(h,t)||(r.warn("Plugin.use:",n.toString(h),"is for",h.for,"but installed on",n.toString(t)+"."),h._warned=!0),h.install?h.install(t):(r.warn("Plugin.use:",n.toString(h),"does not specify an install function."),h._warned=!0),h._warned?(o.push("🔶 "+n.toString(h)),delete h._warned):o.push("✅ "+n.toString(h)),t.used.push(h.name)):o.push("❌ "+s[a])}o.length>0&&!h.silent&&r.info(o.join(" "))}else r.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),s=i.name;if(!(s in(e=e||{}))){t=n.resolve(t)||t,e[s]=r.map(t.uses||[],(function(e){n.isPlugin(e)&&n.register(e);var s=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,s.range)?(r.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(s),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(r.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),s.name}));for(var o=0;o<e[s].length;o+=1)n.dependencies(e[s][o],e);return e}},n.dependencyParse=function(t){return r.isString(t)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/.test(t)||r.warn("Plugin.dependencyParse:",t,"is not a valid dependency string."),{name:t.split("@")[0],range:t.split("@")[1]||"*"}):{name:t.name,range:t.range||t.version}},n.versionParse=function(t){/^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/.test(t)||r.warn("Plugin.versionParse:",t,"is not a valid version or range.");var e=t.split("-");t=e[0];var i=isNaN(Number(t[0])),n=i?t.substr(1):t,s=r.map(n.split("."),(function(t){return Number(t)}));return{isRange:i,version:n,range:t,operator:i?t[0]:"",parts:s,prerelease:e[1],number:1e8*s[0]+1e4*s[1]+s[2]}},n.versionSatisfies=function(t,e){e=e||"*";var i=n.versionParse(e),r=i.parts,s=n.versionParse(t),o=s.parts;if(i.isRange){if("*"===i.operator||"*"===t)return!0;if("~"===i.operator)return o[0]===r[0]&&o[1]===r[1]&&o[2]>=r[2];if("^"===i.operator)return r[0]>0?o[0]===r[0]&&s.number>=i.number:r[1]>0?o[1]===r[1]&&o[2]>=r[2]:o[2]===r[2]}return t===e||"*"===t}},function(t,e,i){var n={};t.exports=n;var r=i(163),s=(i(246),i(50));n.create=function(t){var e=r.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return s.extend(e,i,t)}},function(t,e,i){var n={};t.exports=n;var r=i(535),s=i(587),o=i(50);n.create=function(t){var e={controller:n,detector:s.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return o.extend(e,t)},n.update=function(t,e,i,r){var s,o,a,h,l,c=i.world,u=t.buckets,d=!1,p=i.metrics;for(p.broadphaseTests=0,s=0;s<e.length;s++){var f=e[s];if((!f.isSleeping||r)&&!(f.bounds.max.x<c.bounds.min.x||f.bounds.min.x>c.bounds.max.x||f.bounds.max.y<c.bounds.min.y||f.bounds.min.y>c.bounds.max.y)){var m=n._getRegion(t,f);if(!f.region||m.id!==f.region.id||r){p.broadphaseTests+=1,f.region&&!r||(f.region=m);var g=n._regionUnion(m,f.region);for(o=g.startCol;o<=g.endCol;o++)for(a=g.startRow;a<=g.endRow;a++){h=u[l=n._getBucketId(o,a)];var v=o>=m.startCol&&o<=m.endCol&&a>=m.startRow&&a<=m.endRow,y=o>=f.region.startCol&&o<=f.region.endCol&&a>=f.region.startRow&&a<=f.region.endRow;!v&&y&&y&&h&&n._bucketRemoveBody(t,h,f),(f.region===m||v&&!y||r)&&(h||(h=n._createBucket(u,l)),n._bucketAddBody(t,h,f))}f.region=m,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),r=Math.max(t.endCol,e.endCol),s=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,r,s,o)},n._getRegion=function(t,e){var i=e.bounds,r=Math.floor(i.min.x/t.bucketWidth),s=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(r,s,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n<e.length;n++){var s=e[n];if(!(i.id===s.id||i.isStatic&&s.isStatic)){var o=r.id(i,s),a=t.pairs[o];a?a[2]+=1:t.pairs[o]=[i,s,1]}}e.push(i)},n._bucketRemoveBody=function(t,e,i){e.splice(e.indexOf(i),1);for(var n=0;n<e.length;n++){var s=e[n],o=r.id(i,s),a=t.pairs[o];a&&(a[2]-=1)}},n._createActivePairsList=function(t){var e,i,n=[];e=o.keys(t.pairs);for(var r=0;r<e.length;r++)(i=t.pairs[e[r]])[2]>0?n.push(i):delete t.pairs[e[r]];return n}},function(t,e,i){var n={};t.exports=n;var r=i(535),s=i(50);n._pairMaxIdleLife=1e3,n.create=function(t){return s.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,s,o,a,h=t.list,l=t.table,c=t.collisionStart,u=t.collisionEnd,d=t.collisionActive;for(c.length=0,u.length=0,d.length=0,a=0;a<h.length;a++)h[a].confirmedActive=!1;for(a=0;a<e.length;a++)(n=e[a]).collided&&((o=l[s=r.id(n.bodyA,n.bodyB)])?(o.isActive?d.push(o):c.push(o),r.update(o,n,i),o.confirmedActive=!0):(o=r.create(n,i),l[s]=o,c.push(o),h.push(o)));for(a=0;a<h.length;a++)(o=h[a]).isActive&&!o.confirmedActive&&(r.setActive(o,!1,i),u.push(o))},n.removeOld=function(t,e){var i,r,s,o,a=t.list,h=t.table,l=[];for(o=0;o<a.length;o++)(r=(i=a[o]).collision).bodyA.isSleeping||r.bodyB.isSleeping?i.timeUpdated=e:e-i.timeUpdated>n._pairMaxIdleLife&&l.push(o);for(o=0;o<l.length;o++)delete h[(i=a[s=l[o]-o]).id],a.splice(s,1)},n.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},function(t,e,i){var n={};t.exports=n;var r=i(94),s=i(116),o=i(50),a=i(117);n._restingThresh=4,n._restingThreshTangent=6,n._positionDampen=.9,n._positionWarming=.8,n._frictionNormalMultiplier=5,n.preSolvePosition=function(t){var e,i,n;for(e=0;e<t.length;e++)(i=t[e]).isActive&&(n=i.activeContacts.length,i.collision.parentA.totalContacts+=n,i.collision.parentB.totalContacts+=n)},n.solvePosition=function(t,e,i){var r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x,b=i*n._positionDampen;for(r=0;r<e.length;r++){var w=e[r];w.previousPositionImpulse.x=w.positionImpulse.x,w.previousPositionImpulse.y=w.positionImpulse.y}for(r=0;r<t.length;r++)(a=t[r]).isActive&&!a.isSensor&&(l=(h=a.collision).parentA,c=h.parentB,u=h.normal,f=l.previousPositionImpulse,m=c.previousPositionImpulse,p=h.penetration,v=m.x-f.x+p.x,y=m.y-f.y+p.y,d=(s=u.x)*v+(o=u.y)*y,a.separation=d,x=(d-a.slop)*b,(l.isStatic||c.isStatic)&&(x*=2),l.isStatic||l.isSleeping||(g=x/l.totalContacts,l.positionImpulse.x+=s*g,l.positionImpulse.y+=o*g),c.isStatic||c.isSleeping||(g=x/c.totalContacts,c.positionImpulse.x-=s*g,c.positionImpulse.y-=o*g))},n.postSolvePosition=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.totalContacts=0,0!==i.positionImpulse.x||0!==i.positionImpulse.y){for(var o=0;o<i.parts.length;o++){var h=i.parts[o];r.translate(h.vertices,i.positionImpulse),a.update(h.bounds,h.vertices,i.velocity),h.position.x+=i.positionImpulse.x,h.position.y+=i.positionImpulse.y}i.positionPrev.x+=i.positionImpulse.x,i.positionPrev.y+=i.positionImpulse.y,s.dot(i.positionImpulse,i.velocity)<0?(i.positionImpulse.x=0,i.positionImpulse.y=0):(i.positionImpulse.x*=n._positionWarming,i.positionImpulse.y*=n._positionWarming)}}},n.preSolveVelocity=function(t){var e,i,n,r,o,a,h,l,c,u,d,p,f,m,g=s._temp[0],v=s._temp[1];for(e=0;e<t.length;e++)if((n=t[e]).isActive&&!n.isSensor)for(r=n.activeContacts,a=(o=n.collision).parentA,h=o.parentB,l=o.normal,c=o.tangent,i=0;i<r.length;i++)d=(u=r[i]).vertex,p=u.normalImpulse,f=u.tangentImpulse,0===p&&0===f||(g.x=l.x*p+c.x*f,g.y=l.y*p+c.y*f,a.isStatic||a.isSleeping||(m=s.sub(d,a.position,v),a.positionPrev.x+=g.x*a.inverseMass,a.positionPrev.y+=g.y*a.inverseMass,a.anglePrev+=s.cross(m,g)*a.inverseInertia),h.isStatic||h.isSleeping||(m=s.sub(d,h.position,v),h.positionPrev.x-=g.x*h.inverseMass,h.positionPrev.y-=g.y*h.inverseMass,h.anglePrev-=s.cross(m,g)*h.inverseInertia))},n.solveVelocity=function(t,e){for(var i=e*e,r=s._temp[0],a=s._temp[1],h=s._temp[2],l=s._temp[3],c=s._temp[4],u=s._temp[5],d=0;d<t.length;d++){var p=t[d];if(p.isActive&&!p.isSensor){var f=p.collision,m=f.parentA,g=f.parentB,v=f.normal,y=f.tangent,x=p.activeContacts,b=1/x.length;m.velocity.x=m.position.x-m.positionPrev.x,m.velocity.y=m.position.y-m.positionPrev.y,g.velocity.x=g.position.x-g.positionPrev.x,g.velocity.y=g.position.y-g.positionPrev.y,m.angularVelocity=m.angle-m.anglePrev,g.angularVelocity=g.angle-g.anglePrev;for(var w=0;w<x.length;w++){var T=x[w],_=T.vertex,E=s.sub(_,m.position,a),S=s.sub(_,g.position,h),M=s.add(m.velocity,s.mult(s.perp(E),m.angularVelocity),l),A=s.add(g.velocity,s.mult(s.perp(S),g.angularVelocity),c),C=s.sub(M,A,u),P=s.dot(v,C),R=s.dot(y,C),L=Math.abs(R),O=o.sign(R),D=(1+p.restitution)*P,I=o.clamp(p.separation+P,0,1)*n._frictionNormalMultiplier,F=R,B=1/0;L>p.friction*p.frictionStatic*I*i&&(B=L,F=o.clamp(p.friction*O*i,-B,B));var k=s.cross(E,v),N=s.cross(S,v),U=b/(m.inverseMass+g.inverseMass+m.inverseInertia*k*k+g.inverseInertia*N*N);if(D*=U,F*=U,P<0&&P*P>n._restingThresh*i)T.normalImpulse=0;else{var z=T.normalImpulse;T.normalImpulse=Math.min(T.normalImpulse+D,0),D=T.normalImpulse-z}if(R*R>n._restingThreshTangent*i)T.tangentImpulse=0;else{var G=T.tangentImpulse;T.tangentImpulse=o.clamp(T.tangentImpulse+F,-B,B),F=T.tangentImpulse-G}r.x=v.x*D+y.x*F,r.y=v.y*D+y.y*F,m.isStatic||m.isSleeping||(m.positionPrev.x+=r.x*m.inverseMass,m.positionPrev.y+=r.y*m.inverseMass,m.anglePrev+=s.cross(E,r)*m.inverseInertia),g.isStatic||g.isSleeping||(g.positionPrev.x-=r.x*g.inverseMass,g.positionPrev.y-=r.y*g.inverseMass,g.anglePrev-=s.cross(S,r)*g.inverseInertia)}}}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={BasePlugin:i(536),DefaultPlugins:i(194),PluginCache:i(24),PluginManager:i(408),ScenePlugin:i(1398)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}
|
|
*/
|
|
var n=i(536),r=i(0),s=i(21),o=new r({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Canvas:i(1400),Events:i(88),Snapshot:i(1401),WebGL:i(1402)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={CanvasRenderer:i(362),GetBlendModes:i(364),SetTransform:i(30)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Canvas:i(363),WebGL:i(377)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(104),r=i(17),s={PipelineManager:i(366),Pipelines:i(1403),RenderTarget:i(139),Utils:i(12),WebGLPipeline:i(57),WebGLRenderer:i(365),WebGLShader:i(369)};s=r(!1,s,n),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(65),r=i(17),s={BitmapMaskPipeline:i(367),Events:i(368),GraphicsPipeline:i(370),LightPipeline:i(371),MultiPipeline:i(105),PointLightPipeline:i(372),PostFXPipeline:i(1404),RopePipeline:i(373),SinglePipeline:i(374),UtilityPipeline:i(375)};s=r(!1,s,n),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(195),s=i(2),o=i(1405),a=i(376),h=i(57),l=new n({Extends:h,initialize:function(t){t.renderTarget=s(t,"renderTarget",1),t.fragShader=s(t,"fragShader",o),t.vertShader=s(t,"vertShader",a),t.attributes=s(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.colorMatrix=new r,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2,this.set1i("uMainSampler",0)},onDraw:function(t){this.bindAndDraw(t)},copyFrame:function(t,e,i,n,r){this.manager.copyFrame(t,e,i,n,r)},copyToGame:function(t){this.manager.copyToGame(t)},drawFrame:function(t,e,i){this.manager.drawFrame(t,e,i,this.colorMatrix)},blendFrames:function(t,e,i,n,r){this.manager.blendFrames(t,e,i,n,r)},blendFramesAdditive:function(t,e,i,n,r){this.manager.blendFramesAdditive(t,e,i,n,r)},clearFrame:function(t,e){this.manager.clearFrame(t,e)},blitFrame:function(t,e,i,n,r,s){this.manager.blitFrame(t,e,i,n,r,s)},copyFrameRect:function(t,e,i,n,r,s,o,a){this.manager.copyFrameRect(t,e,i,n,r,s,o,a)},bindAndDraw:function(t,e,i,n,r){void 0===i&&(i=!0),void 0===n&&(n=!0);var s=this.gl,o=this.renderer;this.bind(r),this.set1i("uMainSampler",0),e?(s.viewport(0,0,e.width,e.height),s.bindFramebuffer(s.FRAMEBUFFER,e.framebuffer),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e.texture,0),i&&(n?s.clearColor(0,0,0,0):s.clearColor(0,0,0,1),s.clear(s.COLOR_BUFFER_BIT))):(o.popFramebuffer(!1,!1,!1),o.currentFramebuffer||s.viewport(0,0,o.width,o.height)),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,t.texture),s.bufferData(s.ARRAY_BUFFER,this.vertexData,s.STATIC_DRAW),s.drawArrays(s.TRIANGLES,0,6),e?(s.bindTexture(s.TEXTURE_2D,null),s.bindFramebuffer(s.FRAMEBUFFER,null)):o.resetTextures()}});t.exports=l},function(t,e){t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}",""].join("\n")},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(17),r=i(198),s={Center:i(397),Events:i(101),Orientation:i(398),ScaleManager:i(409),ScaleModes:i(399),Zoom:i(400)};s=n(!1,s,r.CENTER),s=n(!1,s,r.ORIENTATION),s=n(!1,s,r.SCALE_MODE),s=n(!1,s,r.ZOOM),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(142),r=i(17),s={Events:i(21),GetPhysicsPlugins:i(413),GetScenePlugins:i(414),SceneManager:i(411),ScenePlugin:i(1408),Settings:i(415),Systems:i(201)};s=r(!1,s,n),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(18),r=i(0),s=i(21),o=i(2),a=i(24),h=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(s.BOOT,this.boot,this),t.sys.events.on(s.START,this.pluginStart,this)},boot:function(){this.systems.events.once(s.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(s.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var r=o(t,"onUpdate",null);r&&(this._onUpdate=r,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=n,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(o(t,"data")):this.manager.start(e,o(t,"data")),this.systems.events.emit(s.TRANSITION_OUT,i,n),this.systems.events.on(s.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(s.UPDATE,this.step,this),t.events.emit(s.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(s.SHUTDOWN,this.shutdown,this),t.off(s.POST_UPDATE,this.step,this),t.off(s.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Events:i(432),List:i(107),Map:i(99),ProcessQueue:i(208),RTree:i(525),Set:i(148),Size:i(410)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(17),r=i(1411),s={CanvasTexture:i(417),Events:i(103),FilterMode:r,Frame:i(106),Parsers:i(419),Texture:i(203),TextureManager:i(416),TextureSource:i(418)};s=n(!1,s,r),t.exports=s},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(17),r=i(1413),s={Components:i(247),Parsers:i(1446),Formats:i(39),ImageCollection:i(572),ParseToTilemap:i(258),Tile:i(83),Tilemap:i(576),TilemapCreator:i(1452),TilemapFactory:i(1453),Tileset:i(121),TilemapLayer:i(577),Orientation:i(29),LayerData:i(119),MapData:i(120),ObjectLayer:i(568)};s=n(!1,s,r.ORIENTATION),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n={ORIENTATION:i(29)};t.exports=n},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26),r=i(61);t.exports=function(t,e,i,s,o,a,h,l){void 0===h&&(h=!0),t<0&&(t=0),e<0&&(e=0);for(var c=n(t,e,i,s,null,l),u=o-t,d=a-e,p=0;p<c.length;p++){var f=c[p].x+u,m=c[p].y+d;f>=0&&f<l.width&&m>=0&&m<l.height&&l.data[m][f]&&l.data[m][f].copy(c[p])}h&&r(o-1,a-1,i+2,s+2,l)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26),r=i(538);t.exports=function(t,e,i,s,o,a){i||(i={}),Array.isArray(t)||(t=[t]);var h=a.tilemapLayer;s||(s=h.scene),o||(o=s.cameras.main);var l,c=n(0,0,a.width,a.height,null,a),u=[];for(l=0;l<c.length;l++){var d=c[l];if(-1!==t.indexOf(d.index)){var p=h.tileToWorldXY(d.x,d.y,void 0,o,a);i.x=p.x,i.y=p.y,u.push(s.make.sprite(i))}}if("number"==typeof e)for(l=0;l<t.length;l++)r(t[l],e,0,0,a.width,a.height,a);else if(Array.isArray(e))for(l=0;l<t.length;l++)r(t[l],e[l],0,0,a.width,a.height,a);return u}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26),r=i(61),s=i(72);t.exports=function(t,e,i,o,a,h,l){for(var c=-1!==l.collideIndexes.indexOf(t),u=n(e,i,o,a,null,l),d=0;d<u.length;d++)u[d].index=t,s(u[d],c);h&&r(e-1,i-1,o+2,a+2,l)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26);t.exports=function(t,e,i,r,s,o,a,h){return n(i,r,s,o,a,h).filter(t,e)}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=!1);var r,s,o,a=0;if(i){for(s=n.height-1;s>=0;s--)for(r=n.width-1;r>=0;r--)if((o=n.data[s][r])&&o.index===t){if(a===e)return o;a+=1}}else for(s=0;s<n.height;s++)for(r=0;r<n.width;r++)if((o=n.data[s][r])&&o.index===t){if(a===e)return o;a+=1}return null}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26);t.exports=function(t,e,i,r,s,o,a,h){return n(i,r,s,o,a,h).find(t,e)||null}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26);t.exports=function(t,e,i,r,s,o,a,h){n(i,r,s,o,a,h).forEach(t,e)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(29),r=i(540),s=i(541),o=i(543),a=i(1),h=i(544);t.exports=function(t){return t===n.ORTHOGONAL?r:t===n.HEXAGONAL?s:t===n.STAGGERED?h:t===n.ISOMETRIC?o:a}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(156),r=new(i(3));t.exports=function(t,e,i,s,o){return o.tilemapLayer.worldToTileXY(t,e,!0,r,s),n(r.x,r.y,i,o)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(477),r=i(26),s=i(478),o=i(1),a=i(3),h=function(t,e){return s.RectangleToTriangle(e,t)},l=new a,c=new a,u=new a;t.exports=function(t,e,i,a){if(void 0===t)return[];var d=o;t instanceof n.Circle?d=s.CircleToRectangle:t instanceof n.Rectangle?d=s.RectangleToRectangle:t instanceof n.Triangle?d=h:t instanceof n.Line&&(d=s.LineToRectangle),a.tilemapLayer.worldToTileXY(t.left,t.top,!0,c,i);var p=c.x,f=c.y;a.tilemapLayer.worldToTileXY(t.right,t.bottom,!0,u,i);var m=Math.ceil(u.x),g=Math.ceil(u.y),v=Math.max(m-p,1),y=Math.max(g-f,1),x=r(p,f,v,y,e,a),b=a.tileWidth,w=a.tileHeight;a.tilemapLayer&&(b*=a.tilemapLayer.scaleX,w*=a.tilemapLayer.scaleY);for(var T=[],_=new n.Rectangle(0,0,b,w),E=0;E<x.length;E++){var S=x[E];a.tilemapLayer.tileToWorldXY(S.x,S.y,l,i),_.x=l.x,_.y=l.y,d(t,_)&&T.push(S)}return T}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(29),r=i(1),s=i(249);t.exports=function(t){return t===n.ORTHOGONAL?s:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(29),r=i(546),s=i(547),o=i(1),a=i(548),h=i(549);t.exports=function(t){return t===n.ORTHOGONAL?h:t===n.ISOMETRIC?s:t===n.HEXAGONAL?r:t===n.STAGGERED?a:o}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(29),r=i(550),s=i(1),o=i(551),a=i(250);t.exports=function(t){return t===n.ORTHOGONAL?a:t===n.HEXAGONAL?r:t===n.STAGGERED?o:s}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(29),r=i(1),s=i(251);t.exports=function(t){return t===n.ORTHOGONAL?s:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(29),r=i(552),s=i(553),o=i(1),a=i(554),h=i(555);t.exports=function(t){return t===n.ORTHOGONAL?h:t===n.ISOMETRIC?s:t===n.HEXAGONAL?r:t===n.STAGGERED?a:o}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(29),r=i(556),s=i(1),o=i(557),a=i(252);t.exports=function(t){return t===n.ORTHOGONAL?a:t===n.HEXAGONAL?r:t===n.STAGGERED?o:s}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(558),r=new(i(3));t.exports=function(t,e,i,s){s.tilemapLayer.worldToTileXY(t,e,!0,r,i);var o=r.x,a=r.y;return n(o,a,s)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(253),r=new(i(3));t.exports=function(t,e,i,s,o,a){return a.tilemapLayer.worldToTileXY(e,i,!0,r,o,a),n(t,r.x,r.y,s,a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(61),r=i(253);t.exports=function(t,e,i,s,o){if(void 0===s&&(s=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var a=t.length,h=t[0].length,l=0;l<a;l++)for(var c=0;c<h;c++){var u=t[l][c];r(u,e+c,i+l,!1,o)}s&&n(e-1,i-1,h+2,a+2,o)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26),r=i(207);t.exports=function(t,e,i,s,o,a){var h,l=n(t,e,i,s,{},a);if(!o)for(o=[],h=0;h<l.length;h++)-1===o.indexOf(l[h].index)&&o.push(l[h].index);for(h=0;h<l.length;h++)l[h].index=r(o)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(559),r=new(i(3));t.exports=function(t,e,i,s,o,a){return a.tilemapLayer.worldToTileXY(t,e,!0,r,o,a),n(r.x,r.y,i,s,a)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26),r=i(391),s=new r(105,210,231,150),o=new r(243,134,48,200),a=new r(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var r=void 0!==e.tileColor?e.tileColor:s,h=void 0!==e.collidingTileColor?e.collidingTileColor:o,l=void 0!==e.faceColor?e.faceColor:a,c=n(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var u=0;u<c.length;u++){var d=c[u],p=d.width,f=d.height,m=d.pixelX,g=d.pixelY,v=d.collides?h:r;null!==v&&(t.fillStyle(v.color,v.alpha/255),t.fillRect(m,g,p,f)),m+=1,g+=1,p-=2,f-=2,null!==l&&(t.lineStyle(1,l.color,l.alpha/255),d.faceTop&&t.lineBetween(m,g,m+p,g),d.faceRight&&t.lineBetween(m+p,g,m+p,g+f),d.faceBottom&&t.lineBetween(m,g+f,m+p,g+f),d.faceLeft&&t.lineBetween(m,g,m,g+f))}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(72),r=i(61),s=i(158);t.exports=function(t,e,i,o,a){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===a&&(a=!0),Array.isArray(t)||(t=[t]);for(var h=0;h<t.length;h++)s(t[h],e,o);if(a)for(var l=0;l<o.height;l++)for(var c=0;c<o.width;c++){var u=o.data[l][c];u&&-1!==t.indexOf(u.index)&&n(u,e)}i&&r(0,0,o.width,o.height,o)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(72),r=i(61),s=i(158);t.exports=function(t,e,i,o,a,h){if(void 0===i&&(i=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)s(l,i,a);if(h)for(var c=0;c<a.height;c++)for(var u=0;u<a.width;u++){var d=a.data[c][u];d&&d.index>=t&&d.index<=e&&n(d,i)}o&&r(0,0,a.width,a.height,a)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(72),r=i(61),s=i(158);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a<o.height;a++)for(var h=0;h<o.width;h++){var l=o.data[a][h];l&&-1===t.indexOf(l.index)&&(n(l,e),s(l.index,e,o))}i&&r(0,0,o.width,o.height,o)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(72),r=i(61),s=i(125);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a<o.height;a++)for(var h=0;h<o.width;h++){var l=o.data[a][h];if(l)for(var c in t)if(s(l.properties,c)){var u=t[c];Array.isArray(u)||(u=[u]);for(var d=0;d<u.length;d++)l.properties[c]===u[d]&&n(l,e)}}i&&r(0,0,o.width,o.height,o)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(72),r=i(61);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var s=0;s<i.height;s++)for(var o=0;o<i.width;o++){var a=i.data[s][o];if(a){var h=a.getCollisionGroup();h&&h.objects&&h.objects.length>0&&n(a,t)}}e&&r(0,0,i.width,i.height,i)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var r=0,s=t.length;r<s;r++)n.callbacks[t[r]]=null!==e?{callback:e,callbackContext:i}:void 0}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26);t.exports=function(t,e,i,r,s,o,a){for(var h=n(t,e,i,r,null,a),l=0;l<h.length;l++)h[l].setCollisionCallback(s,o)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26),r=i(129);t.exports=function(t,e,i,s,o){var a=n(t,e,i,s,null,o),h=a.map((function(t){return t.index}));r(h);for(var l=0;l<a.length;l++)a[l].index=h[l]}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26);t.exports=function(t,e,i,r,s,o,a){for(var h=n(i,r,s,o,null,a),l=0;l<h.length;l++)h[l]&&(h[l].index===t?h[l].index=e:h[l].index===e&&(h[l].index=t))}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(26);t.exports=function(t,e,i,r,s,o){if(s){var a,h=n(t,e,i,r,null,o),l=0;for(a=0;a<s.length;a++)l+=s[a].weight;if(!(l<=0))for(a=0;a<h.length;a++){for(var c=Math.random()*l,u=0,d=-1,p=0;p<s.length;p++)if(c<=(u+=s[p].weight)){var f=s[p].index;d=Array.isArray(f)?f[Math.floor(Math.random()*f.length)]:f;break}h[a].index=d}}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={FromOrientationString:i(254),Parse:i(560),Parse2DArray:i(255),ParseCSV:i(561),Impact:i(1447),Tiled:i(1448)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ParseTileLayers:i(574),ParseTilesets:i(575),ParseWeltmeister:i(573)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={AssignTileProperties:i(563),Base64Decode:i(570),BuildTilesetIndex:i(564),CreateGroupLayer:i(159),ParseGID:i(257),ParseImageLayers:i(565),ParseJSONTiled:i(562),ParseObject:i(256),ParseObjectLayers:i(566),ParseTileLayers:i(569),ParseTilesets:i(571)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(1),r=i(1);n=i(1450),r=i(1451),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(12);t.exports=function(t,e,i){var r=e.cull(i),s=r.length,o=i.alpha*e.alpha;if(!(0===s||o<=0)){var a=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=n.getTintAppendFloatAlpha,c=e.scrollFactorX,u=e.scrollFactorY,d=e.x,p=e.y,f=e.scaleX,m=e.scaleY;t.pipelines.preBatch(e);for(var g=0;g<s;g++){var v=r[g],y=a[v.index];if(y){var x=y.getTileTextureCoordinates(v.index);if(null!==x){var b=y.glTexture,w=h.setTexture2D(b,e),T=y.tileWidth,_=y.tileHeight,E=x.x,S=x.y,M=.5*y.tileWidth,A=.5*y.tileHeight,C=l(v.tint,o*v.alpha);h.batchTexture(e,b,b.width,b.height,d+(M+v.pixelX)*f,p+(A+v.pixelY)*m,v.width,v.height,f,m,v.rotation,v.flipX,v.flipY,c,u,M,A,E,S,T,_,C,C,C,C,!1,0,0,i,null,!0,w)}}}t.pipelines.postBatch(e)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(25),r=new n,s=new n,o=new n;t.exports=function(t,e,i,n){var a=e.cull(i),h=a.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var c=r,u=s,d=o;u.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),c.copyFrom(i.matrix);var p=t.currentContext,f=e.gidMap;p.save(),n?(c.multiplyWithOffset(n,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),u.e=e.x,u.f=e.y,c.multiply(u,d),d.copyToContext(p)):(u.e-=i.scrollX*e.scrollFactorX,u.f-=i.scrollY*e.scrollFactorY,u.copyToContext(p)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var m=0;m<h;m++){var g=a[m],v=f[g.index];if(v){var y=v.image.getSourceImage(),x=v.getTileTextureCoordinates(g.index);if(null!==x){var b=v.tileWidth,w=v.tileHeight,T=.5*b,_=.5*w;p.save(),p.translate(g.pixelX+T,g.pixelY+_),0!==g.rotation&&p.rotate(g.rotation),(g.flipX||g.flipY)&&p.scale(g.flipX?-1:1,g.flipY?-1:1),p.globalAlpha=l*g.alpha,p.drawImage(y,x.x,x.y,b,w,-T,-_,b,w),p.restore()}}}p.restore()}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(16),r=i(258);n.register("tilemap",(function(t){var e=void 0!==t?t:{};return r(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(5),r=i(258);n.register("tilemap",(function(t,e,i,n,s,o,a){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===n&&(n=void 0),null===s&&(s=void 0),r(this.scene,t,e,i,n,s,o,a)}))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Clock:i(1455),TimerEvent:i(578)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(24),s=i(21),o=i(578),a=i(89),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(s.BOOT,this.boot,this),t.sys.events.on(s.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(s.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(s.PRE_UPDATE,this.preUpdate,this),t.on(s.UPDATE,this.update,this),t.once(s.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof o?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new o(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,n){return this.addEvent({delay:t,callback:e,args:i,callbackScope:n})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];a(this._pendingRemoval,i),a(this._pendingInsertion,i),a(this._active,i)}return this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i<t;i++){n=this._pendingRemoval[i];var r=this._active.indexOf(n);r>-1&&this._active.splice(r,1),n.destroy()}for(i=0;i<e;i++)n=this._pendingInsertion[i],this._active.push(n);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){if(this.now=t,!this.paused){e*=this.timeScale;for(var i=0;i<this._active.length;i++){var n=this._active[i];if(!n.paused&&(n.elapsed+=e*n.timeScale,n.elapsed>=n.delay)){var r=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=r,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t<this._pendingInsertion.length;t++)this._pendingInsertion[t].destroy();for(t=0;t<this._active.length;t++)this._active[t].destroy();for(t=0;t<this._pendingRemoval.length;t++)this._pendingRemoval[t].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off(s.PRE_UPDATE,this.preUpdate,this),e.off(s.UPDATE,this.update,this),e.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(s.START,this.start,this),this.scene=null,this.systems=null}});r.register("Clock",h,"time"),t.exports=h},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(97),r=i(17),s={Builders:i(1457),Events:i(263),TweenManager:i(1473),Tween:i(262),TweenData:i(264),Timeline:i(584)};s=r(!1,s,n),t.exports=s},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={GetBoolean:i(96),GetEaseFunction:i(80),GetNewValue:i(160),GetProps:i(579),GetTargets:i(259),GetTweens:i(580),GetValueOp:i(260),NumberTweenBuilder:i(581),StaggerBuilder:i(582),TimelineBuilder:i(583),TweenBuilder:i(161)}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onActive","onActiveParams","onActiveScope","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStartScope","onStop","onStopParams","onStopScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"]},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="complete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="loop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pause"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resume"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="start"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="update"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="active"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="complete"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="loop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="repeat"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="start"},function(t,e){
|
|
/**
|
|
* @author samme
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="stop"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="update"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="yoyo"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(89),r=i(0),s=i(581),o=i(24),a=i(21),h=i(582),l=i(583),c=i(97),u=i(161),d=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.preUpdate,this),t.on(a.UPDATE,this.update,this),t.once(a.SHUTDOWN,this.shutdown,this),this.timeScale=1},createTimeline:function(t){return l(this,t)},timeline:function(t){var e=l(this,t);return e.paused||(this._add.push(e),this._toProcess++),e},create:function(t){return u(this,t)},add:function(t){var e=u(this,t);return this._add.push(e),this._toProcess++,e},existing:function(t){return this._add.push(t),this._toProcess++,this},addCounter:function(t){var e=s(this,t);return this._add.push(e),this._toProcess++,e},stagger:function(t,e){return h(t,e)},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,n=this._active,r=this._pending;for(t=0;t<i.length;t++){e=i[t];var s=n.indexOf(e);-1===s?(s=r.indexOf(e))>-1&&(e.state=c.REMOVED,r.splice(s,1)):(e.state=c.REMOVED,n.splice(s,1))}for(i.length=0,i=this._add,t=0;t<i.length;t++)(e=i[t]).state===c.PENDING_ADD&&(e.init()?(e.play(),this._active.push(e)):this._pending.push(e));i.length=0,this._toProcess=0}},update:function(t,e){var i,n=this._active;e*=this.timeScale;for(var r=0;r<n.length;r++)(i=n[r]).update(t,e)&&(this._destroy.push(i),this._toProcess++)},remove:function(t){return n(this._add,t),n(this._pending,t),n(this._active,t),n(this._destroy,t),t.state=c.REMOVED,this},makeActive:function(t){if(-1!==this._add.indexOf(t)||-1!==this._active.indexOf(t))return this;var e=this._pending.indexOf(t);return-1!==e&&this._pending.splice(e,1),this._add.push(t),t.state=c.PENDING_ADD,this._toProcess++,this},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var r in this.list)i[0]=this.list[r],t.apply(e,i)},getAllTweens:function(){for(var t=this._active,e=[],i=0;i<t.length;i++)e.push(t[i]);return e},getGlobalTimeScale:function(){return this.timeScale},getTweensOf:function(t,e){void 0===e&&(e=!1);var i,n,r,s=this._active,o=[];for(Array.isArray(t)||(t=[t]),n=0;n<s.length;n++)for(i=s[n],r=0;r<t.length;r++)i.hasTarget(t[r])&&o.push(i);if(e)for(s=this._pending,n=0;n<s.length;n++)for(i=s[n],r=0;r<t.length;r++)i.hasTarget(t[r])&&o.push(i);return o},isTweening:function(t){for(var e,i=this._active,n=0;n<i.length;n++)if((e=i[n]).hasTarget(t)&&e.isPlaying())return!0;return!1},killAll:function(){for(var t=this.getAllTweens(),e=0;e<t.length;e++)t[e].stop();return this},killTweensOf:function(t){for(var e=this.getTweensOf(t),i=0;i<e.length;i++)e[i].stop();return this},pauseAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].pause();return this},resumeAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].resume();return this},setGlobalTimeScale:function(t){return this.timeScale=t,this},shutdown:function(){this.killAll(),this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0;var t=this.systems.events;t.off(a.PRE_UPDATE,this.preUpdate,this),t.off(a.UPDATE,this.update,this),t.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});o.register("TweenManager",d,"tweens"),t.exports=d},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Array:i(205),Base64:i(1475),Objects:i(1477),String:i(1481),NOOP:i(1)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={ArrayBufferToBase64:i(1476),Base64ToArrayBuffer:i(427)}},function(t,e){
|
|
/**
|
|
* @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer)
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,e){for(var n=new Uint8Array(t),r=n.length,s=e?"data:"+e+";base64,":"",o=0;o<r;o+=3)s+=i[n[o]>>2],s+=i[(3&n[o])<<4|n[o+1]>>4],s+=i[(15&n[o+1])<<2|n[o+2]>>6],s+=i[63&n[o+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Clone:i(77),DeepCopy:i(172),Extend:i(17),GetAdvancedValue:i(13),GetFastValue:i(2),GetMinMaxValue:i(1478),GetValue:i(6),HasAll:i(1479),HasAny:i(449),HasValue:i(125),IsPlainObject:i(7),Merge:i(143),MergeRight:i(1480),Pick:i(567),SetValue:i(472)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(6),r=i(18);t.exports=function(t,e,i,s,o){void 0===o&&(o=i);var a=n(t,e,o);return r(a,i,s)}},function(t,e){t.exports=function(t,e){for(var i=0;i<e.length;i++)if(!t.hasOwnProperty(e[i]))return!1;return!0}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(77);t.exports=function(t,e){var i=n(t);for(var r in e)i.hasOwnProperty(r)&&(i[r]=e[r]);return i}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Format:i(1482),Pad:i(183),RemoveAt:i(1483),Reverse:i(1484),UppercaseFirst:i(202),UUID:i(219)}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},function(t,e){t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @author Pavle Goloskokovic <pgoloskokovic@gmail.com> (http://prunegames.com)
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={SoundManagerCreator:i(420),Events:i(69),BaseSound:i(145),BaseSoundManager:i(144),WebAudioSound:i(428),WebAudioSoundManager:i(426),HTML5AudioSound:i(423),HTML5AudioSoundManager:i(421),NoAudioSound:i(425),NoAudioSoundManager:i(424)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(3),s=new n({initialize:function(){this.boundsCenter=new r,this.centerDiff=new r},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,n=t.bounds.max.x-t.bounds.min.x,r=t.bounds.max.y-t.bounds.min.y,s=n*t.centerOfMass.x,o=r*t.centerOfMass.y;return e.set(n/2,r/2),i.set(s-e.x,o-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+n.x+s.x,i+n.y+s.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+s.x,i+n.y+s.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e-(n.x-s.x),i+n.y+s.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+n.x+s.x,i+s.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.centerDiff;return new r(e+n.x,i+n.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e-(n.x-s.x),i+s.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+n.x+s.x,i-(n.y-s.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+s.x,i-(n.y-s.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e-(n.x-s.x),i-(n.y-s.y))}return!1}});t.exports=s},function(t,e){function i(t,e,i){i=i||0;var n,r,s,o,a,h,l,c=[0,0];return n=t[1][1]-t[0][1],r=t[0][0]-t[1][0],s=n*t[0][0]+r*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],T(l=n*a-o*r,0,i)||(c[0]=(a*s-r*h)/l,c[1]=(n*h-o*s)/l),c}function n(t,e,i,n){var r=e[0]-t[0],s=e[1]-t[1],o=n[0]-i[0],a=n[1]-i[1];if(o*s-a*r==0)return!1;var h=(r*(i[1]-t[1])+s*(t[0]-i[0]))/(o*s-a*r),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*r-o*s);return h>=0&&h<=1&&l>=0&&l<=1}function r(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function s(t,e,i){return r(t,e,i)>0}function o(t,e,i){return r(t,e,i)>=0}function a(t,e,i){return r(t,e,i)<0}function h(t,e,i){return r(t,e,i)<=0}
|
|
/**
|
|
* @author Stefan Hedman <schteppe@gmail.com> (http://steffe.se)
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={decomp:function(t){var e=function t(e){for(var i=[],n=[],r=[],s=[],o=Number.MAX_VALUE,a=0;a<e.length;++a)if(m(e,a))for(var h=0;h<e.length;++h)if(y(e,a,h)){n=t(b(e,a,h,s)),r=t(b(e,h,a,s));for(var l=0;l<r.length;l++)n.push(r[l]);n.length<o&&(i=n,o=n.length,i.push([p(e,a),p(e,h)]))}return i}(t);return e.length>0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],r=0;r<i.length;r++)for(var s=i[r],o=0;o<n.length;o++){var a=n[o],h=t(a,s);if(h){n.splice(o,1),n.push(h[0],h[1]);break}}return n}return s=i,r=e.indexOf(s[0]),o=e.indexOf(s[1]),-1!==r&&-1!==o&&[b(e,r,o),b(e,o,r)]}(t,e):[t]},quickDecomp:function t(e,i,n,r,l,c,u){c=c||100,u=u||0,l=l||25,i=void 0!==i?i:[],n=n||[],r=r||[];var g=[0,0],v=[0,0],y=[0,0],b=0,T=0,_=0,E=0,S=0,M=0,A=0,C=[],P=[],R=e,L=e;if(L.length<3)return i;if(++u>c)return console.warn("quickDecomp: max level ("+c+") reached."),i;for(var O=0;O<e.length;++O)if(m(R,O)){n.push(R[O]),b=T=Number.MAX_VALUE;for(var D=0;D<e.length;++D)s(p(R,O-1),p(R,O),p(R,D))&&h(p(R,O-1),p(R,O),p(R,D-1))&&(y=w(p(R,O-1),p(R,O),p(R,D),p(R,D-1)),a(p(R,O+1),p(R,O),y)&&(_=d(R[O],y))<T&&(T=_,v=y,M=D)),s(p(R,O+1),p(R,O),p(R,D+1))&&h(p(R,O+1),p(R,O),p(R,D))&&(y=w(p(R,O+1),p(R,O),p(R,D),p(R,D+1)),s(p(R,O-1),p(R,O),y)&&(_=d(R[O],y))<b&&(b=_,g=y,S=D));if(M===(S+1)%e.length)y[0]=(v[0]+g[0])/2,y[1]=(v[1]+g[1])/2,r.push(y),O<S?(f(C,R,O,S+1),C.push(y),P.push(y),0!==M&&f(P,R,M,R.length),f(P,R,0,O+1)):(0!==O&&f(C,R,O,R.length),f(C,R,0,S+1),C.push(y),P.push(y),f(P,R,M,O+1));else{if(M>S&&(S+=e.length),E=Number.MAX_VALUE,S<M)return i;for(D=M;D<=S;++D)o(p(R,O-1),p(R,O),p(R,D))&&h(p(R,O+1),p(R,O),p(R,D))&&(_=d(p(R,O),p(R,D)))<E&&x(R,O,D)&&(E=_,A=D%e.length);O<A?(f(C,R,O,A+1),0!==A&&f(P,R,A,L.length),f(P,R,0,O+1)):(0!==O&&f(C,R,O,L.length),f(C,R,0,A+1),f(P,R,A,O+1))}return C.length<P.length?(t(C,i,n,r,l,c,u),t(P,i,n,r,l,c,u)):(t(P,i,n,r,l,c,u),t(C,i,n,r,l,c,u)),i}return i.push(e),i},isSimple:function(t){var e,i=t;for(e=0;e<i.length-1;e++)for(var r=0;r<e-1;r++)if(n(i[e],i[e+1],i[r],i[r+1]))return!1;for(e=1;e<i.length-2;e++)if(n(i[0],i[i.length-1],i[e],i[e+1]))return!1;return!0},removeCollinearPoints:function(t,e){for(var i=0,n=t.length-1;t.length>3&&n>=0;--n)u(p(t,n-1),p(t,n),p(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],r=i-1;r>=0;--r)_(n,t[r],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;n<t.length;++n)(i[n][1]<i[e][1]||i[n][1]===i[e][1]&&i[n][0]>i[e][0])&&(e=n);return!s(p(t,e-1),p(t,e),p(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],c=[];function u(t,e,i,n){if(n){var s=l,o=c;s[0]=e[0]-t[0],s[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=s[0]*o[0]+s[1]*o[1],h=Math.sqrt(s[0]*s[0]+s[1]*s[1]),u=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*u))<n}return 0===r(t,e,i)}function d(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function p(t,e){var i=t.length;return t[e<0?e%i+i:e%i]}function f(t,e,i,n){for(var r=i;r<n;r++)t.push(e[r])}function m(t,e){return a(p(t,e-1),p(t,e),p(t,e+1))}var g=[],v=[];function y(t,e,n){var r,s,a=g,l=v;if(o(p(t,e+1),p(t,e),p(t,n))&&h(p(t,e-1),p(t,e),p(t,n)))return!1;s=d(p(t,e),p(t,n));for(var c=0;c!==t.length;++c)if((c+1)%t.length!==e&&c!==e&&o(p(t,e),p(t,n),p(t,c+1))&&h(p(t,e),p(t,n),p(t,c))&&(a[0]=p(t,e),a[1]=p(t,n),l[0]=p(t,c),l[1]=p(t,c+1),r=i(a,l),d(p(t,e),r)<s))return!1;return!0}function x(t,e,i){for(var r=0;r!==t.length;++r)if(r!==e&&r!==i&&(r+1)%t.length!==e&&(r+1)%t.length!==i&&n(p(t,e),p(t,i),p(t,r),p(t,r+1)))return!1;return!0}function b(t,e,i,n){var r=n||[];if(function(t){t.length=0}(r),e<i)for(var s=e;s<=i;s++)r.push(t[s]);else{for(s=0;s<=i;s++)r.push(t[s]);for(s=e;s<t.length;s++)r.push(t[s])}return r}function w(t,e,i,n,r){r=r||0;var s=e[1]-t[1],o=t[0]-e[0],a=s*t[0]+o*t[1],h=n[1]-i[1],l=i[0]-n[0],c=h*i[0]+l*i[1],u=s*l-h*o;return T(u,0,r)?[0,0]:[(l*a-o*c)/u,(s*c-h*a)/u]}function T(t,e,i){return i=i||0,Math.abs(t-e)<=i}function _(t,e,i){return T(t[0],e[0],i)&&T(t[1],e[1],i)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(126),r=i(0),s=i(1388),o=i(246),a=i(1389),h=i(1489),l=i(1490),c=i(1491),u=i(1390),d=i(1386),p=i(1387),f=i(1492),m=i(94),g=new r({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,r,s){var o=n.rectangle(t,e,i,r,s);return this.world.add(o),o},trapezoid:function(t,e,i,r,s,o){var a=n.trapezoid(t,e,i,r,s,o);return this.world.add(a),a},circle:function(t,e,i,r,s){var o=n.circle(t,e,i,r,s);return this.world.add(o),o},polygon:function(t,e,i,r,s){var o=n.polygon(t,e,i,r,s);return this.world.add(o),o},fromVertices:function(t,e,i,r,s,o,a){"string"==typeof i&&(i=m.fromPath(i));var h=n.fromVertices(t,e,i,r,s,o,a);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,n,r){void 0===r&&(r=!0);var s=d.parseBody(t,e,i,n);return r&&!this.world.has(s)&&this.world.add(s),s},fromSVG:function(t,e,i,r,s,o){void 0===r&&(r=1),void 0===s&&(s={}),void 0===o&&(o=!0);for(var h=i.getElementsByTagName("path"),l=[],c=0;c<h.length;c++){var u=a.pathToVertices(h[c],30);1!==r&&m.scale(u,r,r),l.push(u)}var d=n.fromVertices(t,e,l,s);return o&&this.world.add(d),d},fromJSON:function(t,e,i,n,r){void 0===n&&(n={}),void 0===r&&(r=!0);var s=p.parseBody(t,e,i,n);return s&&r&&this.world.add(s),s},imageStack:function(t,e,i,n,r,o,a,h,c){void 0===a&&(a=0),void 0===h&&(h=0),void 0===c&&(c={});var u=this.world,d=this.sys.displayList;c.addToWorld=!1;var p=s.stack(i,n,r,o,a,h,(function(i,n){var r=new l(u,i,n,t,e,c);return d.add(r),r.body}));return u.add(p),p},stack:function(t,e,i,n,r,o,a){var h=s.stack(t,e,i,n,r,o,a);return this.world.add(h),h},pyramid:function(t,e,i,n,r,o,a){var h=s.pyramid(t,e,i,n,r,o,a);return this.world.add(h),h},chain:function(t,e,i,n,r,o){return s.chain(t,e,i,n,r,o)},mesh:function(t,e,i,n,r){return s.mesh(t,e,i,n,r)},newtonsCradle:function(t,e,i,n,r){var o=s.newtonsCradle(t,e,i,n,r);return this.world.add(o),o},car:function(t,e,i,n,r){var o=s.car(t,e,i,n,r);return this.world.add(o),o},softBody:function(t,e,i,n,r,o,a,h,l,c){var u=s.softBody(t,e,i,n,r,o,a,h,l,c);return this.world.add(u),u},joint:function(t,e,i,n,r){return this.constraint(t,e,i,n,r)},spring:function(t,e,i,n,r){return this.constraint(t,e,i,n,r)},constraint:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r={}),r.bodyA="body"===t.type?t:t.body,r.bodyB="body"===e.type?e:e.body,isNaN(i)||(r.length=i),r.stiffness=n;var s=o.create(r);return this.world.add(s),s},worldConstraint:function(t,e,i,n){void 0===i&&(i=1),void 0===n&&(n={}),n.bodyB="body"===t.type?t:t.body,isNaN(e)||(n.length=e),n.stiffness=i;var r=o.create(n);return this.world.add(r),r},mouseSpring:function(t){return this.pointerConstraint(t)},pointerConstraint:function(t){void 0===t&&(t={}),t.hasOwnProperty("render")||(t.render={visible:!1});var e=new f(this.scene,this.world,t);return this.world.add(e.constraint),e},image:function(t,e,i,n,r){var s=new l(this.world,t,e,i,n,r);return this.sys.displayList.add(s),s},tileBody:function(t,e){return new u(this.world,t,e)},sprite:function(t,e,i,n,r){var s=new c(this.world,t,e,i,n,r);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},gameObject:function(t,e,i){return h(this.world,t,e,i)},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=g},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(534),r=i(2),s=i(3);t.exports=function(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var a=e.x,h=e.y;if(e.body={temp:!0,position:{x:a,y:h}},[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity].forEach((function(t){for(var i in t)(n=t[i]).get&&"function"==typeof n.get||n.set&&"function"==typeof n.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var n})),e.world=t,e._tempVec2=new s(a,h),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,o);else{var l=r(i,"shape",null);l||(l="rectangle"),i.addToWorld=o,e.setBody(l,i)}return e}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(0),r=i(534),s=i(15),o=i(2),a=i(124),h=i(171),l=i(3),c=new n({Extends:a,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,n,r,a){s.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline()}});t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(162),r=i(0),s=i(534),o=i(15),a=i(2),h=i(171),l=i(73),c=i(3),u=new r({Extends:l,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,h],initialize:function(t,e,i,r,s,h){o.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new n(this),this.setTexture(r,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new c(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline()}});t.exports=u},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(117),r=i(0),s=i(163),o=i(246),a=i(587),h=i(586),l=i(49),c=i(143),u=i(267),d=i(3),p=i(94),f=new r({initialize:function(t,e,i){void 0===i&&(i={}),this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=o.create(c(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var r=s.allBodies(this.world.localWorld),o=0;o<r.length;o++){var l=r[o];if(!l.ignorePointer&&n.contains(l.bounds,e)&&a.canCollide(l.collisionFilter,i.collisionFilter)&&this.hitTestBody(l,e))return this.world.emit(h.DRAG_START,l,this.part,this),!0}return!1},hitTestBody:function(t,e){for(var i=this.constraint,n=t.parts.length,r=n>1?1:0;r<n;r++){var s=t.parts[r];if(p.contains(s.vertices,e))return i.pointA=e,i.pointB={x:e.x-t.position.x,y:e.y-t.position.y},i.bodyB=t,i.angleB=t.angle,u.set(t,!1),this.part=s,this.body=t,!0}return!1},update:function(){var t=this.pointer,e=this.body;if(this.active&&t)if(t.isDown||!e){if(t.isDown){if(!e&&!this.getBody(t))return;e=this.body;var i=this.position,n=this.constraint;this.camera.getWorldPoint(t.x,t.y,i),n.pointA.x=i.x,n.pointA.y=i.y,u.set(e,!1),this.world.emit(h.DRAG,e,this)}}else this.stopDrag();else e&&this.stopDrag()},stopDrag:function(){var t=this.body,e=this.constraint;e.bodyB=null,e.pointB=null,this.pointer=null,this.body=null,this.part=null,t&&this.world.emit(h.DRAG_END,t,this)},destroy:function(){this.world.removeConstraint(this.constraint),this.pointer=null,this.constraint=null,this.body=null,this.part=null,this.world.off(h.BEFORE_UPDATE,this.update),this.scene.sys.input.off(l.POINTER_DOWN,this.onDown,this),this.scene.sys.input.off(l.POINTER_UP,this.onUp,this)}});t.exports=f},function(t,e,i){var n={};t.exports=n;var r=i(1392),s=i(50);n.name="matter-js",n.version="0.14.2",n.uses=[],n.used=[],n.use=function(){r.use(n,Array.prototype.slice.call(arguments))},n.before=function(t,e){return t=t.replace(/^Matter./,""),s.chainPathBefore(n,t,e)},n.after=function(t,e){return t=t.replace(/^Matter./,""),s.chainPathAfter(n,t,e)}},function(t,e,i){var n={};t.exports=n;var r=i(116),s=i(588),o=i(117),a=i(126),h=i(94);n.collides=function(t,e){for(var i=[],n=0;n<e.length;n++){var r=e[n];if(t!==r&&o.overlaps(r.bounds,t.bounds))for(var a=1===r.parts.length?0:1;a<r.parts.length;a++){var h=r.parts[a];if(o.overlaps(h.bounds,t.bounds)){var l=s.collides(h,t);if(l.collided){i.push(l);break}}}}return i},n.ray=function(t,e,i,s){s=s||1e-100;for(var o=r.angle(e,i),h=r.magnitude(r.sub(e,i)),l=.5*(i.x+e.x),c=.5*(i.y+e.y),u=a.rectangle(l,c,h,s,{angle:o}),d=n.collides(u,t),p=0;p<d.length;p+=1){var f=d[p];f.body=f.bodyB=f.bodyA}return d},n.region=function(t,e,i){for(var n=[],r=0;r<t.length;r++){var s=t[r],a=o.overlaps(s.bounds,e);(a&&!i||!a&&i)&&n.push(s)}return n},n.point=function(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n];if(o.contains(r.bounds,e))for(var s=1===r.parts.length?0:1;s<r.parts.length;s++){var a=r.parts[s];if(o.contains(a.bounds,e)&&h.contains(a.vertices,e)){i.push(r);break}}}return i}},function(t,e,i){var n={};t.exports=n;var r=i(1393),s=i(267),o=i(1396),a=i(1395),h=i(1528),l=i(1394),c=i(268),u=i(163),d=i(246),p=i(50),f=i(71);n.create=function(t,e){e=(e=p.isElement(t)?e:t)||{},((t=p.isElement(t)?t:null)||e.render)&&p.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},n=p.extend(i,e);return n.world=e.world||r.create(n.world),n.pairs=a.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=h.create(n.metrics),n},n.update=function(t,e,i){e=e||1e3/60,i=i||1;var r,l=t.world,p=t.timing,f=t.broadphase,m=[];p.timestamp+=e*p.timeScale;var g={timestamp:p.timestamp};c.trigger(t,"beforeUpdate",g);var v=u.allBodies(l),y=u.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&s.update(v,p.timeScale),n._bodiesApplyGravity(v,l.gravity),n._bodiesUpdate(v,e,p.timeScale,i,l.bounds),d.preSolveAll(v),r=0;r<t.constraintIterations;r++)d.solveAll(y,p.timeScale);d.postSolveAll(v),f.controller?(l.isModified&&f.controller.clear(f),f.controller.update(f,v,t,l.isModified),m=f.pairsList):m=v,l.isModified&&u.setModified(l,!1,!1,!0);var x=f.detector(m,t),b=t.pairs,w=p.timestamp;for(a.update(b,x,w),a.removeOld(b,w),t.enableSleeping&&s.afterCollisions(b.list,p.timeScale),b.collisionStart.length>0&&c.trigger(t,"collisionStart",{pairs:b.collisionStart}),o.preSolvePosition(b.list),r=0;r<t.positionIterations;r++)o.solvePosition(b.list,v,p.timeScale);for(o.postSolvePosition(v),d.preSolveAll(v),r=0;r<t.constraintIterations;r++)d.solveAll(y,p.timeScale);for(d.postSolveAll(v),o.preSolveVelocity(b.list),r=0;r<t.velocityIterations;r++)o.solveVelocity(b.list,p.timeScale);return b.collisionActive.length>0&&c.trigger(t,"collisionActive",{pairs:b.collisionActive}),b.collisionEnd.length>0&&c.trigger(t,"collisionEnd",{pairs:b.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(v),c.trigger(t,"afterUpdate",g),t},n.merge=function(t,e){if(p.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=u.allBodies(t.world),r=0;r<i.length;r++){var o=i[r];s.set(o,!1),o.id=p.nextId()}}},n.clear=function(t){var e=t.world;a.clear(t.pairs);var i=t.broadphase;if(i.controller){var n=u.allBodies(e);i.controller.clear(i),i.controller.update(i,n,t,!0)}},n._bodiesClearForces=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.force.x=0,i.force.y=0,i.torque=0}},n._bodiesApplyGravity=function(t,e){var i=void 0!==e.scale?e.scale:.001;if((0!==e.x||0!==e.y)&&0!==i)for(var n=0;n<t.length;n++){var r=t[n];r.ignoreGravity||r.isStatic||r.isSleeping||(r.force.x+=r.mass*e.x*i*r.gravityScale.x,r.force.y+=r.mass*e.y*i*r.gravityScale.y)}},n._bodiesUpdate=function(t,e,i,n,r){for(var s=0;s<t.length;s++){var o=t[s];o.isStatic||o.isSleeping||f.update(o,e,i,n)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(126),r=i(71),s=i(0),o=i(50),a=i(163),h=i(1495),l=i(9),c=i(586),u=i(2),d=i(6),p=i(71),f=i(268),m=i(1390),g=i(1393),v=i(116),y=new s({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=d(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(e,"enabled",!0),this.correction=d(e,"correction",1),this.getDelta=d(e,"getDelta",this.update60Hz);var n=u(e,"runner",{}),r=u(n,"fps",!1),s=u(n,"fps",60),o=u(n,"delta",1e3/s),a=u(n,"deltaMin",1e3/s),c=u(n,"deltaMax",1e3/(.5*s));r||(s=1e3/o),this.runner={fps:s,correction:u(n,"correction",1),deltaSampleSize:u(n,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:u(n,"isFixed",!1),delta:o,deltaMin:a,deltaMax:c},this.autoUpdate=d(e,"autoUpdate",!0);var p=d(e,"debug",!1);if(this.drawDebug="object"==typeof p||p,this.debugGraphic,this.debugConfig={showAxes:u(p,"showAxes",!1),showAngleIndicator:u(p,"showAngleIndicator",!1),angleColor:u(p,"angleColor",15208787),showBroadphase:u(p,"showBroadphase",!1),broadphaseColor:u(p,"broadphaseColor",16757760),showBounds:u(p,"showBounds",!1),boundsColor:u(p,"boundsColor",16777215),showVelocity:u(p,"showVelocity",!1),velocityColor:u(p,"velocityColor",44783),showCollisions:u(p,"showCollisions",!1),collisionColor:u(p,"collisionColor",16094476),showSeparations:u(p,"showSeparations",!1),separationColor:u(p,"separationColor",16753920),showBody:u(p,"showBody",!0),showStaticBody:u(p,"showStaticBody",!0),showInternalEdges:u(p,"showInternalEdges",!1),renderFill:u(p,"renderFill",!1),renderLine:u(p,"renderLine",!0),fillColor:u(p,"fillColor",1075465),fillOpacity:u(p,"fillOpacity",1),lineColor:u(p,"lineColor",2678297),lineOpacity:u(p,"lineOpacity",1),lineThickness:u(p,"lineThickness",1),staticFillColor:u(p,"staticFillColor",857979),staticLineColor:u(p,"staticLineColor",1255396),showSleeping:u(p,"showSleeping",!1),staticBodySleepOpacity:u(p,"staticBodySleepOpacity",.7),sleepFillColor:u(p,"sleepFillColor",4605510),sleepLineColor:u(p,"sleepLineColor",10066585),showSensors:u(p,"showSensors",!0),sensorFillColor:u(p,"sensorFillColor",857979),sensorLineColor:u(p,"sensorLineColor",1255396),showPositions:u(p,"showPositions",!0),positionSize:u(p,"positionSize",4),positionColor:u(p,"positionColor",14697178),showJoint:u(p,"showJoint",!0),jointColor:u(p,"jointColor",14737474),jointLineOpacity:u(p,"jointLineOpacity",1),jointLineThickness:u(p,"jointLineThickness",2),pinSize:u(p,"pinSize",4),pinColor:u(p,"pinColor",4382944),springColor:u(p,"springColor",14697184),anchorColor:u(p,"anchorColor",15724527),anchorSize:u(p,"anchorSize",4),showConvexHulls:u(p,"showConvexHulls",!1),hullColor:u(p,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),u(e,"setBounds",!1)){var f=e.setBounds;if("boolean"==typeof f)this.setBounds();else{var m=u(f,"x",0),g=u(f,"y",0),v=u(f,"width",t.sys.scale.width),y=u(f,"height",t.sys.scale.height),x=u(f,"thickness",64),b=u(f,"left",!0),w=u(f,"right",!0),T=u(f,"top",!0),_=u(f,"bottom",!0);this.setBounds(m,g,v,y,x,b,w,T,_)}}},setCompositeRenderStyle:function(t){var e,i,n,r=t.bodies,s=t.constraints,o=t.composites;for(e=0;e<r.length;e++)n=(i=r[e]).render,this.setBodyRenderStyle(i,n.lineColor,n.lineOpacity,n.lineThickness,n.fillColor,n.fillOpacity);for(e=0;e<s.length;e++)n=(i=s[e]).render,this.setConstraintRenderStyle(i,n.lineColor,n.lineOpacity,n.lineThickness,n.pinSize,n.anchorColor,n.anchorSize);for(e=0;e<o.length;e++)i=o[e],this.setCompositeRenderStyle(i);return this},setBodyRenderStyle:function(t,e,i,n,r,s){var o=t.render,a=this.debugConfig;return o?(null==e&&(e=t.isStatic?a.staticLineColor:a.lineColor),null==i&&(i=a.lineOpacity),null==n&&(n=a.lineThickness),null==r&&(r=t.isStatic?a.staticFillColor:a.fillColor),null==s&&(s=a.fillOpacity),!1!==e&&(o.lineColor=e),!1!==i&&(o.lineOpacity=i),!1!==n&&(o.lineThickness=n),!1!==r&&(o.fillColor=r),!1!==s&&(o.fillOpacity=s),this):this},setConstraintRenderStyle:function(t,e,i,n,r,s,o){var a=t.render,h=this.debugConfig;if(!a)return this;if(null==e){var l=a.type;"line"===l?e=h.jointColor:"pin"===l?e=h.pinColor:"spring"===l&&(e=h.springColor)}return null==i&&(i=h.jointLineOpacity),null==n&&(n=h.jointLineThickness),null==r&&(r=h.pinSize),null==s&&(s=h.anchorColor),null==o&&(o=h.anchorSize),!1!==e&&(a.lineColor=e),!1!==i&&(a.lineOpacity=i),!1!==n&&(a.lineThickness=n),!1!==r&&(a.pinSize=r),!1!==s&&(a.anchorColor=s),!1!==o&&(a.anchorSize=o),this},setEventsProxy:function(){var t=this,e=this.engine,i=this.localWorld;this.drawDebug&&(f.on(i,"compositeModified",(function(e){t.setCompositeRenderStyle(e)})),f.on(i,"beforeAdd",(function(e){for(var i=[].concat(e.object),n=0;n<i.length;n++){var r=i[n],s=r.render;"body"===r.type?t.setBodyRenderStyle(r,s.lineColor,s.lineOpacity,s.lineThickness,s.fillColor,s.fillOpacity):"composite"===r.type?t.setCompositeRenderStyle(r):"constraint"===r.type&&t.setConstraintRenderStyle(r,s.lineColor,s.lineOpacity,s.lineThickness,s.pinSize,s.anchorColor,s.anchorSize)}}))),f.on(i,"beforeAdd",(function(e){t.emit(c.BEFORE_ADD,e)})),f.on(i,"afterAdd",(function(e){t.emit(c.AFTER_ADD,e)})),f.on(i,"beforeRemove",(function(e){t.emit(c.BEFORE_REMOVE,e)})),f.on(i,"afterRemove",(function(e){t.emit(c.AFTER_REMOVE,e)})),f.on(e,"beforeUpdate",(function(e){t.emit(c.BEFORE_UPDATE,e)})),f.on(e,"afterUpdate",(function(e){t.emit(c.AFTER_UPDATE,e)})),f.on(e,"collisionStart",(function(e){var i,n,r=e.pairs;r.length>0&&(i=r[0].bodyA,n=r[0].bodyB),t.emit(c.COLLISION_START,e,i,n)})),f.on(e,"collisionActive",(function(e){var i,n,r=e.pairs;r.length>0&&(i=r[0].bodyA,n=r[0].bodyB),t.emit(c.COLLISION_ACTIVE,e,i,n)})),f.on(e,"collisionEnd",(function(e){var i,n,r=e.pairs;r.length>0&&(i=r[0].bodyA,n=r[0].bodyB),t.emit(c.COLLISION_END,e,i,n)}))},setBounds:function(t,e,i,n,r,s,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=64),void 0===s&&(s=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(s,"left",t-r,e-r,r,n+2*r),this.updateWall(o,"right",t+i,e-r,r,n+2*r),this.updateWall(a,"top",t,e-r,i,r),this.updateWall(h,"bottom",t,e+n,i,r),this},updateWall:function(t,e,i,n,r,s){var o=this.walls[e];t?(o&&g.remove(this.localWorld,o),i+=r/2,n+=s/2,this.walls[e]=this.create(i,n,r,s,{isStatic:!0,friction:0,frictionStatic:0})):(o&&g.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,r,s){var o=n.rectangle(t,e,i,r,s);return g.add(this.localWorld,o),o},add:function(t){return g.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i],r=n.body?n.body:n;a.remove(this.localWorld,r,e)}return this},removeConstraint:function(t,e){return a.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i<t.length;i++)new m(this,t[i],e);return this},nextGroup:function(t){return p.nextGroup(t)},nextCategory:function(){return p.nextCategory()},pause:function(){return this.enabled=!1,this.emit(c.PAUSE),this},resume:function(){return this.enabled=!0,this.emit(c.RESUME),this},update:function(t,e){if(this.enabled&&this.autoUpdate){var i=this.engine,n=this.runner,r=i.timing,s=this.correction;n.isFixed?e=this.getDelta(t,e):(e=t-n.timePrev||n.delta,n.timePrev=t,n.deltaHistory.push(e),n.deltaHistory=n.deltaHistory.slice(-n.deltaSampleSize),s=(e=(e=(e=Math.min.apply(null,n.deltaHistory))<n.deltaMin?n.deltaMin:e)>n.deltaMax?n.deltaMax:e)/n.delta,n.delta=e),0!==n.timeScalePrev&&(s*=r.timeScale/n.timeScalePrev),0===r.timeScale&&(s=0),n.timeScalePrev=r.timeScale,n.correction=s,n.frameCounter+=1,t-n.counterTimestamp>=1e3&&(n.fps=n.frameCounter*((t-n.counterTimestamp)/1e3),n.counterTimestamp=t,n.frameCounter=0),h.update(i,e,s)}},step:function(t,e){h.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==a.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return a.allBodies(this.localWorld)},getAllConstraints:function(){return a.allConstraints(this.localWorld)},getAllComposites:function(){return a.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,n=a.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(n,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(n),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(n,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(n,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,n){e.lineStyle(1,i,n);for(var r=o.keys(t.buckets),s=0;s<r.length;s++){var a=r[s];if(!(t.buckets[a].length<2)){var h=a.split(/C|R/);e.strokeRect(parseInt(h[1],10)*t.bucketWidth,parseInt(h[2],10)*t.bucketHeight,t.bucketWidth,t.bucketHeight)}}return this},renderSeparations:function(t,e,i){e.lineStyle(1,i,1);for(var n=0;n<t.length;n++){var r=t[n];if(r.isActive){var s=r.collision,o=s.bodyA,a=s.bodyB,h=o.position,l=a.position,c=s.penetration,u=o.isStatic||a.isStatic?1:4;a.isStatic&&(u=0),e.lineBetween(l.x,l.y,l.x-c.x*u,l.y-c.y*u),u=o.isStatic||a.isStatic?1:4,o.isStatic&&(u=0),e.lineBetween(h.x,h.y,h.x-c.x*u,h.y-c.y*u)}}return this},renderCollisions:function(t,e,i){var n,r;for(e.lineStyle(1,i,.5),e.fillStyle(i,1),n=0;n<t.length;n++)if((r=t[n]).isActive)for(var s=0;s<r.activeContacts.length;s++){var o=r.activeContacts[s].vertex;e.fillRect(o.x-2,o.y-2,5,5)}for(n=0;n<t.length;n++)if((r=t[n]).isActive){var a=r.collision,h=r.activeContacts;if(h.length>0){var l=h[0].vertex.x,c=h[0].vertex.y;2===h.length&&(l=(h[0].vertex.x+h[1].vertex.x)/2,c=(h[0].vertex.y+h[1].vertex.y)/2),a.bodyB===a.supports[0].body||a.bodyA.isStatic?e.lineBetween(l-8*a.normal.x,c-8*a.normal.y,l,c):e.lineBetween(l+8*a.normal.x,c+8*a.normal.y,l,c)}}return this},renderBodyBounds:function(t,e,i,n){e.lineStyle(1,i,n);for(var r=0;r<t.length;r++){var s=t[r];if(s.render.visible){var o=s.bounds;if(o)e.strokeRect(o.min.x,o.min.y,o.max.x-o.min.x,o.max.y-o.min.y);else for(var a=s.parts,h=a.length>1?1:0;h<a.length;h++){var l=a[h];e.strokeRect(l.bounds.min.x,l.bounds.min.y,l.bounds.max.x-l.bounds.min.x,l.bounds.max.y-l.bounds.min.y)}}}return this},renderBodyAxes:function(t,e,i,n,r){e.lineStyle(1,n,r);for(var s=0;s<t.length;s++){var o,a,h,l=t[s],c=l.parts;if(l.render.visible)if(i)for(a=c.length>1?1:0;a<c.length;a++)for(o=c[a],h=0;h<o.axes.length;h++){var u=o.axes[h];e.lineBetween(o.position.x,o.position.y,o.position.x+20*u.x,o.position.y+20*u.y)}else for(a=c.length>1?1:0;a<c.length;a++)for(o=c[a],h=0;h<o.axes.length;h++)e.lineBetween(o.position.x,o.position.y,(o.vertices[0].x+o.vertices[o.vertices.length-1].x)/2,(o.vertices[0].y+o.vertices[o.vertices.length-1].y)/2)}return this},renderBodyVelocity:function(t,e,i,n,r){e.lineStyle(r,i,n);for(var s=0;s<t.length;s++){var o=t[s];o.render.visible&&e.lineBetween(o.position.x,o.position.y,o.position.x+2*(o.position.x-o.positionPrev.x),o.position.y+2*(o.position.y-o.positionPrev.y))}return this},renderBodies:function(t){for(var e=this.debugGraphic,i=this.debugConfig,n=i.showBody,r=i.showStaticBody,s=i.showSleeping,o=i.showInternalEdges,a=i.showConvexHulls,h=i.renderFill,l=i.renderLine,c=i.staticBodySleepOpacity,u=i.sleepFillColor,d=i.sleepLineColor,p=i.hullColor,f=0;f<t.length;f++){var m=t[f];if(m.render.visible&&(r||!m.isStatic)&&(n||m.isStatic)){var g=m.render.lineColor,v=m.render.lineOpacity,y=m.render.lineThickness,x=m.render.fillColor,b=m.render.fillOpacity;s&&m.isSleeping&&(m.isStatic?(v*=c,b*=c):(g=d,x=u)),h||(x=null),l||(g=null),this.renderBody(m,e,o,g,v,y,x,b);var w=m.parts.length;a&&w>1&&this.renderConvexHull(m,e,p,y)}}},renderBody:function(t,e,i,n,r,s,o,a){void 0===n&&(n=null),void 0===r&&(r=null),void 0===s&&(s=1),void 0===o&&(o=null),void 0===a&&(a=null);for(var h=this.debugConfig,l=h.sensorFillColor,c=h.sensorLineColor,u=t.parts,d=u.length,p=d>1?1:0;p<d;p++){var f=u[p],m=f.render,g=m.opacity;if(m.visible&&0!==g&&(!f.isSensor||h.showSensors)){var v=f.circleRadius;if(e.beginPath(),f.isSensor?(null!==o&&e.fillStyle(l,a*g),null!==n&&e.lineStyle(s,c,r*g)):(null!==o&&e.fillStyle(o,a*g),null!==n&&e.lineStyle(s,n,r*g)),v)e.arc(f.position.x,f.position.y,v,0,2*Math.PI);else{var y=f.vertices,x=y.length;e.moveTo(y[0].x,y[0].y);for(var b=1;b<x;b++){var w=y[b];if(!y[b-1].isInternal||i?e.lineTo(w.x,w.y):e.moveTo(w.x,w.y),b<x&&w.isInternal&&!i){var T=(b+1)%x;e.moveTo(y[T].x,y[T].y)}}e.closePath()}null!==o&&e.fillPath(),null!==n&&e.strokePath()}}if(h.showPositions&&!t.isStatic){var _=t.position.x,E=t.position.y,S=Math.ceil(h.positionSize/2);e.fillStyle(h.positionColor,1),e.fillRect(_-S,E-S,h.positionSize,h.positionSize)}return this},renderConvexHull:function(t,e,i,n){if(void 0===n&&(n=1),t.parts.length>1){var r=t.vertices;e.lineStyle(n,i),e.beginPath(),e.moveTo(r[0].x,r[0].y);for(var s=1;s<r.length;s++)e.lineTo(r[s].x,r[s].y);e.lineTo(r[0].x,r[0].y),e.strokePath()}return this},renderJoints:function(){for(var t=this.debugGraphic,e=a.allConstraints(this.localWorld),i=0;i<e.length;i++){var n=e[i].render,r=n.lineColor,s=n.lineOpacity,o=n.lineThickness,h=n.pinSize,l=n.anchorColor,c=n.anchorSize;this.renderConstraint(e[i],t,r,s,o,h,l,c)}},renderConstraint:function(t,e,i,n,r,s,a,h){var l=t.render;if(!l.visible||!t.pointA||!t.pointB)return this;e.lineStyle(r,i,n);var c,u,d=t.bodyA,p=t.bodyB;if(c=d?v.add(d.position,t.pointA):t.pointA,"pin"===l.type)e.strokeCircle(c.x,c.y,s);else{if(u=p?v.add(p.position,t.pointB):t.pointB,e.beginPath(),e.moveTo(c.x,c.y),"spring"===l.type)for(var f,m=v.sub(u,c),g=v.perp(v.normalise(m)),y=Math.ceil(o.clamp(t.length/5,12,20)),x=1;x<y;x+=1)f=x%2==0?1:-1,e.lineTo(c.x+m.x*(x/y)+g.x*f*4,c.y+m.y*(x/y)+g.y*f*4);e.lineTo(u.x,u.y)}return e.strokePath(),l.anchors&&h>0&&(e.fillStyle(a),e.fillCircle(c.x,c.y,h),e.fillCircle(u.x,u.y,h)),this},resetCollisionIDs:function(){return r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,this},shutdown:function(){f.off(this.engine),this.removeAllListeners(),g.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=y},function(t,e,i){(function(e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
i(590);var n=i(32),r=i(17),s={Actions:i(269),Animations:i(699),BlendModes:i(34),Cache:i(711),Cameras:i(714),Core:i(803),Class:i(0),Create:i(884),Curves:i(890),Data:i(892),Display:i(894),DOM:i(913),Events:i(914),Game:i(916),GameObjects:i(1007),Geom:i(477),Input:i(1302),Loader:i(1332),Math:i(190),Physics:i(1498),Plugins:i(1397),Renderer:i(1399),Scale:i(1406),ScaleModes:i(164),Scene:i(412),Scenes:i(1407),Structs:i(1409),Textures:i(1410),Tilemaps:i(1412),Time:i(1454),Tweens:i(1456),Utils:i(1474)};s.Sound=i(1485),s=r(!1,s,n),t.exports=s,e.Phaser=s}).call(this,i(589))},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={Arcade:i(1360),Matter:i(1499)}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports={BodyBounds:i(1486),Components:i(534),Events:i(586),Factory:i(1488),MatterGameObject:i(1489),Image:i(1490),Matter:i(1391),MatterPhysics:i(1529),PolyDecomp:i(1487),Sprite:i(1491),TileBody:i(1390),PhysicsEditorParser:i(1386),PhysicsJSONParser:i(1387),PointerConstraint:i(1492),World:i(1496)}},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i<t.length;i++)e|=t[i];else e=t;return this.body.collisionFilter.mask=e,this},setOnCollide:function(t){return this.body.onCollideCallback=t,this},setOnCollideEnd:function(t){return this.body.onCollideEndCallback=t,this},setOnCollideActive:function(t){return this.body.onCollideActiveCallback=t,this},setOnCollideWith:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i].hasOwnProperty("body")?t[i].body:t[i];this.body.setOnCollideWith(n,e)}return this}};t.exports=i},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(71),r={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),n.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return n.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=r},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var i={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};t.exports=i},function(t,e){t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(71),r=i(3),s={setMass:function(t){return n.setMass(this.body,t),this},setDensity:function(t){return n.setDensity(this.body,t),this},centerOfMass:{get:function(){return new r(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=s},function(t,e){t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(126),r=i(71),s=i(123),o=i(2),a=i(1386),h=i(1387),l=i(94),c={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,n){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},n)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i<t.parts.length;i++)t.parts[i].gameObject=this;var n=this;if(t.destroy=function(){n.world.remove(n.body,!0),n.body.gameObject=null},e&&(this.world.has(t)&&this.world.remove(t,!0),this.world.add(t)),this._originComponent){var r=t.render.sprite.xOffset,o=t.render.sprite.yOffset,a=t.centerOfMass.x,h=t.centerOfMass.y;if(s(a,.5)&&s(h,.5))this.setOrigin(r+.5,o+.5);else{var l=t.centerOffset.x,c=t.centerOffset.y;this.setOrigin(r+l/this.displayWidth,o+c/this.displayHeight)}}return this},setBody:function(t,e){if(!t)return this;var i;"string"==typeof t&&(t={type:t});var s=o(t,"type","rectangle"),c=o(t,"x",this._tempVec2.x),u=o(t,"y",this._tempVec2.y),d=o(t,"width",this.width),p=o(t,"height",this.height);switch(s){case"rectangle":i=n.rectangle(c,u,d,p,e);break;case"circle":var f=o(t,"radius",Math.max(d,p)/2),m=o(t,"maxSides",25);i=n.circle(c,u,f,e,m);break;case"trapezoid":var g=o(t,"slope",.5);i=n.trapezoid(c,u,d,p,g,e);break;case"polygon":var v=o(t,"sides",5),y=o(t,"radius",Math.max(d,p)/2);i=n.polygon(c,u,v,y,e);break;case"fromVertices":case"fromVerts":var x=o(t,"verts",null);if(x)if("string"==typeof x&&(x=l.fromPath(x)),this.body&&!this.body.hasOwnProperty("temp"))r.setVertices(this.body,x),i=this.body;else{var b=o(t,"flagInternal",!1),w=o(t,"removeCollinear",.01),T=o(t,"minimumArea",10);i=n.fromVertices(c,u,x,e,b,w,T)}break;case"fromPhysicsEditor":i=a.parseBody(c,u,t,e);break;case"fromPhysicsTracer":i=h.parseBody(c,u,t,e)}return i&&this.setExistingBody(i,t.addToWorld),this}};t.exports=c},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(586),r=i(267),s=i(268),o={setToSleep:function(){r.set(this.body,!0)},setAwake:function(){r.set(this.body,!1)},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;s.on(this.body,"sleepStart",(function(t){e.emit(n.SLEEP_START,t,this)}))}else s.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;s.on(this.body,"sleepEnd",(function(t){e.emit(n.SLEEP_END,t,this)}))}else s.off(this.body,"sleepEnd");return this}};t.exports=o},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="afteradd"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="afterremove"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="afterupdate"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="beforeadd"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="beforeremove"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="beforeupdate"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="collisionactive"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="collisionend"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="collisionstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragend"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="drag"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="dragstart"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="pause"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="resume"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="sleepend"},function(t,e){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
t.exports="sleepstart"},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(71),r={setStatic:function(t){return n.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=r},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(71),r=i(14),s=i(265),o=i(266),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),n.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),n.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,e,i),n.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,e,i),n.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*r.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*r.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=s(t),n.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),n.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=s(t),n.setAngle(this.body,t),this},setFixedRotation:function(){return n.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,n.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var r=1/this._scaleX,s=1/this._scaleY;return this._scaleX=t,this._scaleY=e,n.scale(this.body,r,s,i),n.scale(this.body,t,e,i),this}};t.exports=a},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(71),r={setAngularVelocity:function(t){return n.setAngularVelocity(this.body,t),this},setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),n.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),n.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),n.setVelocity(this.body,this._tempVec2),this}};t.exports=r},function(t,e,i){var n={};t.exports=n;var r=i(163),s=i(50);n.create=function(t){return s.extend({extended:!1,narrowDetections:0,narrowphaseTests:0,narrowReuse:0,narrowReuseCount:0,midphaseTests:0,broadphaseTests:0,narrowEff:1e-4,midEff:1e-4,broadEff:1e-4,collisions:0,buckets:0,bodies:0,pairs:0},!1,t)},n.reset=function(t){t.extended&&(t.narrowDetections=0,t.narrowphaseTests=0,t.narrowReuse=0,t.narrowReuseCount=0,t.midphaseTests=0,t.broadphaseTests=0,t.narrowEff=0,t.midEff=0,t.broadEff=0,t.collisions=0,t.buckets=0,t.pairs=0,t.bodies=0)},n.update=function(t,e){if(t.extended){var i=e.world,n=r.allBodies(i);t.collisions=t.narrowDetections,t.pairs=e.pairs.list.length,t.bodies=n.length,t.midEff=(t.narrowDetections/(t.midphaseTests||1)).toFixed(2),t.narrowEff=(t.narrowDetections/(t.narrowphaseTests||1)).toFixed(2),t.broadEff=(1-t.broadphaseTests/(n.length||1)).toFixed(2),t.narrowReuse=(t.narrowReuseCount/(t.narrowphaseTests||1)).toFixed(2)}}},function(t,e,i){
|
|
/**
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
* @copyright 2020 Photon Storm Ltd.
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
*/
|
|
var n=i(122),r=i(585),s=i(126),o=i(71),a=i(1486),h=i(117),l=i(0),c=i(163),u=i(1388),d=i(246),p=i(587),f=i(48),m=i(1488),g=i(2),v=i(6),y=i(1394),x=i(1530),b=i(1531),w=i(1493),T=i(1532),_=i(143),E=i(535),S=i(1395),M=i(1392),A=i(24),C=i(1494),P=i(1396),R=i(588),L=i(21),O=i(1389),D=i(116),I=i(94),F=i(1496),B=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=o,this.composite=c,this.detector=p,this.grid=y,this.pair=E,this.pairs=S,this.query=C,this.resolver=P,this.sat=R,this.constraint=d,this.bodies=s,this.composites=u,this.axes=r,this.bounds=h,this.svg=O,this.vector=D,this.vertices=I,this.verts=I,this._tempVec2=D.create(),v(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),v(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),v(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),P._restingThresh=v(this.config,"restingThresh",4),P._restingThreshTangent=v(this.config,"restingThreshTangent",6),P._positionDampen=v(this.config,"positionDampen",.9),P._positionWarming=v(this.config,"positionWarming",.8),P._frictionNormalMultiplier=v(this.config,"frictionNormalMultiplier",5),t.sys.events.once(L.BOOT,this.boot,this),t.sys.events.on(L.START,this.start,this)},boot:function(){this.world=new F(this.scene,this.config),this.add=new m(this.world),this.bodyBounds=new a,this.systems.events.once(L.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new F(this.scene,this.config),this.add=new m(this.world));var t=this.systems.events;t.on(L.UPDATE,this.world.update,this.world),t.on(L.POST_UPDATE,this.world.postUpdate,this.world),t.once(L.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return _(g(e,"matter",{}),g(t,"matter",{}))},enableAttractorPlugin:function(){return M.register(x),M.use(w,x),this},enableWrapPlugin:function(){return M.register(T),M.use(w,T),this},enableCollisionEventsPlugin:function(){return M.register(b),M.use(w,b),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var n=D.create(e,i);return C.point(t,n).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var n=D.create(t,e),r=[];return C.point(i,n).forEach((function(t){-1===r.indexOf(t)&&r.push(t)})),r},intersectRect:function(t,e,i,n,r,s){void 0===r&&(r=!1),s=this.getMatterBodies(s);var o={min:{x:t,y:e},max:{x:t+i,y:e+n}},a=[];return C.region(s,o,r).forEach((function(t){-1===a.indexOf(t)&&a.push(t)})),a},intersectRay:function(t,e,i,n,r,s){void 0===r&&(r=1),s=this.getMatterBodies(s);for(var o=[],a=C.ray(s,D.create(t,e),D.create(i,n),r),h=0;h<a.length;h++)o.push(a[h].body);return o},intersectBody:function(t,e){e=this.getMatterBodies(e);for(var i=[],n=C.collides(t,e),r=0;r<n.length;r++){var s=n[r];s.bodyA===t?i.push(s.bodyB):i.push(s.bodyA)}return i},overlap:function(t,e,i,n,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),Array.isArray(t)||(t=[t]),t=this.getMatterBodies(t),e=this.getMatterBodies(e);for(var s=!1,o=0;o<t.length;o++)for(var a=t[o],h=C.collides(a,e),l=0;l<h.length;l++){var c=h[l],u=c.bodyA.id===a.id?c.bodyB:c.bodyA;if(!n||n.call(r,a,u,c))if(s=!0,i)i.call(r,a,u,c);else if(!n)return!0}return s},setCollisionCategory:function(t,e){return(t=this.getMatterBodies(t)).forEach((function(t){t.collisionFilter.category=e})),this},setCollisionGroup:function(t,e){return(t=this.getMatterBodies(t)).forEach((function(t){t.collisionFilter.group=e})),this},setCollidesWith:function(t,e){t=this.getMatterBodies(t);var i=0;if(Array.isArray(e))for(var n=0;n<e.length;n++)i|=e[n];else i=e;return t.forEach((function(t){t.collisionFilter.mask=i})),this},getMatterBodies:function(t){if(!t)return this.world.getAllBodies();Array.isArray(t)||(t=[t]);for(var e=[],i=0;i<t.length;i++){var n=t[i].hasOwnProperty("body")?t[i].body:t[i];e.push(n)}return e},setVelocity:function(t,e,i){t=this.getMatterBodies(t);var n=this._tempVec2;return n.x=e,n.y=i,t.forEach((function(t){o.setVelocity(t,n)})),this},setVelocityX:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return i.x=e,t.forEach((function(t){i.y=t.velocity.y,o.setVelocity(t,i)})),this},setVelocityY:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return i.y=e,t.forEach((function(t){i.x=t.velocity.x,o.setVelocity(t,i)})),this},setAngularVelocity:function(t,e){return(t=this.getMatterBodies(t)).forEach((function(t){o.setAngularVelocity(t,e)})),this},applyForce:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return t.forEach((function(t){i.x=t.position.x,i.y=t.position.y,o.applyForce(t,i,e)})),this},applyForceFromPosition:function(t,e,i,n){t=this.getMatterBodies(t);var r=this._tempVec2;return t.forEach((function(t){void 0===n&&(n=t.angle),r.x=i*Math.cos(n),r.y=i*Math.sin(n),o.applyForce(t,e,r)})),this},applyForceFromAngle:function(t,e,i){t=this.getMatterBodies(t);var n=this._tempVec2;return t.forEach((function(t){void 0===i&&(i=t.angle),n.x=e*Math.cos(i),n.y=e*Math.sin(i),o.applyForce(t,{x:t.position.x,y:t.position.y},n)})),this},getConstraintLength:function(t){var e=t.pointA.x,i=t.pointA.y,n=t.pointB.x,r=t.pointB.y;return t.bodyA&&(e+=t.bodyA.position.x,i+=t.bodyA.position.y),t.bodyB&&(n+=t.bodyB.position.x,r+=t.bodyB.position.y),f(e,i,n,r)},alignBody:function(t,e,i,r){var s;switch(t=t.hasOwnProperty("body")?t.body:t,r){case n.TOP_LEFT:case n.LEFT_TOP:s=this.bodyBounds.getTopLeft(t,e,i);break;case n.TOP_CENTER:s=this.bodyBounds.getTopCenter(t,e,i);break;case n.TOP_RIGHT:case n.RIGHT_TOP:s=this.bodyBounds.getTopRight(t,e,i);break;case n.LEFT_CENTER:s=this.bodyBounds.getLeftCenter(t,e,i);break;case n.CENTER:s=this.bodyBounds.getCenter(t,e,i);break;case n.RIGHT_CENTER:s=this.bodyBounds.getRightCenter(t,e,i);break;case n.LEFT_BOTTOM:case n.BOTTOM_LEFT:s=this.bodyBounds.getBottomLeft(t,e,i);break;case n.BOTTOM_CENTER:s=this.bodyBounds.getBottomCenter(t,e,i);break;case n.BOTTOM_RIGHT:case n.RIGHT_BOTTOM:s=this.bodyBounds.getBottomRight(t,e,i)}return s&&o.setPosition(t,s),this},shutdown:function(){var t=this.systems.events;this.world&&(t.off(L.UPDATE,this.world.update,this.world),t.off(L.POST_UPDATE,this.world.postUpdate,this.world)),t.off(L.SHUTDOWN,this.shutdown,this),this.add&&this.add.destroy(),this.world&&this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off(L.START,this.start,this),this.scene=null,this.systems=null}});A.register("MatterPhysics",B,"matterPhysics"),t.exports=B},function(t,e,i){var n=i(1391),r={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Body.create",(function(){r.Body.init(this)})),t.before("Engine.update",(function(t){r.Engine.update(t)}))},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=n.Composite.allBodies(t.world),i=0;i<e.length;i++){var r=e[i],s=r.plugin.attractors;if(s&&s.length>0)for(var o=0;o<e.length;o++){var a=e[o];if(i!==o)for(var h=0;h<s.length;h++){var l=s[h],c=l;n.Common.isFunction(l)&&(c=l(r,a)),c&&n.Body.applyForce(a,a.position,c)}}}}},Attractors:{gravityConstant:.001,gravity:function(t,e){var i=n.Vector.sub(e.position,t.position),s=n.Vector.magnitudeSquared(i)||1e-4,o=n.Vector.normalise(i),a=-r.Attractors.gravityConstant*(t.mass*e.mass/s),h=n.Vector.mult(o,a);n.Body.applyForce(t,t.position,n.Vector.neg(h)),n.Body.applyForce(e,e.position,h)}}};t.exports=r},function(t,e){t.exports={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Engine.create",(function(){t.Events.on(this,"collisionStart",(function(e){e.pairs.map((function(e){var i=e.bodyA,n=e.bodyB;i.gameObject&&i.gameObject.emit("collide",i,n,e),n.gameObject&&n.gameObject.emit("collide",n,i,e),t.Events.trigger(i,"onCollide",{pair:e}),t.Events.trigger(n,"onCollide",{pair:e}),i.onCollideCallback&&i.onCollideCallback(e),n.onCollideCallback&&n.onCollideCallback(e),i.onCollideWith[n.id]&&i.onCollideWith[n.id](n,e),n.onCollideWith[i.id]&&n.onCollideWith[i.id](i,e)}))})),t.Events.on(this,"collisionActive",(function(e){e.pairs.map((function(e){var i=e.bodyA,n=e.bodyB;i.gameObject&&i.gameObject.emit("collideActive",i,n,e),n.gameObject&&n.gameObject.emit("collideActive",n,i,e),t.Events.trigger(i,"onCollideActive",{pair:e}),t.Events.trigger(n,"onCollideActive",{pair:e}),i.onCollideActiveCallback&&i.onCollideActiveCallback(e),n.onCollideActiveCallback&&n.onCollideActiveCallback(e)}))})),t.Events.on(this,"collisionEnd",(function(e){e.pairs.map((function(e){var i=e.bodyA,n=e.bodyB;i.gameObject&&i.gameObject.emit("collideEnd",i,n,e),n.gameObject&&n.gameObject.emit("collideEnd",n,i,e),t.Events.trigger(i,"onCollideEnd",{pair:e}),t.Events.trigger(n,"onCollideEnd",{pair:e}),i.onCollideEndCallback&&i.onCollideEndCallback(e),n.onCollideEndCallback&&n.onCollideEndCallback(e)}))}))}))}}},function(t,e,i){var n=i(1391),r={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Engine.update",(function(){r.Engine.update(this)}))},Engine:{update:function(t){for(var e=t.world,i=n.Composite.allBodies(e),s=n.Composite.allComposites(e),o=0;o<i.length;o+=1){var a=i[o];a.plugin.wrap&&r.Body.wrap(a,a.plugin.wrap)}for(o=0;o<s.length;o+=1){var h=s[o];h.plugin.wrap&&r.Composite.wrap(h,h.plugin.wrap)}}},Bounds:{wrap:function(t,e){var i=null,n=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?i=e.min.x-t.max.x:t.max.x<e.min.x&&(i=e.max.x-t.min.x)),void 0!==e.min.y&&void 0!==e.max.y&&(t.min.y>e.max.y?n=e.min.y-t.max.y:t.max.y<e.min.y&&(n=e.max.y-t.min.y)),null!==i||null!==n)return{x:i||0,y:n||0}}},Body:{wrap:function(t,e){var i=r.Bounds.wrap(t.bounds,e);return i&&n.Body.translate(t,i),i}},Composite:{bounds:function(t){for(var e=n.Composite.allBodies(t),i=[],r=0;r<e.length;r+=1){var s=e[r];i.push(s.bounds.min,s.bounds.max)}return n.Bounds.create(i)},wrap:function(t,e){var i=r.Bounds.wrap(r.Composite.bounds(t),e);return i&&n.Composite.translate(t,i),i}}};t.exports=r}])},t.exports=n()},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});const n=i(2);class r{perspectiveCamera(t={}){return r.Perspective(t)}orthographicCamera(t={}){return r.Orthographic(t)}static Perspective(t={}){const{fov:e=50,aspect:i=window.innerWidth/window.innerHeight,near:r=.1,far:s=2e3,x:o=0,y:a=5,z:h=25}=t,l=new n.PerspectiveCamera(e,i,r,s);return l.position.set(o,a,h),l}static Orthographic(t={}){const e=window.innerWidth,i=window.innerHeight,{left:r=e/-2,right:s=e/2,top:o=i/2,bottom:a=i/-2,near:h=1,far:l=1e3,x:c=0,y:u=0,z:d=10}=t,p=new n.OrthographicCamera(r,s,o,a,h,l);return p.position.set(c,u,d),p}}e.default=r},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedGroup=void 0;const n=i(2);class r extends n.Group{constructor(){super(),this.isMesh=!1,this.hasBody=!1,this.name="object-"+this.id}}e.ExtendedGroup=r},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/var n=this&&this.__rest||function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i};Object.defineProperty(e,"__esModule",{value:!0});const r=i(2),s=i(6),o=i(9),a=i(17);e.default=class{constructor(t){this.scene=t,this.isHeadless="headless"===t,this.defaultMaterial=new a.default}get make(){return{plane:(t={},e={})=>this.makePlane(t,e),box:(t={},e={})=>this.makeBox(t,e),sphere:(t={},e={})=>this.makeSphere(t,e),cylinder:(t={},e={})=>this.makeCylinder(t,e),cone:(t={},e={})=>this.makeCone(t,e),torus:(t={},e={})=>this.makeTorus(t,e),extrude:(t,e={})=>this.makeExtrude(t,e)}}get add(){return{mesh:t=>this.addMesh(t),existing:t=>this.addExisting(t),plane:(t={},e={})=>this.addPlane(t,e),box:(t={},e={})=>this.addBox(t,e),ground:(t,e={})=>this.addGround(t,e),sphere:(t={},e={})=>this.addSphere(t,e),cylinder:(t={},e={})=>this.addCylinder(t,e),cone:(t={},e={})=>this.addCone(t,e),torus:(t={},e={})=>this.addTorus(t,e),extrude:(t,e={})=>this.addExtrude(t,e),material:(t={})=>this.addMaterial(t)}}addExisting(...t){"headless"!==this.scene&&this.scene.add(...t)}addMesh(t){if(Array.isArray(t))for(let e=0;e<t.length;e++)this.addExisting(t[e]);else this.addExisting(t);return this}createMesh(t,e,i){const{x:n=0,y:o=0,z:a=0}=i;let h;switch(!Array.isArray(e)&&e.type){case"LineBasicMaterial":h=new r.Line(t,e);break;case"PointsMaterial":h=new r.Points(t,e);break;default:h=new s.ExtendedMesh(t,e)}return h.position.set(n,o,a),h.castShadow=h.receiveShadow=!0,h}makeExtrude(t,e){const{x:i,y:s,z:o,name:a,shape:h,autoCenter:l=!0,breakable:c=!1}=t,u=n(t,["x","y","z","name","shape","autoCenter","breakable"]),{depth:d=1,bevelEnabled:p=!1}=u,f=new r.ExtrudeBufferGeometry(h,Object.assign({depth:d,bevelEnabled:p},u)),m=this.addMaterial(e),g=this.createMesh(f,m,{x:i,y:s,z:o});return l&&g.geometry.center(),g.name=a||"body_id_"+g.id,g.shape="extrude",g}addExtrude(t,e={}){const i=this.makeExtrude(t,e);return this.addExisting(i),i}makePlane(t,e){const{x:i,y:s,z:o,name:a,breakable:h=!1}=t,l=n(t,["x","y","z","name","breakable"]),c=new r.PlaneBufferGeometry(l.width||1,l.height||1,l.widthSegments||1,l.heightSegments||1),u=this.addMaterial(e);u.side=r.DoubleSide;const d=this.createMesh(c,u,{x:i,y:s,z:o});return d.name=a||"body_id_"+d.id,d.shape="plane",d}addPlane(t,e){const i=this.makePlane(t,e);return this.addExisting(i),i}makeSphere(t,e){const{x:i,y:s,z:o,name:a,breakable:h=!1}=t,l=n(t,["x","y","z","name","breakable"]),c=new r.SphereBufferGeometry(l.radius||1,l.widthSegments||16,l.heightSegments||12,l.phiStart||void 0,l.phiLength||void 0,l.thetaStart||void 0,l.thetaLength||void 0),u=this.addMaterial(e),d=this.createMesh(c,u,{x:i,y:s,z:o});return d.name=a||"body_id_"+d.id,d.shape="sphere",d}addSphere(t={},e={}){const i=this.makeSphere(t,e);return this.addExisting(i),i}makeBox(t,e){const{x:i,y:s,z:o,name:a,breakable:h=!1}=t,l=n(t,["x","y","z","name","breakable"]),c=new r.BoxBufferGeometry(l.width||1,l.height||1,l.depth||1,l.widthSegments||void 0,l.heightSegments||void 0,l.depthSegments||void 0),u=this.addMaterial(e),d=this.createMesh(c,u,{x:i,y:s,z:o});return d.name=a||"body_id_"+d.id,d.shape="box",d}addBox(t={},e={}){const i=this.makeBox(t,e);return this.addExisting(i),i}addGround(t,e={}){const i=this.makeBox(t,e);return i.rotateX(r.MathUtils.degToRad(90)),this.addExisting(i),i}makeCylinder(t={},e={}){const{x:i,y:s,z:o,name:a,breakable:h=!1}=t,l=n(t,["x","y","z","name","breakable"]),c=new r.CylinderBufferGeometry(l.radiusTop||1,l.radiusBottom||1,l.height||1,l.radiusSegments||void 0,l.heightSegments||void 0,l.openEnded||void 0,l.thetaStart||void 0,l.thetaLength||void 0),u=this.addMaterial(e),d=this.createMesh(c,u,{x:i,y:s,z:o});return d.name=a||"body_id_"+d.id,d.shape="cylinder",d}addCylinder(t={},e={}){const i=this.makeCylinder(t,e);return this.addExisting(i),i}makeCone(t={},e={}){const{x:i,y:s,z:o,name:a,breakable:h=!1}=t,l=n(t,["x","y","z","name","breakable"]),c=new r.ConeBufferGeometry(l.radius||1,l.height||1,l.radiusSegments||8,l.heightSegments||1,l.openEnded||!1,l.thetaStart||0,l.thetaLength||2*Math.PI),u=this.addMaterial(e),d=this.createMesh(c,u,{x:i,y:s,z:o});return d.name=a||"body_id_"+d.id,d.shape="cone",d}addCone(t={},e={}){const i=this.makeCone(t,e);return this.addExisting(i),i}makeTorus(t={},e={}){const{x:i,y:s,z:o,name:a,breakable:h=!1}=t,l=n(t,["x","y","z","name","breakable"]),c=new r.TorusBufferGeometry(l.radius||void 0,l.tube||void 0,l.radialSegments||void 0,l.tubularSegments||void 0,l.arc||void 0),u=this.addMaterial(e),d=this.createMesh(c,u,{x:i,y:s,z:o});return d.name=a||"body_id_"+d.id,d.shape="torus",d}addTorus(t={},e={}){const i=this.makeTorus(t,e);return this.addExisting(i),i}addMaterial(t={}){const e=Object.keys(t)[0];let i;if("headless"===this.scene)return this.defaultMaterial.get();switch(e){case"basic":i=new r.MeshBasicMaterial(t.basic);break;case"normal":i=new r.MeshNormalMaterial(t.normal);break;case"standard":i=new r.MeshStandardMaterial(t.standard);break;case"lambert":i=new r.MeshLambertMaterial(t.lambert);break;case"phong":i=new r.MeshPhongMaterial(t.phong);break;case"physical":void 0!==t.physical?i=new r.MeshPhysicalMaterial(t.physical):(o.default("You need to pass parameters to the physical material. (Fallback to default material)"),i=this.defaultMaterial.get());break;case"toon":i=new r.MeshToonMaterial(t.toon);break;case"line":i=new r.LineBasicMaterial(t.line);break;case"points":i=new r.PointsMaterial(t.points);break;case"custom":i=t.custom||this.defaultMaterial.get();break;default:i=this.defaultMaterial.get()}return i}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(2);e.default=class{constructor(){this._defaultMaterial=new n.MeshLambertMaterial({color:13421772})}get(){return this._defaultMaterial}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=(()=>{try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const t=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(t instanceof WebAssembly.Module)return new WebAssembly.Instance(t)instanceof WebAssembly.Instance}}catch(t){}return!1})(),r=(t,e)=>{var i=document.createElement("script");i.onload=()=>{e()},i.onerror=()=>{throw new Error("failed to load "+t)},i.async=!0,i.src=t,document.head.appendChild(i)};e.default=(t,e)=>{r(n?t+"/ammo.wasm.js":t+"/ammo.js",()=>e())}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fromGeometry=void 0;const n=i(2),r=i(59);e.fromGeometry=(t,e)=>{const i=(new r.DirectGeometry).fromGeometry(e);return s(t,i)};const s=(t,e)=>{var i,r;const s=new Float32Array(3*e.vertices.length);if(t.setAttribute("position",new n.BufferAttribute(s,3).copyVector3sArray(e.vertices)),e.normals.length>0){const i=new Float32Array(3*e.normals.length);t.setAttribute("normal",new n.BufferAttribute(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){const i=new Float32Array(3*e.colors.length);t.setAttribute("color",new n.BufferAttribute(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){const i=new Float32Array(2*e.uvs.length);t.setAttribute("uv",new n.BufferAttribute(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){const i=new Float32Array(2*e.uvs2.length);t.setAttribute("uv2",new n.BufferAttribute(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(const i in e.morphTargets){const r=[],s=e.morphTargets[i];for(let t=0,e=s.length;t<e;t++){const e=s[t],i=new n.Float32BufferAttribute(3*e.data.length,3);i.name=e.name,r.push(i.copyVector3sArray(e.data))}t.morphAttributes[i]=r}if(e.skinIndices.length>0){const i=new n.Float32BufferAttribute(4*e.skinIndices.length,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){const i=new n.Float32BufferAttribute(4*e.skinWeights.length,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(t.boundingSphere=null===(i=e.boundingSphere)||void 0===i?void 0:i.clone()),null!==e.boundingBox&&(t.boundingBox=null===(r=e.boundingBox)||void 0===r?void 0:r.clone()),t}},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},,,function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Scene3D=void 0;const r=i(24),s=i(13),o=i(2);class a extends s.Scene{constructor(t){super(t)}warpSpeed(...t){return n(this,void 0,void 0,(function*(){return yield this.third.warpSpeed(...t)}))}haveSomeFun(t=20){this.third.haveSomeFun(t)}requestThirdDimension(){console.warn("[enable3d] You do not need requestThirdDimension() anymore. Place accessThirdDimension() inside init() instead!")}clearThirdDimension(){for(let t in this.third)delete this.third[t];delete this.third}accessThirdDimension(t={}){this.clearThirdDimension(),this.third=new r.default(this,t),this.cameras.main.transparent=!0,this.cameras.main.setBackgroundColor("rgba(0,0,0,0)"),this.third.scene.background=new o.Color("white")}updateLoopXR(t,e){this.preUpdateXR(t,e),this.updateXR(t,e),this.postUpdateXR(t,e)}preUpdateXR(t,e){}updateXR(t,e){}postUpdateXR(t,e){this.third.isXrEnabled&&(this.time.update(t,e),this.third.physics.update(e),this.third.physics.updateDebugger(),this.third.animationMixers.update(e))}}e.Scene3D=a},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(25),s=i(54);class o extends r.ThreeGraphics{constructor(t,e={}){var i;const n=document.getElementById("enable3d-three-canvas");let o={};n&&(o={canvas:n}),e.renderer=new r.WebGLRenderer(Object.assign(Object.assign({},o),{antialias:e.antialias||!1})),super(e),null===(i=t.sys.game.canvas.parentElement)||void 0===i||i.insertBefore(e.renderer.domElement,t.sys.game.canvas),t.sys.game.canvas.style.position="relative";const a=()=>{var i,n;if(!e.renderer)return;const{width:r,height:s,marginLeft:o,marginTop:a}=t.sys.game.canvas.style;e.renderer.domElement.id="enable3d-three-canvas",null===(i=this.camera)||void 0===i||(i.aspect=t.sys.game.scale.baseSize.width/t.sys.game.scale.baseSize.height),null===(n=this.camera)||void 0===n||n.updateProjectionMatrix(),e.renderer.setSize(t.sys.game.scale.baseSize.width,t.sys.game.scale.baseSize.height),e.renderer.domElement.style.width=r,e.renderer.domElement.style.height=s,e.renderer.domElement.style.marginLeft=o,e.renderer.domElement.style.marginTop=a};a(),t.scale.on("resize",()=>{a()});const h=document.createElement("style");h.innerText="\n #enable3d-phaser-canvas:focus,\n #enable3d-three-canvas:focus {\n outline: none;\n }\n\n #enable3d-three-canvas {\n position: absolute;\n }\n ",document.head.appendChild(h);const{enableXR:l=!1}=e;if(this.isXrEnabled=l,this.scene3D=t,l&&(this.webXR=new s.WebXR(this.renderer,this.scene,this.camera)),this.isXrEnabled){let e=0;this.renderer.setAnimationLoop(i=>{if(this.renderer.xr.isPresenting){const n=i-e;e=i,t.updateLoopXR(i,n),this.renderer.state.reset(),this.preRender(),this.composer?this.composer.render():this.renderer.render(this.scene,this.camera),this.postRender()}})}t.add.extern().render=t=>{this.renderer.xr.isPresenting||(this.preRender(),this.composer?this.composer.render():this.renderer.render(this.scene,this.camera),this.postRender())},t.events.on("postupdate",(t,e)=>{var i,n,r;null===(i=this.animationMixers)||void 0===i||i.update(e),null===(n=this.physics)||void 0===n||n.update(e),null===(r=this.physics)||void 0===r||r.updateDebugger()}),this.load=new s.Loaders(this.cache,this.textureAnisotropy),this.lights=new s.Lights(this.scene),this.transform=new s.Transform(this.camera,this.renderer),this.csg=new s.CSG(this.scene,this.transform),this.heightMap=new s.HeightMap(this.scene),this.factories=new s.Factories(this.scene),this.misc=new s.Misc(this.scene,this.renderer,this.factories),this.cameras=new s.Cameras,this.ws=new s.WarpSpeed(this.scene,this.renderer,this.camera,this.lights,this.physics,this.load,this.factories),this.mixers=new s.Mixers,t.events.once("shutdown",()=>{t.clearThirdDimension(),t.events.removeListener("update")})}preRender(){}postRender(){}destroy(t){var e;null===(e=this.physics)||void 0===e||e.destroy(t.body),this.scene.remove(t),t=null}warpSpeed(...t){return n(this,void 0,void 0,(function*(){return yield this.ws.warpSpeed(...t)}))}haveSomeFun(t=20){s.HaveSomeFun(t,this.physics)}get animationMixers(){var t;return null===(t=this.mixers)||void 0===t?void 0:t.mixers}get make(){return this.factories.make}get add(){return this.factories.add}}e.default=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MathUtils=e.Vector3=e.Vector2=e.Object3D=e.FBXLoader=e.GLTFLoader=e.RGBAFormat=e.Texture=e.WebGLRenderer=e.Types=e.THREE=e.PhysicsLoader=e.ThreeGraphics=void 0;const n=i(26);Object.defineProperty(e,"ThreeGraphics",{enumerable:!0,get:function(){return n.ThreeGraphics}});const r=i(11);Object.defineProperty(e,"PhysicsLoader",{enumerable:!0,get:function(){return r.PhysicsLoader}});const s=i(2);e.THREE=s;const o=i(4);e.Types=o;const a=i(53);var h=i(2);Object.defineProperty(e,"WebGLRenderer",{enumerable:!0,get:function(){return h.WebGLRenderer}}),Object.defineProperty(e,"Texture",{enumerable:!0,get:function(){return h.Texture}}),Object.defineProperty(e,"RGBAFormat",{enumerable:!0,get:function(){return h.RGBAFormat}}),Object.defineProperty(e,"GLTFLoader",{enumerable:!0,get:function(){return h.GLTFLoader}}),Object.defineProperty(e,"FBXLoader",{enumerable:!0,get:function(){return h.FBXLoader}}),Object.defineProperty(e,"Object3D",{enumerable:!0,get:function(){return h.Object3D}}),Object.defineProperty(e,"Vector2",{enumerable:!0,get:function(){return h.Vector2}}),Object.defineProperty(e,"Vector3",{enumerable:!0,get:function(){return h.Vector3}}),Object.defineProperty(e,"MathUtils",{enumerable:!0,get:function(){return h.MathUtils}});const l="Powered by enable3d v"+a.VERSION;console.log(`%c %c %c %c %c ${l} %c https://enable3d.io/`,"background: #ff0000","background: #ffff00","background: #00ff00","background: #00ffff","color: #fff; background: #000000;","background: none")},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.ThreeGraphics=void 0;const n=i(2),r=i(14),s=i(36);e.ThreeGraphics=class{constructor(t={}){this.threeGraphicsConfig=t;const{anisotropy:e=1,camera:i=r.default.Perspective({z:25,y:5}),antialias:o=!1,usePhysics:a=!0,renderer:h}=t;this.textureAnisotropy=e,this.camera=i,this.scene=new n.Scene,this.renderer=h||new n.WebGLRenderer({antialias:o}),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=n.PCFSoftShadowMap,this.cache=n.Cache,this.cache.enabled=!0,a&&("undefined"!=typeof Ammo?this.physics=new s.AmmoPhysics(this.scene,t):console.log("[enable3d]: Are you sure you included ammo.js?"))}}},function(t,e,i){"use strict";i.r(e),i.d(e,"Geometry",(function(){return a}));var n=i(0);const r=new n.Matrix4,s=new n.Object3D,o=new n.Vector3;function a(){this.uuid=n.MathUtils.generateUUID(),this.name="",this.type="Geometry",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.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}a.prototype=Object.assign(Object.create(n.EventDispatcher.prototype),{constructor:a,isGeometry:!0,applyMatrix4:function(t){const e=(new n.Matrix3).getNormalMatrix(t);for(let e=0,i=this.vertices.length;e<i;e++){this.vertices[e].applyMatrix4(t)}for(let t=0,i=this.faces.length;t<i;t++){const i=this.faces[t];i.normal.applyMatrix3(e).normalize();for(let t=0,n=i.vertexNormals.length;t<n;t++)i.vertexNormals[t].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return r.makeRotationX(t),this.applyMatrix4(r),this},rotateY:function(t){return r.makeRotationY(t),this.applyMatrix4(r),this},rotateZ:function(t){return r.makeRotationZ(t),this.applyMatrix4(r),this},translate:function(t,e,i){return r.makeTranslation(t,e,i),this.applyMatrix4(r),this},scale:function(t,e,i){return r.makeScale(t,e,i),this.applyMatrix4(r),this},lookAt:function(t){return s.lookAt(t),s.updateMatrix(),this.applyMatrix4(s.matrix),this},fromBufferGeometry:function(t){const e=this,i=null!==t.index?t.index:void 0,r=t.attributes;if(void 0===r.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;const s=r.position,o=r.normal,a=r.color,h=r.uv,c=r.uv2;void 0!==c&&(this.faceVertexUvs[1]=[]);for(let t=0;t<s.count;t++)e.vertices.push((new n.Vector3).fromBufferAttribute(s,t)),void 0!==a&&e.colors.push((new n.Color).fromBufferAttribute(a,t));function u(t,i,r,s){const u=void 0===a?[]:[e.colors[t].clone(),e.colors[i].clone(),e.colors[r].clone()],d=void 0===o?[]:[(new n.Vector3).fromBufferAttribute(o,t),(new n.Vector3).fromBufferAttribute(o,i),(new n.Vector3).fromBufferAttribute(o,r)],p=new l(t,i,r,d,u,s);e.faces.push(p),void 0!==h&&e.faceVertexUvs[0].push([(new n.Vector2).fromBufferAttribute(h,t),(new n.Vector2).fromBufferAttribute(h,i),(new n.Vector2).fromBufferAttribute(h,r)]),void 0!==c&&e.faceVertexUvs[1].push([(new n.Vector2).fromBufferAttribute(c,t),(new n.Vector2).fromBufferAttribute(c,i),(new n.Vector2).fromBufferAttribute(c,r)])}const d=t.groups;if(d.length>0)for(let t=0;t<d.length;t++){const e=d[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)void 0!==i?u(i.getX(t),i.getX(t+1),i.getX(t+2),e.materialIndex):u(t,t+1,t+2,e.materialIndex)}else if(void 0!==i)for(let t=0;t<i.count;t+=3)u(i.getX(t),i.getX(t+1),i.getX(t+2));else for(let t=0;t<s.count;t+=3)u(t,t+1,t+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(o).negate(),this.translate(o.x,o.y,o.z),this},normalize:function(){this.computeBoundingSphere();const t=this.boundingSphere.center,e=this.boundingSphere.radius,i=0===e?1:1/e,r=new n.Matrix4;return r.set(i,0,0,-i*t.x,0,i,0,-i*t.y,0,0,i,-i*t.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){const t=new n.Vector3,e=new n.Vector3;for(let i=0,n=this.faces.length;i<n;i++){const n=this.faces[i],r=this.vertices[n.a],s=this.vertices[n.b],o=this.vertices[n.c];t.subVectors(o,s),e.subVectors(r,s),t.cross(e),t.normalize(),n.normal.copy(t)}},computeVertexNormals:function(t=!0){const e=new Array(this.vertices.length);for(let t=0,i=this.vertices.length;t<i;t++)e[t]=new n.Vector3;if(t){const t=new n.Vector3,i=new n.Vector3;for(let n=0,r=this.faces.length;n<r;n++){const r=this.faces[n],s=this.vertices[r.a],o=this.vertices[r.b],a=this.vertices[r.c];t.subVectors(a,o),i.subVectors(s,o),t.cross(i),e[r.a].add(t),e[r.b].add(t),e[r.c].add(t)}}else{this.computeFaceNormals();for(let t=0,i=this.faces.length;t<i;t++){const i=this.faces[t];e[i.a].add(i.normal),e[i.b].add(i.normal),e[i.c].add(i.normal)}}for(let t=0,i=this.vertices.length;t<i;t++)e[t].normalize();for(let t=0,i=this.faces.length;t<i;t++){const i=this.faces[t],n=i.vertexNormals;3===n.length?(n[0].copy(e[i.a]),n[1].copy(e[i.b]),n[2].copy(e[i.c])):(n[0]=e[i.a].clone(),n[1]=e[i.b].clone(),n[2]=e[i.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t],i=e.vertexNormals;3===i.length?(i[0].copy(e.normal),i[1].copy(e.normal),i[2].copy(e.normal)):(i[0]=e.normal.clone(),i[1]=e.normal.clone(),i[2]=e.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t];e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]);for(let t=0,i=e.vertexNormals.length;t<i;t++)e.__originalVertexNormals[t]?e.__originalVertexNormals[t].copy(e.vertexNormals[t]):e.__originalVertexNormals[t]=e.vertexNormals[t].clone()}const t=new a;t.faces=this.faces;for(let e=0,i=this.morphTargets.length;e<i;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];const t=this.morphNormals[e].faceNormals,i=this.morphNormals[e].vertexNormals;for(let e=0,r=this.faces.length;e<r;e++){const e=new n.Vector3,r={a:new n.Vector3,b:new n.Vector3,c:new n.Vector3};t.push(e),i.push(r)}}const i=this.morphNormals[e];t.vertices=this.morphTargets[e].vertices,t.computeFaceNormals(),t.computeVertexNormals();for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t],n=i.faceNormals[t],r=i.vertexNormals[t];n.copy(e.normal),r.a.copy(e.vertexNormals[0]),r.b.copy(e.vertexNormals[1]),r.c.copy(e.vertexNormals[2])}}for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t];e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals}},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new n.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i=0){if(!t||!t.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);let r;const s=this.vertices.length,o=this.vertices,a=t.vertices,h=this.faces,c=t.faces,u=this.colors,d=t.colors;void 0!==e&&(r=(new n.Matrix3).getNormalMatrix(e));for(let t=0,i=a.length;t<i;t++){const i=a[t].clone();void 0!==e&&i.applyMatrix4(e),o.push(i)}for(let t=0,e=d.length;t<e;t++)u.push(d[t].clone());for(let t=0,e=c.length;t<e;t++){const e=c[t];let n,o;const a=e.vertexNormals,u=e.vertexColors,d=new l(e.a+s,e.b+s,e.c+s);d.normal.copy(e.normal),void 0!==r&&d.normal.applyMatrix3(r).normalize();for(let t=0,e=a.length;t<e;t++)n=a[t].clone(),void 0!==r&&n.applyMatrix3(r).normalize(),d.vertexNormals.push(n);d.color.copy(e.color);for(let t=0,e=u.length;t<e;t++)o=u[t],d.vertexColors.push(o.clone());d.materialIndex=e.materialIndex+i,h.push(d)}for(let e=0,i=t.faceVertexUvs.length;e<i;e++){const i=t.faceVertexUvs[e];void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]);for(let t=0,n=i.length;t<n;t++){const n=i[t],r=[];for(let t=0,e=n.length;t<e;t++)r.push(n[t].clone());this.faceVertexUvs[e].push(r)}}},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(t=4){const e={},i=[],n=[],r=Math.pow(10,t);for(let t=0,s=this.vertices.length;t<s;t++){const s=this.vertices[t],o=Math.round(s.x*r)+"_"+Math.round(s.y*r)+"_"+Math.round(s.z*r);void 0===e[o]?(e[o]=t,i.push(this.vertices[t]),n[t]=i.length-1):n[t]=n[e[o]]}const s=[];for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t];e.a=n[e.a],e.b=n[e.b],e.c=n[e.c];const i=[e.a,e.b,e.c];for(let e=0;e<3;e++)if(i[e]===i[(e+1)%3]){s.push(t);break}}for(let t=s.length-1;t>=0;t--){const e=s[t];this.faces.splice(e,1);for(let t=0,i=this.faceVertexUvs.length;t<i;t++)this.faceVertexUvs[t].splice(e,1)}const o=this.vertices.length-i.length;return this.vertices=i,o},setFromPoints:function(t){this.vertices=[];for(let e=0,i=t.length;e<i;e++){const i=t[e];this.vertices.push(new n.Vector3(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){const t=this.faces,e=t.length;for(let i=0;i<e;i++)t[i]._id=i;t.sort((function(t,e){return t.materialIndex-e.materialIndex}));const i=this.faceVertexUvs[0],n=this.faceVertexUvs[1];let r,s;i&&i.length===e&&(r=[]),n&&n.length===e&&(s=[]);for(let o=0;o<e;o++){const e=t[o]._id;r&&r.push(i[e]),s&&s.push(n[e])}r&&(this.faceVertexUvs[0]=r),s&&(this.faceVertexUvs[1]=s)},toJSON:function(){const t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}const e=[];for(let t=0;t<this.vertices.length;t++){const i=this.vertices[t];e.push(i.x,i.y,i.z)}const i=[],n=[],r={},s=[],o={},a=[],h={};for(let t=0;t<this.faces.length;t++){const e=this.faces[t],n=!0,r=!1,s=void 0!==this.faceVertexUvs[0][t],o=e.normal.length()>0,a=e.vertexNormals.length>0,h=1!==e.color.r||1!==e.color.g||1!==e.color.b,p=e.vertexColors.length>0;let f=0;if(f=l(f,0,0),f=l(f,1,n),f=l(f,2,r),f=l(f,3,s),f=l(f,4,o),f=l(f,5,a),f=l(f,6,h),f=l(f,7,p),i.push(f),i.push(e.a,e.b,e.c),i.push(e.materialIndex),s){const e=this.faceVertexUvs[0][t];i.push(d(e[0]),d(e[1]),d(e[2]))}if(o&&i.push(c(e.normal)),a){const t=e.vertexNormals;i.push(c(t[0]),c(t[1]),c(t[2]))}if(h&&i.push(u(e.color)),p){const t=e.vertexColors;i.push(u(t[0]),u(t[1]),u(t[2]))}}function l(t,e,i){return i?t|1<<e:t&~(1<<e)}function c(t){const e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==r[e]||(r[e]=n.length/3,n.push(t.x,t.y,t.z)),r[e]}function u(t){const e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==o[e]||(o[e]=s.length,s.push(t.getHex())),o[e]}function d(t){const e=t.x.toString()+t.y.toString();return void 0!==h[e]||(h[e]=a.length/2,a.push(t.x,t.y)),h[e]}return t.data={},t.data.vertices=e,t.data.normals=n,s.length>0&&(t.data.colors=s),a.length>0&&(t.data.uvs=[a]),t.data.faces=i,t},clone:function(){return(new a).copy(this)},copy:function(t){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;const e=t.vertices;for(let t=0,i=e.length;t<i;t++)this.vertices.push(e[t].clone());const i=t.colors;for(let t=0,e=i.length;t<e;t++)this.colors.push(i[t].clone());const n=t.faces;for(let t=0,e=n.length;t<e;t++)this.faces.push(n[t].clone());for(let e=0,i=t.faceVertexUvs.length;e<i;e++){const i=t.faceVertexUvs[e];void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]);for(let t=0,n=i.length;t<n;t++){const n=i[t],r=[];for(let t=0,e=n.length;t<e;t++){const e=n[t];r.push(e.clone())}this.faceVertexUvs[e].push(r)}}const r=t.morphTargets;for(let t=0,e=r.length;t<e;t++){const e={};if(e.name=r[t].name,void 0!==r[t].vertices){e.vertices=[];for(let i=0,n=r[t].vertices.length;i<n;i++)e.vertices.push(r[t].vertices[i].clone())}if(void 0!==r[t].normals){e.normals=[];for(let i=0,n=r[t].normals.length;i<n;i++)e.normals.push(r[t].normals[i].clone())}this.morphTargets.push(e)}const s=t.morphNormals;for(let t=0,e=s.length;t<e;t++){const e={};if(void 0!==s[t].vertexNormals){e.vertexNormals=[];for(let i=0,n=s[t].vertexNormals.length;i<n;i++){const n=s[t].vertexNormals[i],r={};r.a=n.a.clone(),r.b=n.b.clone(),r.c=n.c.clone(),e.vertexNormals.push(r)}}if(void 0!==s[t].faceNormals){e.faceNormals=[];for(let i=0,n=s[t].faceNormals.length;i<n;i++)e.faceNormals.push(s[t].faceNormals[i].clone())}this.morphNormals.push(e)}const o=t.skinWeights;for(let t=0,e=o.length;t<e;t++)this.skinWeights.push(o[t].clone());const a=t.skinIndices;for(let t=0,e=a.length;t<e;t++)this.skinIndices.push(a[t].clone());const h=t.lineDistances;for(let t=0,e=h.length;t<e;t++)this.lineDistances.push(h[t]);const l=t.boundingBox;null!==l&&(this.boundingBox=l.clone());const c=t.boundingSphere;return null!==c&&(this.boundingSphere=c.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},toBufferGeometry:function(){const t=(new h).fromGeometry(this),e=new n.BufferGeometry,i=new Float32Array(3*t.vertices.length);if(e.setAttribute("position",new n.BufferAttribute(i,3).copyVector3sArray(t.vertices)),t.normals.length>0){const i=new Float32Array(3*t.normals.length);e.setAttribute("normal",new n.BufferAttribute(i,3).copyVector3sArray(t.normals))}if(t.colors.length>0){const i=new Float32Array(3*t.colors.length);e.setAttribute("color",new n.BufferAttribute(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){const i=new Float32Array(2*t.uvs.length);e.setAttribute("uv",new n.BufferAttribute(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){const i=new Float32Array(2*t.uvs2.length);e.setAttribute("uv2",new n.BufferAttribute(i,2).copyVector2sArray(t.uvs2))}e.groups=t.groups;for(const i in t.morphTargets){const r=[],s=t.morphTargets[i];for(let t=0,e=s.length;t<e;t++){const e=s[t],i=new n.Float32BufferAttribute(3*e.data.length,3);i.name=e.name,r.push(i.copyVector3sArray(e.data))}e.morphAttributes[i]=r}if(t.skinIndices.length>0){const i=new n.Float32BufferAttribute(4*t.skinIndices.length,4);e.setAttribute("skinIndex",i.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){const i=new n.Float32BufferAttribute(4*t.skinWeights.length,4);e.setAttribute("skinWeight",i.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(e.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(e.boundingBox=t.boundingBox.clone()),e},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),a.createBufferGeometryFromObject=function(t){let e=new n.BufferGeometry;const i=t.geometry;if(t.isPoints||t.isLine){const t=new n.Float32BufferAttribute(3*i.vertices.length,3),r=new n.Float32BufferAttribute(3*i.colors.length,3);if(e.setAttribute("position",t.copyVector3sArray(i.vertices)),e.setAttribute("color",r.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length){const t=new n.Float32BufferAttribute(i.lineDistances.length,1);e.setAttribute("lineDistance",t.copyArray(i.lineDistances))}null!==i.boundingSphere&&(e.boundingSphere=i.boundingSphere.clone()),null!==i.boundingBox&&(e.boundingBox=i.boundingBox.clone())}else t.isMesh&&(e=i.toBufferGeometry());return e};class h{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(t){const e=[];let i,n,r=void 0;const s=t.faces;for(n=0;n<s.length;n++){const t=s[n];t.materialIndex!==r&&(r=t.materialIndex,void 0!==i&&(i.count=3*n-i.start,e.push(i)),i={start:3*n,materialIndex:r})}void 0!==i&&(i.count=3*n-i.start,e.push(i)),this.groups=e}fromGeometry(t){const e=t.faces,i=t.vertices,r=t.faceVertexUvs,s=r[0]&&r[0].length>0,o=r[1]&&r[1].length>0,a=t.morphTargets,h=a.length;let l;if(h>0){l=[];for(let t=0;t<h;t++)l[t]={name:a[t].name,data:[]};this.morphTargets.position=l}const c=t.morphNormals,u=c.length;let d;if(u>0){d=[];for(let t=0;t<u;t++)d[t]={name:c[t].name,data:[]};this.morphTargets.normal=d}const p=t.skinIndices,f=t.skinWeights,m=p.length===i.length,g=f.length===i.length;i.length>0&&0===e.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let t=0;t<e.length;t++){const v=e[t];this.vertices.push(i[v.a],i[v.b],i[v.c]);const y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{const t=v.normal;this.normals.push(t,t,t)}const x=v.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{const t=v.color;this.colors.push(t,t,t)}if(!0===s){const e=r[0][t];void 0!==e?this.uvs.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",t),this.uvs.push(new n.Vector2,new n.Vector2,new n.Vector2))}if(!0===o){const e=r[1][t];void 0!==e?this.uvs2.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",t),this.uvs2.push(new n.Vector2,new n.Vector2,new n.Vector2))}for(let t=0;t<h;t++){const e=a[t].vertices;l[t].data.push(e[v.a],e[v.b],e[v.c])}for(let e=0;e<u;e++){const i=c[e].vertexNormals[t];d[e].data.push(i.a,i.b,i.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}}class l{constructor(t,e,i,r,s,o=0){this.a=t,this.b=e,this.c=i,this.normal=r&&r.isVector3?r:new n.Vector3,this.vertexNormals=Array.isArray(r)?r:[],this.color=s&&s.isColor?s:new n.Color,this.vertexColors=Array.isArray(s)?s:[],this.materialIndex=o}clone(){return(new this.constructor).copy(this)}copy(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(let e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(let e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Face3=void 0;const n=i(0);e.Face3=class{constructor(t,e,i,r,s,o=0){this.a=t,this.b=e,this.c=i,this.normal=r&&r.isVector3?r:new n.Vector3,this.vertexNormals=Array.isArray(r)?r:[],this.color=s&&s.isColor?s:new n.Color,this.vertexColors=Array.isArray(s)?s:[],this.materialIndex=o}clone(){return(new this.constructor).copy(this)}copy(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(let e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(let e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}},function(t,e,i){"use strict";i.r(e),i.d(e,"SVGLoader",(function(){return w}));var n,r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x,b=i(0),w=function(t){b.Loader.call(this,t),this.defaultDPI=90,this.defaultUnit="px"};w.prototype=Object.assign(Object.create(b.Loader.prototype),{constructor:w,load:function(t,e,i,n){var r=this,s=new b.FileLoader(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(i){try{e(r.parse(i))}catch(e){n?n(e):console.error(e),r.manager.itemError(t)}}),i,n)},parse:function(t){var e=this;function i(t,e,i,r,s,o,a,h){if(0!=e&&0!=i){r=r*Math.PI/180,e=Math.abs(e),i=Math.abs(i);var l=(a.x-h.x)/2,c=(a.y-h.y)/2,u=Math.cos(r)*l+Math.sin(r)*c,d=-Math.sin(r)*l+Math.cos(r)*c,p=e*e,f=i*i,m=u*u,g=d*d,v=m/p+g/f;if(v>1){var y=Math.sqrt(v);p=(e*=y)*e,f=(i*=y)*i}var x=p*g+f*m,b=(p*f-x)/x,w=Math.sqrt(Math.max(0,b));s===o&&(w=-w);var T=w*e*d/i,_=-w*i*u/e,E=Math.cos(r)*T-Math.sin(r)*_+(a.x+h.x)/2,S=Math.sin(r)*T+Math.cos(r)*_+(a.y+h.y)/2,M=n(1,0,(u-T)/e,(d-_)/i),A=n((u-T)/e,(d-_)/i,(-u-T)/e,(-d-_)/i)%(2*Math.PI);t.currentPath.absellipse(E,S,e,i,M,M+A,0===o,r)}else t.lineTo(h.x,h.y)}function n(t,e,i,n){var r=t*i+e*n,s=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n),o=Math.acos(Math.max(-1,Math.min(1,r/s)));return t*n-e*i<0&&(o=-o),o}function r(t,e){e=Object.assign({},e);var i={};if(t.hasAttribute("class"))for(var n=t.getAttribute("class").split(/\s/).filter(Boolean).map(t=>t.trim()),r=0;r<n.length;r++)i=Object.assign(i,p["."+n[r]]);function s(n,r,s){void 0===s&&(s=function(t){return t.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),t}),t.hasAttribute(n)&&(e[r]=s(t.getAttribute(n))),i[n]&&(e[r]=s(i[n])),t.style&&""!==t.style[n]&&(e[r]=s(t.style[n]))}function o(t){return Math.max(0,Math.min(1,l(t)))}function a(t){return Math.max(0,l(t))}return t.hasAttribute("id")&&(i=Object.assign(i,p["#"+t.getAttribute("id")])),s("fill","fill"),s("fill-opacity","fillOpacity",o),s("opacity","opacity",o),s("stroke","stroke"),s("stroke-opacity","strokeOpacity",o),s("stroke-width","strokeWidth",a),s("stroke-linejoin","strokeLineJoin"),s("stroke-linecap","strokeLineCap"),s("stroke-miterlimit","strokeMiterLimit",a),s("visibility","visibility"),e}function s(t,e){return t-(e-t)}function o(t){for(var e=t.split(/[\s,]+|(?=\s?[+\-])/),i=0;i<e.length;i++){var n=e[i];if(n.indexOf(".")!==n.lastIndexOf("."))for(var r=n.split("."),s=2;s<r.length;s++)e.splice(i+s-1,0,"0."+r[s]);e[i]=l(n)}return e}var a=["mm","cm","in","pt","pc","px"],h={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function l(t){var i="px";if("string"==typeof t||t instanceof String)for(var n=0,r=a.length;n<r;n++){var s=a[n];if(t.endsWith(s)){i=s,t=t.substring(0,t.length-s.length);break}}var o=void 0;return"px"===i&&"px"!==e.defaultUnit?o=h.in[e.defaultUnit]/e.defaultDPI:(o=h[i][e.defaultUnit])<0&&(o=h[i].in*e.defaultDPI),o*parseFloat(t)}function c(t){var e=t.elements;return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function u(t){var e=t.elements;return Math.sqrt(e[3]*e[3]+e[4]*e[4])}var d=[],p={},f=[],m=new b.Matrix3,g=new b.Matrix3,v=new b.Matrix3,y=new b.Matrix3,x=new b.Vector2,w=new b.Vector3,T=new b.Matrix3,_=(new DOMParser).parseFromString(t,"image/svg+xml");return function t(e,n){if(1===e.nodeType){var a=function(t){if(!(t.hasAttribute("transform")||"use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))))return null;var e=function(t){var e=new b.Matrix3,i=m;if("use"===t.nodeName&&(t.hasAttribute("x")||t.hasAttribute("y"))){var n=l(t.getAttribute("x")),r=l(t.getAttribute("y"));e.translate(n,r)}if(t.hasAttribute("transform"))for(var s=t.getAttribute("transform").split(")"),a=s.length-1;a>=0;a--){var h=s[a].trim();if(""!==h){var c=h.indexOf("("),u=h.length;if(c>0&&c<u){var d=h.substr(0,c),p=o(h.substr(c+1,u-c-1));switch(i.identity(),d){case"translate":if(p.length>=1){r=n=p[0];p.length>=2&&(r=p[1]),i.translate(n,r)}break;case"rotate":if(p.length>=1){var f,x=0,w=0;f=-p[0]*Math.PI/180,p.length>=3&&(x=p[1],w=p[2]),g.identity().translate(-x,-w),v.identity().rotate(f),y.multiplyMatrices(v,g),g.identity().translate(x,w),i.multiplyMatrices(g,y)}break;case"scale":if(p.length>=1){var T=p[0],_=T;p.length>=2&&(_=p[1]),i.scale(T,_)}break;case"skewX":1===p.length&&i.set(1,Math.tan(p[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===p.length&&i.set(1,0,0,Math.tan(p[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===p.length&&i.set(p[0],p[2],p[4],p[1],p[3],p[5],0,0,1)}}e.premultiply(i)}}return e}(t);f.length>0&&e.premultiply(f[f.length-1]);return T.copy(e),f.push(e),e}(e),h=!0,_=null;switch(e.nodeName){case"svg":break;case"style":!function(t){if(!t.sheet||!t.sheet.cssRules||!t.sheet.cssRules.length)return;for(var e=0;e<t.sheet.cssRules.length;e++){var i=t.sheet.cssRules[e];if(1===i.type)for(var n=i.selectorText.split(/,/gm).filter(Boolean).map(t=>t.trim()),r=0;r<n.length;r++)p[n[r]]=Object.assign(p[n[r]]||{},i.style)}}(e);break;case"g":n=r(e,n);break;case"path":n=r(e,n),e.hasAttribute("d")&&(_=function(t){for(var e=new b.ShapePath,n=new b.Vector2,r=new b.Vector2,a=new b.Vector2,h=!0,l=!1,c=t.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi),u=0,d=c.length;u<d;u++){var p=c[u],f=p.charAt(0),m=p.substr(1).trim();switch(!0===h&&(l=!0,h=!1),f){case"M":for(var g=o(m),v=0,y=g.length;v<y;v+=2)n.x=g[v+0],n.y=g[v+1],r.x=n.x,r.y=n.y,0===v?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===v&&!0===l&&a.copy(n);break;case"H":for(g=o(m),v=0,y=g.length;v<y;v++)n.x=g[v],r.x=n.x,r.y=n.y,e.lineTo(n.x,n.y),0===v&&!0===l&&a.copy(n);break;case"V":for(g=o(m),v=0,y=g.length;v<y;v++)n.y=g[v],r.x=n.x,r.y=n.y,e.lineTo(n.x,n.y),0===v&&!0===l&&a.copy(n);break;case"L":for(g=o(m),v=0,y=g.length;v<y;v+=2)n.x=g[v+0],n.y=g[v+1],r.x=n.x,r.y=n.y,e.lineTo(n.x,n.y),0===v&&!0===l&&a.copy(n);break;case"C":for(g=o(m),v=0,y=g.length;v<y;v+=6)e.bezierCurveTo(g[v+0],g[v+1],g[v+2],g[v+3],g[v+4],g[v+5]),r.x=g[v+2],r.y=g[v+3],n.x=g[v+4],n.y=g[v+5],0===v&&!0===l&&a.copy(n);break;case"S":for(g=o(m),v=0,y=g.length;v<y;v+=4)e.bezierCurveTo(s(n.x,r.x),s(n.y,r.y),g[v+0],g[v+1],g[v+2],g[v+3]),r.x=g[v+0],r.y=g[v+1],n.x=g[v+2],n.y=g[v+3],0===v&&!0===l&&a.copy(n);break;case"Q":for(g=o(m),v=0,y=g.length;v<y;v+=4)e.quadraticCurveTo(g[v+0],g[v+1],g[v+2],g[v+3]),r.x=g[v+0],r.y=g[v+1],n.x=g[v+2],n.y=g[v+3],0===v&&!0===l&&a.copy(n);break;case"T":for(g=o(m),v=0,y=g.length;v<y;v+=2){var x=s(n.x,r.x),w=s(n.y,r.y);e.quadraticCurveTo(x,w,g[v+0],g[v+1]),r.x=x,r.y=w,n.x=g[v+0],n.y=g[v+1],0===v&&!0===l&&a.copy(n)}break;case"A":for(g=o(m),v=0,y=g.length;v<y;v+=7)if(g[v+5]!=n.x||g[v+6]!=n.y){var T=n.clone();n.x=g[v+5],n.y=g[v+6],r.x=n.x,r.y=n.y,i(e,g[v],g[v+1],g[v+2],g[v+3],g[v+4],T,n),0===v&&!0===l&&a.copy(n)}break;case"m":for(g=o(m),v=0,y=g.length;v<y;v+=2)n.x+=g[v+0],n.y+=g[v+1],r.x=n.x,r.y=n.y,0===v?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y),0===v&&!0===l&&a.copy(n);break;case"h":for(g=o(m),v=0,y=g.length;v<y;v++)n.x+=g[v],r.x=n.x,r.y=n.y,e.lineTo(n.x,n.y),0===v&&!0===l&&a.copy(n);break;case"v":for(g=o(m),v=0,y=g.length;v<y;v++)n.y+=g[v],r.x=n.x,r.y=n.y,e.lineTo(n.x,n.y),0===v&&!0===l&&a.copy(n);break;case"l":for(g=o(m),v=0,y=g.length;v<y;v+=2)n.x+=g[v+0],n.y+=g[v+1],r.x=n.x,r.y=n.y,e.lineTo(n.x,n.y),0===v&&!0===l&&a.copy(n);break;case"c":for(g=o(m),v=0,y=g.length;v<y;v+=6)e.bezierCurveTo(n.x+g[v+0],n.y+g[v+1],n.x+g[v+2],n.y+g[v+3],n.x+g[v+4],n.y+g[v+5]),r.x=n.x+g[v+2],r.y=n.y+g[v+3],n.x+=g[v+4],n.y+=g[v+5],0===v&&!0===l&&a.copy(n);break;case"s":for(g=o(m),v=0,y=g.length;v<y;v+=4)e.bezierCurveTo(s(n.x,r.x),s(n.y,r.y),n.x+g[v+0],n.y+g[v+1],n.x+g[v+2],n.y+g[v+3]),r.x=n.x+g[v+0],r.y=n.y+g[v+1],n.x+=g[v+2],n.y+=g[v+3],0===v&&!0===l&&a.copy(n);break;case"q":for(g=o(m),v=0,y=g.length;v<y;v+=4)e.quadraticCurveTo(n.x+g[v+0],n.y+g[v+1],n.x+g[v+2],n.y+g[v+3]),r.x=n.x+g[v+0],r.y=n.y+g[v+1],n.x+=g[v+2],n.y+=g[v+3],0===v&&!0===l&&a.copy(n);break;case"t":for(g=o(m),v=0,y=g.length;v<y;v+=2){x=s(n.x,r.x),w=s(n.y,r.y);e.quadraticCurveTo(x,w,n.x+g[v+0],n.y+g[v+1]),r.x=x,r.y=w,n.x=n.x+g[v+0],n.y=n.y+g[v+1],0===v&&!0===l&&a.copy(n)}break;case"a":for(g=o(m),v=0,y=g.length;v<y;v+=7)if(0!=g[v+5]||0!=g[v+6]){T=n.clone();n.x+=g[v+5],n.y+=g[v+6],r.x=n.x,r.y=n.y,i(e,g[v],g[v+1],g[v+2],g[v+3],g[v+4],T,n),0===v&&!0===l&&a.copy(n)}break;case"Z":case"z":e.currentPath.autoClose=!0,e.currentPath.curves.length>0&&(n.copy(a),e.currentPath.currentPoint.copy(n),h=!0);break;default:console.warn(p)}l=!1}return e}(e));break;case"rect":n=r(e,n),_=function(t){var e=l(t.getAttribute("x")||0),i=l(t.getAttribute("y")||0),n=l(t.getAttribute("rx")||0),r=l(t.getAttribute("ry")||0),s=l(t.getAttribute("width")),o=l(t.getAttribute("height")),a=new b.ShapePath;a.moveTo(e+2*n,i),a.lineTo(e+s-2*n,i),(0!==n||0!==r)&&a.bezierCurveTo(e+s,i,e+s,i,e+s,i+2*r);a.lineTo(e+s,i+o-2*r),(0!==n||0!==r)&&a.bezierCurveTo(e+s,i+o,e+s,i+o,e+s-2*n,i+o);a.lineTo(e+2*n,i+o),(0!==n||0!==r)&&a.bezierCurveTo(e,i+o,e,i+o,e,i+o-2*r);a.lineTo(e,i+2*r),(0!==n||0!==r)&&a.bezierCurveTo(e,i,e,i,e+2*n,i);return a}(e);break;case"polygon":n=r(e,n),_=function(t){function e(t,e,r){var s=l(e),o=l(r);0===n?i.moveTo(s,o):i.lineTo(s,o),n++}var i=new b.ShapePath,n=0;return t.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,e),i.currentPath.autoClose=!0,i}(e);break;case"polyline":n=r(e,n),_=function(t){function e(t,e,r){var s=l(e),o=l(r);0===n?i.moveTo(s,o):i.lineTo(s,o),n++}var i=new b.ShapePath,n=0;return t.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,e),i.currentPath.autoClose=!1,i}(e);break;case"circle":n=r(e,n),_=function(t){var e=l(t.getAttribute("cx")),i=l(t.getAttribute("cy")),n=l(t.getAttribute("r")),r=new b.Path;r.absarc(e,i,n,0,2*Math.PI);var s=new b.ShapePath;return s.subPaths.push(r),s}(e);break;case"ellipse":n=r(e,n),_=function(t){var e=l(t.getAttribute("cx")),i=l(t.getAttribute("cy")),n=l(t.getAttribute("rx")),r=l(t.getAttribute("ry")),s=new b.Path;s.absellipse(e,i,n,r,0,2*Math.PI);var o=new b.ShapePath;return o.subPaths.push(s),o}(e);break;case"line":n=r(e,n),_=function(t){var e=l(t.getAttribute("x1")),i=l(t.getAttribute("y1")),n=l(t.getAttribute("x2")),r=l(t.getAttribute("y2")),s=new b.ShapePath;return s.moveTo(e,i),s.lineTo(n,r),s.currentPath.autoClose=!1,s}(e);break;case"defs":h=!1;break;case"use":n=r(e,n);var E=e.href.baseVal.substring(1),S=e.viewportElement.getElementById(E);S?t(S,n):console.warn("SVGLoader: 'use node' references non-existent node id: "+E)}if(_&&(void 0!==n.fill&&"none"!==n.fill&&_.color.setStyle(n.fill),function(t,e){function i(t){w.set(t.x,t.y,1).applyMatrix3(e),t.set(w.x,w.y)}for(var n=function(t){return 0!==t.elements[1]||0!==t.elements[3]}(e),r=t.subPaths,s=0,o=r.length;s<o;s++)for(var a=r[s].curves,h=0;h<a.length;h++){var l=a[h];l.isLineCurve?(i(l.v1),i(l.v2)):l.isCubicBezierCurve?(i(l.v0),i(l.v1),i(l.v2),i(l.v3)):l.isQuadraticBezierCurve?(i(l.v0),i(l.v1),i(l.v2)):l.isEllipseCurve&&(n&&console.warn("SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented."),x.set(l.aX,l.aY),i(x),l.aX=x.x,l.aY=x.y,l.xRadius*=c(e),l.yRadius*=u(e))}}(_,T),d.push(_),_.userData={node:e,style:n}),h)for(var M=e.childNodes,A=0;A<M.length;A++)t(M[A],n);a&&(f.pop(),f.length>0?T.copy(f[f.length-1]):T.identity())}}(_.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:d,xml:_.documentElement}}}),w.getStrokeStyle=function(t,e,i,n,r){return{strokeColor:e=void 0!==e?e:"#000",strokeWidth:t=void 0!==t?t:1,strokeLineJoin:i=void 0!==i?i:"miter",strokeLineCap:n=void 0!==n?n:"butt",strokeMiterLimit:r=void 0!==r?r:4}},w.pointsToStroke=function(t,e,i,n){var r=[],s=[],o=[];if(0===w.pointsToStrokeWithBuffers(t,e,i,n,r,s,o))return null;var a=new b.BufferGeometry;return a.setAttribute("position",new b.Float32BufferAttribute(r,3)),a.setAttribute("normal",new b.Float32BufferAttribute(s,3)),a.setAttribute("uv",new b.Float32BufferAttribute(o,2)),a},w.pointsToStrokeWithBuffers=(n=new b.Vector2,r=new b.Vector2,s=new b.Vector2,o=new b.Vector2,a=new b.Vector2,h=new b.Vector2,l=new b.Vector2,c=new b.Vector2,u=new b.Vector2,d=new b.Vector2,p=new b.Vector2,f=new b.Vector2,m=new b.Vector2,g=new b.Vector2,v=new b.Vector2,y=new b.Vector2,x=new b.Vector2,function(t,e,i,b,w,T,_,E){i=void 0!==i?i:12,b=void 0!==b?b:.001,E=void 0!==E?E:0;var S=(t=function(t){for(var e=!1,i=1,n=t.length-1;i<n;i++)if(t[i].distanceTo(t[i+1])<b){e=!0;break}if(!e)return t;var r=[];for(r.push(t[0]),i=1,n=t.length-1;i<n;i++)t[i].distanceTo(t[i+1])>=b&&r.push(t[i]);return r.push(t[t.length-1]),r}(t)).length;if(S<2)return 0;var M,A,C,P,R,L=t[0].equals(t[S-1]),O=t[0],D=e.strokeWidth/2,I=1/(S-1),F=0,B=!1,k=0,N=3*E,U=2*E;J(t[0],t[1],n).multiplyScalar(D),c.copy(t[0]).sub(n),u.copy(t[0]).add(n),d.copy(c),p.copy(u);for(var z=1;z<S;z++){M=t[z],A=z===S-1?L?t[1]:void 0:t[z+1];var G=n;J(O,M,G),s.copy(G).multiplyScalar(D),f.copy(M).sub(s),m.copy(M).add(s);var V=F+I;if(C=!1,void 0!==A){J(M,A,r),s.copy(r).multiplyScalar(D),g.copy(M).sub(s),v.copy(M).add(s),P=!0,s.subVectors(A,O),G.dot(s)<0&&(P=!1),1===z&&(B=P),s.subVectors(A,M),s.normalize();var H=Math.abs(G.dot(s));if(0!==H){var W=D/H;s.multiplyScalar(-W),o.subVectors(M,O),a.copy(o).setLength(W).add(s),y.copy(a).negate();var X=a.length(),j=o.length();o.divideScalar(j),h.subVectors(A,M);var Y=h.length();switch(h.divideScalar(Y),o.dot(y)<j&&h.dot(y)<Y&&(C=!0),x.copy(a).add(M),y.add(M),R=!1,C?P?(v.copy(y),m.copy(y)):(g.copy(y),f.copy(y)):tt(),e.strokeLineJoin){case"bevel":et(P,C,V);break;case"round":it(P,C),P?$(M,f,g,V,0):$(M,v,m,V,1);break;case"miter":case"miter-clip":default:var q=D*e.strokeMiterLimit/X;if(q<1){if("miter-clip"!==e.strokeLineJoin){et(P,C,V);break}it(P,C),P?(h.subVectors(x,f).multiplyScalar(q).add(f),l.subVectors(x,g).multiplyScalar(q).add(g),Q(f,V,0),Q(h,V,0),Q(M,V,.5),Q(M,V,.5),Q(h,V,0),Q(l,V,0),Q(M,V,.5),Q(l,V,0),Q(g,V,0)):(h.subVectors(x,m).multiplyScalar(q).add(m),l.subVectors(x,v).multiplyScalar(q).add(v),Q(m,V,1),Q(h,V,1),Q(M,V,.5),Q(M,V,.5),Q(h,V,1),Q(l,V,1),Q(M,V,.5),Q(l,V,1),Q(v,V,1))}else C?(P?(Q(u,F,1),Q(c,F,0),Q(x,V,0),Q(u,F,1),Q(x,V,0),Q(y,V,1)):(Q(u,F,1),Q(c,F,0),Q(x,V,1),Q(c,F,0),Q(y,V,0),Q(x,V,1)),P?g.copy(x):v.copy(x)):P?(Q(f,V,0),Q(x,V,0),Q(M,V,.5),Q(M,V,.5),Q(x,V,0),Q(g,V,0)):(Q(m,V,1),Q(x,V,1),Q(M,V,.5),Q(M,V,.5),Q(x,V,1),Q(v,V,1)),R=!0}}else tt()}else tt();L||z!==S-1||nt(t[0],d,p,P,!0,F),F=V,O=M,c.copy(g),u.copy(v)}if(L){if(C&&w){var Z=x,K=y;B!==P&&(Z=y,K=x),P?(R||B)&&(K.toArray(w,0),K.toArray(w,9),R&&Z.toArray(w,3)):!R&&B||(K.toArray(w,3),K.toArray(w,9),R&&Z.toArray(w,0))}}else nt(M,f,m,P,!1,V);return k;function J(t,e,i){return i.subVectors(e,t),i.set(-i.y,i.x).normalize()}function Q(t,e,i){w&&(w[N]=t.x,w[N+1]=t.y,w[N+2]=0,T&&(T[N]=0,T[N+1]=0,T[N+2]=1),N+=3,_&&(_[U]=e,_[U+1]=i,U+=2)),k+=3}function $(t,e,a,h,l){n.copy(e).sub(t).normalize(),r.copy(a).sub(t).normalize();var c=Math.PI,u=n.dot(r);Math.abs(u)<1&&(c=Math.abs(Math.acos(u))),c/=i,s.copy(e);for(var d=0,p=i-1;d<p;d++)o.copy(s).rotateAround(t,c),Q(s,h,l),Q(o,h,l),Q(t,h,.5),s.copy(o);Q(o,h,l),Q(a,h,l),Q(t,h,.5)}function tt(){Q(u,F,1),Q(c,F,0),Q(f,V,0),Q(u,F,1),Q(f,V,1),Q(m,V,0)}function et(t,e,i){e?t?(Q(u,F,1),Q(c,F,0),Q(f,V,0),Q(u,F,1),Q(f,V,0),Q(y,V,1),Q(f,i,0),Q(g,i,0),Q(y,i,.5)):(Q(u,F,1),Q(c,F,0),Q(m,V,1),Q(c,F,0),Q(y,V,0),Q(m,V,1),Q(m,i,1),Q(v,i,0),Q(y,i,.5)):t?(Q(f,i,0),Q(g,i,0),Q(M,i,.5)):(Q(m,i,1),Q(v,i,0),Q(M,i,.5))}function it(t,e){e&&(t?(Q(u,F,1),Q(c,F,0),Q(f,V,0),Q(u,F,1),Q(f,V,0),Q(y,V,1),Q(f,F,0),Q(M,V,.5),Q(y,V,1),Q(M,V,.5),Q(g,F,0),Q(y,V,1)):(Q(u,F,1),Q(c,F,0),Q(m,V,1),Q(c,F,0),Q(y,V,0),Q(m,V,1),Q(m,F,1),Q(y,V,0),Q(M,V,.5),Q(M,V,.5),Q(y,V,0),Q(v,F,1)))}function nt(t,i,a,h,l,c){switch(e.strokeLineCap){case"round":l?$(t,a,i,c,.5):$(t,i,a,c,.5);break;case"square":if(l)n.subVectors(i,t),r.set(n.y,-n.x),s.addVectors(n,r).add(t),o.subVectors(r,n).add(t),h?(s.toArray(w,3),o.toArray(w,0),o.toArray(w,9)):(s.toArray(w,3),s.toArray(w,9),o.toArray(w,0));else{n.subVectors(a,t),r.set(n.y,-n.x),s.addVectors(n,r).add(t),o.subVectors(r,n).add(t);var u=w.length;h?(s.toArray(w,u-3),o.toArray(w,u-6),o.toArray(w,u-12)):(s.toArray(w,u-6),o.toArray(w,u-3),o.toArray(w,u-12))}}}})},function(t,e,i){"use strict";i.r(e),i.d(e,"VRButton",(function(){return n}));class n{static createButton(t,e){e&&console.error('THREE.VRButton: The "options" parameter has been removed. Please set the reference space type via renderer.xr.setReferenceSpaceType() instead.');const i=document.createElement("button");function n(){i.style.display="",i.style.cursor="auto",i.style.left="calc(50% - 75px)",i.style.width="150px",i.onmouseenter=null,i.onmouseleave=null,i.onclick=null,i.textContent="VR NOT SUPPORTED"}function r(t){t.style.position="absolute",t.style.bottom="20px",t.style.padding="12px 6px",t.style.border="1px solid #fff",t.style.borderRadius="4px",t.style.background="rgba(0,0,0,0.1)",t.style.color="#fff",t.style.font="normal 13px sans-serif",t.style.textAlign="center",t.style.opacity="0.5",t.style.outline="none",t.style.zIndex="999"}if("xr"in navigator)return i.id="VRButton",i.style.display="none",r(i),navigator.xr.isSessionSupported("immersive-vr").then((function(e){e?function(){let e=null;async function n(n){n.addEventListener("end",r),await t.xr.setSession(n),i.textContent="EXIT VR",e=n}function r(){e.removeEventListener("end",r),i.textContent="ENTER VR",e=null}i.style.display="",i.style.cursor="pointer",i.style.left="calc(50% - 50px)",i.style.width="100px",i.textContent="ENTER VR",i.onmouseenter=function(){i.style.opacity="1.0"},i.onmouseleave=function(){i.style.opacity="0.5"},i.onclick=function(){if(null===e){const t={optionalFeatures:["local-floor","bounded-floor","hand-tracking"]};navigator.xr.requestSession("immersive-vr",t).then(n)}else e.end()}}():n()})),i;{const t=document.createElement("a");return!1===window.isSecureContext?(t.href=document.location.href.replace(/^http:/,"https:"),t.innerHTML="WEBXR NEEDS HTTPS"):(t.href="https://immersiveweb.dev/",t.innerHTML="WEBXR NOT AVAILABLE"),t.style.left="calc(50% - 90px)",t.style.width="180px",t.style.textDecoration="none",r(t),t}}}},function(t,e,i){"use strict";i.r(e),i.d(e,"Sky",(function(){return r}));var n=i(0),r=function(){var t=r.SkyShader,e=new n.ShaderMaterial({name:"SkyShader",fragmentShader:t.fragmentShader,vertexShader:t.vertexShader,uniforms:n.UniformsUtils.clone(t.uniforms),side:n.BackSide,depthWrite:!1});n.Mesh.call(this,new n.BoxGeometry(1,1,1),e)};r.prototype=Object.create(n.Mesh.prototype),r.SkyShader={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new n.Vector3},up:{value:new n.Vector3(0,1,0)}},vertexShader:["uniform vec3 sunPosition;","uniform float rayleigh;","uniform float turbidity;","uniform float mieCoefficient;","uniform vec3 up;","varying vec3 vWorldPosition;","varying vec3 vSunDirection;","varying float vSunfade;","varying vec3 vBetaR;","varying vec3 vBetaM;","varying float vSunE;","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );","const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );","const float v = 4.0;","const vec3 K = vec3( 0.686, 0.678, 0.666 );","const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );","const float cutoffAngle = 1.6110731556870734;","const float steepness = 1.5;","const float EE = 1000.0;","float sunIntensity( float zenithAngleCos ) {","\tzenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );","\treturn EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );","}","vec3 totalMie( float T ) {","\tfloat c = ( 0.2 * T ) * 10E-18;","\treturn 0.434 * c * MieConst;","}","void main() {","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvWorldPosition = worldPosition.xyz;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","\tgl_Position.z = gl_Position.w;","\tvSunDirection = normalize( sunPosition );","\tvSunE = sunIntensity( dot( vSunDirection, up ) );","\tvSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );","\tfloat rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );","\tvBetaR = totalRayleigh * rayleighCoefficient;","\tvBetaM = totalMie( turbidity ) * mieCoefficient;","}"].join("\n"),fragmentShader:["varying vec3 vWorldPosition;","varying vec3 vSunDirection;","varying float vSunfade;","varying vec3 vBetaR;","varying vec3 vBetaM;","varying float vSunE;","uniform float mieDirectionalG;","uniform vec3 up;","const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003;","const float N = 2.545E25;","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","const float THREE_OVER_SIXTEENPI = 0.05968310365946075;","const float ONE_OVER_FOURPI = 0.07957747154594767;","float rayleighPhase( float cosTheta ) {","\treturn THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );","}","float hgPhase( float cosTheta, float g ) {","\tfloat g2 = pow( g, 2.0 );","\tfloat inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );","\treturn ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );","}","void main() {","\tvec3 direction = normalize( vWorldPosition - cameraPos );","\tfloat zenithAngle = acos( max( 0.0, dot( up, direction ) ) );","\tfloat inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );","\tfloat sR = rayleighZenithLength * inverse;","\tfloat sM = mieZenithLength * inverse;","\tvec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );","\tfloat cosTheta = dot( direction, vSunDirection );","\tfloat rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );","\tvec3 betaRTheta = vBetaR * rPhase;","\tfloat mPhase = hgPhase( cosTheta, mieDirectionalG );","\tvec3 betaMTheta = vBetaM * mPhase;","\tvec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );","\tLin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );","\tfloat theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]","\tfloat phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]","\tvec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );","\tvec3 L0 = vec3( 0.1 ) * Fex;","\tfloat sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );","\tL0 += ( vSunE * 19000.0 * Fex ) * sundisk;","\tvec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );","\tvec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );","\tgl_FragColor = vec4( retColor, 1.0 );","#include <tonemapping_fragment>","#include <encodings_fragment>","}"].join("\n")}},function(t,e,i){"use strict";i.r(e),i.d(e,"OrbitControls",(function(){return r})),i.d(e,"MapControls",(function(){return s}));var n=i(0),r=function(t,e){var i,r,s,o,a,h;void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.enabled=!0,this.target=new n.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=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:n.MOUSE.ROTATE,MIDDLE:n.MOUSE.DOLLY,RIGHT:n.MOUSE.PAN},this.touches={ONE:n.TOUCH.ROTATE,TWO:n.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return g.phi},this.getAzimuthalAngle=function(){return g.theta},this.listenToKeyEvents=function(t){t.addEventListener("keydown",J),this._domElementKeyEvents=t},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(c),l.update(),f=p.NONE},this.update=(i=new n.Vector3,r=(new n.Quaternion).setFromUnitVectors(t.up,new n.Vector3(0,1,0)),s=r.clone().invert(),o=new n.Vector3,a=new n.Quaternion,h=2*Math.PI,function(){var t=l.object.position;i.copy(t).sub(l.target),i.applyQuaternion(r),g.setFromVector3(i),l.autoRotate&&f===p.NONE&&L(2*Math.PI/60/60*l.autoRotateSpeed),l.enableDamping?(g.theta+=v.theta*l.dampingFactor,g.phi+=v.phi*l.dampingFactor):(g.theta+=v.theta,g.phi+=v.phi);var e=l.minAzimuthAngle,n=l.maxAzimuthAngle;return isFinite(e)&&isFinite(n)&&(e<-Math.PI?e+=h:e>Math.PI&&(e-=h),n<-Math.PI?n+=h:n>Math.PI&&(n-=h),g.theta=e<=n?Math.max(e,Math.min(n,g.theta)):g.theta>(e+n)/2?Math.max(e,g.theta):Math.min(n,g.theta)),g.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,g.phi)),g.makeSafe(),g.radius*=y,g.radius=Math.max(l.minDistance,Math.min(l.maxDistance,g.radius)),!0===l.enableDamping?l.target.addScaledVector(x,l.dampingFactor):l.target.add(x),i.setFromSpherical(g),i.applyQuaternion(s),t.copy(l.target).add(i),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,x.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),x.set(0,0,0)),y=1,!!(b||o.distanceToSquared(l.object.position)>m||8*(1-a.dot(l.object.quaternion))>m)&&(l.dispatchEvent(c),o.copy(l.object.position),a.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",et),l.domElement.removeEventListener("pointerdown",Y),l.domElement.removeEventListener("wheel",K),l.domElement.removeEventListener("touchstart",Q),l.domElement.removeEventListener("touchend",tt),l.domElement.removeEventListener("touchmove",$),l.domElement.ownerDocument.removeEventListener("pointermove",q),l.domElement.ownerDocument.removeEventListener("pointerup",Z),null!==l._domElementKeyEvents&&l._domElementKeyEvents.removeEventListener("keydown",J)};var l=this,c={type:"change"},u={type:"start"},d={type:"end"},p={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},f=p.NONE,m=1e-6,g=new n.Spherical,v=new n.Spherical,y=1,x=new n.Vector3,b=!1,w=new n.Vector2,T=new n.Vector2,_=new n.Vector2,E=new n.Vector2,S=new n.Vector2,M=new n.Vector2,A=new n.Vector2,C=new n.Vector2,P=new n.Vector2;function R(){return Math.pow(.95,l.zoomSpeed)}function L(t){v.theta-=t}function O(t){v.phi-=t}var D,I=(D=new n.Vector3,function(t,e){D.setFromMatrixColumn(e,0),D.multiplyScalar(-t),x.add(D)}),F=function(){var t=new n.Vector3;return function(e,i){!0===l.screenSpacePanning?t.setFromMatrixColumn(i,1):(t.setFromMatrixColumn(i,0),t.crossVectors(l.object.up,t)),t.multiplyScalar(e),x.add(t)}}(),B=function(){var t=new n.Vector3;return function(e,i){var n=l.domElement;if(l.object.isPerspectiveCamera){var r=l.object.position;t.copy(r).sub(l.target);var s=t.length();s*=Math.tan(l.object.fov/2*Math.PI/180),I(2*e*s/n.clientHeight,l.object.matrix),F(2*i*s/n.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(I(e*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),F(i*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function k(t){l.object.isPerspectiveCamera?y/=t:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*t)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function N(t){l.object.isPerspectiveCamera?y*=t:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/t)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(t){w.set(t.clientX,t.clientY)}function z(t){E.set(t.clientX,t.clientY)}function G(t){if(1==t.touches.length)w.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);w.set(e,i)}}function V(t){if(1==t.touches.length)E.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);E.set(e,i)}}function H(t){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);A.set(0,n)}function W(t){if(1==t.touches.length)T.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);T.set(e,i)}_.subVectors(T,w).multiplyScalar(l.rotateSpeed);var n=l.domElement;L(2*Math.PI*_.x/n.clientHeight),O(2*Math.PI*_.y/n.clientHeight),w.copy(T)}function X(t){if(1==t.touches.length)S.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);S.set(e,i)}M.subVectors(S,E).multiplyScalar(l.panSpeed),B(M.x,M.y),E.copy(S)}function j(t){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);C.set(0,n),P.set(0,Math.pow(C.y/A.y,l.zoomSpeed)),k(P.y),A.copy(C)}function Y(t){if(!1!==l.enabled)switch(t.pointerType){case"mouse":case"pen":!function(t){var e;switch(t.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),t.button){case 0:e=l.mouseButtons.LEFT;break;case 1:e=l.mouseButtons.MIDDLE;break;case 2:e=l.mouseButtons.RIGHT;break;default:e=-1}switch(e){case n.MOUSE.DOLLY:if(!1===l.enableZoom)return;!function(t){A.set(t.clientX,t.clientY)}(t),f=p.DOLLY;break;case n.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enablePan)return;z(t),f=p.PAN}else{if(!1===l.enableRotate)return;U(t),f=p.ROTATE}break;case n.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enableRotate)return;U(t),f=p.ROTATE}else{if(!1===l.enablePan)return;z(t),f=p.PAN}break;default:f=p.NONE}f!==p.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",q),l.domElement.ownerDocument.addEventListener("pointerup",Z),l.dispatchEvent(u))}(t)}}function q(t){if(!1!==l.enabled)switch(t.pointerType){case"mouse":case"pen":!function(t){if(!1===l.enabled)return;switch(t.preventDefault(),f){case p.ROTATE:if(!1===l.enableRotate)return;!function(t){T.set(t.clientX,t.clientY),_.subVectors(T,w).multiplyScalar(l.rotateSpeed);var e=l.domElement;L(2*Math.PI*_.x/e.clientHeight),O(2*Math.PI*_.y/e.clientHeight),w.copy(T),l.update()}(t);break;case p.DOLLY:if(!1===l.enableZoom)return;!function(t){C.set(t.clientX,t.clientY),P.subVectors(C,A),P.y>0?k(R()):P.y<0&&N(R()),A.copy(C),l.update()}(t);break;case p.PAN:if(!1===l.enablePan)return;!function(t){S.set(t.clientX,t.clientY),M.subVectors(S,E).multiplyScalar(l.panSpeed),B(M.x,M.y),E.copy(S),l.update()}(t)}}(t)}}function Z(t){switch(t.pointerType){case"mouse":case"pen":!function(t){if(l.domElement.ownerDocument.removeEventListener("pointermove",q),l.domElement.ownerDocument.removeEventListener("pointerup",Z),!1===l.enabled)return;l.dispatchEvent(d),f=p.NONE}()}}function K(t){!1===l.enabled||!1===l.enableZoom||f!==p.NONE&&f!==p.ROTATE||(t.preventDefault(),t.stopPropagation(),l.dispatchEvent(u),function(t){t.deltaY<0?N(R()):t.deltaY>0&&k(R()),l.update()}(t),l.dispatchEvent(d))}function J(t){!1!==l.enabled&&!1!==l.enablePan&&function(t){var e=!1;switch(t.keyCode){case l.keys.UP:B(0,l.keyPanSpeed),e=!0;break;case l.keys.BOTTOM:B(0,-l.keyPanSpeed),e=!0;break;case l.keys.LEFT:B(l.keyPanSpeed,0),e=!0;break;case l.keys.RIGHT:B(-l.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),l.update())}(t)}function Q(t){if(!1!==l.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(l.touches.ONE){case n.TOUCH.ROTATE:if(!1===l.enableRotate)return;G(t),f=p.TOUCH_ROTATE;break;case n.TOUCH.PAN:if(!1===l.enablePan)return;V(t),f=p.TOUCH_PAN;break;default:f=p.NONE}break;case 2:switch(l.touches.TWO){case n.TOUCH.DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(t){l.enableZoom&&H(t),l.enablePan&&V(t)}(t),f=p.TOUCH_DOLLY_PAN;break;case n.TOUCH.DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(t){l.enableZoom&&H(t),l.enableRotate&&G(t)}(t),f=p.TOUCH_DOLLY_ROTATE;break;default:f=p.NONE}break;default:f=p.NONE}f!==p.NONE&&l.dispatchEvent(u)}}function $(t){if(!1!==l.enabled)switch(t.preventDefault(),t.stopPropagation(),f){case p.TOUCH_ROTATE:if(!1===l.enableRotate)return;W(t),l.update();break;case p.TOUCH_PAN:if(!1===l.enablePan)return;X(t),l.update();break;case p.TOUCH_DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(t){l.enableZoom&&j(t),l.enablePan&&X(t)}(t),l.update();break;case p.TOUCH_DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(t){l.enableZoom&&j(t),l.enableRotate&&W(t)}(t),l.update();break;default:f=p.NONE}}function tt(t){!1!==l.enabled&&(l.dispatchEvent(d),f=p.NONE)}function et(t){!1!==l.enabled&&t.preventDefault()}l.domElement.addEventListener("contextmenu",et),l.domElement.addEventListener("pointerdown",Y),l.domElement.addEventListener("wheel",K),l.domElement.addEventListener("touchstart",Q),l.domElement.addEventListener("touchend",tt),l.domElement.addEventListener("touchmove",$),this.update()};r.prototype=Object.create(n.EventDispatcher.prototype),r.prototype.constructor=r;var s=function(t,e){r.call(this,t,e),this.screenSpacePanning=!1,this.mouseButtons.LEFT=n.MOUSE.PAN,this.mouseButtons.RIGHT=n.MOUSE.ROTATE,this.touches.ONE=n.TOUCH.PAN,this.touches.TWO=n.TOUCH.DOLLY_ROTATE};s.prototype=Object.create(n.EventDispatcher.prototype),s.prototype.constructor=s},function(t,e,i){"use strict";i.r(e),i.d(e,"WEBGL",(function(){return n}));var n={isWebGLAvailable:function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}},isWebGL2Available:function(){try{var t=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!t.getContext("webgl2"))}catch(t){return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(t){var e={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='Your $0 does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>',n=document.createElement("div");return n.id="webglmessage",n.style.fontFamily="monospace",n.style.fontSize="13px",n.style.fontWeight="normal",n.style.textAlign="center",n.style.background="#fff",n.style.color="#000",n.style.padding="1.5em",n.style.width="400px",n.style.margin="5em auto 0",i=(i=e[t]?i.replace("$0","graphics card"):i.replace("$0","browser")).replace("$1",{1:"WebGL",2:"WebGL 2"}[t]),n.innerHTML=i,n}}},function(t,e,i){"use strict";i.r(e),i.d(e,"RenderPass",(function(){return s}));var n=i(0),r=i(3),s=function(t,e,i,s,o){r.a.call(this),this.scene=t,this.camera=e,this.overrideMaterial=i,this.clearColor=s,this.clearAlpha=void 0!==o?o:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new n.Color};s.prototype=Object.assign(Object.create(r.a.prototype),{constructor:s,render:function(t,e,i){var n,r,s=t.autoClear;t.autoClear=!1,void 0!==this.overrideMaterial&&(r=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(t.getClearColor(this._oldClearColor),n=t.getClearAlpha(),t.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:i),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),this.clearColor&&t.setClearColor(this._oldClearColor,n),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=r),t.autoClear=s}})},function(t,e,i){"use strict";i.r(e),i.d(e,"DotScreenShader",(function(){return r}));var n=i(0),r={uniforms:{tDiffuse:{value:null},tSize:{value:new n.Vector2(256,256)},center:{value:new n.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","\tfloat s = sin( angle ), c = cos( angle );","\tvec2 tex = vUv * tSize - center;","\tvec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","\treturn ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tfloat average = ( color.r + color.g + color.b ) / 3.0;","\tgl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")}},function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),r=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),i(37),i(38),r(i(39),e)},function(t,e,i){},function(t,e,i){},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.AmmoPhysics=e.Clock=e.Types=e.AllHitsRaycaster=e.ClosestRaycaster=e.PhysicsLoader=e.ExtendedGroup=e.ExtendedMesh=e.ExtendedObject3D=void 0;const n=i(9),r=i(40),s=i(10);Object.defineProperty(e,"ExtendedObject3D",{enumerable:!0,get:function(){return s.ExtendedObject3D}});const o=i(6);Object.defineProperty(e,"ExtendedMesh",{enumerable:!0,get:function(){return o.ExtendedMesh}});const a=i(15);Object.defineProperty(e,"ExtendedGroup",{enumerable:!0,get:function(){return a.ExtendedGroup}});const h=i(41),l=i(42),c=i(5),u=i(2),d=i(43),p=i(44),f=i(16),m=i(45),g=i(46),v=i(47),y=i(11);Object.defineProperty(e,"PhysicsLoader",{enumerable:!0,get:function(){return y.PhysicsLoader}});const x=i(17),b=i(4);e.Types=b;const w=i(48);Object.defineProperty(e,"ClosestRaycaster",{enumerable:!0,get:function(){return w.ClosestRaycaster}}),Object.defineProperty(e,"AllHitsRaycaster",{enumerable:!0,get:function(){return w.AllHitsRaycaster}});var T=i(52);Object.defineProperty(e,"Clock",{enumerable:!0,get:function(){return T.Clock}});class _ extends c.EventEmitter{constructor(t,e={}){super(),this.scene=t,this.config=e,this.rigidBodies=[],this.earlierDetectedCollisions=[],this.complexShapes=["plane","hull","hacd","vhacd","convexMesh","concaveMesh"],this.gravity=e.gravity||{x:0,y:-9.81,z:0},this.isHeadless="headless"===t,this.tmpEuler=new u.Euler,this.tmpQuaternion=new u.Quaternion,this.tmpVector3=new u.Vector3,this.tmpVector3a=new u.Vector3,this.tmpMatrix4=new u.Matrix4,this.tmpMatrix4a=new u.Matrix4,this.tmpBtVector3=new Ammo.btVector3,this.tmpBtQuaternion=new Ammo.btQuaternion(0,0,0,1),this.emptyV3=new u.Vector3,this.impactPoint=new u.Vector3,this.impactNormal=new u.Vector3,"headless"!==t&&(this.defaultMaterial=new x.default),this.start()}get tmpTrans(){return console.warn("Use worldTransform instead of tmpTrans."),this.worldTransform}set tmpTrans(t){console.warn("Use worldTransform instead of tmpTrans."),this.worldTransform=t}destroy(t){var e;const i=Object.keys(t).includes("body")?t.body:t;if(void 0===(null==i?void 0:i.ammo))return;const n=i.ammo.name;let r=i.ammo.threeObject;if(n&&r&&(null===(e=null==r?void 0:r.body)||void 0===e?void 0:e.ammo)){r.body.isSoftBody?this.physicsWorld.removeSoftBody(r.body.ammo):this.physicsWorld.removeRigidBody(r.body.ammo),r.body.destructor(),r.body=void 0,r.hasBody=!1,delete i.ammo.threeObject;for(let t=0;t<this.rigidBodies.length;t++)this.rigidBodies[t].name===n&&(this.rigidBodies.splice(t,1),t--)}"headless"===this.scene&&r&&(r=null)}setup(){if(this.worldTransform=new Ammo.btTransform,"function"==typeof this.config.setupPhysicsWorld?this.physicsWorld=this.config.setupPhysicsWorld():this.physicsWorld=this.setupPhysicsWorld(),"headless"!==this.scene){this.convexBreaker=new v.ConvexObjectBreaker,this.objectsToRemove=[],this.numObjectsToRemove=0;for(let t=0;t<500;t++)this.objectsToRemove[t]=null}this.collisionEvents=new m.CollisionEvents,this.factory=new f.default(this.scene),this.shapes=new h.default(this.factory,(t,e)=>this.addExisting(t,e)),this.constraints=new l.default(this.worldTransform,this.physicsWorld),"headless"!==this.scene&&(this.debugDrawer=new g.default(this.scene,this.physicsWorld,{}))}updateDebugger(){"headless"!==this.scene&&this.debugDrawer&&this.debugDrawer.enabled&&this.debugDrawer.update()}setupPhysicsWorld(){const t=this.gravity,{softBodies:e=!1}=this.config;let i;if(!e){const t=new Ammo.btDefaultCollisionConfiguration,e=new Ammo.btCollisionDispatcher(t),n=new Ammo.btDbvtBroadphase,r=new Ammo.btSequentialImpulseConstraintSolver;i=new Ammo.btDiscreteDynamicsWorld(e,n,r,t)}if(e){const t=new Ammo.btSoftBodyRigidBodyCollisionConfiguration,e=new Ammo.btCollisionDispatcher(t),n=new Ammo.btDbvtBroadphase,r=new Ammo.btSequentialImpulseConstraintSolver,s=new Ammo.btDefaultSoftBodySolver;i=new Ammo.btSoftRigidDynamicsWorld(e,n,r,t,s)}return i.setGravity(new Ammo.btVector3(t.x,t.y,t.z)),i}createDebrisFromBreakableObject(t,e){"headless"!==this.scene&&(t.material=this.defaultMaterial.get(),t.shape="hull",t.fragmentDepth=e.fragmentDepth+1,this.scene.add(t),this.addExisting(t),t.body.breakable=!1,setTimeout(()=>{t.body.breakable=!0},2500))}removeDebris(t){"headless"!==this.scene&&(this.scene.remove(t),this.destroy(t))}update(t){this.updatePhysics(t),this.detectCollisions()}updatePhysics(t){const e=t/1e3;this.physicsWorld.stepSimulation(e,this.config.maxSubSteps||4,this.config.fixedTimeStep||1/60);for(let t=0;t<this.rigidBodies.length;t++){const e=this.rigidBodies[t],i=e.body.ammo.getMotionState();if(i)if(i.getWorldTransform(this.worldTransform),e.body.didUpdate&&(e.body._emitUpdateEvents&&e.body.eventEmitter.emit("update"),e.body.didUpdate=!1),e.body.ammo.isKinematicObject()&&e.body.needUpdate)e.getWorldQuaternion(this.tmpQuaternion),e.getWorldPosition(this.tmpVector3),this.tmpBtVector3.setValue(this.tmpVector3.x,this.tmpVector3.y,this.tmpVector3.z),this.tmpBtQuaternion.setValue(this.tmpQuaternion.x,this.tmpQuaternion.y,this.tmpQuaternion.z,this.tmpQuaternion.w),this.worldTransform.setOrigin(this.tmpBtVector3),this.worldTransform.setRotation(this.tmpBtQuaternion),i.setWorldTransform(this.worldTransform),e.body.needUpdate=!1;else if(e.body.skipUpdate);else if(!e.body.ammo.isStaticObject()){let t=this.worldTransform.getOrigin(),i=this.worldTransform.getRotation(),n=e.body.offset;if(e.body.ignoreScale)this.tmpVector3a.set(e.scale.x,e.scale.y,e.scale.z);else{const t=e.body.ammo.getCollisionShape().getLocalScaling();this.tmpVector3a.set(t.x(),t.y(),t.z())}this.tmpVector3.set(t.x()+n.x,t.y()+n.y,t.z()+n.z),this.tmpQuaternion.set(i.x(),i.y(),i.z(),i.w()),this.tmpMatrix4.compose(this.tmpVector3,this.tmpQuaternion,this.tmpVector3a),e.parent?parseInt(u.REVISION)>=123?this.tmpMatrix4a.copy(e.parent.matrixWorld).invert():this.tmpMatrix4a.getInverse(e.parent.matrixWorld):this.tmpMatrix4a.identity(),this.tmpMatrix4a.multiply(this.tmpMatrix4),this.tmpMatrix4a.decompose(e.position,e.quaternion,e.scale)}}}detectCollisions(){var t,e;const i=[];this.impactPoint.set(0,0,0),this.impactNormal.set(0,0,0);const n=this.physicsWorld.getDispatcher(),r=n.getNumManifolds();for(let s=0;s<r;s++){let r=n.getManifoldByIndexInternal(s),o=r.getNumContacts();const a=Ammo.castObject(r.getBody0(),Ammo.btRigidBody),h=Ammo.castObject(r.getBody1(),Ammo.btRigidBody);let l=a.threeObject,c=h.threeObject;if(!l||!c)continue;if(""===a.name&&""===h.name)continue;const u=null===(t=l.body)||void 0===t?void 0:t.checkCollisions,d=null===(e=c.body)||void 0===e?void 0:e.checkCollisions,p=l.body.breakable,f=c.body.breakable,m=p||f;if(!(u||d)&&!m)continue;let g=!1,v=0,y="start";for(let t=0;t<o;t++){const e=r.getContactPoint(t);if(e.getDistance()<=0){g=!0;const t=e.getAppliedImpulse(),n=e.get_m_positionWorldOnB(),r=e.get_m_normalWorldOnB();if(u||d){const t=[l.name,c.name].sort(),e=`${t[0]}__${t[1]}`;this.earlierDetectedCollisions.find(t=>t.combinedName===e)&&(y="collision"),i.find(t=>t.combinedName===e)||(i.push({combinedName:e,collision:!0}),this.collisionEvents.emit("collision",{bodies:[l,c],event:y}))}t>=v&&(v=t,(p||f)&&(this.impactPoint.set(n.x(),n.y(),n.z()),this.impactNormal.set(r.x(),r.y(),r.z())));break}}if(!g)continue;if(!m)continue;const x=5,b=2;if(this.emptyV3.set(0,0,0),l.userData.ammoPhysicsData={mass:1,velocity:this.emptyV3,angularVelocity:this.emptyV3,breakable:p,physicsBody:a},c.userData.ammoPhysicsData={mass:1,velocity:this.emptyV3,angularVelocity:this.emptyV3,breakable:f,physicsBody:h},void 0===l.fragmentDepth&&(l.fragmentDepth=0),void 0===c.fragmentDepth&&(c.fragmentDepth=0),p&&v>x&&l.fragmentDepth<b){const t=this.convexBreaker.subdivideByImpact(l,this.impactPoint,this.impactNormal,1,2),e=t.length;for(let i=0;i<e;i++){const e=a.getLinearVelocity(),n=a.getAngularVelocity(),r=t[i];r.userData.ammoPhysicsData.velocity.set(e.x(),e.y(),e.z()),r.userData.ammoPhysicsData.angularVelocity.set(n.x(),n.y(),n.z()),this.createDebrisFromBreakableObject(r,l)}this.objectsToRemove[this.numObjectsToRemove++]=l}if(f&&v>x&&c.fragmentDepth<b){const t=this.convexBreaker.subdivideByImpact(c,this.impactPoint,this.impactNormal,1,2),e=t.length;for(let i=0;i<e;i++){const e=h.getLinearVelocity(),n=h.getAngularVelocity(),r=t[i];r.userData.ammoPhysicsData.velocity.set(e.x(),e.y(),e.z()),r.userData.ammoPhysicsData.angularVelocity.set(n.x(),n.y(),n.z()),this.createDebrisFromBreakableObject(r,c)}this.objectsToRemove[this.numObjectsToRemove++]=c}}for(let t=0;t<this.numObjectsToRemove;t++)this.removeDebris(this.objectsToRemove[t]);this.numObjectsToRemove=0,this.earlierDetectedCollisions.forEach(t=>{const{combinedName:e}=t;if(!i.find(t=>t.combinedName===e)){const t=e.split("__"),i=this.rigidBodies.find(e=>e.name===t[0]),n=this.rigidBodies.find(e=>e.name===t[1]),r="end";i&&n&&this.collisionEvents.emit("collision",{bodies:[i,n],event:r})}}),this.earlierDetectedCollisions=[...i]}setGravity(t=0,e=-9.8,i=0){this.tmpBtVector3.setValue(t,e,i),this.physicsWorld.setGravity(this.tmpBtVector3)}get debug(){return this.isHeadless?null:{enable:()=>{this.debugDrawer.enable()},mode:(t=1)=>{this.debugDrawer.setDebugMode(t)},disable:()=>{this.debugDrawer.disable()}}}start(){"undefined"!=typeof Ammo?"function"==typeof Ammo?Ammo().then(()=>{this.setup()}):this.setup():n.default("Are you sure you included ammo.js?")}get add(){return{collider:(t,e,i)=>this.collisionEvents.addCollider(t,e,i),constraints:this.constraints.addConstraints,existing:(t,e)=>this.addExisting(t,e),plane:(t={},e={})=>this.shapes.addPlane(t,e),sphere:(t={},e={})=>this.shapes.addSphere(t,e),ground:(t={},e={})=>this.shapes.addGround(t,e),box:(t={},e={})=>this.shapes.addBox(t,e),cylinder:(t={},e={})=>this.shapes.addCylinder(t,e),cone:(t={},e={})=>this.shapes.addCone(t,e),torus:(t={},e={})=>this.shapes.addTorus(t,e),extrude:(t,e={})=>this.shapes.addExtrude(t,e),raycaster:(t="closest")=>"closest"===t?new w.ClosestRaycaster(this):new w.AllHitsRaycaster(this)}}prepareThreeObjectForCollisionShape(t,e={}){var i,r;const{autoCenter:s=!1}=e,o={width:1,height:1,depth:1,radius:1,radiusTop:1,radiusBottom:1,tube:.4,tubularSegments:6};let a="unknown";const h=(null===(i=t.geometry)||void 0===i?void 0:i.type)||"unknown";/box/i.test(h)?a="box":/cone/i.test(h)?a="cone":/cylinder/i.test(h)?a="cylinder":/extrude/i.test(h)?a="extrude":/plane/i.test(h)?a="plane":/sphere/i.test(h)?a="sphere":/torus/i.test(h)&&(a="torus");let l=Object.assign(Object.assign({},o),null===(r=null==t?void 0:t.geometry)||void 0===r?void 0:r.parameters);return e.shape?(l=Object.assign(Object.assign({},o),e),a=e.shape):t.shape&&(a=t.shape),Object.keys(l).forEach(t=>{void 0===l[t]&&o[t]&&(l[t]=o[t])}),s&&t.geometry.center(),"cylinder"===a&&(l.radius=e.radius||l.radiusTop),"extrude"===a&&(a="hacd"),"mesh"!==a&&"convex"!==a||(a="convexMesh"),"concave"===a&&(a="concaveMesh"),"unknown"===a&&(n.default(`Shape for ${null==t?void 0:t.name} not recognized! Will fallback to box.`),a="box"),{shape:a,params:l,object:t}}createCollisionShape(t,e,i){const n=(null==i?void 0:i.quaternion)?null==i?void 0:i.quaternion:new u.Quaternion(0,0,0,1),{axis:r="y"}=e,s=new Ammo.btVector3,o=null==i?void 0:i.geometry;i&&(null==o?void 0:o.isGeometry)&&(i.geometry=(new u.BufferGeometry).fromGeometry(o));let a,h={};switch(-1!==this.complexShapes.indexOf(t)&&(h=(t=>{const e=(new u.Matrix4).elements,i=[],n=[],r=[];return d.iterateGeometries(t,{},(t,e,s)=>{i.push(t),n.push(e),r.push(s)}),{vertices:i,matrices:n,indexes:r,matrixWorld:e}})(i)),t){case"box":s.setValue(e.width/2,e.height/2,e.depth/2),a=new Ammo.btBoxShape(s);break;case"sphere":a=new Ammo.btSphereShape(e.radius);break;case"cylinder":switch(r){case"y":s.setValue(e.radius,e.height/2,e.radius),a=new Ammo.btCylinderShape(s);break;case"x":s.setValue(e.height/2,e.radius,e.radius),a=new Ammo.btCylinderShapeX(s);break;case"z":s.setValue(e.radius,e.radius,e.height/2),a=new Ammo.btCylinderShapeZ(s)}break;case"cone":switch(r){case"y":a=new Ammo.btConeShape(e.radius,e.height);break;case"x":a=new Ammo.btConeShapeX(e.radius,e.height);break;case"z":a=new Ammo.btConeShapeZ(e.radius,e.height)}break;case"capsule":switch(r){case"y":a=new Ammo.btCapsuleShape(e.radius,e.height);break;case"x":a=new Ammo.btCapsuleShapeX(e.radius,e.height);break;case"z":a=new Ammo.btCapsuleShapeZ(e.radius,e.height)}break;case"torus":a=p.createTorusShape(e,n);break;case"plane":a=d.createTriMeshShape(h.vertices,h.matrices,h.indexes,h.matrixWorld,Object.assign(Object.assign({},e),{concave:!1}));break;case"hull":a=d.createHullShape(h.vertices,h.matrices,h.matrixWorld,e);break;case"hacd":a=d.createHACDShapes(h.vertices,h.matrices,h.indexes,h.matrixWorld,e);break;case"vhacd":a=d.createVHACDShapes(h.vertices,h.matrices,h.indexes,h.matrixWorld,e);break;case"convexMesh":a=d.createTriMeshShape(h.vertices,h.matrices,h.indexes,h.matrixWorld,Object.assign(Object.assign({},e),{concave:!1}));break;case"concaveMesh":a=d.createTriMeshShape(h.vertices,h.matrices,h.indexes,h.matrixWorld,Object.assign(Object.assign({},e),{concave:!0}))}Ammo.destroy(s);const{x:l,y:c,z:f}=e;return(l||c||f)&&(a.offset={x:l||0,y:c||0,z:f||0}),Array.isArray(a)&&(a=this.mergeCollisionShapesToCompoundShape(a)),a}mergeCollisionShapesToCompoundShape(t){const e=new Ammo.btCompoundShape;return t.forEach(t=>{const{offset:i}=t,n=new Ammo.btTransform;n.setIdentity(),i&&n.getOrigin().setValue(i.x||0,i.y||0,i.z||0),e.addChildShape(n,t)}),e}addExisting(t,e={}){const{hasBody:i}=t;if(i)return void console.warn(`[Enable3d]: Object "${t.name}" already has a physical body!`);const n=new u.Vector3,r=new u.Quaternion,s=new u.Vector3;t.getWorldPosition(n),t.getWorldQuaternion(r),t.getWorldScale(s);const o="1"===(e.collisionFlags||0).toString(2).slice(-1),a="1"===(e.collisionFlags||0).toString(2).slice(-2,-1),{shape:h="unknown",compound:l=[],mass:c=(o||a?0:1),collisionFlags:d=0,collisionGroup:p=1,collisionMask:f=-1,offset:m,breakable:g=!1,addChildren:v=!0,margin:y=.01,ignoreScale:x=!1}=e;if(x&&s.set(1,1,1),l.length>=1){const e=l.map(t=>this.createCollisionShape(t.shape,t)),i=this.mergeCollisionShapesToCompoundShape(e),o=this.finishCollisionShape(i,n,r,s,y),h=this.collisionShapeToRigidBody(i,o,c,a);return this.addRigidBodyToWorld(t,h,d,p,f,g,m),void(t.body.ignoreScale=x)}const b=[];if("unknown"!==h||t.isMesh){const i=this.prepareThreeObjectForCollisionShape(t,e),n=this.createCollisionShape(i.shape,i.params,i.object);b.push(n)}if("unknown"===h&&v&&t.children.length>=1&&t.children.forEach(t=>{if(t.isMesh){const e=this.prepareThreeObjectForCollisionShape(t),i=this.createCollisionShape(e.shape,e.params,e.object);i.offset=t.position.clone(),b.push(i)}}),0===b.length){const i=this.prepareThreeObjectForCollisionShape(t,e),n=this.createCollisionShape(i.shape,i.params,i.object);b.push(n)}const w=1===b.length?b[0]:this.mergeCollisionShapesToCompoundShape(b),T=this.finishCollisionShape(w,n,r,s,y),_=this.collisionShapeToRigidBody(w,T,c,a);this.addRigidBodyToWorld(t,_,d,p,f,g,m),t.body.ignoreScale=x}addRigidBodyToWorld(t,e,i,n,s,o,a){this.rigidBodies.push(t),this.physicsWorld.addRigidBody(e,n,s);const h=Object.values(e)[0];e.name=t.name,t.body=new r.default(this,e),t.hasBody=!0,t.ptr=h,e.threeObject=t,o&&(t.body.breakable=!0),a&&(t.body.offset=Object.assign({x:0,y:0,z:0},a)),t.body.setCollisionFlags(i)}finishCollisionShape(t,e,i,n,r){t.setMargin(r);const s=new Ammo.btQuaternion(0,0,0,1);s.setValue(i.x,i.y,i.z,i.w);const o=new Ammo.btTransform;o.setIdentity(),o.getOrigin().setValue(e.x,e.y,e.z),o.setRotation(s),Ammo.destroy(s);const a=new Ammo.btVector3(n.x,n.y,n.z);return t.setLocalScaling(a),Ammo.destroy(a),o}collisionShapeToRigidBody(t,e,i,n){const r=new Ammo.btDefaultMotionState(e),s=new Ammo.btVector3(0,0,0);i>0&&t.calculateLocalInertia(i,s);const o=new Ammo.btRigidBodyConstructionInfo(i,r,t,s),a=new Ammo.btRigidBody(o);return(i>0||n)&&a.setActivationState(4),a}}e.AmmoPhysics=_},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});const n=i(5),r=i(2);e.default=class{constructor(t,e){this.physics=t,this.ammo=e,this.ignoreScale=!1,this.isSoftBody=!1,this.offset={x:0,y:0,z:0},this.errors=[],this.checkCollisions=!1,this.breakable=!1,this.didUpdate=!1,this.skipUpdate=!1,this._emitUpdateEvents=!1,this._needUpdate=!1,this.tmpEuler=new r.Euler,this.tmpQuaternion=new r.Quaternion,this.tmpBtVector3=new Ammo.btVector3,this.tmpBtVector3_1=new Ammo.btVector3,this.tmpBtQuaternion=new Ammo.btQuaternion(0,0,0,1),this.eventEmitter=new n.EventEmitter,this.name=e.name}destructor(){this.eventEmitter&&this.eventEmitter.removeAllListeners(),Ammo.destroy(this.tmpBtVector3),Ammo.destroy(this.tmpBtVector3_1),Ammo.destroy(this.tmpBtQuaternion),Ammo.destroy(this.ammo.getCollisionShape()),Ammo.destroy(this.ammo)}setupEventEmitter(){void 0===this.eventEmitter&&(this.eventEmitter=new n.EventEmitter)}get needUpdate(){return this._needUpdate}set needUpdate(t){!t&&this._needUpdate&&(this.didUpdate=!0),this._needUpdate=t}onUpdateEvent(t,e=!1){this.setupEventEmitter(),this._emitUpdateEvents=!0,e?this.eventEmitter.once("update",()=>{t()}):this.eventEmitter.on("update",()=>{t()})}get on(){return{update:t=>this.onUpdateEvent(t),collision:t=>this.onCollision(t)}}get once(){return{update:t=>this.onUpdateEvent(t,!0)}}onCollision(t){this.checkCollisions=!0,this.physics.collisionEvents.on("collision",e=>{const{bodies:i,event:n}=e;i[0].name===this.name?t(i[1],n):i[1].name===this.name&&t(i[0],n)})}transform(){const t=this.physics.worldTransform;this.ammo.getMotionState().getWorldTransform(t)}refresh(){const t=this.physics.worldTransform;this.ammo.getMotionState().setWorldTransform(t)}setRotation(t,e,i){const n=this.tmpEuler.set(t,e,i),r=this.tmpQuaternion.set(0,0,0,1);r.setFromEuler(n),this.tmpBtQuaternion.setValue(0,0,0,1);const s=this.tmpBtQuaternion;s.setValue(r.x,r.y,r.z,r.w);this.physics.worldTransform.setRotation(s)}get rotation(){let t,e,i;const n=this.physics.worldTransform.getRotation();let r=this.tmpQuaternion.set(n.x(),n.y(),n.z(),n.w());r.w>1&&(r=r.normalize());const s=2*Math.acos(r.w),o=Math.sqrt(1-r.w*r.w);return o<.001?(t=r.x,e=r.y,i=r.z):(t=r.x/o,e=r.y/o,i=r.z/o),{x:t*s,y:e*s,z:i*s}}get quaternion(){const t=this.physics.worldTransform.getRotation();return{x:t.x(),y:t.y(),z:t.z(),w:t.w()}}setPosition(t,e,i){this.physics.worldTransform.getOrigin().setValue(t,e,i)}get position(){const t=this.physics.worldTransform;return{x:t.getOrigin().x(),y:t.getOrigin().y(),z:t.getOrigin().z()}}get velocity(){return{x:this.ammo.getLinearVelocity().x(),y:this.ammo.getLinearVelocity().y(),z:this.ammo.getLinearVelocity().z()}}get angularVelocity(){return{x:this.ammo.getAngularVelocity().x(),y:this.ammo.getAngularVelocity().y(),z:this.ammo.getAngularVelocity().z()}}setVelocity(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setLinearVelocity(this.tmpBtVector3)}setVelocityX(t){this.tmpBtVector3.setValue(t,this.velocity.y,this.velocity.z),this.ammo.setLinearVelocity(this.tmpBtVector3)}setVelocityY(t){this.tmpBtVector3.setValue(this.velocity.x,t,this.velocity.z),this.ammo.setLinearVelocity(this.tmpBtVector3)}setVelocityZ(t){this.tmpBtVector3.setValue(this.velocity.x,this.velocity.y,t),this.ammo.setLinearVelocity(this.tmpBtVector3)}setAngularVelocity(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setAngularVelocity(this.tmpBtVector3)}setAngularVelocityX(t){this.tmpBtVector3.setValue(t,this.angularVelocity.y,this.angularVelocity.z),this.ammo.setAngularVelocity(this.tmpBtVector3)}setAngularVelocityY(t){this.tmpBtVector3.setValue(this.angularVelocity.x,t,this.angularVelocity.z),this.ammo.setAngularVelocity(this.tmpBtVector3)}setAngularVelocityZ(t){this.tmpBtVector3.setValue(this.angularVelocity.x,this.angularVelocity.y,t),this.ammo.setAngularVelocity(this.tmpBtVector3)}applyForce(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyForceX(t){this.tmpBtVector3.setValue(t,0,0),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyForceY(t){this.tmpBtVector3.setValue(0,t,0),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyForceZ(t){this.tmpBtVector3.setValue(0,0,t),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyCentralForce(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyCentralForce(this.tmpBtVector3)}applyCentralImpulse(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyCentralLocalForce(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyCentralLocalForce(this.tmpBtVector3)}applyImpulse(t,e){this.tmpBtVector3.setValue(t.x||0,t.y||0,t.z||0),this.tmpBtVector3_1.setValue(e.x||0,e.y||0,e.z||0),this.ammo.applyImpulse(this.tmpBtVector3,this.tmpBtVector3_1)}applyLocalTorque(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyLocalTorque(this.tmpBtVector3)}applyTorque(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyTorque(this.tmpBtVector3)}applyTorqueImpulse(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyTorqueImpulse(this.tmpBtVector3)}setCollisionFlags(t){this.ammo.setCollisionFlags(t)}getCollisionFlags(){return this.ammo.getCollisionFlags()}setRestitution(t){this.ammo.setRestitution(t)}setBounciness(t){this.setRestitution(t)}setFriction(t){this.ammo.setFriction(t)}setDamping(t,e){this.ammo.setDamping(t,e)}setGravity(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setGravity(this.tmpBtVector3)}setLinearFactor(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setLinearFactor(this.tmpBtVector3)}setAngularFactor(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setAngularFactor(this.tmpBtVector3)}setCcdMotionThreshold(t){this.ammo.setCcdMotionThreshold(t)}setCcdSweptSphereRadius(t){this.ammo.setCcdSweptSphereRadius(t)}}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this.factory=t,this.addExisting=e}addPlane(t={},e={}){const i=this.factory.add.plane(t,e);return this.addExisting(i,t),i}addSphere(t={},e={}){const i=this.factory.add.sphere(t,e);return this.addExisting(i,t),i}addBox(t={},e={}){const i=this.factory.add.box(t,e);return this.addExisting(i,t),i}addGround(t,e={}){const i=this.factory.add.ground(t,e),n=Object.assign(Object.assign({},t),{mass:0,collisionFlags:1});return this.addExisting(i,n),i}addCylinder(t={},e={}){const i=this.factory.add.cylinder(t,e);return this.addExisting(i,t),i}addCone(t={},e={}){const i=this.factory.add.cone(t,e);return this.addExisting(i,t),i}addTorus(t={},e={}){const i=this.factory.add.torus(t,e);return this.addExisting(i,t),i}addExtrude(t,e={}){const i=this.factory.add.extrude(t,e);return i.translateX(1),this.addExisting(i),i}}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this.worldTransform=t,this.physicsWorld=e,this.tmpBtVector3=new Ammo.btVector3}toAmmoV3(t,e=0){return new Ammo.btVector3(void 0!==(null==t?void 0:t.x)?t.x:e,void 0!==(null==t?void 0:t.y)?t.y:e,void 0!==(null==t?void 0:t.z)?t.z:e)}get addConstraints(){return{lock:(t,e,i)=>this.lock(t,e,i),fixed:(t,e,i)=>this.fixed(t,e,i),pointToPoint:(t,e,i,n)=>this.pointToPoint(t,e,i,n),hinge:(t,e,i,n)=>this.hinge(t,e,i,n),slider:(t,e,i={},n)=>this.slider(t,e,i,n),spring:(t,e,i={},n)=>this.spring(t,e,i,n),coneTwist:(t,e,i={frameA:{},frameB:{}},n)=>this.coneTwist(t,e,i,n),dof:(t,e,i,n)=>this.dof(t,e,i,n)}}getTransform(t,e,i={x:0,y:0,z:0},n=!1){i=Object.assign({x:0,y:0,z:0},i);const r=new Ammo.btTransform;if(r.setIdentity(),n){const n=(s=t.getWorldTransform().getOrigin(),o=e.getWorldTransform().getOrigin(),a=(s.x()-o.x())/2+i.x,h=(s.y()-o.y())/2+i.y,l=(s.z()-o.z())/2+i.z,new Ammo.btVector3(a,h,l)),r=new Ammo.btTransform;r.setIdentity(),r.setOrigin(n);const c=t.getCenterOfMassTransform().inverse().op_mul(e.getWorldTransform());return c.op_mul(r),{transformA:c,transformB:r}}r.setOrigin(new Ammo.btVector3(i.x,i.y,i.z));return{transformA:t.getCenterOfMassTransform().inverse().op_mul(e.getWorldTransform()).op_mul(r),transformB:r};var s,o,a,h,l}lock(t,e,i=!0){const n={x:0,y:0,z:0};return this.dof(t,e,{angularLowerLimit:n,angularUpperLimit:n},i)}fixed(t,e,i=!0){const n=this.getTransform(t.ammo,e.ammo);n.transformA.setRotation(t.ammo.getWorldTransform().getRotation()),n.transformB.setRotation(e.ammo.getWorldTransform().getRotation());const r=new Ammo.btFixedConstraint(t.ammo,e.ammo,n.transformA,n.transformB);return this.physicsWorld.addConstraint(r,i),r}pointToPoint(t,e,i={},n=!0){const{pivotA:r,pivotB:s}=i,o=new Ammo.btVector3((null==r?void 0:r.x)||0,(null==r?void 0:r.y)||0,(null==r?void 0:r.z)||0),a=new Ammo.btVector3((null==s?void 0:s.x)||0,(null==s?void 0:s.y)||0,(null==s?void 0:s.z)||0),h=new Ammo.btPoint2PointConstraint(t.ammo,e.ammo,o,a);return this.physicsWorld.addConstraint(h,n),h}hinge(t,e,i={},n=!0){const{pivotA:r,pivotB:s,axisA:o,axisB:a}=i,h=new Ammo.btVector3((null==r?void 0:r.x)||0,(null==r?void 0:r.y)||0,(null==r?void 0:r.z)||0),l=new Ammo.btVector3((null==s?void 0:s.x)||0,(null==s?void 0:s.y)||0,(null==s?void 0:s.z)||0),c=new Ammo.btVector3((null==o?void 0:o.x)||0,(null==o?void 0:o.y)||0,(null==o?void 0:o.z)||0),u=new Ammo.btVector3((null==a?void 0:a.x)||0,(null==a?void 0:a.y)||0,(null==a?void 0:a.z)||0),d=new Ammo.btHingeConstraint(t.ammo,e.ammo,h,l,c,u,!0);return this.physicsWorld.addConstraint(d,n),d}slider(t,e,i={},n=!0){const r=this.getTransform(t.ammo,e.ammo),{frameA:s={},frameB:o={},linearLowerLimit:a=0,linearUpperLimit:h=0,angularLowerLimit:l=0,angularUpperLimit:c=0}=i,u=r.transformA.getRotation();u.setEulerZYX(s.x||0,s.y||0,s.z||0),r.transformA.setRotation(u);const d=r.transformB.getRotation();d.setEulerZYX(o.x||0,o.y||0,o.z||0),r.transformB.setRotation(d);const p=new Ammo.btSliderConstraint(t.ammo,e.ammo,r.transformA,r.transformB,!0);return p.setLowerLinLimit(a),p.setUpperLinLimit(h),p.setLowerAngLimit(l),p.setUpperAngLimit(c),this.physicsWorld.addConstraint(p,n),p}spring(t,e,i={},n=!0){const{stiffness:r=50,damping:s=.01,angularLock:o=!1,linearLowerLimit:a={},linearUpperLimit:h={},angularLowerLimit:l={},angularUpperLimit:c={},offset:u={},center:d=!1,enableSpring:p=!0}=i,f=Object.assign({x:0,y:0,z:0},u),m=this.getTransform(t.ammo,e.ammo,f,d),g=new Ammo.btGeneric6DofSpringConstraint(t.ammo,e.ammo,m.transformA,m.transformB,!0);this.tmpBtVector3.setValue(a.x||0,a.y||0,a.z||0),g.setLinearLowerLimit(this.tmpBtVector3),this.tmpBtVector3.setValue(h.x||0,h.y||0,h.z||0),g.setLinearUpperLimit(this.tmpBtVector3),o?(this.tmpBtVector3.setValue(0,0,0),g.setAngularLowerLimit(this.tmpBtVector3),g.setAngularUpperLimit(this.tmpBtVector3)):(console.log(l,c),g.setAngularLowerLimit(this.toAmmoV3(l,-Math.PI)),g.setAngularUpperLimit(this.toAmmoV3(c,Math.PI)));for(let t=0;t<3;t++)g.enableSpring(t,p),g.setStiffness(t,r),g.setDamping(t,s);return this.physicsWorld.addConstraint(g,n),g}coneTwist(t,e,i,n=!0){const{frameA:r,frameB:s}=i,o=new Ammo.btTransform;o.setIdentity(),o.getOrigin().setValue((null==r?void 0:r.x)||0,(null==r?void 0:r.y)||0,(null==r?void 0:r.z)||0);const a=new Ammo.btTransform;a.setIdentity(),a.getOrigin().setValue((null==s?void 0:s.x)||0,(null==s?void 0:s.y)||0,(null==s?void 0:s.z)||0);this.getTransform(t.ammo,e.ammo);const h=new Ammo.btConeTwistConstraint(e.ammo,t.ammo,o,a);return h.setAngularOnly(!0),this.physicsWorld.addConstraint(h,n),h}dof(t,e,i={},n=!0){const{offset:r,center:s=!1}=i,o=Object.assign({x:0,y:0,z:0},r),a=this.getTransform(t.ammo,e.ammo,o,s),h=new Ammo.btGeneric6DofConstraint(t.ammo,e.ammo,a.transformA,a.transformB,!0),{linearLowerLimit:l,linearUpperLimit:c,angularLowerLimit:u,angularUpperLimit:d}=i,p=this.toAmmoV3(l),f=this.toAmmoV3(c),m=this.toAmmoV3(u,-Math.PI),g=this.toAmmoV3(d,Math.PI);return h.setLinearLowerLimit(p),h.setLinearUpperLimit(f),h.setAngularLowerLimit(m),h.setAngularUpperLimit(g),Ammo.destroy(p),Ammo.destroy(f),Ammo.destroy(m),Ammo.destroy(g),this.physicsWorld.addConstraint(h,n),h}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateGeometries=e.createHeightfieldTerrainShape=e.createTriMeshShape=e.createVHACDShapes=e.createHACDShapes=e.createHullShape=e.createSphereShape=e.createConeShape=e.createCapsuleShape=e.createCylinderShape=e.createBoxShape=e.createCollisionShapes=e.HEIGHTFIELD_DATA_TYPE=e.FIT=e.TYPE=void 0;
|
|
/**
|
|
* @author Kevin Lee (https://github.com/InfiniteLee)
|
|
* @copyright Copyright (c) 2020 Kevin Lee; Project Url: https://github.com/InfiniteLee/three-to-ammo
|
|
* @license {@link https://github.com/InfiniteLee/three-to-ammo/blob/master/LICENSE|MPL-2.0}
|
|
*/
|
|
const n=i(2);e.TYPE={BOX:"box",CYLINDER:"cylinder",SPHERE:"sphere",CAPSULE:"capsule",CONE:"cone",HULL:"hull",HACD:"hacd",VHACD:"vhacd",MESH:"mesh",HEIGHTFIELD:"heightfield"},e.FIT={ALL:"all",MANUAL:"manual"},e.HEIGHTFIELD_DATA_TYPE={short:"short",float:"float"};e.createCollisionShapes=function(t,i,n,r,s={}){switch(s.type){case e.TYPE.BOX:return[e.createBoxShape(t,i,r,s)];case e.TYPE.CYLINDER:return[e.createCylinderShape(t,i,r,s)];case e.TYPE.CAPSULE:return[e.createCapsuleShape(t,i,r,s)];case e.TYPE.CONE:return[e.createConeShape(t,i,r,s)];case e.TYPE.SPHERE:return[e.createSphereShape(t,i,r,s)];case e.TYPE.HULL:return[e.createHullShape(t,i,r,s)];case e.TYPE.HACD:return e.createHACDShapes(t,i,n,r,s);case e.TYPE.VHACD:return e.createVHACDShapes(t,i,n,r,s);case e.TYPE.MESH:return[e.createTriMeshShape(t,i,n,r,s)];case e.TYPE.HEIGHTFIELD:return[e.createHeightfieldTerrainShape(s)];default:return console.warn(s.type+" is not currently supported"),[]}};e.createBoxShape=function(t,i,n,a={}){a.type=e.TYPE.BOX,r(a),a.fit===e.FIT.ALL&&(a.halfExtents=h(l(t,i),a.minHalfExtent,a.maxHalfExtent));const c=new Ammo.btVector3(a.halfExtents.x,a.halfExtents.y,a.halfExtents.z),u=new Ammo.btBoxShape(c);return Ammo.destroy(c),s(u,a,o(n,a)),u};e.createCylinderShape=function(t,i,n,a={}){a.type=e.TYPE.CYLINDER,r(a),a.fit===e.FIT.ALL&&(a.halfExtents=h(l(t,i),a.minHalfExtent,a.maxHalfExtent));const c=new Ammo.btVector3(a.halfExtents.x,a.halfExtents.y,a.halfExtents.z),u=(()=>{switch(a.cylinderAxis){case"y":return new Ammo.btCylinderShape(c);case"x":return new Ammo.btCylinderShapeX(c);case"z":return new Ammo.btCylinderShapeZ(c)}return null})();return Ammo.destroy(c),s(u,a,o(n,a)),u};e.createCapsuleShape=function(t,i,n,a={}){a.type=e.TYPE.CAPSULE,r(a),a.fit===e.FIT.ALL&&(a.halfExtents=h(l(t,i),a.minHalfExtent,a.maxHalfExtent));const{x:c,y:u,z:d}=a.halfExtents,p=(()=>{switch(a.cylinderAxis){case"y":return new Ammo.btCapsuleShape(Math.max(c,d),2*u);case"x":return new Ammo.btCapsuleShapeX(Math.max(u,d),2*c);case"z":return new Ammo.btCapsuleShapeZ(Math.max(c,u),2*d)}return null})();return s(p,a,o(n,a)),p};e.createConeShape=function(t,i,n,a={}){a.type=e.TYPE.CONE,r(a),a.fit===e.FIT.ALL&&(a.halfExtents=h(l(t,i),a.minHalfExtent,a.maxHalfExtent));const{x:c,y:u,z:d}=a.halfExtents,p=(()=>{switch(a.cylinderAxis){case"y":return new Ammo.btConeShape(Math.max(c,d),2*u);case"x":return new Ammo.btConeShapeX(Math.max(u,d),2*c);case"z":return new Ammo.btConeShapeZ(Math.max(c,u),2*d)}return null})();return s(p,a,o(n,a)),p};e.createSphereShape=function(t,i,n,h={}){let c;h.type=e.TYPE.SPHERE,r(h),c=h.fit!==e.FIT.MANUAL||isNaN(h.sphereRadius)?a(t,i,l(t,i)):h.sphereRadius;const u=new Ammo.btSphereShape(c);return s(u,h,o(n,h)),u},e.createHullShape=function(){const t=new n.Vector3,i=new n.Vector3,a=new n.Matrix4;return function(n,h,c,u={}){if(u.type=e.TYPE.HULL,r(u),u.fit===e.FIT.MANUAL)return console.warn("cannot use fit: manual with type: hull"),null;const d=l(n,h),p=new Ammo.btVector3,f=new Ammo.btConvexHullShape;f.setMargin(u.margin),i.addVectors(d.max,d.min).multiplyScalar(.5);let m=0;for(let t=0;t<n.length;t++)m+=n[t].length/3;const g=u.hullMaxVertices||1e5;m>g&&console.warn(`too many vertices for hull shape; sampling ~${g} from ~${m} vertices`);const v=Math.min(1,g/m);for(let e=0;e<n.length;e++){const r=n[e];a.fromArray(h[e]);for(let s=0;s<r.length;s+=3){const o=e===n.length-1&&s===r.length-3;(Math.random()<=v||o)&&(t.set(r[s],r[s+1],r[s+2]).applyMatrix4(a).sub(i),p.setValue(t.x,t.y,t.z),f.addPoint(p,o))}}let y=f;if(f.getNumVertices()>=100){const t=new Ammo.btShapeHull(f);t.buildHull(u.margin),Ammo.destroy(f),y=new Ammo.btConvexHullShape(Ammo.getPointer(t.getVertexPointer()),t.numVertices()),Ammo.destroy(t)}return Ammo.destroy(p),s(y,u,o(c,u)),y}}(),e.createHACDShapes=function(){const t=new n.Vector3,i=new n.Vector3,a=new n.Matrix4;return function(n,h,c,u,d={}){if(d.type=e.TYPE.HACD,r(d),d.fit===e.FIT.MANUAL)return console.warn("cannot use fit: manual with type: hacd"),[];if(!Ammo.hasOwnProperty("HACD"))return console.warn("HACD unavailable in included build of Ammo.js. Visit https://github.com/mozillareality/ammo.js for the latest version."),[];const p=l(n,h),f=o(u,d);let m=0,g=0;i.addVectors(p.max,p.min).multiplyScalar(.5);for(let t=0;t<n.length;t++)m+=n[t].length/3,c&&c[t]?g+=c[t].length/3:g+=n[t].length/9;const v=new Ammo.HACD;d.hasOwnProperty("compacityWeight")&&v.SetCompacityWeight(d.compacityWeight),d.hasOwnProperty("volumeWeight")&&v.SetVolumeWeight(d.volumeWeight),d.hasOwnProperty("nClusters")&&v.SetNClusters(d.nClusters),d.hasOwnProperty("nVerticesPerCH")&&v.SetNVerticesPerCH(d.nVerticesPerCH),d.hasOwnProperty("concavity")&&v.SetConcavity(d.concavity);const y=Ammo._malloc(3*m*8),x=Ammo._malloc(3*g*4);v.SetPoints(y),v.SetTriangles(x),v.SetNPoints(m),v.SetNTriangles(g);let b=y/8,w=x/4;for(let e=0;e<n.length;e++){const r=n[e];a.fromArray(h[e]);for(let e=0;e<r.length;e+=3)t.set(r[e+0],r[e+1],r[e+2]).applyMatrix4(a).sub(i),Ammo.HEAPF64[b+0]=t.x,Ammo.HEAPF64[b+1]=t.y,Ammo.HEAPF64[b+2]=t.z,b+=3;if(c[e]){const t=c[e];for(let e=0;e<t.length;e++)Ammo.HEAP32[w]=t[e],w++}else for(let t=0;t<r.length/3;t++)Ammo.HEAP32[w]=t,w++}v.Compute(),Ammo._free(y),Ammo._free(x);const T=v.GetNClusters(),_=[];for(let t=0;t<T;t++){const e=new Ammo.btConvexHullShape;e.setMargin(d.margin);const i=v.GetNPointsCH(t),n=v.GetNTrianglesCH(t),r=Ammo._malloc(3*i*8),o=Ammo._malloc(3*n*4);v.GetCH(t,r,o);const a=r/8;for(let t=0;t<i;t++){const n=new Ammo.btVector3,r=Ammo.HEAPF64[a+3*t+0],s=Ammo.HEAPF64[a+3*t+1],o=Ammo.HEAPF64[a+3*t+2];n.setValue(r,s,o),e.addPoint(n,t===i-1),Ammo.destroy(n)}s(e,d,f),_.push(e)}return _}}(),e.createVHACDShapes=function(){const t=new n.Vector3,i=new n.Vector3,a=new n.Matrix4;return function(n,h,c,u,d={}){if(d.type=e.TYPE.VHACD,r(d),d.fit===e.FIT.MANUAL)return console.warn("cannot use fit: manual with type: vhacd"),[];if(!Ammo.hasOwnProperty("VHACD"))return console.warn("VHACD unavailable in included build of Ammo.js. Visit https://github.com/mozillareality/ammo.js for the latest version."),[];const p=l(n,h),f=o(u,d);let m=0,g=0;i.addVectors(p.max,p.min).multiplyScalar(.5);for(let t=0;t<n.length;t++)m+=n[t].length/3,c&&c[t]?g+=c[t].length/3:g+=n[t].length/9;const v=new Ammo.VHACD,y=new Ammo.Parameters;d.hasOwnProperty("resolution")&&y.set_m_resolution(d.resolution),d.hasOwnProperty("depth")&&y.set_m_depth(d.depth),d.hasOwnProperty("concavity")&&y.set_m_concavity(d.concavity),d.hasOwnProperty("planeDownsampling")&&y.set_m_planeDownsampling(d.planeDownsampling),d.hasOwnProperty("convexhullDownsampling")&&y.set_m_convexhullDownsampling(d.convexhullDownsampling),d.hasOwnProperty("alpha")&&y.set_m_alpha(d.alpha),d.hasOwnProperty("beta")&&y.set_m_beta(d.beta),d.hasOwnProperty("gamma")&&y.set_m_gamma(d.gamma),d.hasOwnProperty("pca")&&y.set_m_pca(d.pca),d.hasOwnProperty("mode")&&y.set_m_mode(d.mode),d.hasOwnProperty("maxNumVerticesPerCH")&&y.set_m_maxNumVerticesPerCH(d.maxNumVerticesPerCH),d.hasOwnProperty("minVolumePerCH")&&y.set_m_minVolumePerCH(d.minVolumePerCH),d.hasOwnProperty("convexhullApproximation")&&y.set_m_convexhullApproximation(d.convexhullApproximation),d.hasOwnProperty("oclAcceleration")&&y.set_m_oclAcceleration(d.oclAcceleration);const x=Ammo._malloc(3*m*8+3),b=Ammo._malloc(3*g*4);let w=x/8,T=b/4;for(let e=0;e<n.length;e++){const r=n[e];a.fromArray(h[e]);for(let e=0;e<r.length;e+=3)t.set(r[e+0],r[e+1],r[e+2]).applyMatrix4(a).sub(i),Ammo.HEAPF64[w+0]=t.x,Ammo.HEAPF64[w+1]=t.y,Ammo.HEAPF64[w+2]=t.z,w+=3;if(c[e]){const t=c[e];for(let e=0;e<t.length;e++)Ammo.HEAP32[T]=t[e],T++}else for(let t=0;t<r.length/3;t++)Ammo.HEAP32[T]=t,T++}v.Compute(x,3,m,b,3,g,y),Ammo._free(x),Ammo._free(b);const _=v.GetNConvexHulls(),E=[],S=new Ammo.ConvexHull;for(let t=0;t<_;t++){v.GetConvexHull(t,S);const e=S.get_m_nPoints(),i=(S.get_m_points(),new Ammo.btConvexHullShape);i.setMargin(d.margin);for(let t=0;t<e;t++){const n=new Ammo.btVector3,r=S.get_m_points(3*t+0),s=S.get_m_points(3*t+1),o=S.get_m_points(3*t+2);n.setValue(r,s,o),i.addPoint(n,t===e-1),Ammo.destroy(n)}s(i,d,f),E.push(i)}return Ammo.destroy(S),Ammo.destroy(v),E}}(),e.createTriMeshShape=function(){const t=new n.Vector3,i=new n.Vector3,a=new n.Vector3,h=new n.Matrix4;return function(n,l,c,u,d={}){if(d.type=e.TYPE.MESH,r(d),d.fit===e.FIT.MANUAL)return console.warn("cannot use fit: manual with type: mesh"),null;const p=o(u,d),f=new Ammo.btVector3,m=new Ammo.btVector3,g=new Ammo.btVector3,v=new Ammo.btTriangleMesh(!0,!1);for(let e=0;e<n.length;e++){const r=n[e],s=c[e]?c[e]:null;if(h.fromArray(l[e]),s)for(let e=0;e<s.length;e+=3){const n=3*s[e],o=3*s[e+1],l=3*s[e+2];t.set(r[n],r[n+1],r[n+2]).applyMatrix4(h),i.set(r[o],r[o+1],r[o+2]).applyMatrix4(h),a.set(r[l],r[l+1],r[l+2]).applyMatrix4(h),f.setValue(t.x,t.y,t.z),m.setValue(i.x,i.y,i.z),g.setValue(a.x,a.y,a.z),v.addTriangle(f,m,g,!1)}else for(let e=0;e<r.length;e+=9)t.set(r[e+0],r[e+1],r[e+2]).applyMatrix4(h),i.set(r[e+3],r[e+4],r[e+5]).applyMatrix4(h),a.set(r[e+6],r[e+7],r[e+8]).applyMatrix4(h),f.setValue(t.x,t.y,t.z),m.setValue(i.x,i.y,i.z),g.setValue(a.x,a.y,a.z),v.addTriangle(f,m,g,!1)}const y=new Ammo.btVector3(p.x,p.y,p.z);let x;return v.setScaling(y),Ammo.destroy(y),x=d.concave?new Ammo.btBvhTriangleMeshShape(v,!0,!0):new Ammo.btConvexTriangleMeshShape(v,!0),x.resources=[v],Ammo.destroy(f),Ammo.destroy(m),Ammo.destroy(g),s(x,d),x}}();function r(t){t.type=t.type||e.TYPE.HULL,t.margin=t.hasOwnProperty("margin")?t.margin:.01}e.createHeightfieldTerrainShape=function(t={}){if(r(t),t.fit===e.FIT.ALL)return console.warn("cannot use fit: all with type: heightfield"),null;const i=t.heightfieldDistance||1,n=t.heightfieldData||[],o=t.heightScale||0,a=t.hasOwnProperty("upAxis")?t.upAxis:1,h=(()=>{switch(t.heightDataType){case"short":return Ammo.PHY_SHORT;case"float":default:return Ammo.PHY_FLOAT}})(),l=!t.hasOwnProperty("flipQuadEdges")||t.flipQuadEdges,c=n.length,u=c>0?n[0].length:0,d=Ammo._malloc(c*u*4),p=d/4;let f=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=0;for(let t=0;t<c;t++)for(let e=0;e<u;e++){const i=n[t][e];Ammo.HEAPF32[p+g]=i,g++,f=Math.min(f,i),m=Math.max(m,i)}const v=new Ammo.btHeightfieldTerrainShape(u,c,d,o,f,m,a,h,l),y=new Ammo.btVector3(i,1,i);return v.setLocalScaling(y),Ammo.destroy(y),v.heightfieldData=d,s(v,t),v};const s=function(t,e,i){};e.iterateGeometries=function(){const t=new n.Matrix4;return function(e,i,r){parseInt(n.REVISION)>=123?t.copy(e.matrixWorld).invert():t.getInverse(e.matrixWorld);(new n.Vector3).setFromMatrixScale(e.matrixWorld),e.traverse(s=>{const o=new n.Matrix4;s.isMesh&&(i.includeInvisible||s.el&&s.el.object3D.visible||s.visible)&&(s===e?o.identity():(s.updateWorldMatrix(!0),o.multiplyMatrices(t,s.matrixWorld)),r(s.geometry.isBufferGeometry?s.geometry.attributes.position.array:s.geometry.vertices,o.elements,s.geometry.index?s.geometry.index.array:null))})}}();const o=function(){const t=new n.Matrix4;return function(i,r={}){const s=new n.Vector3(1,1,1);return r.fit===e.FIT.ALL&&(t.fromArray(i),s.setFromMatrixScale(t)),s}}(),a=function(){const t=new n.Vector3;return function(e,i,n){let r=0,{x:s,y:o,z:a}=n.getCenter(t);return c(e,i,t=>{const e=s-t.x,i=o-t.y,n=a-t.z;r=Math.max(r,e*e+i*i+n*n)}),Math.sqrt(r)}}(),h=function(t,e,i){return(new n.Vector3).subVectors(t.max,t.min).multiplyScalar(.5).clampScalar(e,i)},l=function(t,e){const i=new n.Box3;let r=1/0,s=1/0,o=1/0,a=-1/0,h=-1/0,l=-1/0;return i.min.set(0,0,0),i.max.set(0,0,0),c(t,e,t=>{t.x<r&&(r=t.x),t.y<s&&(s=t.y),t.z<o&&(o=t.z),t.x>a&&(a=t.x),t.y>h&&(h=t.y),t.z>l&&(l=t.z)}),i.min.set(r,s,o),i.max.set(a,h,l),i},c=function(){const t=new n.Vector3,e=new n.Matrix4;return function(i,n,r){for(let s=0;s<i.length;s++){e.fromArray(n[s]);for(let n=0;n<i[s].length;n+=3)t.set(i[s][n],i[s][n+1],i[s][n+2]).applyMatrix4(e),r(t)}}}()},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.createTorusShape=void 0;e.createTorusShape=(t,e)=>{const{radius:i=1,tube:n=.4,tubularSegments:r=8}=t,s=Math.PI,o=r,a=Math.sqrt(2*n*n-2*n*n*Math.cos(2*s/o)),h=new Ammo.btVector3(n,s/o+.5*a,n),l=new Ammo.btCylinderShape(h);l.setMargin(.05);const c=new Ammo.btCompoundShape,u=new Ammo.btVector3(0,0,1),d=new Ammo.btVector3(0,i,0),p=new Ammo.btQuaternion(e.x,e.y,e.z,e.w);for(let t=0;t<o;t++){const e=2*t*s/o,i=d.rotate(u,e),n=new Ammo.btTransform;p.setRotation(u,e+Math.PI/2),n.setIdentity(),n.setOrigin(i),n.setRotation(p),c.addChildShape(n,l)}return c}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.CollisionEvents=void 0;const n=i(5);class r extends n.EventEmitter{addCollider(t,e,i){t.body&&e.body&&(t.body.checkCollisions=!0,e.body.checkCollisions=!0,this.on("collision",n=>{var r,s;const{bodies:o,event:a}=n;(null===(r=o[0])||void 0===r?void 0:r.name)&&(null===(s=o[1])||void 0===s?void 0:s.name)&&(null==t?void 0:t.name)&&(null==e?void 0:e.name)&&(o[0].name===t.name&&o[1].name===e.name||o[1].name===t.name&&o[0].name===e.name)&&i(a)}))}}e.CollisionEvents=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});
|
|
/**
|
|
* @author Kevin Lee (https://github.com/InfiniteLee)
|
|
* @copyright Copyright (c) 2019 Kevin Lee; Project Url: https://github.com/InfiniteLee/ammo-debug-drawer
|
|
* @license {@link https://github.com/InfiniteLee/ammo-debug-drawer/blob/master/LICENSE|MPL-2.0}
|
|
*/
|
|
const n=i(2),r=1,s=32768;e.default=class{constructor(t,e,i={}){this.scene=t,this.world=e,this.options=i,this.debugDrawMode=i.debugDrawMode||r;const o=this.debugDrawMode&s||!1,a=i.maxBufferSize||1e6;this.geometry=new n.BufferGeometry;const h=new Float32Array(3*a),l=new Float32Array(3*a);this.geometry.setAttribute("position",new n.BufferAttribute(h,3).setUsage(n.StaticDrawUsage)),this.geometry.setAttribute("color",new n.BufferAttribute(l,3).setUsage(n.StaticDrawUsage)),this.index=0;const c=new n.LineBasicMaterial({vertexColors:!0,depthTest:!o});this.mesh=new n.LineSegments(this.geometry,c),o&&(this.mesh.renderOrder=999),this.mesh.frustumCulled=!1,this.enabled=!1,this.debugDrawer=new Ammo.DebugDrawer,this.debugDrawer.drawLine=this.drawLine.bind(this),this.debugDrawer.drawContactPoint=this.drawContactPoint.bind(this),this.debugDrawer.reportErrorWarning=this.reportErrorWarning.bind(this),this.debugDrawer.draw3dText=this.draw3dText.bind(this),this.debugDrawer.setDebugMode=this.setDebugMode.bind(this),this.debugDrawer.getDebugMode=this.getDebugMode.bind(this),this.world.setDebugDrawer(this.debugDrawer)}enable(){this.enabled=!0,this.scene.add(this.mesh)}disable(){this.enabled=!1,this.scene.remove(this.mesh)}update(){this.enabled&&(0!=this.index&&(this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.color.needsUpdate=!0),this.index=0,this.world.debugDrawWorld(),this.geometry.setDrawRange(0,this.index))}drawLine(t,e,i){const n=Ammo.HEAPF32,r=n[(i+0)/4],s=n[(i+4)/4],o=n[(i+8)/4],a=n[(t+0)/4],h=n[(t+4)/4],l=n[(t+8)/4];this.geometry.attributes.position.setXYZ(this.index,a,h,l),this.geometry.attributes.color.setXYZ(this.index++,r,s,o);const c=n[(e+0)/4],u=n[(e+4)/4],d=n[(e+8)/4];this.geometry.attributes.position.setXYZ(this.index,c,u,d),this.geometry.attributes.color.setXYZ(this.index++,r,s,o)}drawContactPoint(t,e,i,n,r){const s=Ammo.HEAPF32,o=s[(r+0)/4],a=s[(r+4)/4],h=s[(r+8)/4],l=s[(t+0)/4],c=s[(t+4)/4],u=s[(t+8)/4];this.geometry.attributes.position.setXYZ(this.index,l,c,u),this.geometry.attributes.color.setXYZ(this.index++,o,a,h);const d=s[(e+0)/4]*i,p=s[(e+4)/4]*i,f=s[(e+8)/4]*i;this.geometry.attributes.position.setXYZ(this.index,l+d,c+p,u+f),this.geometry.attributes.color.setXYZ(this.index++,o,a,h)}reportErrorWarning(t){Ammo.hasOwnProperty("Pointer_stringify")?console.warn(Ammo.Pointer_stringify(t)):this.warnedOnce||(this.warnedOnce=!0,console.warn("Cannot print warningString, please rebuild Ammo.js using 'debug' flag"))}draw3dText(t,e){console.warn("TODO: draw3dText")}setDebugMode(t){this.debugDrawMode=t}getDebugMode(){return this.debugDrawMode}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvexObjectBreaker=void 0;const n=i(2),r=i(2),s=i(9),o=function(t,e){this.minSizeForBreak=t||1.4,this.smallDelta=e||1e-4,this.tempLine1=new n.Line3,this.tempPlane1=new n.Plane,this.tempPlane2=new n.Plane,this.tempPlane_Cut=new n.Plane,this.tempCM1=new n.Vector3,this.tempCM2=new n.Vector3,this.tempVector3=new n.Vector3,this.tempVector3_2=new n.Vector3,this.tempVector3_3=new n.Vector3,this.tempVector3_P0=new n.Vector3,this.tempVector3_P1=new n.Vector3,this.tempVector3_P2=new n.Vector3,this.tempVector3_N0=new n.Vector3,this.tempVector3_N1=new n.Vector3,this.tempVector3_AB=new n.Vector3,this.tempVector3_CB=new n.Vector3,this.tempResultObjects={object1:null,object2:null},this.segments=[];for(var i=0;i<900;i++)this.segments[i]=!1};var a;e.ConvexObjectBreaker=o,o.prototype={constructor:o,prepareBreakableObject:function(t,e,i,n,r){t.geometry.isBufferGeometry||console.error("THREE.ConvexObjectBreaker.prepareBreakableObject(): Parameter object must have a BufferGeometry."),t.userData.ammoPhysicsData={};var s=t.userData.ammoPhysicsData;s.mass=e,s.velocity=i.clone(),s.angularVelocity=n.clone(),s.breakable=r},subdivideByImpact:function(t,e,i,n,r){var s=[],o=this.tempPlane1,a=this.tempPlane2;this.tempVector3.addVectors(e,i),o.setFromCoplanarPoints(e,t.position,this.tempVector3);var h=r+n,l=this;return function r(c,u,d,p){if(Math.random()<.05*p||p>h)s.push(c);else{var f=Math.PI;0===p?(a.normal.copy(o.normal),a.constant=o.constant):p<=n?(f=(d-u)*(.2+.6*Math.random())+u,l.tempVector3_2.copy(t.position).sub(e).applyAxisAngle(i,f).add(e),a.setFromCoplanarPoints(e,l.tempVector3,l.tempVector3_2)):(f=(.5*(1&p)+.2*(2-Math.random()))*Math.PI,l.tempVector3_2.copy(e).sub(c.position).applyAxisAngle(i,f).add(c.position),l.tempVector3_3.copy(i).add(c.position),a.setFromCoplanarPoints(c.position,l.tempVector3_3,l.tempVector3_2)),l.cutByPlane(c,a,l.tempResultObjects);var m=l.tempResultObjects.object1,g=l.tempResultObjects.object2;m&&r(m,u,f,p+1),g&&r(g,f,d,p+1)}}(t,0,2*Math.PI,0),s},cutByPlane:function(t,e,i){var a=t.geometry,h=a.attributes.position.array,l=a.attributes.normal.array,c=h.length/3,u=c/3,d=a.getIndex();function p(t,e){var i=3*t+e;return d?d[i]:i}d&&(u=(d=d.array).length/3);for(var f=[],m=[],g=this.smallDelta,v=c*c,y=0;y<v;y++)this.segments[y]=!1;var x=this.tempVector3_P0,b=this.tempVector3_P1,w=this.tempVector3_N0,T=this.tempVector3_N1;for(y=0;y<u-1;y++){var _=p(y,0),E=p(y,1),S=p(y,2);w.set(l[_],l[_]+1,l[_]+2);for(var M=y+1;M<u;M++){var A=p(M,0),C=p(M,1),P=p(M,2);T.set(l[A],l[A]+1,l[A]+2),1-w.dot(T)<g&&(_===A||_===C||_===P?E===A||E===C||E===P?(this.segments[_*c+E]=!0,this.segments[E*c+_]=!0):(this.segments[S*c+_]=!0,this.segments[_*c+S]=!0):E!==A&&E!==C&&E!==P||(this.segments[S*c+E]=!0,this.segments[E*c+S]=!0))}}var R=this.tempPlane_Cut;t.updateMatrix(),o.transformPlaneToLocalSpace(e,t.matrix,R);for(y=0;y<u;y++)for(var L=p(y,0),O=p(y,1),D=p(y,2),I=0;I<3;I++){var F=0===I?L:1===I?O:D,B=0===I?O:1===I?D:L;if(!this.segments[F*c+B]){this.segments[F*c+B]=!0,this.segments[B*c+F]=!0,x.set(h[3*F],h[3*F+1],h[3*F+2]),b.set(h[3*B],h[3*B+1],h[3*B+2]);var k=0;(N=R.distanceToPoint(x))>g?(k=2,m.push(x.clone())):N<-g?(k=1,f.push(x.clone())):(k=3,f.push(x.clone()),m.push(x.clone()));var N,U=0;if((N=R.distanceToPoint(b))>g?(U=2,m.push(b.clone())):N<-g?(U=1,f.push(b.clone())):(U=3,f.push(b.clone()),m.push(b.clone())),1===k&&2===U||2===k&&1===U){this.tempLine1.start.copy(x),this.tempLine1.end.copy(b);var z=new n.Vector3;if(void 0===(z=R.intersectLine(this.tempLine1,z)))return console.error("Internal error: segment does not intersect plane."),i.segmentedObject1=null,i.segmentedObject2=null,0;f.push(z),m.push(z.clone())}}}var G=.5*t.userData.ammoPhysicsData.mass;this.tempCM1.set(0,0,0);var V=0,H=f.length;if(H>0){for(y=0;y<H;y++)this.tempCM1.add(f[y]);this.tempCM1.divideScalar(H);for(y=0;y<H;y++){(j=f[y]).sub(this.tempCM1),V=Math.max(V,j.x,j.y,j.z)}this.tempCM1.add(t.position)}this.tempCM2.set(0,0,0);var W=0,X=m.length;if(X>0){for(y=0;y<X;y++)this.tempCM2.add(m[y]);this.tempCM2.divideScalar(X);for(y=0;y<X;y++){var j;(j=m[y]).sub(this.tempCM2),W=Math.max(W,j.x,j.y,j.z)}this.tempCM2.add(t.position)}var Y=null,q=null,Z=0;if(H>4)try{(Y=new n.Mesh(new r.ConvexGeometry(f),t.material)).position.copy(this.tempCM1),Y.quaternion.copy(t.quaternion),Y.userData=t.userData,this.prepareBreakableObject(Y,G,t.userData.ammoPhysicsData.velocity,t.userData.ammoPhysicsData.angularVelocity,2*V>this.minSizeForBreak),Z++}catch(t){s.default("Error in ConvexObjectBreaker.ts"),s.default(t)}if(X>4)try{(q=new n.Mesh(new r.ConvexGeometry(m),t.material)).position.copy(this.tempCM2),q.quaternion.copy(t.quaternion),q.userData=t.userData,this.prepareBreakableObject(q,G,t.userData.ammoPhysicsData.velocity,t.userData.ammoPhysicsData.angularVelocity,2*W>this.minSizeForBreak),Z++}catch(t){s.default("Error in ConvexObjectBreaker.ts"),s.default(t)}return i.object1=Y,i.object2=q,Z}},o.transformFreeVector=function(t,e){var i=t.x,n=t.y,r=t.z,s=e.elements;return t.x=s[0]*i+s[4]*n+s[8]*r,t.y=s[1]*i+s[5]*n+s[9]*r,t.z=s[2]*i+s[6]*n+s[10]*r,t},o.transformFreeVectorInverse=function(t,e){var i=t.x,n=t.y,r=t.z,s=e.elements;return t.x=s[0]*i+s[1]*n+s[2]*r,t.y=s[4]*i+s[5]*n+s[6]*r,t.z=s[8]*i+s[9]*n+s[10]*r,t},o.transformTiedVectorInverse=function(t,e){var i=t.x,n=t.y,r=t.z,s=e.elements;return t.x=s[0]*i+s[1]*n+s[2]*r-s[12],t.y=s[4]*i+s[5]*n+s[6]*r-s[13],t.z=s[8]*i+s[9]*n+s[10]*r-s[14],t},o.transformPlaneToLocalSpace=(a=new n.Vector3,function(t,e,i){i.normal.copy(t.normal),i.constant=t.constant;var n=o.transformTiedVectorInverse(t.coplanarPoint(a),e);o.transformFreeVectorInverse(i.normal,e),i.constant=-n.dot(i.normal)})},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.AllHitsRaycaster=e.ClosestRaycaster=void 0;const n=i(49),r=i(50),s=i(51);class o{constructor(t){this.physics=t}setRayFromWorld(t=0,e=0,i=0){this._btRayFrom.setValue(t,e,i)}setRayToWorld(t=0,e=0,i=0){this._btRayTo.setValue(t,e,i)}hasHit(){return this._btRayCallback.hasHit()}rayTest(){void 0!==this._btRayCallback&&Ammo.destroy(this._btRayCallback),this._btRayCallback="closest"===this.type?new Ammo.ClosestRayResultCallback(this._btRayFrom,this._btRayTo):new Ammo.AllHitsRayResultCallback(this._btRayFrom,this._btRayTo),this.physics.physicsWorld.rayTest(this._btRayFrom,this._btRayTo,this._btRayCallback)}destroy(){void 0!==this._btRayFrom&&Ammo.destroy(this._btRayFrom),void 0!==this._btRayTo&&Ammo.destroy(this._btRayTo),void 0!==this._btRayCallback&&Ammo.destroy(this._btRayCallback)}}class a{constructor(t){this.physics=t,this.type="closest",this._btRayFrom=new Ammo.btVector3(0,0,0),this._btRayTo=new Ammo.btVector3(0,0,0)}}e.ClosestRaycaster=a;class h{constructor(t){this.physics=t,this.type="allHits",this._btRayFrom=new Ammo.btVector3(0,0,0),this._btRayTo=new Ammo.btVector3(0,0,0)}}e.AllHitsRaycaster=h,n.default(a,[o,r.default]),n.default(h,[o,s.default])},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=(t,e)=>{e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(i=>{Object.defineProperty(t.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i))})})}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t){this.physics=t}getHitPointWorld(){const t=this._btRayCallback.get_m_hitPointWorld();return{x:t.x(),y:t.y(),z:t.z()}}getHitNormalWorld(){const t=this._btRayCallback.get_m_hitNormalWorld();return{x:t.x(),y:t.y(),z:t.z()}}getCollisionObject(){return Ammo.castObject(this._btRayCallback.get_m_collisionObject(),Ammo.btRigidBody).threeObject}}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t){this.physics=t}getHitPointsWorld(){const t=this._btRayCallback.get_m_hitPointWorld(),e=[];for(let i=t.size()-1;i>=0;i--){const n=t.at(i);e.push({x:n.x(),y:n.y(),z:n.z()})}return e}getHitPointWorld(){return console.warn("[enable3d] Use getHitPointsWorld() instead of getHitPointWorld() for the AllHitsRayCaster!"),this.getHitPointsWorld()}getHitNormalsWorld(){const t=this._btRayCallback.get_m_hitNormalWorld(),e=[];for(let i=t.size()-1;i>=0;i--){const n=t.at(i);e.push({x:n.x(),y:n.y(),z:n.z()})}return e}getCollisionObjects(){const t=[],e=this._btRayCallback.get_m_collisionObjects();for(let i=e.size()-1;i>=0;i--){const n=Ammo.castObject(e.at(i),Ammo.btRigidBody);t.push(n.threeObject)}return t}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Clock=void 0;e.Clock=class{constructor(t=!0){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION="0.22.0-dev.0"},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Cameras=e.HaveSomeFun=e.WebXR=e.Transform=e.TextureCube=e.Misc=e.Mixers=e.WarpSpeed=e.HeightMap=e.CSG=e.Factories=e.Lights=e.Loaders=void 0;const n=i(55);e.Loaders=n.default;const r=i(56);e.Lights=r.default;const s=i(16);e.Factories=s.default;const o=i(57);e.CSG=o.default;const a=i(58);e.HeightMap=a.default;const h=i(60);e.WarpSpeed=h.default;const l=i(61);e.Mixers=l.default;const c=i(62);e.Misc=c.default,Object.defineProperty(e,"TextureCube",{enumerable:!0,get:function(){return c.TextureCube}});const u=i(64);e.Transform=u.default;const d=i(65);e.WebXR=d.default;const p=i(66);e.HaveSomeFun=p.default;const f=i(14);e.Cameras=f.default},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(2);e.default=class{constructor(t,e){this.cache=t,this.textureAnisotropy=e}get fileLoader(){return this._fileLoader||(this._fileLoader=new r.FileLoader),this._fileLoader}get imageLoader(){return this._imgLoader||(this._imgLoader=new r.ImageLoader),this._imgLoader}get svgLoader(){return this._svgLoader||(this._svgLoader=new r.SVGLoader),this._svgLoader}get textureLoader(){return this._textureLoader||(this._textureLoader=new r.TextureLoader),this._textureLoader}get objectLoader(){return this._objectLoader||(this._objectLoader=new r.ObjectLoader),this._objectLoader}get gltfLoader(){return this._gltfLoader||(this._gltfLoader=new r.GLTFLoader),this._gltfLoader}get fbxLoader(){return this._fbxLoader||(this._fbxLoader=new r.FBXLoader),this._fbxLoader}preload(t,e){return n(this,void 0,void 0,(function*(){return this.cache.add(t,e),new Promise(t=>{const i=/\.fbx$|\.glb$|\.gltf$/.test(e);/\.jpe?g$|\.png$/.test(e)?this.textureLoader.load(e,e=>t(e)):(i&&this.fileLoader.setResponseType("arraybuffer"),this.fileLoader.load(e,e=>t(e)))})}))}textureAtlas(t,e,i="JSONHash"){return n(this,void 0,void 0,(function*(){let i=JSON.parse(yield this.file(e));if(i.textures){const t=i.textures[0].frames;let e={frames:{}};t.forEach(t=>{e=Object.assign(Object.assign({},e),{frames:Object.assign(Object.assign({},e.frames),{[t.filename]:{frame:t.frame,rotated:t.rotated,sourceSize:t.sourceSize,spriteSourceSize:t.spriteSourceSize,trimmed:t.trimmed}})})}),i=e}return{texture:yield this.texture(t),json:i}}))}file(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.fileLoader.load(t,t=>e(t))})}svg(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.svgLoader.load(t,t=>e(t))})}texture(t,e){let i=null!=e?e:t,n=e?t:void 0;if(!/^data:image\/[\S]+;base64,/gm.test(i)){const t=this.cache.get(i);i=t||i}return new Promise(t=>{this.textureLoader.load(i,e=>{n&&this.cache.add(n,e),e.anisotropy=this.textureAnisotropy,e.needsUpdate=!0,t(e)})})}object(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.objectLoader.load(t,t=>{e(t)})})}gltf(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.gltfLoader.load(t,t=>{e(t)})})}fbx(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.fbxLoader.load(t,t=>{e(t)})})}}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});const n=i(2),r=i(2),s=i(2);class o extends n.Object3D{constructor(t,e,i,r){super(),this.scene=t,this.light=e,this.size=i,this.color=r,this.geo=new n.SphereBufferGeometry(i||.2,16,8),this.mat=new n.MeshBasicMaterial({color:r||e.color}),this.mesh=new n.Mesh(this.geo,this.mat),this.add(this.mesh),e.add(this)}dispose(){this.mesh.geometry.dispose(),Array.isArray(this.mesh.material)?this.mesh.material.forEach(t=>t.dispose()):this.mesh.material.dispose(),this.remove(this.mesh)}update(){}}e.default=class{constructor(t){this.scene=t}get helper(){return{directionalLightHelper:(t,e,i)=>{const n=new s.DirectionalLightHelper(t,e,i);return this.scene.add(n),n},spotLightHelper:(t,e)=>{const i=new s.SpotLightHelper(t,e);return this.scene.add(i),i},pointLightHelper:(t,e,i)=>new o(this.scene,t,e,i)}}directionalLight(t={}){const{color:e=16777215,intensity:i=1}=t,n=new r.DirectionalLight(e,i);return n.castShadow=!0,this.scene.add(n),n}hemisphereLight(t={}){const{skyColor:e=16777215,groundColor:i=16777215,intensity:n=1}=t,s=new r.HemisphereLight(e,i,n);return this.scene.add(s),s}ambientLight(t={}){const{color:e=16777215,intensity:i=1}=t,n=new r.AmbientLight(e,i);return this.scene.add(n),n}pointLight(t={}){const{color:e=16777215,intensity:i=1,distance:n=0,decay:s=1}=t,o=new r.PointLight(e,i,n,s);return o.castShadow=!0,this.scene.add(o),o}spotLight(t={}){const{color:e=16777215,intensity:i=1,distance:n=0,angle:s=Math.PI/8,penumbra:o=0,decay:a=1}=t,h=new r.SpotLight(e,i,n,s,o,a);return h.castShadow=!0,this.scene.add(h),h}rectAreaLight(t={}){const{color:e=16777215,intensity:i=1,width:n=10,height:s=10}=t,o=new r.RectAreaLight(e,i,n,s);return this.scene.add(o),o}}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});const n=i(2);e.default=class{constructor(t,e){this.scene=t,this.transform=e}toGeometry(t,e){t.geometry=this.transform.bufferGeometryToGeometry(t.geometry),e.geometry=this.transform.bufferGeometryToGeometry(e.geometry)}toBufferGeometry(t){t.geometry=this.transform.geometryToBufferGeometry(t.geometry)}union(t,e){this.toGeometry(t,e);const i=this.doCSG(t,e,"union");return this.toBufferGeometry(i),i}subtract(t,e){this.toGeometry(t,e);const i=this.doCSG(t,e,"subtract");return this.toBufferGeometry(i),i}intersect(t,e){this.toGeometry(t,e);const i=this.doCSG(t,e,"intersect");return this.toBufferGeometry(i),i}doCSG(t,e,i){t.updateMatrix(),e.updateMatrix();const n=r.fromMesh(t),s=r.fromMesh(e),o=n[i](s);return r.toMesh(o,t.matrix)}};class r{constructor(){this.polygons=[]}static fromPolygons(t){const e=new r;return e.polygons=t,e}static fromGeometry(t){t.isBufferGeometry&&(t=(new n.Geometry).fromBufferGeometry(t));const e=t.faces,i=t.vertices,s=[],a=["a","b","c"];for(let n=0;n<e.length;n++){const r=e[n],l=[];for(let e=0;e<3;e++){const s=void 0!==t.faceVertexUvs[0][n]&&void 0!==t.faceVertexUvs[0][n][e]?t.faceVertexUvs[0][n][e]:void 0;l.push(new o(i[r[a[e]]],r.vertexNormals[e],s))}s.push(new h(l))}return r.fromPolygons(s)}static fromMesh(t){const e=r.fromGeometry(t.geometry);r._tmpm3.getNormalMatrix(t.matrix);for(const i of e.polygons)for(const e of i.vertices)e.pos.applyMatrix4(t.matrix),e.normal.applyMatrix3(r._tmpm3);return e}static toMesh(t,e){const i=new n.Geometry,r=t.polygons,s=i.vertices,o=i.faceVertexUvs[0];for(const t of r){const e=t.vertices,r=s.length,a=e.length;for(const t of e)s.push((new n.Vector3).copy(t.pos));for(let s=3;s<=a;s++){const a=new n.Face3(r,r+s-2,r+s-1),h=[];o.push(h);const l=a.vertexNormals;l.push((new n.Vector3).copy(e[0].normal)),l.push((new n.Vector3).copy(e[s-2].normal)),l.push((new n.Vector3).copy(e[s-1].normal)),e[0].uv&&e[s-2].uv&&e[s-1].uv&&(h.push((new n.Vector3).copy(e[0].uv)),h.push((new n.Vector3).copy(e[s-2].uv)),h.push((new n.Vector3).copy(e[s-1].uv))),a.normal=(new n.Vector3).copy(t.plane.normal),i.faces.push(a)}}const a=parseInt(n.REVISION)>=123?(new n.Matrix4).copy(e).invert():(new n.Matrix4).getInverse(e);i.applyMatrix4(a),i.verticesNeedUpdate=i.elementsNeedUpdate=i.normalsNeedUpdate=!0,i.computeBoundingSphere(),i.computeBoundingBox();const h=new n.Mesh(i);return h.matrix.copy(e),h.matrix.decompose(h.position,h.rotation,h.scale),h.updateMatrixWorld(),h}static iEval(t,e=0){var i;if("string"==typeof t)r.currentOp=t;else if(t instanceof Array)for(const e of t)r.iEval(e,0);else if("object"==typeof t){const e=r.currentOp;t.updateMatrix(),t.updateMatrixWorld(),r.sourceMesh?(r.nextPrim=r.fromMesh(t),r.currentPrim=r.currentPrim[e](r.nextPrim)):r.currentPrim=r.fromMesh(r.sourceMesh=t),r.doRemove&&(null===(i=null==t?void 0:t.parent)||void 0===i||i.remove(t))}}static eval(t,e){delete r.currentOp,delete r.sourceMesh,r.doRemove=e,r.iEval(t);const i=r.toMesh(r.currentPrim,r.sourceMesh.matrix);return i.material=r.sourceMesh.material,i.castShadow=i.receiveShadow=!0,i}clone(){const t=new r;return t.polygons=this.polygons.map(t=>t.clone()),t}toPolygons(){return this.polygons}union(t){const e=new l(this.clone().polygons),i=new l(t.clone().polygons);return e.clipTo(i),i.clipTo(e),i.invert(),i.clipTo(e),i.invert(),e.build(i.allPolygons()),r.fromPolygons(e.allPolygons())}subtract(t){const e=new l(this.clone().polygons),i=new l(t.clone().polygons);return e.invert(),e.clipTo(i),i.clipTo(e),i.invert(),i.clipTo(e),i.invert(),e.build(i.allPolygons()),e.invert(),r.fromPolygons(e.allPolygons())}intersect(t){const e=new l(this.clone().polygons),i=new l(t.clone().polygons);return e.invert(),i.clipTo(e),i.invert(),e.clipTo(i),i.clipTo(e),e.build(i.allPolygons()),e.invert(),r.fromPolygons(e.allPolygons())}inverse(){const t=this.clone();return t.polygons.map(t=>{t.flip()}),t}}r._tmpm3=new n.Matrix3;class s extends n.Vector3{constructor(t,e,i){if(3===arguments.length)super(t,e,i);else if(Array.isArray(t))super(t[0],t[1],t[2]);else{if("object"!=typeof t)throw new Error("Invalid constructor to vector");this.copy(t)}}clone(){return new s(this.x,this.y,this.z)}negated(){return this.clone().multiplyScalar(-1)}plus(t){return this.clone().add(t)}minus(t){return this.clone().sub(t)}times(t){return this.clone().multiplyScalar(t)}dividedBy(t){return this.clone().divideScalar(t)}lerp(t,e){return this.plus(t.minus(this).times(e))}unit(){return this.dividedBy(this.length())}cross(t,e){return n.Vector3.prototype.cross.call(this.clone(),t)}}class o{constructor(t,e,i){this.pos=new s(t.x,t.y,t.z),this.normal=new s(e.x,e.y,e.z),i&&(this.uv=new s(i.x,i.y,i.z))}clone(){return new o(this.pos.clone(),this.normal.clone(),this.uv?this.uv.clone():void 0)}flip(){this.normal=this.normal.negated()}interpolate(t,e){return new o(this.pos.lerp(t.pos,e),this.normal.lerp(t.normal,e),this.uv?this.uv.lerp(t.uv,e):void 0)}}class a{constructor(t,e){this.normal=t,this.w=e}static fromPoints(t,e,i){const n=e.minus(t).cross(i.minus(t)).unit();return new a(n,n.dot(t))}clone(){return new a(this.normal.clone(),this.w)}flip(){this.normal=this.normal.negated(),this.w=-this.w}splitPolygon(t,e,i,n,r){let s=0;const o=[];for(const e of t.vertices){const t=this.normal.dot(e.pos)-this.w,i=t<-a.EPSILON?2:t>a.EPSILON?1:0;s|=i,o.push(i)}switch(s){case 0:(this.normal.dot(t.plane.normal)>0?e:i).push(t);break;case 1:n.push(t);break;case 2:r.push(t);break;case 3:const s=[],a=[];for(let e=0;e<t.vertices.length;e++){const i=(e+1)%t.vertices.length,n=o[e],r=o[i],h=t.vertices[e],l=t.vertices[i];if(2!==n&&s.push(h),1!==n&&a.push(2!==n?h.clone():h),3==(n|r)){const t=(this.w-this.normal.dot(h.pos))/this.normal.dot(l.pos.minus(h.pos)),e=h.interpolate(l,t);s.push(e),a.push(e.clone())}}s.length>=3&&n.push(new h(s,t.shared)),a.length>=3&&r.push(new h(a,t.shared))}}}a.EPSILON=1e-5;class h{constructor(t,e=null){this.vertices=t,this.shared=e,this.plane=a.fromPoints(t[0].pos,t[1].pos,t[2].pos)}clone(){const t=this.vertices.map(t=>t.clone());return new h(t,this.shared)}flip(){this.vertices.reverse().map(t=>{t.flip()}),this.plane.flip()}}class l{constructor(t){delete this.plane,delete this.front,delete this.back,this.polygons=[],t&&this.build(t)}clone(){const t=new l;return t.plane=this.plane&&this.plane.clone(),t.front=this.front&&this.front.clone(),t.back=this.back&&this.back.clone(),t.polygons=this.polygons.map(t=>t.clone()),t}invert(){for(const t of this.polygons)t.flip();this.plane.flip(),this.front&&this.front.invert(),this.back&&this.back.invert();const t=this.front;this.front=this.back,this.back=t}clipPolygons(t){if(!this.plane)return t.slice();let e=[],i=[];for(const n of t)this.plane.splitPolygon(n,e,i,e,i);return this.front&&(e=this.front.clipPolygons(e)),i=this.back?this.back.clipPolygons(i):[],e.concat(i)}clipTo(t){this.polygons=t.clipPolygons(this.polygons),this.front&&this.front.clipTo(t),this.back&&this.back.clipTo(t)}allPolygons(){let t=this.polygons.slice();return this.front&&(t=t.concat(this.front.allPolygons())),this.back&&(t=t.concat(this.back.allPolygons())),t}build(t){if(!t.length)return;this.plane||(this.plane=t[0].plane.clone());const e=[],i=[];for(const n of t)this.plane.splitPolygon(n,this.polygons,this.polygons,e,i);e.length&&(this.front||(this.front=new l),this.front.build(e)),i.length&&(this.back||(this.back=new l),this.back.build(i))}}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});const n=i(2),r=i(4),s=i(19);e.default=class{constructor(t){this.scene=t}add(t,e={}){const i=this.make(t,e);return i?this.scene.add(i):console.warn("Could not make heightmap"),i}make(t,e={}){const{image:i}=t,{width:o,height:a}=i,{colorScale:h}=e,l=document.createElement("canvas");l.width=o,l.height=a;const c=l.getContext("2d");if(!c)return;c.drawImage(t.image,0,0);const u=c.getImageData(0,0,o,a),d=(new n.Geometry).fromBufferGeometry(new n.PlaneBufferGeometry(10,10,o-1,a-1));let p={color:13421772,side:n.DoubleSide};h&&(p=Object.assign(Object.assign({},p),{vertexColors:!0}));const f=new n.MeshPhongMaterial(p),m=new r.ExtendedMesh(d,f);m.receiveShadow=m.castShadow=!0,m.shape="concave";const g=m.geometry;for(let t=0;t<g.vertices.length;t++)g.vertices[t].z=u.data[4*t]/120;return h&&g.faces.forEach(t=>t.color=new n.Color(h(((t,e)=>{var i=t.vertices[e.a].z,n=t.vertices[e.b].z,r=t.vertices[e.c].z;return Math.max(i,n,r)})(g,t)).hex())),m.rotateX(-Math.PI/2),m.updateMatrix(),d.computeFaceNormals(),d.computeVertexNormals(),m.name="heightmap",m.geometry=s.fromGeometry(new n.BufferGeometry,m.geometry),m}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirectGeometry=void 0;const n=i(2);e.DirectGeometry=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(t){const e=[];let i,n,r=void 0;const s=t.faces;for(n=0;n<s.length;n++){const t=s[n];t.materialIndex!==r&&(r=t.materialIndex,void 0!==i&&(i.count=3*n-i.start,e.push(i)),i={start:3*n,materialIndex:r})}void 0!==i&&(i.count=3*n-i.start,e.push(i)),this.groups=e}fromGeometry(t){const e=t.faces,i=t.vertices,r=t.faceVertexUvs,s=r[0]&&r[0].length>0,o=r[1]&&r[1].length>0,a=t.morphTargets,h=a.length;let l;if(h>0){l=[];for(let t=0;t<h;t++)l[t]={name:a[t].name,data:[]};this.morphTargets.position=l}const c=t.morphNormals,u=c.length;let d;if(u>0){d=[];for(let t=0;t<u;t++)d[t]={name:c[t].name,data:[]};this.morphTargets.normal=d}const p=t.skinIndices,f=t.skinWeights,m=p.length===i.length,g=f.length===i.length;i.length>0&&0===e.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let t=0;t<e.length;t++){const v=e[t];this.vertices.push(i[v.a],i[v.b],i[v.c]);const y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{const t=v.normal;this.normals.push(t,t,t)}const x=v.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{const t=v.color;this.colors.push(t,t,t)}if(!0===s){const e=r[0][t];void 0!==e?this.uvs.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",t),this.uvs.push(new n.Vector2,new n.Vector2,new n.Vector2))}if(!0===o){const e=r[1][t];void 0!==e?this.uvs2.push(e[0],e[1],e[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",t),this.uvs2.push(new n.Vector2,new n.Vector2,new n.Vector2))}for(let t=0;t<h;t++){const e=a[t].vertices;l[t].data.push(e[v.a],e[v.b],e[v.c])}for(let e=0;e<u;e++){const i=c[e].vertexNormals[t];d[e].data.push(i.a,i.b,i.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}}},function(t,e,i){"use strict";var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(2),s=i(2);e.default=class{constructor(t,e,i,n,r,s,o){this.scene=t,this.renderer=e,this.camera=i,this.lights=n,this.physics=r,this.load=s,this.factories=o}warpSpeed(...t){return n(this,void 0,void 0,(function*(){let e={};const i=t.filter(t=>/^-\w+/.test(t)),n=i.length>0;if((0===t.length||n)&&(t=["light","camera","lookAtCenter","ground","grid","orbitControls","fog","sky"]),n){i.map(t=>t.substr(1)).forEach(e=>{const i=t.indexOf(e);t.splice(i,1)})}if(t.includes("fog"),t.includes("sky")){const t=["varying vec3 vWorldPosition;","","void main() {","","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vWorldPosition = worldPosition.xyz;","","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","","}"].join("\n"),e=["uniform vec3 topColor;","uniform vec3 bottomColor;","uniform float offset;","uniform float exponent;","","varying vec3 vWorldPosition;","","void main() {","","float h = normalize( vWorldPosition + offset ).y;","gl_FragColor = vec4( mix( bottomColor, topColor, max( pow( max( h , 0.0), exponent ), 0.0 ) ), 1.0 );","","}"].join("\n"),i={topColor:{value:new s.Color(0)},bottomColor:{value:new s.Color(0)},offset:{value:33},exponent:{value:.6}};var o=new s.SphereBufferGeometry(5e3,32,15),a=new s.ShaderMaterial({uniforms:i,vertexShader:t,fragmentShader:e,side:s.BackSide}),h=new s.Mesh(o,a);this.scene.add(h)}if(t.includes("camera")&&(this.camera.position.set(0,6,12),e=Object.assign({camera:this.camera},e)),t.includes("light")){const t=.4,i=this.lights.hemisphereLight({skyColor:16777215,groundColor:0,intensity:t}),n=this.lights.ambientLight({color:16777215,intensity:t}),r=this.lights.directionalLight({color:16777215,intensity:t});r.position.set(100,200,50);const s=20;r.shadow.camera.top=s,r.shadow.camera.bottom=-s,r.shadow.camera.left=-s,r.shadow.camera.right=s,r.shadow.mapSize.set(1024,1024);const o={ambientLight:n,directionalLight:r,hemisphereLight:i};e=Object.assign({lights:o},e)}if(t.includes("lookAtCenter")&&this.camera.lookAt(this.scene.position),t.includes("ground")){const i=t.includes("grid"),n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOnAAADusBZ+q87AAAAJtJREFUeJzt0EENwDAAxLDbNP6UOxh+NEYQ5dl2drFv286598GrA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAu37AD8eaBH5JQdVbAAAAAElFTkSuQmCC",r=yield this.load.texture(n);r.wrapS=r.wrapT=s.RepeatWrapping,r.repeat.set(21,21);const o={name:"ground",width:21,height:21,depth:1,y:-.5},a={phong:{map:i?r:null,transparent:!0,opacity:.8,color:16777215}};let h;window.__loadPhysics?(h=this.physics.add.ground(o,a),h.body.setRestitution(1)):h=this.factories.add.ground(o,a),h.receiveShadow=!0,e=Object.assign({ground:h},e)}if(t.includes("orbitControls")){const t=new r.OrbitControls(this.camera,document.getElementById("enable3d-phaser-canvas")||this.renderer.domElement);e=Object.assign({orbitControls:t},e)}return e}))}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4);e.default=class{constructor(){this._mixers=[]}animationMixer(t){const e=new n.AnimationMixer(t);return this.mixers.add(e),e}get mixers(){return{create:t=>this.animationMixer(t),add:t=>this._mixers.push(t),get:()=>this._mixers,update:t=>{var e;return null===(e=this._mixers)||void 0===e?void 0:e.forEach(e=>e.update(t/1e3))}}}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextureCube=void 0;const n=i(63),r=i(2);e.default=class{constructor(t,e,i){this.scene=t,this.renderer=e,this.factories=i}water(t={}){n.addWater(this.scene,this.renderer,t)}textureCube(t){6!==t.length&&console.log("[enable3d] You need to pass 6 urls to textureCube()");const e=new s;return t.forEach((t,i)=>{t.wrapS=t.wrapT=r.RepeatWrapping;const n=this.factories.add.material({phong:{map:t}});e.materials[i]=n}),e}};class s{constructor(){this.materials=new Array(6)}get texture(){return{left:this.getTexture(0),right:this.getTexture(1),up:this.getTexture(2),down:this.getTexture(3),front:this.getTexture(4),back:this.getTexture(5)}}getTexture(t){return this.materials[t].map}}e.TextureCube=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addWater=void 0;const n=i(2);e.addWater=(t,e,i={})=>{const{width:r=20,height:s=20,x:o=0,y:a=0,z:h=0,color:l="#ffffff",scale:c=4,flowX:u=1,flowY:d=1,normalMap0:p,normalMap1:f}=i,m=new n.PlaneBufferGeometry(r,s),g=new n.MeshStandardMaterial({color:30654,transparent:!0,opacity:.8}),v=new n.Mesh(m,g);v.position.set(o,a,h),v.rotation.x=-.5*Math.PI,t.add(v);const y=new n.PlaneBufferGeometry(r,s),x=new n.Water(y,{color:l,scale:c,flowDirection:new n.Vector2(u,d),textureWidth:1024,textureHeight:1024,normalMap0:p,normalMap1:f,encoding:e.outputEncoding});return x.position.set(o,a+.1,h),x.rotation.x=-.5*Math.PI,t.add(x),{ground:v,water:x}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(2),r=i(2),s=i(19);e.default=
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/
|
|
class{constructor(t,e){this.camera=t,this.renderer=e}geometryToBufferGeometry(t){return t.isGeometry?s.fromGeometry(new n.BufferGeometry,t):t}bufferGeometryToGeometry(t){return t.isBufferGeometry?(new n.Geometry).fromBufferGeometry(t):t}fromSVGtoShape(t,e=!1,i){if(t){const n=new r.SVGLoader,s=[];return n.parse(t).paths.forEach(t=>{t.toShapes(e,i).forEach(t=>{s.push(t)})}),s}return[]}from3dto2d(t){const e=new n.Vector3(t.x,t.y,t.z),i=this.renderer.domElement;this.camera.updateMatrixWorld(),e.project(this.camera);const r=Math.round((e.x+1)*(i.width/2)),s=Math.round((1-e.y)*(i.height/2));return new n.Vector2(r,s)}from2dto3d(t,e,i){var r;if(!this.tmpPlane){const t=new n.PlaneBufferGeometry(1e4,1e4),e=new n.MeshBasicMaterial({transparent:!0,opacity:.25});this.tmpPlane=new n.Mesh(t,e),this.tmpPlane.name="_tmp_raycast_plane"}let s;this.tmpRaycaster||(this.tmpRaycaster=new n.Raycaster),this.tmpVector3||(this.tmpVector3=new n.Vector3),this.tmpPlane.setRotationFromEuler(this.camera.rotation);const o=this.camera.position;this.tmpPlane.position.set(o.x,o.y,o.z),this.camera.getWorldDirection(this.tmpVector3),this.tmpPlane.position.add(this.tmpVector3.clone().multiplyScalar(i)),this.tmpPlane.updateMatrix(),this.tmpPlane.updateMatrixWorld(!0),this.tmpRaycaster.setFromCamera({x:t,y:e},this.camera);const a=this.tmpRaycaster.intersectObjects([this.tmpPlane]);return"_tmp_raycast_plane"===(null===(r=a[0])||void 0===r?void 0:r.object.name)&&(s=a[0].point),s}}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});const n=i(2);e.default=class{constructor(t,e,i){this._renderer=t,this._scene=e,this._camera=i,this.controllerModelFactory=new n.XRControllerModelFactory,this.cameraGroup=new n.Group,this.cameraGroup.add(i),e.add(this.cameraGroup),t.xr.enabled=!0;const r=n.VRButton.createButton(t);r.style.cssText+="background: rgba(0, 0, 0, 0.8); ",document.body.appendChild(r)}get isPresenting(){var t,e;return!!(null===(e=null===(t=this._renderer)||void 0===t?void 0:t.xr)||void 0===e?void 0:e.isPresenting)}getController(t){const e=this._renderer.xr.getController(t);return this.cameraGroup.add(e),e}getControllerGrip(t){const e=this._renderer.xr.getControllerGrip(t),i=this.controllerModelFactory.createControllerModel(e);return e.add(i),this.cameraGroup.add(e),e}getControllerRay(t){const{targetRayMode:e}=t;if("tracked-pointer"===e){let t=new n.BufferGeometry;t.setAttribute("position",new n.Float32BufferAttribute([0,0,0,0,0,-1],3)),t.setAttribute("color",new n.Float32BufferAttribute([1,0,0,1,1,1],3));let e=new n.LineBasicMaterial({vertexColors:!0});return new n.Line(t,e)}if("gaze"===e){let t=new n.RingBufferGeometry(.02,.04,32).translate(0,0,-1),e=new n.MeshBasicMaterial({color:"red",opacity:.5,transparent:!0});return new n.Mesh(t,e)}}get camera(){return this.WebXRCamera}get WebXRCamera(){var t;return{group:this.cameraGroup,position:null===(t=this.cameraGroup)||void 0===t?void 0:t.position,rotation:this.isPresenting?this._renderer.xr.getCamera(this._camera).rotation:void 0,getWorldDirection:t=>this.isPresenting?this._renderer.xr.getCamera(this._camera).getWorldDirection(t):void 0}}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=(t=20,e)=>{if(window.__loadPhysics)for(let i=0;i<t;i++){const t=["standard","basic","normal","phong","line","points"],i=(t,e)=>Math.floor(Math.random()*(e-t+1)+t),n=t=>t[Math.floor(Math.random()*t.length)];Math.random()>.5?e.add.box({x:i(-10,10),y:i(10,20),z:i(-10,10),width:i(1,2)/10,height:i(1,2)/10,depth:i(1,2)/10,mass:1},{[n(t)]:{color:Math.floor(16777215*Math.random())}}).body.setRestitution(Math.floor(10*Math.random())/20):e.add.sphere({x:i(-10,10),y:i(10,20),z:i(-10,10),radius:i(1,2)/10,mass:1},{[n(t)]:{color:Math.floor(16777215*Math.random())}}).body.setRestitution(Math.floor(10*Math.random())/20)}else console.log("There is not much fun without physics enabled!")}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.enable3d=void 0;const n=i(18);window.__loadPhysics=!1,window.__ammoPath="";e.enable3d=t=>(window.setTimeout(()=>{window.__loadPhysics?n.default(window.__ammoPath,()=>{Ammo().then(()=>{t()})}):t()},50),{withPhysics(t){window.__loadPhysics=!0,window.__ammoPath=t}}),e.default=e.enable3d},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0});const n=i(2);e.default=(t={})=>{const{antialias:e=!0,parent:i,canvasId:r="enable3d-phaser-canvas"}=t,s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");s.id=r;const o=i?document.getElementById(i):document.body;o?o.appendChild(s):console.error(`[enable3d] parent "${i}" not found!`);const a={antialias:e},h={alpha:void 0===a.alpha||a.alpha,depth:void 0===a.depth||a.depth,stencil:void 0===a.stencil||a.stencil,antialias:void 0!==a.antialias&&a.antialias,premultipliedAlpha:void 0===a.premultipliedAlpha||a.premultipliedAlpha,preserveDrawingBuffer:void 0!==a.preserveDrawingBuffer&&a.preserveDrawingBuffer,powerPreference:void 0!==a.powerPreference?a.powerPreference:"default",failIfMajorPerformanceCaveat:void 0!==a.failIfMajorPerformanceCaveat&&a.failIfMajorPerformanceCaveat,xrCompatible:!0},l=Object.assign({},h),c=n.WEBGL.isWebGL2Available()?"webgl2":"webgl",u=s.getContext(c,l);return{canvas:s,context:u}}},function(t,e,i){"use strict";
|
|
/**
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.JoyStick=void 0;const n=i(5);class r extends n.EventEmitter{constructor(){super(...arguments),this.id=-1}get add(){return{axis:(t={})=>this.addAxis(t),button:(t={})=>this.addButton(t)}}addAxis(t={}){this.id++;const{styles:e={left:35,bottom:35,size:100}}=t,i=this.circle({styles:e}),n=this.thumb({styles:e});i.appendChild(n),document.body.appendChild(i);const{maxRadius:r=40,rotationDamping:s=.06,moveDamping:o=.01}=t,a={id:this.id,domElement:n,maxRadius:r,maxRadiusSquared:r*r,origin:{left:n.offsetLeft,top:n.offsetTop},offset:{x:0,y:0},rotationDamping:s,moveDamping:o};if(null==a?void 0:a.domElement){const{domElement:t}=a;"ontouchstart"in window?t.addEventListener("touchstart",t=>{t.preventDefault(),this.tap(t,a),t.stopPropagation()}):t.addEventListener("mousedown",t=>{t.preventDefault(),this.tap(t,a),t.stopPropagation()})}return{onMove:t=>{this.on("axis_onmove_"+a.id,e=>{t(e)})}}}addButton(t={}){this.id++;const{styles:e={right:35,bottom:35,size:80},letter:i="A"}=t,n=this.circle({styles:e}),r=this.letter({letter:i});n.appendChild(r),document.body.appendChild(n);const s={id:this.id,domElement:n,offset:{x:0,y:0}};return(null==s?void 0:s.domElement)&&this.click(s),{onClick:t=>{this.on("button_onclick_"+s.id,e=>{t(e)})},onRelease:t=>{this.on("button_onrelease_"+s.id,e=>{t(e)})}}}circle(t={}){const{styles:e}=t,{top:i,right:n,bottom:r,left:s,size:o}=e,a=document.createElement("div");let h=`position:absolute; width:${o}px; height:${o}px; background:rgba(126, 126, 126, 0.5); border:#444 solid medium; border-radius:50%; cursor: pointer; `;return i&&(h+=`top:${i}px; `),n&&(h+=`right:${n}px; `),r&&(h+=`bottom:${r}px; `),s&&(h+=`left:${s}px; `),a.style.cssText=h,a}thumb(t={}){const{styles:e}=t,{size:i}=e,n=document.createElement("div");return n.style.cssText=`position: absolute; left: ${i/4}px; top: ${i/4}px; width: ${i/2}px; height: ${i/2}px; border-radius: 50%; background: #fff; `,n}letter(t={}){const{letter:e}=t,i=document.createElement("span");return i.innerText=e,i.style.cssText="position: absolute; text-align: center; top: 4px; width: 80px; height: 80px; font-size: 64px; color: #fff; ",i}click(t){const{id:e,domElement:i}=t;"ontouchstart"in window?(i.addEventListener("touchstart",t=>{t.preventDefault(),this.emit("button_onclick_"+e)}),i.addEventListener("touchend",t=>{t.preventDefault(),this.emit("button_onrelease_"+e)})):(i.addEventListener("mousedown",t=>{t.preventDefault(),this.emit("button_onclick_"+e),t.stopPropagation()}),i.addEventListener("mouseup",t=>{t.preventDefault(),this.emit("button_onrelease_"+e),t.stopPropagation()}))}tap(t,e){t=t||window.event,e.offset=this.getMousePosition(t),"ontouchstart"in window?(document.ontouchmove=t=>{t.target===e.domElement&&this.move(t,e)},document.ontouchend=t=>{t.target===e.domElement&&this.up(e)}):(document.onmousemove=t=>{t.target===e.domElement&&this.move(t,e)},document.onmouseup=t=>{this.up(e)})}move(t,e){const{domElement:i,maxRadius:n,maxRadiusSquared:r,origin:s,offset:o,id:a}=e;t=t||window.event;const h=this.getMousePosition(t);let l=h.x-o.x,c=h.y-o.y;const u=l*l+c*c;if(u>r){const t=Math.sqrt(u);l/=t,c/=t,l*=n,c*=n}i.style.top=c+i.clientHeight/2+"px",i.style.left=l+i.clientWidth/2+"px";const d=-(c-s.top+i.clientHeight/2)/n,p=(l-s.left+i.clientWidth/2)/n;this.emit("axis_onmove_"+a,{top:d,right:p})}up(t){const{domElement:e,origin:i,id:n}=t;"ontouchstart"in window?(document.ontouchmove=null,document.touchend=null):(document.onmousemove=null,document.onmouseup=null),e.style.top=i.top+"px",e.style.left=i.left+"px",this.emit("axis_onmove_"+n,{top:0,right:0})}getMousePosition(t){return{x:t.targetTouches?t.targetTouches[0].pageX:t.clientX,y:t.targetTouches?t.targetTouches[0].pageY:t.clientY}}}e.JoyStick=r},function(t,e,i){"use strict";
|
|
/**
|
|
* @description This code has originally been copied from Sketchbook
|
|
*
|
|
* @author swift502 <blaha.j502@gmail.com> (http://jblaha.art/)
|
|
* @copyright Copyright (c) 2018 swift502; Project Url: https://github.com/swift502/Sketchbook
|
|
* @license {@link https://github.com/swift502/Sketchbook/blob/master/LICENSE|GPL-3.0}
|
|
*
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.ThirdPersonControls=void 0;const n=i(2);e.ThirdPersonControls=class{constructor(t,e,i){this.camera=t,this.target=e,this.config=i;const{offset:r=new n.Vector3(0,0,0),sensitivity:s=new n.Vector2(1,1),radius:o=8,targetRadius:a=10,interpolationFactor:h=.05,pointerLock:l=!0,autoUpdate:c=!0,theta:u=0,phi:d=0,maxPhi:p=85,minPhi:f=-85}=i;this.offset=r,this.sensitivity=s,this.radius=o,this.targetRadius=a,this.interpolationFactor=h,this.theta=u,this.phi=d,this.maxPhi=p,this.minPhi=f}update(t,e){const i=this.target.position.clone().add(this.offset);this.theta-=t*(this.sensitivity.x/2),this.theta%=360,this.phi+=e*(this.sensitivity.y/2),this.phi=Math.min(this.maxPhi,Math.max(this.minPhi,this.phi)),this.radius=n.MathUtils.lerp(this.radius,this.targetRadius,this.interpolationFactor),this.camera.position.x=i.x+this.radius*Math.sin(this.theta*Math.PI/180)*Math.cos(this.phi*Math.PI/180),this.camera.position.y=i.y+this.radius*Math.sin(this.phi*Math.PI/180),this.camera.position.z=i.z+this.radius*Math.cos(this.theta*Math.PI/180)*Math.cos(this.phi*Math.PI/180),this.camera.updateMatrix(),this.camera.lookAt(i)}}},function(t,e,i){"use strict";
|
|
/**
|
|
* @description This code has originally been copied from Sketchbook
|
|
*
|
|
* @author swift502 <blaha.j502@gmail.com> (http://jblaha.art/)
|
|
* @copyright Copyright (c) 2018 swift502; Project Url: https://github.com/swift502/Sketchbook
|
|
* @license {@link https://github.com/swift502/Sketchbook/blob/master/LICENSE|GPL-3.0}
|
|
*
|
|
* @author Yannick Deubel (https://github.com/yandeu)
|
|
* @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d
|
|
* @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3}
|
|
*/Object.defineProperty(e,"__esModule",{value:!0}),e.FirstPersonControls=void 0;const n=i(2);e.FirstPersonControls=class{constructor(t,e,i){this.camera=t,this.target=e,this.config=i;const{offset:r=new n.Vector3(0,0,0),sensitivity:s=new n.Vector2(1,1),radius:o=8,targetRadius:a=10,interpolationFactor:h=.05,pointerLock:l=!0,autoUpdate:c=!0}=i;this.offset=r,this.sensitivity=s,this.radius=o,this.targetRadius=a,this.interpolationFactor=h,this.theta=0,this.phi=0}update(t,e){const i=this.target.position.clone().add(this.offset);this.camera.position.copy(i),this.theta-=t*(this.sensitivity.x/2),this.theta%=360,this.phi+=e*(-this.sensitivity.y/2),this.phi=Math.min(85,Math.max(-85,this.phi));const r=new n.Vector3;r.x=i.x+this.radius*Math.sin(this.theta*Math.PI/180)*Math.cos(this.phi*Math.PI/180),r.y=i.y+this.radius*Math.sin(this.phi*Math.PI/180),r.z=i.z+this.radius*Math.cos(this.theta*Math.PI/180)*Math.cos(this.phi*Math.PI/180),this.camera.updateMatrix(),this.camera.lookAt(r)}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PointerLock=void 0;e.PointerLock=class{constructor(t,e=!0){this._element=t,this._isRunning=!1,e&&this.request()}isLocked(){return!!document.pointerLockElement}exit(){this._isRunning=!1,document.exitPointerLock(),this.removeListeners()}removeListeners(){document.removeEventListener("pointerlockchange",()=>this.pointerLockChangeHandler()),this._element.removeEventListener("pointerdown",()=>this.pointerDownHandlerHandler())}pointerLockChangeHandler(){this._isRunning&&this._request()}pointerDownHandlerHandler(){this._isRunning&&this._element.requestPointerLock()}request(){this._isRunning=!0,this._request()}_request(){document.addEventListener("pointerlockchange",()=>this.pointerLockChangeHandler(),{once:!0}),document.pointerLockElement||this._element.addEventListener("pointerdown",()=>this.pointerDownHandlerHandler(),{once:!0})}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PointerDrag=void 0;e.PointerDrag=class{constructor(t,e=!0){this._element=t,this._isRunning=!1,this._position={x:0,y:0},this._delta={x:0,y:0},this._onMoveCallback=()=>{},this._isPointerDown=!1,e&&this.start()}get isTouchDevice(){return"ontouchstart"in window}get isPointerDown(){return this._isPointerDown}start(){this._isRunning||(this._isRunning=!0,this.isTouchDevice?(this._element.addEventListener("touchstart",t=>this.onTouchStart(t)),this._element.addEventListener("touchend",t=>this.onTouchEnd(t)),this._element.addEventListener("touchmove",t=>this.onTouchMove(t))):(this._element.addEventListener("mousedown",t=>this.onPointerDown(t)),this._element.addEventListener("mouseup",t=>this.onPointerUp(t)),this._element.addEventListener("mouseleave",t=>this.onPointerLeave(t)),this._element.addEventListener("mouseover",t=>this.onPointerOver(t)),this._element.addEventListener("mousemove",t=>this.onPointerMove(t))))}stop(){this.isTouchDevice?(this._element.removeEventListener("touchstart",t=>this.onTouchStart(t)),this._element.removeEventListener("touchend",t=>this.onTouchEnd(t)),this._element.removeEventListener("touchmove",t=>this.onTouchMove(t))):(this._element.removeEventListener("mousedown",t=>this.onPointerDown(t)),this._element.removeEventListener("mouseleave",t=>this.onPointerLeave(t)),this._element.removeEventListener("mouseup",t=>this.onPointerUp(t)),this._element.removeEventListener("mouseover",t=>this.onPointerOver(t)),this._element.removeEventListener("mousemove",t=>this.onPointerMove(t))),this._isRunning=!1}removeListeners(){this.stop()}onMove(t){this._onMoveCallback=t}onPointerDown(t){this._isPointerDown=!0}onPointerUp(t){this._isPointerDown=!1}onPointerLeave(t){this._isPointerDown=!1}onPointerMove(t){const e=t.movementX,i=t.movementY;this._delta={x:e,y:i},this._onMoveCallback(this._delta)}onPointerOver(t){}onTouchStart(t){const e=t.touches[0].clientX,i=t.touches[0].clientY;this._position={x:e,y:i}}onTouchEnd(t){this._position={x:0,y:0},this._delta={x:0,y:0},this._onMoveCallback(this._delta)}onTouchMove(t){const e=t.touches[0].clientX,i=t.touches[0].clientY;this._delta={x:e-this._position.x,y:i-this._position.y},this._onMoveCallback(this._delta),this._position={x:e,y:i}}}},,,,,,,,,,,,,,,,,function(t,e,i){"use strict";i.r(e),i.d(e,"FBXLoader",(function(){return Se}));var n={};i.r(n),i.d(n,"Deflate",(function(){return Tt})),i.d(n,"AsyncDeflate",(function(){return _t})),i.d(n,"deflate",(function(){return Et})),i.d(n,"deflateSync",(function(){return St})),i.d(n,"Inflate",(function(){return Mt})),i.d(n,"AsyncInflate",(function(){return At})),i.d(n,"inflate",(function(){return Ct})),i.d(n,"inflateSync",(function(){return Pt})),i.d(n,"Gzip",(function(){return Rt})),i.d(n,"AsyncGzip",(function(){return Lt})),i.d(n,"gzip",(function(){return Ot})),i.d(n,"gzipSync",(function(){return Dt})),i.d(n,"Gunzip",(function(){return It})),i.d(n,"AsyncGunzip",(function(){return Ft})),i.d(n,"gunzip",(function(){return Bt})),i.d(n,"gunzipSync",(function(){return kt})),i.d(n,"Zlib",(function(){return Nt})),i.d(n,"AsyncZlib",(function(){return Ut})),i.d(n,"zlib",(function(){return zt})),i.d(n,"zlibSync",(function(){return Gt})),i.d(n,"Unzlib",(function(){return Vt})),i.d(n,"AsyncUnzlib",(function(){return Ht})),i.d(n,"unzlib",(function(){return Wt})),i.d(n,"unzlibSync",(function(){return Xt})),i.d(n,"compress",(function(){return Ot})),i.d(n,"AsyncCompress",(function(){return Lt})),i.d(n,"compressSync",(function(){return Dt})),i.d(n,"Compress",(function(){return Rt})),i.d(n,"Decompress",(function(){return jt})),i.d(n,"AsyncDecompress",(function(){return Yt})),i.d(n,"decompress",(function(){return qt})),i.d(n,"decompressSync",(function(){return Zt})),i.d(n,"DecodeUTF8",(function(){return ee})),i.d(n,"EncodeUTF8",(function(){return ie})),i.d(n,"strToU8",(function(){return ne})),i.d(n,"strFromU8",(function(){return re})),i.d(n,"ZipPassThrough",(function(){return ue})),i.d(n,"ZipDeflate",(function(){return de})),i.d(n,"AsyncZipDeflate",(function(){return pe})),i.d(n,"Zip",(function(){return fe})),i.d(n,"zip",(function(){return me})),i.d(n,"zipSync",(function(){return ge})),i.d(n,"UnzipPassThrough",(function(){return ve})),i.d(n,"UnzipInflate",(function(){return ye})),i.d(n,"AsyncUnzipInflate",(function(){return xe})),i.d(n,"Unzip",(function(){return be})),i.d(n,"unzip",(function(){return we})),i.d(n,"unzipSync",(function(){return Te}));var r=i(0),s={},o=Uint8Array,a=Uint16Array,h=Uint32Array,l=new o([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),c=new o([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new o([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(t,e){for(var i=new a(31),n=0;n<31;++n)i[n]=e+=1<<t[n-1];var r=new h(i[30]);for(n=1;n<30;++n)for(var s=i[n];s<i[n+1];++s)r[s]=s-i[n]<<5|n;return[i,r]},p=d(l,2),f=p[0],m=p[1];
|
|
/*!
|
|
fflate - fast JavaScript compression/decompression
|
|
<https://101arrowz.github.io/fflate>
|
|
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
|
|
*/f[28]=258,m[258]=28;for(var g=d(c,0),v=g[0],y=g[1],x=new a(32768),b=0;b<32768;++b){var w=(43690&b)>>>1|(21845&b)<<1;w=(61680&(w=(52428&w)>>>2|(13107&w)<<2))>>>4|(3855&w)<<4,x[b]=((65280&w)>>>8|(255&w)<<8)>>>1}var T=function(t,e,i){for(var n=t.length,r=0,s=new a(e);r<n;++r)++s[t[r]-1];var o,h=new a(e);for(r=0;r<e;++r)h[r]=h[r-1]+s[r-1]<<1;if(i){o=new a(1<<e);var l=15-e;for(r=0;r<n;++r)if(t[r])for(var c=r<<4|t[r],u=e-t[r],d=h[t[r]-1]++<<u,p=d|(1<<u)-1;d<=p;++d)o[x[d]>>>l]=c}else for(o=new a(n),r=0;r<n;++r)o[r]=x[h[t[r]-1]++]>>>15-t[r];return o},_=new o(288);for(b=0;b<144;++b)_[b]=8;for(b=144;b<256;++b)_[b]=9;for(b=256;b<280;++b)_[b]=7;for(b=280;b<288;++b)_[b]=8;var E=new o(32);for(b=0;b<32;++b)E[b]=5;var S=T(_,9,0),M=T(_,9,1),A=T(E,5,0),C=T(E,5,1),P=function(t){for(var e=t[0],i=1;i<t.length;++i)t[i]>e&&(e=t[i]);return e},R=function(t,e,i){var n=e/8>>0;return(t[n]|t[n+1]<<8)>>>(7&e)&i},L=function(t,e){var i=e/8>>0;return(t[i]|t[i+1]<<8|t[i+2]<<16)>>>(7&e)},O=function(t){return(t/8>>0)+(7&t&&1)},D=function(t,e,i){(null==e||e<0)&&(e=0),(null==i||i>t.length)&&(i=t.length);var n=new(t instanceof a?a:t instanceof h?h:o)(i-e);return n.set(t.subarray(e,i)),n},I=function(t,e,i){var n=t.length,r=!e||i,s=!i||i.i;i||(i={}),e||(e=new o(3*n));var a=function(t){var i=e.length;if(t>i){var n=new o(Math.max(2*i,t));n.set(e),e=n}},h=i.f||0,d=i.p||0,p=i.b||0,m=i.l,g=i.d,y=i.m,x=i.n,b=8*n;do{if(!m){i.f=h=R(t,d,1);var w=R(t,d+1,3);if(d+=3,!w){var _=t[(G=O(d)+4)-4]|t[G-3]<<8,E=G+_;if(E>n){if(s)throw"unexpected EOF";break}r&&a(p+_),e.set(t.subarray(G,E),p),i.b=p+=_,i.p=d=8*E;continue}if(1==w)m=M,g=C,y=9,x=5;else{if(2!=w)throw"invalid block type";var S=R(t,d,31)+257,A=R(t,d+10,15)+4,I=S+R(t,d+5,31)+1;d+=14;for(var F=new o(I),B=new o(19),k=0;k<A;++k)B[u[k]]=R(t,d+3*k,7);d+=3*A;var N=P(B),U=(1<<N)-1;if(!s&&d+I*(N+7)>b)break;var z=T(B,N,1);for(k=0;k<I;){var G,V=z[R(t,d,U)];if(d+=15&V,(G=V>>>4)<16)F[k++]=G;else{var H=0,W=0;for(16==G?(W=3+R(t,d,3),d+=2,H=F[k-1]):17==G?(W=3+R(t,d,7),d+=3):18==G&&(W=11+R(t,d,127),d+=7);W--;)F[k++]=H}}var X=F.subarray(0,S),j=F.subarray(S);y=P(X),x=P(j),m=T(X,y,1),g=T(j,x,1)}if(d>b)throw"unexpected EOF"}r&&a(p+131072);for(var Y=(1<<y)-1,q=(1<<x)-1,Z=y+x+18;s||d+Z<b;){var K=(H=m[L(t,d)&Y])>>>4;if((d+=15&H)>b)throw"unexpected EOF";if(!H)throw"invalid length/literal";if(K<256)e[p++]=K;else{if(256==K){m=null;break}var J=K-254;if(K>264){var Q=l[k=K-257];J=R(t,d,(1<<Q)-1)+f[k],d+=Q}var $=g[L(t,d)&q],tt=$>>>4;if(!$)throw"invalid distance";if(d+=15&$,j=v[tt],tt>3&&(Q=c[tt],j+=L(t,d)&(1<<Q)-1,d+=Q),d>b)throw"unexpected EOF";r&&a(p+131072);for(var et=p+J;p<et;p+=4)e[p]=e[p-j],e[p+1]=e[p+1-j],e[p+2]=e[p+2-j],e[p+3]=e[p+3-j];p=et}}i.l=m,i.p=d,i.b=p,m&&(h=1,i.m=y,i.d=g,i.n=x)}while(!h);return p==e.length?e:D(e,0,p)},F=function(t,e,i){i<<=7&e;var n=e/8>>0;t[n]|=i,t[n+1]|=i>>>8},B=function(t,e,i){i<<=7&e;var n=e/8>>0;t[n]|=i,t[n+1]|=i>>>8,t[n+2]|=i>>>16},k=function(t,e){for(var i=[],n=0;n<t.length;++n)t[n]&&i.push({s:n,f:t[n]});var r=i.length,s=i.slice();if(!r)return[new o(0),0];if(1==r){var h=new o(i[0].s+1);return h[i[0].s]=1,[h,1]}i.sort((function(t,e){return t.f-e.f})),i.push({s:-1,f:25001});var l=i[0],c=i[1],u=0,d=1,p=2;for(i[0]={s:-1,f:l.f+c.f,l:l,r:c};d!=r-1;)l=i[i[u].f<i[p].f?u++:p++],c=i[u!=d&&i[u].f<i[p].f?u++:p++],i[d++]={s:-1,f:l.f+c.f,l:l,r:c};var f=s[0].s;for(n=1;n<r;++n)s[n].s>f&&(f=s[n].s);var m=new a(f+1),g=N(i[d-1],m,0);if(g>e){n=0;var v=0,y=g-e,x=1<<y;for(s.sort((function(t,e){return m[e.s]-m[t.s]||t.f-e.f}));n<r;++n){var b=s[n].s;if(!(m[b]>e))break;v+=x-(1<<g-m[b]),m[b]=e}for(v>>>=y;v>0;){var w=s[n].s;m[w]<e?v-=1<<e-m[w]++-1:++n}for(;n>=0&&v;--n){var T=s[n].s;m[T]==e&&(--m[T],++v)}g=e}return[new o(m),g]},N=function(t,e,i){return-1==t.s?Math.max(N(t.l,e,i+1),N(t.r,e,i+1)):e[t.s]=i},U=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new a(++e),n=0,r=t[0],s=1,o=function(t){i[n++]=t},h=1;h<=e;++h)if(t[h]==r&&h!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[h]}return[i.subarray(0,n),e]},z=function(t,e){for(var i=0,n=0;n<e.length;++n)i+=t[n]*e[n];return i},G=function(t,e,i){var n=i.length,r=O(e+2);t[r]=255&n,t[r+1]=n>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s<n;++s)t[r+s+4]=i[s];return 8*(r+4+n)},V=function(t,e,i,n,r,s,o,h,d,p,f){F(e,f++,i),++r[256];for(var m=k(r,15),g=m[0],v=m[1],y=k(s,15),x=y[0],b=y[1],w=U(g),M=w[0],C=w[1],P=U(x),R=P[0],L=P[1],O=new a(19),D=0;D<M.length;++D)O[31&M[D]]++;for(D=0;D<R.length;++D)O[31&R[D]]++;for(var I=k(O,7),N=I[0],V=I[1],H=19;H>4&&!N[u[H-1]];--H);var W,X,j,Y,q=p+5<<3,Z=z(r,_)+z(s,E)+o,K=z(r,g)+z(s,x)+o+14+3*H+z(O,N)+(2*O[16]+3*O[17]+7*O[18]);if(q<=Z&&q<=K)return G(e,f,t.subarray(d,d+p));if(F(e,f,1+(K<Z)),f+=2,K<Z){W=T(g,v,0),X=g,j=T(x,b,0),Y=x;var J=T(N,V,0);for(F(e,f,C-257),F(e,f+5,L-1),F(e,f+10,H-4),f+=14,D=0;D<H;++D)F(e,f+3*D,N[u[D]]);f+=3*H;for(var Q=[M,R],$=0;$<2;++$){var tt=Q[$];for(D=0;D<tt.length;++D){var et=31&tt[D];F(e,f,J[et]),f+=N[et],et>15&&(F(e,f,tt[D]>>>5&127),f+=tt[D]>>>12)}}}else W=S,X=_,j=A,Y=E;for(D=0;D<h;++D)if(n[D]>255){et=n[D]>>>18&31,B(e,f,W[et+257]),f+=X[et+257],et>7&&(F(e,f,n[D]>>>23&31),f+=l[et]);var it=31&n[D];B(e,f,j[it]),f+=Y[it],it>3&&(B(e,f,n[D]>>>5&8191),f+=c[it])}else B(e,f,W[n[D]]),f+=X[n[D]];return B(e,f,W[256]),f+X[256]},H=new h([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),W=new o(0),X=function(t,e,i,n,r,s){var u=t.length,d=new o(n+u+5*(1+Math.ceil(u/7e3))+r),p=d.subarray(n,d.length-r),f=0;if(!e||u<8)for(var g=0;g<=u;g+=65535){var v=g+65535;v<u?f=G(p,f,t.subarray(g,v)):(p[g]=s,f=G(p,f,t.subarray(g,u)))}else{for(var x=H[e-1],b=x>>>13,w=8191&x,T=(1<<i)-1,_=new a(32768),E=new a(T+1),S=Math.ceil(i/3),M=2*S,A=function(e){return(t[e]^t[e+1]<<S^t[e+2]<<M)&T},C=new h(25e3),P=new a(288),R=new a(32),L=0,I=0,F=(g=0,0),B=0,k=0;g<u;++g){var N=A(g),U=32767&g,z=E[N];if(_[U]=z,E[N]=U,B<=g){var X=u-g;if((L>7e3||F>24576)&&X>423){f=V(t,p,0,C,P,R,I,F,k,g-k,f),F=L=I=0,k=g;for(var j=0;j<286;++j)P[j]=0;for(j=0;j<30;++j)R[j]=0}var Y=2,q=0,Z=w,K=U-z&32767;if(X>2&&N==A(g-K))for(var J=Math.min(b,X)-1,Q=Math.min(32767,g),$=Math.min(258,X);K<=Q&&--Z&&U!=z;){if(t[g+Y]==t[g+Y-K]){for(var tt=0;tt<$&&t[g+tt]==t[g+tt-K];++tt);if(tt>Y){if(Y=tt,q=K,tt>J)break;var et=Math.min(K,tt-2),it=0;for(j=0;j<et;++j){var nt=g-K+j+32768&32767,rt=nt-_[nt]+32768&32767;rt>it&&(it=rt,z=nt)}}}K+=(U=z)-(z=_[U])+32768&32767}if(q){C[F++]=268435456|m[Y]<<18|y[q];var st=31&m[Y],ot=31&y[q];I+=l[st]+c[ot],++P[257+st],++R[ot],B=g+Y,++L}else C[F++]=t[g],++P[t[g]]}}f=V(t,p,s,C,P,R,I,F,k,g-k,f),!s&&7&f&&(f=G(p,f+1,W))}return D(d,0,n+O(f)+r)},j=function(){for(var t=new h(256),e=0;e<256;++e){for(var i=e,n=9;--n;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Y=function(){var t=4294967295;return{p:function(e){for(var i=t,n=0;n<e.length;++n)i=j[255&i^e[n]]^i>>>8;t=i},d:function(){return 4294967295^t}}},q=function(){var t=1,e=0;return{p:function(i){for(var n=t,r=e,s=i.length,o=0;o!=s;){for(var a=Math.min(o+5552,s);o<a;++o)r+=n+=i[o];n%=65521,r%=65521}t=n,e=r},d:function(){return(t>>>8<<16|(255&e)<<8|e>>>8)+2*((255&t)<<23)}}},Z=function(t,e,i,n,r){return X(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,n,!r)},K=function(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i},J=function(t,e,i){for(var n=t(),r=t.toString(),s=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/ /g,"").split(","),o=0;o<n.length;++o){var a=n[o],h=s[o];if("function"==typeof a){e+=";"+h+"=";var l=a.toString();if(a.prototype)if(-1!=l.indexOf("[native code]")){var c=l.indexOf(" ",8)+1;e+=l.slice(c,l.indexOf("(",c))}else for(var u in e+=l,a.prototype)e+=";"+h+".prototype."+u+"="+a.prototype[u].toString();else e+=l}else i[h]=a}return[e,i]},Q=[],$=function(t,e,i,n){var r;if(!Q[i]){for(var l="",c={},u=t.length-1,d=0;d<u;++d)l=(r=J(t[d],l,c))[0],c=r[1];Q[i]=J(t[u],l,c)}var p=K({},Q[i][1]);return function(t,e,i,n,r){var o=s[e]||(s[e]=URL.createObjectURL(new Blob([t],{type:"text/javascript"}))),a=new Worker(o);return a.onerror=function(t){r(t.error,null)},a.onmessage=function(t){r(null,t.data)},a.postMessage(i,n),a}(Q[i][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",i,p,function(t){var e=[];for(var i in t)(t[i]instanceof o||t[i]instanceof a||t[i]instanceof h)&&e.push((t[i]=new t[i].constructor(t[i])).buffer);return e}(p),n)},tt=function(){return[o,a,h,l,c,u,f,v,M,C,x,T,P,R,L,O,D,I,Pt,ot,at]},et=function(){return[o,a,h,l,c,u,m,y,S,_,A,E,x,H,W,T,F,B,k,N,U,z,G,V,O,D,X,Z,St,ot]},it=function(){return[mt,yt,ft,Y,j]},nt=function(){return[gt,vt]},rt=function(){return[xt,ft,q]},st=function(){return[bt]},ot=function(t){return postMessage(t,[t.buffer])},at=function(t){return t&&t.size&&new o(t.size)},ht=function(t,e,i,n,r,s){var a=$(i,n,r,(function(t,e){a.terminate(),s(t,e)}));return e.consume||(t=new o(t)),a.postMessage([t,e],[t.buffer]),function(){a.terminate()}},lt=function(t){return t.ondata=function(t,e){return postMessage([t,e],[t.buffer])},function(e){return t.push(e.data[0],e.data[1])}},ct=function(t,e,i,n,r){var s,o=$(t,n,r,(function(t,i){t?(o.terminate(),e.ondata.call(e,t)):(i[1]&&o.terminate(),e.ondata.call(e,t,i[0],i[1]))}));o.postMessage(i),e.push=function(t,i){if(s)throw"stream finished";if(!e.ondata)throw"no stream handler";o.postMessage([t,s=i],[t.buffer])},e.terminate=function(){o.terminate()}},ut=function(t,e){return t[e]|t[e+1]<<8},dt=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+2*(t[e+3]<<23)},pt=function(t,e){return dt(t,e)|4294967296*dt(t,e)},ft=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8},mt=function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&ft(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var n=0;n<=i.length;++n)t[n+10]=i.charCodeAt(n)}},gt=function(t){if(31!=t[0]||139!=t[1]||8!=t[2])throw"invalid gzip data";var e=t[3],i=10;4&e&&(i+=t[10]|2+(t[11]<<8));for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!t[i++]);return i+(2&e)},vt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16)+2*(t[e-1]<<23)},yt=function(t){return 10+(t.filename&&t.filename.length+1||0)},xt=function(t,e){var i=e.level,n=0==i?0:i<6?1:9==i?3:2;t[0]=120,t[1]=n<<6|(n?32-2*n:1)},bt=function(t){if(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(32&t[1])throw"invalid zlib data: preset dictionaries not supported"};function wt(t,e){return e||"function"!=typeof t||(e=t,t={}),this.ondata=e,t}var Tt=function(){function t(t,e){e||"function"!=typeof t||(e=t,t={}),this.ondata=e,this.o=t||{}}return t.prototype.p=function(t,e){this.ondata(Z(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=e,this.p(t,e||!1)},t}(),_t=function(t,e){ct([et,function(){return[lt,Tt]}],this,wt.call(this,t,e),(function(t){var e=new Tt(t.data);onmessage=lt(e)}),6)};function Et(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[et],(function(t){return ot(St(t.data[0],t.data[1]))}),0,i)}function St(t,e){return void 0===e&&(e={}),Z(t,e,0,0)}var Mt=function(){function t(t){this.s={},this.p=new o(0),this.ondata=t}return t.prototype.e=function(t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var e=this.p.length,i=new o(e+t.length);i.set(this.p),i.set(t,e),this.p=i},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,i=I(this.p,this.o,this.s);this.ondata(D(i,e,this.s.b),this.d),this.o=D(i,this.s.b-32768),this.s.b=this.o.length,this.p=D(this.p,this.s.p/8>>0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),At=function(t){this.ondata=t,ct([tt,function(){return[lt,Mt]}],this,0,(function(){var t=new Mt;onmessage=lt(t)}),7)};function Ct(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[tt],(function(t){return ot(Pt(t.data[0],at(t.data[1])))}),1,i)}function Pt(t,e){return I(t,e)}var Rt=function(){function t(t,e){this.c=Y(),this.l=0,this.v=1,Tt.call(this,t,e)}return t.prototype.push=function(t,e){Tt.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var i=Z(t,this.o,this.v&&yt(this.o),e&&8,!e);this.v&&(mt(i,this.o),this.v=0),e&&(ft(i,i.length-8,this.c.d()),ft(i,i.length-4,this.l)),this.ondata(i,e)},t}(),Lt=function(t,e){ct([et,it,function(){return[lt,Tt,Rt]}],this,wt.call(this,t,e),(function(t){var e=new Rt(t.data);onmessage=lt(e)}),8)};function Ot(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[et,it,function(){return[Dt]}],(function(t){return ot(Dt(t.data[0],t.data[1]))}),2,i)}function Dt(t,e){void 0===e&&(e={});var i=Y(),n=t.length;i.p(t);var r=Z(t,e,yt(e),8),s=r.length;return mt(r,e),ft(r,s-8,i.d()),ft(r,s-4,n),r}var It=function(){function t(t){this.v=1,Mt.call(this,t)}return t.prototype.push=function(t,e){if(Mt.prototype.e.call(this,t),this.v){var i=gt(this.p);if(i>=this.p.length&&!e)return;this.p=this.p.subarray(i),this.v=0}if(e){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Mt.prototype.c.call(this,e)},t}(),Ft=function(t){this.ondata=t,ct([tt,nt,function(){return[lt,Mt,It]}],this,0,(function(){var t=new It;onmessage=lt(t)}),9)};function Bt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[tt,nt,function(){return[kt]}],(function(t){return ot(kt(t.data[0]))}),3,i)}function kt(t,e){return I(t.subarray(gt(t),-8),e||new o(vt(t)))}var Nt=function(){function t(t,e){this.c=q(),this.v=1,Tt.call(this,t,e)}return t.prototype.push=function(t,e){Tt.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var i=Z(t,this.o,this.v&&2,e&&4,!e);this.v&&(xt(i,this.o),this.v=0),e&&ft(i,i.length-4,this.c.d()),this.ondata(i,e)},t}(),Ut=function(t,e){ct([et,rt,function(){return[lt,Tt,Nt]}],this,wt.call(this,t,e),(function(t){var e=new Nt(t.data);onmessage=lt(e)}),10)};function zt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[et,rt,function(){return[Gt]}],(function(t){return ot(Gt(t.data[0],t.data[1]))}),4,i)}function Gt(t,e){void 0===e&&(e={});var i=q();i.p(t);var n=Z(t,e,2,4);return xt(n,e),ft(n,n.length-4,i.d()),n}var Vt=function(){function t(t){this.v=1,Mt.call(this,t)}return t.prototype.push=function(t,e){if(Mt.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}if(e){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Mt.prototype.c.call(this,e)},t}(),Ht=function(t){this.ondata=t,ct([tt,st,function(){return[lt,Mt,Vt]}],this,0,(function(){var t=new Vt;onmessage=lt(t)}),11)};function Wt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[tt,st,function(){return[Xt]}],(function(t){return ot(Xt(t.data[0],at(t.data[1])))}),5,i)}function Xt(t,e){return I((bt(t),t.subarray(2,-4)),e)}var jt=function(){function t(t){this.G=It,this.I=Mt,this.Z=Vt,this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var i=new o(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var n=this,r=function(){n.ondata.apply(n,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(r):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(r):new this.Z(r),this.s.push(this.p,e),this.p=null}}},t}(),Yt=function(){function t(t){this.G=Ft,this.I=At,this.Z=Ht,this.ondata=t}return t.prototype.push=function(t,e){jt.prototype.push.call(this,t,e)},t}();function qt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return 31==t[0]&&139==t[1]&&8==t[2]?Bt(t,e,i):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Ct(t,e,i):Wt(t,e,i)}function Zt(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?kt(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Pt(t,e):Xt(t,e)}var Kt=function(t,e,i,n){for(var r in t){var s=t[r],a=e+r;s instanceof o?i[a]=[s,n]:Array.isArray(s)?i[a]=[s[0],K(n,s[1])]:Kt(s,a+"/",i,n)}},Jt="undefined"!=typeof TextEncoder&&new TextEncoder,Qt="undefined"!=typeof TextDecoder&&new TextDecoder,$t=0;try{Qt.decode(W,{stream:!0}),$t=1}catch(t){}var te=function(t){for(var e="",i=0;;){var n=t[i++],r=(n>127)+(n>223)+(n>239);if(i+r>t.length)return[e,t.slice(i-1)];r?3==r?(n=((15&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,e+=String.fromCharCode(55296|n>>10,56320|1023&n)):e+=1&r?String.fromCharCode((31&n)<<6|63&t[i++]):String.fromCharCode((15&n)<<12|(63&t[i++])<<6|63&t[i++]):e+=String.fromCharCode(n)}},ee=function(){function t(t){this.ondata=t,$t?this.t=new TextDecoder:this.p=W}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";if(e||(e=!1),this.t)return this.ondata(this.t.decode(t,{stream:!e}),e);var i=new o(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length);var n=te(i),r=n[0],s=n[1];if(e&&s.length)throw"invalid utf-8 data";this.p=s,this.ondata(r,e)},t}(),ie=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";this.ondata(ne(t),e||!1)},t}();function ne(t,e){if(e){for(var i=new o(t.length),n=0;n<t.length;++n)i[n]=t.charCodeAt(n);return i}if(Jt)return Jt.encode(t);var r=t.length,s=new o(t.length+(t.length>>1)),a=0,h=function(t){s[a++]=t};for(n=0;n<r;++n){if(a+5>s.length){var l=new o(a+8+(r-n<<1));l.set(s),s=l}var c=t.charCodeAt(n);c<128||e?h(c):c<2048?(h(192|c>>>6),h(128|63&c)):c>55295&&c<57344?(h(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++n))>>>18),h(128|c>>>12&63),h(128|c>>>6&63),h(128|63&c)):(h(224|c>>>12),h(128|c>>>6&63),h(128|63&c))}return D(s,0,a)}function re(t,e){if(e){for(var i="",n=0;n<t.length;n+=16384)i+=String.fromCharCode.apply(null,t.subarray(n,n+16384));return i}if(Qt)return Qt.decode(t);var r=te(t),s=r[0];if(r[1].length)throw"invalid utf-8 data";return s}var se=function(t){return 1==t?3:t<6?2:9==t?1:0},oe=function(t,e){return e+30+ut(t,e+26)+ut(t,e+28)},ae=function(t,e,i){var n=ut(t,e+28),r=re(t.subarray(e+46,e+46+n),!(2048&ut(t,e+8))),s=e+46+n,o=dt(t,e+20),a=i&&4294967295==o?he(t,s):[o,dt(t,e+24),dt(t,e+42)],h=a[0],l=a[1],c=a[2];return[ut(t,e+10),h,l,r,s+ut(t,e+30)+ut(t,e+32),c]},he=function(t,e){for(;1!=ut(t,e);e+=4+ut(t,e+2));return[pt(t,e+12),pt(t,e+4),pt(t,e+20)]},le=function(t,e,i,n,r,s,o){var a=n.length;ft(t,e,null!=o?33639248:67324752),e+=4,null!=o&&(t[e++]=20,t[e++]=i.os),t[e]=20,e+=2,t[e++]=i.flag<<1|(null==s&&8),t[e++]=r&&8,t[e++]=255&i.compression,t[e++]=i.compression>>8;var h=new Date(null==i.mtime?Date.now():i.mtime),l=h.getFullYear()-1980;if(l<0||l>119)throw"date not in range 1980-2099";return ft(t,e,2*(l<<24)|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>>1),e+=4,null!=s&&(ft(t,e,i.crc),ft(t,e+4,s),ft(t,e+8,i.size)),ft(t,e+12,a),e+=16,null!=o&&(ft(t,e+6,i.attrs),ft(t,e+10,o),e+=14),t.set(n,e),e+a},ce=function(t,e,i,n,r){ft(t,e,101010256),ft(t,e+8,i),ft(t,e+10,i),ft(t,e+12,n),ft(t,e+16,r)},ue=function(){function t(t){this.filename=t,this.c=Y(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),de=function(){function t(t,e){var i=this;void 0===e&&(e={}),ue.call(this,t),this.d=new Tt(e,(function(t,e){i.ondata(null,t,e)})),this.compression=8,this.flag=se(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}(),pe=function(){function t(t,e){var i=this;void 0===e&&(e={}),ue.call(this,t),this.d=new _t(e,(function(t,e,n){i.ondata(t,e,n)})),this.compression=8,this.flag=se(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}(),fe=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(2&this.d)throw"stream finished";var i=ne(t.filename),n=i.length,r=n!=t.filename.length,s=n+30;if(n>65535)throw"filename too long";var a=new o(s);le(a,0,t,i,r);var h=[a],l=function(){for(var t=0,i=h;t<i.length;t++){var n=i[t];e.ondata(null,n,!1)}h=[]},c=this.d;this.d=0;var u=this.u.length,d=K(t,{f:i,u:r,t:function(){t.terminate&&t.terminate()},r:function(){if(l(),c){var t=e.u[u+1];t?t.r():e.d=1}c=1}}),p=0;t.ondata=function(i,n,r){i?(e.ondata(i,n,r),e.terminate()):(p+=n.length,h.push(n),r?(h.push(function(t,e){var i=new o(16);return ft(i,0,134695760),ft(i,4,t.crc),ft(i,8,e),ft(i,12,t.size),i}(t,p)),d.c=p,d.b=s+p+16,d.crc=t.crc,d.size=t.size,c&&d.r(),c=1):c&&l())},this.u.push(d)},t.prototype.end=function(){var t=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){1&t.d&&(t.u.splice(-1,1),t.e())},t:function(){}}),this.d=3},t.prototype.e=function(){for(var t=0,e=0,i=0,n=0,r=this.u;n<r.length;n++)i+=46+(l=r[n]).f.length;for(var s=new o(i+22),a=0,h=this.u;a<h.length;a++){var l=h[a];le(s,t,l,l.f,l.u,l.c,e),t+=46+l.f.length,e+=l.b}ce(s,t,this.u.length,i,e),this.ondata(null,s,!0),this.d=2},t.prototype.terminate=function(){for(var t=0,e=this.u;t<e.length;t++)e[t].t();this.d=2},t}();function me(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";var n={};Kt(t,"",n,e);var r=Object.keys(n),s=r.length,a=0,h=0,l=s,c=new Array(s),u=[],d=function(){for(var t=0;t<u.length;++t)u[t]()},p=function(){var t=new o(h+22),e=a,n=h-a;h=0;for(var r=0;r<l;++r){var s=c[r];try{var u=s.c.length;le(t,h,s,s.f,s.u,u);var d=h+30+s.f.length;t.set(s.c,d),le(t,a,s,s.f,s.u,u,h),a+=46+s.f.length,h=d+u}catch(t){return i(t,null)}}ce(t,a,c.length,n,e),i(null,t)};s||p();for(var f=function(t){var e=r[t],o=n[e],l=o[0],f=o[1],m=Y(),g=l.length;m.p(l);var v=ne(e),y=v.length,x=0==f.level?0:8,b=function(n,r){if(n)d(),i(n,null);else{var o=r.length;c[t]=K(f,{size:g,crc:m.d(),c:r,f:v,u:y!=e.length,compression:x}),a+=30+y+o,h+=76+2*y+o,--s||p()}};if(y>65535&&b("filename too long",null),x)if(g<16e4)try{b(null,St(l,f))}catch(t){b(t,null)}else u.push(Et(l,f,b));else b(null,l)},m=0;m<l;++m)f(m);return d}function ge(t,e){void 0===e&&(e={});var i={},n=[];Kt(t,"",i,e);var r=0,s=0;for(var a in i){var h=i[a],l=h[0],c=h[1],u=0==c.level?0:8,d=(b=ne(a)).length;if(d>65535)throw"filename too long";var p=u?St(l,c):l,f=p.length,m=Y();m.p(l),n.push(K(c,{size:l.length,crc:m.d(),c:p,f:b,u:d!=a.length,o:r,compression:u})),r+=30+d+f,s+=76+2*d+f}for(var g=new o(s+22),v=r,y=s-r,x=0;x<n.length;++x){var b=n[x];le(g,b.o,b,b.f,b.u,b.c.length),g.set(b.c,b.o+30+b.f.length),le(g,r,b,b.f,b.u,b.c.length,b.o),r+=46+b.f.length}return ce(g,r,n.length,y,v),g}var ve=function(){function t(){}return t.prototype.push=function(t,e){this.ondata(null,t,e)},t.compression=0,t}(),ye=function(){function t(){var t=this;this.i=new Mt((function(e,i){t.ondata(null,e,i)}))}return t.prototype.push=function(t,e){try{this.i.push(t,e)}catch(i){this.ondata(i,t,e)}},t.compression=8,t}(),xe=function(){function t(){var t=this;this.i=new At((function(e,i,n){t.ondata(e,i,n)})),this.terminate=this.i.terminate}return t.prototype.push=function(t,e){this.i.push(D(t,0),e)},t.compression=8,t}(),be=function(){function t(t){this.onfile=t,this.k=[],this.o={0:ve},this.p=W}return t.prototype.push=function(t,e){var i=this,n=-1==this.c&&this.d;if(this.c&&!n){var r=Math.min(this.c,t.length),s=t.subarray(0,r);this.c-=r,this.d?this.d.push(s,!this.c):this.k[0].push([s,!this.c]),t=t.subarray(r)}if(n||!this.c){var a=0,h=0,l=void 0,c=void 0,u=t.length,d=this.p.length,p=u+d;if(u)d?((c=new Uint8Array(p)).set(this.p),c.set(t,this.p.length)):c=t;else{if(!d)return;c=this.p}this.p=W;for(var f=function(){if(67324752==dt(c,h)){a=1,n&&n.push(W,!0),m.d=null,m.c=0;var t=ut(c,h+6),e=ut(c,h+8),r=2048&t,s=8&t,u=ut(c,h+26),d=ut(c,h+28);if(p>h+30+u+d){var f=[];m.k.unshift(f),a=2,l=h;var g=dt(c,h+18),v=re(c.subarray(h+30,h+=30+u),!r);if(s&&(g=-1),4294967295==g&&(g=he(c,h)[0]),!m.o[e])return m.onfile("unknown compression type "+e,v,null),"break";m.c=g;var y={start:function(){if(!y.ondata)throw"no callback";if(g){var t=new i.o[e];t.ondata=function(t,e,i){y.ondata(t,e,i)};for(var n=0,r=f;n<r.length;n++){var s=r[n],a=s[0],h=s[1];t.push(a,h)}i.k[0]==f&&(i.d=t)}else y.ondata(null,new o(0),!0)},terminate:function(){i.k[0]==f&&i.d.terminate&&i.d.terminate()}};m.onfile(null,v,y),h+=d}return"break"}},m=this;h<p&&"break"!==f();++h);if(n&&n.push(2==a?c.subarray(0,l-12-(134695760==dt(c,l-12)&&4)):c.subarray(0,h),!!a),2&a)return this.push(c.subarray(h),e);if(1&a&&(this.p=c),e&&(a||this.c))throw"invalid zip file"}},t.prototype.register=function(t){this.o[t.compression]=t},t}();function we(t,e){if("function"!=typeof e)throw"no callback";for(var i=[],n=function(){for(var t=0;t<i.length;++t)i[t]()},r={},s=t.length-22;101010256!=dt(t,s);--s)if(!s||t.length-s>65558)return void e("invalid zip file",null);var a=ut(t,s+8);a||e(null,{});var h=a,l=dt(t,s+16),c=4294967295==l;if(c){if(s=dt(t,s-12),101075792!=dt(t,s))return void e("invalid zip file",null);h=a=dt(t,s+32),l=dt(t,s+48)}for(var u=function(s){var h=ae(t,l,c),u=h[0],d=h[1],p=h[2],f=h[3],m=h[4],g=h[5],v=oe(t,g);l=m;var y=function(t,i){t?(n(),e(t,null)):(r[f]=i,--a||e(null,r))};if(u)if(8==u){var x=t.subarray(v,v+d);if(d<32e4)try{y(null,Pt(x,new o(p)))}catch(t){y(t,null)}else i.push(Ct(x,{size:p},y))}else y("unknown compression type "+u,null);else y(null,D(t,v,v+d))},d=0;d<h;++d)u();return n}function Te(t){for(var e={},i=t.length-22;101010256!=dt(t,i);--i)if(!i||t.length-i>65558)throw"invalid zip file";var n=ut(t,i+8);if(!n)return{};var r=dt(t,i+16),s=4294967295==r;if(s){if(i=dt(t,i-12),101075792!=dt(t,i))throw"invalid zip file";n=dt(t,i+32),r=dt(t,i+48)}for(var a=0;a<n;++a){var h=ae(t,r,s),l=h[0],c=h[1],u=h[2],d=h[3],p=h[4],f=h[5],m=oe(t,f);if(r=p,l){if(8!=l)throw"unknown compression type "+l;e[d]=Pt(t.subarray(m,m+c),new o(u))}else e[d]=D(t,m,m+c)}return e}var _e={findSpan:function(t,e,i){var n=i.length-t-1;if(e>=i[n])return n-1;if(e<=i[t])return t;for(var r=t,s=n,o=Math.floor((r+s)/2);e<i[o]||e>=i[o+1];)e<i[o]?s=o:r=o,o=Math.floor((r+s)/2);return o},calcBasisFunctions:function(t,e,i,n){var r=[],s=[],o=[];r[0]=1;for(var a=1;a<=i;++a){s[a]=e-n[t+1-a],o[a]=n[t+a]-e;for(var h=0,l=0;l<a;++l){var c=o[l+1],u=s[a-l],d=r[l]/(c+u);r[l]=h+c*d,h=u*d}r[a]=h}return r},calcBSplinePoint:function(t,e,i,n){for(var s=this.findSpan(t,n,e),o=this.calcBasisFunctions(s,n,t,e),a=new r.Vector4(0,0,0,0),h=0;h<=t;++h){var l=i[s-t+h],c=o[h],u=l.w*c;a.x+=l.x*u,a.y+=l.y*u,a.z+=l.z*u,a.w+=l.w*c}return a},calcBasisFunctionDerivatives:function(t,e,i,n,r){for(var s=[],o=0;o<=i;++o)s[o]=0;var a=[];for(o=0;o<=n;++o)a[o]=s.slice(0);var h=[];for(o=0;o<=i;++o)h[o]=s.slice(0);h[0][0]=1;for(var l=s.slice(0),c=s.slice(0),u=1;u<=i;++u){l[u]=e-r[t+1-u],c[u]=r[t+u]-e;for(var d=0,p=0;p<u;++p){var f=c[p+1],m=l[u-p];h[u][p]=f+m;var g=h[p][u-1]/h[u][p];h[p][u]=d+f*g,d=m*g}h[u][u]=d}for(u=0;u<=i;++u)a[0][u]=h[u][i];for(p=0;p<=i;++p){var v=0,y=1,x=[];for(o=0;o<=i;++o)x[o]=s.slice(0);x[0][0]=1;for(var b=1;b<=n;++b){var w=0,T=p-b,_=i-b;p>=b&&(x[y][0]=x[v][0]/h[_+1][T],w=x[y][0]*h[T][_]);var E=p-1<=_?b-1:i-p;for(u=T>=-1?1:-T;u<=E;++u)x[y][u]=(x[v][u]-x[v][u-1])/h[_+1][T+u],w+=x[y][u]*h[T+u][_];p<=_&&(x[y][b]=-x[v][b-1]/h[_+1][p],w+=x[y][b]*h[p][_]),a[b][p]=w;u=v;v=y,y=u}}for(p=i,b=1;b<=n;++b){for(u=0;u<=i;++u)a[b][u]*=p;p*=i-b}return a},calcBSplineDerivatives:function(t,e,i,n,s){for(var o=s<t?s:t,a=[],h=this.findSpan(t,n,e),l=this.calcBasisFunctionDerivatives(h,n,t,o,e),c=[],u=0;u<i.length;++u){var d=(f=i[u].clone()).w;f.x*=d,f.y*=d,f.z*=d,c[u]=f}for(var p=0;p<=o;++p){for(var f=c[h-t].clone().multiplyScalar(l[p][0]),m=1;m<=t;++m)f.add(c[h-t+m].clone().multiplyScalar(l[p][m]));a[p]=f}for(p=o+1;p<=s+1;++p)a[p]=new r.Vector4(0,0,0);return a},calcKoverI:function(t,e){for(var i=1,n=2;n<=t;++n)i*=n;var r=1;for(n=2;n<=e;++n)r*=n;for(n=2;n<=t-e;++n)r*=n;return i/r},calcRationalCurveDerivatives:function(t){for(var e=t.length,i=[],n=[],s=0;s<e;++s){var o=t[s];i[s]=new r.Vector3(o.x,o.y,o.z),n[s]=o.w}for(var a=[],h=0;h<e;++h){var l=i[h].clone();for(s=1;s<=h;++s)l.sub(a[h-s].clone().multiplyScalar(this.calcKoverI(h,s)*n[s]));a[h]=l.divideScalar(n[0])}return a},calcNURBSDerivatives:function(t,e,i,n,r){var s=this.calcBSplineDerivatives(t,e,i,n,r);return this.calcRationalCurveDerivatives(s)},calcSurfacePoint:function(t,e,i,n,s,o,a,h){for(var l=this.findSpan(t,o,i),c=this.findSpan(e,a,n),u=this.calcBasisFunctions(l,o,t,i),d=this.calcBasisFunctions(c,a,e,n),p=[],f=0;f<=e;++f){p[f]=new r.Vector4(0,0,0,0);for(var m=0;m<=t;++m){var g=s[l-t+m][c-e+f].clone(),v=g.w;g.x*=v,g.y*=v,g.z*=v,p[f].add(g.multiplyScalar(u[m]))}}var y=new r.Vector4(0,0,0,0);for(f=0;f<=e;++f)y.add(p[f].multiplyScalar(d[f]));y.divideScalar(y.w),h.set(y.x,y.y,y.z)}},Ee=function(t,e,i,n,s){r.Curve.call(this),this.degree=t,this.knots=e,this.controlPoints=[],this.startKnot=n||0,this.endKnot=s||this.knots.length-1;for(var o=0;o<i.length;++o){var a=i[o];this.controlPoints[o]=new r.Vector4(a.x,a.y,a.z,a.w)}};(Ee.prototype=Object.create(r.Curve.prototype)).constructor=Ee,Ee.prototype.getPoint=function(t,e){var i=e||new r.Vector3,n=this.knots[this.startKnot]+t*(this.knots[this.endKnot]-this.knots[this.startKnot]),s=_e.calcBSplinePoint(this.degree,this.knots,this.controlPoints,n);return 1!=s.w&&s.divideScalar(s.w),i.set(s.x,s.y,s.z)},Ee.prototype.getTangent=function(t,e){var i=e||new r.Vector3,n=this.knots[0]+t*(this.knots[this.knots.length-1]-this.knots[0]),s=_e.calcNURBSDerivatives(this.degree,this.knots,this.controlPoints,n,1);return i.copy(s[1]).normalize(),i};var Se=function(){var t,e,i;function s(t){r.Loader.call(this,t)}function o(t,e){this.textureLoader=t,this.manager=e}function a(){}function h(){}function l(){}function c(){}function u(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=void 0===e||e}function d(){}function p(t){var e=t.match(/FBXVersion: (\d+)/);if(e)return parseInt(e[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function f(t){return t/46186158e3}s.prototype=Object.assign(Object.create(r.Loader.prototype),{constructor:s,load:function(t,e,i,n){var s=this,o=""===s.path?r.LoaderUtils.extractUrlBase(t):s.path,a=new r.FileLoader(this.manager);a.setPath(s.path),a.setResponseType("arraybuffer"),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(t,(function(i){try{e(s.parse(i,o))}catch(e){n?n(e):console.error(e),s.manager.itemError(t)}}),i,n)},parse:function(e,i){if(a="Kaydara FBX Binary \0",(s=e).byteLength>=a.length&&a===T(s,0,a.length))t=(new c).parse(e);else{var n=T(e);if(!function(t){var e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],i=0;for(var n=0;n<e.length;++n){if((s=void 0,s=t[(r=1)-1],t=t.slice(i+r),i++,s)===e[n])return!1}var r,s;return!0}(n))throw new Error("THREE.FBXLoader: Unknown format.");if(p(n)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+p(n));t=(new l).parse(n)}var s,a;return new o(new r.TextureLoader(this.manager).setPath(this.resourcePath||i).setCrossOrigin(this.crossOrigin),this.manager).parse(t)}}),o.prototype={constructor:o,parse:function(){e=this.parseConnections();var t=this.parseImages(),n=this.parseTextures(t),r=this.parseMaterials(n),s=this.parseDeformers(),o=(new a).parse(s);return this.parseScene(s,o,r),i},parseConnections:function(){var e=new Map;"Connections"in t&&t.Connections.connections.forEach((function(t){var i=t[0],n=t[1],r=t[2];e.has(i)||e.set(i,{parents:[],children:[]});var s={ID:n,relationship:r};e.get(i).parents.push(s),e.has(n)||e.set(n,{parents:[],children:[]});var o={ID:i,relationship:r};e.get(n).children.push(o)}));return e},parseImages:function(){var e={},i={};if("Video"in t.Objects){var n=t.Objects.Video;for(var r in n){var s=n[r];if(e[l=parseInt(r)]=s.RelativeFilename||s.Filename,"Content"in s){var o=s.Content instanceof ArrayBuffer&&s.Content.byteLength>0,a="string"==typeof s.Content&&""!==s.Content;if(o||a){var h=this.parseImage(n[r]);i[s.RelativeFilename||s.Filename]=h}}}}for(var l in e){var c=e[l];void 0!==i[c]?e[l]=i[c]:e[l]=e[l].split("\\").pop()}return e},parseImage:function(t){var e,i=t.Content,n=t.RelativeFilename||t.Filename,r=n.slice(n.lastIndexOf(".")+1).toLowerCase();switch(r){case"bmp":e="image/bmp";break;case"jpg":case"jpeg":e="image/jpeg";break;case"png":e="image/png";break;case"tif":e="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),e="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof i)return"data:"+e+";base64,"+i;var s=new Uint8Array(i);return window.URL.createObjectURL(new Blob([s],{type:e}))},parseTextures:function(e){var i=new Map;if("Texture"in t.Objects){var n=t.Objects.Texture;for(var r in n){var s=this.parseTexture(n[r],e);i.set(parseInt(r),s)}}return i},parseTexture:function(t,e){var i=this.loadTexture(t,e);i.ID=t.id,i.name=t.attrName;var n=t.WrapModeU,s=t.WrapModeV,o=void 0!==n?n.value:0,a=void 0!==s?s.value:0;if(i.wrapS=0===o?r.RepeatWrapping:r.ClampToEdgeWrapping,i.wrapT=0===a?r.RepeatWrapping:r.ClampToEdgeWrapping,"Scaling"in t){var h=t.Scaling.value;i.repeat.x=h[0],i.repeat.y=h[1]}return i},loadTexture:function(t,i){var n,s,o=this.textureLoader.path,a=e.get(t.id).children;void 0!==a&&a.length>0&&void 0!==i[a[0].ID]&&(0!==(n=i[a[0].ID]).indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0));var h=t.FileName.slice(-3).toLowerCase();if("tga"===h){var l=this.manager.getHandler(".tga");null===l?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",t.RelativeFilename),s=new r.Texture):s=l.load(n)}else"psd"===h?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",t.RelativeFilename),s=new r.Texture):s=this.textureLoader.load(n);return this.textureLoader.setPath(o),s},parseMaterials:function(e){var i=new Map;if("Material"in t.Objects){var n=t.Objects.Material;for(var r in n){var s=this.parseMaterial(n[r],e);null!==s&&i.set(parseInt(r),s)}}return i},parseMaterial:function(t,i){var n=t.id,s=t.attrName,o=t.ShadingModel;if("object"==typeof o&&(o=o.value),!e.has(n))return null;var a,h=this.parseParameters(t,i,n);switch(o.toLowerCase()){case"phong":a=new r.MeshPhongMaterial;break;case"lambert":a=new r.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',o),a=new r.MeshPhongMaterial}return a.setValues(h),a.name=s,a},parseParameters:function(t,i,n){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value),t.Diffuse?s.color=(new r.Color).fromArray(t.Diffuse.value):!t.DiffuseColor||"Color"!==t.DiffuseColor.type&&"ColorRGB"!==t.DiffuseColor.type||(s.color=(new r.Color).fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value),t.Emissive?s.emissive=(new r.Color).fromArray(t.Emissive.value):!t.EmissiveColor||"Color"!==t.EmissiveColor.type&&"ColorRGB"!==t.EmissiveColor.type||(s.emissive=(new r.Color).fromArray(t.EmissiveColor.value)),t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value)),t.Opacity&&(s.opacity=parseFloat(t.Opacity.value)),s.opacity<1&&(s.transparent=!0),t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value),t.Shininess&&(s.shininess=t.Shininess.value),t.Specular?s.specular=(new r.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new r.Color).fromArray(t.SpecularColor.value));var o=this;return e.get(n).children.forEach((function(t){var e=t.relationship;switch(e){case"Bump":s.bumpMap=o.getTexture(i,t.ID);break;case"Maya|TEX_ao_map":s.aoMap=o.getTexture(i,t.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=o.getTexture(i,t.ID),s.map.encoding=r.sRGBEncoding;break;case"DisplacementColor":s.displacementMap=o.getTexture(i,t.ID);break;case"EmissiveColor":s.emissiveMap=o.getTexture(i,t.ID),s.emissiveMap.encoding=r.sRGBEncoding;break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=o.getTexture(i,t.ID);break;case"ReflectionColor":s.envMap=o.getTexture(i,t.ID),s.envMap.mapping=r.EquirectangularReflectionMapping,s.envMap.encoding=r.sRGBEncoding;break;case"SpecularColor":s.specularMap=o.getTexture(i,t.ID),s.specularMap.encoding=r.sRGBEncoding;break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=o.getTexture(i,t.ID),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",e)}})),s},getTexture:function(i,n){return"LayeredTexture"in t.Objects&&n in t.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),n=e.get(n).children[0].ID),i.get(n)},parseDeformers:function(){var i={},n={};if("Deformer"in t.Objects){var r=t.Objects.Deformer;for(var s in r){var o=r[s],a=e.get(parseInt(s));if("Skin"===o.attrType){var h=this.parseSkeleton(a,r);h.ID=s,a.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),h.geometryID=a.parents[0].ID,i[s]=h}else if("BlendShape"===o.attrType){var l={id:s};l.rawTargets=this.parseMorphTargets(a,r),l.id=s,a.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),n[s]=l}}}return{skeletons:i,morphTargets:n}},parseSkeleton:function(t,e){var i=[];return t.children.forEach((function(t){var n=e[t.ID];if("Cluster"===n.attrType){var s={ID:t.ID,indices:[],weights:[],transformLink:(new r.Matrix4).fromArray(n.TransformLink.a)};"Indexes"in n&&(s.indices=n.Indexes.a,s.weights=n.Weights.a),i.push(s)}})),{rawBones:i,bones:[]}},parseMorphTargets:function(t,i){for(var n=[],r=0;r<t.children.length;r++){var s=t.children[r],o=i[s.ID],a={name:o.attrName,initialWeight:o.DeformPercent,id:o.id,fullWeights:o.FullWeights.a};if("BlendShapeChannel"!==o.attrType)return;a.geoID=e.get(parseInt(s.ID)).children.filter((function(t){return void 0===t.relationship}))[0].ID,n.push(a)}return n},parseScene:function(n,s,o){i=new r.Group;var a=this.parseModels(n.skeletons,s,o),l=t.Objects.Model,c=this;a.forEach((function(t){var n=l[t.ID];c.setLookAtProperties(t,n),e.get(t.ID).parents.forEach((function(e){var i=a.get(e.ID);void 0!==i&&i.add(t)})),null===t.parent&&i.add(t)})),this.bindSkeleton(n.skeletons,s,a),this.createAmbientLight(),this.setupMorphMaterials(),i.traverse((function(t){if(t.userData.transformData){t.parent&&(t.userData.transformData.parentMatrix=t.parent.matrix,t.userData.transformData.parentMatrixWorld=t.parent.matrixWorld);var e=x(t.userData.transformData);t.applyMatrix4(e),t.updateWorldMatrix()}}));var u=(new h).parse();1===i.children.length&&i.children[0].isGroup&&(i.children[0].animations=u,i=i.children[0]),i.animations=u},parseModels:function(i,n,s){var o=new Map,a=t.Objects.Model;for(var h in a){var l=parseInt(h),c=a[h],u=e.get(l),d=this.buildSkeleton(u,i,l,c.attrName);if(!d){switch(c.attrType){case"Camera":d=this.createCamera(u);break;case"Light":d=this.createLight(u);break;case"Mesh":d=this.createMesh(u,n,s);break;case"NurbsCurve":d=this.createCurve(u,n);break;case"LimbNode":case"Root":d=new r.Bone;break;case"Null":default:d=new r.Group}d.name=c.attrName?r.PropertyBinding.sanitizeNodeName(c.attrName):"",d.ID=l}this.getTransformData(d,c),o.set(l,d)}return o},buildSkeleton:function(t,e,i,n){var s=null;return t.parents.forEach((function(t){for(var o in e){var a=e[o];a.rawBones.forEach((function(e,o){if(e.ID===t.ID){var h=s;(s=new r.Bone).matrixWorld.copy(e.transformLink),s.name=n?r.PropertyBinding.sanitizeNodeName(n):"",s.ID=i,a.bones[o]=s,null!==h&&s.add(h)}}))}})),s},createCamera:function(e){var i,n;if(e.children.forEach((function(e){var i=t.Objects.NodeAttribute[e.ID];void 0!==i&&(n=i)})),void 0===n)i=new r.Object3D;else{var s=0;void 0!==n.CameraProjectionType&&1===n.CameraProjectionType.value&&(s=1);var o=1;void 0!==n.NearPlane&&(o=n.NearPlane.value/1e3);var a=1e3;void 0!==n.FarPlane&&(a=n.FarPlane.value/1e3);var h=window.innerWidth,l=window.innerHeight;void 0!==n.AspectWidth&&void 0!==n.AspectHeight&&(h=n.AspectWidth.value,l=n.AspectHeight.value);var c=h/l,u=45;void 0!==n.FieldOfView&&(u=n.FieldOfView.value);var d=n.FocalLength?n.FocalLength.value:null;switch(s){case 0:i=new r.PerspectiveCamera(u,c,o,a),null!==d&&i.setFocalLength(d);break;case 1:i=new r.OrthographicCamera(-h/2,h/2,l/2,-l/2,o,a);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+s+"."),i=new r.Object3D}}return i},createLight:function(e){var i,n;if(e.children.forEach((function(e){var i=t.Objects.NodeAttribute[e.ID];void 0!==i&&(n=i)})),void 0===n)i=new r.Object3D;else{var s;s=void 0===n.LightType?0:n.LightType.value;var o=16777215;void 0!==n.Color&&(o=(new r.Color).fromArray(n.Color.value));var a=void 0===n.Intensity?1:n.Intensity.value/100;void 0!==n.CastLightOnObject&&0===n.CastLightOnObject.value&&(a=0);var h=0;void 0!==n.FarAttenuationEnd&&(h=void 0!==n.EnableFarAttenuation&&0===n.EnableFarAttenuation.value?0:n.FarAttenuationEnd.value);switch(s){case 0:i=new r.PointLight(o,a,h,1);break;case 1:i=new r.DirectionalLight(o,a);break;case 2:var l=Math.PI/3;void 0!==n.InnerAngle&&(l=r.MathUtils.degToRad(n.InnerAngle.value));var c=0;void 0!==n.OuterAngle&&(c=r.MathUtils.degToRad(n.OuterAngle.value),c=Math.max(c,1)),i=new r.SpotLight(o,a,h,l,c,1);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),i=new r.PointLight(o,a)}void 0!==n.CastShadows&&1===n.CastShadows.value&&(i.castShadow=!0)}return i},createMesh:function(t,e,i){var n,s=null,o=null,a=[];return t.children.forEach((function(t){e.has(t.ID)&&(s=e.get(t.ID)),i.has(t.ID)&&a.push(i.get(t.ID))})),a.length>1?o=a:a.length>0?o=a[0]:(o=new r.MeshPhongMaterial({color:13421772}),a.push(o)),"color"in s.attributes&&a.forEach((function(t){t.vertexColors=!0})),s.FBX_Deformer?(a.forEach((function(t){t.skinning=!0})),(n=new r.SkinnedMesh(s,o)).normalizeSkinWeights()):n=new r.Mesh(s,o),n},createCurve:function(t,e){var i=t.children.reduce((function(t,i){return e.has(i.ID)&&(t=e.get(i.ID)),t}),null),n=new r.LineBasicMaterial({color:3342591,linewidth:1});return new r.Line(i,n)},getTransformData:function(t,e){var i={};"InheritType"in e&&(i.inheritType=parseInt(e.InheritType.value)),i.eulerOrder="RotationOrder"in e?b(e.RotationOrder.value):"ZYX","Lcl_Translation"in e&&(i.translation=e.Lcl_Translation.value),"PreRotation"in e&&(i.preRotation=e.PreRotation.value),"Lcl_Rotation"in e&&(i.rotation=e.Lcl_Rotation.value),"PostRotation"in e&&(i.postRotation=e.PostRotation.value),"Lcl_Scaling"in e&&(i.scale=e.Lcl_Scaling.value),"ScalingOffset"in e&&(i.scalingOffset=e.ScalingOffset.value),"ScalingPivot"in e&&(i.scalingPivot=e.ScalingPivot.value),"RotationOffset"in e&&(i.rotationOffset=e.RotationOffset.value),"RotationPivot"in e&&(i.rotationPivot=e.RotationPivot.value),t.userData.transformData=i},setLookAtProperties:function(n,s){"LookAtProperty"in s&&e.get(n.ID).children.forEach((function(e){if("LookAtProperty"===e.relationship){var s=t.Objects.Model[e.ID];if("Lcl_Translation"in s){var o=s.Lcl_Translation.value;void 0!==n.target?(n.target.position.fromArray(o),i.add(n.target)):n.lookAt((new r.Vector3).fromArray(o))}}}))},bindSkeleton:function(t,i,n){var s=this.parsePoseNodes();for(var o in t){var a=t[o];e.get(parseInt(a.ID)).parents.forEach((function(t){if(i.has(t.ID)){var o=t.ID;e.get(o).parents.forEach((function(t){n.has(t.ID)&&n.get(t.ID).bind(new r.Skeleton(a.bones),s[t.ID])}))}}))}},parsePoseNodes:function(){var e={};if("Pose"in t.Objects){var i=t.Objects.Pose;for(var n in i)if("BindPose"===i[n].attrType){var s=i[n].PoseNode;Array.isArray(s)?s.forEach((function(t){e[t.Node]=(new r.Matrix4).fromArray(t.Matrix.a)})):e[s.Node]=(new r.Matrix4).fromArray(s.Matrix.a)}}return e},createAmbientLight:function(){if("GlobalSettings"in t&&"AmbientColor"in t.GlobalSettings){var e=t.GlobalSettings.AmbientColor.value,n=e[0],s=e[1],o=e[2];if(0!==n||0!==s||0!==o){var a=new r.Color(n,s,o);i.add(new r.AmbientLight(a,1))}}},setupMorphMaterials:function(){var t=this;i.traverse((function(e){e.isMesh&&e.geometry.morphAttributes.position&&e.geometry.morphAttributes.position.length&&(Array.isArray(e.material)?e.material.forEach((function(i,n){t.setupMorphMaterial(e,i,n)})):t.setupMorphMaterial(e,e.material))}))},setupMorphMaterial:function(t,e,n){var r=t.uuid,s=e.uuid,o=!1;if(i.traverse((function(t){t.isMesh&&(Array.isArray(t.material)?t.material.forEach((function(e){e.uuid===s&&t.uuid!==r&&(o=!0)})):t.material.uuid===s&&t.uuid!==r&&(o=!0))})),!0===o){var a=e.clone();a.morphTargets=!0,void 0===n?t.material=a:t.material[n]=a}else e.morphTargets=!0}},a.prototype={constructor:a,parse:function(i){var n=new Map;if("Geometry"in t.Objects){var r=t.Objects.Geometry;for(var s in r){var o=e.get(parseInt(s)),a=this.parseGeometry(o,r[s],i);n.set(parseInt(s),a)}}return n},parseGeometry:function(t,e,i){switch(e.attrType){case"Mesh":return this.parseMeshGeometry(t,e,i);case"NurbsCurve":return this.parseNurbsGeometry(e)}},parseMeshGeometry:function(e,i,n){var r=n.skeletons,s=[],o=e.parents.map((function(e){return t.Objects.Model[e.ID]}));if(0!==o.length){var a=e.children.reduce((function(t,e){return void 0!==r[e.ID]&&(t=r[e.ID]),t}),null);e.children.forEach((function(t){void 0!==n.morphTargets[t.ID]&&s.push(n.morphTargets[t.ID])}));var h=o[0],l={};"RotationOrder"in h&&(l.eulerOrder=b(h.RotationOrder.value)),"InheritType"in h&&(l.inheritType=parseInt(h.InheritType.value)),"GeometricTranslation"in h&&(l.translation=h.GeometricTranslation.value),"GeometricRotation"in h&&(l.rotation=h.GeometricRotation.value),"GeometricScaling"in h&&(l.scale=h.GeometricScaling.value);var c=x(l);return this.genGeometry(i,a,s,c)}},genGeometry:function(t,e,i,n){var s=new r.BufferGeometry;t.attrName&&(s.name=t.attrName);var o=this.parseGeoNode(t,e),a=this.genBuffers(o),h=new r.Float32BufferAttribute(a.vertex,3);if(h.applyMatrix4(n),s.setAttribute("position",h),a.colors.length>0&&s.setAttribute("color",new r.Float32BufferAttribute(a.colors,3)),e&&(s.setAttribute("skinIndex",new r.Uint16BufferAttribute(a.weightsIndices,4)),s.setAttribute("skinWeight",new r.Float32BufferAttribute(a.vertexWeights,4)),s.FBX_Deformer=e),a.normal.length>0){var l=(new r.Matrix3).getNormalMatrix(n),c=new r.Float32BufferAttribute(a.normal,3);c.applyNormalMatrix(l),s.setAttribute("normal",c)}if(a.uvs.forEach((function(t,e){var i="uv"+(e+1).toString();0===e&&(i="uv"),s.setAttribute(i,new r.Float32BufferAttribute(a.uvs[e],2))})),o.material&&"AllSame"!==o.material.mappingType){var u=a.materialIndex[0],d=0;if(a.materialIndex.forEach((function(t,e){t!==u&&(s.addGroup(d,e-d,u),u=t,d=e)})),s.groups.length>0){var p=s.groups[s.groups.length-1],f=p.start+p.count;f!==a.materialIndex.length&&s.addGroup(f,a.materialIndex.length-f,u)}0===s.groups.length&&s.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(s,t,i,n),s},parseGeoNode:function(t,e){var i={};if(i.vertexPositions=void 0!==t.Vertices?t.Vertices.a:[],i.vertexIndices=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(i.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(i.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(i.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){i.uv=[];for(var n=0;t.LayerElementUV[n];)t.LayerElementUV[n].UV&&i.uv.push(this.parseUVs(t.LayerElementUV[n])),n++}return i.weightTable={},null!==e&&(i.skeleton=e,e.rawBones.forEach((function(t,e){t.indices.forEach((function(n,r){void 0===i.weightTable[n]&&(i.weightTable[n]=[]),i.weightTable[n].push({id:e,weight:t.weights[r]})}))}))),i},genBuffers:function(t){var e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},i=0,n=0,r=!1,s=[],o=[],a=[],h=[],l=[],c=[],u=this;return t.vertexIndices.forEach((function(d,p){var f=!1;d<0&&(d^=-1,f=!0);var m=[],v=[];if(s.push(3*d,3*d+1,3*d+2),t.color){var y=g(p,i,d,t.color);a.push(y[0],y[1],y[2])}if(t.skeleton){if(void 0!==t.weightTable[d]&&t.weightTable[d].forEach((function(t){v.push(t.weight),m.push(t.id)})),v.length>4){r||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),r=!0);var x=[0,0,0,0],b=[0,0,0,0];v.forEach((function(t,e){var i=t,n=m[e];b.forEach((function(t,e,r){if(i>t){r[e]=i,i=t;var s=x[e];x[e]=n,n=s}}))})),m=x,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)l.push(v[w]),c.push(m[w])}if(t.normal){y=g(p,i,d,t.normal);o.push(y[0],y[1],y[2])}if(t.material&&"AllSame"!==t.material.mappingType)var T=g(p,i,d,t.material)[0];t.uv&&t.uv.forEach((function(t,e){var n=g(p,i,d,t);void 0===h[e]&&(h[e]=[]),h[e].push(n[0]),h[e].push(n[1])})),n++,f&&(u.genFace(e,t,s,T,o,a,h,l,c,n),i++,n=0,s=[],o=[],a=[],h=[],l=[],c=[])})),e},genFace:function(t,e,i,n,r,s,o,a,h,l){for(var c=2;c<l;c++)t.vertex.push(e.vertexPositions[i[0]]),t.vertex.push(e.vertexPositions[i[1]]),t.vertex.push(e.vertexPositions[i[2]]),t.vertex.push(e.vertexPositions[i[3*(c-1)]]),t.vertex.push(e.vertexPositions[i[3*(c-1)+1]]),t.vertex.push(e.vertexPositions[i[3*(c-1)+2]]),t.vertex.push(e.vertexPositions[i[3*c]]),t.vertex.push(e.vertexPositions[i[3*c+1]]),t.vertex.push(e.vertexPositions[i[3*c+2]]),e.skeleton&&(t.vertexWeights.push(a[0]),t.vertexWeights.push(a[1]),t.vertexWeights.push(a[2]),t.vertexWeights.push(a[3]),t.vertexWeights.push(a[4*(c-1)]),t.vertexWeights.push(a[4*(c-1)+1]),t.vertexWeights.push(a[4*(c-1)+2]),t.vertexWeights.push(a[4*(c-1)+3]),t.vertexWeights.push(a[4*c]),t.vertexWeights.push(a[4*c+1]),t.vertexWeights.push(a[4*c+2]),t.vertexWeights.push(a[4*c+3]),t.weightsIndices.push(h[0]),t.weightsIndices.push(h[1]),t.weightsIndices.push(h[2]),t.weightsIndices.push(h[3]),t.weightsIndices.push(h[4*(c-1)]),t.weightsIndices.push(h[4*(c-1)+1]),t.weightsIndices.push(h[4*(c-1)+2]),t.weightsIndices.push(h[4*(c-1)+3]),t.weightsIndices.push(h[4*c]),t.weightsIndices.push(h[4*c+1]),t.weightsIndices.push(h[4*c+2]),t.weightsIndices.push(h[4*c+3])),e.color&&(t.colors.push(s[0]),t.colors.push(s[1]),t.colors.push(s[2]),t.colors.push(s[3*(c-1)]),t.colors.push(s[3*(c-1)+1]),t.colors.push(s[3*(c-1)+2]),t.colors.push(s[3*c]),t.colors.push(s[3*c+1]),t.colors.push(s[3*c+2])),e.material&&"AllSame"!==e.material.mappingType&&(t.materialIndex.push(n),t.materialIndex.push(n),t.materialIndex.push(n)),e.normal&&(t.normal.push(r[0]),t.normal.push(r[1]),t.normal.push(r[2]),t.normal.push(r[3*(c-1)]),t.normal.push(r[3*(c-1)+1]),t.normal.push(r[3*(c-1)+2]),t.normal.push(r[3*c]),t.normal.push(r[3*c+1]),t.normal.push(r[3*c+2])),e.uv&&e.uv.forEach((function(e,i){void 0===t.uvs[i]&&(t.uvs[i]=[]),t.uvs[i].push(o[i][0]),t.uvs[i].push(o[i][1]),t.uvs[i].push(o[i][2*(c-1)]),t.uvs[i].push(o[i][2*(c-1)+1]),t.uvs[i].push(o[i][2*c]),t.uvs[i].push(o[i][2*c+1])}))},addMorphTargets:function(e,i,n,r){if(0!==n.length){e.morphTargetsRelative=!0,e.morphAttributes.position=[];var s=this;n.forEach((function(n){n.rawTargets.forEach((function(n){var o=t.Objects.Geometry[n.geoID];void 0!==o&&s.genMorphGeometry(e,i,o,r,n.name)}))}))}},genMorphGeometry:function(t,e,i,n,s){for(var o=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],a=void 0!==i.Vertices?i.Vertices.a:[],h=void 0!==i.Indexes?i.Indexes.a:[],l=3*t.attributes.position.count,c=new Float32Array(l),u=0;u<h.length;u++){var d=3*h[u];c[d]=a[3*u],c[d+1]=a[3*u+1],c[d+2]=a[3*u+2]}var p={vertexIndices:o,vertexPositions:c},f=this.genBuffers(p),m=new r.Float32BufferAttribute(f.vertex,3);m.name=s||i.attrName,m.applyMatrix4(n),t.morphAttributes.position.push(m)},parseNormals:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.Normals.a,r=[];return"IndexToDirect"===i&&("NormalIndex"in t?r=t.NormalIndex.a:"NormalsIndex"in t&&(r=t.NormalsIndex.a)),{dataSize:3,buffer:n,indices:r,mappingType:e,referenceType:i}},parseUVs:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.UV.a,r=[];return"IndexToDirect"===i&&(r=t.UVIndex.a),{dataSize:2,buffer:n,indices:r,mappingType:e,referenceType:i}},parseVertexColors:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.Colors.a,r=[];return"IndexToDirect"===i&&(r=t.ColorIndex.a),{dataSize:4,buffer:n,indices:r,mappingType:e,referenceType:i}},parseMaterialIndices:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType;if("NoMappingInformation"===e)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};for(var n=t.Materials.a,r=[],s=0;s<n.length;++s)r.push(s);return{dataSize:1,buffer:n,indices:r,mappingType:e,referenceType:i}},parseNurbsGeometry:function(t){if(void 0===Ee)return console.error("THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new r.BufferGeometry;var e=parseInt(t.Order);if(isNaN(e))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new r.BufferGeometry;for(var i,n,s=e-1,o=t.KnotVector.a,a=[],h=t.Points.a,l=0,c=h.length;l<c;l+=4)a.push((new r.Vector4).fromArray(h,l));if("Closed"===t.Form)a.push(a[0]);else if("Periodic"===t.Form){i=s,n=o.length-1-i;for(l=0;l<s;++l)a.push(a[l])}var u=new Ee(s,o,a,i,n).getPoints(7*a.length),d=new Float32Array(3*u.length);u.forEach((function(t,e){t.toArray(d,3*e)}));var p=new r.BufferGeometry;return p.setAttribute("position",new r.BufferAttribute(d,3)),p}},h.prototype={constructor:h,parse:function(){var t=[],e=this.parseClips();if(void 0!==e)for(var i in e){var n=e[i],r=this.addClip(n);t.push(r)}return t},parseClips:function(){if(void 0!==t.Objects.AnimationCurve){var e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);var i=this.parseAnimationLayers(e);return this.parseAnimStacks(i)}},parseAnimationCurveNodes:function(){var e=t.Objects.AnimationCurveNode,i=new Map;for(var n in e){var r=e[n];if(null!==r.attrName.match(/S|R|T|DeformPercent/)){var s={id:r.id,attr:r.attrName,curves:{}};i.set(s.id,s)}}return i},parseAnimationCurves:function(i){var n=t.Objects.AnimationCurve;for(var r in n){var s={id:n[r].id,times:n[r].KeyTime.a.map(f),values:n[r].KeyValueFloat.a},o=e.get(s.id);if(void 0!==o){var a=o.parents[0].ID,h=o.parents[0].relationship;h.match(/X/)?i.get(a).curves.x=s:h.match(/Y/)?i.get(a).curves.y=s:h.match(/Z/)?i.get(a).curves.z=s:h.match(/d|DeformPercent/)&&i.has(a)&&(i.get(a).curves.morph=s)}}},parseAnimationLayers:function(n){var s=t.Objects.AnimationLayer,o=new Map;for(var a in s){var h=[],l=e.get(parseInt(a));if(void 0!==l)l.children.forEach((function(s,o){if(n.has(s.ID)){var a=n.get(s.ID);if(void 0!==a.curves.x||void 0!==a.curves.y||void 0!==a.curves.z){if(void 0===h[o])if(void 0!==(f=e.get(s.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID)){if(void 0===(c=t.Objects.Model[f.toString()]))return void console.warn("THREE.FBXLoader: Encountered a unused curve.",s);var l={modelName:c.attrName?r.PropertyBinding.sanitizeNodeName(c.attrName):"",ID:c.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};i.traverse((function(t){t.ID===c.id&&(l.transform=t.matrix,t.userData.transformData&&(l.eulerOrder=t.userData.transformData.eulerOrder))})),l.transform||(l.transform=new r.Matrix4),"PreRotation"in c&&(l.preRotation=c.PreRotation.value),"PostRotation"in c&&(l.postRotation=c.PostRotation.value),h[o]=l}h[o]&&(h[o][a.attr]=a)}else if(void 0!==a.curves.morph){if(void 0===h[o]){var c,u=e.get(s.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID,d=e.get(u).parents[0].ID,p=e.get(d).parents[0].ID,f=e.get(p).parents[0].ID;l={modelName:(c=t.Objects.Model[f]).attrName?r.PropertyBinding.sanitizeNodeName(c.attrName):"",morphName:t.Objects.Deformer[u].attrName};h[o]=l}h[o][a.attr]=a}}})),o.set(parseInt(a),h)}return o},parseAnimStacks:function(i){var n=t.Objects.AnimationStack,r={};for(var s in n){var o=e.get(parseInt(s)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var a=i.get(o[0].ID);r[s]={name:n[s].attrName,layer:a}}return r},addClip:function(t){var e=[],i=this;return t.layer.forEach((function(t){e=e.concat(i.generateTracks(t))})),new r.AnimationClip(t.name,-1,e)},generateTracks:function(t){var e=[],i=new r.Vector3,n=new r.Quaternion,s=new r.Vector3;if(t.transform&&t.transform.decompose(i,n,s),i=i.toArray(),n=(new r.Euler).setFromQuaternion(n,t.eulerOrder).toArray(),s=s.toArray(),void 0!==t.T&&Object.keys(t.T.curves).length>0){var o=this.generateVectorTrack(t.modelName,t.T.curves,i,"position");void 0!==o&&e.push(o)}if(void 0!==t.R&&Object.keys(t.R.curves).length>0){var a=this.generateRotationTrack(t.modelName,t.R.curves,n,t.preRotation,t.postRotation,t.eulerOrder);void 0!==a&&e.push(a)}if(void 0!==t.S&&Object.keys(t.S.curves).length>0){var h=this.generateVectorTrack(t.modelName,t.S.curves,s,"scale");void 0!==h&&e.push(h)}if(void 0!==t.DeformPercent){var l=this.generateMorphTrack(t);void 0!==l&&e.push(l)}return e},generateVectorTrack:function(t,e,i,n){var s=this.getTimesForAllAxes(e),o=this.getKeyframeTrackValues(s,e,i);return new r.VectorKeyframeTrack(t+"."+n,s,o)},generateRotationTrack:function(t,e,i,n,s,o){void 0!==e.x&&(this.interpolateRotations(e.x),e.x.values=e.x.values.map(r.MathUtils.degToRad)),void 0!==e.y&&(this.interpolateRotations(e.y),e.y.values=e.y.values.map(r.MathUtils.degToRad)),void 0!==e.z&&(this.interpolateRotations(e.z),e.z.values=e.z.values.map(r.MathUtils.degToRad));var a=this.getTimesForAllAxes(e),h=this.getKeyframeTrackValues(a,e,i);void 0!==n&&((n=n.map(r.MathUtils.degToRad)).push(o),n=(new r.Euler).fromArray(n),n=(new r.Quaternion).setFromEuler(n)),void 0!==s&&((s=s.map(r.MathUtils.degToRad)).push(o),s=(new r.Euler).fromArray(s),s=(new r.Quaternion).setFromEuler(s).invert());for(var l=new r.Quaternion,c=new r.Euler,u=[],d=0;d<h.length;d+=3)c.set(h[d],h[d+1],h[d+2],o),l.setFromEuler(c),void 0!==n&&l.premultiply(n),void 0!==s&&l.multiply(s),l.toArray(u,d/3*4);return new r.QuaternionKeyframeTrack(t+".quaternion",a,u)},generateMorphTrack:function(t){var e=t.DeformPercent.curves.morph,n=e.values.map((function(t){return t/100})),s=i.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new r.NumberKeyframeTrack(t.modelName+".morphTargetInfluences["+s+"]",e.times,n)},getTimesForAllAxes:function(t){var e=[];if(void 0!==t.x&&(e=e.concat(t.x.times)),void 0!==t.y&&(e=e.concat(t.y.times)),void 0!==t.z&&(e=e.concat(t.z.times)),(e=e.sort((function(t,e){return t-e}))).length>1){for(var i=1,n=e[0],r=1;r<e.length;r++){var s=e[r];s!==n&&(e[i]=s,n=s,i++)}e=e.slice(0,i)}return e},getKeyframeTrackValues:function(t,e,i){var n=i,r=[],s=-1,o=-1,a=-1;return t.forEach((function(t){if(e.x&&(s=e.x.times.indexOf(t)),e.y&&(o=e.y.times.indexOf(t)),e.z&&(a=e.z.times.indexOf(t)),-1!==s){var i=e.x.values[s];r.push(i),n[0]=i}else r.push(n[0]);if(-1!==o){var h=e.y.values[o];r.push(h),n[1]=h}else r.push(n[1]);if(-1!==a){var l=e.z.values[a];r.push(l),n[2]=l}else r.push(n[2])})),r},interpolateRotations:function(t){for(var e=1;e<t.values.length;e++){var i=t.values[e-1],n=t.values[e]-i,r=Math.abs(n);if(r>=180){for(var s=r/180,o=n/s,a=i+o,h=t.times[e-1],l=(t.times[e]-h)/s,c=h+l,u=[],d=[];c<t.times[e];)u.push(c),c+=l,d.push(a),a+=o;t.times=_(t.times,e,u),t.values=_(t.values,e,d)}}}},l.prototype={constructor:l,getPrevNode:function(){return this.nodeStack[this.currentIndent-2]},getCurrentNode:function(){return this.nodeStack[this.currentIndent-1]},getCurrentProp:function(){return this.currentProp},pushStack:function(t){this.nodeStack.push(t),this.currentIndent+=1},popStack:function(){this.nodeStack.pop(),this.currentIndent-=1},setCurrentProp:function(t,e){this.currentProp=t,this.currentPropName=e},parse:function(t){this.currentIndent=0,this.allNodes=new d,this.nodeStack=[],this.currentProp=[],this.currentPropName="";var e=this,i=t.split(/[\r\n]+/);return i.forEach((function(t,n){var r=t.match(/^[\s\t]*;/),s=t.match(/^[\s\t]*$/);if(!r&&!s){var o=t.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){",""),a=t.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),h=t.match("^\\t{"+(e.currentIndent-1)+"}}");o?e.parseNodeBegin(t,o):a?e.parseNodeProperty(t,a,i[++n]):h?e.popStack():t.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(t)}})),this.allNodes},parseNodeBegin:function(t,e){var i=e[1].trim().replace(/^"/,"").replace(/"$/,""),n=e[2].split(",").map((function(t){return t.trim().replace(/^"/,"").replace(/"$/,"")})),r={name:i},s=this.parseNodeAttr(n),o=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(i,r):i in o?("PoseNode"===i?o.PoseNode.push(r):void 0!==o[i].id&&(o[i]={},o[i][o[i].id]=o[i]),""!==s.id&&(o[i][s.id]=r)):"number"==typeof s.id?(o[i]={},o[i][s.id]=r):"Properties70"!==i&&(o[i]="PoseNode"===i?[r]:r),"number"==typeof s.id&&(r.id=s.id),""!==s.name&&(r.attrName=s.name),""!==s.type&&(r.attrType=s.type),this.pushStack(r)},parseNodeAttr:function(t){var e=t[0];""!==t[0]&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));var i="",n="";return t.length>1&&(i=t[1].replace(/^(\w+)::/,""),n=t[2]),{id:e,name:i,type:n}},parseNodeProperty:function(t,e,i){var n=e[1].replace(/^"/,"").replace(/"$/,"").trim(),r=e[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===n&&","===r&&(r=i.replace(/"/g,"").replace(/,$/,"").trim());var s=this.getCurrentNode();if("Properties70"!==s.name){if("C"===n){var o=r.split(",").slice(1),a=parseInt(o[0]),h=parseInt(o[1]),l=r.split(",").slice(3);n="connections",function(t,e){for(var i=0,n=t.length,r=e.length;i<r;i++,n++)t[n]=e[i]}(r=[a,h],l=l.map((function(t){return t.trim().replace(/^"/,"")}))),void 0===s[n]&&(s[n]=[])}"Node"===n&&(s.id=r),n in s&&Array.isArray(s[n])?s[n].push(r):"a"!==n?s[n]=r:s.a=r,this.setCurrentProp(s,n),"a"===n&&","!==r.slice(-1)&&(s.a=w(r))}else this.parseNodeSpecialProperty(t,n,r)},parseNodePropertyContinued:function(t){var e=this.getCurrentNode();e.a+=t,","!==t.slice(-1)&&(e.a=w(e.a))},parseNodeSpecialProperty:function(t,e,i){var n=i.split('",').map((function(t){return t.trim().replace(/^\"/,"").replace(/\s/,"_")})),r=n[0],s=n[1],o=n[2],a=n[3],h=n[4];switch(s){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":h=parseFloat(h);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":h=w(h)}this.getPrevNode()[r]={type:s,type2:o,flag:a,value:h},this.setCurrentProp(this.getPrevNode(),r)}},c.prototype={constructor:c,parse:function(t){var e=new u(t);e.skip(23);var i=e.getUint32();if(i<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+i);for(var n=new d;!this.endOfContent(e);){var r=this.parseNode(e,i);null!==r&&n.add(r.name,r)}return n},endOfContent:function(t){return t.size()%16==0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()},parseNode:function(t,e){var i={},n=e>=7500?t.getUint64():t.getUint32(),r=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();var s=t.getUint8(),o=t.getString(s);if(0===n)return null;for(var a=[],h=0;h<r;h++)a.push(this.parseProperty(t));var l=a.length>0?a[0]:"",c=a.length>1?a[1]:"",u=a.length>2?a[2]:"";for(i.singleProperty=1===r&&t.getOffset()===n;n>t.getOffset();){var d=this.parseNode(t,e);null!==d&&this.parseSubNode(o,i,d)}return i.propertyList=a,"number"==typeof l&&(i.id=l),""!==c&&(i.attrName=c),""!==u&&(i.attrType=u),""!==o&&(i.name=o),i},parseSubNode:function(t,e,i){if(!0===i.singleProperty){var n=i.propertyList[0];Array.isArray(n)?(e[i.name]=i,i.a=n):e[i.name]=n}else if("Connections"===t&&"C"===i.name){var r=[];i.propertyList.forEach((function(t,e){0!==e&&r.push(t)})),void 0===e.connections&&(e.connections=[]),e.connections.push(r)}else if("Properties70"===i.name){Object.keys(i).forEach((function(t){e[t]=i[t]}))}else if("Properties70"===t&&"P"===i.name){var s,o=i.propertyList[0],a=i.propertyList[1],h=i.propertyList[2],l=i.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===a.indexOf("Lcl ")&&(a=a.replace("Lcl ","Lcl_")),s="Color"===a||"ColorRGB"===a||"Vector"===a||"Vector3D"===a||0===a.indexOf("Lcl_")?[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:i.propertyList[4],e[o]={type:a,type2:h,flag:l,value:s}}else void 0===e[i.name]?"number"==typeof i.id?(e[i.name]={},e[i.name][i.id]=i):e[i.name]=i:"PoseNode"===i.name?(Array.isArray(e[i.name])||(e[i.name]=[e[i.name]]),e[i.name].push(i)):void 0===e[i.name][i.id]&&(e[i.name][i.id]=i)},parseProperty:function(t){var e=t.getString(1);switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":var i=t.getUint32();return t.getArrayBuffer(i);case"S":i=t.getUint32();return t.getString(i);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var r=t.getUint32(),s=t.getUint32(),o=t.getUint32();if(0===s)switch(e){case"b":case"c":return t.getBooleanArray(r);case"d":return t.getFloat64Array(r);case"f":return t.getFloat32Array(r);case"i":return t.getInt32Array(r);case"l":return t.getInt64Array(r)}void 0===n&&console.error("THREE.FBXLoader: External library fflate.min.js required.");var a=new u(Xt(new Uint8Array(t.getArrayBuffer(o))).buffer);switch(e){case"b":case"c":return a.getBooleanArray(r);case"d":return a.getFloat64Array(r);case"f":return a.getFloat32Array(r);case"i":return a.getInt32Array(r);case"l":return a.getInt64Array(r)}default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}}},u.prototype={constructor:u,getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(t){this.offset+=t},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getBoolean());return e},getUint8:function(){var t=this.dv.getUint8(this.offset);return this.offset+=1,t},getInt16:function(){var t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},getInt32:function(){var t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},getInt32Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getInt32());return e},getUint32:function(){var t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},getInt64:function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),2147483648&e?(e=4294967295&~e,4294967295===(t=4294967295&~t)&&(e=e+1&4294967295),-(4294967296*e+(t=t+1&4294967295))):4294967296*e+t},getInt64Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getInt64());return e},getUint64:function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),4294967296*e+t},getFloat32:function(){var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},getFloat32Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getFloat32());return e},getFloat64:function(){var t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},getFloat64Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getFloat64());return e},getArrayBuffer:function(t){var e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e},getString:function(t){for(var e=[],i=0;i<t;i++)e[i]=this.getUint8();var n=e.indexOf(0);return n>=0&&(e=e.slice(0,n)),r.LoaderUtils.decodeText(new Uint8Array(e))}},d.prototype={constructor:d,add:function(t,e){this[t]=e}};var m=[];function g(t,e,i,n){var r;switch(n.mappingType){case"ByPolygonVertex":r=t;break;case"ByPolygon":r=e;break;case"ByVertice":r=i;break;case"AllSame":r=n.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+n.mappingType)}"IndexToDirect"===n.referenceType&&(r=n.indices[r]);var s=r*n.dataSize,o=s+n.dataSize;return function(t,e,i,n){for(var r=i,s=0;r<n;r++,s++)t[s]=e[r];return t}(m,n.buffer,s,o)}var v=new r.Euler,y=new r.Vector3;function x(t){var e,i=new r.Matrix4,n=new r.Matrix4,s=new r.Matrix4,o=new r.Matrix4,a=new r.Matrix4,h=new r.Matrix4,l=new r.Matrix4,c=new r.Matrix4,u=new r.Matrix4,d=new r.Matrix4,p=new r.Matrix4,f=new r.Matrix4,m=t.inheritType?t.inheritType:0;(t.translation&&i.setPosition(y.fromArray(t.translation)),t.preRotation)&&((e=t.preRotation.map(r.MathUtils.degToRad)).push(t.eulerOrder),n.makeRotationFromEuler(v.fromArray(e)));t.rotation&&((e=t.rotation.map(r.MathUtils.degToRad)).push(t.eulerOrder),s.makeRotationFromEuler(v.fromArray(e)));t.postRotation&&((e=t.postRotation.map(r.MathUtils.degToRad)).push(t.eulerOrder),o.makeRotationFromEuler(v.fromArray(e)),o.invert());t.scale&&a.scale(y.fromArray(t.scale)),t.scalingOffset&&l.setPosition(y.fromArray(t.scalingOffset)),t.scalingPivot&&h.setPosition(y.fromArray(t.scalingPivot)),t.rotationOffset&&c.setPosition(y.fromArray(t.rotationOffset)),t.rotationPivot&&u.setPosition(y.fromArray(t.rotationPivot)),t.parentMatrixWorld&&(p.copy(t.parentMatrix),d.copy(t.parentMatrixWorld));var g=(new r.Matrix4).copy(n).multiply(s).multiply(o),x=new r.Matrix4;x.extractRotation(d);var b=new r.Matrix4;b.copyPosition(d);var w=new r.Matrix4,T=(new r.Matrix4).copy(b).invert().multiply(d);w.copy(x).invert().multiply(T);var _=a,E=new r.Matrix4;if(0===m)E.copy(x).multiply(g).multiply(w).multiply(_);else if(1===m)E.copy(x).multiply(w).multiply(g).multiply(_);else{var S=(new r.Matrix4).scale((new r.Vector3).setFromMatrixScale(p)),M=(new r.Matrix4).copy(S).invert(),A=(new r.Matrix4).copy(w).multiply(M);E.copy(x).multiply(g).multiply(A).multiply(_)}var C=new r.Matrix4;C.copy(u).invert();var P=new r.Matrix4;P.copy(h).invert();var R=new r.Matrix4;R.copy(i).multiply(c).multiply(u).multiply(n).multiply(s).multiply(o).multiply(C).multiply(l).multiply(h).multiply(a).multiply(P);var L=(new r.Matrix4).copyPosition(R),O=(new r.Matrix4).copy(d).multiply(L);return f.copyPosition(O),(R=(new r.Matrix4).copy(f).multiply(E)).premultiply(d.invert()),R}function b(t){var e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(t=t||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),e[0]):e[t]}function w(t){return t.split(",").map((function(t){return parseFloat(t)}))}function T(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=t.byteLength),r.LoaderUtils.decodeText(new Uint8Array(t,e,i))}function _(t,e,i){return t.slice(0,e).concat(i).concat(t.slice(e))}return s}()},function(t,e,i){"use strict";i.r(e),i.d(e,"Water",(function(){return o}));var n=i(0),r=function(t,e){n.Mesh.call(this,t),this.type="Reflector";var i=this,s=void 0!==(e=e||{}).color?new n.Color(e.color):new n.Color(8355711),o=e.textureWidth||512,a=e.textureHeight||512,h=e.clipBias||0,l=e.shader||r.ReflectorShader,c=new n.Plane,u=new n.Vector3,d=new n.Vector3,p=new n.Vector3,f=new n.Matrix4,m=new n.Vector3(0,0,-1),g=new n.Vector4,v=new n.Vector3,y=new n.Vector3,x=new n.Vector4,b=new n.Matrix4,w=new n.PerspectiveCamera,T={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBFormat},_=new n.WebGLRenderTarget(o,a,T);n.MathUtils.isPowerOfTwo(o)&&n.MathUtils.isPowerOfTwo(a)||(_.texture.generateMipmaps=!1);var E=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(l.uniforms),fragmentShader:l.fragmentShader,vertexShader:l.vertexShader});E.uniforms.tDiffuse.value=_.texture,E.uniforms.color.value=s,E.uniforms.textureMatrix.value=b,this.material=E,this.onBeforeRender=function(t,e,n){if(d.setFromMatrixPosition(i.matrixWorld),p.setFromMatrixPosition(n.matrixWorld),f.extractRotation(i.matrixWorld),u.set(0,0,1),u.applyMatrix4(f),v.subVectors(d,p),!(v.dot(u)>0)){v.reflect(u).negate(),v.add(d),f.extractRotation(n.matrixWorld),m.set(0,0,-1),m.applyMatrix4(f),m.add(p),y.subVectors(d,m),y.reflect(u).negate(),y.add(d),w.position.copy(v),w.up.set(0,1,0),w.up.applyMatrix4(f),w.up.reflect(u),w.lookAt(y),w.far=n.far,w.updateMatrixWorld(),w.projectionMatrix.copy(n.projectionMatrix),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(w.projectionMatrix),b.multiply(w.matrixWorldInverse),b.multiply(i.matrixWorld),c.setFromNormalAndCoplanarPoint(u,d),c.applyMatrix4(w.matrixWorldInverse),g.set(c.normal.x,c.normal.y,c.normal.z,c.constant);var r=w.projectionMatrix;x.x=(Math.sign(g.x)+r.elements[8])/r.elements[0],x.y=(Math.sign(g.y)+r.elements[9])/r.elements[5],x.z=-1,x.w=(1+r.elements[10])/r.elements[14],g.multiplyScalar(2/g.dot(x)),r.elements[2]=g.x,r.elements[6]=g.y,r.elements[10]=g.z+1-h,r.elements[14]=g.w,_.texture.encoding=t.outputEncoding,i.visible=!1;var s=t.getRenderTarget(),o=t.xr.enabled,a=t.shadowMap.autoUpdate;t.xr.enabled=!1,t.shadowMap.autoUpdate=!1,t.setRenderTarget(_),t.state.buffers.depth.setMask(!0),!1===t.autoClear&&t.clear(),t.render(e,w),t.xr.enabled=o,t.shadowMap.autoUpdate=a,t.setRenderTarget(s);var l=n.viewport;void 0!==l&&t.state.viewport(l),i.visible=!0}},this.getRenderTarget=function(){return _}};r.prototype=Object.create(n.Mesh.prototype),r.prototype.constructor=r,r.ReflectorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec4 vUv;","void main() {","\tvUv = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec4 vUv;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );","}","void main() {","\tvec4 base = texture2DProj( tDiffuse, vUv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};var s=function(t,e){n.Mesh.call(this,t),this.type="Refractor";var i=this,r=void 0!==(e=e||{}).color?new n.Color(e.color):new n.Color(8355711),o=e.textureWidth||512,a=e.textureHeight||512,h=e.clipBias||0,l=e.shader||s.RefractorShader,c=new n.PerspectiveCamera;c.matrixAutoUpdate=!1,c.userData.refractor=!0;var u=new n.Plane,d=new n.Matrix4,p={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBFormat},f=new n.WebGLRenderTarget(o,a,p);n.MathUtils.isPowerOfTwo(o)&&n.MathUtils.isPowerOfTwo(a)||(f.texture.generateMipmaps=!1),this.material=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader,transparent:!0}),this.material.uniforms.color.value=r,this.material.uniforms.tDiffuse.value=f.texture,this.material.uniforms.textureMatrix.value=d;var m,g,v,y,x,b,w,T,_=(m=new n.Vector3,g=new n.Vector3,v=new n.Matrix4,y=new n.Vector3,x=new n.Vector3,function(t){return m.setFromMatrixPosition(i.matrixWorld),g.setFromMatrixPosition(t.matrixWorld),y.subVectors(m,g),v.extractRotation(i.matrixWorld),x.set(0,0,1),x.applyMatrix4(v),y.dot(x)<0}),E=function(){var t=new n.Vector3,e=new n.Vector3,r=new n.Quaternion,s=new n.Vector3;return function(){i.matrixWorld.decompose(e,r,s),t.set(0,0,1).applyQuaternion(r).normalize(),t.negate(),u.setFromNormalAndCoplanarPoint(t,e)}}(),S=(b=new n.Plane,w=new n.Vector4,T=new n.Vector4,function(t){c.matrixWorld.copy(t.matrixWorld),c.matrixWorldInverse.copy(c.matrixWorld).invert(),c.projectionMatrix.copy(t.projectionMatrix),c.far=t.far,b.copy(u),b.applyMatrix4(c.matrixWorldInverse),w.set(b.normal.x,b.normal.y,b.normal.z,b.constant);var e=c.projectionMatrix;T.x=(Math.sign(w.x)+e.elements[8])/e.elements[0],T.y=(Math.sign(w.y)+e.elements[9])/e.elements[5],T.z=-1,T.w=(1+e.elements[10])/e.elements[14],w.multiplyScalar(2/w.dot(T)),e.elements[2]=w.x,e.elements[6]=w.y,e.elements[10]=w.z+1-h,e.elements[14]=w.w});this.onBeforeRender=function(t,e,n){f.texture.encoding=t.outputEncoding,!0!==n.userData.refractor&&!0!=!_(n)&&(E(),function(t){d.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),d.multiply(t.projectionMatrix),d.multiply(t.matrixWorldInverse),d.multiply(i.matrixWorld)}(n),S(n),function(t,e,n){i.visible=!1;var r=t.getRenderTarget(),s=t.xr.enabled,o=t.shadowMap.autoUpdate;t.xr.enabled=!1,t.shadowMap.autoUpdate=!1,t.setRenderTarget(f),!1===t.autoClear&&t.clear(),t.render(e,c),t.xr.enabled=s,t.shadowMap.autoUpdate=o,t.setRenderTarget(r);var a=n.viewport;void 0!==a&&t.state.viewport(a),i.visible=!0}(t,e,n))},this.getRenderTarget=function(){return f}};s.prototype=Object.create(n.Mesh.prototype),s.prototype.constructor=s,s.RefractorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec4 vUv;","void main() {","\tvUv = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec4 vUv;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );","}","void main() {","\tvec4 base = texture2DProj( tDiffuse, vUv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};var o=function(t,e){n.Mesh.call(this,t),this.type="Water";var i=this,a=void 0!==(e=e||{}).color?new n.Color(e.color):new n.Color(16777215),h=e.textureWidth||512,l=e.textureHeight||512,c=e.clipBias||0,u=e.flowDirection||new n.Vector2(1,0),d=e.flowSpeed||.03,p=e.reflectivity||.02,f=e.scale||1,m=e.shader||o.WaterShader,g=void 0!==e.encoding?e.encoding:n.LinearEncoding,v=new n.TextureLoader,y=e.flowMap||void 0,x=e.normalMap0||v.load("textures/water/Water_1_M_Normal.jpg"),b=e.normalMap1||v.load("textures/water/Water_2_M_Normal.jpg"),w=new n.Matrix4,T=new n.Clock;if(void 0!==r)if(void 0!==s){var _=new r(t,{textureWidth:h,textureHeight:l,clipBias:c,encoding:g}),E=new s(t,{textureWidth:h,textureHeight:l,clipBias:c,encoding:g});_.matrixAutoUpdate=!1,E.matrixAutoUpdate=!1,this.material=new n.ShaderMaterial({uniforms:n.UniformsUtils.merge([n.UniformsLib.fog,m.uniforms]),vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,transparent:!0,fog:!0}),void 0!==y?(this.material.defines.USE_FLOWMAP="",this.material.uniforms.tFlowMap={type:"t",value:y}):this.material.uniforms.flowDirection={type:"v2",value:u},x.wrapS=x.wrapT=n.RepeatWrapping,b.wrapS=b.wrapT=n.RepeatWrapping,this.material.uniforms.tReflectionMap.value=_.getRenderTarget().texture,this.material.uniforms.tRefractionMap.value=E.getRenderTarget().texture,this.material.uniforms.tNormalMap0.value=x,this.material.uniforms.tNormalMap1.value=b,this.material.uniforms.color.value=a,this.material.uniforms.reflectivity.value=p,this.material.uniforms.textureMatrix.value=w,this.material.uniforms.config.value.x=0,this.material.uniforms.config.value.y=.075,this.material.uniforms.config.value.z=.075,this.material.uniforms.config.value.w=f,this.onBeforeRender=function(t,e,n){var r,s;!function(t){w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(t.projectionMatrix),w.multiply(t.matrixWorldInverse),w.multiply(i.matrixWorld)}(n),r=T.getDelta(),(s=i.material.uniforms.config).value.x+=d*r,s.value.y=s.value.x+.075,s.value.x>=.15?(s.value.x=0,s.value.y=.075):s.value.y>=.15&&(s.value.y=s.value.y-.15),i.visible=!1,_.matrixWorld.copy(i.matrixWorld),E.matrixWorld.copy(i.matrixWorld),_.onBeforeRender(t,e,n),E.onBeforeRender(t,e,n),i.visible=!0}}else console.error("THREE.Water: Required component Refractor not found.");else console.error("THREE.Water: Required component Reflector not found.")};o.prototype=Object.create(n.Mesh.prototype),o.prototype.constructor=o,o.WaterShader={uniforms:{color:{type:"c",value:null},reflectivity:{type:"f",value:0},tReflectionMap:{type:"t",value:null},tRefractionMap:{type:"t",value:null},tNormalMap0:{type:"t",value:null},tNormalMap1:{type:"t",value:null},textureMatrix:{type:"m4",value:null},config:{type:"v4",value:new n.Vector4}},vertexShader:["#include <common>","#include <fog_pars_vertex>","#include <logdepthbuf_pars_vertex>","uniform mat4 textureMatrix;","varying vec4 vCoord;","varying vec2 vUv;","varying vec3 vToEye;","void main() {","\tvUv = uv;","\tvCoord = textureMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvToEye = cameraPosition - worldPosition.xyz;","\tvec4 mvPosition = viewMatrix * worldPosition;","\tgl_Position = projectionMatrix * mvPosition;","\t#include <logdepthbuf_vertex>","\t#include <fog_vertex>","}"].join("\n"),fragmentShader:["#include <common>","#include <fog_pars_fragment>","#include <logdepthbuf_pars_fragment>","uniform sampler2D tReflectionMap;","uniform sampler2D tRefractionMap;","uniform sampler2D tNormalMap0;","uniform sampler2D tNormalMap1;","#ifdef USE_FLOWMAP","\tuniform sampler2D tFlowMap;","#else","\tuniform vec2 flowDirection;","#endif","uniform vec3 color;","uniform float reflectivity;","uniform vec4 config;","varying vec4 vCoord;","varying vec2 vUv;","varying vec3 vToEye;","void main() {","\t#include <logdepthbuf_fragment>","\tfloat flowMapOffset0 = config.x;","\tfloat flowMapOffset1 = config.y;","\tfloat halfCycle = config.z;","\tfloat scale = config.w;","\tvec3 toEye = normalize( vToEye );","\tvec2 flow;","\t#ifdef USE_FLOWMAP","\t\tflow = texture2D( tFlowMap, vUv ).rg * 2.0 - 1.0;","\t#else","\t\tflow = flowDirection;","\t#endif","\tflow.x *= - 1.0;","\tvec4 normalColor0 = texture2D( tNormalMap0, ( vUv * scale ) + flow * flowMapOffset0 );","\tvec4 normalColor1 = texture2D( tNormalMap1, ( vUv * scale ) + flow * flowMapOffset1 );","\tfloat flowLerp = abs( halfCycle - flowMapOffset0 ) / halfCycle;","\tvec4 normalColor = mix( normalColor0, normalColor1, flowLerp );","\tvec3 normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );","\tfloat theta = max( dot( toEye, normal ), 0.0 );","\tfloat reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 5.0 );","\tvec3 coord = vCoord.xyz / vCoord.w;","\tvec2 uv = coord.xy + coord.z * normal.xz * 0.05;","\tvec4 reflectColor = texture2D( tReflectionMap, vec2( 1.0 - uv.x, uv.y ) );","\tvec4 refractColor = texture2D( tRefractionMap, uv );","\tgl_FragColor = vec4( color, 1.0 ) * mix( refractColor, reflectColor, reflectance );","\t#include <tonemapping_fragment>","\t#include <encodings_fragment>","\t#include <fog_fragment>","}"].join("\n")}},function(t,e,i){"use strict";i.r(e),i.d(e,"EffectComposer",(function(){return l})),i.d(e,"Pass",(function(){return p}));var n=i(0),r={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")},s=i(8),o=i(3),a=function(t,e){o.a.call(this),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1};a.prototype=Object.assign(Object.create(o.a.prototype),{constructor:a,render:function(t,e,i){var n,r,s=t.getContext(),o=t.state;o.buffers.color.setMask(!1),o.buffers.depth.setMask(!1),o.buffers.color.setLocked(!0),o.buffers.depth.setLocked(!0),this.inverse?(n=0,r=1):(n=1,r=0),o.buffers.stencil.setTest(!0),o.buffers.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.buffers.stencil.setFunc(s.ALWAYS,n,4294967295),o.buffers.stencil.setClear(r),o.buffers.stencil.setLocked(!0),t.setRenderTarget(i),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),o.buffers.color.setLocked(!1),o.buffers.depth.setLocked(!1),o.buffers.stencil.setLocked(!1),o.buffers.stencil.setFunc(s.EQUAL,1,4294967295),o.buffers.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.buffers.stencil.setLocked(!0)}});var h=function(){o.a.call(this),this.needsSwap=!1};h.prototype=Object.create(o.a.prototype),Object.assign(h.prototype,{render:function(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}});var l=function(t,e){if(this.renderer=t,void 0===e){var i={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat},o=t.getSize(new n.Vector2);this._pixelRatio=t.getPixelRatio(),this._width=o.width,this._height=o.height,(e=new n.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,i)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===r&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===s.ShaderPass&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new s.ShaderPass(r),this.clock=new n.Clock};Object.assign(l.prototype,{swapBuffers:function(){var t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t},addPass:function(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},insertPass:function(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},removePass:function(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)},isLastEnabledPass:function(t){for(var e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return!1;return!0},render:function(t){void 0===t&&(t=this.clock.getDelta());var e,i,n=this.renderer.getRenderTarget(),r=!1,s=this.passes.length;for(i=0;i<s;i++)if(!1!==(e=this.passes[i]).enabled){if(e.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),e.render(this.renderer,this.writeBuffer,this.readBuffer,t,r),e.needsSwap){if(r){var o=this.renderer.getContext(),l=this.renderer.state.buffers.stencil;l.setFunc(o.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),l.setFunc(o.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==a&&(e instanceof a?r=!0:e instanceof h&&(r=!1))}this.renderer.setRenderTarget(n)},reset:function(t){if(void 0===t){var e=this.renderer.getSize(new n.Vector2);this._pixelRatio=this.renderer.getPixelRatio(),this._width=e.width,this._height=e.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(t,e){this._width=t,this._height=e;var i=this._width*this._pixelRatio,n=this._height*this._pixelRatio;this.renderTarget1.setSize(i,n),this.renderTarget2.setSize(i,n);for(var r=0;r<this.passes.length;r++)this.passes[r].setSize(i,n)},setPixelRatio:function(t){this._pixelRatio=t,this.setSize(this._width,this._height)}});var c,u,d,p=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(p.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),p.FullScreenQuad=(c=new n.OrthographicCamera(-1,1,1,-1,0,1),u=new n.PlaneGeometry(2,2),d=function(t){this._mesh=new n.Mesh(u,t)},Object.defineProperty(d.prototype,"material",{get:function(){return this._mesh.material},set:function(t){this._mesh.material=t}}),Object.assign(d.prototype,{dispose:function(){this._mesh.geometry.dispose()},render:function(t){t.render(this._mesh,c)}}),d)},function(t,e,i){"use strict";i.r(e),i.d(e,"XRControllerModelFactory",(function(){return f}));var n=i(0),r=i(12);const s={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function o(t){const e=await fetch(t);if(e.ok)return e.json();throw new Error(e.statusText)}async function a(t,e,i=null,n=!0){if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No basePath supplied");const r=await async function(t){if(!t)throw new Error("No basePath supplied");return await o(t+"/profilesList.json")}(e);let s;if(t.profiles.some(t=>{const i=r[t];return i&&(s={profileId:t,profilePath:`${e}/${i.path}`,deprecated:!!i.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");const t=r[i];if(!t)throw new Error(`No matching profile name found and default profile "${i}" missing.`);s={profileId:i,profilePath:`${e}/${t.path}`,deprecated:!!t.deprecated}}const a=await o(s.profilePath);let h;if(n){let e;if(e="any"===t.handedness?a.layouts[Object.keys(a.layouts)[0]]:a.layouts[t.handedness],!e)throw new Error(`No matching handedness, ${t.handedness}, in profile ${s.profileId}`);e.assetPath&&(h=s.profilePath.replace("profile.json",e.assetPath))}return{profile:a,assetPath:h}}const h={xAxis:0,yAxis:0,button:0,state:s.ComponentState.DEFAULT};class l{constructor(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===s.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(h)}updateFromComponent({xAxis:t,yAxis:e,button:i,state:n}){const{normalizedXAxis:r,normalizedYAxis:o}=function(t=0,e=0){let i=t,n=e;if(Math.sqrt(t*t+e*e)>1){const r=Math.atan2(e,t);i=Math.cos(r),n=Math.sin(r)}return{normalizedXAxis:.5*i+.5,normalizedYAxis:.5*n+.5}}(t,e);switch(this.componentProperty){case s.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?r:.5;break;case s.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case s.ComponentProperty.BUTTON:this.value=this.states.includes(n)?i:0;break;case s.ComponentProperty.STATE:this.valueNodeProperty===s.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty "+this.componentProperty)}}}class c{constructor(t,e){if(!(t&&e&&e.visualResponses&&e.gamepadIndices&&0!==Object.keys(e.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(t=>{const i=new l(e.visualResponses[t]);this.visualResponses[t]=i}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:s.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(t){if(this.values.state=s.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&t.buttons.length>this.gamepadIndices.button){const e=t.buttons[this.gamepadIndices.button];this.values.button=e.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,e.pressed||1===this.values.button?this.values.state=s.ComponentState.PRESSED:(e.touched||this.values.button>s.ButtonTouchThreshold)&&(this.values.state=s.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===s.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>s.AxisTouchThreshold&&(this.values.state=s.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===s.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>s.AxisTouchThreshold&&(this.values.state=s.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class u{constructor(t,e,i){if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=i,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(t=>{const e=this.layoutDescription.components[t];this.components[t]=new c(t,e)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const t=[];return Object.values(this.components).forEach(e=>{t.push(e.data)}),t}updateFromGamepad(){Object.values(this.components).forEach(t=>{t.updateFromGamepad(this.xrInputSource.gamepad)})}}function d(){n.Object3D.call(this),this.motionController=null,this.envMap=null}function p(t,e){!function(t,e){Object.values(t.components).forEach(t=>{const{type:i,touchPointNodeName:r,visualResponses:o}=t;if(i===s.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(r),t.touchPointNode){const e=new n.SphereGeometry(.001),i=new n.MeshBasicMaterial({color:255}),r=new n.Mesh(e,i);t.touchPointNode.add(r)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(o).forEach(t=>{const{valueNodeName:i,minNodeName:n,maxNodeName:r,valueNodeProperty:o}=t;if(o===s.VisualResponseProperty.TRANSFORM){if(t.minNode=e.getObjectByName(n),t.maxNode=e.getObjectByName(r),!t.minNode)return void console.warn(`Could not find ${n} in the model`);if(!t.maxNode)return void console.warn(`Could not find ${r} in the model`)}t.valueNode=e.getObjectByName(i),t.valueNode||console.warn(`Could not find ${i} in the model`)})})}(t.motionController,e),t.envMap&&e.traverse(e=>{e.isMesh&&(e.material.envMap=t.envMap,e.material.needsUpdate=!0)}),t.add(e)}d.prototype=Object.assign(Object.create(n.Object3D.prototype),{constructor:d,setEnvironmentMap:function(t){return this.envMap==t||(this.envMap=t,this.traverse(t=>{t.isMesh&&(t.material.envMap=this.envMap,t.material.needsUpdate=!0)})),this},updateMatrixWorld:function(t){n.Object3D.prototype.updateMatrixWorld.call(this,t),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(t=>{Object.values(t.visualResponses).forEach(t=>{const{valueNode:e,minNode:i,maxNode:r,value:o,valueNodeProperty:a}=t;e&&(a===s.VisualResponseProperty.VISIBILITY?e.visible=o:a===s.VisualResponseProperty.TRANSFORM&&(n.Quaternion.slerp(i.quaternion,r.quaternion,e.quaternion,o),e.position.lerpVectors(i.position,r.position,o)))})}))}});var f=function(){function t(t=null){this.gltfLoader=t,this.path="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",this._assetCache={},this.gltfLoader||(this.gltfLoader=new r.GLTFLoader)}return t.prototype={constructor:t,createControllerModel:function(t){const e=new d;let i=null;return t.addEventListener("connected",t=>{const n=t.data;"tracked-pointer"===n.targetRayMode&&n.gamepad&&a(n,this.path,"generic-trigger").then(({profile:t,assetPath:r})=>{e.motionController=new u(n,t,r);const s=this._assetCache[e.motionController.assetUrl];if(s)i=s.scene.clone(),p(e,i);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(e.motionController.assetUrl,t=>{this._assetCache[e.motionController.assetUrl]=t,i=t.scene.clone(),p(e,i)},null,()=>{throw new Error(`Asset ${e.motionController.assetUrl} missing or malformed.`)})}}).catch(t=>{console.warn(t)})}),t.addEventListener("disconnected",()=>{e.motionController=null,e.remove(i),i=null}),e}},t}()},function(t,e,i){"use strict";i.r(e),i.d(e,"AnimationAction",(function(){return n}));class n{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,s=r.length,o=new Array(s),a={endingStart:2400,endingEnd:2400};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,s=i/n;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,h=o.sampleValues;return a[0]=r,a[1]=r+i,h[0]=t/s,h[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case 2501:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(o);break;case 2500:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const s=2202===i;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=e,o[1]=r+t,a[1]=i,this}}},function(t,e,i){"use strict";i.r(e),i.d(e,"ConvexGeometry",(function(){return s}));var n=i(0),r=function(){var t,e,i,r,s=new n.Vector3;function o(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new c,this.unassigned=new c,this.vertices=[]}function a(){this.normal=new n.Vector3,this.midpoint=new n.Vector3,this.area=0,this.constant=0,this.outside=null,this.mark=0,this.edge=null}function h(t,e){this.vertex=t,this.prev=null,this.next=null,this.twin=null,this.face=e}function l(t){this.point=t,this.prev=null,this.next=null,this.face=null}function c(){this.head=null,this.tail=null}return Object.assign(o.prototype,{setFromPoints:function(t){!0!==Array.isArray(t)&&console.error("THREE.ConvexHull: Points parameter is not an array."),t.length<4&&console.error("THREE.ConvexHull: The algorithm needs at least four points."),this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.vertices.push(new l(t[e]));return this.compute(),this},setFromObject:function(t){var e=[];return t.updateMatrixWorld(!0),t.traverse((function(t){var i,r,s,o=t.geometry;if(void 0!==o){if(o.isGeometry)return void console.error("THREE.ConvexHull no longer supports Geometry. Use THREE.BufferGeometry instead.");if(o.isBufferGeometry){var a=o.attributes.position;if(void 0!==a)for(i=0,r=a.count;i<r;i++)(s=new n.Vector3).fromBufferAttribute(a,i).applyMatrix4(t.matrixWorld),e.push(s)}}})),this.setFromPoints(e)},containsPoint:function(t){for(var e=this.faces,i=0,n=e.length;i<n;i++){if(e[i].distanceToPoint(t)>this.tolerance)return!1}return!0},intersectRay:function(t,e){for(var i=this.faces,n=-1/0,r=1/0,s=0,o=i.length;s<o;s++){var a=i[s],h=a.distanceToPoint(t.origin),l=a.normal.dot(t.direction);if(h>0&&l>=0)return null;var c=0!==l?-h/l:0;if(!(c<=0)&&(l>0?r=Math.min(c,r):n=Math.max(c,n),n>r))return null}return n!==-1/0?t.at(n,e):t.at(r,e),e},intersectsRay:function(t){return null!==this.intersectRay(t,s)},makeEmpty:function(){return this.faces=[],this.vertices=[],this},addVertexToFace:function(t,e){return t.face=e,null===e.outside?this.assigned.append(t):this.assigned.insertBefore(e.outside,t),e.outside=t,this},removeVertexFromFace:function(t,e){return t===e.outside&&(null!==t.next&&t.next.face===e?e.outside=t.next:e.outside=null),this.assigned.remove(t),this},removeAllVerticesFromFace:function(t){if(null!==t.outside){for(var e=t.outside,i=t.outside;null!==i.next&&i.next.face===t;)i=i.next;return this.assigned.removeSubList(e,i),e.prev=i.next=null,t.outside=null,e}},deleteFaceVertices:function(t,e){var i=this.removeAllVerticesFromFace(t);if(void 0!==i)if(void 0===e)this.unassigned.appendChain(i);else{var n=i;do{var r=n.next;e.distanceToPoint(n.point)>this.tolerance?this.addVertexToFace(n,e):this.unassigned.append(n),n=r}while(null!==n)}return this},resolveUnassignedPoints:function(t){if(!1===this.unassigned.isEmpty()){var e=this.unassigned.first();do{for(var i=e.next,n=this.tolerance,r=null,s=0;s<t.length;s++){var o=t[s];if(0===o.mark){var a=o.distanceToPoint(e.point);if(a>n&&(n=a,r=o),n>1e3*this.tolerance)break}}null!==r&&this.addVertexToFace(e,r),e=i}while(null!==e)}return this},computeExtremes:function(){var t,e,i,r=new n.Vector3,s=new n.Vector3,o=[],a=[];for(t=0;t<3;t++)o[t]=a[t]=this.vertices[0];for(r.copy(this.vertices[0].point),s.copy(this.vertices[0].point),t=0,e=this.vertices.length;t<e;t++){var h=this.vertices[t],l=h.point;for(i=0;i<3;i++)l.getComponent(i)<r.getComponent(i)&&(r.setComponent(i,l.getComponent(i)),o[i]=h);for(i=0;i<3;i++)l.getComponent(i)>s.getComponent(i)&&(s.setComponent(i,l.getComponent(i)),a[i]=h)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(r.x),Math.abs(s.x))+Math.max(Math.abs(r.y),Math.abs(s.y))+Math.max(Math.abs(r.z),Math.abs(s.z))),{min:o,max:a}},computeInitialHull:function(){void 0===t&&(t=new n.Line3,e=new n.Plane,i=new n.Vector3);var r,s,o,h,l,c,u,d,p,f=this.vertices,m=this.computeExtremes(),g=m.min,v=m.max,y=0,x=0;for(c=0;c<3;c++)(p=v[c].point.getComponent(c)-g[c].point.getComponent(c))>y&&(y=p,x=c);for(s=g[x],o=v[x],y=0,t.set(s.point,o.point),c=0,u=this.vertices.length;c<u;c++)(r=f[c])!==s&&r!==o&&(t.closestPointToPoint(r.point,!0,i),(p=i.distanceToSquared(r.point))>y&&(y=p,h=r));for(y=-1,e.setFromCoplanarPoints(s.point,o.point,h.point),c=0,u=this.vertices.length;c<u;c++)(r=f[c])!==s&&r!==o&&r!==h&&(p=Math.abs(e.distanceToPoint(r.point)))>y&&(y=p,l=r);var b=[];if(e.distanceToPoint(l.point)<0)for(b.push(a.create(s,o,h),a.create(l,o,s),a.create(l,h,o),a.create(l,s,h)),c=0;c<3;c++)d=(c+1)%3,b[c+1].getEdge(2).setTwin(b[0].getEdge(d)),b[c+1].getEdge(1).setTwin(b[d+1].getEdge(0));else for(b.push(a.create(s,h,o),a.create(l,s,o),a.create(l,o,h),a.create(l,h,s)),c=0;c<3;c++)d=(c+1)%3,b[c+1].getEdge(2).setTwin(b[0].getEdge((3-c)%3)),b[c+1].getEdge(0).setTwin(b[d+1].getEdge(1));for(c=0;c<4;c++)this.faces.push(b[c]);for(c=0,u=f.length;c<u;c++)if((r=f[c])!==s&&r!==o&&r!==h&&r!==l){y=this.tolerance;var w=null;for(d=0;d<4;d++)(p=this.faces[d].distanceToPoint(r.point))>y&&(y=p,w=this.faces[d]);null!==w&&this.addVertexToFace(r,w)}return this},reindexFaces:function(){for(var t=[],e=0;e<this.faces.length;e++){var i=this.faces[e];0===i.mark&&t.push(i)}return this.faces=t,this},nextVertexToAdd:function(){if(!1===this.assigned.isEmpty()){var t,e=0,i=this.assigned.first().face,n=i.outside;do{var r=i.distanceToPoint(n.point);r>e&&(e=r,t=n),n=n.next}while(null!==n&&n.face===i);return t}},computeHorizon:function(t,e,i,n){var r;this.deleteFaceVertices(i),i.mark=1,r=null===e?e=i.getEdge(0):e.next;do{var s=r.twin,o=s.face;0===o.mark&&(o.distanceToPoint(t)>this.tolerance?this.computeHorizon(t,s,o,n):n.push(r)),r=r.next}while(r!==e);return this},addAdjoiningFace:function(t,e){var i=a.create(t,e.tail(),e.head());return this.faces.push(i),i.getEdge(-1).setTwin(e.twin),i.getEdge(0)},addNewFaces:function(t,e){this.newFaces=[];for(var i=null,n=null,r=0;r<e.length;r++){var s=e[r],o=this.addAdjoiningFace(t,s);null===i?i=o:o.next.setTwin(n),this.newFaces.push(o.face),n=o}return i.next.setTwin(n),this},addVertexToHull:function(t){var e=[];return this.unassigned.clear(),this.removeVertexFromFace(t,t.face),this.computeHorizon(t.point,null,t.face,e),this.addNewFaces(t,e),this.resolveUnassignedPoints(this.newFaces),this},cleanup:function(){return this.assigned.clear(),this.unassigned.clear(),this.newFaces=[],this},compute:function(){var t;for(this.computeInitialHull();void 0!==(t=this.nextVertexToAdd());)this.addVertexToHull(t);return this.reindexFaces(),this.cleanup(),this}}),Object.assign(a,{create:function(t,e,i){var n=new a,r=new h(t,n),s=new h(e,n),o=new h(i,n);return r.next=o.prev=s,s.next=r.prev=o,o.next=s.prev=r,n.edge=r,n.compute()}}),Object.assign(a.prototype,{getEdge:function(t){for(var e=this.edge;t>0;)e=e.next,t--;for(;t<0;)e=e.prev,t++;return e},compute:function(){void 0===r&&(r=new n.Triangle);var t=this.edge.tail(),e=this.edge.head(),i=this.edge.next.head();return r.set(t.point,e.point,i.point),r.getNormal(this.normal),r.getMidpoint(this.midpoint),this.area=r.getArea(),this.constant=this.normal.dot(this.midpoint),this},distanceToPoint:function(t){return this.normal.dot(t)-this.constant}}),Object.assign(h.prototype,{head:function(){return this.vertex},tail:function(){return this.prev?this.prev.vertex:null},length:function(){var t=this.head(),e=this.tail();return null!==e?e.point.distanceTo(t.point):-1},lengthSquared:function(){var t=this.head(),e=this.tail();return null!==e?e.point.distanceToSquared(t.point):-1},setTwin:function(t){return this.twin=t,t.twin=this,this}}),Object.assign(c.prototype,{first:function(){return this.head},last:function(){return this.tail},clear:function(){return this.head=this.tail=null,this},insertBefore:function(t,e){return e.prev=t.prev,e.next=t,null===e.prev?this.head=e:e.prev.next=e,t.prev=e,this},insertAfter:function(t,e){return e.prev=t,e.next=t.next,null===e.next?this.tail=e:e.next.prev=e,t.next=e,this},append:function(t){return null===this.head?this.head=t:this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t,this},appendChain:function(t){for(null===this.head?this.head=t:this.tail.next=t,t.prev=this.tail;null!==t.next;)t=t.next;return this.tail=t,this},remove:function(t){return null===t.prev?this.head=t.next:t.prev.next=t.next,null===t.next?this.tail=t.prev:t.next.prev=t.prev,this},removeSubList:function(t,e){return null===t.prev?this.head=e.next:t.prev.next=e.next,null===e.next?this.tail=t.prev:e.next.prev=t.prev,this},isEmpty:function(){return null===this.head}}),o}(),s=function(t){n.BufferGeometry.call(this);var e=[],i=[];void 0===r&&console.error("THREE.ConvexBufferGeometry: ConvexBufferGeometry relies on ConvexHull");for(var s=(new r).setFromPoints(t).faces,o=0;o<s.length;o++){var a=s[o],h=a.edge;do{var l=h.head().point;e.push(l.x,l.y,l.z),i.push(a.normal.x,a.normal.y,a.normal.z),h=h.next}while(h!==a.edge)}this.setAttribute("position",new n.Float32BufferAttribute(e,3)),this.setAttribute("normal",new n.Float32BufferAttribute(i,3))};s.prototype=Object.create(n.BufferGeometry.prototype),s.prototype.constructor=s},function(t,e,i){"use strict";i.r(e),i.d(e,"GlitchPass",(function(){return o}));var n=i(0),r=i(3),s={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","\treturn fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","\tif(byp<1) {","\t\tvec2 p = vUv;","\t\tfloat xs = floor(gl_FragCoord.x / 0.5);","\t\tfloat ys = floor(gl_FragCoord.y / 0.5);","\t\tvec4 normal = texture2D (tDisp, p*seed*seed);","\t\tif(p.y<distortion_x+col_s && p.y>distortion_x-col_s*seed) {","\t\t\tif(seed_x>0.){","\t\t\t\tp.y = 1. - (p.y + distortion_y);","\t\t\t}","\t\t\telse {","\t\t\t\tp.y = distortion_y;","\t\t\t}","\t\t}","\t\tif(p.x<distortion_y+col_s && p.x>distortion_y-col_s*seed) {","\t\t\tif(seed_y>0.){","\t\t\t\tp.x=distortion_x;","\t\t\t}","\t\t\telse {","\t\t\t\tp.x = 1. - (p.x + distortion_x);","\t\t\t}","\t\t}","\t\tp.x+=normal.x*seed_x*(seed/5.);","\t\tp.y+=normal.y*seed_y*(seed/5.);","\t\tvec2 offset = amount * vec2( cos(angle), sin(angle));","\t\tvec4 cr = texture2D(tDiffuse, p + offset);","\t\tvec4 cga = texture2D(tDiffuse, p);","\t\tvec4 cb = texture2D(tDiffuse, p - offset);","\t\tgl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","\t\tvec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","\t\tgl_FragColor = gl_FragColor+ snow;","\t}","\telse {","\t\tgl_FragColor=texture2D (tDiffuse, vUv);","\t}","}"].join("\n")},o=function(t){r.a.call(this),void 0===s&&console.error("THREE.GlitchPass relies on DigitalGlitch");var e=s;this.uniforms=n.UniformsUtils.clone(e.uniforms),null==t&&(t=64),this.uniforms.tDisp.value=this.generateHeightmap(t),this.material=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.fsQuad=new r.a.FullScreenQuad(this.material),this.goWild=!1,this.curF=0,this.generateTrigger()};o.prototype=Object.assign(Object.create(r.a.prototype),{constructor:o,render:function(t,e,i){this.uniforms.tDiffuse.value=i.texture,this.uniforms.seed.value=Math.random(),this.uniforms.byp.value=0,this.curF%this.randX==0||1==this.goWild?(this.uniforms.amount.value=Math.random()/30,this.uniforms.angle.value=n.MathUtils.randFloat(-Math.PI,Math.PI),this.uniforms.seed_x.value=n.MathUtils.randFloat(-1,1),this.uniforms.seed_y.value=n.MathUtils.randFloat(-1,1),this.uniforms.distortion_x.value=n.MathUtils.randFloat(0,1),this.uniforms.distortion_y.value=n.MathUtils.randFloat(0,1),this.curF=0,this.generateTrigger()):this.curF%this.randX<this.randX/5?(this.uniforms.amount.value=Math.random()/90,this.uniforms.angle.value=n.MathUtils.randFloat(-Math.PI,Math.PI),this.uniforms.distortion_x.value=n.MathUtils.randFloat(0,1),this.uniforms.distortion_y.value=n.MathUtils.randFloat(0,1),this.uniforms.seed_x.value=n.MathUtils.randFloat(-.3,.3),this.uniforms.seed_y.value=n.MathUtils.randFloat(-.3,.3)):0==this.goWild&&(this.uniforms.byp.value=1),this.curF++,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(),this.fsQuad.render(t))},generateTrigger:function(){this.randX=n.MathUtils.randInt(120,240)},generateHeightmap:function(t){for(var e=new Float32Array(t*t*3),i=t*t,r=0;r<i;r++){var s=n.MathUtils.randFloat(0,1);e[3*r+0]=s,e[3*r+1]=s,e[3*r+2]=s}return new n.DataTexture(e,t,t,n.RGBFormat,n.FloatType)}})}]]); |