!function(t){var e=this.webpackHotUpdate;this.webpackHotUpdate=function(t,n){!function(t,e){if(!x[t]||!_[t])return;for(var n in _[t]=!1,e)Object.prototype.hasOwnProperty.call(e,n)&&(p[n]=e[n]);0==--g&&0===v&&E()}(t,n),e&&e(t,n)};var n,i=!0,r="7f46b82413e0a1c44870",o=1e4,a={},s=[],h=[];function u(t){var e=T[t];if(!e)return C;var i=function(i){return e.hot.active?(T[i]?-1===T[i].parents.indexOf(t)&&T[i].parents.push(t):(s=[t],n=i),-1===e.children.indexOf(i)&&e.children.push(i)):(console.warn("[HMR] unexpected require("+i+") from disposed module "+t),s=[]),C(i)},r=function(t){return{configurable:!0,enumerable:!0,get:function(){return C[t]},set:function(e){C[t]=e}}};for(var o in C)Object.prototype.hasOwnProperty.call(C,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(i,o,r(o));return i.e=function(t){return"ready"===l&&f("prepare"),v++,C.e(t).then(e,function(t){throw e(),t});function e(){v--,"prepare"===l&&(y[t]||M(t),0===v&&0===g&&E())}},i.t=function(t,e){return 1&e&&(t=i(t)),C.t(t,-2&e)},i}var c=[],l="idle";function f(t){l=t;for(var e=0;e0;){var r=i.pop(),o=r.id,a=r.chain;if((h=T[o])&&!h.hot._selfAccepted){if(h.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:o};if(h.hot._main)return{type:"unaccepted",chain:a,moduleId:o};for(var s=0;s ")),M.type){case"self-declined":e.onDeclined&&e.onDeclined(M),e.ignoreDeclined||(E=new Error("Aborted because of self decline: "+M.moduleId+A));break;case"declined":e.onDeclined&&e.onDeclined(M),e.ignoreDeclined||(E=new Error("Aborted because of declined dependency: "+M.moduleId+" in "+M.parentId+A));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(M),e.ignoreUnaccepted||(E=new Error("Aborted because "+u+" is not accepted"+A));break;case"accepted":e.onAccepted&&e.onAccepted(M),S=!0;break;case"disposed":e.onDisposed&&e.onDisposed(M),P=!0;break;default:throw new Error("Unexception type "+M.type)}if(E)return f("abort"),Promise.reject(E);if(S)for(u in y[u]=p[u],d(v,M.outdatedModules),M.outdatedDependencies)Object.prototype.hasOwnProperty.call(M.outdatedDependencies,u)&&(g[u]||(g[u]=[]),d(g[u],M.outdatedDependencies[u]));P&&(d(v,[M.moduleId]),y[u]=_)}var L,R=[];for(i=0;i0;)if(u=D.pop(),h=T[u]){var k={},N=h.hot._disposeHandlers;for(o=0;o=0&&z.parents.splice(L,1))}}for(u in g)if(Object.prototype.hasOwnProperty.call(g,u)&&(h=T[u]))for(I=g[u],o=0;o=0&&h.children.splice(L,1);for(u in f("apply"),r=m,y)Object.prototype.hasOwnProperty.call(y,u)&&(t[u]=y[u]);var F=null;for(u in g)if(Object.prototype.hasOwnProperty.call(g,u)&&(h=T[u])){I=g[u];var B=[];for(i=0;i=0&&e._disposeHandlers.splice(n,1)},check:b,apply:S,status:function(t){if(!t)return l;c.push(t)},addStatusHandler:function(t){c.push(t)},removeStatusHandler:function(t){var e=c.indexOf(t);e>=0&&c.splice(e,1)},data:a[t]};return n=void 0,e}(e),parents:(h=s,s=[],h),children:[]};return t[e].call(i.exports,i,i.exports,u(e)),i.l=!0,i.exports}C.m=t,C.c=T,C.d=function(t,e,n){C.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},C.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},C.t=function(t,e){if(1&e&&(t=C(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(C.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)C.d(n,i,function(e){return t[e]}.bind(null,i));return n},C.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return C.d(e,"a",e),e},C.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},C.p="",C.h=function(){return r},u(136)(C.s=136)}([function(t,e,n){var i=n(2),r=n(20),o=n(13),a=n(14),s=n(21),h=function(t,e,n){var u,c,l,f,d=t&h.F,p=t&h.G,m=t&h.S,g=t&h.P,v=t&h.B,y=p?i:m?i[e]||(i[e]={}):(i[e]||{}).prototype,_=p?r:r[e]||(r[e]={}),x=_.prototype||(_.prototype={});for(u in p&&(n=e),n)l=((c=!d&&y&&void 0!==y[u])?y:n)[u],f=v&&c?s(l,i):g&&"function"==typeof l?s(Function.call,l):l,y&&a(y,u,l,t&h.U),_[u]!=l&&o(_,u,f),g&&x[u]!=l&&(x[u]=l)};i.core=r,h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,t.exports=h},function(t,e,n){var i=n(4);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var i=n(53)("wks"),r=n(36),o=n(2).Symbol,a="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=a&&o[t]||(a?o:r)("Symbol."+t))}).store=i},function(t,e,n){t.exports=!n(3)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(1),r=n(99),o=n(24),a=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(26),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},function(t,e,n){"use strict";function i(){}n.r(e),n.d(e,"WebGLRenderTargetCube",function(){return Xe}),n.d(e,"WebGLRenderTarget",function(){return qe}),n.d(e,"WebGLRenderer",function(){return ar}),n.d(e,"ShaderLib",function(){return an}),n.d(e,"UniformsLib",function(){return on}),n.d(e,"UniformsUtils",function(){return en}),n.d(e,"ShaderChunk",function(){return tn}),n.d(e,"FogExp2",function(){return sr}),n.d(e,"Fog",function(){return hr}),n.d(e,"Scene",function(){return ur}),n.d(e,"Sprite",function(){return dr}),n.d(e,"LOD",function(){return pr}),n.d(e,"SkinnedMesh",function(){return vr}),n.d(e,"Skeleton",function(){return mr}),n.d(e,"Bone",function(){return gr}),n.d(e,"Mesh",function(){return Hn}),n.d(e,"LineSegments",function(){return xr}),n.d(e,"LineLoop",function(){return wr}),n.d(e,"Line",function(){return _r}),n.d(e,"Points",function(){return Mr}),n.d(e,"Group",function(){return nr}),n.d(e,"VideoTexture",function(){return Er}),n.d(e,"DataTexture",function(){return Ye}),n.d(e,"CompressedTexture",function(){return Sr}),n.d(e,"CubeTexture",function(){return Vn}),n.d(e,"CanvasTexture",function(){return Tr}),n.d(e,"DepthTexture",function(){return Cr}),n.d(e,"Texture",function(){return We}),n.d(e,"CompressedTextureLoader",function(){return ia}),n.d(e,"DataTextureLoader",function(){return ra}),n.d(e,"CubeTextureLoader",function(){return aa}),n.d(e,"TextureLoader",function(){return sa}),n.d(e,"ObjectLoader",function(){return hs}),n.d(e,"MaterialLoader",function(){return ns}),n.d(e,"BufferGeometryLoader",function(){return is}),n.d(e,"DefaultLoadingManager",function(){return ta}),n.d(e,"LoadingManager",function(){return $o}),n.d(e,"JSONLoader",function(){return ss}),n.d(e,"ImageLoader",function(){return oa}),n.d(e,"ImageBitmapLoader",function(){return ds}),n.d(e,"FontLoader",function(){return vs}),n.d(e,"FileLoader",function(){return na}),n.d(e,"Loader",function(){return os}),n.d(e,"LoaderUtils",function(){return as}),n.d(e,"Cache",function(){return Qo}),n.d(e,"AudioLoader",function(){return _s}),n.d(e,"SpotLightShadow",function(){return Da}),n.d(e,"SpotLight",function(){return ka}),n.d(e,"PointLight",function(){return Na}),n.d(e,"RectAreaLight",function(){return ja}),n.d(e,"HemisphereLight",function(){return Oa}),n.d(e,"DirectionalLightShadow",function(){return za}),n.d(e,"DirectionalLight",function(){return Fa}),n.d(e,"AmbientLight",function(){return Ba}),n.d(e,"LightShadow",function(){return Ia}),n.d(e,"Light",function(){return Ra}),n.d(e,"StereoCamera",function(){return xs}),n.d(e,"PerspectiveCamera",function(){return ir}),n.d(e,"OrthographicCamera",function(){return pn}),n.d(e,"CubeCamera",function(){return ws}),n.d(e,"ArrayCamera",function(){return rr}),n.d(e,"Camera",function(){return dn}),n.d(e,"AudioListener",function(){return bs}),n.d(e,"PositionalAudio",function(){return Es}),n.d(e,"AudioContext",function(){return ys}),n.d(e,"AudioAnalyser",function(){return Ss}),n.d(e,"Audio",function(){return Ms}),n.d(e,"VectorKeyframeTrack",function(){return $a}),n.d(e,"StringKeyframeTrack",function(){return Qa}),n.d(e,"QuaternionKeyframeTrack",function(){return Ka}),n.d(e,"NumberKeyframeTrack",function(){return Ya}),n.d(e,"ColorKeyframeTrack",function(){return Xa}),n.d(e,"BooleanKeyframeTrack",function(){return qa}),n.d(e,"PropertyMixer",function(){return Ts}),n.d(e,"PropertyBinding",function(){return Ls}),n.d(e,"KeyframeTrack",function(){return Za}),n.d(e,"AnimationUtils",function(){return Ga}),n.d(e,"AnimationObjectGroup",function(){return Rs}),n.d(e,"AnimationMixer",function(){return Is}),n.d(e,"AnimationClip",function(){return ts}),n.d(e,"Uniform",function(){return Ds}),n.d(e,"InstancedBufferGeometry",function(){return ks}),n.d(e,"BufferGeometry",function(){return Rn}),n.d(e,"Geometry",function(){return vn}),n.d(e,"InterleavedBufferAttribute",function(){return lr}),n.d(e,"InstancedInterleavedBuffer",function(){return Ns}),n.d(e,"InterleavedBuffer",function(){return cr}),n.d(e,"InstancedBufferAttribute",function(){return zs}),n.d(e,"Face3",function(){return mn}),n.d(e,"Object3D",function(){return fn}),n.d(e,"Raycaster",function(){return Fs}),n.d(e,"Layers",function(){return cn}),n.d(e,"EventDispatcher",function(){return i}),n.d(e,"Clock",function(){return Gs}),n.d(e,"QuaternionLinearInterpolant",function(){return Ja}),n.d(e,"LinearInterpolant",function(){return Va}),n.d(e,"DiscreteInterpolant",function(){return Wa}),n.d(e,"CubicInterpolant",function(){return Ua}),n.d(e,"Interpolant",function(){return Ha}),n.d(e,"Triangle",function(){return Gn}),n.d(e,"Math",function(){return ze}),n.d(e,"Spherical",function(){return Hs}),n.d(e,"Cylindrical",function(){return Us}),n.d(e,"Plane",function(){return Qe}),n.d(e,"Frustum",function(){return $e}),n.d(e,"Sphere",function(){return Ke}),n.d(e,"Ray",function(){return jn}),n.d(e,"Matrix4",function(){return Be}),n.d(e,"Matrix3",function(){return He}),n.d(e,"Box3",function(){return Je}),n.d(e,"Box2",function(){return Vs}),n.d(e,"Line3",function(){return Ws}),n.d(e,"Euler",function(){return un}),n.d(e,"Vector4",function(){return Ze}),n.d(e,"Vector3",function(){return Ge}),n.d(e,"Vector2",function(){return Fe}),n.d(e,"Quaternion",function(){return je}),n.d(e,"Color",function(){return rn}),n.d(e,"ImmediateRenderObject",function(){return Zs}),n.d(e,"VertexNormalsHelper",function(){return qs}),n.d(e,"SpotLightHelper",function(){return Xs}),n.d(e,"SkeletonHelper",function(){return Ys}),n.d(e,"PointLightHelper",function(){return Js}),n.d(e,"RectAreaLightHelper",function(){return Ks}),n.d(e,"HemisphereLightHelper",function(){return Qs}),n.d(e,"GridHelper",function(){return $s}),n.d(e,"PolarGridHelper",function(){return th}),n.d(e,"FaceNormalsHelper",function(){return eh}),n.d(e,"DirectionalLightHelper",function(){return nh}),n.d(e,"CameraHelper",function(){return ih}),n.d(e,"BoxHelper",function(){return rh}),n.d(e,"Box3Helper",function(){return oh}),n.d(e,"PlaneHelper",function(){return ah}),n.d(e,"ArrowHelper",function(){return sh}),n.d(e,"AxesHelper",function(){return hh}),n.d(e,"Shape",function(){return La}),n.d(e,"Path",function(){return Aa}),n.d(e,"ShapePath",function(){return ps}),n.d(e,"Font",function(){return ms}),n.d(e,"CurvePath",function(){return Pa}),n.d(e,"Curve",function(){return ha}),n.d(e,"ImageUtils",function(){return Ue}),n.d(e,"ShapeUtils",function(){return go}),n.d(e,"WebGLUtils",function(){return er}),n.d(e,"WireframeGeometry",function(){return Pr}),n.d(e,"ParametricGeometry",function(){return Ar}),n.d(e,"ParametricBufferGeometry",function(){return Lr}),n.d(e,"TetrahedronGeometry",function(){return Ir}),n.d(e,"TetrahedronBufferGeometry",function(){return Dr}),n.d(e,"OctahedronGeometry",function(){return kr}),n.d(e,"OctahedronBufferGeometry",function(){return Nr}),n.d(e,"IcosahedronGeometry",function(){return zr}),n.d(e,"IcosahedronBufferGeometry",function(){return Fr}),n.d(e,"DodecahedronGeometry",function(){return Br}),n.d(e,"DodecahedronBufferGeometry",function(){return jr}),n.d(e,"PolyhedronGeometry",function(){return Rr}),n.d(e,"PolyhedronBufferGeometry",function(){return Or}),n.d(e,"TubeGeometry",function(){return Gr}),n.d(e,"TubeBufferGeometry",function(){return Hr}),n.d(e,"TorusKnotGeometry",function(){return Ur}),n.d(e,"TorusKnotBufferGeometry",function(){return Vr}),n.d(e,"TorusGeometry",function(){return Wr}),n.d(e,"TorusBufferGeometry",function(){return Zr}),n.d(e,"TextGeometry",function(){return Mo}),n.d(e,"TextBufferGeometry",function(){return Eo}),n.d(e,"SphereGeometry",function(){return So}),n.d(e,"SphereBufferGeometry",function(){return To}),n.d(e,"RingGeometry",function(){return Co}),n.d(e,"RingBufferGeometry",function(){return Po}),n.d(e,"PlaneGeometry",function(){return Dn}),n.d(e,"PlaneBufferGeometry",function(){return kn}),n.d(e,"LatheGeometry",function(){return Ao}),n.d(e,"LatheBufferGeometry",function(){return Lo}),n.d(e,"ShapeGeometry",function(){return Ro}),n.d(e,"ShapeBufferGeometry",function(){return Oo}),n.d(e,"ExtrudeGeometry",function(){return _o}),n.d(e,"ExtrudeBufferGeometry",function(){return xo}),n.d(e,"EdgesGeometry",function(){return Do}),n.d(e,"ConeGeometry",function(){return zo}),n.d(e,"ConeBufferGeometry",function(){return Fo}),n.d(e,"CylinderGeometry",function(){return ko}),n.d(e,"CylinderBufferGeometry",function(){return No}),n.d(e,"CircleGeometry",function(){return Bo}),n.d(e,"CircleBufferGeometry",function(){return jo}),n.d(e,"BoxGeometry",function(){return On}),n.d(e,"BoxBufferGeometry",function(){return In}),n.d(e,"ShadowMaterial",function(){return Ho}),n.d(e,"SpriteMaterial",function(){return fr}),n.d(e,"RawShaderMaterial",function(){return Uo}),n.d(e,"ShaderMaterial",function(){return Bn}),n.d(e,"PointsMaterial",function(){return br}),n.d(e,"MeshPhysicalMaterial",function(){return Wo}),n.d(e,"MeshStandardMaterial",function(){return Vo}),n.d(e,"MeshPhongMaterial",function(){return Zo}),n.d(e,"MeshToonMaterial",function(){return qo}),n.d(e,"MeshNormalMaterial",function(){return Xo}),n.d(e,"MeshLambertMaterial",function(){return Yo}),n.d(e,"MeshDepthMaterial",function(){return Ki}),n.d(e,"MeshDistanceMaterial",function(){return Qi}),n.d(e,"MeshBasicMaterial",function(){return Fn}),n.d(e,"LineDashedMaterial",function(){return Jo}),n.d(e,"LineBasicMaterial",function(){return yr}),n.d(e,"Material",function(){return zn}),n.d(e,"Float64BufferAttribute",function(){return Cn}),n.d(e,"Float32BufferAttribute",function(){return Tn}),n.d(e,"Uint32BufferAttribute",function(){return Sn}),n.d(e,"Int32BufferAttribute",function(){return En}),n.d(e,"Uint16BufferAttribute",function(){return Mn}),n.d(e,"Int16BufferAttribute",function(){return bn}),n.d(e,"Uint8ClampedBufferAttribute",function(){return wn}),n.d(e,"Uint8BufferAttribute",function(){return xn}),n.d(e,"Int8BufferAttribute",function(){return _n}),n.d(e,"BufferAttribute",function(){return yn}),n.d(e,"ArcCurve",function(){return ca}),n.d(e,"CatmullRomCurve3",function(){return ga}),n.d(e,"CubicBezierCurve",function(){return xa}),n.d(e,"CubicBezierCurve3",function(){return wa}),n.d(e,"EllipseCurve",function(){return ua}),n.d(e,"LineCurve",function(){return ba}),n.d(e,"LineCurve3",function(){return Ma}),n.d(e,"QuadraticBezierCurve",function(){return Ea}),n.d(e,"QuadraticBezierCurve3",function(){return Sa}),n.d(e,"SplineCurve",function(){return Ta}),n.d(e,"REVISION",function(){return r}),n.d(e,"MOUSE",function(){return o}),n.d(e,"CullFaceNone",function(){return a}),n.d(e,"CullFaceBack",function(){return s}),n.d(e,"CullFaceFront",function(){return h}),n.d(e,"CullFaceFrontBack",function(){return u}),n.d(e,"FrontFaceDirectionCW",function(){return c}),n.d(e,"FrontFaceDirectionCCW",function(){return l}),n.d(e,"BasicShadowMap",function(){return f}),n.d(e,"PCFShadowMap",function(){return d}),n.d(e,"PCFSoftShadowMap",function(){return p}),n.d(e,"FrontSide",function(){return m}),n.d(e,"BackSide",function(){return g}),n.d(e,"DoubleSide",function(){return v}),n.d(e,"FlatShading",function(){return y}),n.d(e,"SmoothShading",function(){return _}),n.d(e,"NoColors",function(){return x}),n.d(e,"FaceColors",function(){return w}),n.d(e,"VertexColors",function(){return b}),n.d(e,"NoBlending",function(){return M}),n.d(e,"NormalBlending",function(){return E}),n.d(e,"AdditiveBlending",function(){return S}),n.d(e,"SubtractiveBlending",function(){return T}),n.d(e,"MultiplyBlending",function(){return C}),n.d(e,"CustomBlending",function(){return P}),n.d(e,"AddEquation",function(){return A}),n.d(e,"SubtractEquation",function(){return L}),n.d(e,"ReverseSubtractEquation",function(){return R}),n.d(e,"MinEquation",function(){return O}),n.d(e,"MaxEquation",function(){return I}),n.d(e,"ZeroFactor",function(){return D}),n.d(e,"OneFactor",function(){return k}),n.d(e,"SrcColorFactor",function(){return N}),n.d(e,"OneMinusSrcColorFactor",function(){return z}),n.d(e,"SrcAlphaFactor",function(){return F}),n.d(e,"OneMinusSrcAlphaFactor",function(){return B}),n.d(e,"DstAlphaFactor",function(){return j}),n.d(e,"OneMinusDstAlphaFactor",function(){return G}),n.d(e,"DstColorFactor",function(){return H}),n.d(e,"OneMinusDstColorFactor",function(){return U}),n.d(e,"SrcAlphaSaturateFactor",function(){return V}),n.d(e,"NeverDepth",function(){return W}),n.d(e,"AlwaysDepth",function(){return Z}),n.d(e,"LessDepth",function(){return q}),n.d(e,"LessEqualDepth",function(){return X}),n.d(e,"EqualDepth",function(){return Y}),n.d(e,"GreaterEqualDepth",function(){return J}),n.d(e,"GreaterDepth",function(){return K}),n.d(e,"NotEqualDepth",function(){return Q}),n.d(e,"MultiplyOperation",function(){return $}),n.d(e,"MixOperation",function(){return tt}),n.d(e,"AddOperation",function(){return et}),n.d(e,"NoToneMapping",function(){return nt}),n.d(e,"LinearToneMapping",function(){return it}),n.d(e,"ReinhardToneMapping",function(){return rt}),n.d(e,"Uncharted2ToneMapping",function(){return ot}),n.d(e,"CineonToneMapping",function(){return at}),n.d(e,"UVMapping",function(){return st}),n.d(e,"CubeReflectionMapping",function(){return ht}),n.d(e,"CubeRefractionMapping",function(){return ut}),n.d(e,"EquirectangularReflectionMapping",function(){return ct}),n.d(e,"EquirectangularRefractionMapping",function(){return lt}),n.d(e,"SphericalReflectionMapping",function(){return ft}),n.d(e,"CubeUVReflectionMapping",function(){return dt}),n.d(e,"CubeUVRefractionMapping",function(){return pt}),n.d(e,"RepeatWrapping",function(){return mt}),n.d(e,"ClampToEdgeWrapping",function(){return gt}),n.d(e,"MirroredRepeatWrapping",function(){return vt}),n.d(e,"NearestFilter",function(){return yt}),n.d(e,"NearestMipMapNearestFilter",function(){return _t}),n.d(e,"NearestMipMapLinearFilter",function(){return xt}),n.d(e,"LinearFilter",function(){return wt}),n.d(e,"LinearMipMapNearestFilter",function(){return bt}),n.d(e,"LinearMipMapLinearFilter",function(){return Mt}),n.d(e,"UnsignedByteType",function(){return Et}),n.d(e,"ByteType",function(){return St}),n.d(e,"ShortType",function(){return Tt}),n.d(e,"UnsignedShortType",function(){return Ct}),n.d(e,"IntType",function(){return Pt}),n.d(e,"UnsignedIntType",function(){return At}),n.d(e,"FloatType",function(){return Lt}),n.d(e,"HalfFloatType",function(){return Rt}),n.d(e,"UnsignedShort4444Type",function(){return Ot}),n.d(e,"UnsignedShort5551Type",function(){return It}),n.d(e,"UnsignedShort565Type",function(){return Dt}),n.d(e,"UnsignedInt248Type",function(){return kt}),n.d(e,"AlphaFormat",function(){return Nt}),n.d(e,"RGBFormat",function(){return zt}),n.d(e,"RGBAFormat",function(){return Ft}),n.d(e,"LuminanceFormat",function(){return Bt}),n.d(e,"LuminanceAlphaFormat",function(){return jt}),n.d(e,"RGBEFormat",function(){return Gt}),n.d(e,"DepthFormat",function(){return Ht}),n.d(e,"DepthStencilFormat",function(){return Ut}),n.d(e,"RGB_S3TC_DXT1_Format",function(){return Vt}),n.d(e,"RGBA_S3TC_DXT1_Format",function(){return Wt}),n.d(e,"RGBA_S3TC_DXT3_Format",function(){return Zt}),n.d(e,"RGBA_S3TC_DXT5_Format",function(){return qt}),n.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return Xt}),n.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return Yt}),n.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return Jt}),n.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return Kt}),n.d(e,"RGB_ETC1_Format",function(){return Qt}),n.d(e,"RGBA_ASTC_4x4_Format",function(){return $t}),n.d(e,"RGBA_ASTC_5x4_Format",function(){return te}),n.d(e,"RGBA_ASTC_5x5_Format",function(){return ee}),n.d(e,"RGBA_ASTC_6x5_Format",function(){return ne}),n.d(e,"RGBA_ASTC_6x6_Format",function(){return ie}),n.d(e,"RGBA_ASTC_8x5_Format",function(){return re}),n.d(e,"RGBA_ASTC_8x6_Format",function(){return oe}),n.d(e,"RGBA_ASTC_8x8_Format",function(){return ae}),n.d(e,"RGBA_ASTC_10x5_Format",function(){return se}),n.d(e,"RGBA_ASTC_10x6_Format",function(){return he}),n.d(e,"RGBA_ASTC_10x8_Format",function(){return ue}),n.d(e,"RGBA_ASTC_10x10_Format",function(){return ce}),n.d(e,"RGBA_ASTC_12x10_Format",function(){return le}),n.d(e,"RGBA_ASTC_12x12_Format",function(){return fe}),n.d(e,"LoopOnce",function(){return de}),n.d(e,"LoopRepeat",function(){return pe}),n.d(e,"LoopPingPong",function(){return me}),n.d(e,"InterpolateDiscrete",function(){return ge}),n.d(e,"InterpolateLinear",function(){return ve}),n.d(e,"InterpolateSmooth",function(){return ye}),n.d(e,"ZeroCurvatureEnding",function(){return _e}),n.d(e,"ZeroSlopeEnding",function(){return xe}),n.d(e,"WrapAroundEnding",function(){return we}),n.d(e,"TrianglesDrawMode",function(){return be}),n.d(e,"TriangleStripDrawMode",function(){return Me}),n.d(e,"TriangleFanDrawMode",function(){return Ee}),n.d(e,"LinearEncoding",function(){return Se}),n.d(e,"sRGBEncoding",function(){return Te}),n.d(e,"GammaEncoding",function(){return Ce}),n.d(e,"RGBEEncoding",function(){return Pe}),n.d(e,"LogLuvEncoding",function(){return Ae}),n.d(e,"RGBM7Encoding",function(){return Le}),n.d(e,"RGBM16Encoding",function(){return Re}),n.d(e,"RGBDEncoding",function(){return Oe}),n.d(e,"BasicDepthPacking",function(){return Ie}),n.d(e,"RGBADepthPacking",function(){return De}),n.d(e,"TangentSpaceNormalMap",function(){return ke}),n.d(e,"ObjectSpaceNormalMap",function(){return Ne}),n.d(e,"CubeGeometry",function(){return On}),n.d(e,"Face4",function(){return uh}),n.d(e,"LineStrip",function(){return ch}),n.d(e,"LinePieces",function(){return lh}),n.d(e,"MeshFaceMaterial",function(){return fh}),n.d(e,"MultiMaterial",function(){return dh}),n.d(e,"PointCloud",function(){return ph}),n.d(e,"Particle",function(){return mh}),n.d(e,"ParticleSystem",function(){return gh}),n.d(e,"PointCloudMaterial",function(){return vh}),n.d(e,"ParticleBasicMaterial",function(){return yh}),n.d(e,"ParticleSystemMaterial",function(){return _h}),n.d(e,"Vertex",function(){return xh}),n.d(e,"DynamicBufferAttribute",function(){return wh}),n.d(e,"Int8Attribute",function(){return bh}),n.d(e,"Uint8Attribute",function(){return Mh}),n.d(e,"Uint8ClampedAttribute",function(){return Eh}),n.d(e,"Int16Attribute",function(){return Sh}),n.d(e,"Uint16Attribute",function(){return Th}),n.d(e,"Int32Attribute",function(){return Ch}),n.d(e,"Uint32Attribute",function(){return Ph}),n.d(e,"Float32Attribute",function(){return Ah}),n.d(e,"Float64Attribute",function(){return Lh}),n.d(e,"ClosedSplineCurve3",function(){return Rh}),n.d(e,"SplineCurve3",function(){return Oh}),n.d(e,"Spline",function(){return Ih}),n.d(e,"AxisHelper",function(){return Dh}),n.d(e,"BoundingBoxHelper",function(){return kh}),n.d(e,"EdgesHelper",function(){return Nh}),n.d(e,"WireframeHelper",function(){return zh}),n.d(e,"XHRLoader",function(){return Fh}),n.d(e,"BinaryTextureLoader",function(){return Bh}),n.d(e,"GeometryUtils",function(){return jh}),n.d(e,"Projector",function(){return Gh}),n.d(e,"CanvasRenderer",function(){return Hh}),n.d(e,"SceneUtils",function(){return Uh}),n.d(e,"LensFlare",function(){return Vh}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&n]+t[n>>8&255]+"-"+t[n>>16&15|64]+t[n>>24&255]+"-"+t[63&i|128]+t[i>>8&255]+"-"+t[i>>16&255]+t[i>>24&255]+t[255&r]+t[r>>8&255]+t[r>>16&255]+t[r>>24&255]).toUpperCase()}}(),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*ze.DEG2RAD},radToDeg:function(t){return t*ze.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))}};function Fe(t,e){this.x=t||0,this.y=e||0}function Be(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function je(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}function Ge(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function He(){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.")}Object.defineProperties(Fe.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(Fe.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t=new Fe,e=new Fe;return function(n,i){return t.set(n,n),e.set(i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}}),Object.assign(Be.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,o,a,s,h,u,c,l,f,d,p,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=a,g[13]=s,g[2]=h,g[6]=u,g[10]=c,g[14]=l,g[3]=f,g[7]=d,g[11]=p,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Be).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(){var t=new Ge;return function(e){var n=this.elements,i=e.elements,r=1/t.setFromMatrixColumn(e,0).length(),o=1/t.setFromMatrixColumn(e,1).length(),a=1/t.setFromMatrixColumn(e,2).length();return n[0]=i[0]*r,n[1]=i[1]*r,n[2]=i[2]*r,n[3]=0,n[4]=i[4]*o,n[5]=i[5]*o,n[6]=i[6]*o,n[7]=0,n[8]=i[8]*a,n[9]=i[9]*a,n[10]=i[10]*a,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(i),h=Math.sin(i),u=Math.cos(r),c=Math.sin(r);if("XYZ"===t.order){var l=o*u,f=o*c,d=a*u,p=a*c;e[0]=s*u,e[4]=-s*c,e[8]=h,e[1]=f+d*h,e[5]=l-p*h,e[9]=-a*s,e[2]=p-l*h,e[6]=d+f*h,e[10]=o*s}else if("YXZ"===t.order){var m=s*u,g=s*c,v=h*u,y=h*c;e[0]=m+y*a,e[4]=v*a-g,e[8]=o*h,e[1]=o*c,e[5]=o*u,e[9]=-a,e[2]=g*a-v,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*u,g=s*c,v=h*u,y=h*c;e[0]=m-y*a,e[4]=-o*c,e[8]=v+g*a,e[1]=g+v*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*h,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){l=o*u,f=o*c,d=a*u,p=a*c;e[0]=s*u,e[4]=d*h-f,e[8]=l*h+p,e[1]=s*c,e[5]=p*h+l,e[9]=f*h-d,e[2]=-h,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var _=o*s,x=o*h,w=a*s,b=a*h;e[0]=s*u,e[4]=b-_*c,e[8]=w*c+x,e[1]=c,e[5]=o*u,e[9]=-a*u,e[2]=-h*u,e[6]=x*c+w,e[10]=_-b*c}else if("XZY"===t.order){_=o*s,x=o*h,w=a*s,b=a*h;e[0]=s*u,e[4]=-c,e[8]=h*u,e[1]=_*c+b,e[5]=o*u,e[9]=x*c-w,e[2]=w*c-x,e[6]=a*u,e[10]=b*c+_}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(){var t=new Ge(0,0,0),e=new Ge(1,1,1);return function(n){return this.compose(t,n,e)}}(),lookAt:function(){var t=new Ge,e=new Ge,n=new Ge;return function(i,r,o){var a=this.elements;return n.subVectors(i,r),0===n.lengthSq()&&(n.z=1),n.normalize(),t.crossVectors(o,n),0===t.lengthSq()&&(1===Math.abs(o.z)?n.x+=1e-4:n.z+=1e-4,n.normalize(),t.crossVectors(o,n)),t.normalize(),e.crossVectors(n,t),a[0]=t.x,a[4]=e.x,a[8]=n.x,a[1]=t.y,a[5]=e.y,a[9]=n.y,a[2]=t.z,a[6]=e.z,a[10]=n.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[4],s=n[8],h=n[12],u=n[1],c=n[5],l=n[9],f=n[13],d=n[2],p=n[6],m=n[10],g=n[14],v=n[3],y=n[7],_=n[11],x=n[15],w=i[0],b=i[4],M=i[8],E=i[12],S=i[1],T=i[5],C=i[9],P=i[13],A=i[2],L=i[6],R=i[10],O=i[14],I=i[3],D=i[7],k=i[11],N=i[15];return r[0]=o*w+a*S+s*A+h*I,r[4]=o*b+a*T+s*L+h*D,r[8]=o*M+a*C+s*R+h*k,r[12]=o*E+a*P+s*O+h*N,r[1]=u*w+c*S+l*A+f*I,r[5]=u*b+c*T+l*L+f*D,r[9]=u*M+c*C+l*R+f*k,r[13]=u*E+c*P+l*O+f*N,r[2]=d*w+p*S+m*A+g*I,r[6]=d*b+p*T+m*L+g*D,r[10]=d*M+p*C+m*R+g*k,r[14]=d*E+p*P+m*O+g*N,r[3]=v*w+y*S+_*A+x*I,r[7]=v*b+y*T+_*L+x*D,r[11]=v*M+y*C+_*R+x*k,r[15]=v*E+y*P+_*O+x*N,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t=new Ge;return function(e){for(var n=0,i=e.count;n=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var _=Math.sqrt(y),x=Math.atan2(_,g*v);m=Math.sin(m*x)/_,a=Math.sin(a*x)/_}var w=a*v;if(s=s*m+l*w,h=h*m+f*w,u=u*m+d*w,c=c*m+p*w,m===1-a){var b=1/Math.sqrt(s*s+h*h+u*u+c*c);s*=b,h*=b,u*=b,c*=b}}t[e]=s,t[e+1]=h,t[e+2]=u,t[e+3]=c}}),Object.defineProperties(je.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(je.prototype,{set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,o=t.order,a=Math.cos,s=Math.sin,h=a(n/2),u=a(i/2),c=a(r/2),l=s(n/2),f=s(i/2),d=s(r/2);return"XYZ"===o?(this._x=l*u*c+h*f*d,this._y=h*f*c-l*u*d,this._z=h*u*d+l*f*c,this._w=h*u*c-l*f*d):"YXZ"===o?(this._x=l*u*c+h*f*d,this._y=h*f*c-l*u*d,this._z=h*u*d-l*f*c,this._w=h*u*c+l*f*d):"ZXY"===o?(this._x=l*u*c-h*f*d,this._y=h*f*c+l*u*d,this._z=h*u*d+l*f*c,this._w=h*u*c-l*f*d):"ZYX"===o?(this._x=l*u*c-h*f*d,this._y=h*f*c+l*u*d,this._z=h*u*d-l*f*c,this._w=h*u*c+l*f*d):"YZX"===o?(this._x=l*u*c+h*f*d,this._y=h*f*c+l*u*d,this._z=h*u*d-l*f*c,this._w=h*u*c-l*f*d):"XZY"===o&&(this._x=l*u*c-h*f*d,this._y=h*f*c-l*u*d,this._z=h*u*d+l*f*c,this._w=h*u*c+l*f*d),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],o=n[8],a=n[1],s=n[5],h=n[9],u=n[2],c=n[6],l=n[10],f=i+s+l;return f>0?(e=.5/Math.sqrt(f+1),this._w=.25/e,this._x=(c-h)*e,this._y=(o-u)*e,this._z=(a-r)*e):i>s&&i>l?(e=2*Math.sqrt(1+i-s-l),this._w=(c-h)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+u)/e):s>l?(e=2*Math.sqrt(1+s-i-l),this._w=(o-u)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(h+c)/e):(e=2*Math.sqrt(1+l-i-s),this._w=(a-r)/e,this._x=(o+u)/e,this._y=(h+c)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e=new Ge;return function(n,i){return void 0===e&&(e=new Ge),(t=n.dot(i)+1)<1e-6?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,i),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize()}}(),angleTo:function(t){return 2*Math.acos(Math.abs(ze.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var i=Math.min(1,e/n);return this.slerp(t,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,s=e._y,h=e._z,u=e._w;return this._x=n*u+o*a+i*h-r*s,this._y=i*u+o*s+r*a-n*h,this._z=r*u+o*h+n*s-i*a,this._w=o*u-n*a-i*s-r*h,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;var s=1-a*a;if(s<=Number.EPSILON){var h=1-e;return this._w=h*o+e*this._w,this._x=h*n+e*this._x,this._y=h*i+e*this._y,this._z=h*r+e*this._z,this.normalize()}var u=Math.sqrt(s),c=Math.atan2(u,a),l=Math.sin((1-e)*c)/u,f=Math.sin(e*c)/u;return this._w=o*l+this._w*f,this._x=n*l+this._x*f,this._y=i*l+this._y*f,this._z=r*l+this._z*f,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Ge.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t=new je;return function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(t.setFromEuler(e))}}(),applyAxisAngle:function(){var t=new je;return function(e,n){return this.applyQuaternion(t.setFromAxisAngle(e,n))}}(),applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,s=t.w,h=s*e+o*i-a*n,u=s*n+a*e-r*i,c=s*i+r*n-o*e,l=-r*e-o*n-a*i;return this.x=h*s+l*-r+u*-a-c*-o,this.y=u*s+l*-o+c*-r-h*-a,this.z=c*s+l*-a+h*-o-u*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(){var t=new Be;return function(e){return this.applyMatrix4(t.getInverse(e.projectionMatrix)).applyMatrix4(e.matrixWorld)}}(),transformDirection:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t=new Ge,e=new Ge;return function(n,i){return t.set(n,n,n),e.set(i,i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){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:function(t,e){var n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-i*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t=new Ge;return function(e){return t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t=new Ge;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(ze.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(He.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,o,a,s,h){var u=this.elements;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=r,u[5]=s,u[6]=n,u[7]=o,u[8]=h,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var t=new Ge;return function(e){for(var n=0,i=e.count;n2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},Ve=0;function We(t,e,n,i,r,o,a,s,h,u){Object.defineProperty(this,"id",{value:Ve++}),this.uuid=ze.generateUUID(),this.name="",this.image=void 0!==t?t:We.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:We.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:gt,this.wrapT=void 0!==i?i:gt,this.magFilter=void 0!==r?r:wt,this.minFilter=void 0!==o?o:Mt,this.anisotropy=void 0!==h?h:1,this.format=void 0!==a?a:Ft,this.type=void 0!==s?s:Et,this.offset=new Fe(0,0),this.repeat=new Fe(1,1),this.center=new Fe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new He,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:Se,this.version=0,this.onUpdate=null}function Ze(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function qe(t,e,n){this.width=t,this.height=e,this.scissor=new Ze(0,0,t,e),this.scissorTest=!1,this.viewport=new Ze(0,0,t,e),void 0===(n=n||{}).minFilter&&(n.minFilter=wt),this.texture=new We(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.generateMipmaps=void 0===n.generateMipmaps||n.generateMipmaps,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Xe(t,e,n){qe.call(this,t,e,n),this.activeCubeFace=0,this.activeMipMapLevel=0}function Ye(t,e,n,i,r,o,a,s,h,u,c,l){We.call(this,null,o,a,s,h,u,i,r,c,l),this.image={data:t,width:e,height:n},this.magFilter=void 0!==h?h:yt,this.minFilter=void 0!==u?u:yt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Je(t,e){this.min=void 0!==t?t:new Ge(1/0,1/0,1/0),this.max=void 0!==e?e:new Ge(-1/0,-1/0,-1/0)}function Ke(t,e){this.center=void 0!==t?t:new Ge,this.radius=void 0!==e?e:0}function Qe(t,e){this.normal=void 0!==t?t:new Ge(1,0,0),this.constant=void 0!==e?e:0}function $e(t,e,n,i,r,o){this.planes=[void 0!==t?t:new Qe,void 0!==e?e:new Qe,void 0!==n?n:new Qe,void 0!==i?i:new Qe,void 0!==r?r:new Qe,void 0!==o?o:new Qe]}We.DEFAULT_IMAGE=void 0,We.DEFAULT_MAPPING=st,We.prototype=Object.assign(Object.create(i.prototype),{constructor:We,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.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){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={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,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=ze.generateUUID()),!e&&void 0===t.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var o=0,a=i.length;o1)switch(this.wrapS){case mt:t.x=t.x-Math.floor(t.x);break;case gt:t.x=t.x<0?0:1;break;case vt: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 mt:t.y=t.y-Math.floor(t.y);break;case gt:t.y=t.y<0?0:1;break;case vt: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(We.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Ze.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,i,r,o=t.elements,a=o[0],s=o[4],h=o[8],u=o[1],c=o[5],l=o[9],f=o[2],d=o[6],p=o[10];if(Math.abs(s-u)<.01&&Math.abs(h-f)<.01&&Math.abs(l-d)<.01){if(Math.abs(s+u)<.1&&Math.abs(h+f)<.1&&Math.abs(l+d)<.1&&Math.abs(a+c+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,g=(c+1)/2,v=(p+1)/2,y=(s+u)/4,_=(h+f)/4,x=(l+d)/4;return m>g&&m>v?m<.01?(n=0,i=.707106781,r=.707106781):(i=y/(n=Math.sqrt(m)),r=_/n):g>v?g<.01?(n=.707106781,i=0,r=.707106781):(n=y/(i=Math.sqrt(g)),r=x/i):v<.01?(n=.707106781,i=.707106781,r=0):(n=_/(r=Math.sqrt(v)),i=x/r),this.set(n,i,r,e),this}var w=Math.sqrt((d-l)*(d-l)+(h-f)*(h-f)+(u-s)*(u-s));return Math.abs(w)<.001&&(w=1),this.x=(d-l)/w,this.y=(h-f)/w,this.z=(u-s)/w,this.w=Math.acos((a+c+p-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(n,i){return void 0===t&&(t=new Ze,e=new Ze),t.set(n,n,n,n),e.set(i,i,i,i),this.clamp(t,e)}}(),clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),qe.prototype=Object.assign(Object.create(i.prototype),{constructor:qe,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Xe.prototype=Object.create(qe.prototype),Xe.prototype.constructor=Xe,Xe.prototype.isWebGLRenderTargetCube=!0,Ye.prototype=Object.create(We.prototype),Ye.prototype.constructor=Ye,Ye.prototype.isDataTexture=!0,Object.assign(Je.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,h=t.length;sr&&(r=u),c>o&&(o=c),l>a&&(a=l)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,h=t.count;sr&&(r=u),c>o&&(o=c),l>a&&(a=l)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Ge),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:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},intersectsSphere:function(){var t=new Ge;return function(e){return this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=t.constant&&n>=t.constant},intersectsTriangle:function(){var t=new Ge,e=new Ge,n=new Ge,i=new Ge,r=new Ge,o=new Ge,a=new Ge,s=new Ge,h=new Ge,u=new Ge;function c(i){var r,o;for(r=0,o=i.length-3;r<=o;r+=3){a.fromArray(i,r);var s=h.x*Math.abs(a.x)+h.y*Math.abs(a.y)+h.z*Math.abs(a.z),u=t.dot(a),c=e.dot(a),l=n.dot(a);if(Math.max(-Math.max(u,c,l),Math.min(u,c,l))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),h.subVectors(this.max,s),t.subVectors(a.a,s),e.subVectors(a.b,s),n.subVectors(a.c,s),i.subVectors(e,t),r.subVectors(n,e),o.subVectors(t,n);var l=[0,-i.z,i.y,0,-r.z,r.y,0,-o.z,o.y,i.z,0,-i.x,r.z,0,-r.x,o.z,0,-o.x,-i.y,i.x,0,-r.y,r.x,0,-o.y,o.x,0];return!!c(l)&&(!!c(l=[1,0,0,0,1,0,0,0,1])&&(u.crossVectors(i,r),c(l=[u.x,u.y,u.z])))}}(),clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Ge),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Ge;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new Ge;return function(e){return void 0===e&&(console.warn("THREE.Box3: .getBoundingSphere() target is now required"),e=new Ke),this.getCenter(e.center),e.radius=.5*this.getSize(t).length(),e}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new Ge,new Ge,new Ge,new Ge,new Ge,new Ge,new Ge,new Ge];return function(e){return this.isEmpty()?this:(t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(t),this)}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(Ke.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new Je;return function(e,n){var i=this.center;void 0!==n?i.copy(n):t.setFromPoints(e).getCenter(i);for(var r=0,o=0,a=e.length;othis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Je),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(Qe.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new Ge,e=new Ge;return function(n,i,r){var o=t.subVectors(r,i).cross(e.subVectors(n,i)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new Ge),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new Ge;return function(e,n){void 0===n&&(console.warn("THREE.Plane: .intersectLine() target is now required"),n=new Ge);var i=e.delta(t),r=this.normal.dot(i);if(0===r)return 0===this.distanceToPoint(e.start)?n.copy(e.start):void 0;var o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?void 0:n.copy(i).multiplyScalar(o).add(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Ge),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new Ge,e=new He;return function(n,i){var r=i||e.getNormalMatrix(n),o=this.coplanarPoint(t).applyMatrix4(n),a=this.normal.applyMatrix3(r).normalize();return this.constant=-o.dot(a),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign($e.prototype,{set:function(t,e,n,i,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],h=n[5],u=n[6],c=n[7],l=n[8],f=n[9],d=n[10],p=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-i,c-s,p-l,y-m).normalize(),e[1].setComponents(a+i,c+s,p+l,y+m).normalize(),e[2].setComponents(a+r,c+h,p+f,y+g).normalize(),e[3].setComponents(a-r,c-h,p-f,y-g).normalize(),e[4].setComponents(a-o,c-u,p-d,y-v).normalize(),e[5].setComponents(a+o,c+u,p+d,y+v).normalize(),this},intersectsObject:function(){var t=new Ke;return function(e){var n=e.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),t.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSprite:function(){var t=new Ke;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)0?e.max.x:e.min.x,t.y=r.normal.y>0?e.max.y:e.min.y,t.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(t)<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var tn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",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( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat 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 GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\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\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 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}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.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 = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif\n",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D 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\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\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#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif\n",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif\n",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, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif\n",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_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#endif\n",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 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}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, 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 )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( 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#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n}\n",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}\n",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}\n"},en={merge:function(t){for(var e={},n=0;n>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(){function t(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}return function(e,n,i){if(e=ze.euclideanModulo(e,1),n=ze.clamp(n,0,1),i=ze.clamp(i,0,1),0===n)this.r=this.g=this.b=i;else{var r=i<=.5?i*(1+n):i+n-i*n,o=2*i-r;this.r=t(o,r,e+1/3),this.g=t(o,r,e),this.b=t(o,r,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var i,r=n[1],o=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,h=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(a,s,h)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u,c=(u=n[1]).length;if(3===c)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}t&&t.length>0&&(void 0!==(u=nn[t])?this.setHex(u):console.warn("THREE.Color: Unknown color "+t));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(){function t(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.b),this}}(),copyLinearToSRGB:function(){function t(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.b),this}}(),convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,i=this.r,r=this.g,o=this.b,a=Math.max(i,r,o),s=Math.min(i,r,o),h=(s+a)/2;if(s===a)e=0,n=0;else{var u=a-s;switch(n=h<=.5?u/(a+s):u/(2-a-s),a){case i:e=(r-o)/u+(r1){for(var e=0;e1){for(var e=0;e0){i.children=[];for(s=0;s0&&(n.geometries=l),f.length>0&&(n.materials=f),d.length>0&&(n.textures=d),p.length>0&&(n.images=p),a.length>0&&(n.shapes=a)}return n.object=i,n;function m(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;ne&&(e=t[n]);return e}vn.prototype=Object.assign(Object.create(i.prototype),{constructor:vn,isGeometry:!0,applyMatrix:function(t){for(var e=(new He).getNormalMatrix(t),n=0,i=this.vertices.length;n0)for(f=0;f0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n=0;n--){var p=f[n];for(this.faces.splice(p,1),a=0,s=this.faceVertexUvs.length;a0,g=d.vertexNormals.length>0,v=1!==d.color.r||1!==d.color.g||1!==d.color.b,y=d.vertexColors.length>0,_=0;if(_=M(_=M(_=M(_=M(_=M(_=M(_=M(_=M(_,0,0),1,!0),2,!1),3,p),4,m),5,g),6,v),7,y),a.push(_),a.push(d.a,d.b,d.c),a.push(d.materialIndex),p){var x=this.faceVertexUvs[0][r];a.push(T(x[0]),T(x[1]),T(x[2]))}if(m&&a.push(E(d.normal)),g){var w=d.vertexNormals;a.push(E(w[0]),E(w[1]),E(w[2]))}if(v&&a.push(S(d.color)),y){var b=d.vertexColors;a.push(S(b[0]),S(b[1]),S(b[2]))}}function M(t,e,n){return n?t|1<0&&(t.data.colors=u),l.length>0&&(t.data.uvs=[l]),t.data.faces=a,t},clone:function(){return(new vn).copy(this)},copy:function(t){var e,n,i,r,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e0,a=r[1]&&r[1].length>0,s=t.morphTargets,h=s.length;if(h>0){e=[];for(var u=0;u0){c=[];for(u=0;u0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(u=0;u0?1:-1,u.push(A.x,A.y,A.z),c.push(y/m),c.push(1-_/g),C+=1}}for(_=0;_65535?Sn:Mn)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):(this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new yn(arguments[1],arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new He).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new Be;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new Be;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new Be;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new Be;return function(e,n,i){return t.makeTranslation(e,n,i),this.applyMatrix(t),this}}(),scale:function(){var t=new Be;return function(e,n,i){return t.makeScale(e,n,i),this.applyMatrix(t),this}}(),lookAt:function(){var t=new fn;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){var t=new Ge;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(t).negate(),this.translate(t.x,t.y,t.z),this}}(),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new Tn(3*e.vertices.length,3),i=new Tn(3*e.colors.length,3);if(this.addAttribute("position",n.copyVector3sArray(e.vertices)),this.addAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new Tn(e.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n0){var n=new Float32Array(3*t.normals.length);this.addAttribute("normal",new yn(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var i=new Float32Array(3*t.colors.length);this.addAttribute("color",new yn(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new yn(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new yn(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],h=t.morphTargets[a],u=0,c=h.length;u0){var d=new Tn(4*t.skinIndices.length,4);this.addAttribute("skinIndex",d.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var p=new Tn(4*t.skinWeights.length,4);this.addAttribute("skinWeight",p.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Je);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var t=new Je,e=new Ge;return function(){null===this.boundingSphere&&(this.boundingSphere=new Ke);var n=this.attributes.position;if(n){var i=this.boundingSphere.center;t.setFromBufferAttribute(n),t.getCenter(i);for(var r=0,o=0,a=n.count;o0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var i=this.index;if(null!==i){var r=Array.prototype.slice.call(i.array);t.data.index={type:i.array.constructor.name,array:r}}var o=this.attributes;for(var n in o){var a=o[n];r=Array.prototype.slice.call(a.array);t.data.attributes[n]={itemSize:a.itemSize,type:a.array.constructor.name,array:r,normalized:a.normalized}}var s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var h=this.boundingSphere;return null!==h&&(t.data.boundingSphere={center:h.center.toArray(),radius:h.radius}),t},clone:function(){return(new Rn).copy(this)},copy:function(t){var e,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var o=t.attributes;for(e in o){var a=o[e];this.addAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var h=[],u=s[e];for(n=0,i=u.length;n0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var r=i(t.textures),o=i(t.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.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.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Fn.prototype=Object.create(zn.prototype),Fn.prototype.constructor=Fn,Fn.prototype.isMeshBasicMaterial=!0,Fn.prototype.copy=function(t){return zn.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},Bn.prototype=Object.create(zn.prototype),Bn.prototype.constructor=Bn,Bn.prototype.isShaderMaterial=!0,Bn.prototype.copy=function(t){return zn.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=en.clone(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=t.extensions,this},Bn.prototype.toJSON=function(t){var e=zn.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var i=this.uniforms[n].value;i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}return Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},Object.assign(jn.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Ge),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new Ge;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Ge),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new Ge;return function(e){var n=t.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(n).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new Ge,e=new Ge,n=new Ge;return function(i,r,o,a){t.copy(i).add(r).multiplyScalar(.5),e.copy(r).sub(i).normalize(),n.copy(this.origin).sub(t);var s,h,u,c,l=.5*i.distanceTo(r),f=-this.direction.dot(e),d=n.dot(this.direction),p=-n.dot(e),m=n.lengthSq(),g=Math.abs(1-f*f);if(g>0)if(h=f*d-p,c=l*g,(s=f*p-d)>=0)if(h>=-c)if(h<=c){var v=1/g;u=(s*=v)*(s+f*(h*=v)+2*d)+h*(f*s+h+2*p)+m}else h=l,u=-(s=Math.max(0,-(f*h+d)))*s+h*(h+2*p)+m;else h=-l,u=-(s=Math.max(0,-(f*h+d)))*s+h*(h+2*p)+m;else h<=-c?u=-(s=Math.max(0,-(-f*l+d)))*s+(h=s>0?-l:Math.min(Math.max(-l,-p),l))*(h+2*p)+m:h<=c?(s=0,u=(h=Math.min(Math.max(-l,-p),l))*(h+2*p)+m):u=-(s=Math.max(0,-(f*l+d)))*s+(h=s>0?l:Math.min(Math.max(-l,-p),l))*(h+2*p)+m;else h=f>0?-l:l,u=-(s=Math.max(0,-(f*h+d)))*s+h*(h+2*p)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(e).multiplyScalar(h).add(t),u}}(),intersectSphere:function(){var t=new Ge;return function(e,n){t.subVectors(e.center,this.origin);var i=t.dot(this.direction),r=t.dot(t)-i*i,o=e.radius*e.radius;if(r>o)return null;var a=Math.sqrt(o-r),s=i-a,h=i+a;return s<0&&h<0?null:s<0?this.at(h,n):this.at(s,n)}}(),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,i,r,o,a,s,h=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,l=this.origin;return h>=0?(n=(t.min.x-l.x)*h,i=(t.max.x-l.x)*h):(n=(t.max.x-l.x)*h,i=(t.min.x-l.x)*h),u>=0?(r=(t.min.y-l.y)*u,o=(t.max.y-l.y)*u):(r=(t.max.y-l.y)*u,o=(t.min.y-l.y)*u),n>o||r>i?null:((r>n||n!=n)&&(n=r),(o=0?(a=(t.min.z-l.z)*c,s=(t.max.z-l.z)*c):(a=(t.max.z-l.z)*c,s=(t.min.z-l.z)*c),n>s||a>i?null:((a>n||n!=n)&&(n=a),(s=0?n:i,e)))},intersectsBox:function(){var t=new Ge;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new Ge,e=new Ge,n=new Ge,i=new Ge;return function(r,o,a,s,h){e.subVectors(o,r),n.subVectors(a,r),i.crossVectors(e,n);var u,c=this.direction.dot(i);if(c>0){if(s)return null;u=1}else{if(!(c<0))return null;u=-1,c=-c}t.subVectors(this.origin,r);var l=u*this.direction.dot(n.crossVectors(t,n));if(l<0)return null;var f=u*this.direction.dot(e.cross(t));if(f<0)return null;if(l+f>c)return null;var d=-u*t.dot(i);return d<0?null:this.at(d/c,h)}}(),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(Gn,{getNormal:function(){var t=new Ge;return function(e,n,i,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Ge),r.subVectors(i,n),t.subVectors(e,n),r.cross(t);var o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}}(),getBarycoord:function(){var t=new Ge,e=new Ge,n=new Ge;return function(i,r,o,a,s){t.subVectors(a,r),e.subVectors(o,r),n.subVectors(i,r);var h=t.dot(t),u=t.dot(e),c=t.dot(n),l=e.dot(e),f=e.dot(n),d=h*l-u*u;if(void 0===s&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),s=new Ge),0===d)return s.set(-2,-1,-1);var p=1/d,m=(l*c-u*f)*p,g=(h*f-u*c)*p;return s.set(1-m-g,g,m)}}(),containsPoint:function(){var t=new Ge;return function(e,n,i,r){return Gn.getBarycoord(e,n,i,r,t),t.x>=0&&t.y>=0&&t.x+t.y<=1}}(),getUV:function(){var t=new Ge;return function(e,n,i,r,o,a,s,h){return this.getBarycoord(e,n,i,r,t),h.set(0,0),h.addScaledVector(o,t.x),h.addScaledVector(a,t.y),h.addScaledVector(s,t.z),h}}()}),Object.assign(Gn.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){var t=new Ge,e=new Ge;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Ge),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Gn.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Ge),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Gn.getBarycoord(t,this.a,this.b,this.c,e)},containsPoint:function(t){return Gn.containsPoint(t,this.a,this.b,this.c)},getUV:function(t,e,n,i,r){return Gn.getUV(t,this.a,this.b,this.c,e,n,i,r)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(){var t=new Ge,e=new Ge,n=new Ge,i=new Ge,r=new Ge,o=new Ge;return function(a,s){void 0===s&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),s=new Ge);var h,u,c=this.a,l=this.b,f=this.c;t.subVectors(l,c),e.subVectors(f,c),i.subVectors(a,c);var d=t.dot(i),p=e.dot(i);if(d<=0&&p<=0)return s.copy(c);r.subVectors(a,l);var m=t.dot(r),g=e.dot(r);if(m>=0&&g<=m)return s.copy(l);var v=d*g-m*p;if(v<=0&&d>=0&&m<=0)return h=d/(d-m),s.copy(c).addScaledVector(t,h);o.subVectors(a,f);var y=t.dot(o),_=e.dot(o);if(_>=0&&y<=_)return s.copy(f);var x=y*p-d*_;if(x<=0&&p>=0&&_<=0)return u=p/(p-_),s.copy(c).addScaledVector(e,u);var w=m*_-y*g;if(w<=0&&g-m>=0&&y-_>=0)return n.subVectors(f,l),u=(g-m)/(g-m+(y-_)),s.copy(l).addScaledVector(n,u);var b=1/(w+x+v);return h=x*b,u=v*b,s.copy(c).addScaledVector(t,h).addScaledVector(e,u)}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),Hn.prototype=Object.assign(Object.create(fn.prototype),{constructor:Hn,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return fn.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(o.length>0){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=s.length;tn.far?null:{distance:h,point:d.clone(),object:t}}function m(t,e,n,a,s,h,d,m,g){i.fromBufferAttribute(s,d),r.fromBufferAttribute(s,m),o.fromBufferAttribute(s,g);var v=p(t,e,n,a,i,r,o,f);if(v){h&&(u.fromBufferAttribute(h,d),c.fromBufferAttribute(h,m),l.fromBufferAttribute(h,g),v.uv=Gn.getUV(f,i,r,o,u,c,l,new Fe));var y=new mn(d,m,g);Gn.getNormal(i,r,o,y.normal),v.face=y}return v}return function(d,g){var v,y=this.geometry,_=this.material,x=this.matrixWorld;if(void 0!==_&&(null===y.boundingSphere&&y.computeBoundingSphere(),n.copy(y.boundingSphere),n.applyMatrix4(x),!1!==d.ray.intersectsSphere(n)&&(t.getInverse(x),e.copy(d.ray).applyMatrix4(t),null===y.boundingBox||!1!==e.intersectsBox(y.boundingBox))))if(y.isBufferGeometry){var w,b,M,E,S,T,C,P,A,L=y.index,R=y.attributes.position,O=y.attributes.uv,I=y.groups,D=y.drawRange;if(null!==L)if(Array.isArray(_))for(E=0,T=I.length;E0&&(F=H);for(var U=0,V=G.length;U0)return t;var r=e*n,o=Xn[r];if(void 0===o&&(o=new Float32Array(r),Xn[r]=o),0!==e){i.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function ti(t,e){if(t.length!==e.length)return!1;for(var n=0,i=t.length;n/gm,function(t,e){var n=tn[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return ji(n)})}function Gi(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,n,i){for(var r="",o=parseInt(e);o0?t.gammaFactor:1,x=a.isWebGL2?"":function(t,e,n){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap&&!e.objectSpaceNormalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(zi).join("\n")}(i.extensions,o,e),w=function(t){var e=[];for(var n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(h),b=s.createProgram();if(i.isRawShaderMaterial?((v=[w].filter(zi).join("\n")).length>0&&(v+="\n"),(y=[x,w].filter(zi).join("\n")).length>0&&(y+="\n")):(v=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,w,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+_,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+m:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+l:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(zi).join("\n"),y=[x,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,w,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+_,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+f:"",o.envMap?"#define "+m:"",o.envMap?"#define "+g:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+l:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(a.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",o.toneMapping!==nt?"#define TONE_MAPPING":"",o.toneMapping!==nt?tn.tonemapping_pars_fragment:"",o.toneMapping!==nt?function(t,e){var n;switch(e){case it:n="Linear";break;case rt:n="Reinhard";break;case ot:n="Uncharted2";break;case at:n="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.envMapEncoding||o.emissiveMapEncoding?tn.encodings_pars_fragment:"",o.mapEncoding?Ni("mapTexelToLinear",o.mapEncoding):"",o.envMapEncoding?Ni("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?Ni("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?function(t,e){var n=ki(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}("linearToOutputTexel",o.outputEncoding):"",o.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(zi).join("\n")),u=Bi(u=Fi(u=ji(u),o),o),c=Bi(c=Fi(c=ji(c),o),o),u=Gi(u),c=Gi(c),a.isWebGL2&&!i.isRawShaderMaterial){var M=!1,E=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==u.match(E)&&null!==c.match(E)&&(M=!0,u=u.replace(E,""),c=c.replace(E,"")),v=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,y=["#version 300 es\n","#define varying in",M?"":"out highp vec4 pc_fragColor;",M?"":"#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"+y}var S=v+u,T=y+c,C=Ii(s,s.VERTEX_SHADER,S),P=Ii(s,s.FRAGMENT_SHADER,T);s.attachShader(b,C),s.attachShader(b,P),void 0!==i.index0AttributeName?s.bindAttribLocation(b,0,i.index0AttributeName):!0===o.morphTargets&&s.bindAttribLocation(b,0,"position"),s.linkProgram(b);var A,L,R=s.getProgramInfoLog(b).trim(),O=s.getShaderInfoLog(C).trim(),I=s.getShaderInfoLog(P).trim(),D=!0,k=!0;return!1===s.getProgramParameter(b,s.LINK_STATUS)?(D=!1,console.error("THREE.WebGLProgram: shader error: ",s.getError(),"gl.VALIDATE_STATUS",s.getProgramParameter(b,s.VALIDATE_STATUS),"gl.getProgramInfoLog",R,O,I)):""!==R?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",R):""!==O&&""!==I||(k=!1),k&&(this.diagnostics={runnable:D,material:i,programLog:R,vertexShader:{log:O,prefix:v},fragmentShader:{log:I,prefix:y}}),s.deleteShader(C),s.deleteShader(P),this.getUniforms=function(){return void 0===A&&(A=new Oi(s,b,t)),A},this.getAttributes=function(){return void 0===L&&(L=function(t,e){for(var n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),r=0;r0,maxBones:f,useVertexTexture:n.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numClippingPlanes:h,numClipIntersection:u,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.receiveShadow&&o.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===v,flipSided:e.side===g,depthPacking:void 0!==e.depthPacking&&e.depthPacking}},this.getProgramCode=function(e,n){var i=[];if(n.shaderID?i.push(n.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)i.push(r),i.push(e.defines[r]);for(var a=0;a1&&n.sort(Vi),i.length>1&&i.sort(Wi)}}},t[i]=r),r},dispose:function(){t={}}}}var qi,Xi=0;function Yi(){var t=new function(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new Ge,color:new rn,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"SpotLight":n={position:new Ge,direction:new Ge,color:new rn,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Fe};break;case"PointLight":n={position:new Ge,color:new rn,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Fe,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new Ge,skyColor:new rn,groundColor:new rn};break;case"RectAreaLight":n={color:new rn,position:new Ge,halfWidth:new Ge,halfHeight:new Ge}}return t[e.id]=n,n}}},e={id:Xi++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=new Ge,i=new Be,r=new Be;return{setup:function(o,a,s){for(var h=0,u=0,c=0,l=0,f=0,d=0,p=0,m=0,g=s.matrixWorldInverse,v=0,y=o.length;v0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),e.isSkinnedMesh&&!1===n.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var g=e.isSkinnedMesh&&n.skinning,v=0;m&&(v|=u),g&&(v|=c),h=l[v]}if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var x=h.uuid,w=n.uuid,b=y[x];void 0===b&&(b={},y[x]=b);var M=b[w];void 0===M&&(M=h.clone(),b[w]=M),h=M}return h.visible=n.visible,h.wireframe=n.wireframe,h.side=null!=n.shadowSide?n.shadowSide:_[n.side],h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,i&&h.isMeshDistanceMaterial&&(h.referencePosition.copy(r),h.nearDistance=o,h.farDistance=a),h}function L(n,r,o,a){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&n.castShadow&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var s=e.update(n),u=n.material;if(Array.isArray(u))for(var c=s.groups,l=0,f=c.length;le||t.height>e){if("data"in t)return void console.warn("THREE.WebGLRenderer: image in DataTexture is too big ("+t.width+"x"+t.height+").");var n=e/Math.max(t.width,t.height),i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return i.width=Math.floor(t.width*n),i.height=Math.floor(t.height*n),i.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+i.width+"x"+i.height),i}return t}function c(t){return ze.isPowerOfTwo(t.width)&&ze.isPowerOfTwo(t.height)}function l(t,e){return t.generateMipmaps&&e&&t.minFilter!==yt&&t.minFilter!==wt}function f(e,n,r,o){t.generateMipmap(e),i.get(n).__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function d(e,n){if(!r.isWebGL2)return e;if(e===t.RGB){if(n===t.FLOAT)return t.RGB32F;if(n===t.HALF_FLOAT)return t.RGB16F;if(n===t.UNSIGNED_BYTE)return t.RGB8}if(e===t.RGBA){if(n===t.FLOAT)return t.RGBA32F;if(n===t.HALF_FLOAT)return t.RGBA16F;if(n===t.UNSIGNED_BYTE)return t.RGBA8}return e}function p(e){return e===yt||e===_t||e===xt?t.NEAREST:t.LINEAR}function m(e){var n=e.target;n.removeEventListener("dispose",m),function(e){var n=i.get(e);if(e.image&&n.__image__webglTextureCube)t.deleteTexture(n.__image__webglTextureCube);else{if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture)}i.remove(e)}(n),n.isVideoTexture&&delete h[n.id],a.memory.textures--}function g(e){var n=e.target;n.removeEventListener("dispose",g),function(e){var n=i.get(e),r=i.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);i.remove(e.texture),i.remove(e)}(n),a.memory.textures--}function v(e,p){var g=i.get(e);if(e.isVideoTexture&&function(t){var e=t.id,n=a.render.frame;h[e]!==n&&(h[e]=n,t.update())}(e),e.version>0&&g.__version!==e.version){var v=e.image;if(void 0===v)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==v.complete)return void function(e,i,h){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",m),e.__webglTexture=t.createTexture(),a.memory.textures++);n.activeTexture(t.TEXTURE0+h),n.bindTexture(t.TEXTURE_2D,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,i.unpackAlignment);var p=u(i.image,r.maxTextureSize);(function(t){return!r.isWebGL2&&(t.wrapS!==gt||t.wrapT!==gt||t.minFilter!==yt&&t.minFilter!==wt)})(i)&&!1===c(p)&&(p=function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof ImageBitmap?(void 0===s&&(s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),s.width=ze.floorPowerOfTwo(t.width),s.height=ze.floorPowerOfTwo(t.height),s.getContext("2d").drawImage(t,0,0,s.width,s.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+s.width+"x"+s.height),s):t}(p));var g=c(p),v=o.convert(i.format),_=o.convert(i.type),x=d(v,_);y(t.TEXTURE_2D,i,g);var w,b=i.mipmaps;if(i.isDepthTexture){if(x=t.DEPTH_COMPONENT,i.type===Lt){if(!r.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");x=t.DEPTH_COMPONENT32F}else r.isWebGL2&&(x=t.DEPTH_COMPONENT16);i.format===Ht&&x===t.DEPTH_COMPONENT&&i.type!==Ct&&i.type!==At&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=Ct,_=o.convert(i.type)),i.format===Ut&&(x=t.DEPTH_STENCIL,i.type!==kt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=kt,_=o.convert(i.type))),n.texImage2D(t.TEXTURE_2D,0,x,p.width,p.height,0,v,_,null)}else if(i.isDataTexture)if(b.length>0&&g){for(var M=0,E=b.length;M-1?n.compressedTexImage2D(t.TEXTURE_2D,M,x,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(t.TEXTURE_2D,M,x,w.width,w.height,0,v,_,w.data);e.__maxMipLevel=b.length-1}else if(b.length>0&&g){for(var M=0,E=b.length;M1||i.get(a).__currentAnisotropy)&&(t.texParameterf(n,h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function _(e,r,a,s){var h=o.convert(r.texture.format),u=o.convert(r.texture.type),c=d(h,u);n.texImage2D(s,0,c,r.width,r.height,0,h,u,null),t.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,a,s,i.get(r.texture).__webglTexture,0),t.bindFramebuffer(t.FRAMEBUFFER,null)}function x(e,n){t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)):n.depthBuffer&&n.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)):t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,n.width,n.height),t.bindRenderbuffer(t.RENDERBUFFER,null)}function w(e){var n=i.get(e),r=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(t.FRAMEBUFFER,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),v(n.depthTexture,0);var r=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Ht)t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,r,0);else{if(n.depthTexture.format!==Ut)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,r,0)}}(n.__webglFramebuffer,e)}else if(r){n.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(t.FRAMEBUFFER,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=t.createRenderbuffer(),x(n.__webglDepthbuffer[o],e)}else t.bindFramebuffer(t.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),x(n.__webglDepthbuffer,e);t.bindFramebuffer(t.FRAMEBUFFER,null)}this.setTexture2D=v,this.setTextureCube=function(e,s){var h=i.get(e);if(6===e.image.length)if(e.version>0&&h.__version!==e.version){h.__image__webglTextureCube||(e.addEventListener("dispose",m),h.__image__webglTextureCube=t.createTexture(),a.memory.textures++),n.activeTexture(t.TEXTURE0+s),n.bindTexture(t.TEXTURE_CUBE_MAP,h.__image__webglTextureCube),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var p=e&&e.isCompressedTexture,g=e.image[0]&&e.image[0].isDataTexture,v=[],_=0;_<6;_++)v[_]=p||g?g?e.image[_].image:e.image[_]:u(e.image[_],r.maxCubemapSize);var x=v[0],w=c(x),b=o.convert(e.format),M=o.convert(e.type),E=d(b,M);for(y(t.TEXTURE_CUBE_MAP,e,w),_=0;_<6;_++)if(p)for(var S,T=v[_].mipmaps,C=0,P=T.length;C-1?n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_,C,E,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_,C,E,S.width,S.height,0,b,M,S.data);else g?n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_,0,E,v[_].width,v[_].height,0,b,M,v[_].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+_,0,E,b,M,v[_]);h.__maxMipLevel=p?T.length-1:0,l(e,w)&&f(t.TEXTURE_CUBE_MAP,e,x.width,x.height),h.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(t.TEXTURE0+s),n.bindTexture(t.TEXTURE_CUBE_MAP,h.__image__webglTextureCube)},this.setTextureCubeDynamic=function(e,r){n.activeTexture(t.TEXTURE0+r),n.bindTexture(t.TEXTURE_CUBE_MAP,i.get(e).__webglTexture)},this.setupRenderTarget=function(e){var r=i.get(e),o=i.get(e.texture);e.addEventListener("dispose",g),o.__webglTexture=t.createTexture(),a.memory.textures++;var s=!0===e.isWebGLRenderTargetCube,h=c(e);if(s){r.__webglFramebuffer=[];for(var u=0;u<6;u++)r.__webglFramebuffer[u]=t.createFramebuffer()}else r.__webglFramebuffer=t.createFramebuffer();if(s){for(n.bindTexture(t.TEXTURE_CUBE_MAP,o.__webglTexture),y(t.TEXTURE_CUBE_MAP,e.texture,h),u=0;u<6;u++)_(r.__webglFramebuffer[u],e,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+u);l(e.texture,h)&&f(t.TEXTURE_CUBE_MAP,e.texture,e.width,e.height),n.bindTexture(t.TEXTURE_CUBE_MAP,null)}else n.bindTexture(t.TEXTURE_2D,o.__webglTexture),y(t.TEXTURE_2D,e.texture,h),_(r.__webglFramebuffer,e,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),l(e.texture,h)&&f(t.TEXTURE_2D,e.texture,e.width,e.height),n.bindTexture(t.TEXTURE_2D,null);e.depthBuffer&&w(e)},this.updateRenderTargetMipmap=function(e){var r=e.texture;if(l(r,c(e))){var o=e.isWebGLRenderTargetCube?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=i.get(r).__webglTexture;n.bindTexture(o,a),f(o,r,e.width,e.height),n.bindTexture(o,null)}}}function er(t,e,n){return{convert:function(i){var r;if(i===mt)return t.REPEAT;if(i===gt)return t.CLAMP_TO_EDGE;if(i===vt)return t.MIRRORED_REPEAT;if(i===yt)return t.NEAREST;if(i===_t)return t.NEAREST_MIPMAP_NEAREST;if(i===xt)return t.NEAREST_MIPMAP_LINEAR;if(i===wt)return t.LINEAR;if(i===bt)return t.LINEAR_MIPMAP_NEAREST;if(i===Mt)return t.LINEAR_MIPMAP_LINEAR;if(i===Et)return t.UNSIGNED_BYTE;if(i===Ot)return t.UNSIGNED_SHORT_4_4_4_4;if(i===It)return t.UNSIGNED_SHORT_5_5_5_1;if(i===Dt)return t.UNSIGNED_SHORT_5_6_5;if(i===St)return t.BYTE;if(i===Tt)return t.SHORT;if(i===Ct)return t.UNSIGNED_SHORT;if(i===Pt)return t.INT;if(i===At)return t.UNSIGNED_INT;if(i===Lt)return t.FLOAT;if(i===Rt){if(n.isWebGL2)return t.HALF_FLOAT;if(null!==(r=e.get("OES_texture_half_float")))return r.HALF_FLOAT_OES}if(i===Nt)return t.ALPHA;if(i===zt)return t.RGB;if(i===Ft)return t.RGBA;if(i===Bt)return t.LUMINANCE;if(i===jt)return t.LUMINANCE_ALPHA;if(i===Ht)return t.DEPTH_COMPONENT;if(i===Ut)return t.DEPTH_STENCIL;if(i===A)return t.FUNC_ADD;if(i===L)return t.FUNC_SUBTRACT;if(i===R)return t.FUNC_REVERSE_SUBTRACT;if(i===D)return t.ZERO;if(i===k)return t.ONE;if(i===N)return t.SRC_COLOR;if(i===z)return t.ONE_MINUS_SRC_COLOR;if(i===F)return t.SRC_ALPHA;if(i===B)return t.ONE_MINUS_SRC_ALPHA;if(i===j)return t.DST_ALPHA;if(i===G)return t.ONE_MINUS_DST_ALPHA;if(i===H)return t.DST_COLOR;if(i===U)return t.ONE_MINUS_DST_COLOR;if(i===V)return t.SRC_ALPHA_SATURATE;if((i===Vt||i===Wt||i===Zt||i===qt)&&null!==(r=e.get("WEBGL_compressed_texture_s3tc"))){if(i===Vt)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Wt)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===Zt)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===qt)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((i===Xt||i===Yt||i===Jt||i===Kt)&&null!==(r=e.get("WEBGL_compressed_texture_pvrtc"))){if(i===Xt)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Yt)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Jt)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===Kt)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===Qt&&null!==(r=e.get("WEBGL_compressed_texture_etc1")))return r.COMPRESSED_RGB_ETC1_WEBGL;if((i===$t||i===te||i===ee||i===ne||i===ie||i===re||i===oe||i===ae||i===se||i===he||i===ue||i===ce||i===le||i===fe)&&null!==(r=e.get("WEBGL_compressed_texture_astc")))return i;if(i===O||i===I){if(n.isWebGL2){if(i===O)return t.MIN;if(i===I)return t.MAX}if(null!==(r=e.get("EXT_blend_minmax"))){if(i===O)return r.MIN_EXT;if(i===I)return r.MAX_EXT}}if(i===kt){if(n.isWebGL2)return t.UNSIGNED_INT_24_8;if(null!==(r=e.get("WEBGL_depth_texture")))return r.UNSIGNED_INT_24_8_WEBGL}return 0}}}function nr(){fn.call(this),this.type="Group"}function ir(t,e,n,i){dn.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function rr(t){ir.call(this),this.cameras=t||[]}function or(t){var e=this,n=null,i=null,r=null,o=[],a=new Be,s=new Be,h="stage";"undefined"!=typeof window&&"VRFrameData"in window&&(i=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",y,!1));var u=new Be,c=new je,l=new Ge,f=new ir;f.bounds=new Ze(0,0,.5,1),f.layers.enable(1);var d=new ir;d.bounds=new Ze(.5,0,.5,1),d.layers.enable(2);var p,m,g=new rr([f,d]);function v(){return null!==n&&!0===n.isPresenting}function y(){if(v()){var i=n.getEyeParameters("left"),r=i.renderWidth,o=i.renderHeight;m=t.getPixelRatio(),p=t.getSize(),t.setDrawingBufferSize(2*r,o,1),w.start()}else e.enabled&&t.setDrawingBufferSize(p.width,p.height,m),w.stop()}g.layers.enable(1),g.layers.enable(2);var _=[];function x(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),n=0,i=0,r=e.length;n0),t.numPlanes=n,t.numIntersection=0}function u(e,n,i,r){var h=null!==e?e.length:0,u=null;if(0!==h){if(u=s.value,!0!==r||null===u){var c=i+4*h,l=n.matrixWorldInverse;a.getNormalMatrix(l),(null===u||u.length0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext,a=void 0!==n.precision?n.precision:"highp",s=r(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var h=!0===n.logarithmicDepthBuffer,u=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),c=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=t.getParameter(t.MAX_TEXTURE_SIZE),f=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),d=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),g=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=c>0,y=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=e.get("EXT_texture_filter_anisotropic");return i=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:h,maxTextures:u,maxVertexTextures:c,maxTextureSize:l,maxCubemapSize:f,maxAttributes:d,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y}}(y,_,t)).isWebGL2||(_.get("WEBGL_depth_texture"),_.get("OES_texture_float"),_.get("OES_texture_half_float"),_.get("OES_texture_half_float_linear"),_.get("OES_standard_derivatives"),_.get("OES_element_index_uint"),_.get("ANGLE_instanced_arrays")),_.get("OES_texture_float_linear"),H=new er(y,_,x),(w=new function(t,e,n,i){var r=new function(){var e=!1,n=new Ze,i=null,r=new Ze(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,o,a,s){!0===s&&(e*=a,i*=a,o*=a),n.set(e,i,o,a),!1===r.equals(n)&&(t.clearColor(e,i,o,a),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},o=new function(){var e=!1,n=null,i=null,r=null;return{setTest:function(e){e?ot(t.DEPTH_TEST):at(t.DEPTH_TEST)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(e)switch(e){case W:t.depthFunc(t.NEVER);break;case Z:t.depthFunc(t.ALWAYS);break;case q:t.depthFunc(t.LESS);break;case X:t.depthFunc(t.LEQUAL);break;case Y:t.depthFunc(t.EQUAL);break;case J:t.depthFunc(t.GEQUAL);break;case K:t.depthFunc(t.GREATER);break;case Q:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}},u=new function(){var e=!1,n=null,i=null,r=null,o=null,a=null,s=null,h=null,u=null;return{setTest:function(e){e?ot(t.STENCIL_TEST):at(t.STENCIL_TEST)},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&o===a||(t.stencilFunc(e,n,a),i=e,r=n,o=a)},setOp:function(e,n,i){a===e&&s===n&&h===i||(t.stencilOp(e,n,i),a=e,s=n,h=i)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,n=null,i=null,r=null,o=null,a=null,s=null,h=null,u=null}}},c=t.getParameter(t.MAX_VERTEX_ATTRIBS),l=new Uint8Array(c),f=new Uint8Array(c),d=new Uint8Array(c),p={},m=null,y=null,_=null,x=null,w=null,b=null,L=null,R=null,O=null,I=null,D=!1,k=null,N=null,z=null,F=null,B=null,j=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),G=!1,H=0,U=t.getParameter(t.VERSION);-1!==U.indexOf("WebGL")?(H=parseFloat(/^WebGL\ ([0-9])/.exec(U)[1]),G=H>=1):-1!==U.indexOf("OpenGL ES")&&(H=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(U)[1]),G=H>=2);var V=null,$={},tt=new Ze,et=new Ze;function nt(e,n,i){var r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(var a=0;a65535?Sn:Mn)(a,1),e.update(i,t.ELEMENT_ARRAY_BUFFER),r[n.id]=i,i}}}(y,O,b),D=new function(t,e){var n={};return{update:function(i){var r=e.render.frame,o=i.geometry,a=t.get(i,o);return n[a.id]!==r&&(o.isGeometry&&a.updateFromObject(i),t.update(a),n[a.id]=r),a},dispose:function(){n={}}}}(I,b),B=new function(t){var e={},n=new Float32Array(8);return{update:function(i,r,o,a){var s=i.morphTargetInfluences,h=s.length,u=e[r.id];if(void 0===u){u=[];for(var c=0;c=0){var h=i[a];if(void 0!==h){var u=h.normalized,c=h.itemSize,l=O.get(h);if(void 0===l)continue;var f=l.buffer,d=l.type,p=l.bytesPerElement;if(h.isInterleavedBufferAttribute){var m=h.data,g=m.stride,v=h.offset;m&&m.isInstancedInterleavedBuffer?(w.enableAttributeAndDivisor(s,m.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=m.meshPerAttribute*m.count)):w.enableAttribute(s),y.bindBuffer(y.ARRAY_BUFFER,f),y.vertexAttribPointer(s,c,d,u,g*p,v*p)}else h.isInstancedBufferAttribute?(w.enableAttributeAndDivisor(s,h.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=h.meshPerAttribute*h.count)):w.enableAttribute(s),y.bindBuffer(y.ARRAY_BUFFER,f),y.vertexAttribPointer(s,c,d,u,0,0)}else if(void 0!==o){var b=o[a];if(void 0!==b)switch(b.length){case 2:y.vertexAttrib2fv(s,b);break;case 3:y.vertexAttrib3fv(s,b);break;case 4:y.vertexAttrib4fv(s,b);break;default:y.vertexAttrib1fv(s,b)}}}}w.disableUnusedAttributes()}(i,s,n),null!==c&&y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,u.buffer));var p=1/0;null!==c?p=c.count:void 0!==l&&(p=l.count);var m=n.drawRange.start*f,g=n.drawRange.count*f,v=null!==o?o.start*f:0,b=null!==o?o.count*f:1/0,M=Math.max(m,v),E=Math.min(p,m+g,v+b)-1,S=Math.max(0,E-M+1);if(0!==S){if(r.isMesh)if(!0===i.wireframe)w.setLineWidth(i.wireframeLinewidth*Mt()),d.setMode(y.LINES);else switch(r.drawMode){case be:d.setMode(y.TRIANGLES);break;case Me:d.setMode(y.TRIANGLE_STRIP);break;case Ee:d.setMode(y.TRIANGLE_FAN)}else if(r.isLine){var T=i.linewidth;void 0===T&&(T=1),w.setLineWidth(T*Mt()),r.isLineSegments?d.setMode(y.LINES):r.isLineLoop?d.setMode(y.LINE_LOOP):d.setMode(y.LINE_STRIP)}else r.isPoints?d.setMode(y.POINTS):r.isSprite&&d.setMode(y.TRIANGLES);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&d.renderInstances(n,M,S):d.render(M,S)}},this.compile=function(t,e){(m=z.get(t,e)).init(),t.traverse(function(t){t.isLight&&(m.pushLight(t),t.castShadow&&m.pushShadow(t))}),m.setupLights(e),t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var n=0;n=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(p=0;p=0&&t.numSupportedMorphNormals++}var g=i.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=yt.numPlanes,i.numIntersection=yt.numIntersection,g.clippingPlanes=yt.uniform),i.fog=e,void 0===a&&(i.lightsHash=a={}),a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,t.lights&&(g.ambientLightColor.value=r.state.ambient,g.directionalLights.value=r.state.directional,g.spotLights.value=r.state.spot,g.rectAreaLights.value=r.state.rectArea,g.pointLights.value=r.state.point,g.hemisphereLights.value=r.state.hemi,g.directionalShadowMap.value=r.state.directionalShadowMap,g.directionalShadowMatrix.value=r.state.directionalShadowMatrix,g.spotShadowMap.value=r.state.spotShadowMap,g.spotShadowMatrix.value=r.state.spotShadowMatrix,g.pointShadowMap.value=r.state.pointShadowMap,g.pointShadowMatrix.value=r.state.pointShadowMatrix);var v=i.program.getUniforms(),y=Oi.seqWithValue(v.seq,g);i.uniformsList=y}function Gt(t,e,n,i){ct=0;var r=L.get(n),o=m.state.lights,a=r.lightsHash,s=o.state.hash;if(_t&&(xt||t!==ot)){var h=t===ot&&n.id===nt;yt.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,r,h)}!1===n.needsUpdate&&(void 0===r.program?n.needsUpdate=!0:n.fog&&r.fog!==e?n.needsUpdate=!0:(!n.lights||a.stateID===s.stateID&&a.directionalLength===s.directionalLength&&a.pointLength===s.pointLength&&a.spotLength===s.spotLength&&a.rectAreaLength===s.rectAreaLength&&a.hemiLength===s.hemiLength&&a.shadowsLength===s.shadowsLength)&&(void 0===r.numClippingPlanes||r.numClippingPlanes===yt.numPlanes&&r.numIntersection===yt.numIntersection)||(n.needsUpdate=!0)),n.needsUpdate&&(jt(n,e,i),n.needsUpdate=!1);var u=!1,c=!1,l=!1,f=r.program,d=f.getUniforms(),p=r.shader.uniforms;if(w.useProgram(f.program)&&(u=!0,c=!0,l=!0),n.id!==nt&&(nt=n.id,c=!0),u||ot!==t){if(d.setValue(y,"projectionMatrix",t.projectionMatrix),x.logarithmicDepthBuffer&&d.setValue(y,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),ot!==t&&(ot=t,c=!0,l=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var v=d.map.cameraPosition;void 0!==v&&v.setValue(y,bt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&d.setValue(y,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){d.setOptional(y,i,"bindMatrix"),d.setOptional(y,i,"bindMatrixInverse");var _=i.skeleton;if(_){var b=_.bones;if(x.floatVertexTextures){if(void 0===_.boneTexture){var M=Math.sqrt(4*b.length);M=ze.ceilPowerOfTwo(M),M=Math.max(M,4);var E=new Float32Array(M*M*4);E.set(_.boneMatrices);var S=new Ye(E,M,M,Ft,Lt);S.needsUpdate=!0,_.boneMatrices=E,_.boneTexture=S,_.boneTextureSize=M}d.setValue(y,"boneTexture",_.boneTexture),d.setValue(y,"boneTextureSize",_.boneTextureSize)}else d.setOptional(y,_,"boneMatrices")}}return c&&(d.setValue(y,"toneMappingExposure",U.toneMappingExposure),d.setValue(y,"toneMappingWhitePoint",U.toneMappingWhitePoint),n.lights&&function(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}(p,l),e&&n.fog&&function(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(p,e),n.isMeshBasicMaterial?Ht(p,n):n.isMeshLambertMaterial?(Ht(p,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(p,n)):n.isMeshPhongMaterial?(Ht(p,n),n.isMeshToonMaterial?function(t,e){Ut(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(p,n):Ut(p,n)):n.isMeshStandardMaterial?(Ht(p,n),n.isMeshPhysicalMaterial?function(t,e){Vt(t,e),t.reflectivity.value=e.reflectivity,t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness}(p,n):Vt(p,n)):n.isMeshDepthMaterial?(Ht(p,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(p,n)):n.isMeshDistanceMaterial?(Ht(p,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}(p,n)):n.isMeshNormalMaterial?(Ht(p,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===g&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===g&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(p,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}(p,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(p,n)):n.isPointsMaterial?function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*dt,t.scale.value=.5*ft,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(p,n):n.isSpriteMaterial?function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.rotation.value=e.rotation,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(p,n):n.isShadowMaterial&&(p.color.value=n.color,p.opacity.value=n.opacity),void 0!==p.ltc_1&&(p.ltc_1.value=on.LTC_1),void 0!==p.ltc_2&&(p.ltc_2.value=on.LTC_2),Oi.upload(y,r.uniformsList,p,U)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Oi.upload(y,r.uniformsList,p,U),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&d.setValue(y,"center",i.center),d.setValue(y,"modelViewMatrix",i.modelViewMatrix),d.setValue(y,"normalMatrix",i.normalMatrix),d.setValue(y,"modelMatrix",i.matrixWorld),f}function Ht(t,e){var n;t.opacity.value=e.opacity,e.color&&(t.diffuse.value=e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap&&e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=L.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function Ut(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===g&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===g&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function Vt(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===g&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===g&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}Nt.setAnimationLoop(function(t){Ct.isPresenting()||kt&&kt(t)}),"undefined"!=typeof window&&Nt.setContext(window),this.setAnimationLoop=function(t){kt=t,Ct.setAnimationLoop(t),Nt.start()},this.render=function(t,e,n,i){if(e&&e.isCamera){if(!V){rt.geometry=null,rt.program=null,rt.wireframe=!1,nt=-1,ot=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),Ct.enabled&&(e=Ct.getCamera(e)),(m=z.get(t,e)).init(),t.onBeforeRender(U,t,e,n),wt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),vt.setFromMatrix(wt),xt=this.localClippingEnabled,_t=yt.init(this.clippingPlanes,xt,e),(p=N.get(t,e)).init(),function t(e,n,i){if(!1===e.visible)return;var r=e.layers.test(n.layers);if(r)if(e.isLight)m.pushLight(e),e.castShadow&&m.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||vt.intersectsSprite(e)){i&&bt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(wt);var o=D.update(e),a=e.material;p.push(e,o,a,bt.z,null)}}else if(e.isImmediateRenderObject)i&&bt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(wt),p.push(e,null,e.material,bt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||vt.intersectsObject(e))){i&&bt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(wt);var o=D.update(e),a=e.material;if(Array.isArray(a))for(var s=o.groups,h=0,u=s.length;h=x.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+x.maxTextures),ct+=1,t},this.setTexture2D=function(){var t=!1;return function(e,n){e&&e.isWebGLRenderTarget&&(t||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),R.setTexture2D(e,n)}}(),this.setTexture=function(){var t=!1;return function(e,n){t||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),t=!0),R.setTexture2D(e,n)}}(),this.setTextureCube=function(){var t=!1;return function(e,n){e&&e.isWebGLRenderTargetCube&&(t||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?R.setTextureCube(e,n):R.setTextureCubeDynamic(e,n)}}(),this.setFramebuffer=function(t){$=t},this.getRenderTarget=function(){return tt},this.setRenderTarget=function(t){tt=t,t&&void 0===L.get(t).__webglFramebuffer&&R.setupRenderTarget(t);var e=$,n=!1;if(t){var i=L.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(e=i[t.activeCubeFace],n=!0):e=i,st.copy(t.viewport),ht.copy(t.scissor),ut=t.scissorTest}else st.copy(pt).multiplyScalar(dt),ht.copy(mt).multiplyScalar(dt),ut=gt;if(et!==e&&(y.bindFramebuffer(y.FRAMEBUFFER,e),et=e),w.viewport(st),w.scissor(ht),w.setScissorTest(ut),n){var r=L.get(t.texture);y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,r.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,n,i,r,o){if(t&&t.isWebGLRenderTarget){var a=L.get(t).__webglFramebuffer;if(a){var s=!1;a!==et&&(y.bindFramebuffer(y.FRAMEBUFFER,a),s=!0);try{var h=t.texture,u=h.format,c=h.type;if(u!==Ft&&H.convert(u)!==y.getParameter(y.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===Et||H.convert(c)===y.getParameter(y.IMPLEMENTATION_COLOR_READ_TYPE)||c===Lt&&(x.isWebGL2||_.get("OES_texture_float")||_.get("WEBGL_color_buffer_float"))||c===Rt&&(x.isWebGL2?_.get("EXT_color_buffer_float"):_.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");y.checkFramebufferStatus(y.FRAMEBUFFER)===y.FRAMEBUFFER_COMPLETE?e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&y.readPixels(e,n,i,r,H.convert(u),H.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&y.bindFramebuffer(y.FRAMEBUFFER,et)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){var i=e.image.width,r=e.image.height,o=H.convert(e.format);this.setTexture2D(e,0),y.copyTexImage2D(y.TEXTURE_2D,n||0,o,t.x,t.y,i,r,0)},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,o=e.image.height,a=H.convert(n.format),s=H.convert(n.type);this.setTexture2D(n,0),e.isDataTexture?y.texSubImage2D(y.TEXTURE_2D,i||0,t.x,t.y,r,o,a,s,e.image.data):y.texSubImage2D(y.TEXTURE_2D,i||0,t.x,t.y,a,s,e.image)}}function sr(t,e){this.name="",this.color=new rn(t),this.density=void 0!==e?e:25e-5}function hr(t,e,n){this.name="",this.color=new rn(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function ur(){fn.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function cr(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function lr(t,e,n,i){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===i}function fr(t){zn.call(this),this.type="SpriteMaterial",this.color=new rn(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function dr(t){if(fn.call(this),this.type="Sprite",void 0===qi){qi=new Rn;var e=new cr(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);qi.setIndex([0,1,2,0,2,3]),qi.addAttribute("position",new lr(e,3,0,!1)),qi.addAttribute("uv",new lr(e,2,3,!1))}this.geometry=qi,this.material=void 0!==t?t:new fr,this.center=new Fe(.5,.5)}function pr(){fn.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function mr(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n=0?(t(g-1e-5,m,l),f.subVectors(c,l)):(t(g+1e-5,m,l),f.subVectors(l,c)),m-1e-5>=0?(t(g,m-1e-5,l),d.subVectors(c,l)):(t(g,m+1e-5,l),d.subVectors(l,c)),u.crossVectors(f,d).normalize(),s.push(u.x,u.y,u.z),h.push(g,m)}}for(i=0;i.9&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),i<.2&&(o[t+4]+=1))}}()}(),this.addAttribute("position",new Tn(r,3)),this.addAttribute("normal",new Tn(r.slice(),3)),this.addAttribute("uv",new Tn(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function Ir(t,e){vn.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Dr(t,e)),this.mergeVertices()}function Dr(t,e){Or.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function kr(t,e){vn.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Nr(t,e)),this.mergeVertices()}function Nr(t,e){Or.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function zr(t,e){vn.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Fr(t,e)),this.mergeVertices()}function Fr(t,e){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Or.call(this,i,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Br(t,e){vn.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new jr(t,e)),this.mergeVertices()}function jr(t,e){var n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];Or.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Gr(t,e,n,i,r,o){vn.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Hr(t,e,n,i,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Hr(t,e,n,i,r){Rn.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},e=e||64,n=n||1,i=i||8,r=r||!1;var o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,h=new Ge,u=new Ge,c=new Fe,l=new Ge,f=[],d=[],p=[],m=[];function g(r){l=t.getPointAt(r/e,l);var a=o.normals[r],c=o.binormals[r];for(s=0;s<=i;s++){var p=s/i*Math.PI*2,m=Math.sin(p),g=-Math.cos(p);u.x=g*a.x+m*c.x,u.y=g*a.y+m*c.y,u.z=g*a.z+m*c.z,u.normalize(),d.push(u.x,u.y,u.z),h.x=l.x+n*u.x,h.y=l.y+n*u.y,h.z=l.z+n*u.z,f.push(h.x,h.y,h.z)}}!function(){for(a=0;ai.far||r.push({distance:y,point:t.clone(),uv:Gn.getUV(t,a,s,h,u,c,l,new Fe),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return fn.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),pr.prototype=Object.assign(Object.create(fn.prototype),{constructor:pr,copy:function(t){fn.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n1){t.setFromMatrixPosition(n.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var r=t.distanceTo(e);i[0].object.visible=!0;for(var o=1,a=i.length;o=i[o].distance;o++)i[o-1].object.visible=!1,i[o].object.visible=!0;for(;ou))d.applyMatrix4(this.matrixWorld),(E=i.ray.origin.distanceTo(d))i.far||r.push({distance:E,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(y=0,_=g.length/3-1;y<_;y+=p){if(c.fromArray(g,3*y),l.fromArray(g,3*y+3),!(e.distanceSqToSegment(c,l,d,f)>u))d.applyMatrix4(this.matrixWorld),(E=i.ray.origin.distanceTo(d))i.far||r.push({distance:E,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else if(a.isGeometry){var b=a.vertices,M=b.length;for(y=0;yu))d.applyMatrix4(this.matrixWorld),(E=i.ray.origin.distanceTo(d))i.far||r.push({distance:E,point:f.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),xr.prototype=Object.assign(Object.create(_r.prototype),{constructor:xr,isLineSegments:!0,computeLineDistances:function(){var t=new Ge,e=new Ge;return function(){var n=this.geometry;if(n.isBufferGeometry)if(null===n.index){for(var i=n.attributes.position,r=[],o=0,a=i.count;oi.far)return;r.push({distance:h,distanceToRay:Math.sqrt(a),point:f.clone(),index:n,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Er.prototype=Object.assign(Object.create(We.prototype),{constructor:Er,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Sr.prototype=Object.create(We.prototype),Sr.prototype.constructor=Sr,Sr.prototype.isCompressedTexture=!0,Tr.prototype=Object.create(We.prototype),Tr.prototype.constructor=Tr,Tr.prototype.isCanvasTexture=!0,Cr.prototype=Object.create(We.prototype),Cr.prototype.constructor=Cr,Cr.prototype.isDepthTexture=!0,Pr.prototype=Object.create(Rn.prototype),Pr.prototype.constructor=Pr,Ar.prototype=Object.create(vn.prototype),Ar.prototype.constructor=Ar,Lr.prototype=Object.create(Rn.prototype),Lr.prototype.constructor=Lr,Rr.prototype=Object.create(vn.prototype),Rr.prototype.constructor=Rr,Or.prototype=Object.create(Rn.prototype),Or.prototype.constructor=Or,Ir.prototype=Object.create(vn.prototype),Ir.prototype.constructor=Ir,Dr.prototype=Object.create(Or.prototype),Dr.prototype.constructor=Dr,kr.prototype=Object.create(vn.prototype),kr.prototype.constructor=kr,Nr.prototype=Object.create(Or.prototype),Nr.prototype.constructor=Nr,zr.prototype=Object.create(vn.prototype),zr.prototype.constructor=zr,Fr.prototype=Object.create(Or.prototype),Fr.prototype.constructor=Fr,Br.prototype=Object.create(vn.prototype),Br.prototype.constructor=Br,jr.prototype=Object.create(Or.prototype),jr.prototype.constructor=jr,Gr.prototype=Object.create(vn.prototype),Gr.prototype.constructor=Gr,Hr.prototype=Object.create(Rn.prototype),Hr.prototype.constructor=Hr,Ur.prototype=Object.create(vn.prototype),Ur.prototype.constructor=Ur,Vr.prototype=Object.create(Rn.prototype),Vr.prototype.constructor=Vr,Wr.prototype=Object.create(vn.prototype),Wr.prototype.constructor=Wr,Zr.prototype=Object.create(Rn.prototype),Zr.prototype.constructor=Zr;var qr=function(t,e,n){n=n||2;var i,r,o,a,s,h,u,c=e&&e.length,l=c?e[0]*n:t.length,f=Xr(t,0,l,n,!0),d=[];if(!f)return d;if(c&&(f=function(t,e,n,i){var r,o,a,s,h,u=[];for(r=0,o=e.length;r80*n){i=o=t[0],r=a=t[1];for(var p=n;po&&(o=s),h>a&&(a=h);u=0!==(u=Math.max(o-i,a-r))?1/u:0}return Jr(f,d,n,i,r,u),d};function Xr(t,e,n,i,r){var o,a;if(r===function(t,e,n,i){for(var r=0,o=e,a=n-i;o0)for(o=e;o=e;o-=i)a=fo(o,t[o],t[o+1],a);return a&&ho(a,a.next)&&(po(a),a=a.next),a}function Yr(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!ho(i,i.next)&&0!==so(i.prev,i,i.next))i=i.next;else{if(po(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function Jr(t,e,n,i,r,o,a){if(t){!a&&o&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=io(r.x,r.y,e,n,i)),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,n,i,r,o,a,s,h,u=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,i=n,s=0,e=0;e0||h>0&&i;)0!==s&&(0===h||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,h--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(a>1)}(r)}(t,i,r,o);for(var s,h,u=t;t.prev!==t.next;)if(s=t.prev,h=t.next,o?Qr(t,i,r,o):Kr(t))e.push(s.i/n),e.push(t.i/n),e.push(h.i/n),po(t),t=h.next,u=h.next;else if((t=h)===u){a?1===a?Jr(t=$r(t,e,n),e,n,i,r,o,2):2===a&&to(t,e,n,i,r,o):Jr(Yr(t),e,n,i,r,o,1);break}}}function Kr(t){var e=t.prev,n=t,i=t.next;if(so(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(oo(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&so(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Qr(t,e,n,i){var r=t.prev,o=t,a=t.next;if(so(r,o,a)>=0)return!1;for(var s=r.xo.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,c=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,l=io(s,h,e,n,i),f=io(u,c,e,n,i),d=t.nextZ;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&oo(r.x,r.y,o.x,o.y,a.x,a.y,d.x,d.y)&&so(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=l;){if(d!==t.prev&&d!==t.next&&oo(r.x,r.y,o.x,o.y,a.x,a.y,d.x,d.y)&&so(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function $r(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!ho(r,o)&&uo(r,i,i.next,o)&&co(r,o)&&co(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),po(i),po(i.next),i=t=o),i=i.next}while(i!==t);return i}function to(t,e,n,i,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ao(a,s)){var h=lo(a,s);return a=Yr(a,a.next),h=Yr(h,h.next),Jr(a,e,n,i,r,o),void Jr(h,e,n,i,r,o)}s=s.next}a=a.next}while(a!==t)}function eo(t,e){return t.x-e.x}function no(t,e){if(e=function(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>a){if(a=s,s===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x=i.x&&i.x>=c&&r!==i.x&&oo(on.x)&&co(i,t)&&(n=i,f=h),i=i.next;return n}(t,e)){var n=lo(e,t);Yr(n,n.next)}}function io(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ro(t){var e=t,n=t;do{e.x=0&&(t-a)*(i-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(r-a)*(i-s)>=0}function ao(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&uo(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&co(t,e)&&co(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)}function so(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ho(t,e){return t.x===e.x&&t.y===e.y}function uo(t,e,n,i){return!!(ho(t,e)&&ho(n,i)||ho(t,i)&&ho(n,e))||so(t,e,n)>0!=so(t,e,i)>0&&so(n,i,t)>0!=so(n,i,e)>0}function co(t,e){return so(t.prev,t,t.next)<0?so(t,e,t.next)>=0&&so(t,t.prev,e)>=0:so(t,e,t.prev)<0||so(t,t.next,e)<0}function lo(t,e){var n=new mo(t.i,t.x,t.y),i=new mo(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function fo(t,e,n,i){var r=new mo(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function po(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 mo(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var go={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function yo(t,e){for(var n=0;nNumber.EPSILON){var f=Math.sqrt(c),d=Math.sqrt(h*h+u*u),p=e.x-s/f,m=e.y+a/f,g=((n.x-u/d-p)*u-(n.y+h/d-m)*h)/(a*u-s*h),v=(i=p+a*g-t.x)*i+(r=m+s*g-t.y)*r;if(v<=2)return new Fe(i,r);o=Math.sqrt(v/2)}else{var y=!1;a>Number.EPSILON?h>Number.EPSILON&&(y=!0):a<-Number.EPSILON?h<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),y?(i=-s,r=a,o=Math.sqrt(c)):(i=a,r=s,o=Math.sqrt(c/2))}return new Fe(i/o,r/o)}for(var B=[],j=0,G=P.length,H=G-1,U=j+1;j=0;L--){for(O=L/f,I=c*Math.cos(O*Math.PI/2),R=l*Math.sin(O*Math.PI/2),j=0,G=P.length;j=0;){n=j,(i=j-1)<0&&(i=t.length-1);var r=0,o=s+2*f;for(r=0;r0)&&p.push(w,b,E),(h!==n-1||u0&&v(!0),e>0&&v(!1)),this.setIndex(u),this.addAttribute("position",new Tn(c,3)),this.addAttribute("normal",new Tn(l,3)),this.addAttribute("uv",new Tn(f,2))}function zo(t,e,n,i,r,o,a){ko.call(this,0,t,e,n,i,r,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Fo(t,e,n,i,r,o,a){No.call(this,0,t,e,n,i,r,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Bo(t,e,n,i){vn.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new jo(t,e,n,i)),this.mergeVertices()}function jo(t,e,n,i){Rn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,o,a=[],s=[],h=[],u=[],c=new Ge,l=new Fe;for(s.push(0,0,0),h.push(0,0,1),u.push(.5,.5),o=0,r=3;o<=e;o++,r+=3){var f=n+o/e*i;c.x=t*Math.cos(f),c.y=t*Math.sin(f),s.push(c.x,c.y,c.z),h.push(0,0,1),l.x=(s[r]/t+1)/2,l.y=(s[r+1]/t+1)/2,u.push(l.x,l.y)}for(r=1;r<=e;r++)a.push(r,r+1,0);this.setIndex(a),this.addAttribute("position",new Tn(s,3)),this.addAttribute("normal",new Tn(h,3)),this.addAttribute("uv",new Tn(u,2))}Mo.prototype=Object.create(vn.prototype),Mo.prototype.constructor=Mo,Eo.prototype=Object.create(xo.prototype),Eo.prototype.constructor=Eo,So.prototype=Object.create(vn.prototype),So.prototype.constructor=So,To.prototype=Object.create(Rn.prototype),To.prototype.constructor=To,Co.prototype=Object.create(vn.prototype),Co.prototype.constructor=Co,Po.prototype=Object.create(Rn.prototype),Po.prototype.constructor=Po,Ao.prototype=Object.create(vn.prototype),Ao.prototype.constructor=Ao,Lo.prototype=Object.create(Rn.prototype),Lo.prototype.constructor=Lo,Ro.prototype=Object.create(vn.prototype),Ro.prototype.constructor=Ro,Ro.prototype.toJSON=function(){var t=vn.prototype.toJSON.call(this);return Io(this.parameters.shapes,t)},Oo.prototype=Object.create(Rn.prototype),Oo.prototype.constructor=Oo,Oo.prototype.toJSON=function(){var t=Rn.prototype.toJSON.call(this);return Io(this.parameters.shapes,t)},Do.prototype=Object.create(Rn.prototype),Do.prototype.constructor=Do,ko.prototype=Object.create(vn.prototype),ko.prototype.constructor=ko,No.prototype=Object.create(Rn.prototype),No.prototype.constructor=No,zo.prototype=Object.create(ko.prototype),zo.prototype.constructor=zo,Fo.prototype=Object.create(No.prototype),Fo.prototype.constructor=Fo,Bo.prototype=Object.create(vn.prototype),Bo.prototype.constructor=Bo,jo.prototype=Object.create(Rn.prototype),jo.prototype.constructor=jo;var Go=Object.freeze({WireframeGeometry:Pr,ParametricGeometry:Ar,ParametricBufferGeometry:Lr,TetrahedronGeometry:Ir,TetrahedronBufferGeometry:Dr,OctahedronGeometry:kr,OctahedronBufferGeometry:Nr,IcosahedronGeometry:zr,IcosahedronBufferGeometry:Fr,DodecahedronGeometry:Br,DodecahedronBufferGeometry:jr,PolyhedronGeometry:Rr,PolyhedronBufferGeometry:Or,TubeGeometry:Gr,TubeBufferGeometry:Hr,TorusKnotGeometry:Ur,TorusKnotBufferGeometry:Vr,TorusGeometry:Wr,TorusBufferGeometry:Zr,TextGeometry:Mo,TextBufferGeometry:Eo,SphereGeometry:So,SphereBufferGeometry:To,RingGeometry:Co,RingBufferGeometry:Po,PlaneGeometry:Dn,PlaneBufferGeometry:kn,LatheGeometry:Ao,LatheBufferGeometry:Lo,ShapeGeometry:Ro,ShapeBufferGeometry:Oo,ExtrudeGeometry:_o,ExtrudeBufferGeometry:xo,EdgesGeometry:Do,ConeGeometry:zo,ConeBufferGeometry:Fo,CylinderGeometry:ko,CylinderBufferGeometry:No,CircleGeometry:Bo,CircleBufferGeometry:jo,BoxGeometry:On,BoxBufferGeometry:In});function Ho(t){zn.call(this),this.type="ShadowMaterial",this.color=new rn(0),this.transparent=!0,this.setValues(t)}function Uo(t){Bn.call(this,t),this.type="RawShaderMaterial"}function Vo(t){zn.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new rn(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ke,this.normalScale=new Fe(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.setValues(t)}function Wo(t){Vo.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function Zo(t){zn.call(this),this.type="MeshPhongMaterial",this.color=new rn(16777215),this.specular=new rn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ke,this.normalScale=new Fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$,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 qo(t){Zo.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function Xo(t){zn.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ke,this.normalScale=new Fe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Yo(t){zn.call(this),this.type="MeshLambertMaterial",this.color=new rn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new rn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$,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 Jo(t){yr.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Ho.prototype=Object.create(zn.prototype),Ho.prototype.constructor=Ho,Ho.prototype.isShadowMaterial=!0,Ho.prototype.copy=function(t){return zn.prototype.copy.call(this,t),this.color.copy(t.color),this},Uo.prototype=Object.create(Bn.prototype),Uo.prototype.constructor=Uo,Uo.prototype.isRawShaderMaterial=!0,Vo.prototype=Object.create(zn.prototype),Vo.prototype.constructor=Vo,Vo.prototype.isMeshStandardMaterial=!0,Vo.prototype.copy=function(t){return zn.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},Wo.prototype=Object.create(Vo.prototype),Wo.prototype.constructor=Wo,Wo.prototype.isMeshPhysicalMaterial=!0,Wo.prototype.copy=function(t){return Vo.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},Zo.prototype=Object.create(zn.prototype),Zo.prototype.constructor=Zo,Zo.prototype.isMeshPhongMaterial=!0,Zo.prototype.copy=function(t){return zn.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},qo.prototype=Object.create(Zo.prototype),qo.prototype.constructor=qo,qo.prototype.isMeshToonMaterial=!0,qo.prototype.copy=function(t){return Zo.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},Xo.prototype=Object.create(zn.prototype),Xo.prototype.constructor=Xo,Xo.prototype.isMeshNormalMaterial=!0,Xo.prototype.copy=function(t){return zn.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},Yo.prototype=Object.create(zn.prototype),Yo.prototype.constructor=Yo,Yo.prototype.isMeshLambertMaterial=!0,Yo.prototype.copy=function(t){return zn.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},Jo.prototype=Object.create(yr.prototype),Jo.prototype.constructor=Jo,Jo.prototype.isLineDashedMaterial=!0,Jo.prototype.copy=function(t){return yr.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Ko=Object.freeze({ShadowMaterial:Ho,SpriteMaterial:fr,RawShaderMaterial:Uo,ShaderMaterial:Bn,PointsMaterial:br,MeshPhysicalMaterial:Wo,MeshStandardMaterial:Vo,MeshPhongMaterial:Zo,MeshToonMaterial:qo,MeshNormalMaterial:Xo,MeshLambertMaterial:Yo,MeshDepthMaterial:Ki,MeshDistanceMaterial:Qi,MeshBasicMaterial:Fn,LineDashedMaterial:Jo,LineBasicMaterial:yr,Material:zn}),Qo={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 $o(t,e,n){var i=this,r=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,a),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,a),o===a&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}var ta=new $o,ea={};function na(t){this.manager=void 0!==t?t:ta}function ia(t){this.manager=void 0!==t?t:ta,this._parser=null}function ra(t){this.manager=void 0!==t?t:ta,this._parser=null}function oa(t){this.manager=void 0!==t?t:ta}function aa(t){this.manager=void 0!==t?t:ta}function sa(t){this.manager=void 0!==t?t:ta}function ha(){this.type="Curve",this.arcLengthDivisions=200}function ua(t,e,n,i,r,o,a,s){ha.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function ca(t,e,n,i,r,o){ua.call(this,t,e,n,n,i,r,o),this.type="ArcCurve"}function la(){var t=0,e=0,n=0,i=0;function r(r,o,a,s){t=r,e=a,n=-3*r+3*o-2*a-s,i=2*r-2*o+a+s}return{initCatmullRom:function(t,e,n,i,o){r(e,n,o*(n-t),o*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,o,a,s){var h=(e-t)/o-(n-t)/(o+a)+(n-e)/a,u=(n-e)/a-(i-e)/(a+s)+(i-n)/s;r(e,n,h*=a,u*=a)},calc:function(r){var o=r*r;return t+e*r+n*o+i*(o*r)}}}Object.assign(na.prototype,{load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=Qo.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;if(void 0===ea[t]){var a=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],h=!!a[2],u=a[3];u=window.decodeURIComponent(u),h&&(u=window.atob(u));try{var c,l=(this.responseType||"").toLowerCase();switch(l){case"arraybuffer":case"blob":for(var f=new Uint8Array(u.length),d=0;d0||0===t.search(/^data\:image\/jpeg/);r.format=i?zt:Ft,r.needsUpdate=!0,void 0!==e&&e(r)},n,i),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(ha.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var 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;var e,n,i=[],r=this.getPoint(0),o=0;for(i.push(0),n=1;n<=t;n++)o+=(e=this.getPoint(n/t)).distanceTo(r),i.push(o),r=e;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,o=i.length;n=e||t*i[o-1];for(var a,s=0,h=o-1;s<=h;)if((a=i[r=Math.floor(s+(h-s)/2)]-n)<0)s=r+1;else{if(!(a>0)){h=r;break}h=r-1}if(i[r=h]===n)return r/(o-1);var u=i[r];return(r+(n-u)/(i[r+1]-u))/(o-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),n>1&&(n=1);var i=this.getPoint(e);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,i,r,o=new Ge,a=[],s=[],h=[],u=new Ge,c=new Be;for(n=0;n<=t;n++)i=n/t,a[n]=this.getTangentAt(i),a[n].normalize();s[0]=new Ge,h[0]=new Ge;var l=Number.MAX_VALUE,f=Math.abs(a[0].x),d=Math.abs(a[0].y),p=Math.abs(a[0].z);for(f<=l&&(l=f,o.set(1,0,0)),d<=l&&(l=d,o.set(0,1,0)),p<=l&&o.set(0,0,1),u.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],u),h[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),h[n]=h[n-1].clone(),u.crossVectors(a[n-1],a[n]),u.length()>Number.EPSILON&&(u.normalize(),r=Math.acos(ze.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(c.makeRotationAxis(u,r))),h[n].crossVectors(a[n],s[n]);if(!0===e)for(r=Math.acos(ze.clamp(s[0].dot(s[t]),-1,1)),r/=t,a[0].dot(u.crossVectors(s[0],s[t]))>0&&(r=-r),n=1;n<=t;n++)s[n].applyMatrix4(c.makeRotationAxis(a[n],r*n)),h[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:h}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var 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}}),ua.prototype=Object.create(ha.prototype),ua.prototype.constructor=ua,ua.prototype.isEllipseCurve=!0,ua.prototype.getPoint=function(t,e){for(var n=e||new Fe,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(c)/h)+1)*h:0===l&&c===h-1&&(c=h-2,l=1),this.closed||c>0?n=s[(c-1)%h]:(fa.subVectors(s[0],s[1]).add(s[0]),n=fa),i=s[c%h],r=s[(c+1)%h],this.closed||c+2i.length-2?i.length-1:o+1],c=i[o>i.length-3?i.length-1:o+2];return n.set(va(a,s.x,h.x,u.x,c.x),va(a,s.y,h.y,u.y,c.y)),n},Ta.prototype.copy=function(t){ha.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e=e){var r=n[i]-e,o=this.curves[i],a=o.getLength(),s=0===a?0:1-r/a;return o.getPointAt(s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,i=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){ha.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e0){var u=h.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(h);var c=h.getPoint(1);this.currentPoint.copy(c)},copy:function(t){return Pa.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Pa.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Pa.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),La.prototype=Object.assign(Object.create(Aa.prototype),{constructor:La,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n=r)break t;var s=e[1];t=(r=e[--n-1]))break e}o=n,n=0}for(;n>>1;te;)--o;if(++o,0!==r||o!==i){r>=o&&(r=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Ga.arraySlice(n,r,o),this.values=Ga.arraySlice(this.values,r*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==r;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==i&&Ga.isTypedArray(i)){a=0;for(var h=i.length;a!==h;++a){var u=i[a];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,u),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),i=this.getInterpolation()===ye,r=1,o=t.length-1,a=1;a0){t[r]=t[o];for(p=o*n,m=r*n,f=0;f!==n;++f)e[m+f]=e[p+f];++r}return r!==t.length&&(this.times=Ga.arraySlice(t,0,r),this.values=Ga.arraySlice(e,0,r*n)),this}}),qa.prototype=Object.assign(Object.create(Za.prototype),{constructor:qa,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:ge,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Xa.prototype=Object.assign(Object.create(Za.prototype),{constructor:Xa,ValueTypeName:"color"}),Ya.prototype=Object.assign(Object.create(Za.prototype),{constructor:Ya,ValueTypeName:"number"}),Ja.prototype=Object.assign(Object.create(Ha.prototype),{constructor:Ja,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,h=(n-e)/(i-e),u=s+a;s!==u;s+=4)je.slerpFlat(r,0,o,s-a,o,s,h);return r}}),Ka.prototype=Object.assign(Object.create(Za.prototype),{constructor:Ka,ValueTypeName:"quaternion",DefaultInterpolation:ve,InterpolantFactoryMethodLinear:function(t){return new Ja(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Qa.prototype=Object.assign(Object.create(Za.prototype),{constructor:Qa,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:ge,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),$a.prototype=Object.assign(Object.create(Za.prototype),{constructor:$a,ValueTypeName:"vector"}),Object.assign(ts,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,o=n.length;r!==o;++r)e.push(es(n[r]).scale(i));return new ts(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,o=n.length;r!==o;++r)e.push(Za.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,o=[],a=0;a1){var u=i[l=h[1]];u||(i[l]=u=[]),u.push(s)}}var c=[];for(var l in i)c.push(ts.CreateFromMorphTargetSequence(l,i[l],e,n));return c},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){if(0!==n.length){var o=[],a=[];Ga.flattenJSON(n,o,a,i),0!==o.length&&r.push(new t(e,o,a))}},i=[],r=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],h=0;h1?t.skinWeights[i+1]:0,s=n>2?t.skinWeights[i+2]:0,h=n>3?t.skinWeights[i+3]:0;e.skinWeights.push(new Ze(o,a,s,h))}if(t.skinIndices)for(i=0,r=t.skinIndices.length;i1?t.skinIndices[i+1]:0,l=n>2?t.skinIndices[i+2]:0,f=n>3?t.skinIndices[i+3]:0;e.skinIndices.push(new Ze(u,c,l,f))}e.bones=t.bones,e.bones&&e.bones.length>0&&(e.skinWeights.length!==e.skinIndices.length||e.skinIndices.length!==e.vertices.length)&&console.warn("When skinning, number of vertices ("+e.vertices.length+"), skinIndices ("+e.skinIndices.length+"), and skinWeights ("+e.skinWeights.length+") should match.")}(t,n),function(t,e){var n=t.scale;if(void 0!==t.morphTargets)for(var i=0,r=t.morphTargets.length;i0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var c=e.faces,l=t.morphColors[0].colors;for(i=0,r=c.length;i0&&(e.animations=n)}(t,n),n.computeFaceNormals(),n.computeBoundingSphere(),void 0===t.materials||0===t.materials.length?{geometry:n}:{geometry:n,materials:os.prototype.initMaterials(t.materials,e,this.crossOrigin)}}}()}),Object.assign(hs.prototype,{crossOrigin:"anonymous",load:function(t,e,n,i){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var r=this;new na(r.manager).load(t,function(n){var o=null;try{o=JSON.parse(n)}catch(e){return void 0!==i&&i(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?r.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t+". Use THREE.JSONLoader instead.")},n,i)},setTexturePath:function(t){return this.texturePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){var n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),r=this.parseImages(t.images,function(){void 0!==e&&e(s)}),o=this.parseTextures(t.textures,r),a=this.parseMaterials(t.materials,o),s=this.parseObject(t.object,i,a);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,i=t.length;n0){var o=new oa(new $o(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a0?new vr(a,s):new Hn(a,s);break;case"LOD":i=new pr;break;case"Line":i=new _r(r(t.geometry),o(t.material),t.mode);break;case"LineLoop":i=new wr(r(t.geometry),o(t.material));break;case"LineSegments":i=new xr(r(t.geometry),o(t.material));break;case"PointCloud":case"Points":i=new Mr(r(t.geometry),o(t.material));break;case"Sprite":i=new dr(o(t.material));break;case"Group":i=new nr;break;default:i=new fn}if(i.uuid=t.uuid,void 0!==t.name&&(i.name=t.name),void 0!==t.matrix?(i.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(i.matrixAutoUpdate=t.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==t.position&&i.position.fromArray(t.position),void 0!==t.rotation&&i.rotation.fromArray(t.rotation),void 0!==t.quaternion&&i.quaternion.fromArray(t.quaternion),void 0!==t.scale&&i.scale.fromArray(t.scale)),void 0!==t.castShadow&&(i.castShadow=t.castShadow),void 0!==t.receiveShadow&&(i.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(i.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(i.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&i.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(i.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.frustumCulled&&(i.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(i.renderOrder=t.renderOrder),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.layers&&(i.layers.mask=t.layers),void 0!==t.children)for(var h=t.children,u=0;uNumber.EPSILON){if(u<0&&(a=e[o],h=-h,s=e[r],u=-u),t.ys.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var c=u*(t.x-a.x)-h*(t.y-a.y);if(0===c)return!0;if(c<0)continue;i=!i}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return i}var r=go.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,h,u=[];if(1===o.length)return s=o[0],(h=new La).curves=s.curves,u.push(h),u;var c=!r(o[0].getPoints());c=t?!c:c;var l,f,d=[],p=[],m=[],g=0;p[g]=void 0,m[g]=[];for(var v=0,y=o.length;v1){for(var _=!1,x=[],w=0,b=p.length;w0&&(_||(m=d))}v=0;for(var P=p.length;v0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t=.5)for(var o=0;o!==r;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,i){je.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var o=1-i,a=0;a!==r;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*i}}});var Cs,Ps;function As(t,e,n){var i=n||Ls.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function Ls(t,e,n){this.path=e,this.parsedPath=n||Ls.parseTrackName(e),this.node=Ls.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Rs(){this.uuid=ze.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Os(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,o=new Array(r),a={endingStart:_e,endingEnd:_e},s=0;s!==r;++s){var h=i[s].createInterpolant(null);o[s]=h,h.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=pe,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}function Is(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Ds(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function ks(){Rn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Ns(t,e,n){cr.call(this,t,e),this.meshPerAttribute=n||1}function zs(t,e,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),yn.call(this,t,e,n),this.meshPerAttribute=i||1}function Fs(t,e,n,i){this.ray=new jn(t,e),this.near=n||0,this.far=i||1/0,this.params={Mesh:{},Line:{},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 Bs(t,e){return t.distance-e.distance}function js(t,e,n,i){if(!1!==t.visible&&(t.raycast(e,n),!0===i))for(var r=t.children,o=0,a=r.length;o=e){var c=e++,l=t[c];n[l.uuid]=u,t[u]=l,n[h]=c,t[c]=s;for(var f=0,d=r;f!==d;++f){var p=i[f],m=p[c],g=p[u];p[u]=m,p[c]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,o=r.length,a=0,s=arguments.length;a!==s;++a){var h=arguments[a].uuid,u=i[h];if(void 0!==u)if(delete i[h],u0)for(var h=this._interpolants,u=this._propertyBindings,c=0,l=h.length;c!==l;++c)h[c].evaluate(a),u[c].accumulate(i,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,i=this.loop,r=this._loopCount,o=i===me;if(0===t)return-1===r?e:o&&1==(1&r)?n-e:e;if(i===de){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=n)e=n;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=n||e<0){var a=Math.floor(e/n);e-=n*a,r+=Math.abs(a);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?n:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var h=t<0;this._setEndings(h,!h,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1==(1&r))return this.time=e,n-e}return this.time=e,e},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=xe,i.endingEnd=xe):(i.endingStart=t?this.zeroSlopeAtStart?xe:_e:we,i.endingEnd=e?this.zeroSlopeAtEnd?xe:_e:we)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=r,s[0]=e,a[1]=r+t,s[1]=n,this}}),Is.prototype=Object.assign(Object.create(i.prototype),{constructor:Is,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,h=this._bindingsByRootAndName,u=h[s];void 0===u&&(u={},h[s]=u);for(var c=0;c!==r;++c){var l=i[c],f=l.name,d=u[f];if(void 0!==d)o[c]=d;else{if(void 0!==(d=o[c])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,f));continue}var p=e&&e._propertyBindings[c].binding.parsedPath;++(d=new Ts(Ls.create(n,f,p),l.ValueTypeName,l.getValueSize())).referenceCount,this._addInactiveBinding(d,s,f),o[c]=d}a[c].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,o=0,a=r.length;o!==a;++o){var s=r[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&ethis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new Fe),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:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new Fe),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Fe;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(Ws.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Ge),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Ge),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Ge),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new Ge,e=new Ge;return function(n,i){t.subVectors(n,this.start),e.subVectors(this.end,this.start);var r=e.dot(e),o=e.dot(t)/r;return i&&(o=ze.clamp(o,0,1)),o}}(),closestPointToPoint:function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Ge),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),Zs.prototype=Object.create(fn.prototype),Zs.prototype.constructor=Zs,Zs.prototype.isImmediateRenderObject=!0,qs.prototype=Object.create(xr.prototype),qs.prototype.constructor=qs,qs.prototype.update=function(){var t=new Ge,e=new Ge,n=new He;return function(){var i=["a","b","c"];this.object.updateMatrixWorld(!0),n.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,h=a.faces,u=0,c=0,l=h.length;c.99999?this.quaternion.set(0,0,0,1):n.y<-.99999?this.quaternion.set(1,0,0,0):(e.set(n.z,0,-n.x).normalize(),t=Math.acos(n.y),this.quaternion.setFromAxisAngle(e,t))}}(),sh.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},sh.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},hh.prototype=Object.create(xr.prototype),hh.prototype.constructor=hh;var ch=0,lh=1;function fh(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function dh(t){return void 0===t&&(t=[]),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 ph(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Mr(t,e)}function mh(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new dr(t)}function gh(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Mr(t,e)}function vh(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new br(t)}function yh(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new br(t)}function _h(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new br(t)}function xh(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Ge(t,e,n)}function wh(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new yn(t,e).setDynamic(!0)}function bh(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new _n(t,e)}function Mh(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new xn(t,e)}function Eh(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new wn(t,e)}function Sh(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new bn(t,e)}function Th(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Mn(t,e)}function Ch(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new En(t,e)}function Ph(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Sn(t,e)}function Ah(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Tn(t,e)}function Lh(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Cn(t,e)}function Rh(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ga.call(this,t),this.type="catmullrom",this.closed=!0}function Oh(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ga.call(this,t),this.type="catmullrom"}function Ih(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),ga.call(this,t),this.type="catmullrom"}function Dh(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new hh(t)}function kh(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new rh(t,e)}function Nh(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new xr(new Do(t.geometry),new yr({color:void 0!==e?e:16777215}))}function zh(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new xr(new Pr(t.geometry),new yr({color:void 0!==e?e:16777215}))}function Fh(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new na(t)}function Bh(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new ra(t)}ha.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(ha.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Pa.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new vn,n=0,i=t.length;n4&&".svg"===t.slice(-4)?1:"data:image/svg+xml"===t.slice(0,"data:image/svg+xml".length)?2:0}function A(t,e){C&&A.node?A.node(t,e):t.src=e[0]}!function(){if(C)return S=function(t){return setTimeout(t,16)},void(T=clearTimeout);var t,e,n=1e3/30;function i(t){return setTimeout(t,n)}function r(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}"undefined"!=typeof window?(t=window.requestAnimationFrame||r("RequestAnimationFrame")||i,e=window.cancelAnimationFrame||r("CancelAnimationFrame")||r("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)}):(t=i,e=clearTimeout),S=function(e){return t(e)},T=function(t){t&&e(t)}}();var L=0;function R(){return L++}var O=R;function I(t){return t&&y(t)?JSON.parse(t):t}function D(t){for(var e=1;e-1&&e.splice(n,1)}function N(t,e,n){if(!Array.isArray(t))return n?e.call(n,t):e(t);for(var i,r,o=[],a=0,s=t.length;a0?1:-1}function B(t){if(Math.log2)return Math.log2(t);var e=Math.log(t)*Math.LOG2E,n=Math.round(e);return Math.abs(n-e)<1e-14?n:e}function j(t,e,n){return t*(1-n)+e*n}function G(t,e,n){if(t===n||t===e)return t;var i=n-e;return((t-e)%i+i)%i+e}function H(t,e,n){return Math.min(n,Math.max(e,t))}function U(t){return Array.isArray(t)&&t.length>0}function V(t){if(!t)return!1;var e=t.slice(0,6);return"http:/"===e||"https:"===e||"file:/"===e}var W=/^url\((['"])(.+)\1\)$/i,Z=/^url\(([^'"].*[^'"])\)$/i;function q(t){if(!y(t))return 0;var e=t.slice(0,6);return"http:/"===e||"https:"===e?3:Z.test(t)?1:W.test(t)?2:0}function X(t){var e=q(t);return 3===e?t:1===e?Z.exec(t)[1]:2===e?W.exec(t)[2]:t}var Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function J(t){if("undefined"!=typeof window&&window.btoa)return window.btoa(t);for(var e,n,i=String(t),r="",o=0,a=Y;i.charAt(0|o)||(a="=",o%1);r+=a.charAt(63&e>>8-o%1*8)){if((n=i.charCodeAt(o+=.75))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");e=e<<8|n}return r}function K(t,e){for(var n=atob(t),i=new ArrayBuffer(n.length),r=new Uint8Array(i),o=0;o=e-n&&t<=e+n}function nt(t,e,n,i){t||(t=100),e||(e=4);var r=this;return e*=2,this._flashTimeout&&clearTimeout(this._flashTimeout),this._flashTimeout=setTimeout(function o(){if(0===e)return r.show(),void(n&&(i?n.call(i):n()));e%2==0?r.hide():r.show(),e--,r._flashTimeout=setTimeout(o,t)},t),this}var it=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function rt(t){return new Function("f","var p = (f && f.properties || {}); return "+ot(t))}function ot(t){if(!t)return"true";var e=t[0];return t.length<=1?"any"===e?"false":"true":"("+("=="===e?st(t[1],t[2],"===",!1):"!="===e?st(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?st(t[1],t[2],e,!0):"any"===e?ht(t.slice(1),"||"):"all"===e?ht(t.slice(1),"&&"):"none"===e?lt(ht(t.slice(1),"||")):"in"===e?ut(t[1],t.slice(2)):"!in"===e?lt(ut(t[1],t.slice(2))):"has"===e?ct(t[1]):"!has"===e?lt(ct(t[1])):"true")+")"}function at(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function st(t,e,n,i){var r=at(t),o="$type"===t?it.indexOf(e):JSON.stringify(e);return(i?"typeof "+r+"=== typeof "+o+"&&":"")+r+n+o}function ht(t,e){return t.map(ot).join(e)}function ut(t,e){"$type"===t&&(e=e.map(function(t){return it.indexOf(t)}));var n=JSON.stringify(e.sort(ft)),i=at(t);return e.length<=200?n+".indexOf("+i+") !== -1":"function(v, a, i, j) {\n while (i <= j) { var m = (i + j) >> 1;\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\n }\n return false; }("+i+", "+n+",0,"+(e.length-1)+")"}function ct(t){return"$id"===t?'"id" in f':JSON.stringify(t)+" in p"}function lt(t){return"!("+t+")"}function ft(t,e){return te?1:0}function dt(t){var e=t._toJSON(),n=e.feature;return n.type=it.indexOf(n.geometry.type),n.subType=e.subType,n}function pt(t){if(!Array.isArray(t))return pt([t]);for(var e=[],n=0;n=t.stops.length||e<=t.stops[i][0]);)i++;return 0===i?t.stops[i][1]:i===t.stops.length?t.stops[i-1][1]:function t(e,n,i,r,o,a){return"function"==typeof o?function(){var s=o.apply(void 0,arguments),h=a.apply(void 0,arguments);return t(e,n,i,r,s,h)}:o.length?function(t,e,n,i,r,o){for(var a=[],s=0;s");for(var g=0;g"),"data:image/svg+xml;base64,"+J(f.join(" "))}function Lt(t,e){if(!t)return[];var n=t;Array.isArray(t)||(n=[t]);for(var i,r,o,a,s=[],c=h,l=n.length-1;l>=0;l--)if(t=n[l]){e&&(t=Rt(t));for(var f=0;f=0;i--)n.push(t.colorStops[i].join());e.push(n.join(","))}return e.join("_")}function kt(t,e){function n(t,e){p(t.opacity)?t.opacity=e:t.opacity*=e}var i;if(Array.isArray(t)){i=[];for(var r=0;r1,language:navigator.browserLanguage?navigator.browserLanguage:navigator.language,ie9:Gt&&9===document.documentMode,ie10:Gt&&10===document.documentMode,webgl:ne}}var ae=Ft;function se(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function he(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var ue=function(){function t(t,e){if(p(t)||p(e)?p(t.x)||p(t.y)?Array.isArray(t)&&(this.x=+t[0],this.y=+t[1]):(this.x=+t.x,this.y=+t.y):(this.x=+t,this.y=+e),this._isNaN())throw new Error("Position is NaN")}var e=t.prototype;return e.abs=function(){return new this.constructor(Math.abs(this.x),Math.abs(this.y))},e._abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this},e._round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},e.round=function(){return new this.constructor(Math.round(this.x),Math.round(this.y))},e._ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},e.ceil=function(){return new this.constructor(Math.ceil(this.x),Math.ceil(this.y))},e._floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},e.floor=function(){return new this.constructor(Math.floor(this.x),Math.floor(this.y))},e.copy=function(){return new this.constructor(this.x,this.y)},e._add=function(t,e){return p(t.x)?p(t[0])?(this.x+=t,this.y+=e):(this.x+=t[0],this.y+=t[1]):(this.x+=t.x,this.y+=t.y),this},e.add=function(t,e){var n,i;return p(t.x)?p(t[0])?(n=this.x+t,i=this.y+e):(n=this.x+t[0],i=this.y+t[1]):(n=this.x+t.x,i=this.y+t.y),new this.constructor(n,i)},e._sub=function(t,e){return p(t.x)?p(t[0])?(this.x-=t,this.y-=e):(this.x-=t[0],this.y-=t[1]):(this.x-=t.x,this.y-=t.y),this},e._substract=function(){return this._sub.apply(this,arguments)},e.sub=function(t,e){var n,i;return p(t.x)?p(t[0])?(n=this.x-t,i=this.y-e):(n=this.x-t[0],i=this.y-t[1]):(n=this.x-t.x,i=this.y-t.y),new this.constructor(n,i)},e.substract=function(){return this.sub.apply(this,arguments)},e.multi=function(t){return new this.constructor(this.x*t,this.y*t)},e._multi=function(t){return this.x*=t,this.y*=t,this},e.div=function(t){return this.multi(1/t)},e._div=function(t){return this._multi(1/t)},e.equals=function(t){return t instanceof this.constructor&&(this.x===t.x&&this.y===t.y)},e._isNaN=function(){return isNaN(this.x)||isNaN(this.y)},e.isZero=function(){return 0===this.x&&0===this.y},e.toArray=function(){return[this.x,this.y]},e.toFixed=function(t){return new this.constructor(this.x.toFixed(t),this.y.toFixed(t))},e.toJSON=function(){return{x:this.x,y:this.y}},t}(),ce=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.closeTo=function(t,e){return e||(e=0),this.x>=t.x-e&&this.x<=t.x+e&&this.y>=t.y-e&&this.y<=t.y+e},n.distanceTo=function(t){var e=t.x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},n.mag=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},n.unit=function(){return this.copy()._unit()},n._unit=function(){return this._div(this.mag()),this},n.perp=function(){return this.copy()._perp()},n._perp=function(){var t=this.y;return this.y=this.x,this.x=-t,this},n.angleWith=function(t){return this.angleWithSep(t.x,t.y)},n.angleWithSep=function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},n._rotate=function(t){var e=Math.cos(t),n=Math.sin(t),i=e*this.x-n*this.y,r=n*this.x+e*this.y;return this.x=i,this.y=r,this},n.rotate=function(t){return this.copy()._rotate(t)},e}(ue),le=function(){function t(t,e){m(t)&&m(e)?(this.width=t,this.height=e):m(t.width)?(this.width=t.width,this.height=t.height):Array.isArray(t)&&(this.width=t[0],this.height=t[1])}var e=t.prototype;return e.copy=function(){return new t(this.width,this.height)},e.add=function(e,n){var i,r;return e instanceof t?(i=this.width+e.width,r=this.height+e.height):(i=this.width+e,r=this.height+n),new t(i,r)},e.equals=function(t){return this.width===t.width&&this.height===t.height},e.multi=function(e){return new t(this.width*e,this.height*e)},e._multi=function(t){return this.width*=t,this.height*=t,this},e._round=function(){return this.width=Math.round(this.width),this.height=Math.round(this.height),this},e.toPoint=function(){return new ce(this.width,this.height)},e.toArray=function(){return[this.width,this.height]},e.toJSON=function(){return{width:this.width,height:this.height}},t}();function fe(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}var de=/[\b\t\r\v\f]/gim;function pe(t){return y(t)?t.replace(de,""):t}function me(t){return fe(t).split(/\s+/)}var ge="undefined"!=typeof document?document.createElement("canvas").getContext("2d"):null;function ve(t,e){return ve.node?ve.node(t,e):(ge.font=e,ge.measureText(t).width)}var ye={};function _e(t,e){if(_e.node)return _e.node(t,e);var n=ve(t,e);return e||(e="_default_"),ye[e]||(ye[e]=xe(e)),new le(n,ye[e])}function xe(t){var e=tn();"_default_"!==t&&(e.style.font=t),e.innerHTML="秦";var n=e.clientHeight;return Ne(e),n}function we(t,e,n,i){if(!t||0===t.length)return[{text:"",width:0}];var r=p(i)?ve(t,e):i,o=r/t.length,a=Math.floor(n/o/2);if(o>=n||a<=0)return[{text:"",width:n}];if(r<=n)return[{text:t,width:r}];for(var s=[],h=t.substring(0,a),u=o*a,c=a,l=t.length;c=n?(s.push({text:h,width:u}),h=t.substring(c,a+c),c+=a-1,u=o*a):(h+=f,u=d),c>=l-1&&(u=ve(h),s.push({text:h,width:u}))}return s}var be=/\{([\w_]+)\}/g;function Me(t,e){return y(t)?t.replace(be,function(t,n){if(!e)return"";var i=e[n];return p(i)?"":Array.isArray(i)?i.join():i}):t}function Ee(t,e,n){var i=t.width,r=t.height;return new ce("left"===e?-i:"right"===e?0:-i/2,"top"===n?-r:"bottom"===n?0:-r/2)}var Se="monospace";function Te(t){return t.textFont?t.textFont:(t.textStyle&&"normal"!==t.textStyle?t.textStyle+" ":"")+(t.textWeight&&"normal"!==t.textWeight?t.textWeight+" ":"")+t.textSize+"px "+(t.textFaceName?'"'===t.textFaceName[0]?t.textFaceName:'"'+t.textFaceName+'"':Se)}function Ce(t,e){var n=Te(e),i=e.textLineSpacing||0,r=_e(t,n),o=r.width,a=r.height,s=e.textWrapCharacter,h=[],u=e.textWrapWidth;(!u||u>o)&&(u=o),y(t)||(t+="");var c=0;if(s&&t.indexOf(s)>=0)for(var l=t.split(s),f=0,d=l.length;fu)for(var g=we(p,n,u,m),v=0,_=g.length;v<_;v++){var x=g[v].width;x>c&&(c=x),h.push({text:g[v].text,size:new le(x,a)})}else m>c&&(c=m),h.push({text:p,size:new le(m,a)})}else if(o>u)for(var w=we(t,n,u,o),b=0;bc&&(c=M),h.push({text:w[b].text,size:new le(M,a)})}else o>c&&(c=o),h.push({text:t,size:r});var E=h.length;return{total:E,size:new le(c,a*E+i*(E-1)),rows:h,rawSize:r}}var Pe=Object.freeze({trim:fe,escapeSpecialChars:pe,splitWords:me,stringWidth:ve,stringLength:_e,getFontHeight:xe,splitContent:we,replaceVariable:Me,getAlignPoint:Ee,getFont:Te,splitTextToRow:Ce}),Ae=C?function(t){return t[0]}:function(t){for(var e=document.documentElement.style,n=0;n=0;a--){var s=o[a];if(s)t["Z__"+s]||(t["Z__"+s]=[]),Be(t,s,n)>=0&&Fe(t,s,n),t["Z__"+s].push({callback:r,src:n}),"mousewheel"===s&&ae.gecko&&(s="DOMMouseScroll"),t.addEventListener(s,r,!1)}return this}function Fe(t,e,n){function i(e,n){"mousewheel"===e&&ae.gecko&&(e="DOMMouseScroll"),t.removeEventListener(e,n,!1)}if(!t||!t.removeEventListener||!e)return this;for(var r=e.split(" "),o=r.length-1;o>=0;o--){var a=r[o];if(a){if(!n&&t["Z__"+a]){for(var s=t["Z__"+a],h=0,u=s.length;h=0&&t.indexOf(e,n)===n}(n,";")||(n+=";"),t.style.cssText=n+e,this}function qe(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=Je(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function Xe(t,e){if(void 0===t.classList||qe(t,e)){var n=Je(t);Ye(t,(n?n+" ":"")+e)}else for(var i=me(e),r=0,o=i.length;r/i.test(t)}function $e(t,e){var n=tn(t);y(e)?n.innerHTML=e:n.appendChild(e);var i=new le(n.clientWidth,n.clientHeight);return Ne(n),i}function tn(t){var e=document.createElement(t);return e.style.cssText="position:absolute;left:-10000px;top:-10000px;",document.body.appendChild(e),e}var en=ze,nn=Fe,rn=Object.freeze({TRANSFORM:Le,TRANSFORMORIGIN:Re,TRANSITION:Oe,CSSFILTER:Ie,createEl:De,createElOn:ke,removeDomNode:Ne,addDomEvent:ze,removeDomEvent:Fe,listensDomEvent:Be,preventDefault:je,stopPropagation:Ge,preventSelection:He,offsetDom:Ue,computeDomPosition:Ve,getEventContainerPoint:We,setStyle:Ze,hasClass:qe,addClass:Xe,setClass:Ye,getClass:Je,setOpacity:function(t,e){return t.style.opacity=e,this},setTransform:Ke,setTransformMatrix:function(t,e){var n="matrix("+(y(e)?e:e.join())+")";return t.style[Le]!==n&&(t.style[Le]=n),this},removeTransform:function(t){return t.style[Le]&&(t.style[Le]=""),this},isHTML:Qe,measureDom:$e,getDomRuler:tn,on:en,off:nn}),on={jsonp:function(t,e){var n="_maptalks_jsonp_"+R();t.match(/\?/)?t+="&callback="+n:t+="?callback="+n;var i=document.createElement("script");return i.type="text/javascript",i.src=t,window[n]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(i),i=null,delete window[n]},document.getElementsByTagName("head")[0].appendChild(i),this},get:function(t,e,n){if(_(e)){var i=n;n=e,e=i}if(C&&on.get.node)return on.get.node(t,n,e);var r=on._getClient(n);if(r.open("GET",t,!0),e){for(var o in e.headers)r.setRequestHeader(o,e.headers[o]);r.withCredentials="include"===e.credentials,e.responseType&&(r.responseType=e.responseType)}return r.send(null),r},post:function(t,e,n){var i;if(y(t)){if(_(e)){var r=n;n=e,e=r}i=(e=e||{}).postData}else{var o=n;i=e,t=(e=t).url,n=o}if(C&&on.post.node)return e.url=t,on.post.node(e,i,n);var a=on._getClient(n);if(a.open("POST",e.url,!0),e.headers||(e.headers={}),e.headers["Content-Type"]||(e.headers["Content-Type"]="application/x-www-form-urlencoded"),"setRequestHeader"in a)for(var s in e.headers)e.headers.hasOwnProperty(s)&&a.setRequestHeader(s,e.headers[s]);return y(i)||(i=JSON.stringify(i)),a.send(i),a},_wrapCallback:function(t,e){return function(){4===t.readyState&&(200===t.status?"arraybuffer"===t.responseType?0===t.response.byteLength?e(new Error("http status 200 returned without content.")):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")}):e(null,t.responseText):e(new Error(t.statusText+","+t.status)))}},_getClient:function(t){var e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return e.onreadystatechange=on._wrapCallback(e,t),e},getArrayBuffer:function(t,e,n){if(_(e)){var i=n;n=e,e=i}return e||(e={}),e.responseType="arraybuffer",on.get(t,e,n)},getImage:function(t,e,n){return on.getArrayBuffer(e,n,function(e,n){if(e)t.onerror&&t.onerror(e);else if(n){var i=window.URL||window.webkitURL,r=t.onload;t.onload=function(){r&&r(),i.revokeObjectURL(t.src)};var o=new Blob([new Uint8Array(n.data)],{type:n.contentType});t.cacheControl=n.cacheControl,t.expires=n.expires,t.src=n.data.byteLength?i.createObjectURL(o):$}})},getJSON:function(t,e,n){if(_(e)){var i=n;n=e,e=i}var r=function(t,e){var i=e?I(e):null;n(t,i)};return e&&e.jsonp?on.jsonp(t,r):on.get(t,e,r)}},an=!1,sn={setHitTesting:function(t){an=t},createCanvas:function(t,e,n){var i;return C?i=new n(t,e):((i=De("canvas")).width=t,i.height=e),i},prepareCanvasFont:function(t,e){t.textBaseline="top",t.font=Te(e);var n=e.textFill;n||(n="#000"),t.fillStyle=sn.getRgba(n,e.textOpacity)},prepareCanvas:function(t,e,n,i){if(e){var r=e.lineWidth;p(r)||t.lineWidth===r||(t.lineWidth=r);var o=e.linePatternFile||e.lineColor||"#000";if(i)t.strokeStyle="#000";else if(cn(o)&&n){var a;(e.linePatternDx||e.linePatternDy)&&(a=[e.linePatternDx,e.linePatternDy]),sn._setStrokePattern(t,o,r,a,n),e.lineDasharray=[]}else It(o)?e.lineGradientExtent?t.strokeStyle=sn._createGradient(t,o,e.lineGradientExtent):t.strokeStyle="#000":t.strokeStyle=o;e.lineJoin&&(t.lineJoin=e.lineJoin),e.lineCap&&(t.lineCap=e.lineCap),t.setLineDash&&U(e.lineDasharray)&&t.setLineDash(e.lineDasharray);var s=e.polygonPatternFile||e.polygonFill||"rgba(255,255,255,0)";if(i)t.fillStyle="#000";else if(cn(s)&&n){var h=ln(s),u=n.getImage([h,null,null]);if(u||(u=n.getImage([h+"-texture",null,r])),P(h)&&u instanceof Image&&(ae.edge||ae.ie)){var c=u.width||20,l=u.height||20,f=sn.createCanvas(c,l);sn.image(f.getContext("2d"),u,0,0,c,l),u=f}u?(t.fillStyle=t.createPattern(u,"repeat"),(e.polygonPatternDx||e.polygonPatternDy)&&(t.fillStyle.polygonPatternOffset=[e.polygonPatternDx,e.polygonPatternDy])):"undefined"!=typeof console&&console.warn("img not found for",h)}else It(s)?e.polygonGradientExtent?t.fillStyle=sn._createGradient(t,s,e.polygonGradientExtent):t.fillStyle="rgba(255,255,255,0)":t.fillStyle=s}},_createGradient:function(t,e,n){var i=null,r=e.places,o=n.getMin(),a=n.getMax(),s=n.getWidth(),h=n.getHeight();if(e.type&&"linear"!==e.type){if("radial"===e.type){if(r){if(6!==r.length)throw new Error("A radial gradient's places should have 6 numbers.");r=[o.x+r[0]*s,o.y+r[1]*h,s*r[2],o.x+r[3]*s,o.y+r[4]*h,s*r[5]]}else{var u=n.getCenter()._round();r=[u.x,u.y,Math.abs(u.x-o.x),u.x,u.y,0]}i=t.createRadialGradient.apply(t,r)}}else{if(r){if(4!==r.length)throw new Error("A linear gradient's places should have 4 numbers.");r=[o.x+r[0]*s,o.y+r[1]*h,o.x+r[2]*s,o.y+r[3]*h]}else r=[o.x,o.y,a.x,o.y];i=t.createLinearGradient.apply(t,r)}return e.colorStops.forEach(function(t){i.addColorStop.apply(i,t)}),i},_setStrokePattern:function(t,e,n,i,r){var o,a=ln(e);if(C)o=r.getImage([a,null,n]);else{var s=a+"-texture-"+n;if(!(o=r.getImage(s))){var h=r.getImage([a,null,null]);if(h){var u;u=h.width&&h.height?Math.round(h.width*n/h.height):n;var c=sn.createCanvas(u,n,t.canvas.constructor);sn.image(c.getContext("2d"),h,0,0,u,n),r.addResource([s,null,n],c),o=c}}}o?(t.strokeStyle=t.createPattern(o,"repeat"),t.strokeStyle.linePatternOffset=i):"undefined"!=typeof console&&console.warn("img not found for",a)},clearRect:function(t,e,n,i,r){t.canvas._drawn=!1,t.clearRect(e,n,i,r)},fillCanvas:function(t,e,n,i){if(an&&(e=1),t.canvas._drawn=!0,0!==e){var r,o=sn._isPattern(t.fillStyle),a=t.fillStyle&&t.fillStyle.polygonPatternOffset,s=a?a[0]:0,h=a?a[1]:0;p(e)&&(e=1),e<1&&(r=t.globalAlpha,t.globalAlpha*=e),o&&(n=n||0,i=i||0,t.translate(n+s,i+h)),t.fill(),o&&t.translate(-n-s,-i-h),e<1&&(t.globalAlpha=r)}},getRgba:function(t,e){return p(e)&&(e=1),"#"!==t[0]?t:(7===t.length?(n=parseInt(t.substring(1,3),16),i=parseInt(t.substring(3,5),16),r=parseInt(t.substring(5,7),16)):(n=17*parseInt(t.substring(1,2),16),i=17*parseInt(t.substring(2,3),16),r=17*parseInt(t.substring(3,4),16)),"rgba("+n+","+i+","+r+","+e+")");var n,i,r},image:function(t,e,n,i,r,o){t.canvas._drawn=!0;try{m(r)&&m(o)?t.drawImage(e,n,i,r,o):t.drawImage(e,n,i)}catch(t){console&&(console.warn("error when drawing image on canvas:",t),console.warn(e))}},text:function(t,e,n,i,r){sn._textOnMultiRow(t,r.rows,i,n,r.size,r.rawSize)},_textOnMultiRow:function(t,e,n,i,r,o){for(var a,s,h=Ee(r,n.textHorizontalAlignment,n.textVerticalAlignment),u=o.height+n.textLineSpacing,c=i.add(0,h.y),l=n.textMaxHeight,f=0,d=0,p=e.length;d0&&(f+=u)+o.height>=l));d++);},_textOnLine:function(t,e,n,i,r,o){an&&(o=1);var a,s,h=0!==o&&0!==i;t.textBaseline="top";var u=t.shadowBlur,c=t.shadowOffsetX,l=t.shadowOffsetY;if(h){var f=t.globalAlpha;t.globalAlpha*=o,t.miterLimit=2,t.lineJoin="round",t.lineCap="round",t.lineWidth=2*i,t.strokeStyle=r,t.strokeText(e,Math.round(n.x),Math.round(n.y)),t.miterLimit=10,t.globalAlpha=f,a=t.globalCompositeOperation,t.globalCompositeOperation="destination-out",s=t.fillStyle,t.fillStyle="#000"}u&&h&&(t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0),sn.fillText(t,e,n),a&&(t.globalCompositeOperation=a,sn.fillText(t,e,n,s),u&&(t.shadowBlur=u,t.shadowOffsetX=c,t.shadowOffsetY=l))},fillText:function(t,e,n,i){t.canvas._drawn=!0,i&&(t.fillStyle=i),t.fillText(e,Math.round(n.x),Math.round(n.y))},_stroke:function(t,e,n,i){if(an&&(e=1),t.canvas._drawn=!0,0!==e){var r,o=t.strokeStyle&&t.strokeStyle.linePatternOffset,a=o?o[0]:0,s=o?o[1]:0,h=sn._isPattern(t.strokeStyle)&&(!p(n)&&!p(i)||!p(a)&&!p(s));p(e)&&(e=1),e<1&&(r=t.globalAlpha,t.globalAlpha*=e),h&&(n=n||0,i=i||0,t.translate(n+a,i+s)),t.stroke(),h&&t.translate(-n-a,-i-s),e<1&&(t.globalAlpha=r)}},_path:function(t,e,n,i,r){if(U(e))for(var o,a,s=U(n),h=!0!==r&&sn._isPattern(t.strokeStyle),u=0,c=e.length;u0&&(l(e[u-1],o),t.beginPath(),t.moveTo(o.x,o.y));else if(s){if(u===c-1)break;a=e[u+1],hn(t,o,a,n)}function l(e,n){var r=Q(e.x,e.y,n.x,n.y);t.save(),t.translate(e.x,e.y-t.lineWidth/2/Math.cos(r)),t.rotate(r),sn._stroke(t,i),t.restore()}},path:function(t,e,n,i,r){U(e)&&(t.beginPath(),t.moveTo(e[0].x,e[0].y),sn._path(t,e,r,n),sn._stroke(t,n))},polygon:function(t,e,n,i,r,o){if(U(e)){var a,s,h,u=sn._isPattern(t.strokeStyle),c=U(r)&&!t.setLineDash||u&&!o;if(U(e[0])||(e=[e]),c){for(t.save(),s=0,h=e.length;s0&&(t.globalCompositeOperation="destination-out",a=1),l(e,s,a),s>0?t.globalCompositeOperation="source-over":h>1&&(t.fillStyle="#fff"),sn._stroke(t,0));t.restore()}for(s=0,h=e.length;s0&&(t.globalCompositeOperation="destination-out",a=1),l(e,s,a),s>0?t.globalCompositeOperation="source-over":h>1&&(t.fillStyle="#fff")),sn._stroke(t,n))}function l(e,n,i){sn.fillCanvas(t,i,e[n][0].x,e[n][0].y)}},_ring:function(t,e,n,i,r){var o=sn._isPattern(t.strokeStyle);r||!o||e[0].equals(e[e.length-1])||(e=e.concat([e[0]])),t.beginPath(),t.moveTo(e[0].x,e[0].y),sn._path(t,e,n,i,r),o||t.closePath()},paintSmoothLine:function(t,e,n,i,r,o,a){if(e)if(e.length<=2||!i)sn.path(t,e,n);else{var s,h=e.length,u=r?h:h-1;t.beginPath(),t.moveTo(e[0].x,e[0].y),void 0!==a&&(u-=Math.max(u-o-1,0));for(var c=0;c=0&&a<1){t.bezierCurveTo(_[0],_[1],_[2],_[3],_[4],_[5]),e.splice(u-1,h-(u-1)-1);var x=new ce(_[4],_[5]);x.prevCtrlPoint=new ce(_[2],_[3]),e.push(x),h=e.length}else t.bezierCurveTo(_[0],_[1],_[2],_[3],m,g);e[c].nextCtrlPoint=_.slice(0,2),e[c].prevCtrlPoint=s?s.slice(2):null,s=_}!r&&e[1].prevCtrlPoint&&(e[0].nextCtrlPoint=e[1].prevCtrlPoint,delete e[0].prevCtrlPoint),e[h-1].prevCtrlPoint||(e[h-1].prevCtrlPoint=e[h-2].nextCtrlPoint),sn._stroke(t,n)}function w(t,e,n,i,r,o,a,s,h,u){var c=(t+n)/2,l=(e+i)/2,f=(n+r)/2,d=(i+o)/2,p=(r+a)/2,m=(o+s)/2,g=Math.sqrt((n-t)*(n-t)+(i-e)*(i-e)),v=Math.sqrt((r-n)*(r-n)+(o-i)*(o-i)),y=g/(g+v),_=v/(v+Math.sqrt((a-r)*(a-r)+(s-o)*(s-o))),x=c+(f-c)*y,w=l+(d-l)*y,b=f+(p-f)*_,M=d+(m-d)*_,E=x+(f-x)*h+n-x,S=w+(d-w)*h+i-w,T=b+(f-b)*h+r-b,C=M+(d-M)*h+o-M,P=[E,S,T,C];return u<1?function(t,e,n,i,r,o,a,s,h,u){var c=1-t,l=1-e,f=n*l*l+2*r*e*l+a*e*e,d=r*l*l+2*a*e*l+h*e*e,p=i*l*l+2*o*e*l+s*e*e,m=o*l*l+2*s*e*l+u*e*e;return[(n*c*c+2*r*t*c+a*t*t)*l+(r*c*c+2*a*t*c+h*t*t)*e,(i*c*c+2*o*t*c+s*t*t)*l+(o*c*c+2*s*t*c+u*t*t)*e,f*c+d*t,p*c+m*t,f*l+d*e,p*l+m*e]}(0,u,n,i,E,S,T,C,r,o):P}},_arcBetween:function(t,e,n,i){var r=i,o=e.distanceTo(n),a=o/2/Math.sin(r/2),s=Math.asin((n.y-e.y)/o);e.x>n.x&&(s=Math.PI-s);var h=s-(90*Math.PI/180-r/2),u=Math.cos(h)*a,c=Math.sin(h)*a,l=e.x+u,f=e.y+c,d=Math.asin((n.y-f)/a);l>n.x&&(d=Math.PI-d);var p=d+r;return t.beginPath(),t.arc(l,f,a,d,p),[l,f]},_lineTo:function(t,e){t.lineTo(e.x,e.y)},bezierCurveAndFill:function(t,e,n,i){t.beginPath();var r=e[0];t.moveTo(r.x,r.y);var o=[t];o.push.apply(o,e.splice(1)),sn._bezierCurveTo.apply(sn,o),sn.fillCanvas(t,i),sn._stroke(t,n)},_bezierCurveTo:function(t,e,n,i){t.bezierCurveTo(e.x,e.y,n.x,n.y,i.x,i.y)},ellipse:function(t,e,n,i,r,o){t.beginPath(),n===i?t.arc(e.x,e.y,n,0,2*Math.PI):t.ellipse?t.ellipse(e.x,e.y,n,i,0,0,Math.PI/180*360):function(e,n,i,r){var o=.5522848,a=i*o,s=r*o;t.moveTo(e-i,n),t.bezierCurveTo(e-i,n-s,e-a,n-r,e,n-r),t.bezierCurveTo(e+a,n-r,e+i,n-s,e+i,n),t.bezierCurveTo(e+i,n+s,e+a,n+r,e,n+r),t.bezierCurveTo(e-a,n+r,e-i,n+s,e-i,n),t.closePath()}(e.x,e.y,n,i),sn.fillCanvas(t,o,e.x-n,e.y-i),sn._stroke(t,r,e.x-n,e.y-i)},rectangle:function(t,e,n,i,r){t.beginPath(),t.rect(e.x,e.y,n.width,n.height),sn.fillCanvas(t,r,e.x,e.y),sn._stroke(t,i,e.x,e.y)},sector:function(t,e,n,i,r,o){var a=Math.PI/180,s=i[0],h=i[1];function u(t,e,n,i,s,h){var u=a*-h,c=a*-s;t.beginPath(),t.moveTo(e,n),t.arc(e,n,i,u,c),t.lineTo(e,n),sn.fillCanvas(t,o,e-i,n-i),sn._stroke(t,r,e-i,n-i)}u(t,e.x,e.y,n,s,h)},_isPattern:function(t){return!(y(t)||"addColorStop"in t)},drawCross:function(t,e,n,i){t.canvas._drawn=!0,t.strokeStyle=i,t.lineWidth=n,t.beginPath(),t.moveTo(e.x-5,e.y),t.lineTo(e.x+5,e.y),t.moveTo(e.x,e.y-5),t.lineTo(e.x,e.y+5),t.stroke()},copy:function(t,e){var n=e||De("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),n}};function hn(t,e,n,i){var r=e.x,o=e.y,a=n.x,s=n.y,h=i,u=function(t,e){return t<=e},c=function(t,e){return t>=e},l=function(t,e){return Math.min(t,e)},f=function(t,e){return Math.max(t,e)},d={thereYet:c,cap:l},p={thereYet:c,cap:l};o-s>0&&(p.thereYet=u,p.cap=f),r-a>0&&(d.thereYet=u,d.cap=f),t.moveTo(r,o);for(var m,g,v=r,y=o,_=0,x=!0;!d.thereYet(v,a)||!p.thereYet(y,s);)m=Math.atan2(s-o,a-r),g=h[_],v=d.cap(a,v+Math.cos(m)*g),y=p.cap(s,y+Math.sin(m)*g),x?t.lineTo(v,y):t.moveTo(v,y),_=(_+1)%h.length,x=!x}var un="data:image/";function cn(t){return t.length>un.length&&t.substring(0,un.length)===un||q(t)}function ln(t){return t.substring(0,un.length)===un?t:X(t)}var fn=function(t){return function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.on=function(t,e,n){if(!t)return this;if(!y(t))return this._switch("on",t,e);if(!e)return this;this._eventMap||(this._eventMap={});var i,r,o=t.toLowerCase().split(" ");n||(n=this);for(var a=0,s=o.length;a0)for(var u=0;u=0;u--){var c=r[u];e!==c.handler&&e!==c.handler[o]||c.context!==n||(delete c.handler[o],r.splice(u,1))}}return this},n.removeEventListener=function(){return this.off.apply(this,arguments)},n.listens=function(t,e,n){if(!this._eventMap||!y(t))return 0;var i=this._eventMap[t.toLowerCase()];if(!i||!i.length)return 0;for(var r=0,o=0,a=i.length;o1?e-1:0),i=1;i=0&&this._handlers.splice(n,1),this[t].remove(),delete this[t]}return this},n._clearHandlers=function(){for(var t=0,e=this._handlers.length;t1||this.options.cancelOn&&!0===this.options.cancelOn(t))){var e=this.dom;e.setCapture?e.setCapture():window.captureEvents&&window.captureEvents(window.Event.MOUSEMOVE|window.Event.MOUSEUP),e.ondragstart=function(){return!1},delete this.moved;var n=t.touches?t.touches[0]:t;this.startPos=new ce(n.clientX,n.clientY),en(document,_n[t.type],this.onMouseMove,this),en(document,xn[t.type],this.onMouseUp,this),this.options.ignoreMouseleave||en(this.dom,"mouseleave",this.onMouseUp,this),this.fire("mousedown",{domEvent:t,mousePos:new ce(n.clientX,n.clientY)})}},n.onMouseMove=function(t){if(t.touches&&t.touches.length>1)this.moved&&(this.interupted=!0,this.onMouseUp(t));else{var e=t.touches?t.touches[0]:t,n=new ce(e.clientX,e.clientY).sub(this.startPos);(n.x||n.y)&&(this.moved?this.fire("dragging",{domEvent:t,mousePos:new ce(e.clientX,e.clientY)}):(this.fire("dragstart",{domEvent:t,mousePos:this.startPos.copy()}),this.moved=!0))}},n.onMouseUp=function(t){var e=t.changedTouches?t.changedTouches[0]:t;this._offEvents();var n={domEvent:t};m(e.clientX)&&(n.mousePos=new ce(parseInt(e.clientX,0),parseInt(e.clientY,0))),this.moved&&(n.interupted=this.interupted,this.fire("dragend",n),delete this.interupted,delete this.moved),this.fire("mouseup",n)},n._offEvents=function(){var t=this.dom;if(nn(t,"mouseleave",this.onMouseUp,this),"undefined"!=typeof document&&"undefined"!=typeof window){for(var e in _n)nn(document,_n[e],this.onMouseMove,this),nn(document,xn[e],this.onMouseUp,this);t.releaseCapture?t.releaseCapture():window.captureEvents&&window.captureEvents(window.Event.MOUSEMOVE|window.Event.MOUSEUP)}},e}(pn),bn=function(t){function e(){return t.apply(this,arguments)||this}return se(e,t),e.toNumberArrays=function(t){return Array.isArray(t)?N(t,function(t){return[t.x,t.y]}):[t.x,t.y]},e.toCoordinates=function(t){if(m(t[0])&&m(t[1]))return new e(t);for(var n=[],i=0,r=t.length;i0?arguments[r-1]:null;o&&o.unproject&&(this.projection=arguments[r-1]),this._dirty=!0,this._initialize(t,e,n,i)}var e=t.prototype;return e._initialize=function(t,e,n,i){if(this.xmin=null,this.xmax=null,this.ymin=null,this.ymax=null,!p(t)){var r=this.projection;m(t)&&m(e)&&m(n)&&m(i)?r?(this.xmin=t,this.ymin=e,this.xmax=n,this.ymax=i):(this.xmin=Math.min(t,n),this.ymin=Math.min(e,i),this.xmax=Math.max(t,n),this.ymax=Math.max(e,i)):Array.isArray(t)?r?(this.xmin=t[0],this.ymin=t[1],this.xmax=t[2],this.ymax=t[3]):(this.xmin=Math.min(t[0],t[2]),this.ymin=Math.min(t[1],t[3]),this.xmax=Math.max(t[0],t[2]),this.ymax=Math.max(t[1],t[3])):m(t.x)&&m(e.x)&&m(t.y)&&m(e.y)?r?(this.xmin=t.x,this.ymin=t.y,this.xmax=e.x,this.ymax=e.y):(t.x>e.x?(this.xmin=e.x,this.xmax=t.x):(this.xmin=t.x,this.xmax=e.x),t.y>e.y?(this.ymin=e.y,this.ymax=t.y):(this.ymin=t.y,this.ymax=e.y)):m(t.xmin)&&m(t.xmax)&&m(t.ymin)&&m(t.ymax)&&(this.xmin=t.xmin,this.ymin=t.ymin,this.xmax=t.xmax,this.ymax=t.ymax)}},e._add=function(t){return this._dirty=!0,p(t.x)?p(t.xmin)?p(t[0])||(this.xmin+=t[0],this.ymin+=t[1],this.xmax+=t[0],this.ymax+=t[1]):(this.xmin+=t.xmin,this.ymin+=t.ymin,this.xmax+=t.xmax,this.ymax+=t.ymax):(this.xmin+=t.x,this.ymin+=t.y,this.xmax+=t.x,this.ymax+=t.y),this},e.add=function(){var t=new this.constructor(this.xmin,this.ymin,this.xmax,this.ymax,this.projection);return t._add.apply(t,arguments)},e._sub=function(t){return this._dirty=!0,p(t.x)?p(t.xmin)?p(t[0])||(this.xmin-=t[0],this.ymin-=t[1],this.xmax-=t[0],this.ymax-=t[1]):(this.xmin-=t.xmin,this.ymin-=t.ymin,this.xmax-=t.xmax,this.ymax-=t.ymax):(this.xmin-=t.x,this.ymin-=t.y,this.xmax-=t.x,this.ymax-=t.y),this},e._substract=function(){return this._sub.apply(this,arguments)},e.sub=function(){var t=new this.constructor(this.xmin,this.ymin,this.xmax,this.ymax,this.projection);return t._sub.apply(t,arguments)},e.substract=function(){return this.sub.apply(this,arguments)},e.round=function(){return new this.constructor(Math.round(this.xmin),Math.round(this.ymin),Math.round(this.xmax),Math.round(this.ymax),this.projection)},e._round=function(){return this._dirty=!0,this.xmin=Math.round(this.xmin),this.ymin=Math.round(this.ymin),this.xmax=Math.round(this.xmax),this.ymax=Math.round(this.ymax),this},e.getMin=function(){return new this._clazz(this.xmin,this.ymin)},e.getMax=function(){return new this._clazz(this.xmax,this.ymax)},e.getCenter=function(){return new this._clazz((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)},e.isValid=function(){return m(this.xmin)&&m(this.ymin)&&m(this.xmax)&&m(this.ymax)},e.equals=function(t){return this.xmin===t.xmin&&this.xmax===t.xmax&&this.ymin===t.ymin&&this.ymax===t.ymax},e.intersects=function(t){this._project(this),this._project(t);var e=Math.max(this.pxmin,t.pxmin),n=Math.max(this.pymin,t.pymin),i=Math.min(this.pxmax,t.pxmax),r=Math.min(this.pymax,t.pymax),o=!(e>i||n>r);return o},e.within=function(t){return this._project(this),this._project(t),this.pxmin>=t.pxmin&&this.pxmax<=t.pxmax&&this.pymin>=t.pymin&&this.pymax<=t.pymax},e.contains=function(t){if(!t)return!1;this._project(this);var e=this.projection;return Array.isArray(t)&&(t=new this._clazz(t)),e&&(t=e.project(t)),t.x>=this.pxmin&&t.x<=this.pxmax&&t.y>=this.pymin&&t.y<=this.pymax},e.getWidth=function(){return Math.abs(this.xmax-this.xmin)},e.getHeight=function(){return Math.abs(this.ymax-this.ymin)},e.getSize=function(){return new le(this.getWidth(),this.getHeight())},e.__combine=function(t){t instanceof this.constructor||(t=new this.constructor(t,t)),this._project(t),this._project(this);var e=this.pxmin;m(e)?m(t.pxmin)&&e>t.pxmin&&(e=t.pxmin):e=t.pxmin;var n=this.pxmax;m(n)?m(t.pxmax)&&nt.pymin&&(i=t.pymin):i=t.pymin;var r=this.pymax;m(r)?m(t.pymax)&&r180&&(void 0===n&&(n=r.x90&&(void 0===i&&(i=r.ye.x?1:-1,this.extent.sy=t.y>e.y?1:-1}return this.extent}},Pn={measureLength:function(t,e){if(!Array.isArray(t))return this.measureLenBetween(t,e);for(var n=0,i=0,r=t.length;i0?1:-1))/Math.PI,-90,90)}else r=t.y;if(0!==e){var s=Math.abs(e),h=M(t.x);i=G(180*(h+=2*Math.sqrt(Math.pow(Math.sin(s/(2*this.radius)),2)/Math.pow(Math.cos(o),2))*(e>0?1:-1))/Math.PI,-180,180)}else i=t.x;return t.x=i,t.y=r,t},e.rotate=function(t,e,n){return t=new bn(t),this._rotate(t,e,n)},e._rotate=function(t,e,n){var i=function(t,e,n){void 0===n&&(n={});var i;i=n.final?Rn(e,t):Rn(t,e);return i>180?-(360-i):i}(e,t)-n,r=this.measureLenBetween(e,t);return t.x=e.x,t.y=e.y,function(t,e,n,i){var r=e/i,o=t.x*Math.PI/180,a=M(t.y),s=M(n),h=r*Math.cos(s),u=a+h;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(a/2+Math.PI/4)),l=Math.abs(c)>1e-11?h/c:Math.cos(a),f=r*Math.sin(s)/l,d=o+f;return t.x=(180*d/Math.PI+540)%360-180,t.y=180*u/Math.PI,t}(t,r,i,this.radius)},t}();function Rn(t,e){var n=M(t.y),i=M(e.y),r=M(e.x-t.x);r>Math.PI&&(r-=2*Math.PI),r<-Math.PI&&(r+=2*Math.PI);var o=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(E(Math.atan2(r,o))+360)%360}var On=d({measure:"EPSG:4326",sphere:new Ln(6378137),measureLenBetween:function(){return this.sphere.measureLenBetween.apply(this.sphere,arguments)},measureArea:function(){return this.sphere.measureArea.apply(this.sphere,arguments)},_locate:function(){return this.sphere._locate.apply(this.sphere,arguments)},locate:function(){return this.sphere.locate.apply(this.sphere,arguments)},_rotate:function(){return this.sphere._rotate.apply(this.sphere,arguments)},rotate:function(){return this.sphere.rotate.apply(this.sphere,arguments)}},Pn),In=d({measure:"BAIDU",sphere:new Ln(6370996.81),measureLenBetween:function(){return this.sphere.measureLenBetween.apply(this.sphere,arguments)},measureArea:function(){return this.sphere.measureArea.apply(this.sphere,arguments)},_locate:function(){return this.sphere._locate.apply(this.sphere,arguments)},locate:function(){return this.sphere.locate.apply(this.sphere,arguments)},_rotate:function(){return this.sphere._rotate.apply(this.sphere,arguments)},rotate:function(){return this.sphere.rotate.apply(this.sphere,arguments)}},Pn),Dn=On,kn={};function Nn(t){kn[t.measure]=t}Nn(An),Nn(On),Nn(In);var zn={getInstance:function(t){if(!t)return Dn;for(var e in kn)if(w(kn,e)){var n=kn[e].measure;if(!n)continue;if(t.toLowerCase()===n.toLowerCase())return kn[e]}return null}},Fn=Object.freeze({Identity:An,DEFAULT:Dn,Measurer:zn,WGS84Sphere:On,BaiduSphere:In}),Bn=d({},Cn,{code:"EPSG:3857",rad:Math.PI/180,metersPerDegree:6378137*Math.PI/180,maxLatitude:85.0511287798,project:function(t){var e,n=this.rad,i=this.metersPerDegree,r=this.maxLatitude,o=t.x,a=Math.max(Math.min(r,t.y),-r);return e=0===a?0:Math.log(Math.tan((90+a)*n/2))/n,new bn(o*i,e*i)},unproject:function(t){var e,n=t.x,i=t.y,r=this.rad,o=this.metersPerDegree;return 0===i?e=0:(e=i/o,e=(2*Math.atan(Math.exp(e*r))-Math.PI/2)/r),new bn(G(n/o,-180,180),G(e,-this.maxLatitude,this.maxLatitude))}},On),jn=d({},Cn,{code:"EPSG:4326",project:function(t){return new bn(t)},unproject:function(t){return new bn(t)}},On),Gn=d({},jn,{code:"EPSG:4490"}),Hn=d({},Cn,{code:"BAIDU",project:function(t){return this.convertLL2MC(t)},unproject:function(t){return this.convertMC2LL(t)}},In,{EARTHRADIUS:6370996.81,MCBAND:[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],LLBAND:[75,60,45,30,15,0],MC2LL:[[1.410526172116255e-8,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,17337981.2],[-7.435856389565537e-9,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,6856817.37],[-1.981981304930552e-8,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,4482777.06],[3.09191371068437e-9,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,2555164.4],[2.890871144776878e-9,8983055095805407e-21,-3.068298e-8,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],LL2MC:[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],convertMC2LL:function(t){Math.abs(t.x);for(var e,n=Math.abs(t.y),i=0,r=this.MCBAND.length;i=this.MCBAND[i]){e=this.MC2LL[i];break}var o=this.convertor(t,e);return new bn(o.x,o.y)},convertLL2MC:function(t){var e,n,i;t.x=this.getLoop(t.x,-180,180),t.y=this.getRange(t.y,-74,74);var r=new bn(t.x,t.y);for(n=0,i=this.LLBAND.length;n=this.LLBAND[n]){e=this.LL2MC[n];break}if(!e)for(n=this.LLBAND.length-1;n>=0;n--)if(r.y<=-this.LLBAND[n]){e=this.LL2MC[n];break}var o=this.convertor(t,e);return new bn(o.x,o.y)},convertor:function(t,e){if(!t||!e)return null;var n=e[0]+e[1]*Math.abs(t.x),i=Math.abs(t.y)/e[9],r=e[2]+e[3]*i+e[4]*i*i+e[5]*i*i*i+e[6]*i*i*i*i+e[7]*i*i*i*i*i+e[8]*i*i*i*i*i*i;return n*=t.x<0?-1:1,r*=t.y<0?-1:1,new bn(n,r)},toRadians:function(t){return Math.PI*t/180},toDegrees:function(t){return 180*t/Math.PI},getRange:function(t,e,n){return null!=e&&(t=Math.max(t,e)),null!=n&&(t=Math.min(t,n)),t},getLoop:function(t,e,n){for(;t>n;)t-=n-e;for(;tn;n++)i(e.c[n],t)})}},reject:function(t){if(this.state===a){this.state="rejected",this.v=t;var i=this.c;i?c(function(){for(var e=0,n=i.length;n>e;e++)o(i[e],t)}):!n.suppressUncaughtRejectionError&&e.console&&e.console.log("You upset Zousan. Please catch rejections: ",t,t?t.stack:null)}},then:function(t,e){var r=new n,s={y:t,n:e,p:r};if(this.state===a)this.c?this.c.push(s):this.c=[s];else{var u=this.state,l=this.v;c(function(){u===h?i(s,l):o(s,l)})}return r},catch:function(t){return this.then(null,t)},finally:function(t){return this.then(t,t)},timeout:function(t,e){e=e||"Timeout";var i=this;return new n(function(n,r){setTimeout(function(){r(Error(e))},t),i.then(function(t){n(t)},function(t){r(t)})})}},n.resolve=function(t){var e=new n;return e.resolve(t),e},n.reject=function(t){var e=new n;return e.reject(t),e},n.all=function(t){function e(e,a){e&&"function"==typeof e.then||(e=n.resolve(e)),e.then(function(e){i[a]=e,++r==t.length&&o.resolve(i)},function(t){o.reject(t)})}for(var i=[],r=0,o=new n,a=0;a0?(this._loadingResource=!0,this.loadResources(n).then(function(){e._loadingResource=!1,e.layer&&(e.layer.fire("resourceload"),e.setToRedraw())})):this._tryToDraw(t)}else this._tryToDraw(t)},n.testIfNeedRedraw=function(){var t=this.getMap();return!this._loadingResource&&(!!this._toRedraw||!(t.isInteracting()&&!this.drawOnInteracting)&&!!this.needToRedraw())},n.needToRedraw=function(){var t=this.getMap();return!!t.isInteracting()&&!(!t.getPitch()&&t.isMoving()&&!t.isZooming()&&!t.isRotating()&&!this.layer.options.forceRenderOnMoving)},n.onSkipDrawOnInteracting=function(){},n.isRenderComplete=function(){return!!this._renderComplete},n.mustRenderOnInteracting=function(){return!this._painted||this.checkResources&&this.checkResources().length>0},n.setToRedraw=function(){return this._toRedraw=!0,this},n.setCanvasUpdated=function(){return this._canvasUpdated=!0,this},n.isCanvasUpdated=function(){return!!this._canvasUpdated},n.remove=function(){this.onRemove(),delete this._loadingResource,delete this.southWest,delete this.canvas,delete this.context,delete this.canvasExtent2D,delete this._extent2D,delete this.resources,delete this.layer},n.onRemove=function(){},n.onAdd=function(){},n.getMap=function(){return this.layer?this.layer.getMap():null},n.getCanvasImage=function(){var t=this.getMap();if(this._canvasUpdated=!1,this._renderZoom!==t.getZoom()||!this.canvas||!this._extent2D)return null;if(this.isBlank())return null;if(this.layer.isEmpty&&this.layer.isEmpty())return null;var e=t._pointToContainerPoint(this.southWest)._add(0,-t.height);return{image:this.canvas,layer:this.layer,point:e}},n.clear=function(){this.clearCanvas()},n.isBlank=function(){return!this._painted},n.show=function(){this.setToRedraw()},n.hide=function(){this.clear(),this.setToRedraw()},n.setZIndex=function(){this.setToRedraw()},n.hitDetect=function(t){if(!this.context||this.layer.isEmpty&&this.layer.isEmpty()||this.isBlank()||this._errorThrown)return!1;var e=this.getMap(),n=ae.retina?2:1,i=e.getSize();if(t.x<0||t.x>i.width*n||t.y<0||t.y>i.height*n)return!1;try{if(this.context.getImageData(n*t.x,n*t.y,1,1).data[3]>0)return!0}catch(t){return this._errorThrown||(console&&console.warn("hit detect failed with tainted canvas, some geometries have external resources in another domain:\n",t),this._errorThrown=!0),!1}return!1},n.loadResources=function(t){this.resources||(this.resources=new Qn);var e=this.resources,n=[];if(U(t))for(var i={},r=t.length-1;r>=0;r--){var o=t[r];o&&o.length&&!i[o.join("-")]&&(i[o.join("-")]=1,e.isResourceLoaded(o,!0)||n.push(new Jn(this._promiseResource(o))))}return Jn.all(n)},n.prepareRender=function(){delete this._renderComplete;var t=this.getMap();this._renderZoom=t.getZoom(),this.canvasExtent2D=this._extent2D=t._get2DExtent(),this.southWest=t._containerPointToPoint(new ce(0,t.height))},n.createCanvas=function(){if(!this.canvas){var t=this.getMap(),e=t.getSize(),n=ae.retina?2:1,i=n*e.width,r=n*e.height;if(this.layer._canvas){var o=this.layer._canvas;o.width=i,o.height=r,o.style&&(o.style.width=e.width+"px",o.style.height=e.height+"px"),this.canvas=this.layer._canvas}else this.canvas=sn.createCanvas(i,r,t.CanvasClass);this.onCanvasCreate()}},n.onCanvasCreate=function(){},n.createContext=function(){if(!(this.gl&&this.gl.canvas===this.canvas||this.context)&&(this.context=this.canvas.getContext("2d"),this.layer.options.globalCompositeOperation&&(this.context.globalCompositeOperation=this.layer.options.globalCompositeOperation),ae.retina)){this.context.scale(2,2)}},n.resetCanvasTransform=function(){if(this.context){var t=ae.retina?2:1;this.context.setTransform(t,0,0,t,0,0)}},n.resizeCanvas=function(t){var e=this.canvas;if(e){var n=t||this.getMap().getSize(),i=ae.retina?2:1;e.width===i*n.width&&e.height===i*n.height||(e.height=i*n.height,e.width=i*n.width,ae.retina&&this.context&&this.context.scale(i,i),this.layer._canvas&&e.style&&(e.style.width=n.width+"px",e.style.height=n.height+"px"))}},n.clearCanvas=function(){this.context&&sn.clearRect(this.context,0,0,this.canvas.width,this.canvas.height)},n.prepareCanvas=function(){this.canvas?(this.clearCanvas(),this.resizeCanvas(),this.resetCanvasTransform()):(this.createCanvas(),this.createContext(),this.layer.fire("canvascreate",{context:this.context,gl:this.gl})),delete this._maskExtent;var t=this.layer.getMask();if(!t)return this.layer.fire("renderstart",{context:this.context,gl:this.gl}),null;var e=this._maskExtent=t._getPainter().get2DExtent();return e.intersects(this._extent2D),this.layer.fire("renderstart",{context:this.context,gl:this.gl}),e},n.clipCanvas=function(t){var e=this.layer.getMask();if(!e)return!1;var n=this.southWest,i=this.getMap();return this.southWest=i._containerPointToPoint(new ce(0,i.height)),t.save(),ae.retina&&(t.save(),t.scale(2,2)),e._getPainter().paint(null,t),ae.retina&&t.restore(),t.clip(),this.southWest=n,!0},n.getViewExtent=function(){return{extent:this._extent2D,maskExtent:this._maskExtent,zoom:this._renderZoom,southWest:this.southWest}},n.completeRender=function(){this.getMap()&&(this._renderComplete=!0,this.layer.fire("renderend",{context:this.context,gl:this.gl}),this.setCanvasUpdated())},n.getEvents=function(){return{_zoomstart:this.onZoomStart,_zooming:this.onZooming,_zoomend:this.onZoomEnd,_resize:this.onResize,_movestart:this.onMoveStart,_moving:this.onMoving,_moveend:this.onMoveEnd,_dragrotatestart:this.onDragRotateStart,_dragrotating:this.onDragRotating,_dragrotateend:this.onDragRotateEnd,_spatialreferencechange:this.onSpatialReferenceChange}},n.onZoomStart=function(){},n.onZoomEnd=function(){this.setToRedraw()},n.onZooming=function(){},n.onMoveStart=function(){},n.onMoving=function(){},n.onMoveEnd=function(){this.setToRedraw()},n.onResize=function(){delete this._extent2D,this.resizeCanvas(),this.setToRedraw()},n.onDragRotateStart=function(){},n.onDragRotating=function(){},n.onDragRotateEnd=function(){this.setToRedraw()},n.onSpatialReferenceChange=function(){},n.getDrawTime=function(){return this._drawTime},n._tryToDraw=function(t){this._toRedraw=!1,!this.canvas&&this.layer.isEmpty&&this.layer.isEmpty()?this._renderComplete=!0:this._drawAndRecord(t)},n._drawAndRecord=function(t){if(this.getMap()){var e=this._painted;this._painted=!0;var n=f();this.draw(t),n=f()-n,this._drawTime=e?n:n/2,e&&this.layer.options.logDrawTime&&console.log(this.layer.getId(),"frameTimeStamp:",t,"drawTime:",this._drawTime)}},n._promiseResource=function(t){var e=this,n=this.resources,i=this.layer.options.crossOrigin;return function(r){if(n.isResourceLoaded(t,!0))r(t);else{var o=new Image;p(i)||(o.crossOrigin=i),P(t[0])&&!C&&(t[1]&&(t[1]*=2),t[2]&&(t[2]*=2)),o.onload=function(){e._cacheResource(t,o),r(t)},o.onabort=function(e){console&&console.warn("image loading aborted: "+t[0]),e&&console&&console.warn(e),r(t)},o.onerror=function(e){e&&"undefined"!=typeof console&&console.warn(e),n.markErrorResource(t),r(t)},A(o,t)}}},n._cacheResource=function(t,e){if(this.layer&&this.resources){var n=t[1],i=t[2];if(this.layer.options.cacheSvgOnCanvas&&1===P(t[0])&&(ae.edge||ae.ie)){p(n)&&(n=e.width||this.layer.options.defaultIconSize[0]),p(i)&&(i=e.height||this.layer.options.defaultIconSize[1]);var r=sn.createCanvas(n,i);sn.image(r.getContext("2d"),e,0,0,n,i),e=r}this.resources.addResource(t,e)}},e}(mn),Qn=function(){function t(){this.resources={},this._errors={}}var e=t.prototype;return e.addResource=function(t,e){this.resources[t[0]]={image:e,width:+t[1],height:+t[2]}},e.isResourceLoaded=function(t,e){if(!t)return!1;var n=this._getImgUrl(t);if(this._errors[n])return!0;var i=this.resources[n];return!!i&&!(e&&P(t[0])&&(+t[1]>i.width||+t[2]>i.height))},e.getImage=function(t){var e=this._getImgUrl(t);return!this.isResourceLoaded(t)||this._errors[e]?null:this.resources[e].image},e.markErrorResource=function(t){this._errors[this._getImgUrl(t)]=1},e.merge=function(t){if(!t)return this;for(var e in t.resources){var n=t.resources[e];this.addResource([e,n.width,n.height],n.image)}return this},e.forEach=function(t){if(!this.resources)return this;for(var e in this.resources)w(this.resources,e)&&t(e,this.resources[e]);return this},e._getImgUrl=function(t){return Array.isArray(t)?t[0]:t},t}(),$n=function(t){function e(e,n){var i,r;return n&&(r=n.canvas,delete n.canvas),(i=t.call(this,n)||this)._canvas=r,i.setId(e),n&&i.setZIndex(n.zIndex),i}se(e,t);var n=e.prototype;return n.load=function(){if(!this.getMap())return this;if(this.onLoad()){this._initRenderer();var t=this.getZIndex();p(t)||(this._renderer.setZIndex(t),this.isCanvasRender()||this._renderer.render()),this.onLoadEnd()}return this},n.getId=function(){return this._id},n.setId=function(t){var e=this._id;return p(t)||(t+=""),this._id=t,this.fire("idchange",{old:e,new:t}),this},n.addTo=function(t){return t.addLayer(this),this},n.setZIndex=function(t){return this._zIndex=t,this.map&&this.map._sortLayersByZIndex(),this._renderer&&this._renderer.setZIndex(t),this},n.getZIndex=function(){return this._zIndex||0},n.getMinZoom=function(){var t=this.getMap(),e=this.options.minZoom;return t?Math.max(t.getMinZoom(),e||0):e},n.getMaxZoom=function(){var t=this.getMap(),e=this.options.maxZoom;return t?Math.min(t.getMaxZoom(),p(e)?1/0:e):e},n.getOpacity=function(){return this.options.opacity},n.setOpacity=function(t){return this.config("opacity",t),this},n.isCanvasRender=function(){var t=this._getRenderer();return t&&t instanceof Kn},n.getMap=function(){return this.map?this.map:null},n.getProjection=function(){var t=this.getMap();return t?t.getProjection():null},n.bringToFront=function(){var t=this._getLayerList();if(!t.length)return this;var e=t[t.length-1];if(1===t.length||e===this)return this;var n=e.getZIndex();return this.setZIndex(n+1),this},n.bringToBack=function(){var t=this._getLayerList();if(!t.length)return this;var e=t[0];if(1===t.length||e===this)return this;var n=e.getZIndex();return this.setZIndex(n-1),this},n.show=function(){var t=this;if(!this.options.visible){this.options.visible=!0;var e=this.getRenderer();e&&e.show();var n=this.getMap();e&&n?n.once("renderend",function(){t.fire("show")}):this.fire("show")}return this},n.hide=function(){var t=this;if(this.options.visible){this.options.visible=!1;var e=this.getRenderer();e&&e.hide();var n=this.getMap();e&&n?n.once("renderend",function(){t.fire("hide")}):this.fire("hide")}return this},n.isVisible=function(){if(m(this.options.opacity)&&this.options.opacity<=0)return!1;var t=this.getMap();if(t){var e=t.getZoom();if(!p(this.options.maxZoom)&&this.options.maxZoome)return!1}return p(this.options.visible)&&(this.options.visible=!0),this.options.visible},n.remove=function(){return this.map&&this.map.removeLayer(this),this},n.getMask=function(){return this._mask},n.setMask=function(t){if(!("Point"===t.type&&t._isVectorMarker()||"Polygon"===t.type))throw new Error("Mask for a layer must be a marker with vector marker symbol or a Polygon.");if("Point"===t.type?t.updateSymbol({markerLineColor:"rgba(0, 0, 0, 0)",markerFillOpacity:0}):t.setSymbol({lineColor:"rgba(0, 0, 0, 0)",polygonOpacity:0}),t._bindLayer(this),this._mask=t,!this.getMap()||this.getMap().isZooming())return this;var e=this._getRenderer();return e&&e.setToRedraw&&this._getRenderer().setToRedraw(),this},n.removeMask=function(){if(delete this._mask,!this.getMap()||this.getMap().isZooming())return this;var t=this._getRenderer();return t&&t.setToRedraw&&this._getRenderer().setToRedraw(),this},n.onLoad=function(){return!0},n.onLoadEnd=function(){},n.isLoaded=function(){return!!this._loaded},n.getRenderer=function(){return this._getRenderer()},n.onConfig=function(t){if(m(t.opacity)||t.cssFilter){var e=this.getRenderer();e&&e.setToRedraw()}},n.onAdd=function(){},n.onRemove=function(){},n._bindMap=function(t,e){t&&(this.map=t,p(e)||this.setZIndex(e),this._switchEvents("on",this),this.onAdd(),this.fire("add"))},n._initRenderer=function(){var t=this.options.renderer;if(this.constructor.getRendererClass){var e=this.constructor.getRendererClass(t);if(!e)throw new Error("Invalid renderer for Layer("+this.getId()+"):"+t);this._renderer=new e(this),this._renderer.layer=this,this._renderer.setZIndex(this.getZIndex()),this._switchEvents("on",this._renderer),this._renderer.onAdd&&this._renderer.onAdd(),this.fire("renderercreate",{renderer:this._renderer})}},n._doRemove=function(){this._loaded=!1,this.onRemove(),this._switchEvents("off",this),this._renderer&&(this._switchEvents("off",this._renderer),this._renderer.remove(),delete this._renderer),delete this.map},n._switchEvents=function(t,e){e&&e.getEvents&&this.getMap()[t](e.getEvents(),e)},n._getRenderer=function(){return this._renderer},n._getLayerList=function(){return this.map?this.map._layers:[]},n._getMask2DExtent=function(){if(!this._mask||!this.getMap())return null;var t=this._mask._getPainter();return t?t.get2DExtent():null},e}(vn(fn(Zn(mn))));$n.mergeOptions({attribution:null,minZoom:null,maxZoom:null,visible:!0,opacity:1,globalCompositeOperation:null,renderer:"canvas",debugOutline:"#0f0",cssFilter:null,forceRenderOnMoving:!1,forceRenderOnZooming:!1,forceRenderOnRotating:!1});var ti=$n.prototype.fire;$n.prototype.fire=function(t,e){return"layerload"===t&&(this._loaded=!0),this.map&&(e||(e={}),e.type=t,e.target=this,this.map._onLayerEvent(e)),ti.apply(this,arguments)};var ei={"EPSG:3857":{resolutions:function(){for(var t=[],e=12756274*Math.PI,n=0;n<21;n++)t[n]=e/(256*Math.pow(2,n));return t}(),fullExtent:{top:6378137*Math.PI,left:-6378137*Math.PI,bottom:-6378137*Math.PI,right:6378137*Math.PI}},"EPSG:4326":{fullExtent:{top:90,left:-180,bottom:-90,right:180},resolutions:function(){for(var t=[],e=0;e<20;e++)t[e]=180/(128*Math.pow(2,e));return t}()},BAIDU:{resolutions:function(){for(var t=Math.pow(2,18),e=[],n=0;n<20;n++)e[n]=t,t*=.5;return e[0]=null,e[1]=null,e[2]=null,e}(),fullExtent:{top:33554432,left:-33554432,bottom:-33554432,right:33554432}},IDENTITY:{resolutions:function(){for(var t=Math.pow(2,8),e=[],n=0;n<18;n++)e[n]=t,t*=.5;return e}(),fullExtent:{top:2e5,left:-2e5,bottom:-2e5,right:2e5}}};ei["EPSG:4490"]=ei["EPSG:4326"];var ni=function(){function t(t){void 0===t&&(t={}),this.options=t,this._initSpatialRef()}t.getProjectionInstance=function(t){if(!t)return null;if(v(t))return t;for(var e in t=(t+"").toLowerCase(),Wn)if(w(Wn,e)){var n=Wn[e].code;if(n&&n.toLowerCase()===t)return Wn[e]}return null},t.equals=function(t,e){if(!t&&!e)return!0;if(!t||!e)return!1;if(t.projection!==e.projection)return!1;var n=t.fullExtent,i=e.fullExtent;if(n&&i&&(n.top!==i.top||n.bottom!==i.bottom||n.left!==i.left||n.right!==i.right))return!1;var r=t.resolutions,o=e.resolutions;if(r&&o){if(r.length!==o.length)return!1;for(var a=0;a=r.left?1:-1,a=r.top>=r.bottom?-1:1;this._transformation=new Tn([o,a,0,0])},e.getResolutions=function(){return this._resolutions||[]},e.getResolution=function(t){var e=0|t;e<0?e=0:e>this._resolutions.length-1&&(e=this._resolutions.length-1);var n=this._resolutions[e];return g(t)||e===this._resolutions.length-1?n:n+(this._resolutions[e+1]-n)*(t-e)},e.getProjection=function(){return this._projection},e.getFullExtent=function(){return this._fullExtent},e.getTransformation=function(){return this._transformation},e.getMinZoom=function(){for(var t=0;t=0;t--)if(!p(this._resolutions[t]))return t;return this._resolutions.length-1},e.getZoomDirection=function(){return F(this._resolutions[this.getMinZoom()]-this._resolutions[this.getMaxZoom()])},e.toJSON=function(){return this.json||(this.json={resolutions:this._resolutions,fullExtent:{top:this._fullExtent.top,left:this._fullExtent.left,bottom:this._fullExtent.bottom,right:this._fullExtent.right},projection:this._projection.code}),this.json},t}(),ii={maxVisualPitch:60,maxPitch:80,centerCross:!1,zoomInCenter:!1,zoomAnimation:!C,zoomAnimationDuration:330,panAnimation:!C,panAnimationDuration:600,zoomable:!0,enableInfoWindow:!0,hitDetect:!ae.mobile,hitDetectLimit:5,fpsOnInteracting:25,layerCanvasLimitOnInteracting:-1,maxZoom:null,minZoom:null,maxExtent:null,checkSize:!0,renderer:"canvas"},ri=function(t){function e(e,n){var i;if(!n)throw new Error("Invalid options when creating map.");if(!n.center)throw new Error("Invalid center when creating map.");var r=d({},n),o=r.zoom;delete r.zoom;var a=new bn(r.center);delete r.center;var s=r.baseLayer;delete r.baseLayer;var h=r.layers;return delete r.layers,i=t.call(this,r)||this,Object.defineProperty(he(he(i)),"id",{value:R(),writable:!1}),i._loaded=!1,i._initContainer(e),i._panels={},i._baseLayer=null,i._layers=[],i._zoomLevel=o,i._center=a,i.setSpatialReference(r.spatialReference||r.view),i._mapViewPoint=new ce(0,0),i._initRenderer(),i._updateMapSize(i._getContainerDomSize()),s&&i.setBaseLayer(s),h&&i.addLayer(h),i._Load(),i}se(e,t),e.addOnLoadHook=function(t){var e=Array.prototype.slice.call(arguments,1),n="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._onLoadHooks=this.prototype._onLoadHooks||[],this.prototype._onLoadHooks.push(n),this};var n=e.prototype;return n.isLoaded=function(){return!!this._loaded},n.getContainer=function(){return this._containerDOM},n.getSpatialReference=function(){return this._spatialReference},n.setSpatialReference=function(t){var e=this.options.spatialReference;if(this._loaded&&ni.equals(e,t))return this;if(t=d({},t),this._center=this.getCenter(),this.options.spatialReference=t,this._spatialReference=new ni(t),this.options.spatialReference&&_(this.options.spatialReference.projection)){var n=this._spatialReference.getProjection();this.options.spatialReference.projection=n.code}return this._resetMapStatus(),this._fireEvent("spatialreferencechange",{old:e,new:d({},this.options.spatialReference)}),this},n.onConfig=function(t){var e=t.spatialReference||t.view;return p(e)||this.setSpatialReference(e),this},n.getProjection=function(){return this._spatialReference?this._spatialReference.getProjection():null},n.getFullExtent=function(){return this._spatialReference?this._spatialReference.getFullExtent():null},n.setCursor=function(t){return delete this._cursor,this._trySetCursor(t),this._cursor=t,this},n.resetCursor=function(){return this.setCursor(null)},n.getCenter=function(){return this._loaded&&this._prjCenter?this.getProjection().unproject(this._prjCenter):this._center},n.setCenter=function(t){if(!t)return this;if(t=new bn(t),!this._verifyExtent(t))return this;if(!this._loaded)return this._center=t,this;this.onMoveStart();var e=this.getProjection().project(t);return this._setPrjCenter(e),this.onMoveEnd(this._parseEventFromCoord(this.getCenter())),this},n.getSize=function(){return p(this.width)||p(this.height)?this._getContainerDomSize():new le(this.width,this.height)},n.getContainerExtent=function(){var t=this.height,e=this.getPitch(),n=this.options.maxVisualPitch;return n&&e>n&&(t=this._getVisualHeight(n)),new Sn(0,this.height-t,this.width,this.height)},n._getVisualHeight=function(t){var e=this.getPitch(),n=this.height/2*Math.tan(t*Math.PI/180);return this.height/2+n*Math.tan((90-e)*Math.PI/180)},n.getExtent=function(){return this._pointToExtent(this._get2DExtent())},n.getProjExtent=function(){var t=this._get2DExtent();return new En(this._pointToPrj(t.getMin()),this._pointToPrj(t.getMax()))},n.getPrjExtent=function(){return this.getProjExtent()},n.getMaxExtent=function(){return this.options.maxExtent?new En(this.options.maxExtent,this.getProjection()):null},n.setMaxExtent=function(t){if(t){var e=new En(t,this.getProjection());this.options.maxExtent=e;var n=this.getCenter();this._verifyExtent(n)||this.panTo(e.getCenter())}else delete this.options.maxExtent;return this},n.getZoom=function(){return this._zoomLevel},n.getZoomForScale=function(t,e,n){var i=this.getZoom();if(p(e)&&(e=i),1===t&&e===i)return i;var r=this._getResolution(e)/t,o=this.getZoomFromRes(r);if(n)return o;return this.getSpatialReference().getZoomDirection()<0?Math.ceil(o-1e-6):Math.floor(o+1e-6)},n.getZoomFromRes=function(t){var e=this._getResolutions(),n=this._getResolution(this.getMinZoom()),i=this._getResolution(this.getMaxZoom());if(n<=i){if(t<=n)return this.getMinZoom();if(t>=i)return this.getMaxZoom()}else{if(t>=n)return this.getMinZoom();if(t<=i)return this.getMaxZoom()}for(var r=e.length,o=0;o=Math.abs(s))return o+s/a}return r-1},n.setZoom=function(t,e){return void 0===e&&(e={animation:!0}),isNaN(t)||p(t)?this:(this._loaded&&this.options.zoomAnimation&&e.animation?this._zoomAnimation(t):this._zoom(t),this)},n.getMaxZoom=function(){return p(this.options.maxZoom)?this.getMaxNativeZoom():this.options.maxZoom},n.setMaxZoom=function(t){var e=this.getMaxNativeZoom();return t>e&&(t=e),null!==t&&tthis._zoomLevel&&this.setZoom(t)}return this.options.minZoom=t,this},n.getMaxNativeZoom=function(){var t=this.getSpatialReference();return t?t.getMaxZoom():null},n.getGLZoom=function(){return this.getMaxNativeZoom()/2},n.getGLScale=function(t){return p(t)&&(t=this.getZoom()),this.getScale(t)/this.getScale(this.getGLZoom())},n.zoomIn=function(){return this.setZoom(this.getZoom()+1)},n.zoomOut=function(){return this.setZoom(this.getZoom()-1)},n.isZooming=function(){return!!this._zooming},n.isInteracting=function(){return this.isZooming()||this.isMoving()||this.isRotating()},n.setCenterAndZoom=function(t,e){return p(e)||this._zoomLevel===e?this.setCenter(t):(this.setCenter(t),this.setZoom(e,{animation:!1})),this},n.getFitZoom=function(t){var e=this;if(!(t&&t instanceof En))return this._zoomLevel;if(t.xmin===t.xmax&&t.ymin===t.ymax)return this.getMaxZoom();var n=this.getSize(),i=t.convertTo(function(t){return e.coordToContainerPoint(t)}),r=i.getWidth(),o=i.getHeight(),a=n.width/r,s=n.height/o,h=this.getSpatialReference().getZoomDirection()<0?Math.max(a,s):Math.min(a,s);return this.getZoomForScale(h)},n.getView=function(){return{center:this.getCenter().toArray(),zoom:this.getZoom(),pitch:this.getPitch(),bearing:this.getBearing()}},n.setView=function(t){return t?(t.center&&this.setCenter(t.center),t.zoom&&this.setZoom(t.zoom,{animation:!1}),t.pitch&&this.setPitch(t.pitch),t.bearing&&this.setBearing(t.bearing),this):this},n.getResolution=function(t){return this._getResolution(t)},n.getScale=function(t){var e=p(t)?this.getZoom():t,n=this._getResolution(this.getMaxNativeZoom());return this._getResolution(e)/n},n.fitExtent=function(t,e,n,i){if(void 0===n&&(n={}),!t)return this;t=new En(t,this.getProjection());var r=this.getFitZoom(t)+(e||0),o=t.getCenter();return void 0===n.animation||n.animation?this.animateTo({center:o,zoom:r},{duration:n.duration||this.options.zoomAnimationDuration,easing:n.easing||"out"},i):this.setCenterAndZoom(o,r)},n.getBaseLayer=function(){return this._baseLayer},n.setBaseLayer=function(t){var e=!1;if(this._baseLayer&&(e=!0,this._fireEvent("baselayerchangestart"),this._baseLayer.remove()),!t)return delete this._baseLayer,this._fireEvent("baselayerchangeend"),this._fireEvent("setbaselayer"),this;return this._baseLayer=t,t._bindMap(this,-1),this._baseLayer.on("layerload",function(){this._fireEvent("baselayerload"),e&&(e=!1,this._fireEvent("baselayerchangeend"))},this),this._loaded&&this._baseLayer.load(),this._fireEvent("setbaselayer"),this},n.removeBaseLayer=function(){return this._baseLayer&&(this._baseLayer.remove(),delete this._baseLayer,this._fireEvent("baselayerremove")),this},n.getLayers=function(t){return this._getLayers(function(e){return!(e===this._baseLayer||e.getId().indexOf(o)>=0)&&(!t||t(e))})},n.getLayer=function(t){if(!t)return null;var e=this._layerCache?this._layerCache[t]:null;if(e)return e;var n=this.getBaseLayer();return n&&n.getId()===t?n:null},n.addLayer=function(t){if(!t)return this;if(!Array.isArray(t))return t=Array.prototype.slice.call(arguments,0),this.addLayer(t);this._layerCache||(this._layerCache={});for(var e=this._layers,n=0,i=t.length;n0&&this.once("frameend",function(){e.forEach(function(t){t.fire("remove")})}),this._fireEvent("removelayer",{layers:t}),this},n.sortLayers=function(t){if(!t||!Array.isArray(t))return this;for(var e=[],n=Number.MAX_VALUE,i=0,r=t.length;ii.bottom?-1:1,o=new ce(this.width/2+t,this.height/2+r*e),a=this.containerPointToCoord(o);return n.measureLength(this.getCenter(),a)},n.pointToDistance=function(t,e,n){var i=this.getProjection();if(!i)return null;var r=this._prjToPoint(this._getPrjCenter(),n);r._add(t,e);var o=this.pointToCoord(r,n);return i.measureLength(this.getCenter(),o)},n.locate=function(t,e,n){return this.getProjection()._locate(new bn(t),e,n)},n.locateByPoint=function(t,e,n){var i=this.coordToContainerPoint(t);return this.containerPointToCoord(i._add(e,n))},n.getMainPanel=function(){return this._getRenderer().getMainPanel()},n.getPanels=function(){return this._panels},n.remove=function(){if(this.isRemoved())return this;this._fireEvent("removestart"),this._removeDomEvents(),this._clearHandlers(),this.removeBaseLayer();for(var t=this.getLayers(),e=0;e0&&"maptalks-wrapper"===this._containerDOM.childNodes[0].className)throw new Error("Container is already loaded with another map instance, use map.remove() to clear it.")},n._trySetCursor=function(t){return this._cursor||this._priorityCursor||(t||(t="default"),this._setCursorToPanel(t)),this},n._setPriorityCursor=function(t){if(t)this._priorityCursor=t,this._setCursorToPanel(t);else{var e=!1;this._priorityCursor&&(e=!0),delete this._priorityCursor,e&&this.setCursor(this._cursor)}return this},n._setCursorToPanel=function(t){var e=this.getMainPanel();e&&e.style&&e.style.cursor!==t&&(e.style.cursor=t)},n._get2DExtent=function(t){var e=this;return this.getContainerExtent().convertTo(function(n){return e._containerPointToPoint(n,t)})},n._pointToExtent=function(t){var e=t.getMin(),n=t.getMax(),i=this.getFullExtent(),r=!i||i.left<=i.right?[e.x,n.x]:[n.x,e.x],o=r[0],a=r[1],s=!i||i.top>i.bottom?[n.y,e.y]:[e.y,n.y],h=s[1],u=new bn(o,s[0]),c=new bn(a,h);return new En(this.pointToCoord(u),this.pointToCoord(c),this.getProjection())},n._removeLayer=function(t,e){if(t&&e){var n=e.indexOf(t);n>-1&&e.splice(n,1)}},n._sortLayersByZIndex=function(){if(this._layers){for(var t=0,e=this._layers.length;tn)&&this.setMaxZoom(n),(p(e)||-1===e||et)&&(this._zoomLevel=t),this._zoomLevel5?(n=5*n*(Math.abs(o)+Math.abs(a))/500,e.panBy(new ce(o,a),{duration:n})):e.onMoveEnd(t)}},n._rotateStart=function(t){this._start(t),delete this._rotateMode,this.startBearing=this.target.getBearing(),this.target.onDragRotateStart(t),this._db=0},n._rotating=function(t){var e=this.target,n=t.mousePos.x,i=t.mousePos.y,r=e.getPitch(),o=e.getBearing(),a=Math.abs(n-this.preX),s=Math.abs(i-this.preY);if(this._rotateMode||(e.options.dragRotatePitch?this._rotateMode="rotate_pitch":this._rotateMode=a>s?"rotate":a=0&&e.options.dragRotate){var h=0;h=e.options.dragPitch||a>s?-.6*(this.preX-n):n>e.width/2?.6*(this.preY-i):-.6*(this.preY-i);var u=e.getBearing()+h;this._db=this._db||0,this._db+=h,e.setBearing(u)}this._rotateMode.indexOf("pitch")>=0&&e.options.dragPitch&&e.setPitch(e.getPitch()+.4*(this.preY-i)),this.preX=n,this.preY=i,e.getBearing()===o&&e.getPitch()===r||e.onDragRotating(t)}},n._rotateEnd=function(t){var e=this.target,n=e.getBearing();this._clear();var i=f()-this.startDragTime;if(e.onDragRotateEnd(t),Math.abs(n-this.startBearing)>20&&("rotate"===this._rotateMode||"rotate_pitch"===this._rotateMode)&&!t.interupted&&i<400){var r=e.getBearing();e.animateTo({bearing:r+this._db/2},{easing:"out",duration:800})}},n._clear=function(){delete this.startPrjCoord,delete this.preX,delete this.preY,delete this.startX,delete this.startY},e}(pn);function hi(t,e,n,i){for(var r,o=[],a=0,s=0,h=t.length;se.getMax().x&&(n|=2),t.ye.getMax().y&&(n|=8),n}function di(t,e,n,i){t=new ce(t);var r,o,a,s=Math.abs(n.x-e.x),h=Math.abs(n.y-e.y),u=Math.sqrt(Math.abs(s*s-h*h));return s>=h?(r=new ce(e.x-u,e.y),o=new ce(e.x+u,e.y),a=2*s):(r=new ce(e.x,e.y-u),o=new ce(e.x,e.y+u),a=2*h),t.distanceTo(r)+t.distanceTo(o)<=a+2*i}ri.mergeOptions({draggable:!0,dragPan:!0,dragRotatePitch:!0,dragRotate:!0,dragPitch:!0}),ri.addOnLoadHook("addHandler","draggable",si);var pi=function(){function t(){}var e=t.prototype;return e.getMap=function(){return this.geometry.getMap()},e.getPainter=function(){return this.painter},t.testColor=function(t){return!(!t||!y(t))&&l.indexOf(t)>=0},t}(),mi=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n._prepareContext=function(t){m(this.symbol.opacity)?t.globalAlpha!==this.symbol.opacity&&(t.globalAlpha=this.symbol.opacity):1!==t.globalAlpha&&(t.globalAlpha=1)},n.prepareCanvas=function(t,e,n){sn.prepareCanvas(t,e,n,this.getPainter().isHitTesting())},n.remove=function(){},n.setZIndex=function(){},n.show=function(){},n.hide=function(){},n._defineStyle=function(t){return function(){var e=this,n=[],i={};return St(t,function(){var t=e.getMap();return function(t,e,n){return t[0]=e,t[1]=n,t}(n,t.getZoom(),d({},e.geometry.getProperties(),function(t,e,n,i){return t["{bearing}"]=e,t["{pitch}"]=n,t["{zoom}"]=i,t}(i,t.getBearing(),t.getPitch(),t.getZoom())))})}.bind(this)()},e}(pi);var gi=function(t){function e(e,n,i){var r;return(r=t.call(this)||this).symbol=e,r.geometry=n,r.painter=i,r}se(e,t);var n=e.prototype;return n.get2DExtent=function(){for(var t=this.getMap(),e=t.getGLZoom(),n=new Sn,i=this._getRenderPoints()[0],r=i.length-1;r>=0;r--)i[r]&&n._combine(t._pointToPoint(i[r],e));return n},n._rotateExtent=function(t,e){return t.convertTo(function(t){return t._rotate(e)})},n._getRenderPoints=function(){return this.getPainter().getRenderPoints(this.getPlacement())},n._getRenderContainerPoints=function(t){var e=this.getPainter(),n=this._getRenderPoints()[0];if(e.isSpriting())return n;var i=this.getDxDy(),r=this.painter._pointContainerPoints(n,i.x,i.y,t,!0,this.getPlacement());if(!r||!Array.isArray(r[0]))return r;for(var o=[],a=0,s=r.length;a=0;r--){var o=e[r],a=this._rotate(t,o,this._getRotationAt(r));a&&(o=a),this._drawVectorMarker(t,o,n),a&&t.restore()}},n._drawMarkersWithCache=function(t,e,n){var i=this._stampSymbol(),r=n.getImage(i);r||(r=this._createMarkerImage(t,n),n.addResource([i,r.width,r.height],r));for(var o=this._getAnchor(r.width,r.height),a=e.length-1;a>=0;a--){var s=e[a],h=this._rotate(t,s,this._getRotationAt(a));h&&(s=h),sn.image(t,r,s.x+o.x,s.y+o.y),h&&t.restore()}},n._calMarkerSize=function(){if(!this._size){var t=this.strokeAndFill.lineWidth,e=2*(this.symbol.shadowBlur||0),n=Math.round(this.style.markerWidth+t+2*e+2*this.padding),i=Math.round(this.style.markerHeight+t+2*e+2*this.padding);this._size=[n,i]}return this._size},n._createMarkerImage=function(t,e){var n=t.canvas.constructor,i=this._calMarkerSize(),r=sn.createCanvas(i[0],i[1],n),o=this._getCacheImageAnchor(i[0],i[1]),a=r.getContext("2d");return It(this.strokeAndFill.lineColor)||It(this.strokeAndFill.polygonFill)||this.prepareCanvas(a,this.strokeAndFill,e),this._drawVectorMarker(a,o,e),r},n._stampSymbol=function(){return this._stamp||(this._stamp=[this.style.markerType,It(this.style.markerFill)?Dt(this.style.markerFill):this.style.markerFill,this.style.markerFillOpacity,this.style.markerFillPatternFile,It(this.style.markerLineColor)?Dt(this.style.markerLineColor):this.style.markerLineColor,this.style.markerLineWidth,this.style.markerLineOpacity,this.style.markerLineDasharray?this.style.markerLineDasharray.join(","):"",this.style.markerLinePatternFile,this.style.markerWidth,this.style.markerHeight,this.style.markerHorizontalAlignment,this.style.markerVerticalAlignment].join("_")),this._stamp},n._getAnchor=function(t,e){var n=2*(this.symbol.shadowBlur||0)+this.padding,i=Ee(new le(t,e),this.style.markerHorizontalAlignment,this.style.markerVerticalAlignment);return i.x!==-t/2&&(i.x-=F(i.x+t/2)*n),i.y!==-e/2&&(i.y-=F(i.y+e/2)*n),i},n._getCacheImageAnchor=function(t,e){var n=2*(this.symbol.shadowBlur||0)+this.padding,i=this.style.markerType;return"bar"===i||"pie"===i||"pin"===i?new ce(t/2,e-n):"rectangle"===i?new ce(n,n):new ce(t/2,e/2)},n._getGraidentExtent=function(t){var e=new Sn,n=this.getDxDy(),i=this.getFixedExtent();if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)e._combine(t[r]);else e._combine(t);return e.xmin+=i.xmin-n.x,e.ymin+=i.ymin-n.y,e.xmax+=i.xmax-n.x,e.ymax+=i.ymax-n.y,e},n._drawVectorMarker=function(t,n,i){var r,o=this.style,a=this.strokeAndFill,s=o.markerType.toLowerCase(),h=e._getVectorPoints(s,o.markerWidth,o.markerHeight),u=a.lineOpacity,c=a.polygonOpacity;(It(a.lineColor)||It(a.polygonFill))&&(It(a.lineColor)&&(r=this._getGraidentExtent(n),a.lineGradientExtent=r.expand(a.lineWidth)),It(a.polygonFill)&&(r||(r=this._getGraidentExtent(n)),a.polygonGradientExtent=r),this.prepareCanvas(t,a,i));var l=o.markerWidth,f=o.markerHeight,d=o.markerLineWidth/2;if("ellipse"===s)sn.ellipse(t,n,l/2,f/2,u,c);else if("cross"===s||"x"===s){for(var p=h.length-1;p>=0;p--)h[p]._add(n);sn.path(t,h.slice(0,2),u),sn.path(t,h.slice(2,4),u)}else if("diamond"===s||"bar"===s||"square"===s||"rectangle"===s||"triangle"===s){"bar"===s?n=n.add(0,-d):"rectangle"===s&&(n=n.add(d,d));for(var m=h.length-1;m>=0;m--)h[m]._add(n);sn.polygon(t,h,u,c)}else if("pin"===s){n=n.add(0,-d);for(var g=h.length-1;g>=0;g--)h[g]._add(n);var v=t.lineCap;t.lineCap="round",sn.bezierCurveAndFill(t,h,u,c),t.lineCap=v}else{if("pie"!==s)throw new Error("unsupported markerType: "+s);n=n.add(0,-d);var y=180*Math.atan(l/2/f)/Math.PI,_=t.lineCap;t.lineCap="round",sn.sector(t,n,f,[90-y,90+y],u,c),t.lineCap=_}},n.getPlacement=function(){return this.symbol.markerPlacement},n.getRotation=function(){var t=this.style.markerRotation;return m(t)?-t*Math.PI/180:null},n.getFixedExtent=function(){var t=this.getDxDy(),e=2*this.padding,n=this._calMarkerSize().map(function(t){return t-e}),i=this._getAnchor(n[0],n[1]),r=new Sn(t.add(0,0),t.add(n[0],n[1]));r._add(i);var o=this.getRotation();return o&&(r=this._rotateExtent(r,o)),r},n.translate=function(){var t,e,n=this.symbol,i={markerType:z(n.markerType,"ellipse"),markerFill:z(n.markerFill,"#00f"),markerFillOpacity:z(n.markerFillOpacity,1),markerFillPatternFile:z(n.markerFillPatternFile,null),markerLineColor:z(n.markerLineColor,"#000"),markerLineWidth:z(n.markerLineWidth,1),markerLineOpacity:z(n.markerLineOpacity,1),markerLineDasharray:z(n.markerLineDasharray,[]),markerLinePatternFile:z(n.markerLinePatternFile,null),markerDx:z(n.markerDx,0),markerDy:z(n.markerDy,0),markerWidth:z(n.markerWidth,10),markerHeight:z(n.markerHeight,10),markerRotation:z(n.markerRotation,0)},r=i.markerType;return"bar"===r||"pie"===r||"pin"===r?(t="middle",e="top"):"rectangle"===r?(t="right",e="bottom"):(t="middle",e="middle"),i.markerHorizontalAlignment=z(n.markerHorizontalAlignment,t),i.markerVerticalAlignment=z(n.markerVerticalAlignment,e),m(n.markerOpacity)&&(m(n.markerFillOpacity)&&(i.markerFillOpacity*=n.markerOpacity),m(n.markerLineOpacity)&&(i.markerLineOpacity*=n.markerOpacity)),i},e.translateLineAndFill=function(t){var e={lineColor:t.markerLineColor,linePatternFile:t.markerLinePatternFile,lineWidth:t.markerLineWidth,lineOpacity:t.markerLineOpacity,lineDasharray:t.markerLineDasharray,lineCap:"butt",lineJoin:"round",polygonFill:t.markerFill,polygonPatternFile:t.markerFillPatternFile,polygonOpacity:t.markerFillOpacity};return 0===e.lineWidth&&(e.lineOpacity=0),e},e._getVectorPoints=function(t,e,n){var i,r=n/2,o=e/2;if("triangle"===t)return[i=new ce(0,0-r),new ce(0-o,0+r),new ce(0+o,0+r)];if("cross"===t)return[i=new ce(0-o,0),new ce(0+o,0),new ce(0,0-r),new ce(0,0+r)];if("diamond"===t)return[i=new ce(0-o,0),new ce(0,0-r),new ce(0+o,0),new ce(0,0+r)];if("square"===t)return[i=new ce(0-o,0+r),new ce(0+o,0+r),new ce(0+o,0-r),new ce(0-o,0-r)];if("rectangle"===t)return[i=new ce(0,0),i.add(e,0),i.add(e,n),i.add(0,n)];if("x"===t)return[i=new ce(0-o,0+r),new ce(0+o,0-r),new ce(0+o,0+r),new ce(0-o,0-r)];if("bar"===t)return[i=new ce(0-o,0-n),new ce(0+o,0-n),new ce(0+o,0),new ce(0-o,0)];if("pin"===t){var a=n*Math.atan(o/r);return[i=new ce(0,0),new ce(0-a,0-n),new ce(0+a,0-n),new ce(0,0)]}return[]},e}(gi),yi=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.getPlacement=function(){return"point"},n.getDxDy=function(){return new ce(0,0)},n.symbolize=function(t){var e=this.geometry,n=e.getLayer();if(e.options.debug||!n||n.options.debug){var i=this.getMap();if(i&&!i.isZooming()){var r=n.options.debugOutline;t.strokeStyle=r,t.fillStyle=r;var o=this.getPainter().getContainerExtent().toArray();sn.polygon(t,[o],1,0);for(var a=this._getRenderContainerPoints(),s=this.geometry.getId(),h=vi._getVectorPoints("cross",10,10),u=0;u0&&Array.isArray(a[0][0])||"LineString"===this.geometry.type&&a.length>0&&Array.isArray(a[0]))for(var s=0;s1&&h.push.apply(h,i.slice(1)),h.push(n.lineOpacity,n.polygonOpacity,n.lineDasharray),this.geometry._paintOn.apply(this.geometry,h)}else{this.prepareCanvas(t,n,e),r&&o&&!n.lineColor.places&&this._createGradient(t,a,n.lineColor);var u=[t];u.push.apply(u,i),u.push(n.lineOpacity,n.polygonOpacity,n.lineDasharray),this.geometry._paintOn.apply(this.geometry,u)}t.setLineDash&&Array.isArray(n.lineDasharray)&&t.setLineDash([])}}},n.get2DExtent=function(){var t=this.getMap(),e=this.geometry._getPrjExtent();if(!e)return null;this._extMin&&this._extMax||(this._extMin=new bn(0,0),this._extMax=new bn(0,0)),this._extMin.x=e.xmin,this._extMin.y=e.ymin,this._extMax.x=e.xmax,this._extMax.y=e.ymax;var n=t._prjToPoint(this._extMin),i=t._prjToPoint(this._extMax);return this._pxExtent?(this._pxExtent.xmin=Math.min(n.x,i.x),this._pxExtent.xmax=Math.max(n.x,i.x),this._pxExtent.ymin=Math.min(n.y,i.y),this._pxExtent.ymax=Math.max(n.y,i.y)):this._pxExtent=new Sn(n,i),this._pxExtent},n.getFixedExtent=function(){var t=this.style.lineWidth/2;return new Sn(-t,-t,t,t)},n._getPaintParams=function(){return this.getPainter().getPaintParams(this.style.lineDx,this.style.lineDy)},n.translate=function(){var t=this.symbol,e={lineColor:z(t.lineColor,"#000"),lineWidth:z(t.lineWidth,2),lineOpacity:z(t.lineOpacity,1),lineDasharray:z(t.lineDasharray,[]),lineCap:z(t.lineCap,"butt"),lineJoin:z(t.lineJoin,"miter"),linePatternFile:z(t.linePatternFile,null),lineDx:z(t.lineDx,0),lineDy:z(t.lineDy,0),polygonFill:z(t.polygonFill,null),polygonOpacity:z(t.polygonOpacity,1),polygonPatternFile:z(t.polygonPatternFile,null),polygonPatternDx:z(t.polygonPatternDx,0),polygonPatternDy:z(t.polygonPatternDy,0),linePatternDx:z(t.linePatternDx,0),linePatternDy:z(t.linePatternDy,0)};return 0===e.lineWidth&&(e.lineOpacity=0),"LineString"!==this.geometry.type||e.polygonFill||(e.polygonFill=e.lineColor),e},n._createGradient=function(t,e,n){if(Array.isArray(e)){var i=e.length,r=t.createLinearGradient(e[0].x,e[0].y,e[i-1].x,e[i-1].y);n.colorStops.forEach(function(t){r.addColorStop.apply(r,t)}),t.strokeStyle=r}},e}(mi),wi="___text_symbol_cache",bi=function(t){function e(e,n,i){var r;if((r=t.call(this,e,n,i)||this)._dynamic=Mt(e),r.style=r._defineStyle(r.translate()),0===r.style.textWrapWidth)return he(r);r.strokeAndFill=r._defineStyle(r.translateLineAndFill(r.style));var o=Me(r.style.textName,r.geometry.getProperties());return r._dynamic||(r._cacheKey=function(t,e){var n=[t];for(var i in e)e.hasOwnProperty(i)&&i.length>4&&"text"===i.substring(0,4)&&n.push(i+"="+e[i]);return n.join("-")}(o,r.style)),r._descText(o),r}se(e,t),e.test=function(t){return!!t&&!p(t.textName)};var n=e.prototype;return n.symbolize=function(t,e){if(this.painter.isHitTesting()||0!==this.style.textSize&&(this.style.textOpacity||this.style.textHaloRadius&&this.style.textHaloOpacity)&&0!==this.style.textWrapWidth){var n=this._getRenderContainerPoints();if(U(n)){var i=this.style,r=this.strokeAndFill,o=Me(this.style.textName,this.geometry.getProperties());this._descText(o),this._prepareContext(t),this.prepareCanvas(t,r,e),sn.prepareCanvasFont(t,i);for(var a=0,s=n.length;a0&&(!e.textWrapWidth||e.textWrapWidth>e.textMaxWidth)&&(e.textWrapWidth||(e.textMaxHeight=1),e.textWrapWidth=e.textMaxWidth),e},n.translateLineAndFill=function(t){return{lineColor:t.textHaloRadius?t.textHaloFill:t.textFill,lineWidth:t.textHaloRadius,lineOpacity:t.textOpacity,lineDasharray:null,lineCap:"butt",lineJoin:"round",polygonFill:t.textFill,polygonOpacity:t.textOpacity}},n._descText=function(t){this._dynamic?this.textDesc=this._measureText(t):(this.textDesc=this._loadFromCache(),this.textDesc||(this.textDesc=this._measureText(t),this._storeToCache(this.textDesc)))},n._measureText=function(t){var e=this.style.textMaxHeight,n=Ce(t,this.style);return e&&e0&&Array.isArray(e[0]))for(var r=0;r=0;r--)for(var o=i[r],a=n.length-1;a>=0;a--)if(n[a].test(o,this.geometry)){var s=new n[a](o,this.geometry,this);e.push(s),s instanceof gi&&(this._hasPoint=!0)}if(!e.length&&console){var h=this.geometry.getId();console.warn("invalid symbol for geometry("+(this.geometry?this.geometry.getType()+(h?":"+h:""):"")+") to draw : "+JSON.stringify(t))}return this._debugSymbolizer=new yi(t,this.geometry,this),e},n.hasPoint=function(){return!!this._hasPoint},n.getRenderPoints=function(t){return this._renderPoints||(this._renderPoints={}),t||(t="center"),this._renderPoints[t]||(this._renderPoints[t]=this.geometry._getRenderPoints(t)),this._renderPoints[t]},n.getPaintParams=function(t,e,n){var i=this.getMap(),r=this.geometry,o=i.getResolution(),a=0!==i.getPitch(),s=0!==i.getBearing(),h=this._cachedParams,u=r._paintAsPath&&r._paintAsPath();if(u&&this._unsimpledParams&&o<=this._unsimpledParams._res)h=this._unsimpledParams;else if(!h||h._res!==i.getResolution()||this._pitched!==a&&r._redrawWhenPitch()||this._rotated!==s&&r._redrawWhenRotate()){if(!(h=r._getPaintParams()))return null;h._res=o,!r._simplified&&u&&(this._unsimpledParams||(this._unsimpledParams=h),o>this._unsimpledParams._res&&(this._unsimpledParams._res=o)),this._cachedParams=h}if(!h)return null;this._pitched=a,this._rotated=s;var c=i.getGLScale(),l=[],f=h[0],d=i.getContainerExtent(),p=this._pointContainerPoints(f,t,e,n,this._hitPoint&&!d.contains(this._hitPoint));if(!p)return null;l.push(p);for(var g=1,v=h.length;g0&&e){var s=n.cameraLookAt,h=n.cameraPosition;a=a.combine(new ce(h)._add(F(s[0]-h[0]),F(s[1]-h[1])))}var u=t;if(this.get2DExtent().within(a))return{points:u,altitude:e};var c=i.options.smoothness;if(i.getShell&&this.geometry.getHoles&&!c)if(Array.isArray(t[0])){u=[];for(var l=0;l=0;u--)this._prepareShadow(s,this.symbolizers[u].symbol),this.symbolizers[u].symbolize.apply(this.symbolizers[u],h);this._afterPaint(),this._painted=!0,this._debugSymbolizer.symbolize.apply(this._debugSymbolizer,h)}}}},n.getSprite=function(t,e){if("Point"!==this.geometry.type)return null;if(this._spriting=!0,!this._sprite&&this.symbolizers.length>0){var n=new Sn;this.symbolizers.forEach(function(e){var i=e.getFixedExtent(t);n._combine(i)});var i,r=n.getMin().multi(-1),o=e||(this.getMap()?this.getMap().CanvasClass:null),a=sn.createCanvas(n.getWidth(),n.getHeight(),o);this._renderPoints&&(i=this._renderPoints);for(var s=a.getContext("2d"),h=[s,t],u=this.symbolizers.length-1;u>=0;u--){var c=this.symbolizers[u].getDxDy();this._renderPoints={center:[[r.add(c)]]},this._prepareShadow(s,this.symbolizers[u].symbol),this.symbolizers[u].symbolize.apply(this.symbolizers[u],h)}i&&(this._renderPoints=i),this._sprite={canvas:a,offset:n.getCenter()}}return this._spriting=!1,this._sprite},n.isSpriting=function(){return!!this._spriting},n.hitTest=function(t,e){(!e||e<.5)&&(e=.5),Mi||(Mi=sn.createCanvas(1,1)),sn.setHitTesting(!0),Mi.width=Mi.height=2*e;var n=Mi.getContext("2d");this._hitPoint=t.sub(e,e);try{this.paint(null,n,this._hitPoint)}catch(t){throw t}finally{sn.setHitTesting(!1)}delete this._hitPoint;for(var i=n.getImageData(0,0,Mi.width,Mi.height).data,r=3,o=i.length;r0)return!0;return!1},n.isHitTesting=function(){return!!this._hitPoint},n._prepareShadow=function(t,e){e.shadowBlur?(t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor||"#000",t.shadowOffsetX=e.shadowOffsetX||0,t.shadowOffsetY=e.shadowOffsetY||0):t.shadowBlur&&(t.shadowBlur=null,t.shadowColor=null,t.shadowOffsetX=null,t.shadowOffsetY=null)},n._eachSymbolizer=function(t,e){if(this.symbolizers){e||(e=this);for(var n=this.symbolizers.length-1;n>=0;n--)t.apply(e,[this.symbolizers[n]])}},n.get2DExtent=function(t){this._verifyProjection();var e=this.getMap();t=t||this.getLayer()._getRenderer().resources;var n=e.getZoom();if((!this._extent2D||this._extent2D._zoom!==n)&&(delete this._extent2D,delete this._fixedExtent,this.symbolizers)){for(var i=this._extent2D=new Sn,r=this._fixedExtent=new Sn,o=this.symbolizers.length-1;o>=0;o--){var a=this.symbolizers[o];i._combine(a.get2DExtent()),a.getFixedExtent&&r._combine(a.getFixedExtent(t))}i._zoom=n}return this._extent2D.add(this._fixedExtent)},n.getContainerExtent=function(){this._verifyProjection();var t=this.getMap(),e=t.getZoom(),n=t.getGLScale();this._extent2D&&this._extent2D._zoom===e||this.get2DExtent();var i=this.getMinAltitude(),r=t.getFrustumAltitude();if(i&&r&&rt.maxAltitude&&(t.maxAltitude=i),i})):(this.minAltitude=this.maxAltitude=this._meterToPoint(n,e),this.minAltitude)},n._meterToPoint=function(t,e){var n=this.getMap(),i=n.getGLZoom(),r=n.locate(t,e,0),o=n.coordToPoint(t,i),a=n.coordToPoint(r,i);return Math.abs(a.x-o.x)*F(e)},n._getAltitudeProperty=function(){var t=this.geometry,e=t.getLayer().options,n=t.getProperties();return e.enableAltitude&&n?n[e.altitudeProperty]:0},n._verifyProjection=function(){var t=this.geometry._getProjection();this._projCode&&this._projCode!==t.code&&this.removeCache(),this._projCode=t.code},n._beforePaint=function(){var t=this.geometry[bi.CACHE_KEY];if(t)for(var e in t)w(t,e)&&(t[e].active=!1)},n._afterPaint=function(){var t=this.geometry[bi.CACHE_KEY];if(t)for(var e in t)w(t,e)&&(t[e].active||delete t[e])},e}(mn);var Li=function(t){function e(e){var n;return(n=t.call(this)||this).geometry=e,n}se(e,t);var n=e.prototype;return n._eachPainter=function(t){for(var e,n=this.geometry.getGeometries(),i=0,r=n.length;it&&(t=n)}),t},e}(mn),Ri=function(t){function e(e){var n,i=d({},e),r=i.symbol,o=i.properties,a=i.id;return delete i.symbol,delete i.id,delete i.properties,n=t.call(this,i)||this,r&&n.setSymbol(r),o&&n.setProperties(o),p(a)||n.setId(a),n}se(e,t);var n=e.prototype;return n.getFirstCoordinate=function(){if("GeometryCollection"===this.type){var t=this.getGeometries();return t.length?t[0].getFirstCoordinate():null}var e=this.getCoordinates();if(!Array.isArray(e))return e;do{e=e[0]}while(Array.isArray(e)&&e.length>0);return e},n.getLastCoordinate=function(){if("GeometryCollection"===this.type){var t=this.getGeometries();return t.length?t[t.length-1].getLastCoordinate():null}var e=this.getCoordinates();if(!Array.isArray(e))return e;do{e=e[e.length-1]}while(Array.isArray(e)&&e.length>0);return e},n.addTo=function(t,e){return t.addGeometry(this,e),this},n.getLayer=function(){return this._layer?this._layer:null},n.getMap=function(){return this._layer?this._layer.getMap():null},n.getId=function(){return this._id},n.setId=function(t){var e=this.getId();return this._id=t,this._fireEvent("idchange",{old:e,new:t}),this},n.getProperties=function(){return this.properties?this.properties:this._getParent()?this._getParent().getProperties():null},n.setProperties=function(t){var e=this.properties;return this.properties=v(t)?d({},t):t,this._repaint(),this._fireEvent("propertieschange",{old:e,new:t}),this},n.getType=function(){return this.type},n.getSymbol=function(){var t=this._symbol;return t?Array.isArray(t)?Nt(t):d({},t):null},n.setSymbol=function(t){return this._symbol=this._prepareSymbol(t),this.onSymbolChanged(),this},n.updateSymbol=function(t){if(!t)return this;var e=this._getSymbol();return e=Nt(e||this._getInternalSymbol(),t),this.setSymbol(e)},n.getCenter=function(){return this._computeCenter(this._getMeasurer())},n.getExtent=function(){var t=this._getPrjExtent();if(t){var e=this._getProjection(),n=e.unproject(new bn(t.xmin,t.ymin)),i=e.unproject(new bn(t.xmax,t.ymax));return new En(n,i,this._getProjection())}return this._computeExtent(this._getMeasurer())},n.getContainerExtent=function(){var t=this._getPainter();return t?t.getContainerExtent():null},n.getSize=function(){var t=this.getContainerExtent();return t?t.getSize():null},n.containsPoint=function(t,e){if(!this.getMap())throw new Error('The geometry is required to be added on a map to perform "containsPoint".');return t instanceof bn&&(t=this.getMap().coordToContainerPoint(t)),this._containsPoint(t,e)},n._containsPoint=function(t,e){var n=this._getPainter();return!!n&&(p(e)&&this._hitTestTolerance&&(e=this._hitTestTolerance()),n.hitTest(t,e))},n.show=function(){if(this.options.visible=!0,this.getMap()){var t=this._getPainter();t&&t.show(),this._fireEvent("show")}return this},n.hide=function(){if(this.options.visible=!1,this.getMap()){this.onHide();var t=this._getPainter();t&&t.hide(),this._fireEvent("hide")}return this},n.isVisible=function(){if(!this.options.visible)return!1;var t=this._getInternalSymbol();if(!t)return!0;if(Array.isArray(t)){if(!t.length)return!0;for(var e=0,n=t.length;e0)return!0;return!1}return p(t.opacity)||m(t.opacity)&&t.opacity>0},n.getZIndex=function(){return this.options.zIndex||0},n.setZIndex=function(t){var e=this.options.zIndex;return this.options.zIndex=t,this._fireEvent("zindexchange",{old:e,new:t}),this},n.setZIndexSilently=function(t){return this.options.zIndex=t,this},n.bringToFront=function(){var t=this.getLayer();if(!t||!t.getGeoMaxZIndex)return this;var e=t.getGeoMaxZIndex();return this.setZIndex(e+1),this},n.bringToBack=function(){var t=this.getLayer();if(!t||!t.getGeoMinZIndex)return this;var e=t.getGeoMinZIndex();return this.setZIndex(e-1),this},n.translate=function(t,e){if(p(t))return this;var n=new bn(t,e);if(0===n.x&&0===n.y)return this;var i=this.getCoordinates();if(i)if(Array.isArray(i)){var r=N(i,function(t){return t.add(n)});this.setCoordinates(r)}else this.setCoordinates(i.add(n));return this},n.flash=function(t,e,n,i){return nt.call(this,t,e,n,i)},n.copy=function(){var t=this.toJSON(),n=e.fromJSON(t);return n.options.visible=!0,n},n.remove=function(){return this.getLayer()?(this._fireEvent("removestart"),this._unbind(),this._fireEvent("removeend"),this._fireEvent("remove"),this):this},n.toGeoJSONGeometry=function(){return this._exportGeoJSONGeometry()},n.toGeoJSON=function(t){t||(t={});var e={type:"Feature",geometry:null};if(p(t.geometry)||t.geometry){var n=this._exportGeoJSONGeometry();e.geometry=n}var i,r=this.getId();return p(r)||(e.id=r),(p(t.properties)||t.properties)&&(i=this._exportProperties()),e.properties=i,e},n.toJSON=function(t){t||(t={});var e=this._toJSON(t);return d(e,this._exportGraphicOptions(t)),e},n.getLength=function(){return this._computeGeodesicLength(this._getMeasurer())},n.getArea=function(){return this._computeGeodesicArea(this._getMeasurer())},n.rotate=function(t,e){if("GeometryCollection"===this.type)return this.getGeometries().forEach(function(n){return n.rotate(t,e)}),this;e=e?new bn(e):this.getCenter();var n=this._getMeasurer(),i=this.getCoordinates();if(!Array.isArray(i)){if(e.x!==i.x||e.y!==i.y){var r=n._rotate(i,e,t);this.setCoordinates(r)}return this}return N(i,function(i){return n._rotate(i,e,t)}),this.setCoordinates(i),this},n._getConnectPoints=function(){return[this.getCenter()]},n._initOptions=function(t){var e=d({},t),n=e.symbol,i=e.properties,r=e.id;delete e.symbol,delete e.id,delete e.properties,this.setOptions(e),n&&this.setSymbol(n),i&&this.setProperties(i),p(r)||this.setId(r)},n._bindLayer=function(t){if(this.getLayer())throw new Error("Geometry cannot be added to two or more layers at the same time.");this._layer=t,this._clearCache(),this._clearProjection()},n._prepareSymbol=function(t){if(Array.isArray(t)){for(var e=[],n=0;n300){if("click"===o)return}else"touchend"===o&&(r="click")}var s=t.touches&&t.touches.length>0?t.touches[0]:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0]:t;if(s){var h=We(s,n._containerDOM),u=n.containerPointToCoordinate(h);"touchstart"===o&&je(t);var c=null,l={includeInternals:!0,filter:function(e){if(!(e instanceof Ri))return!1;var n=e._getEventTypeToFire(t);if("mousemove"===o){if(!c&&e.options.cursor&&(c=e.options.cursor),!e.listens("mousemove")&&!e.listens("mouseover")&&!e.listens("mouseenter"))return!1}else if(!e.listens(n)&&!e.listens(r))return!1;return!0},count:1,coordinate:u,onlyVisible:n.options.onlyVisibleGeometryEvents,layers:i},d=function(e){var i=!0;if("mousemove"===o){var a={};if(e.length>0)for(var s=e.length-1;s>=0;s--){var h=e[s];if(h instanceof Ri){var u=h._getInternalId();a[u]=h,h._onEvent(t),this._prevOverGeos&&this._prevOverGeos.geomap[u]||h._onEvent(t,"mouseenter"),i=h._onEvent(t,"mouseover")}}n._setPriorityCursor(c);var l=this._prevOverGeos&&this._prevOverGeos.geos;if(this._prevOverGeos={geos:e,geomap:a},l&&l.length>0)for(var f=l.length-1;f>=0;f--){var d=l[f];if(d instanceof Ri){var p=l[f]._getInternalId();a[p]||(i=d._onEvent(t,"mouseout"))}}}else{if(!e||!e.length)return;for(var m=e.length-1;m>=0;m--)if(e[m]instanceof Ri){i=e[m]._onEvent(t),r&&e[m]._onEvent(t,r);break}}!1===i&&Ge(t)}.bind(this);this._queryIdentifyTimeout&&T(this._queryIdentifyTimeout),"mousemove"===o||"touchmove"===o?this._queryIdentifyTimeout=S(function(){n.isInteracting()||n.identify(l,d)}):n.identify(l,d)}}}},e}(pn);ri.mergeOptions({geometryEvents:!0,onlyVisibleGeometryEvents:!0}),ri.addOnLoadHook("addHandler","geometryEvents",Ii);var Di=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.addHooks=function(){ze(this.target._containerDOM,"mousewheel",this._onWheelScroll,this)},n.removeHooks=function(){Fe(this.target._containerDOM,"mousewheel",this._onWheelScroll)},n._onWheelScroll=function(t){var e=this,n=this.target;if(n._ignoreEvent(t)||!n.options.zoomable)return!1;if(je(t),Ge(t),this._zooming)return this._requesting++,!1;this._requesting=0;var i=n._containerDOM,r=(t.wheelDelta?t.wheelDelta:t.detail)>0?1:-1;t.detail&&(r*=-1);var o=n.getZoom(),a=o+r;if((a=n._checkZoom(r>0?Math.ceil(a):Math.floor(a)))===o)return!1;this._zooming=!0;var s=n._checkZoomOrigin(We(t,i));this._delta||(n.onZoomStart(null,s),this._origin=s,this._delta=r,this._startZoom=n.getZoom());return n.animateTo({zoom:a-1*this._delta/2,around:this._origin},{continueOnViewChanged:!0,easing:"linear",duration:90,wheelZoom:!0},function(i){"finished"===i.state.playState&&(e._requesting<1||Math.abs(a-e._startZoom)>2||a===n.getMaxZoom()||a===n.getMinZoom()?(n.animateTo({zoom:a,around:e._origin},{continueOnViewChanged:!0,duration:100},function(t){"finished"===t.state.playState&&setTimeout(function(){delete e._zooming,delete e._requesting},200)}),delete e._startZoom,delete e._origin,delete e._delta,e._requesting=0):p(e._requesting)||(delete e._zooming,e._onWheelScroll(t)))}),!1},e}(pn);ri.mergeOptions({scrollWheelZoom:!0}),ri.addOnLoadHook("addHandler","scrollWheelZoom",Di);var ki=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.addHooks=function(){ze(this.target.getContainer(),"touchstart",this._onTouchStart,this)},n.removeHooks=function(){Fe(this.target.getContainer(),"touchstart",this._onTouchStart)},n._onTouchStart=function(t){var e=this.target;if(t.touches&&2===t.touches.length&&!e.isInteracting()){var n=e.getContainer(),i=We(t.touches[0],n),r=We(t.touches[1],n);this.preY=i.y,this._startP1=i,this._startP2=r,this._startDist=i.distanceTo(r),this._startVector=i.sub(r),this._startZoom=e.getZoom(),this._startBearing=e.getBearing(),ze(document,"touchmove",this._onTouchMove,this),ze(document,"touchend",this._onTouchEnd,this),je(t),e._fireEvent("touchactstart")}},n._onTouchMove=function(t){var e=this.target;if(t.touches&&2===t.touches.length){var n=e.getContainer(),i=We(t.touches[0],n),r=We(t.touches[1],n),o=i.sub(this._startP1),a=r.sub(this._startP2),s=i.sub(r),h=i.distanceTo(r)/this._startDist,u=180*s.angleWith(this._startVector)/Math.PI,c=.4*((this.preY||i.y)-i.y);this.preY=i.y;var l={domEvent:t,mousePos:[i,r]};if(this.mode||(e.options.touchRotate&&Math.abs(u)>8?this.mode=e.options.touchZoomRotate?"rotate_zoom":"rotate":e.options.touchPitch&&o.y*a.y>0&&Math.abs(o.y)>10&&Math.abs(a.y)>10?this.mode="pitch":e.options.zoomable&&e.options.touchZoom&&Math.abs(1-h)>.15&&(this.mode=e.options.touchZoomRotate&&e.options.touchRotate?"rotate_zoom":"zoom"),this._startTouching(l)),"zoom"===this.mode||"rotate_zoom"===this.mode){this._scale=h;var f=e._getResolution(this._startZoom)/h,d=e.getZoomFromRes(f);e.onZooming(d,this._Origin)}"rotate"===this.mode||"rotate_zoom"===this.mode?(e.setBearing(this._startBearing+u),e.onDragRotating(l)):"pitch"===this.mode&&(e.setPitch(e.getPitch()+c),e.onDragRotating(l)),e._fireEvent("touchactinging")}},n._startTouching=function(t){var e=this.target;if("zoom"===this.mode||"rotate_zoom"===this.mode){var n=e.getSize();this._Origin=new ce(n.width/2,n.height/2),e.onZoomStart(null,this._Origin)}"rotate"!==this.mode&&"pitch"!==this.mode&&"rotate_zoom"!==this.mode||e.onDragRotateStart(t)},n._onTouchEnd=function(t){delete this.preY;var e=this.target;if(nn(document,"touchmove",this._onTouchMove,this),nn(document,"touchend",this._onTouchEnd,this),"zoom"===this.mode||"rotate_zoom"===this.mode){var n=this._scale,i=e._getResolution(this._startZoom)/n,r=e.getZoomFromRes(i);e.onZoomEnd(r,this._Origin)}"pitch"!==this.mode&&"rotate"!==this.mode&&"rotate_zoom"!==this.mode||e.onDragRotateEnd({domEvent:t}),delete this.mode,e._fireEvent("touchactend")},e}(pn);ri.mergeOptions({touchGesture:!0,touchZoom:!0,touchPitch:!0,touchRotate:!0,touchZoomRotate:!1}),ri.addOnLoadHook("addHandler","touchGesture",ki);var Ni={in:function(t){return Math.pow(t,2)},out:function(t){return 1-Ni.in(1-t)},inAndOut:function(t){return 3*t*t-2*t*t*t},linear:function(t){return t},upAndDown:function(t){return t<.5?Ni.inAndOut(2*t):1-Ni.inAndOut(2*(t-.5))}},zi=function(t,e){this.state=t,this.styles=e},Fi=function(t,e,n){this._animation=t,this.options=e,this._onFrame=n,this.playState="idle",this.ready=!0,this.finished=!1},Bi={speed:{slow:2e3,normal:1e3,fast:500},_resolveStyles:function(t){if(!t)return null;function e(t){if(!Array.isArray(t))return Bi._resolveStyles(t);for(var e=[],n=[],i=[],r=0;r=this.duration&&(this._playStartTime=n,i=0),"running"===this.playState){var r=this._animation(i,this.duration);this.playState=r.state.playState,"idle"===this.playState?this.startTime>n&&setTimeout(this._run.bind(this),this.startTime-n):"running"===this.playState?this._framer(function(){"running"===t.playState&&(t.currentTime=i,e&&e(r),t._run())}):"finished"===this.playState&&(this.finished=!0,e&&e(r))}else if(e){"finished"===this.playState?i=this.duration:"idle"===this.playState&&(i=0);var o=this._animation(i,this.duration);o.state.playState=this.playState,e(o)}}});var ji=Object.freeze({Animation:Bi,Easing:Ni,Player:Fi,Frame:zi}),Gi=Xn(function(t){!function(){function e(t,e){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i}function n(t,e,n){var i=e.x,r=e.y,o=n.x-i,a=n.y-r;if(0!==o||0!==a){var s=((t.x-i)*o+(t.y-r)*a)/(o*o+a*a);s>1?(i=n.x,r=n.y):s>0&&(i+=o*s,r+=a*s)}return(o=t.x-i)*o+(a=t.y-r)*a}function i(t,e){var i=t.length-1,r=[t[0]];return function t(e,i,r,o,a){for(var s,h=o,u=i+1;uh&&(s=u,h=c)}h>o&&(s-i>1&&t(e,i,s,o,a),a.push(e[s]),r-s>1&&t(e,s,r,o,a))}(t,0,i,e,r),r.push(t[i]),r}function r(t,n,r){if(t.length<=2)return t;var o=void 0!==n?n*n:1;return t=i(t=r?t:function(t,n){for(var i,r=t[0],o=[r],a=1,s=t.length;an&&(o.push(i),r=i);return r!==i&&o.push(i),o}(t,o),o)}t.exports=r,t.exports.default=r}()}),Hi=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.getOutline=function(){var t=this._getPainter();if(!t)return null;var e=this.getMap(),n=t.getContainerExtent().convertTo(function(t){return e.containerPointToCoord(t)});return new Ui(n.toArray(),{symbol:{lineWidth:1,lineColor:"6b707b"}})},n.animateShow=function(t,e){var n=this;void 0===t&&(t={}),this._showPlayer&&this._showPlayer.finish(),_(t)&&(e=t={});var i=this.getCoordinates();if(0===i.length)return this;this._animIdx=0,this._animLenSoFar=0,this.show();var r=!!this.getShell?this.getShell().concat(this.getShell()[0]):this.getCoordinates(),o=this._getProjection();this._aniShowCenter=o.unproject(this._getPrjExtent().getCenter());var a=t.duration||1e3,s=this.getLength(),h=t.easing||"out";this.setCoordinates([]);var u=this._showPlayer=Bi.animate({t:a},{duration:a,easing:h},function(t){if(n.getMap()){var o=n._drawAnimShowFrame(t.styles.t,a,s,r);"finished"===t.state.playState&&(delete n._showPlayer,delete n._aniShowCenter,delete n._animIdx,delete n._animLenSoFar,delete n._animTailRatio,n.setCoordinates(i)),e&&e(t,o)}else if("finished"!==u.playState&&(u.finish(),e)){var h=n.getCoordinates();e(t,h[h.length-1])}});return u.play(),u},n._drawAnimShowFrame=function(t,e,n,i){if(0===t)return i[0];var r,o,a=this.getMap(),s=t/e*n,h=0;for(r=this._animIdx,o=i.length;rs));r++)this._animLenSoFar+=h;if(this._animIdx=r,this._animIdx>=o-1)return this.setCoordinates(i),i[i.length-1];var u=this._animIdx,c=i[u],l=i[u+1],f=(s-this._animLenSoFar)/h;this._animTailRatio=f;var d=c.x+(l.x-c.x)*f,p=c.y+(l.y-c.y)*f,m=new bn(d,p),g=!!this.getShell;if(!g&&this.options.smoothness>0){var v=i.slice(0,this._animIdx+3);this.setCoordinates(v)}else{var y=i.slice(0,this._animIdx+1);y.push(m),g?this.setCoordinates([this._aniShowCenter].concat(y)):this.setCoordinates(y)}return m},n._getCenterInExtent=function(t,e,n){var i=this.getExtent();if(!t.intersects(i))return null;var r=n(e,t);if(0===r.length)return null;var o=0,a=0,s=0;r.forEach(function(t){Array.isArray(t)?t.forEach(function(t){t.point&&(t=t.point),o+=t.x,a+=t.y,s++}):(t.point&&(t=t.point),o+=t.x,a+=t.y,s++)});var h=new bn(o,a)._multi(1/s);return h.count=s,h},n._getPath2DPoints=function(t,e,n){if(!U(t))return[];var i=this.getMap(),r=!e&&this._shouldSimplify(),o=this.options.simplifyTolerance*i._getResolution(),a=Array.isArray(t[0]);if(delete this._simplified,r&&!a){var s=t.length;t=Gi(t,o,!1),this._simplified=t.lengtht&&(t=e[n].lineWidth)}else t=e.lineWidth;return m(t)?t/2:1.5},n._coords2Extent=function(t,e){for(var n=new En(e),i=0,r=t.length;i1){for(var i=[],r=1;r0},n._projectRings=function(){this.getMap()?(this._prjCoords=this._projectCoords(this._coordinates),this._prjHoles=this._projectCoords(this._holes),this.onShapeChanged()):this.onShapeChanged()},n._cleanRing=function(t){for(var e=t.length-1;e>=0;e--)t[e]||t.splice(e,1)},n._checkRing=function(t){if(this._cleanRing(t),!t||!U(t))return!1;var e=t[t.length-1],n=!0;return t[0].x===e.x&&t[0].y===e.y||(n=!1),n},n._trimRing=function(t){var e=this._checkRing(t);return U(t)&&e&&t.splice(t.length-1,1),t},n._copyAndCloseRing=function(t){t=t.slice(0);var e=this._checkRing(t);return U(t)&&!e?(t.push(t[0].copy()),t):t},n._getPrjShell=function(){return"Polygon"===this.getJSONType()?this._getPrjCoordinates():this._getProjection()?(this._verifyProjection(),this._prjShell||(this._prjShell=this._projectCoords(this.getShell())),this._prjShell):null},n._getPrjHoles=function(){return this._getProjection()?(this._verifyProjection(),this._prjHoles||(this._prjHoles=this._projectCoords(this.getHoles())),this._prjHoles):null},n._computeGeodesicLength=function(t){var e=this.getCoordinates();if(!U(e))return 0;for(var n=0,i=0,r=e.length;i=0;r--)e[r]._initOptions(i),e[r]._setParent(this),e[r]._setEventParent(this),n&&e[r].setSymbol(n);return this._geometries=e,this.getLayer()&&(this._bindGeometriesToLayer(),this.onShapeChanged()),this},n.getGeometries=function(){return this._geometries||[]},n.forEach=function(t,e){for(var n=this.getGeometries(),i=0,r=n.length;i=0)return new er["Point"===e?"Marker":e](t.coordinates);if("GeometryCollection"===e){var o=t.geometries;if(!U(o))return new Xi;for(var a=[],s=o.length,h=0;h90&&t<270&&(n*=-1),t>180&&t<360&&(i*=-1);var p=r.locate(o,n,i);u.push(p)}return u},n.getHoles=function(){return[]},n.animateShow=function(){return this.show()},n._containsPoint=function(e,n){var i=this.getMap();if(i.isTransforming())return t.prototype._containsPoint.call(this,e,n);var r=i.getProjection(),o=p(n)?this._hitTestTolerance():n,a=r.projectCoords([this._coordinates,i.locate(this._coordinates,this.getWidth()/2,this.getHeight()/2)]);return di(e,i._prjToContainerPoint(a[0]),i._prjToContainerPoint(a[1]),o)},n._computePrjExtent=function(){return ir.prototype._computePrjExtent.apply(this,arguments)},n._computeExtent=function(){return ir.prototype._computeExtent.apply(this,arguments)},n._getMinMax=function(t){if(!t||!this._coordinates||p(this.width)||p(this.height))return null;var e=this.getWidth(),n=this.getHeight();return[t.locate(this._coordinates,-e/2,0),t.locate(this._coordinates,e/2,0),t.locate(this._coordinates,0,-n/2),t.locate(this._coordinates,0,n/2)]},n._computeGeodesicLength=function(){if(p(this.width)||p(this.height))return 0;var t=this.width>this.height?this.width:this.height;return 2*Math.PI*t/2-4*Math.abs(this.width-this.height)},n._computeGeodesicArea=function(){return p(this.width)||p(this.height)?0:Math.PI*this.width*this.height/4},n._exportGeoJSONGeometry=function(){return{type:"Polygon",coordinates:bn.toNumberArrays([this.getShell()])}},n._toJSON=function(t){var e=d({},t),n=this.getCenter();e.geometry=!1;var i=this.toGeoJSON(e);return i.geometry={type:"Polygon"},{feature:i,subType:"Ellipse",coordinates:[n.x,n.y],width:this.getWidth(),height:this.getHeight()}},e}(Vi(Ui));rr.mergeOptions({numberOfShellPoints:80}),rr.registerJSONType("Ellipse");var or=function(t){function e(e,n,i,r){var o;return o=t.call(this,null,r)||this,e&&o.setCoordinates(e),o._width=n,o._height=i,o}se(e,t),e.fromJSON=function(t){var n=t.feature,i=new e(t.coordinates,t.width,t.height,t.options);return i.setProperties(n.properties),i};var n=e.prototype;return n.getCoordinates=function(){return this._coordinates},n.setCoordinates=function(t){if(this._coordinates=t instanceof bn?t:new bn(t),!this._coordinates||!this.getMap())return this.onPositionChanged(),this;var e=this._getProjection();return this._setPrjCoordinates(e.project(this._coordinates)),this},n.getWidth=function(){return this._width},n.setWidth=function(t){return this._width=t,this.onShapeChanged(),this},n.getHeight=function(){return this._height},n.setHeight=function(t){return this._height=t,this.onShapeChanged(),this},n.getShell=function(){var t=this._getMeasurer(),e=this._coordinates,n=this.getMap(),i=1,r=-1;if(n){var o=n.getFullExtent();o.left>o.right&&(i=-1),o.bottom>o.top&&(r=1)}var a=[];return a.push(e),a.push(t.locate(e,i*this._width,0)),a.push(t.locate(e,i*this._width,r*this._height)),a.push(t.locate(e,0,r*this._height)),a.push(e),a},n.getHoles=function(){return[]},n.animateShow=function(){return this.show()},n._getPrjCoordinates=function(){var t=this._getProjection();return t?(this._verifyProjection(),this._pnw||this._coordinates&&(this._pnw=t.project(this._coordinates)),this._pnw):null},n._setPrjCoordinates=function(t){this._pnw=t,this.onPositionChanged()},n._getPrjShell=function(){var e=t.prototype._getPrjShell.call(this),n=this._getProjection();if(!n.isSphere())return e;for(var i=n.getSphereExtent(),r=i.sx,o=i.sy,a=this._getProjection().getCircum(),s=e[0],h=1,u=e.length;h0&&(l=a.x*r),o*(s.y-c.y)<0&&(f=a.y*o),e[h]._add(l,f)}return e},n._updateCache=function(){this._clearCache();var t=this._getProjection();this._pnw&&t&&(this._coordinates=t.unproject(this._pnw))},n._clearProjection=function(){this._pnw=null,t.prototype._clearProjection.call(this)},n._computeCenter=function(t){return t.locate(this._coordinates,this._width/2,-this._height/2)},n._containsPoint=function(e,n){var i=this.getMap();if(i.isTransforming())return t.prototype._containsPoint.call(this,e,n);var r=p(n)?this._hitTestTolerance():n,o=i._getResolution()*r,a=this._getPrjExtent().expand(o),s=i._containerPointToPrj(e);return a.contains(s)},n._computePrjExtent=function(t){var e=this._getSouthEast(t);if(!e)return null;var n=t.projectCoords([new bn(this._coordinates.x,e.y),new bn(e.x,this._coordinates.y)]);return new En(n[0],n[1])},n._computeExtent=function(t){var e=this._getSouthEast(t);return e?new En(this._coordinates,e,this._getProjection()):null},n._getSouthEast=function(t){if(!t||!this._coordinates||p(this._width)||p(this._height))return null;var e=this.getWidth(),n=-this.getHeight();if(t.fullExtent){var i=t.fullExtent;e*=i.right>i.left?1:-1,n*=i.top>i.bottom?1:-1}return t.locate(this._coordinates,e,n)},n._computeGeodesicLength=function(){return p(this._width)||p(this._height)?0:2*(this._width+this._height)},n._computeGeodesicArea=function(){return p(this._width)||p(this._height)?0:this._width*this._height},n._exportGeoJSONGeometry=function(){return{type:"Polygon",coordinates:bn.toNumberArrays([this.getShell()])}},n._toJSON=function(t){var e=d({},t),n=this.getCoordinates();e.geometry=!1;var i=this.toGeoJSON(e);return i.geometry={type:"Polygon"},{feature:i,subType:"Rectangle",coordinates:[n.x,n.y],width:this.getWidth(),height:this.getHeight()}},e}(Ui);or.registerJSONType("Rectangle");var ar=function(t){function e(e,n,i,r,o){var a;return(a=t.call(this,e,n,o)||this).startAngle=i,a.endAngle=r,a}se(e,t),e.fromJSON=function(t){var n=t.feature,i=new e(t.coordinates,t.radius,t.startAngle,t.endAngle,t.options);return i.setProperties(n.properties),i};var n=e.prototype;return n.getStartAngle=function(){return this.startAngle},n.setStartAngle=function(t){return this.startAngle=t,this.onShapeChanged(),this},n.getEndAngle=function(){return this.endAngle},n.setEndAngle=function(t){return this.endAngle=t,this.onShapeChanged(),this},n.getShell=function(){for(var t,e,n,i=this._getMeasurer(),r=this.getCoordinates(),o=this.options.numberOfShellPoints-2,a=this.getRadius(),s=[r.copy()],h=this.getStartAngle(),u=this.getEndAngle()-h,c=0;cm?!(f>m&&f=d&&f<=m,h.distanceTo(s)<=a.width/2+o&&g},n._computeGeodesicLength=function(){return p(this._radius)?0:2*Math.PI*this._radius*Math.abs(this.startAngle-this.endAngle)/360+2*this._radius},n._computeGeodesicArea=function(){return p(this._radius)?0:Math.PI*Math.pow(this._radius,2)*Math.abs(this.startAngle-this.endAngle)/360},n._toJSON=function(t){var e=d({},t),n=this.getCenter();e.geometry=!1;var i=this.toGeoJSON(e);return i.geometry={type:"Polygon"},{feature:i,subType:"Sector",coordinates:[n.x,n.y],radius:this.getRadius(),startAngle:this.getStartAngle(),endAngle:this.getEndAngle()}},e}(ir);ar.mergeOptions({numberOfShellPoints:60}),ar.registerJSONType("Sector");var sr=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n._arc=function(t,e,n){for(var i=this.options.arcDegree*Math.PI/180,r=1,o=e.length;r0},e._getConnectors=function(t){return t.__connectors};var n=e.prototype;return n.getConnectSource=function(){return this._connSource},n.setConnectSource=function(t){var e=this._connTarget;return this.onRemove(),this._connSource=t,this._connTarget=e,this.onAdd(),this},n.getConnectTarget=function(){return this._connTarget},n.setConnectTarget=function(t){var e=this._connSource;return this.onRemove(),this._connSource=e,this._connTarget=t,this._updateCoordinates(),this._registerEvents(),this},n._updateCoordinates=function(){var t=this.getMap();if(!t&&this._connSource&&(t=this._connSource.getMap()),!t&&this._connTarget&&(t=this._connTarget.getMap()),t&&this._connSource&&this._connTarget){for(var e,n,i=this._connSource._getConnectPoints(),r=this._connTarget._getConnectPoints(),o=0,a=this.getCoordinates(),s=0,h=i.length;s0;for(var o=[],a=0,s=t.length;a=0;e--)t[e]instanceof Ri||(t[e]=this.getGeometryById(t[e])),t[e]&&this===t[e].getLayer()&&t[e].remove();return this.fire("removegeo",{geometries:t}),this},n.clear=function(){this._clearing=!0,this.forEach(function(t){t.remove()}),this._geoMap={};var t=this._geoList;return this._geoList=[],this._getRenderer()&&this._getRenderer().onGeometryRemove(t),this._clearing=!1,this.fire("clear"),this},n.onRemoveGeometry=function(t){if(t&&!this._clearing&&(this===t.getLayer()&&!p(t._getInternalId()))){var e=t.getId();p(e)||delete this._geoMap[e];var n=this._findInList(t);n>=0&&this._geoList.splice(n,1),this._getRenderer()&&this._getRenderer().onGeometryRemove([t])}},n.hide=function(){for(var t=0,e=this._geoList.length;t=0;u--){var c=t[u];if(c&&c.isVisible()&&c._getPainter()){if(!(c instanceof qi&&(c._getArrowStyle()||c instanceof sr))){var l=c.getContainerExtent();if(r&&(l=l.expand(r)),!l||!l.contains(h))continue}if(c._containsPoint(h,r)&&(!i||i(c))&&(o.push(c),n.count&&o.length>=n.count))break}}return o},n._initCache=function(){this._geoList||(this._geoList=[],this._geoMap={})},n._updateZIndex=function(){for(var t=arguments.length,e=new Array(t),n=0;n0?r=n-1:i=n+1}return-1},n._onGeometryEvent=function(t){if(t&&t.target){var e=t.type;"idchange"===e?this._onGeometryIdChange(t):"zindexchange"===e?this._onGeometryZIndexChange(t):"positionchange"===e?this._onGeometryPositionChange(t):"shapechange"===e?this._onGeometryShapeChange(t):"symbolchange"===e?this._onGeometrySymbolChange(t):"show"===e?this._onGeometryShow(t):"hide"===e?this._onGeometryHide(t):"propertieschange"===e&&this._onGeometryPropertiesChange(t)}},n._onGeometryIdChange=function(t){if(t.new!==t.old||!this._geoMap[t.old]||this._geoMap[t.old]!==t.target){if(!p(t.new)){if(this._geoMap[t.new])throw new Error("Duplicate geometry id in layer("+this.getId()+"):"+t.new);this._geoMap[t.new]=t.target}p(t.old)||t.new===t.old||delete this._geoMap[t.old]}},n._onGeometryZIndexChange=function(t){t.old!==t.new&&(this._updateZIndex(t.new),this._toSort=!0,this._getRenderer()&&this._getRenderer().onGeometryZIndexChange(t))},n._onGeometryPositionChange=function(t){this._getRenderer()&&this._getRenderer().onGeometryPositionChange(t)},n._onGeometryShapeChange=function(t){this._getRenderer()&&this._getRenderer().onGeometryShapeChange(t)},n._onGeometrySymbolChange=function(t){this._getRenderer()&&this._getRenderer().onGeometrySymbolChange(t)},n._onGeometryShow=function(t){this._getRenderer()&&this._getRenderer().onGeometryShow(t)},n._onGeometryHide=function(t){this._getRenderer()&&this._getRenderer().onGeometryHide(t)},n._onGeometryPropertiesChange=function(t){this._getRenderer()&&this._getRenderer().onGeometryPropertiesChange(t)},e}($n);xr.mergeOptions({drawImmediate:!1});var wr={debug:!1,enableSimplify:!0,geometryEvents:!0,defaultIconSize:[20,20],cacheVectorOnCanvas:!0,cacheSvgOnCanvas:ae.gecko,enableAltitude:!1,altitudeProperty:"altitude",drawAltitude:!1},br=function(t){function e(e,n,i){var r,o=(r=t.call(this,e,n,i)||this).options.style;return delete r.options.style,o&&r.setStyle(o),r}se(e,t);var n=e.prototype;return n.getStyle=function(){return this._style?this._style:null},n.setStyle=function(t){return this._style=t,this._cookedStyles=pt(t),this.forEach(function(t){this._styleGeometry(t)},this),this.fire("setstyle",{style:t}),this},n.removeStyle=function(){return this._style?(delete this._style,delete this._cookedStyles,this.forEach(function(t){t._setExternSymbol(null)},this),this.fire("removestyle"),this):this},n.onAddGeometry=function(t){this.getStyle()&&this._styleGeometry(t)},n.onConfig=function(e){if(t.prototype.onConfig.call(this,e),e.enableAltitude||e.drawAltitude||e.altitudeProperty){var n=this.getRenderer();n&&n.setToRedraw&&n.setToRedraw()}},n._styleGeometry=function(t){if(!this._cookedStyles)return!1;for(var e=dt(t),n=0,i=this._cookedStyles.length;n-1){var e=this.getMap();this._mapDraggable=e.options.draggable,e.config({draggable:!1})}},n._restoreMapCfg=function(){var t=this.getMap();t.config({doubleClickZoom:this._mapDoubleClickZoom}),p(this._mapDraggable)||t.config("draggable",this._mapDraggable),delete this._mapDraggable,delete this._mapDoubleClickZoom},n._loadResources=function(){var t=Lt(this.getSymbol());t.length>0&&this._drawToolLayer._getRenderer().loadResources(t)},n._getProjection=function(){return this._map.getProjection()},n._getRegisterMode=function(){var t=this.getMode(),n=e.getRegisterMode(t);if(!n)throw new Error(t+" is not a valid mode of DrawTool.");return n},n.getEvents=function(){var t=this._getRegisterMode().action,e={};if(Array.isArray(t)){for(var n=0;n0&&n.equals(o[o.length-1]))return;r.update(o.concat([n]),this._geometry,t)}else r.update([n],this._geometry,t);this._fireEvent("mousemove",t)}}},n._doubleClickHandler=function(t){if(this._geometry){var e=this._getMouseContainerPoint(t);if(this._isValidContainerPoint(e)){var n=this._getRegisterMode(),i=this._clickCoords;if(!(i.length<2)){for(var r=[i[0]],o=1,a=i.length;on||t.y>i)},n._getDrawLayer=function(){var t=o+"drawtool",e=this._map.getLayer(t);return e||(e=new br(t,{enableSimplify:!1}),this._map.addLayer(e)),e},n._fireEvent=function(t,e){e||(e={}),this._geometry&&(e.geometry=this._getRegisterMode().generate(this._geometry).copy()),Er.prototype._fireEvent.call(this,t,e)},e}(Er);Tr.mergeOptions({symbol:{lineColor:"#000",lineWidth:2,lineOpacity:1,polygonFill:"#fff",polygonOpacity:.3},doubleClickZoom:!1,mode:null,once:!1,ignoreMouseleave:!0});var Cr=function(t){function e(e){var n;return(n=t.call(this,e)||this).drawTool=new Tr({mode:"boxZoom",ignoreMouseleave:!1}),n}se(e,t);var n=e.prototype;return n.addHooks=function(){this.target.on("_mousedown",this._onMouseDown,this)},n.removeHooks=function(){this.target.off("_mousedown",this._onMouseDown,this),this.drawTool.isEnabled()&&this.drawTool.remove()},n._onMouseDown=function(t){this.target.options.boxZoom&&t.domEvent.shiftKey&&this.drawTool.setSymbol(this.target.options.boxZoomSymbol).on("drawend",this._boxZoom,this).addTo(this.target)},n._boxZoom=function(t){var e=this.target;this.drawTool.remove();var n=t.geometry,i=n.getCenter(),r=n.getSymbol(),o=r.markerWidth,a=r.markerHeight,s=new En(i,e.locateByPoint(i,o,a),e.getProjection()),h=e.getFitZoom(s);e.animateTo({center:s.getCenter(),zoom:h})},e}(pn);ri.mergeOptions({boxZoom:!0,boxZoomSymbol:{markerType:"rectangle",markerLineWidth:3,markerLineColor:"#1bbc9b",markerLineDasharray:[10,5],markerFillOpacity:.1,markerFill:"#1bbc9b",markerWidth:1,markerHeight:1}}),ri.addOnLoadHook("addHandler","boxZoom",Cr),ri.include({animateTo:function(t,e,n){var i=this;void 0===e&&(e={}),this._stopAnim(this._animPlayer),_(e)&&(n=e,e={});var r=this.getProjection(),o=this.getView(),a={},s=!0;for(var h in t)if(w(t,h)&&!p(o[h]))if(s=!1,"center"===h){var u=new bn(o[h]).toFixed(7),c=new bn(t[h]).toFixed(7);u.equals(c)||(a.center=[u,c])}else o[h]!==t[h]&&"around"!==h&&(a[h]=[o[h],t[h]]);if(s)return null;var l=t.around||new ce(this.width/2,this.height/2),f=this.getView(),d=this._getRenderer(),m=this._animPlayer=Bi.animate(a,{easing:e.easing||"out",duration:e.duration||this.options.zoomAnimationDuration,framer:function(t){d.callInNextFrame(t)}},function(t){if(i.isRemoved())m.finish();else{if("running"===m.playState){var o=i.getView();if(!e.continueOnViewChanged&&!function(t,e){for(var n in t)if(w(t,n))if("center"===n){if(t[n][0]!==e[n][0]||t[n][1]!==e[n][1])return!1}else if(t[n]!==e[n])return!1;return!0}(o,f))return void i._stopAnim(m);if(t.styles.center){var s=t.styles.center;i._setPrjCenter(r.project(s)),i.onMoving(i._parseEventFromCoord(i.getCenter()))}p(t.styles.zoom)||i.onZooming(t.styles.zoom,l),p(t.styles.pitch)||i.setPitch(t.styles.pitch),p(t.styles.bearing)||i.setBearing(t.styles.bearing),f=i.getView(),i._fireEvent("animating")}else"finished"===m.playState&&(m._interupted||(a.center&&i._setPrjCenter(r.project(a.center[1])),p(a.pitch)||i.setPitch(a.pitch[1]),p(a.bearing)||i.setBearing(a.bearing[1])),i._endAnim(m,a,l,e),f=i.getView());n&&n(t)}});return this._startAnim(a,l),m},isAnimating:function(){return!!this._animPlayer},isRotating:function(){return this.isDragRotating()||!!this._animRotating},_endAnim:function(t,e,n,i){delete this._animRotating;var r,o=t._interupted?"animateinterrupted":"animateend";(t===this._animPlayer&&delete this._animPlayer,e.center)&&(r=t._interupted?this.getCenter():e.center[1],this.onMoveEnd(this._parseEventFromCoord(r)));p(e.zoom)||(t._interupted?this.onZoomEnd(this.getZoom(),n):i.wheelZoom?this.onZooming(e.zoom[1],n):this.onZoomEnd(e.zoom[1],n)),o&&this._fireEvent(o),p(e.pitch)||this.getPitch()||this.getRenderer().setToRedraw()},_startAnim:function(t,e){this._animPlayer&&(t.center&&this.onMoveStart(),t.zoom&&!this.isZooming()&&this.onZoomStart(t.zoom[1],e),(t.pitch||t.bearing)&&(this._animRotating=!0),this._fireEvent("animatestart"),this._animPlayer.play())},_stopAnim:function(t){t&&"finished"!==t.playState&&(t._interupted=!0,t.finish())}});var Pr="mousedown mouseup mouseover mouseout mouseenter mouseleave mousemove click dblclick contextmenu keypress touchstart touchmove touchend ";function Ar(t,e,n){var i,r,o,a,s,h,u,c,l,f,d,p,m=n[0],g=n[1],v=n[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*v+e[12],t[13]=e[1]*m+e[5]*g+e[9]*v+e[13],t[14]=e[2]*m+e[6]*g+e[10]*v+e[14],t[15]=e[3]*m+e[7]*g+e[11]*v+e[15]):(i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=h,t[6]=u,t[7]=c,t[8]=l,t[9]=f,t[10]=d,t[11]=p,t[12]=i*m+s*g+l*v+e[12],t[13]=r*m+h*g+f*v+e[13],t[14]=o*m+u*g+d*v+e[14],t[15]=a*m+c*g+p*v+e[15]),t}function Lr(t,e,n){var i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Rr(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],h=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],m=e[12],g=e[13],v=e[14],y=e[15],_=n[0],x=n[1],w=n[2],b=n[3];return t[0]=_*i+x*s+w*l+b*m,t[1]=_*r+x*h+w*f+b*g,t[2]=_*o+x*u+w*d+b*v,t[3]=_*a+x*c+w*p+b*y,_=n[4],x=n[5],w=n[6],b=n[7],t[4]=_*i+x*s+w*l+b*m,t[5]=_*r+x*h+w*f+b*g,t[6]=_*o+x*u+w*d+b*v,t[7]=_*a+x*c+w*p+b*y,_=n[8],x=n[9],w=n[10],b=n[11],t[8]=_*i+x*s+w*l+b*m,t[9]=_*r+x*h+w*f+b*g,t[10]=_*o+x*u+w*d+b*v,t[11]=_*a+x*c+w*p+b*y,_=n[12],x=n[13],w=n[14],b=n[15],t[12]=_*i+x*s+w*l+b*m,t[13]=_*r+x*h+w*f+b*g,t[14]=_*o+x*u+w*d+b*v,t[15]=_*a+x*c+w*p+b*y,t}function Or(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],h=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],m=e[13],g=e[14],v=e[15],y=n*s-i*a,_=n*h-r*a,x=n*u-o*a,w=i*h-r*s,b=i*u-o*s,M=r*u-o*h,E=c*m-l*p,S=c*g-f*p,T=c*v-d*p,C=l*g-f*m,P=l*v-d*m,A=f*v-d*g,L=y*A-_*P+x*C+w*T-b*S+M*E;return L?(L=1/L,t[0]=(s*A-h*P+u*C)*L,t[1]=(r*P-i*A-o*C)*L,t[2]=(m*M-g*b+v*w)*L,t[3]=(f*b-l*M-d*w)*L,t[4]=(h*T-a*A-u*S)*L,t[5]=(n*A-r*T+o*S)*L,t[6]=(g*x-p*M-v*_)*L,t[7]=(c*M-f*x+d*_)*L,t[8]=(a*P-s*T+u*E)*L,t[9]=(i*T-n*P-o*E)*L,t[10]=(p*b-m*x+v*y)*L,t[11]=(l*x-c*b-d*y)*L,t[12]=(s*S-a*C-h*E)*L,t[13]=(n*C-i*S+r*E)*L,t[14]=(m*_-p*w-g*y)*L,t[15]=(c*w-l*_+f*y)*L,t):null}function Ir(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Dr(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function kr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Nr(t){var e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)}function zr(t,e){var n=e[0],i=e[1],r=e[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function Fr(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],h=n[2];return t[0]=r*h-o*s,t[1]=o*a-i*h,t[2]=i*s-r*a,t}function Br(t,e,n){var i=e[0],r=e[1],o=e[2],a=1/(n[3]*i+n[7]*r+n[11]*o+n[15]);return t[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])*a,t[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])*a,t[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])*a,t}ri.include({_registerDomEvents:function(){ze(this._panels.mapWrapper||this._containerDOM,Pr,this._handleDOMEvent,this)},_removeDomEvents:function(){Fe(this._panels.mapWrapper||this._containerDOM,Pr,this._handleDOMEvent)},_handleDOMEvent:function(t){var e=t.type;if("contextmenu"===e&&je(t),!this._ignoreEvent(t)){var n=!1;if("mousedown"===e||"touchstart"===e&&1===t.touches.length)this._mouseDownTime=f();else if("click"===e||"touchend"===e||"contextmenu"===e){if(!this._mouseDownTime)return;var i=this._mouseDownTime;if(delete this._mouseDownTime,f()-i>300){if("click"===e||"contextmenu"===e)return}else"touchend"===e&&(n=!0)}this._fireDOMEvent(this,t,e),n&&(this._clickTime&&f()-this._clickTime<=300?(delete this._clickTime,this._fireDOMEvent(this,t,"dblclick")):(this._clickTime=f(),this._fireDOMEvent(this,t,"click")))}},_ignoreEvent:function(t){if(!t||!this._panels.control)return!1;if(this._isEventOutMap(t))return!0;var e,n=t.srcElement||t.target;if(n)for(;n&&n!==this._containerDOM;){if(n.className&&n.className.indexOf&&(n.className.indexOf("maptalks-control")>=0||n.className.indexOf("maptalks-ui")>=0&&!e.eventsPropagation))return!0;e=n,n=n.parentNode}return!1},_isEventOutMap:function(t){if(this.getPitch()>this.options.maxVisualPitch){var e=We(this._getActualEvent(t),this._containerDOM);if(!this.getContainerExtent().contains(e))return!0}return!1},_parseEvent:function(t,e){if(!t)return null;var n={domEvent:t};if("keypress"!==e){var i=this._getActualEvent(t);if(i){var r=We(i,this._containerDOM);n=d(n,{coordinate:this.containerPointToCoord(r),containerPoint:r,viewPoint:this.containerPointToViewPoint(r),point2d:this._containerPointToPoint(r)})}}return n},_parseEventFromCoord:function(t){var e=this.coordToContainerPoint(t);return{coordinate:t,containerPoint:e,viewPoint:this.containerPointToViewPoint(e),point2d:this.coordToPoint(t)}},_getActualEvent:function(t){return t.touches&&t.touches.length>0?t.touches[0]:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0]:t},_fireDOMEvent:function(t,e,n){if(!this.isRemoved()){var i=this._parseEvent(e,n);this._fireEvent(n,i)}}}),ri.addOnLoadHook("_registerDomEvents"),ri.include({isFullScreen:function(){return!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement)},requestFullScreen:function(t){return this._fireEvent("fullscreenstart"),this._requestFullScreen(t||this._containerDOM),this._fireEvent("fullscreenend"),this},cancelFullScreen:function(){return this._cancelFullScreen(),this._fireEvent("cancelfullscreen"),this},_requestFullScreen:function(t){if(t.requestFullScreen)t.requestFullScreen();else if(t.mozRequestFullScreen)t.mozRequestFullScreen();else if(t.webkitRequestFullScreen)t.webkitRequestFullScreen();else if(t.msRequestFullScreen)t.msRequestFullScreen();else{var e="fullscreen=1,status=no,resizable=yes,top=0,left=0,scrollbars=no,titlebar=no,menubar=no,location=no,toolbar=no,z-look=yes,width="+(screen.availWidth-8)+",height="+(screen.availHeight-45);null!==window.open(location.href,"_blank",e)&&(window.opener=null,window.close())}},_cancelFullScreen:function(){if(document.cancelFullScreen)document.cancelFullScreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else{null!==window.open(location.href,"_blank","fullscreen=no,status=yes,resizable=yes,scrollbars=no,titlebar=no,menubar=yes,location=yes,toolbar=yes,z-look=yes")&&(window.opener=null,window.close())}}}),ri.include({panTo:function(t,e,n){return void 0===e&&(e={}),t?(_(e)&&(n=e,e={}),t=new bn(t),void 0===e.animation||e.animation?this._panAnimation(t,e.duration,n):(this.setCenter(t),this)):this},panBy:function(t,e,n){if(void 0===e&&(e={}),!t)return this;if(_(e)&&(n=e,e={}),t=new ce(t).multi(-1),this.onMoveStart(),void 0===e.animation||e.animation){var i=this.locateByPoint(this.getCenter(),t.x,t.y);this._panAnimation(i,e.duration,n)}else this._offsetCenterByPixel(t),this.onMoveEnd(this._parseEventFromCoord(this.getCenter()));return this},_panAnimation:function(t,e,n){return this.animateTo({center:t},{duration:e||this.options.panAnimationDuration},n)}}),Ri.fromJSON=function(t){if(Array.isArray(t)){for(var e=[],n=0,i=t.length;n=0&&!(t.count&&u.length>=t.count);c--){var l=i[c];if(l&&l.getMap()&&(t.includeInvisible||l.isVisible())&&(t.includeInternals||!(l.getId().indexOf(o)>=0))){var f=l.identify(s,h);f&&(Array.isArray(f)?D(u,f):u.push(f))}}return e.call(this,u),this}}),ri.include({_zoom:function(t,e){this.options.zoomable&&!this.isZooming()&&(e=this._checkZoomOrigin(e),t=this._checkZoom(t),this.onZoomStart(t,e),this._frameZoom=this.getZoom(),this.onZoomEnd(t,e))},_zoomAnimation:function(t,e,n){this.options.zoomable&&!this.isZooming()&&(t=this._checkZoom(t),this.getZoom()!==t&&(e=this._checkZoomOrigin(e),this._startZoomAnim(t,e,n)))},_checkZoomOrigin:function(t){return t&&!this.options.zoomInCenter||(t=new ce(this.width/2,this.height/2)),t},_startZoomAnim:function(t,e,n){p(n)&&(n=1);var i=this._getResolution(this._startZoomVal)/this._getResolution(t),r=this.options.zoomAnimationDuration*Math.abs(i-n)/Math.abs(i-1);this._frameZoom=this._startZoomVal,this.animateTo({zoom:t,around:e},{continueOnViewChanged:!0,duration:r})},onZoomStart:function(t,e){this.options.zoomable&&!this.isZooming()&&(this._zooming=!0,this._startZoomVal=this.getZoom(),this._startZoomCoord=this._containerPointToPrj(e),this._fireEvent("zoomstart",{from:this._startZoomVal,to:t}))},onZooming:function(t,e,n){if(this.options.zoomable&&this._frameZoom!==t){p(n)&&(n=1),this._zoomTo(t,e);var i=this.getResolution(t),r=this.getResolution(this._startZoomVal)/i/n,o=this._prjToContainerPoint(this._startZoomCoord,this._startZoomVal),a=this.getViewPoint();if(!this.isRotating()&&!o.equals(e)&&1!==r){var s=this.getPitch(),h=o._sub(e)._multi(1/(1-r));s&&(h.y/=Math.cos(s*Math.PI/180)),e=e.add(h)}var u={view:[r,0,0,r,(e.x-a.x)*(1-r),(e.y-a.y)*(1-r)]};ae.retina&&(e=e.multi(2)),u.container=[r,0,0,r,e.x*(1-r),e.y*(1-r)],this._fireEvent("zooming",{from:this._startZoomVal,to:t,origin:e,matrix:u}),this._frameZoom=t}},onZoomEnd:function(t,e){if(this.options.zoomable){var n=this._startZoomVal;this._zoomTo(t,e),this._zooming=!1,this._getRenderer().onZoomEnd(),this._fireEvent("zoomend",{from:n,to:t}),this._verifyExtent(this.getCenter())||this.panTo(this.getMaxExtent().getCenter())}},_zoomTo:function(t,e){this._zoomLevel=t,this._calcMatrices(),e&&this._setPrjCoordAtContainerPoint(this._startZoomCoord,e)},_checkZoom:function(t){var e=this.getMaxZoom(),n=this.getMinZoom();return te&&(t=e),t}});var jr=Math.PI/180;function Gr(){return Ir(new Array(16))}ri.include({getFov:function(){return this._fov||(this._fov=.6435011087932844),this._fov/jr},setFov:function(t){if(this.isZooming())return this;if(t=Math.max(.01,Math.min(60,t)),this._fov===t)return this;var e=this.getFov();return this._fov=t*jr,this._calcMatrices(),this._renderLayers(),this._fireEvent("fovchange",{from:e,to:this.getFov()}),this},getBearing:function(){return this._angle?-this._angle/jr:0},setBearing:function(t){if(ae.ie9)throw new Error("map can't rotate in IE9.");var e=-G(t,-180,180)*jr;if(this._angle===e)return this;var n=this.getBearing();return this._fireEvent("rotatestart",{from:n,to:e}),this._angle=e,this._calcMatrices(),this._renderLayers(),this._fireEvent("rotate",{from:n,to:e}),this._fireEvent("rotateend",{from:n,to:e}),this},getPitch:function(){return this._pitch?this._pitch/Math.PI*180:0},setPitch:function(t){if(ae.ie9)throw new Error("map can't tilt in IE9.");var e=H(t,0,this.options.maxPitch)*jr;if(this._pitch===e)return this;var n=this.getPitch();return this._fireEvent("pitchstart",{from:n,to:e}),this._pitch=e,this._calcMatrices(),this._renderLayers(),this._fireEvent("pitch",{from:n,to:e}),this._fireEvent("pitchend",{from:n,to:e}),this},isTransforming:function(){return!(!this._pitch&&!this._angle)},getFrustumAltitude:function(){var t=90-this.getPitch(),e=this.getFov()/2,n=this.cameraPosition?this.cameraPosition[2]:0;if(e<=t)return n;e=Math.PI*e/180;var i=new ce(this.cameraPosition).distanceTo(new ce(this.cameraLookAt)),r=n*Math.tan(2*e);return n+Math.tan(e)*(i+r)},_pointToContainerPoint:function(){var t=[0,0,0];return function(e,n,i){if(void 0===i&&(i=0),e=this._pointToPoint(e,n),this.isTransforming()||i){i*=this.getResolution(n)/this.getResolution();var r=this._glScale;Dr(t,e.x*r,e.y*r,i*r);var o=this._projIfBehindCamera(t,this.cameraPosition,this.cameraForward);Br(o,o,this.projViewMatrix);var a=this.width/2,s=this.height/2;return o[0]=o[0]*a+a,o[1]=-o[1]*s+s,new ce(o[0],o[1])}var h=this._prjToPoint(this._getPrjCenter());return e._sub(h)._add(this.width/2,this.height/2)}}(),_projIfBehindCamera:function(){var t=new Array(3),e=new Array(3),n=new Array(3);return function(i,r,o){kr(t,i,r);var a=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}(o,t);return a<=0&&(function(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}(e,o,1.01*a),function(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}(i,r,kr(n,t,e))),i}}(),_containerPointToPoint:function(){var t=[0,0,0],e=[0,0,0,1],n=[0,0,0,1];return function(i,r){if(this.isTransforming()){var o=this.width/2||1,a=this.height/2||1;Dr(t,(i.x-o)/o,(a-i.y)/a,0),Dr(e,t[0],t[1],0),Dr(n,t[0],t[1],1),e[3]=n[3]=1,Br(e,e,this.projViewMatrixInverse),Br(n,n,this.projViewMatrixInverse);var s=e[0],h=n[0],u=e[1],c=n[1],l=e[2],f=n[2],d=l===f?0:(0-l)/(f-l),p=new ce(j(s,h,d),j(u,c,d))._multi(1/this._glScale);return void 0===r||this.getZoom()===r?p:this._pointToPointAtZoom(p,r)}var m=this._prjToPoint(this._getPrjCenter(),r),g=void 0!==r?this._getResolution()/this._getResolution(r):1,v=g*(i.x-this.width/2),y=g*(i.y-this.height/2);return m._add(v,y)}}(),_calcMatrices:function(){var t=ae.ie9?null:Gr(),e=ae.ie9?null:Gr();return function(){if(!ae.ie9){var n=this.getSize(),i=n.width||1,r=n.height||1;this._glScale=this.getGLScale();var o=this.getFov()*Math.PI/180,a=this.getScale(this.getMinZoom())/this.getScale(this.getMaxNativeZoom())*r/2/this._getFovRatio()*1.4,s=this.projMatrix||Gr();!function(t,e,n,i,r){var o=1/Math.tan(e/2),a=1/(i-r);t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(r+i)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*r*i*a,t[15]=0}(s,o,i/r,.1,a),this.projMatrix=s;var h=this._getCameraWorldMatrix();this.viewMatrix=Or(t,h),this.projViewMatrix=Rr(this.projViewMatrix||Gr(),s,this.viewMatrix),this.projViewMatrixInverse=Rr(this.projViewMatrixInverse||Gr(),h,Or(e,s)),this.domCssMatrix=this._calcDomMatrix()}}}(),_calcDomMatrix:function(){var t=ae.ie9?null:Gr(),e=[1,-1,1],n=[0,0,0];return function(){var i=.5/Math.tan(this._fov/2)*this.height;Lr(t,this.projMatrix,e),Ar(t,t,Dr(n,0,0,-i)),this._pitch&&function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[4],a=e[5],s=e[6],h=e[7],u=e[8],c=e[9],l=e[10],f=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+u*i,t[5]=a*r+c*i,t[6]=s*r+l*i,t[7]=h*r+f*i,t[8]=u*r-o*i,t[9]=c*r-a*i,t[10]=l*r-s*i,t[11]=f*r-h*i}(t,t,this._pitch),this._angle&&function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[0],a=e[1],s=e[2],h=e[3],u=e[4],c=e[5],l=e[6],f=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+u*i,t[1]=a*r+c*i,t[2]=s*r+l*i,t[3]=h*r+f*i,t[4]=u*r-o*i,t[5]=c*r-a*i,t[6]=l*r-s*i,t[7]=f*r-h*i}(t,t,this._angle);var r=Gr();return Lr(r,r,Dr(n,this.width/2,-this.height/2,1)),Rr(this.domCssMatrix||Gr(),r,t)}}(),_getCameraWorldMatrix:function(){var t={},e=[1,-1,1];return function(){var n=this.getGLZoom(),i=this.getSize(),r=this.getGLScale(),o=this._prjToPoint(this._prjCenter,n);this.cameraLookAt=Dr(this.cameraLookAt||[0,0,0],o.x,o.y,0);var a=this.getPitch()*jr,s=-this.getBearing()*jr,h=this._getFovRatio(),u=r*(i.height||1)/2/h,c=u*Math.cos(a),l=Math.sin(a)*u,f=o.x+l*Math.sin(s),d=o.y+l*Math.cos(s);this.cameraPosition=Dr(this.cameraPosition||[0,0,0],f,d,c);var p=l||1,m=this.cameraUp=Dr(this.cameraUp||[0,0,0],Math.sin(s)*p,Math.cos(s)*p,0),g=this.cameraWorldMatrix=this.cameraWorldMatrix||Gr();!function(t,e,n,i){var r=[0,0,0],o=[0,0,0],a=[0,0,0];kr(a,e,n),0===Nr(a)&&(a[2]=1),zr(a,a),Fr(r,i,a),0===Nr(a)&&(1===Math.abs(i[2])?a[0]+=1e-4:a[2]+=1e-4,zr(a,a),Fr(r,i,a)),zr(r,r),Fr(o,a,r),t[0]=r[0],t[4]=o[0],t[8]=a[0],t[1]=r[1],t[5]=o[1],t[9]=a[1],t[2]=r[2],t[6]=o[2],t[10]=a[2]}(g,this.cameraPosition,this.cameraLookAt,m);var v=this.cameraForward||[0,0,0];return kr(v,this.cameraLookAt,this.cameraPosition),this.cameraForward=zr(v,v),function(t,e){var n,i=e[0],r=e[4],o=e[8],a=e[1],s=e[5],h=e[9],u=e[2],c=e[6],l=e[10],f=i+s+l;f>0?(n=.5/Math.sqrt(f+1),t.w=.25/n,t.x=(c-h)*n,t.y=(o-u)*n,t.z=(a-r)*n):i>s&&i>l?(n=2*Math.sqrt(1+i-s-l),t.w=(c-h)/n,t.x=.25*n,t.y=(r+a)/n,t.z=(o+u)/n):s>l?(n=2*Math.sqrt(1+s-i-l),t.w=(o-u)/n,t.x=(r+a)/n,t.y=.25*n,t.z=(h+c)/n):(n=2*Math.sqrt(1+l-i-s),t.w=(a-r)/n,t.x=(o+u)/n,t.y=(h+c)/n,t.z=.25*n)}(t,g),function(t,e){var n=t,i=e.x,r=e.y,o=e.z,a=e.w,s=i+i,h=r+r,u=o+o,c=i*s,l=i*h,f=i*u,d=r*h,p=r*u,m=o*u,g=a*s,v=a*h,y=a*u;n[0]=1-(d+m),n[4]=l-y,n[8]=f+v,n[1]=l+y,n[5]=1-(c+m),n[9]=p-g,n[2]=f-v,n[6]=p+g,n[10]=1-(c+d),n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1}(g,t),function(t,e){var n=t;n[12]=e[0],n[13]=e[1],n[14]=e[2]}(g,this.cameraPosition),Lr(g,g,e),g}}(),_getFovRatio:function(){var t=this.getFov();return Math.tan(t/2*jr)},_renderLayers:function(){this.isInteracting()||this._getLayers().forEach(function(t){if(t){var e=t._getRenderer();e&&e.setToRedraw&&e.setToRedraw()}})}}),ri.include({_onViewChange:function(t){this._viewHistory||(this._viewHistory=[],this._viewHistoryPointer=0);for(var e=this._getCurrentView(),n=this._viewHistory.length-1;n>=0;n--)if(tt(t,this._viewHistory[n]))return this._viewHistoryPointer=n,void this._fireViewChange(e,t);this._viewHistoryPointer0&&this._viewHistory.length>i&&this._viewHistory.splice(0,this._viewHistory.length-i),this._viewHistoryPointer=this._viewHistory.length-1,this._fireViewChange(e,t)},zoomToPreviousView:function(t){if(void 0===t&&(t={}),!this.hasPreviousView())return null;var e=this._viewHistory[--this._viewHistoryPointer];return this._zoomToView(e,t),e},hasPreviousView:function(){return!(!this._viewHistory||0===this._viewHistoryPointer)},zoomToNextView:function(t){if(void 0===t&&(t={}),!this.hasNextView())return null;var e=this._viewHistory[++this._viewHistoryPointer];return this._zoomToView(e,t),e},hasNextView:function(){return!(!this._viewHistory||this._viewHistoryPointer===this._viewHistory.length-1)},_zoomToView:function(t,e){var n=this,i=this.getView();e.animation?this.animateTo(t,{duration:e.duration},function(e){"finished"===e.state.playState&&n._fireViewChange(i,t)}):(this.setView(t),this._fireViewChange(i,t))},getViewHistory:function(){return this._viewHistory},_fireViewChange:function(t,e){this._fireEvent("viewchange",{old:t,new:e})},_getCurrentView:function(){return this._viewHistory?this._viewHistory[this._viewHistoryPointer]:null}}),ri.mergeOptions({viewHistory:!0,viewHistoryCount:10});var Hr=function(t){function e(e){var n;return(n=t.call(this,e)||this).on("enable",n._afterEnable,he(he(n))).on("disable",n._afterDisable,he(he(n))),n._measureLayers=[],n}se(e,t);var n=e.prototype;return n.clear=function(){if(U(this._measureLayers))for(var t=0;t0&&(r+="\n"),r+=e<5280?e.toFixed(0)+n[2]:(e/5280).toFixed(2)+n[3]),r},n._registerMeasureEvents=function(){this.on("drawstart",this._msOnDrawStart,this).on("drawvertex",this._msOnDrawVertex,this).on("mousemove",this._msOnMouseMove,this).on("drawend",this._msOnDrawEnd,this)},n._afterEnable=function(){this._registerMeasureEvents()},n._afterDisable=function(){this.off("drawstart",this._msOnDrawStart,this).off("drawvertex",this._msOnDrawVertex,this).off("mousemove",this._msOnMouseMove,this).off("drawend",this._msOnDrawEnd,this)},n._msOnDrawStart=function(t){var e=this.getMap(),n=R(),i="distancetool_"+n,r="distancetool_markers_"+n;e.getLayer(i)?(this._measureLineLayer=e.getLayer(i),this._measureMarkerLayer=e.getLayer(r)):(this._measureLineLayer=new br(i).addTo(e),this._measureMarkerLayer=new br(r).addTo(e)),this._measureLayers.push(this._measureLineLayer),this._measureLayers.push(this._measureMarkerLayer),new Wi(t.coordinate,{symbol:this.options.vertexSymbol}).addTo(this._measureMarkerLayer);var o="zh-CN"===this.options.language?"起点":"start",a=new mr(o,t.coordinate,this.options.labelOptions);this._measureMarkerLayer.addGeometry(a)},n._msOnMouseMove=function(t){var e=this._measure(this._msGetCoordsToMeasure(t));if(!this._tailMarker){var n=Nt(this.options.vertexSymbol);n.markerWidth/=2,n.markerHeight/=2,this._tailMarker=new Wi(t.coordinate,{symbol:n}).addTo(this._measureMarkerLayer),this._tailLabel=new mr(e,t.coordinate,this.options.labelOptions).addTo(this._measureMarkerLayer)}this._tailMarker.setCoordinates(t.coordinate),this._tailLabel.setContent(e),this._tailLabel.setCoordinates(t.coordinate)},n._msGetCoordsToMeasure=function(t){return t.geometry.getCoordinates().concat([t.coordinate])},n._msOnDrawVertex=function(t){var e=t.geometry;new Wi(t.coordinate,{symbol:this.options.vertexSymbol}).addTo(this._measureMarkerLayer);var n=this._measure(e),i=new mr(n,t.coordinate,this.options.labelOptions);this._measureMarkerLayer.addGeometry(i),this._lastVertex=i},n._msOnDrawEnd=function(t){this._clearTailMarker();var e=this._lastVertex.getSize();e||(e=new le(10,10)),this._addClearMarker(this._lastVertex.getCoordinates(),e.width);var n=t.geometry.copy();n.addTo(this._measureLineLayer),this._lastMeasure=n.getLength()},n._addClearMarker=function(t,e){var n=this.options.clearButtonSymbol,i={markerDx:(n.markerDx||0)+e,textDx:(n.textDx||0)+e};Array.isArray(n)&&(i=n.map(function(t){return t?{markerDx:(t.markerDx||0)+e,textDx:(t.textDx||0)+e}:null})),n=Nt(n,i);var r=new Wi(t,{symbol:n}),o=this._measureLineLayer,a=this._measureMarkerLayer;r.on("click",function(){return o.remove(),a.remove(),!1},this),r.addTo(this._measureMarkerLayer)},n._clearTailMarker=function(){this._tailMarker&&(this._tailMarker.remove(),delete this._tailMarker),this._tailLabel&&(this._tailLabel.remove(),delete this._tailLabel)},e}(Tr);Hr.mergeOptions({mode:"LineString",language:"zh-CN",metric:!0,imperial:!1,symbol:{lineColor:"#000",lineWidth:3,lineOpacity:1},vertexSymbol:{markerType:"ellipse",markerFill:"#fff",markerLineColor:"#000",markerLineWidth:3,markerWidth:11,markerHeight:11},labelOptions:{textSymbol:{textFaceName:"monospace",textLineSpacing:1,textHorizontalAlignment:"right",textDx:15},boxStyle:{padding:[6,2],symbol:{markerType:"square",markerFill:"#fff",markerFillOpacity:.9,markerLineColor:"#b4b3b3"}}},clearButtonSymbol:[{markerType:"square",markerFill:"#fff",markerLineColor:"#b4b3b3",markerLineWidth:2,markerWidth:15,markerHeight:15,markerDx:20},{markerType:"x",markerWidth:10,markerHeight:10,markerDx:20}]});var Ur=function(t){function e(e){var n;return(n=t.call(this,e)||this).on("enable",n._afterEnable,he(he(n))).on("disable",n._afterDisable,he(he(n))),n._measureLayers=[],n}se(e,t);var n=e.prototype;return n._measure=function(t){var e,n,i=this.getMap();t instanceof Ri?e=i.computeGeometryArea(t):Array.isArray(t)&&(e=i.getProjection().measureArea(t)),this._lastMeasure=e,n="zh-CN"===this.options.language?[" 平方米"," 平方公里"," 平方英尺"," 平方英里"]:[" sq.m"," sq.km"," sq.ft"," sq.mi"];var r="";if(this.options.metric&&(r+=e<1e6?e.toFixed(0)+n[0]:(e/1e6).toFixed(2)+n[1]),this.options.imperial){e*=3.2808399,r.length>0&&(r+="\n");r+=e<27878400?e.toFixed(0)+n[2]:(e/27878400).toFixed(2)+n[3]}return r},n._msGetCoordsToMeasure=function(t){return t.geometry.getShell().concat([t.coordinate])},n._msOnDrawVertex=function(t){var e=new Wi(t.coordinate,{symbol:this.options.vertexSymbol}).addTo(this._measureMarkerLayer);this._measure(t.geometry),this._lastVertex=e},n._msOnDrawEnd=function(t){this._clearTailMarker();var e=this._measure(t.geometry),n=new mr(e,t.coordinate,this.options.labelOptions).addTo(this._measureMarkerLayer).getSize();n||(n=new le(10,10)),this._addClearMarker(t.coordinate,n.width);var i=t.geometry.copy();i.addTo(this._measureLineLayer),this._lastMeasure=i.getArea()},e}(Hr);function Vr(t){for(var e=t.tileInfo,n=[e.cols,e.rows],i=[],r=e.lods,o=0,a=r.length;o=3){if(r=new Ui([t],{id:"polygon"}),n){var o=Nt(n,{lineOpacity:0});r.setSymbol(o)}r.addTo(i)}r&&r.setCoordinates(t)}},generate:function(t){return new Ui(t.getCoordinates(),{symbol:t.getSymbol()})}}),Tr.registerMode("freeHandPolygon",{action:["mousedown","mousemove","mouseup"],create:function(t){return new qi(t)},update:function(t,e){var n=e.getCoordinates(),i=e.getSymbol();e.setCoordinates(n.concat(t));var r=e.getLayer();if(r){var o=r.getGeometryById("polygon");if(!o&&t.length>=3){if(o=new Ui([t],{id:"polygon"}),i){var a=Nt(i,{lineOpacity:0});o.setSymbol(a)}o.addTo(r)}o&&o.setCoordinates(t)}},generate:function(t){return new Ui(t.getCoordinates(),{symbol:t.getSymbol()})}}),Tr.registerMode("linestring",{action:["click","mousemove","dblclick"],create:function(t){return new qi(t)},update:function(t,e){e.setCoordinates(t)},generate:function(t){return t}}),Tr.registerMode("freeHandLinestring",{action:["mousedown","mousemove","mouseup"],create:function(t){return new qi(t)},update:function(t,e){var n=e.getCoordinates();e.setCoordinates(n.concat(t))},generate:function(t){return t}}),Tr.registerMode("arccurve",{action:["click","mousemove","dblclick"],create:function(t){return new hr(t)},update:function(t,e){e.setCoordinates(t)},generate:function(t){return t}}),Tr.registerMode("quadbeziercurve",{action:["click","mousemove","dblclick"],create:function(t){return new cr(t)},update:function(t,e){e.setCoordinates(t)},generate:function(t){return t}}),Tr.registerMode("cubicbeziercurve",{action:["click","mousemove","dblclick"],create:function(t){return new ur(t)},update:function(t,e){e.setCoordinates(t)},generate:function(t){return t}}),Tr.registerMode("boxZoom",{action:["mousedown","mousemove","mouseup"],create:function(t){var e=new Wi(t[0]);return e._firstClick=t[0],e},update:function(t,e,n){var i=e.getMap(),r=i.coordToContainerPoint(e._firstClick),o=n.containerPoint,a=i.containerPointToCoordinate(new bn(Math.min(r.x,o.x),Math.min(r.y,o.y)));e.setCoordinates(a).updateSymbol({markerWidth:Math.abs(r.x-o.x),markerHeight:Math.abs(r.y-o.y)})},generate:function(t){return t}}),ni.loadArcgis=function(t,e,n){if(void 0===n&&(n={jsonp:!0}),y(t)&&"{"!==t.substring(0,1))on.getJSON(t,function(t,n){if(t)e(t);else{var i=Vr(n);e(null,i)}},n);else{y(t)&&(t=I(t));var i=Vr(t);e(null,i)}return this};var Wr=function(t){function e(e){return t.call(this,e)||this}se(e,t);var n=e.prototype;return n.addTo=function(t){return this._owner=t,this._switchEvents("on"),this.onAdd&&this.onAdd(),this.fire("add"),this},n.getMap=function(){return this._owner?this._owner.getBaseLayer?this._owner:this._owner.getMap():null},n.show=function(t){var e=this.getMap();if(!e)return this;this._mapEventsOn||this._switchMapEvents("on"),t=t||this._coordinate||this._owner.getCenter();var n=this.isVisible();this.fire("showstart");var i=this._getUIContainer();this._coordinate=t,this._removePrevDOM();var r=this.__uiDOM=this.buildOn(e);if(r.eventsPropagation=this.options.eventsPropagation,!r)return this.fire("showend"),this;this._measureSize(r),this._singleton()&&(e[this._uiDomKey()]=r),this._setPosition(),r.style[Oe]=null,i.appendChild(r);var o=this._getAnimation();if(n&&(o.ok=!1),o.ok&&(o.fade&&(r.style.opacity=0),o.scale)){if(this.getTransformOrigin){var a=this.getTransformOrigin();r.style[Re]=a}r.style[Le]=Zr(this._pos)+" scale(0)"}r.style.display="",this.options.eventsToStop&&en(r,this.options.eventsToStop,Ge),this.options.autoPan&&this._autoPan();var s=o.transition;return o.ok&&s&&(r.offsetHeight,s&&(r.style[Oe]=s),o.fade&&(r.style.opacity=1),o.scale&&(r.style[Le]=Zr(this._pos)+" scale(1)")),this.fire("showend"),this},n.hide=function(){if(!this.getDOM()||!this.getMap())return this;var t=this._getAnimation(),e=this.getDOM();return this.options.animationOnHide||(t.ok=!1),t.ok?(e.offsetHeight,e.style[Oe]=t.transition,setTimeout(function(){e.style.display="none"},this.options.animationDuration)):e.style.display="none",t.fade&&(e.style.opacity=0),t.scale&&(e.style[Le]=Zr(this._pos)+" scale(0)"),this.fire("hide"),this},n.isVisible=function(){var t=this.getDOM();return this.getMap()&&t&&t.parentNode&&"none"!==t.style.display},n.remove=function(){return delete this._mapEventsOn,this._owner?(this.hide(),this._switchEvents("off"),this.onRemove&&this.onRemove(),!this._singleton()&&this.__uiDOM&&this._removePrevDOM(),delete this._owner,this.fire("remove"),this):this},n.getSize=function(){return this._size?this._size.copy():null},n.getOwner=function(){return this._owner},n.getDOM=function(){return this.__uiDOM},n.getPosition=function(){if(!this.getMap())return null;var t=this._getViewPoint()._round();if(this.getOffset){var e=this.getOffset()._round();e&&t._add(e)}return t},n._getAnimation=function(){for(var t={fade:!1,scale:!1},e=this.options.animation?this.options.animation.split(","):[],n=0;nr&&(u=r-(a.x+3*s/2)),a.y<0?c=50-a.y:a.y>o&&(c=o-a.y-h-30),0===c&&0===u||t.panBy(new ce(u,c),{duration:this.options.autoPanDuration})}},n._measureSize=function(t){var e=this._getUIContainer();t.style.position="absolute",t.style.left="-99999px";var n=t.style.bottom?"bottom":"top";return t.style[n]="-99999px",t.style.display="",e.appendChild(t),this._size=new le(t.clientWidth,t.clientHeight),t.style.display="none",t.style.left="0px",t.style[n]="0px",this._size},n._removePrevDOM=function(){this.onDomRemove&&this.onDomRemove();var t=this.options.eventsToStop;if(this._singleton()){var e=this.getMap(),n=this._uiDomKey();e[n]&&(t&&nn(e[n],t,Ge),Ne(e[n]),delete e[n]),delete this.__uiDOM}else this.__uiDOM&&(t&&nn(this.__uiDOM,t,Ge),Ne(this.__uiDOM),delete this.__uiDOM)},n._uiDomKey=function(){return"__ui_"+this._getClassName()},n._singleton=function(){return this.options.single},n._getUIContainer=function(){return this.getMap()._panels.ui},n._getClassName=function(){return"UIComponent"},n._switchMapEvents=function(t){var e=this.getMap();if(e){this._mapEventsOn="on"===t;var n=this._getDefaultEvents();if(this.getEvents&&d(n,this.getEvents()),n)for(var i in n)n.hasOwnProperty(i)&&e[t](i,n[i],this)}},n._switchEvents=function(t){this._switchMapEvents(t);var e=this._getOwnerEvents();if(this._owner)for(var n in e)e.hasOwnProperty(n)&&this._owner[t](n,e[n],this)},n._getDefaultEvents=function(){return{"zooming rotate pitch":this.onEvent,zoomend:this.onZoomEnd,moving:this.onMoving}},n._getOwnerEvents=function(){var t={};return this._owner&&this._owner instanceof Ri&&(t.positionchange=this.onGeometryPositionChange),this.getOwnerEvents&&d(t,this.getOwnerEvents()),t},n.onGeometryPositionChange=function(t){this._owner&&this.isVisible()&&this.show(t.target.getCenter())},n.onMoving=function(){this.isVisible()&&this.getMap().isTransforming()&&this._updatePosition()},n.onEvent=function(){this.isVisible()&&this._updatePosition()},n.onZoomEnd=function(){this.isVisible()&&this._setPosition()},n._updatePosition=function(){this.getMap()._getRenderer().callInNextFrame(this._setPosition.bind(this))},n._setPosition=function(){var t=this.getDOM(),e=this.getPosition();this._pos=e,t&&(t.style[Oe]=null,t.style[Le]=Zr(e)+" scale(1)")},e}(fn(mn));function Zr(t){return t?ae.any3d?"translate3d("+t.x+"px,"+t.y+"px, 0px)":"translate("+t.x+"px,"+t.y+"px)":""}Wr.mergeOptions({eventsPropagation:!1,eventsToStop:null,dx:0,dy:0,autoPan:!1,autoPanDuration:600,single:!0,animation:"scale",animationOnHide:!0,animationDuration:500});var qr="mousedown mouseup mouseenter mouseover mouseout mousemove click dblclick contextmenu keypress touchstart touchmove touchend",Xr=function(t){function e(e,n){var i;return(i=t.call(this,n)||this)._markerCoord=new bn(e),i}se(e,t);var n=e.prototype;return n._getClassName=function(){return"UIMarker"},n.setCoordinates=function(t){return this._markerCoord=t,this.fire("positionchange"),this.isVisible()&&(this._coordinate=this._markerCoord,this._setPosition()),this},n.getCoordinates=function(){return this._markerCoord},n.setContent=function(t){var e=this.options.content;return this.options.content=t,this.fire("contentchange",{old:e,new:t}),this.isVisible()&&this.show(),this},n.getContent=function(){return this.options.content},n.onAdd=function(){this.show()},n.show=function(){return t.prototype.show.call(this,this._markerCoord)},n.flash=function(t,e,n,i){return nt.call(this,t,e,n,i)},n.buildOn=function(){var t;return y(this.options.content)?(t=De("div")).innerHTML=this.options.content:t=this.options.content,this._registerDOMEvents(t),t},n.getOffset=function(){var t=this.getSize();return new ce(-t.width/2,-t.height/2)},n.getTransformOrigin=function(){return"center center"},n.onDomRemove=function(){var t=this.getDOM();this._removeDOMEvents(t)},n.isDragging=function(){return!!this.draggable&&this.draggable.isDragging()},n._registerDOMEvents=function(t){en(t,qr,this._onDomEvents,this)},n._onDomEvents=function(t){var e=this.getMap()._parseEvent(t,t.type);this.fire(t.type,e)},n._removeDOMEvents=function(t){nn(t,qr,this._onDomEvents,this)},n._getConnectPoints=function(){var t=this.getMap(),e=t.coordToContainerPoint(this.getCoordinates()),n=this.getSize(),i=n.width,r=n.height;return[t.containerPointToCoordinate(e.add(-i/2,0)),t.containerPointToCoordinate(e.add(i/2,0)),t.containerPointToCoordinate(e.add(0,r/2)),t.containerPointToCoordinate(e.add(0,-r/2))]},e}(yn(Wr));Xr.mergeOptions({eventsPropagation:!0,draggable:!1,single:!1,content:null});var Yr=ae.touch?"touchstart mousedown":"mousedown",Jr=function(t){function e(e){return t.call(this,e)||this}se(e,t);var n=e.prototype;return n.addHooks=function(){this.target.on(Yr,this._startDrag,this)},n.removeHooks=function(){this.target.off(Yr,this._startDrag,this)},n._startDrag=function(t){var e=t.domEvent;e.touches&&e.touches.length>1||2===e.button||this.isDragging()||(this.target.on("click",this._endDrag,this),this._lastCoord=t.coordinate,this._lastPoint=t.containerPoint,this._prepareDragHandler(),this._dragHandler.onMouseDown(t.domEvent),this.target.fire("dragstart",t))},n._prepareDragHandler=function(){this._dragHandler=new wn(this.target.getDOM(),{cancelOn:this._cancelOn.bind(this),ignoreMouseleave:!0}),this._dragHandler.on("mousedown",this._onMouseDown,this),this._dragHandler.on("dragging",this._dragging,this),this._dragHandler.on("mouseup",this._endDrag,this),this._dragHandler.enable()},n._cancelOn=function(t){var e=(t.srcElement||t.target).tagName.toLowerCase();return"button"===e||"input"===e||"select"===e||"option"===e||"textarea"===e},n._onMouseDown=function(t){Ge(t.domEvent)},n._dragging=function(t){var e=this.target,n=e.getMap()._parseEvent(t.domEvent),i=n.domEvent;if(!(i.touches&&i.touches.length>1))if(this._isDragging){var r=n.coordinate,o=n.containerPoint;this._lastCoord||(this._lastCoord=r),this._lastPoint||(this._lastPoint=o);var a=r.sub(this._lastCoord),s=o.sub(this._lastPoint);this._lastCoord=r,this._lastPoint=o,this.target.setCoordinates(this.target.getCoordinates().add(a)),n.coordOffset=a,n.pointOffset=s,e.fire("dragging",n)}else this._isDragging=!0},n._endDrag=function(t){var e=this.target,n=e.getMap();if(this._dragHandler&&(e.off("click",this._endDrag,this),this._dragHandler.disable(),delete this._dragHandler),delete this._lastCoord,delete this._lastPoint,this._isDragging=!1,n){var i=n._parseEvent(t.domEvent);e.fire("dragend",i)}},n.isDragging=function(){return!!this._isDragging},e}(pn);Xr.addInitHook("addHandler","draggable",Jr);var Kr=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n._getClassName=function(){return"InfoWindow"},n.addTo=function(e){return e instanceof Ri&&(e.getInfoWindow()&&e.getInfoWindow()!==this&&e.removeInfoWindow(),e._infoWindow=this),t.prototype.addTo.call(this,e)},n.setContent=function(t){var e=this.options.content;return this.options.content=t,this.fire("contentchange",{old:e,new:t}),this.isVisible()&&this.show(this._coordinate),this},n.getContent=function(){return this.options.content},n.setTitle=function(t){var e=t;return this.options.title=t,this.fire("contentchange",{old:e,new:t}),this.isVisible()&&this.show(this._coordinate),this},n.getTitle=function(){return this.options.title},n.buildOn=function(){if(this.options.custom){if(y(this.options.content)){var t=De("div");return t.innerHTML=this.options.content,t}return this.options.content}var e=De("div");e.className="maptalks-msgBox",e.style.width=this._getWindowWidth()+"px",e.style.bottom="0px";var n='';this.options.title&&(n+="

"+this.options.title+"

"),n+='
',e.innerHTML=n;var i=e.querySelector(".maptalks-msgContent");return y(this.options.content)?i.innerHTML=this.options.content:i.appendChild(this.options.content),this._onCloseBtnClick=this.hide.bind(this),ze(e.querySelector(".maptalks-close"),"click touchend",this._onCloseBtnClick),e},n.getTransformOrigin=function(){return this.getSize().width/2+"px bottom"},n.getOffset=function(){var t=this.getSize(),e=new ce(-t.width/2,0);this.options.custom||e._sub(4,12);var n=this.getOwner();if(n instanceof Wi||n instanceof Ki){var i,r;if(n instanceof Wi)i=n._getPainter(),r=n.getSize();else{var o=n.getGeometries();if(!o||!o.length)return e;i=o[0]._getPainter(),r=o[0].getSize()}if(i){var a=i.getFixedExtent();e._add(a.xmax-r.width/2,a.ymin)}}return e},n.show=function(e){return this.getMap()&&this.getMap().options.enableInfoWindow?t.prototype.show.call(this,e):this},n.getEvents=function(){if(!this.options.autoCloseOn)return null;var t={};return t[this.options.autoCloseOn]=this.hide,t},n.getOwnerEvents=function(){var t=this.getOwner();if(!this.options.autoOpenOn||!t)return null;var e={};return e[this.options.autoOpenOn]=this._onAutoOpen,e},n.onRemove=function(){this.onDomRemove()},n.onDomRemove=function(){this._onCloseBtnClick&&(Fe(this.getDOM().childNodes[2],"click touchend",this._onCloseBtnClick),delete this._onCloseBtnClick)},n._onAutoOpen=function(t){var e=this,n=this.getOwner();setTimeout(function(){n instanceof Wi?e.show(n.getCoordinates()):n instanceof Ki?e.show(n.findClosest(t.coordinate)):e.show(t.coordinate)},1)},n._getWindowWidth=function(){var t=this.options.width;return t||(t=300),t},e}(Wr);Kr.mergeOptions({autoPan:!0,autoCloseOn:null,autoOpenOn:"click",width:300,minHeight:120,custom:!1,title:null,content:null});var Qr={width:0,height:0,animation:"fade",cssName:"maptalks-tooltip",showTimeout:400},$r=function(t){se(n,t);var e=n.prototype;function n(e,n){var i;return void 0===n&&(n={}),(i=t.call(this,n)||this)._content=e,i}return e._getClassName=function(){return"ToolTip"},e.addTo=function(e){if(e instanceof Ri)return e.on("mousemove",this.onMouseMove,this),e.on("mouseout",this.onMouseOut,this),t.prototype.addTo.call(this,e);throw new Error("Invalid geometry the tooltip is added to.")},e.setStyle=function(t){return this.options.cssName=t,this},e.getStyle=function(){return this.options.cssName},e.getContent=function(){return this._content},e.buildOn=function(){var t=De("div");Qr.height&&(t.style.height=Qr.height+"px"),Qr.width&&(t.style.width=Qr.width+"px");var e=this.options.cssName;return!e&&Qr.height&&(t.style.lineHeight=Qr.height+"px"),t.innerHTML='
'+this._content+"
",t},e.onMouseOut=function(){clearTimeout(this._timeout),this.isVisible()&&this._removePrevDOM()},e.onMouseMove=function(t){var e=this;clearTimeout(this._timeout);var n=this.getMap();if(n){var i=n.locateByPoint(t.coordinate,-5,25);0===this.options.showTimeout?this.show(i):this._timeout=setTimeout(function(){n&&e.show(i)},this.options.showTimeout)}},e.onRemove=function(){clearTimeout(this._timeout),this._owner&&(this._owner.off("mouseover",this.onMouseOver,this),this._owner.off("mouseout",this.onMouseOut,this))},n}(Wr);$r.mergeOptions(Qr);var to=function(t){function e(e){return t.call(this,e)||this}se(e,t);var n=e.prototype;return n._getClassName=function(){return"Menu"},n.addTo=function(t){return t._menu&&t._menu!==this&&t.removeMenu(),t._menu=this,Wr.prototype.addTo.apply(this,arguments)},n.setItems=function(t){return this.options.items=t,this},n.getItems=function(){return this.options.items||[]},n.buildOn=function(){if(this.options.custom){if(y(this.options.items)){var t=De("div");return t.innerHTML=this.options.items,t}return this.options.items}var e=De("div");Xe(e,"maptalks-menu"),e.style.width=this._getMenuWidth()+"px";var n=this._createMenuItemDom();return e.appendChild(n),en(e,"contextmenu",je),e},n.getOffset=function(){if(!this.getMap())return null;var t=this.getMap().getSize(),e=this.getMap().viewPointToContainerPoint(this._getViewPoint()),n=this.getSize(),i=0,r=0;return e.x+n.width>t.width&&(i=-n.width),e.y+n.height>t.height&&(r=-n.height),new ce(i,r)},n.getTransformOrigin=function(){var t=this.getOffset()._multi(-1);return t.x+"px "+t.y+"px"},n.getEvents=function(){return{"_zoomstart _zoomend _movestart _dblclick _click":this._removePrevDOM}},n._createMenuItemDom=function(){var t=this,e=this.getMap(),n=De("ul");Xe(n,"maptalks-menu-items");var i,r,o=this.getItems();function a(n){return function(i){var r=e._parseEvent(i,"click");r.target=t,r.owner=t._owner,r.index=n,!1!==this._callback(r)&&t.hide()}}for(var s=0,h=o.length;s0&&Ze(n,"max-height: "+c+"px; overflow-y: auto;"),n},n._getMenuWidth=function(){return this.options.width||160},e}(Wr);to.mergeOptions({animation:null,animationDelay:10,animationOnHide:!1,autoPan:!1,width:160,maxHeight:0,custom:!1,items:[]});var eo={setMenu:function(t){return this._menuOptions=t,this._menu?this._menu.setOptions(t):this.on("contextmenu",this._defaultOpenMenu,this),this},openMenu:function(t){var e=this instanceof ri?this:this.getMap();return t||(t=this.getCenter()),this._menu?this._menu.show(t):this._menuOptions&&e&&(this._bindMenu(this._menuOptions),this._menu.show(t)),this},setMenuItems:function(t){return this._menuOptions||(this._menuOptions={}),Array.isArray(t)&&(this._menuOptions.custom=!1),this._menuOptions.items=t,this.setMenu(this._menuOptions),this},getMenuItems:function(){return this._menu?this._menu.getItems():this._menuOptions&&this._menuOptions.items||[]},closeMenu:function(){return this._menu&&this._menu.hide(),this},removeMenu:function(){return this.off("contextmenu",this._defaultOpenMenu,this),this._unbindMenu(),delete this._menuOptions,this},_bindMenu:function(t){return this._menu=new to(t),this._menu.addTo(this),this},_unbindMenu:function(){return this._menu&&(this.closeMenu(),this._menu.remove(),delete this._menu),this},_defaultOpenMenu:function(t){return this.listens("contextmenu")>1||(this.openMenu(t.coordinate),!1)}};ri.include(eo),Ri.include(eo);var no=Object.freeze({UIComponent:Wr,UIMarker:Xr,InfoWindow:Kr,ToolTip:$r,Menuable:eo,Menu:to}),io=function(t){function e(e){return e&&e.position&&!y(e.position)&&(e.position=d({},e.position)),t.call(this,e)||this}se(e,t);var n=e.prototype;return n.addTo=function(t){if(this.remove(),!t.options.control)return this;this._map=t;var e=t._panels.control;return this.__ctrlContainer=De("div"),Ze(this.__ctrlContainer,"position:absolute;overflow:visible;"),this.update(),e.appendChild(this.__ctrlContainer),this.onAdd&&this.onAdd(),this.fire("add",{dom:e}),this},n.update=function(){return this.__ctrlContainer.innerHTML="",this._controlDom=this.buildOn(this.getMap()),this._controlDom&&(this._updatePosition(),this.__ctrlContainer.appendChild(this._controlDom)),this},n.getMap=function(){return this._map},n.getPosition=function(){return d({},this._parse(this.options.position))},n.setPosition=function(t){return y(t)?this.options.position=t:this.options.position=d({},t),this._updatePosition(),this},n.getContainerPoint=function(){var t,e,n=this.getPosition(),i=this.getMap().getSize();return p(n.left)?p(n.right)||(t=i.width-parseInt(n.right)):t=parseInt(n.left),p(n.top)?p(n.bottom)||(e=i.height-parseInt(n.bottom)):e=parseInt(n.top),new ce(t,e)},n.getContainer=function(){return this.__ctrlContainer},n.getDOM=function(){return this._controlDom},n.show=function(){return this.__ctrlContainer.style.display="",this},n.hide=function(){return this.__ctrlContainer.style.display="none",this},n.isVisible=function(){return this.__ctrlContainer&&""===this.__ctrlContainer.style.display},n.remove=function(){return this._map?(Ne(this.__ctrlContainer),this.onRemove&&this.onRemove(),delete this._map,delete this.__ctrlContainer,delete this._controlDom,this.fire("remove"),this):this},n._parse=function(t){var n=t;return y(t)&&(n=e.positions[n]),n},n._updatePosition=function(){var t=this.getPosition();for(var e in t||(t={top:20,left:20}),t)t.hasOwnProperty(e)&&(t[e]=parseInt(t[e]),this.__ctrlContainer.style[e]=t[e]+"px");this.fire("positionchange",{position:d({},t)})},e}(fn(mn));io.positions={"top-left":{top:20,left:20},"top-right":{top:20,right:20},"bottom-left":{bottom:20,left:20},"bottom-right":{bottom:20,right:20}},ri.mergeOptions({control:!0}),ri.include({addControl:function(t){return this._containerDOM.getContext?this:(t.addTo(this),this)},removeControl:function(t){return t&&t.getMap()===this?(t.remove(),this):this}});var ro="addlayer removelayer setbaselayer baselayerremove",oo=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.buildOn=function(){return this._attributionContainer=De("div"),this._attributionContainer.className="maptalks-attribution",this._update(),this._attributionContainer},n.onAdd=function(){this.getMap().on(ro,this._update,this)},n.onRemove=function(){this.getMap().off(ro,this._update,this)},n._update=function(){var t=this.getMap();if(t){var e=t._getLayers(function(t){return t.options.attribution}).reverse().map(function(t){return t.options.attribution}),n=this.options.content+(e.length>0?" - "+e.join(", "):"");this._attributionContainer.innerHTML=''+n+""}},e}(io);oo.mergeOptions({position:{bottom:0,left:0},content:'maptalks'}),ri.mergeOptions({attribution:!0}),ri.addOnLoadHook(function(){var t=this.options.attribution||this.options.attributionControl;t&&(this.attributionControl=new oo(t),this.addControl(this.attributionControl))});var ao=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.buildOn=function(){var t=this.container=De("div",this.options.containerClass),e=this.panel=De("div","panel"),n=this.button=De("button");return t.appendChild(n),t.appendChild(e),t},n.onAdd=function(){en(this.button,"mouseover",this._show,this),en(this.panel,"mouseleave",this._hide,this),en(this.getMap(),"click",this._hide,this)},n.onRemove=function(){this.panel&&(nn(this.button,"mouseover",this._show,this),nn(this.panel,"mouseleave",this._hide,this),nn(this.getMap(),"click",this._hide,this),Ne(this.panel),Ne(this.button),delete this.panel,delete this.button,delete this.container)},n._show=function(){qe(this.container,"shown")||(Xe(this.container,"shown"),this._createPanel())},n._hide=function(t){this.panel.contains(t.toElement||t.relatedTarget)||Ye(this.container,this.options.containerClass)},n._createPanel=function(){this.panel.innerHTML="";var t=De("ul");this.panel.appendChild(t),this._renderLayers(this.getMap(),t)},n._renderLayers=function(t,e){var n=t.getBaseLayer(),i=t.getLayers(),r=i.length;if(n){var o=n.layers||[n],a=De("li","group"),s=De("ul"),h=De("label");h.innerHTML=this.options.baseTitle,a.appendChild(h);for(var u=0,c=o.length;u=0)},n._renderLayer=function(t,e){var n=this,i=De("li","layer"),r=De("label"),o=De("input"),a=this.getMap(),s=t.options.visible;t.options.visible=!0;var h=t.isVisible();return t.options.visible=s,i.className="layer",e?(o.type="radio",o.name="base"):o.type="checkbox",o.checked=s&&h,h||o.setAttribute("disabled","disabled"),o.onchange=function(e){if("radio"===e.target.type){var i=a.getBaseLayer(),r=i.layers;if(r)for(var o=0,s=r.length;o0){for(var r=i;r>0;r--)if(e-r>=n)return e-r}else for(var o=i;o<0;o++)if(e-o>=n)return e-o;return e},n._onDragEnd=function(){var t=this._perspective.getCenter();this._overview.setCenter(t),this.getMap().panTo(t)},n._getPerspectiveCoords=function(){var t=this.getMap();return t.getContainerExtent().toArray().map(function(e){return t.containerPointToCoordinate(e)})},n._update=function(){if(this._overview){Ve(this._overview._containerDOM);var t=this._getPerspectiveCoords();this._perspective.setCoordinates(t),this._overview.setCenterAndZoom(this.getMap().getCenter(),this._getOverviewZoom())}},n._updateSpatialReference=function(){if(this._overview){var t=this.getMap().options.spatialReference;this._overview.setSpatialReference(t)}},n._updateBaseLayer=function(){if(this._overview){var t=this.getMap().getBaseLayer();if(t){var e=t.layers,n=0;if(e)for(var i=0,r=e.length;i5280?(e=r/5280,n=this._getRoundNum(e),this._updateScale(this._iScale,n+" mile",n/e)):(i=this._getRoundNum(r),this._updateScale(this._iScale,i+" feet",i/r))},n._updateScale=function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},n._getRoundNum=function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)},e}(io);uo.mergeOptions({position:"bottom-left",maxWidth:100,metric:!0,imperial:!1}),ri.mergeOptions({scaleControl:!1}),ri.addOnLoadHook(function(){this.options.scaleControl&&(this.scaleControl=new uo(this.options.scaleControl),this.addControl(this.scaleControl))});var co=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.buildOn=function(t){this._map=t;var e=De("div"),n=De("ul","maptalks-toolbar-hx");e.appendChild(n),this.options.vertical?Xe(e,"maptalks-toolbar-vertical"):Xe(e,"maptalks-toolbar-horizonal");var i=this;function r(t,e,n,r){var o=i._getItems()[e];return function(i){return Ge(i),t({target:o,index:e,childIndex:n,dom:r})}}var o=this.options.items;if(U(o))for(var a=0,s=o.length;a'+h.item+""}else u.innerHTML=h.item;if(h.click&&en(u,"click",r(h.click,a,null,u)),U(h.children)){var l=this._createDropMenu(a);u.appendChild(l),u._menu=l,en(u,"mouseover",function(){this._menu.style.display=""}),en(u,"mouseout",function(){this._menu.style.display="none"})}n.appendChild(u)}return e},n._createDropMenu=function(t){var e=this;function n(t,n,i){var r=e._getItems()[n].children[i];return function(e){return Ge(e),t({target:r,index:n,childIndex:i})}}var i=De("div","maptalks-dropMenu"),r=this._getItems(),o=r.length,a=De("ul"),s=r[t].children;t===o-1&&s&&(i.style.cssText="right: 0px;",a.style.cssText="right: 0px;position: absolute;",this.options.reverseMenu&&(a.style.bottom=0)),i.appendChild(De("em","maptalks-ico"));for(var h=0,u=0,c=s.length;uh&&(h=l.width)}for(var f=0,d=s.length;f'+p.item+"",m.style.cursor="pointer",m.style.width=h+24+"px",en(m.childNodes[0],"click",n(p.click,t,f)),a.appendChild(m)}if(this.options.vertical){var g=h<95?95:h;this.options.reverseMenu?i.style.right=-(g+20)+"px":i.style.left=-(g+20)+"px"}else this.options.reverseMenu?i.style.bottom="28px":i.style.top="28px";return i.appendChild(a),i.style.display="none",i},n._getItems=function(){return this.options.items||[]},e}(io);co.mergeOptions({height:28,vertical:!1,position:"top-right",reverseMenu:!1,items:{}});var lo=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.buildOn=function(t){var e=this.options,n=De("div","maptalks-zoom");if(e.zoomLevel){var i=De("span","maptalks-zoom-zoomlevel");n.appendChild(i),this._levelDOM=i}var r=De("div","maptalks-zoom-slider"),o=De("a","maptalks-zoom-zoomin");if(o.href="javascript:;",o.innerHTML="+",r.appendChild(o),this._zoomInButton=o,e.slider){var a=De("div","maptalks-zoom-slider-box"),s=De("div","maptalks-zoom-slider-ruler"),h=De("span","maptalks-zoom-slider-reading"),u=De("span","maptalks-zoom-slider-dot");s.appendChild(h),a.appendChild(s),a.appendChild(u),r.appendChild(a),this._sliderBox=a,this._sliderRuler=s,this._sliderReading=h,this._sliderDot=u}var c=De("a","maptalks-zoom-zoomout");return c.href="javascript:;",c.innerHTML="-",r.appendChild(c),this._zoomOutButton=c,n.appendChild(r),t.on("_zoomend _zoomstart _spatialreferencechange",this._update,this),this._update(),this._registerDomEvents(),n},n.onRemove=function(){this.getMap().off("_zoomend _zoomstart _spatialreferencechange",this._update,this),this._zoomInButton&&nn(this._zoomInButton,"click",this._onZoomInClick,this),this._zoomOutButton&&nn(this._zoomOutButton,"click",this._onZoomOutClick,this),this._sliderRuler&&(nn(this._sliderRuler,"click",this._onClickRuler,this),this.dotDragger.disable(),delete this.dotDragger)},n._update=function(){var t=this.getMap();if(this._sliderBox){var e=10*(t.getMaxZoom()-t.getMinZoom());this._sliderBox.style.height=e+16+"px",this._sliderRuler.style.height=e+8+"px",this._sliderRuler.style.cursor="pointer";var n=10*(t.getMaxZoom()-t.getZoom());this._sliderReading.style.height=10*(t.getZoom()-t.getMinZoom()+1)+"px",this._sliderDot.style.top=n+"px"}this._updateText()},n._updateText=function(){if(this._levelDOM){var t=this.getMap().getZoom();g(t)||(t=t.toFixed(1)),this._levelDOM.innerHTML=t}},n._registerDomEvents=function(){this._zoomInButton&&en(this._zoomInButton,"click",this._onZoomInClick,this),this._zoomOutButton&&en(this._zoomOutButton,"click",this._onZoomOutClick,this),this._sliderRuler&&(en(this._sliderRuler,"click",this._onClickRuler,this),this.dotDragger=new wn(this._sliderDot,{ignoreMouseleave:!0}),this.dotDragger.on("dragstart",this._onDotDragstart,this).on("dragging dragend",this._onDotDrag,this).enable())},n._onZoomInClick=function(t){je(t),this.getMap().zoomIn()},n._onZoomOutClick=function(t){je(t),this.getMap().zoomOut()},n._onClickRuler=function(t){je(t);var e=this.getMap(),n=We(t,this._sliderRuler).y,i=e.getMaxZoom(),r=Math.floor(i-n/10);e.setZoom(r)},n._onDotDragstart=function(t){je(t.domEvent);var e=this.getMap(),n=e.getSize().toPoint()._multi(.5);e.onZoomStart(e.getZoom(),n)},n._onDotDrag=function(t){je(t.domEvent);var e=this.getMap(),n=e.getSize().toPoint()._multi(.5),i=We(t.domEvent,this._sliderRuler),r=e.getMaxZoom(),o=e.getMinZoom(),a=i.y,s=r-a/10;rs&&(s=o,a=10*(r-o)),"dragging"===t.type?e.onZooming(s,n,1):"dragend"===t.type&&(this.options.seamless?e.onZoomEnd(s,n):e.onZoomEnd(Math.round(s),n)),this._sliderDot.style.top=a+"px",this._sliderReading.style.height=10*(e.getZoom()-o+1)+"px",this._updateText()},e}(io);lo.mergeOptions({position:"top-left",slider:!0,zoomLevel:!0,seamless:!1}),ri.mergeOptions({zoomControl:!1}),ri.addOnLoadHook(function(){this.options.zoomControl&&(this.zoomControl=new lo(this.options.zoomControl),this.addControl(this.zoomControl))});var fo=Object.freeze({Control:io,Attribution:oo,LayerSwitcher:ao,Overview:so,Panel:ho,Scale:uo,Toolbar:co,Zoom:lo}),po=function(){function t(t,e,n,i){Array.isArray(t)?(this.scale={x:t[0],y:t[1]},this.origin={x:t[2],y:t[3]}):(this.scale={x:t,y:e},this.origin={x:n,y:i})}return t.getDefault=function(t){return"baidu"===t.code.toLowerCase()?"baidu":t.code.toLowerCase()==="EPSG:4326".toLowerCase()?"tms-global-geodetic":"identity"===t.code.toLowerCase()?[1,-1,0,0]:"web-mercator"},t}(),mo=6378137*Math.PI;d(po,{"web-mercator":new po([1,-1,-mo,mo]),"tms-global-mercator":new po([1,1,-mo,-mo]),"tms-global-geodetic":new po([1,1,-180,-90]),baidu:new po([1,1,0,0])});var go=function(){function t(t,e,n){this.tileSize=n,this.fullExtent=e,this.prepareTileInfo(t,e)}var e=t.prototype;return e.prepareTileInfo=function(t,e){if(y(t)?t=po[t.toLowerCase()]:Array.isArray(t)&&(t=new po(t)),!t)throw new Error("Invalid TileSystem");this.tileSystem=t;var n=e.right>e.left?1:-1,i=e.top>e.bottom?-1:1,r=t.origin.x,o=t.origin.y;this.transformation=new Tn([n,i,r,o])},e._getTileNum=function(t,e){var n=this.tileSystem,i=this.tileSize,r=Math.floor(1e-7+t.x/(i.width*e)),o=-Math.floor(1e-7+t.y/(i.height*e));return{x:n.scale.x*r,y:n.scale.y*o}},e.getTileIndex=function(t,e){var n=this.tileSystem,i=this.transformation.transform(t,1),r=this._getTileNum(i,e);return n.scale.x<0&&(r.x-=1),n.scale.y>0&&(r.y-=1),this.getNeighorTileIndex(r.x,r.y,0,0,!0)},e.getNeighorTileIndex=function(t,e,n,i,r,o){var a=this.tileSystem,s=t+a.scale.x*n,h=e-a.scale.y*i,u=s,c=h;if(o){var l=this._getTileFullIndex(r);s=l.xmax&&(s=l.xmin+(s-l.xmin)%(l.xmax-l.xmin)),h>=l.ymax?h=l.ymin+(h-l.ymin)%(l.ymax-l.ymin):he._frameZoom?Math.floor(t):Math.ceil(t):Math.round(t));var n=this.options.maxAvailableZoom;return!p(n)&&t>n&&(t=n),t},n._getTiles=function(t,e,n){var i=this.getMap();if(!(i&&this.isVisible()&&i.width&&i.height))return null;var r=this.getMinZoom(),o=this.getMaxZoom();if(!p(r)&&to)return null;var a=this._getTileConfig();if(!a)return null;var s=t,h=this.getSpatialReference(),u=i.getSpatialReference(),c=h.getResolution(s),l={zoom:s,extent:null,tiles:[]},f=this._getTileOffset(s),d=f[0]||f[1],m=e.convertTo(function(t){return i._containerPointToPoint(t)})._add(f),g=this._getInnerExtent(s,e,m),v=this._getMask2DExtent();if(v){var y=v.intersection(m);if(!y)return l;e=y.convertTo(function(t){return i._pointToContainerPoint(t)})}var _,x=i._containerPointToPrj(e.getCenter());_=d?this._project(i._pointToPrj(i._prjToPoint(x)._add(f))):this._project(x);for(var w=this._project(i._pointToPrj(m.getMin())),b=this._project(i._pointToPrj(m.getMax())),M=a.getTileIndex(_,c),E=a.getTileIndex(w,c),S=a.getTileIndex(b,c),T=Math.ceil(Math.abs(M.y-E.y)),C=Math.ceil(Math.abs(M.x-E.x)),P=Math.ceil(Math.abs(M.y-S.y)),A=Math.ceil(Math.abs(M.x-S.x)),L=this.getId(),R=this.getRenderer(),O=this.getTileSize(),I=this._getTileConfig().tileSystem.scale,D=[],k=new Sn,N=-C;N<=A;N++)for(var z=-T;z<=P;z++){var F=a.getNeighorTileIndex(M.x,M.y,N,z,c,this.options.repeatWorld),B=a.getTilePrjNW(F.x,F.y,c),j=i._prjToPoint(this._unproject(B),s),G=void 0,H=void 0;if(h===u)G=O.width,H=O.height;else{var U=a.getTilePrjSE(F.x,F.y,c),V=i._prjToPoint(this._unproject(U),s);G=Math.abs(Math.round(V.x-j.x)),H=Math.abs(Math.round(V.y-j.y))}var W=I.x*(F.idx-F.x)*G,Z=-I.y*(F.idy-F.y)*H;(W||Z)&&j._add(W,Z),h!==u&&(G++,H++),d&&j._sub(f);var q=new Sn(j,j.add(G,H)),X={point:j,z:s,x:F.x,y:F.y,extent2d:q,mask:n};(g.intersects(q)||!g.equals(m)&&this._isTileInExtent(X,e))&&(d&&(X.point._add(f),X.extent2d._add(f)),X.size=[G,H],X.dupKey=j.round().toArray().join()+","+G+","+H+","+L,X.id=this._getTileId(F,s),X.layer=L,R&&R.isTileCachedOrLoading(X.id)||(X.url=this.getTileUrl(F.x,F.y,s)),D.push(X),k._combine(q))}var Y=i._containerPointToPoint(e.getCenter(),s)._add(f);return D.sort(function(t,e){return t.point.distanceTo(Y)-e.point.distanceTo(Y)}),{offset:f,zoom:s,extent:k,tiles:D}},n._getInnerExtent=function(t,e,n){var i=this.getMap(),r=i.getResolution(t),o=i.getResolution()/r,a=n.getCenter()._multi(o),s=i.getBearing()*Math.PI/180,h=e.getHeight()/2*o,u=e.getWidth()/2*o,c=Math.abs(Math.cos(s)*h)||h,l=Math.abs(Math.sin(s)*h)||u;return new Sn(a.sub(l,c),a.add(l,c))},n._getTileOffset=function(t){var e=this.getMap(),n=e._getResolution()/e._getResolution(t),i=this.options.offset;return _(i)&&(i=i(this)),i[0]*=n,i[1]*=n,i},n._getTileId=function(t,e,n){return[n||this.getId(),t.idy,t.idx,e].join("__")},n._project=function(t){var e=this.getMap(),n=this.getSpatialReference();return n!==e.getSpatialReference()?n.getProjection().project(e.getProjection().unproject(t)):t},n._unproject=function(t){var e=this.getMap(),n=this.getSpatialReference();return n!==e.getSpatialReference()?e.getProjection().project(n.getProjection().unproject(t)):t},n._initTileConfig=function(){var t=this.getMap(),e=this.getTileSize(),n=this.getSpatialReference(),i=n.getProjection(),r=n.getFullExtent();if(this._defaultTileConfig=new go(po.getDefault(i),r,e),this.options.tileSystem&&(this._tileConfig=new go(this.options.tileSystem,r,e)),t&&!this._tileConfig&&t.getSpatialReference()===n&&t.getBaseLayer()&&t.getBaseLayer()!==this&&t.getBaseLayer()._getTileConfig){var o=t.getBaseLayer()._getTileConfig();this._tileConfig=new go(o.tileSystem,o.fullExtent,e)}},n._getTileConfig=function(){return this._defaultTileConfig||this._initTileConfig(),this._tileConfig||this._defaultTileConfig},n._bindMap=function(e){var n=e.getBaseLayer();return n===this&&(n.options.hasOwnProperty("forceRenderOnMoving")||this.config({forceRenderOnMoving:!0})),t.prototype._bindMap.apply(this,arguments)},n._isTileInExtent=function(t,e){var n=this.getMap();if(!n)return!1;var i=t.z,r=t.extent2d.convertTo(function(t){return n._pointToContainerPoint(t,i)});return!(r.getWidth()<5||r.getHeight()<5)&&e.intersects(r)},n.getEvents=function(){return{spatialreferencechange:this._onSpatialReferenceChange}},n._onSpatialReferenceChange=function(){delete this._tileConfig,delete this._defaultTileConfig,delete this._sr},e}($n);_o.registerJSONType("TileLayer"),_o.mergeOptions(vo);var xo=function(t){function e(e,n,i){var r;return(r=t.call(this,e,i)||this).layers=n||[],r._checkChildren(),r.layerMap={},r._groupChildren=[],r}se(e,t),e.fromJSON=function(t){if(!t||"GroupTileLayer"!==t.type)return null;var n=t.layers.map(function(t){return $n.fromJSON(t)});return new e(t.id,n,t.options)};var n=e.prototype;return n.getLayers=function(){return this.layers},n.toJSON=function(){return{type:this.getJSONType(),id:this.getId(),layers:this.layers.map(function(t){return t.toJSON()}),options:this.config()}},n.getTiles=function(t){for(var e=this.layers,n=[],i=0,r=0,o=e.length;r=1.3?"crs":"srs";this.wmsParams[n]=e,t.prototype.onAdd.call(this)},n.getTileUrl=function(e,n,i){var r=this.getMap()._getResolution(i),o=this._getTileConfig().getTilePrjExtent(e,n,r),a=o.getMax(),s=o.getMin(),h=(this._wmsVersion>=1.3&&"EPSG:4326"===this.wmsParams.crs?[s.y,s.x,a.y,a.x]:[s.x,s.y,a.x,a.y]).join(","),u=t.prototype.getTileUrl.call(this,e,n,i);return u+function(t,e,n){var i=[];for(var r in t)i.push(encodeURIComponent(n?r.toUpperCase():r)+"="+encodeURIComponent(t[r]));return(e&&-1!==e.indexOf("?")?"&":"?")+i.join("&")}(this.wmsParams,u,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+h},n.toJSON=function(){return{type:"WMSTileLayer",id:this.getId(),options:this.config()}},e.fromJSON=function(t){return t&&"WMSTileLayer"===t.type?new e(t.id,t.options):null},e}(_o);bo.registerJSONType("WMSTileLayer"),bo.mergeOptions({crs:null,uppercase:!1,detectRetina:!1});var Mo=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).options.hasOwnProperty("forceRenderOnMoving")||(i.options.forceRenderOnMoving=!1),i}se(e,t);var n=e.prototype;return n.drawTile=function(){},n.toJSON=function(){return{type:"CanvasTileLayer",id:this.getId(),options:this.config()}},e.fromJSON=function(t){return t&&"CanvasTileLayer"===t.type?new e(t.id,t.options):null},e}(_o);function Eo(t,e,n){var i=t.createShader(e);if(t.shaderSource(i,n),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)){var r=t.getShaderInfoLog(i);throw t.deleteShader(i),new Error("Failed to compile shader: "+r)}return i}Mo.registerJSONType("CanvasTileLayer");var So="\n attribute vec3 a_position;\n\n attribute vec2 a_texCoord;\n\n uniform mat4 u_matrix;\n\n varying vec2 v_texCoord;\n\n void main() {\n gl_Position = u_matrix * vec4(a_position, 1.0);\n\n v_texCoord = a_texCoord;\n }\n ",To="\n precision mediump float;\n\n uniform sampler2D u_image;\n\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n\n }\n ",Co=[0,0],Po=[0,0,0],Ao=new Array(16),Lo=function(t){var e=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.drawGLImage=function(t,e,n,i,r,o){var a=this.gl;this.loadTexture(t),Po[0]=e||0,Po[1]=n||0;var s=Ir(Ao);Ar(s,s,Po),Rr(s,this.getMap().projViewMatrix,s),a.uniformMatrix4fv(this.program.u_matrix,!1,s),a.uniform1f(this.program.u_opacity,o),t.glBuffer?a.bindBuffer(a.ARRAY_BUFFER,t.glBuffer):t.glBuffer=this.bufferTileData(0,0,i,r),Co[0]="a_position",Co[1]=3,this.enableVertexAttrib(Co),a.drawArrays(a.TRIANGLE_STRIP,0,4)},n.bufferTileData=function(t,e,n,i,r){var o=t,a=t+n,s=e,h=e+i;return this.loadImageBuffer(this.set12(o,s,0,o,h,0,a,s,0,a,h,0),r)},n.drawTinImage=function(t,e,n,i,r){var o=this.gl;this.loadTexture(t),o.uniformMatrix4fv(this.program.u_matrix,!1,this.getMap().projViewMatrix),o.uniform1f(this.program.u_opacity,r),o.bindBuffer(o.ARRAY_BUFFER,this.posBuffer),this.enableVertexAttrib(["a_position",3]),o.bufferData(o.ARRAY_BUFFER,new Float32Array(e),o.DYNAMIC_DRAW),o.bindBuffer(o.ARRAY_BUFFER,this.texBuffer),this.enableVertexAttrib(["a_texCoord",2]),o.bufferData(o.ARRAY_BUFFER,new Float32Array(n),o.DYNAMIC_DRAW),o.bufferData(o.ELEMENT_ARRAY_BUFFER,new Uint16Array(i),o.DYNAMIC_DRAW),o.drawElements(o.TRIANGLES,i.length,o.UNSIGNED_SHORT,0)},n.createCanvas2=function(){this.canvas2=sn.createCanvas(this.canvas.width,this.canvas.height)},n.createGLContext=function(){var t=this.gl=function(t,e){for(var n={alpha:!0,stencil:!0,preserveDrawingBuffer:!0,antialias:!1},i=["webgl","experimental-webgl"],r=null,o=0;o0?t.pop():null},n.saveTexture=function(t){this._textures.push(t)},n.loadTexture=function(t){var e=this.gl,n=t.texture;return n||(n=this._createTexture(t),t.texture=n),e.bindTexture(e.TEXTURE_2D,n),n},n.getImageBuffer=function(){this._imageBuffers||(this._imageBuffers=[]);var t=this._imageBuffers;return t&&t.length>0?t.pop():null},n.saveImageBuffer=function(t){this._imageBuffers.push(t)},n.loadImageBuffer=function(t,e){var n=this.gl,i=e||this.createImageBuffer();return n.bindBuffer(n.ARRAY_BUFFER,i),n.bufferData(n.ARRAY_BUFFER,t,n.STATIC_DRAW),i},n.createImageBuffer=function(){return this.getImageBuffer()||this.createBuffer()},n.removeGLCanvas=function(){var t=this.gl;if(t){this._buffers&&(this._buffers.forEach(function(e){t.deleteBuffer(e)}),delete this._buffers),this._textures&&(this._textures.forEach(function(e){return t.deleteTexture(e)}),delete this._textures),delete this.posBuffer;var e=t.program;t.deleteShader(e.fragmentShader),t.deleteShader(e.vertexShader),t.deleteProgram(e),delete this.gl,delete this.canvas2}},n.createBuffer=function(){var t=this.gl.createBuffer();if(!t)throw new Error("Failed to create the buffer object");return this._buffers||(this._buffers=[]),this._buffers.push(t),t},n.enableVertexAttrib=function(t){!function(t,e,n){if(Array.isArray(n[0])){for(var i=Float32Array.BYTES_PER_ELEMENT,r=0,o=0;o=0&&(i=i.substring(0,o),C||(r=r.substring(0,o))),t[i]=this._getUniform(t,r)}},n._getUniform=function(t,e){var n=this.gl.getUniformLocation(t,e);if(!n)throw new Error("Failed to get the storage location of "+e);return n},e}(t);return d(e.prototype,{set12:function(){var t=ae.ie9?null:new Float32Array(12);return function(e,n,i,r,o,a,s,h,u,c,l,f){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=o,t[5]=a,t[6]=s,t[7]=h,t[8]=u,t[9]=c,t[10]=l,t[11]=f,t}}()}),e},Ro={renderer:ae.webgl?"gl":"canvas",crossOrigin:null},Oo=function(t){function e(e,n,i){var r;return Array.isArray(n)||n.url||(i=n,n=null),(r=t.call(this,e,i)||this)._prepareImages(n),r}se(e,t);var n=e.prototype;return n.setImages=function(t){return this._images=t,this._prepareImages(t),this},n.getImages=function(){return this._images},n._prepareImages=function(t){t=t||[],Array.isArray(t)||(t=[t]),this._imageData=t.map(function(t){return d({},t,{extent:new En(t.extent)})}),this._images=t;var e=this.getRenderer();e&&e.refreshImages()},e}($n);Oo.mergeOptions(Ro);var Io=[],Do=function(t){function e(){return t.apply(this,arguments)||this}se(e,t);var n=e.prototype;return n.isDrawable=function(){return!this.getMap().getPitch()||(console&&console.warn("ImageLayer with canvas renderer can't be pitched, use gl renderer ('renderer' : 'gl') instead."),!1)},n.checkResources=function(){var t=this;if(this._imageLoaded)return Io;var e=this.layer._imageData.map(function(t){return[t.url,null,null]});if(this.resources){var n=[],i=new Qn;e.forEach(function(e){if(t.resources.isResourceLoaded(e)){var r=t.resources.getImage(e);i.addResource(e,r)}else n.push(e)}),this.resources.forEach(function(e,n){i.isResourceLoaded(e)||t.retireImage(n.image)}),this.resources=i,e=n}return this._imageLoaded=!0,e},n.retireImage=function(){},n.refreshImages=function(){this._imageLoaded=!1,this.setToRedraw()},n.needToRedraw=function(){var e=this.getMap();return!(e.isZooming()&&!e.getPitch())&&t.prototype.needToRedraw.call(this)},n.draw=function(){this.isDrawable()&&(this.prepareCanvas(),this._painted=!1,this._drawImages(),this.completeRender())},n._drawImages=function(){var t=this.layer._imageData,e=this.getMap().getExtent();if(t&&t.length)for(var n=0;n=0){var l=i.viewPointToCoordinate(r.sub(o)),f=n.getCoordinates();l.x=f.x,n.setCoordinates(l),t._updateCoordFromShadow(!0);var d=c[c.length-1-u];r=i.coordToViewPoint(d.getCoordinates())}var p=i._pointToViewPoint(n._getCenter2DPoint()).add(o),m=n._getInternalSymbol(),g=r.sub(p);a&&r.y>p.y&&(g.y=0);var v=a?1:2,y=2*Math.abs(g.x),_=Math.abs(g.y)*v;s&&(_=(y=Math.max(y,_*s))/s);var x=h[u];n instanceof pr?((s||0===x||2===x)&&(n.setWidth(y),e.setWidth(y)),(s||1===x||2===x)&&(n.setHeight(_),e.setHeight(_))):((s||0===x||2===x)&&(m.markerWidth=y),(s||1===x||2===x)&&(m.markerHeight=_),n.setSymbol(m),e.setSymbol(m))},function(){t._update(l())});this._addListener([i,"zoomend",function(){this._refresh()}])}else console&&console.warn("A marker can't be resized with symbol:",n.getSymbol());function l(){var t=[["setCoordinates",n.getCoordinates().toArray()]];return n instanceof pr?(t.push(["setWidth",n.getWidth()]),t.push(["setHeight",n.getHeight()])):t.push(["setSymbol",n.getSymbol()]),t}},n.createCircleEditor=function(){var t=this,e=this._geometry,n=this._shadow,i=this.getMap();this._history||this._recordHistory([["setCoordinates",n.getCoordinates().toArray()],["setRadius",n.getRadius()]]),this._createResizeHandles(null,function(t){var r,o=i._pointToViewPoint(n._getCenter2DPoint()),a=t.sub(o),s=Math.abs(a.x),h=Math.abs(a.y);r=s>h?i.pixelToDistance(s,0):i.pixelToDistance(0,h),n.setRadius(r),e.setRadius(r)},function(){t._update("setRadius",n.getRadius())})},n.createEllipseOrRectEditor=function(){var t=this,e=[2,1,2,0,0,2,1,2],n=this._geometry,i=this._shadow;this._history||this._recordHistory(h());var r,o=this.getMap(),a=this._geometry instanceof or;this.options.fixAspectRatio&&(r=n.getWidth()/n.getHeight());var s=this._createResizeHandles(null,function(h,u){var c,l,f,d=a?1:2,p=h,m=e[u];if(a){var g=s[7-u],v=o.coordToViewPoint(g.getCoordinates()),y=(c=p.sub(v)).abs();l=o.pixelToDistance(y.x,0),f=o.pixelToDistance(0,y.y);var _=n.getSize();0===m?(r&&(y.y=y.x/r,_.height=Math.abs(y.y),f=l/r),p.y=v.y-_.height/2):1===m?(r&&(y.x=y.y*r,_.width=Math.abs(y.x),l=f*r),p.x=v.x-_.width/2):r&&(l>f*r?(f=l/r,p.y=v.y+y.x*F(c.y)/r):(l=f*r,p.x=v.x+y.y*F(c.x)*r));var x=o.viewPointToCoordinate(new ce(Math.min(p.x,v.x),Math.min(p.y,v.y)));i.setCoordinates(x),t._updateCoordFromShadow(!0)}else{c=o.coordToViewPoint(n.getCenter()).sub(p)._abs(),l=o.pixelToDistance(c.x,0),f=o.pixelToDistance(0,c.y),r&&(f=(l=Math.max(l,f*r))/r)}(r||0===m||2===m)&&(i.setWidth(l*d),n.setWidth(l*d)),(r||1===m||2===m)&&(i.setHeight(f*d),n.setHeight(f*d))},function(){t._update(h())});function h(){return[["setCoordinates",i.getCoordinates().toArray()],["setWidth",i.getWidth()],["setHeight",i.getHeight()]]}},n.createPolygonEditor=function(){var t=this.getMap(),e=this._shadow,n=this,i=t.getProjection();this._history||this._recordHistory("setCoordinates",bn.toNumberArrays(e.getCoordinates()));var r=e instanceof Ui?3:2,o="maptalks--editor-refresh-fn",a="maptalks--editor-vertex-index",s=[],h=[];function u(){if(e instanceof Ui){var t=e.getCoordinates()[0];return t.slice(0,t.length-1)}return e.getCoordinates()}function c(){return e._getPrjCoordinates()}function l(){for(var t=s.length-1;t>=0;t--)s[t][a]=t;for(var e=h.length-1;e>=0;e--)h[e][a]=e;n._updateCoordFromShadow()}function f(t){var i,o=t.target[a],u=c();u.length<=r||(u.splice(o,1),e._setPrjCoordinates(u),e._updateCache(),s.splice(o,1)[0].remove(),o=o.length?o[0]:o[t+1];var f=o[t].add(r).multi(.5),g=n.createHandle(f,{symbol:n.options.newVertexHandleSymbol,cursor:"pointer",axis:null,onDown:function(t,r){if(!r||!r.domEvent||2!==r.domEvent.button){var o=c(),s=g[a],u=i.project(g.getCoordinates());o.splice(s+1,0,u),e._setPrjCoordinates(o),e._updateCache();var l=g.getSymbol();delete l.opacity,g.setSymbol(l),h.splice(s,0,m.call(n,s),m.call(n,s+1))}},onMove:function(t){d(t,g[a]+1)},onUp:function(t){if(!t||!t.domEvent||2!==t.domEvent.button){var e=g[a];k(g,h),g.remove(),s.splice(e+1,0,p.call(n,e+1)),l(),n._updateCoordFromShadow(),n._refresh()}},onRefresh:function(){o=u();var t,e=g[a];t=e===o.length-1?0:e+1;var n=o[e].add(o[t]).multi(.5);g.setCoordinates(n)}});return g[a]=t,g}for(var g=u(),v=0,y=g.length;v=0;t--)h[t][o]();for(var e=s.length-1;e>=0;e--)s[e][o]()})},n._refresh=function(){if(this._refreshHooks)for(var t=this._refreshHooks.length-1;t>=0;t--)this._refreshHooks[t].call(this)},n._hideContext=function(){this._geometry&&(this._geometry.closeMenu(),this._geometry.closeInfoWindow())},n._addListener=function(t){this._eventListeners||(this._eventListeners=[]),this._eventListeners.push(t),t[0].on(t[1],t[2],this)},n._clearAllListeners=function(){if(this._eventListeners&&this._eventListeners.length>0){for(var t=this._eventListeners.length-1;t>=0;t--){var e=this._eventListeners[t];e[0].off(e[1],e[2],this)}this._eventListeners=[]}},n._addRefreshHook=function(t){t&&(this._refreshHooks||(this._refreshHooks=[]),this._refreshHooks.push(t))},n._update=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i1?e-1:0),i=1;i/gi,"").replace(/<\/p>/gi,"
"),this._textEditor.innerHTML=t;var e=this._textEditor.innerText.replace(/[\r\n]+$/gi,"");this.setContent(e),nn(this._textEditor,"mousedown dblclick",Ge),this.getMap().off("mousedown",this.endEditText,this),this._editUIMarker.remove(),delete this._editUIMarker,this._textEditor.onkeyup=null,delete this._textEditor,this.show(),this._fireEvent("edittextend")}return this},isEditingText:function(){return!!this._textEditor},getTextEditor:function(){return this._editUIMarker},_prepareEditor:function(){var t=this.getMap(),e=this._createEditor();this._textEditor=e,t.on("mousedown",this.endEditText,this);var n=this._getEditorOffset();this._editUIMarker=new Xr(this.getCoordinates(),{animation:null,content:e,dx:n.dx,dy:n.dy}).addTo(t),this._setCursorToLast(this._textEditor)},_getEditorOffset:function(){var t=this._getInternalSymbol()||{},e=0,n=0,i=t.textHorizontalAlignment;return"middle"===i||p(i)?(e=(t.textDx||0)-2,n=(t.textDy||0)-2):(e=(t.markerDx||0)-2,n=(t.markerDy||0)-2),{dx:e,dy:n}},_createEditor:function(){var t=this.getContent(),e=this.getSize(),n=this._getInternalSymbol()||{},i=e.width,r=n.textFill||"#000000",o=n.textSize||12,a=e.height,s=n.markerLineColor||"#000",h=n.markerFill||"#3398CC",u=n.textLineSpacing||0,c=De("div");return c.contentEditable=!0,c.style.cssText="background:"+h+"; border:1px solid "+s+";\n color:"+r+";font-size:"+o+"px;width:"+(i-2)+"px;height:"+(a-2)+"px;margin: auto;\n line-height:"+(o+u)+"px;outline: 0; padding:0; margin:0;word-wrap: break-word;\n overflow: hidden;-webkit-user-modify: read-write-plaintext-only;",c.innerText=t,en(c,"mousedown dblclick",Ge),c.onkeyup=function(t){var e=c.style.height||0;13===t.keyCode&&(c.style.height=parseInt(e)+o/2+"px")},c},_setCursorToLast:function(t){var e;window.getSelection?(t.focus(),(e=window.getSelection()).selectAllChildren(t),e.collapseToEnd()):document.selection&&((e=document.selection.createRange()).moveToElementText(t),e.collapse(!1),e.select())}};dr.include(Vo),Ri.include({animate:function(t,e,n){var i=this;this._animPlayer&&this._animPlayer.finish(),_(e)&&(n=e),e||(e={});var r,o=this.getMap(),a=this._getProjection(),s=this.getSymbol()||{},h=this._prepareAnimationStyles(t),u=e.focus;if(delete this._animationStarted,o){var c=o._getRenderer();e.framer=function(t){c.callInNextFrame(t)}}var l=Bi.animate(h,e,function(t){if(o&&o.isRemoved())l.finish();else{o&&!i._animationStarted&&u&&o.onMoveStart();var e=t.styles;for(var h in e)if("symbol"!==h&&"translate"!==h&&e.hasOwnProperty(h)){var c="set"+h[0].toUpperCase()+h.slice(1);i[c](e[h])}var f=e.translate;if(f){var d=f;r&&(d=f.sub(r)),r=f,i.translate(d)}var p=e.symbol;if(p&&i.setSymbol(Nt(s,p)),o&&u){var m=a.project(i.getCenter());o._setPrjCenter(m);var g=o._parseEventFromCoord(a.unproject(m));"running"!==l.playState?o.onMoveEnd(g):o.onMoving(g)}i._fireAnimateEvent(l.playState),n&&n(t)}});return this._animPlayer=l,this._animPlayer.play()},_prepareAnimationStyles:function(t){var e=this._getInternalSymbol(),n={};for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if("translate"!==i&&"symbol"!==i){var o=this["get"+i[0].toUpperCase()+i.substring(1)]();n[i]=[o,r]}else if("symbol"===i){var a=void 0;if(Array.isArray(t.symbol)){if(!Array.isArray(e))throw new Error("geometry'symbol isn't a composite symbol, while the symbol in styles is.");a=[];for(var s=t.symbol,h=0;h1||2===n.button||(this.container=e._panels.mapWrapper||e._containerDOM,this.target.on("click",this._endDrag,this),this._lastCoord=this._correctCoord(t.coordinate),this._lastPoint=t.containerPoint,this._prepareDragHandler(),this._dragHandler.onMouseDown(t.domEvent),en(this.container,"mouseleave",this._endDrag,this),this._startParam=t,this._moved=!1)}},n._dragging=function(t){var e=this.target,n=e.getMap()._parseEvent(t.domEvent),i=n.domEvent;if(!(i.touches&&i.touches.length>1)){if(!this._moved)return this._moved=!0,e.on("symbolchange",this._onTargetUpdated,this),this._isDragging=!0,this._prepareShadow(),e.options.dragShadow||e.hide(),this._shadow._fireEvent("dragstart",n),this.target._fireEvent("dragstart",this._startParam||n),void delete this._startParam;if(this._shadow){var r=this._shadow.options.dragOnAxis,o=this._correctCoord(n.coordinate),a=n.containerPoint;this._lastPoint=this._lastPoint||a,this._lastCoord=this._lastCoord||o;var s=a.sub(this._lastPoint),h=o.sub(this._lastCoord);"x"===r?s.y=h.y=0:"y"===r&&(s.x=h.x=0),this._lastPoint=a,this._lastCoord=o,this._shadow.translate(h),e.options.dragShadow||e.translate(h),n.coordOffset=h,n.pointOffset=s,this._shadow._fireEvent("dragging",n),e._fireEvent("dragging",n)}}},n._endDrag=function(t){if(this._dragHandler&&(this._dragHandler.disable(),delete this._dragHandler),this.container&&nn(this.container,"mouseleave",this._endDrag,this),this.target){var e=this.target;e.off("click",this._endDrag,this),e.off("symbolchange",this._onTargetUpdated,this),delete this._lastCoord,delete this._lastPoint,this._isDragging=!1;var n=e.getMap();if(this.enabled()&&n){var i=n._parseEvent(t?t.domEvent:null);this._updateTargetAndRemoveShadow(i),this._moved&&e._fireEvent("dragend",i)}}},n.isDragging=function(){return!!this._isDragging},n._updateTargetAndRemoveShadow=function(t){var e=this.target,n=e.getMap();e.options.dragShadow||e.show();var i=this._shadow;i&&(e.options.dragShadow&&e.setCoordinates(i.getCoordinates()),i._fireEvent("dragend",t),i.remove(),delete this._shadow),this._shadowConnectors&&(n.getLayer(Wo).removeGeometry(this._shadowConnectors),delete this._shadowConnectors),this._dragStageLayer&&this._dragStageLayer.remove()},n._correctCoord=function(t){var e=this.target.getMap();if(!e.getPitch())return t;var n=this.target._getPainter();if(!n.getMinAltitude())return t;var i=(n.getMinAltitude()+n.getMaxAltitude())/2;return e.locateByPoint(t,0,-i)},e}(pn);Ri.mergeOptions({draggable:!1,dragShadow:!0,dragOnAxis:null}),Ri.addInitHook("addHandler","draggable",qo),Ri.include({isDragging:function(){return this._getParent()?this._getParent().isDragging():!!this.draggable&&this.draggable.isDragging()}}),Ri.include({startEdit:function(t){return this.getMap()&&this.options.editable?(this.endEdit(),this._editor=new Uo(this,t),this._editor.start(),this.fire("editstart"),this):this},endEdit:function(){return this._editor&&(this._editor.stop(),delete this._editor,this.fire("editend")),this},redoEdit:function(){return this.isEditing()?(this._editor.redo(),this.fire("redoedit"),this):this},undoEdit:function(){return this.isEditing()?(this._editor.undo(),this.fire("undoedit"),this):this},isEditing:function(){return!!this._editor&&this._editor.isEditing()}}),Ri.include({_onEvent:function(t,e){if(this.getMap()){var n=e||this._getEventTypeToFire(t);"contextmenu"===n&&this.listens("contextmenu")&&(Ge(t),je(t));var i=this._getEventParams(t);this._fireEvent(n,i)}},_getEventTypeToFire:function(t){return t.type},_getEventParams:function(t){var e=this.getMap(),n={domEvent:t},i=t.touches&&t.touches.length>0?t.touches[0]:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0]:t;if(i){var r=We(i,e._containerDOM);n.coordinate=e.containerPointToCoordinate(r),n.containerPoint=r,n.viewPoint=e.containerPointToViewPoint(r),n.pont2d=e._containerPointToPoint(r)}return n}}),Ri.include({setInfoWindow:function(t){return this.removeInfoWindow(),t instanceof Kr?(this._infoWindow=t,this._infoWinOptions=d({},this._infoWindow.options),this._infoWindow.addTo(this),this):(this._infoWinOptions=d({},t),this._infoWindow?this._infoWindow.setOptions(t):this.getMap()&&this._bindInfoWindow(this._infoWinOptions),this)},getInfoWindow:function(){return this._infoWindow?this._infoWindow:null},openInfoWindow:function(t){return this.getMap()?(t||(t=this.getCenter()),this._infoWindow?this._infoWindow.show(t):this._infoWinOptions&&this.getMap()&&(this._bindInfoWindow(this._infoWinOptions),this._infoWindow.show(t)),this):this},closeInfoWindow:function(){return this._infoWindow&&this._infoWindow.hide(),this},removeInfoWindow:function(){return this._unbindInfoWindow(),delete this._infoWinOptions,delete this._infoWindow,this},_bindInfoWindow:function(t){return this._infoWindow=new Kr(t),this._infoWindow.addTo(this),this},_unbindInfoWindow:function(){return this._infoWindow&&(this.closeInfoWindow(),this._infoWindow.remove(),delete this._infoWindow),this}});var Xo=function(){function t(t,e){this.max=t,this.onRemove=e,this.reset()}var e=t.prototype;return e.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);return this.data={},this.order=[],this},e.clear=function(){this.reset(),delete this.onRemove},e.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var n=this.getAndRemove(this.order[0]);n&&this.onRemove(n)}return this},e.has=function(t){return t in this.data},e.keys=function(){return this.order},e.getAndRemove=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},e.get=function(t){return this.has(t)?this.data[t]:null},e.remove=function(t){if(!this.has(t))return this;var e=this.data[t];return delete this.data[t],this.onRemove(e),this.order.splice(this.order.indexOf(t),1),this},e.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.getAndRemove(this.order[0]);e&&this.onRemove(e)}return this},t}(),Yo=function(t){function e(e){var n;return(n=t.call(this,e)||this).tilesInView={},n.tilesLoading={},n._parentTiles=[],n._childTiles=[],n.tileCache=new Xo(e.options.maxCacheSize,n.deleteTile.bind(he(he(n)))),n}se(e,t);var n=e.prototype;return n.draw=function(){var t=this.getMap();if(this.isDrawable()){var e=this.prepareCanvas();if(!e||e.intersects(this.canvasExtent2D)){var n=this.layer.getTiles().tileGrids;if(n&&n.length){var i=0,r=!1,o={},a=[],s=[],h={},u=[],c={},l=[],f={},d={},p=this._markTiles(),m=this._getLoadLimit(),g=n.length;this._tileZoom=n[0].zoom,this._tileOffset=n[0].offset;for(var v=0;vm||t.isInteracting()&&!t.isMoving()&&!t.isRotating()||(i++,d[E+"@"+M.point.toArray().join()]=M)}if(T&&!o[M.dupKey]){o[M.dupKey]=1,x&&!f[M.dupKey]&&(M.cache=!1,l.push({image:x,info:M}),f[M.dupKey]=1);var C=this._findParentTile(M);if(C){var P=C.info.dupKey;void 0===h[P]&&(h[P]=s.length,s.push(C))}else{var A=this._findChildTiles(M);A.length&&A.forEach(function(t){c[t.info.dupKey]||(u.push(t),c[t.info.dupKey]=1)})}}}this._drawTiles(a,s,u,l),i?this.loadTileQueue(d):r||(!t.isAnimating()&&this._parentTiles.length>0&&(this._parentTiles=[],this._childTiles=[],this.setToRedraw()),this.completeRender()),this._retireTiles()}else this.completeRender()}else this.completeRender()}},n.isTileCachedOrLoading=function(t){return this.tilesLoading[t]||this.tilesInView[t]||this.tileCache.has(t)},n._drawTiles=function(t,e,n,i){var r=this;e.length&&(e.sort(function(t,e){return Math.abs(e.info.z-r._tileZoom)-Math.abs(t.info.z-r._tileZoom)}),this._parentTiles=e),n.length&&(this._childTiles=n);var o={tiles:t,parentTiles:e,childTiles:n};this.onDrawTileStart(o),this._parentTiles.forEach(function(t){return r._drawTileAndCache(t)}),this._childTiles.forEach(function(t){return r._drawTileOffset(t.info,t.image)}),i.forEach(function(t){return r._drawTileOffset(t.info,t.image)});var a=this.layer,s=this.getMap();if(!a.options.cascadeTiles||s.getPitch()<=a.options.minPitchToCascade)t.forEach(function(t){return r._drawTileAndCache(t)});else{this.writeZoomStencil();for(var h=!1,u=0,c=t.length;u=0;i--){var r=t[i]._getExternalResources();if(r.length)if(this.resources)for(var o=0;o0&&u-1-f>h&&d!==c){d._getRenderer().clearCanvas();continue}l+=this._drawCanvasLayerOnInteracting(d,l,s,e)}else i&&m.drawOnInteracting?(m.prepareRender&&m.prepareRender(),m.drawOnInteracting(this._eventParam,e)):m.render(e);p&&(o.push(d.getId()),this.setLayerCanvasUpdated())}else p&&i&&(n.isZooming()&&!n.getPitch()?(m.prepareRender(),m.__shouldZoomTransform=!0):(n.getPitch()||n.isRotating())&&m.clearCanvas())}}}var v=this._canvasIds||[],y=this._updatedIds||[];if(this._canvasIds=r,this._updatedIds=o,!this.isLayerCanvasUpdated()){v.join("---")===r.join("---")&&y.join("---")===o.join("---")||this.setLayerCanvasUpdated()}},n._checkLayerRedraw=function(t){if(this.isSpatialReferenceChanged())return!0;var e=this.map,n=t._getRenderer();return t.isCanvasRender()?n.testIfNeedRedraw():!(!n.needToRedraw||!n.needToRedraw())||(e.isInteracting()||this.isViewChanged())},n._drawCanvasLayerOnInteracting=function(t,e,n,i){var r=this.map,o=t._getRenderer(),a=o.getDrawTime(),s=0===n||n>0&&e+a<=n;if(o.mustRenderOnInteracting&&o.mustRenderOnInteracting())o.render(i);else{if(o.drawOnInteracting&&(t===r.getBaseLayer()||s||r.isZooming()&&t.options.forceRenderOnZooming||r.isMoving()&&t.options.forceRenderOnMoving||r.isRotating()&&t.options.forceRenderOnRotating))return o.prepareRender(),o.prepareCanvas(),o.drawOnInteracting(this._eventParam,i),a;!r.isZooming()||r.getPitch()||r.isRotating()?(r.getPitch()||r.isRotating())&&o.clearCanvas():(o.prepareRender(),o.__shouldZoomTransform=!0)}return o.drawOnInteracting&&!s&&o.onSkipDrawOnInteracting(this._eventParam,i),0},n._fireLayerLoadEvents=function(){if(this._updatedIds&&this._updatedIds.length>0){var t=this.map;this._updatedIds.reverse().forEach(function(e){var n=t.getLayer(e);if(n){var i=n._getRenderer();i&&i.isRenderComplete()&&n.fire("layerload")}})}},n.isLayerCanvasUpdated=function(){return this._canvasUpdated},n.setLayerCanvasUpdated=function(){this._canvasUpdated=!0},n.drawLayerCanvas=function(t){var e=this.map;if(e&&(this.isLayerCanvasUpdated()||this.isViewChanged())){this.canvas||this.createCanvas(),e._fireEvent("renderstart",{context:this.context}),this._updateCanvasSize()||this.clearCanvas();for(var n,i=e.isInteracting(),r=e.options.layerCanvasLimitOnInteracting,o=t.length,a=[],s=0;s=0&&o>r?o-r:0;u=0;a--){var s=n[a];if(!s.isEmpty||!s.isEmpty()){var h=s._getRenderer();if(h&&h.hitDetect&&(!h.isBlank||!h.isBlank())){if("default"!==s.options.cursor&&h.hitDetect(t)){i=s.options.cursor||"pointer";break}if(r>0&&++o>r)break}}}e._trySetCursor(i)}},n._getLayerImage=function(t){var e=t._getRenderer();return e.getCanvasImage?e.getCanvasImage():null},n.initContainer=function(){var t=this.map._panels;function e(e,n,i,r){var o=De("div",n);return i&&(o.style.cssText=i),t[e]=o,r||He(o),o}var n=this.map._containerDOM;if(!this._containerIsCanvas){n.innerHTML="";var i="position:absolute;top:0px;left:0px;",r=e("mapWrapper","maptalks-wrapper","position:absolute;overflow:hidden;",!0),o=e("allLayers","maptalks-all-layers",i+"padding:0px;margin:0px;z-index:0;overflow:visible;",!0),a=e("backStatic","maptalks-back-static",i+"z-index:0;",!0),s=e("back","maptalks-back",i+"z-index:1;"),h=e("backLayer","maptalks-back-layer",i),u=e("canvasContainer","maptalks-canvas-layer",i+"border:none;z-index:2;"),c=e("frontStatic","maptalks-front-static",i+"z-index:3;",!0),l=e("front","maptalks-front",i+"z-index:4;",!0),f=e("frontLayer","maptalks-front-layer",i+"z-index:0;"),d=e("ui","maptalks-ui",i+"border:none;z-index:1;",!0),p=e("control","maptalks-control","z-index:1",!0);n.appendChild(r),o.appendChild(a),s.appendChild(h),o.appendChild(s),o.appendChild(u),l.appendChild(f),o.appendChild(c),o.appendChild(l),l.appendChild(d),r.appendChild(o),r.appendChild(p),this.createCanvas(),this.resetContainer();var m=this.map._getContainerDomSize();this.updateMapSize(m)}},n.isViewChanged=function(){var t=this._mapview,e=this._getMapView();return!t||!tt(t,e)},n._recordView=function(){var t=this.map;!t._onViewChange||t.isInteracting()||t.isAnimating()||tt(t.getView(),t._getCurrentView())||t._onViewChange(t.getView())},n.isSpatialReferenceChanged=function(){return this._spatialRefChanged},n._getMapView=function(){var t=this.map,e=t._getPrjCenter();return{x:e.x,y:e.y,zoom:t.getZoom(),pitch:t.getPitch(),bearing:t.getBearing(),width:t.width,height:t.height}},n._frameLoop=function(t){var e=this;this.map?(this.renderFrame(t),this._animationFrame=S(function(t){e._frameLoop(t)})):this._cancelFrameLoop()},n._cancelFrameLoop=function(){this._animationFrame&&T(this._animationFrame)},n._drawLayerCanvasImage=function(t,e){var n=this.context,i=e.point.round();ae.retina&&i._multi(2);var r=e.image;if(!(i.x+r.width<=0||i.y+r.height<=0)){var o=t.options.opacity;if(m(o)||(o=1),!(o<=0)){var a=e.opacity;if(m(a)||(a=1),!(a<=0)){var s=n.globalAlpha;o<1&&(n.globalAlpha*=o),a<1&&(n.globalAlpha*=a),t.options.cssFilter&&(n.filter=t.options.cssFilter);var h=this._zoomMatrix,u=!!t._getRenderer().__shouldZoomTransform,c=t.getRenderer().clipCanvas(this.context);h&&u&&(n.save(),n.setTransform.apply(n,h)),n.drawImage(r,i.x,i.y),h&&u&&n.restore(),c&&n.restore(),"none"!==n.filter&&(n.filter="none"),n.globalAlpha=s}}}},n._drawCenterCross=function(){var t=this.map.options.centerCross;if(t){var e=this.context,n=new ce(this.canvas.width/2,this.canvas.height/2);_(t)?t(e,n):sn.drawCross(this.context,n,2,"#f00")}},n._drawFog=function(){var t=this.map;if(!(t.getPitch()<=t.options.maxVisualPitch)&&t.options.fog){var e=ae.retina?2:1,n=this.context,i=t.getContainerExtent(),r=(t.height-t._getVisualHeight(75))*e;r<0&&(r=0);var o=i.ymin*e,a=Math.ceil(o-r),s=t.options.fogColor.join(),h=n.createLinearGradient(0,r,0,o+30),u=1-30/(a+30);h.addColorStop(0,"rgba("+s+", 0)"),h.addColorStop(.3,"rgba("+s+", 0.3)"),h.addColorStop(u,"rgba("+s+", 1)"),h.addColorStop(1,"rgba("+s+", 0)"),n.beginPath(),n.fillStyle=h,n.fillRect(0,r,Math.ceil(i.getWidth())*e,Math.ceil(a+30))}},n._getAllLayerToRender=function(){return this.map._getLayers()},n.clearCanvas=function(){this.canvas&&sn.clearRect(this.context,0,0,this.canvas.width,this.canvas.height)},n._updateCanvasSize=function(){if(!this.canvas||this._containerIsCanvas)return!1;var t=this.map.getSize(),e=this.canvas,n=ae.retina?2:1;return(t.width*n!==e.width||t.height*n!==e.height)&&(e.height=n*t.height,e.width=n*t.width,e.style&&(e.style.width=t.width+"px",e.style.height=t.height+"px"),!0)},n.createCanvas=function(){this._containerIsCanvas?this.canvas=this.map._containerDOM:(this.canvas=De("canvas"),this._updateCanvasSize(),this.map._panels.canvasContainer.appendChild(this.canvas)),this.context=this.canvas.getContext("2d")},n._checkSize=function(){this.map&&!this.map.isInteracting()&&(Ve(this.map._containerDOM),this.map.checkSize())},n._setCheckSizeInterval=function(t){var e=this;clearInterval(this._resizeInterval),this._checkSizeInterval=t,this._resizeInterval=setInterval(function(){!e.map||e.map.isRemoved()?clearInterval(e._resizeInterval):e._checkSize()},this._checkSizeInterval)},n._registerEvents=function(){var t=this,e=this.map;e.options.checkSize&&!C&&"undefined"!=typeof window&&this._setCheckSizeInterval(1e3),ae.mobile||e.on("_mousemove",this._onMapMouseMove,this),e.on("_dragrotatestart _dragrotating _dragrotateend _movestart _moving _moveend _zoomstart",function(e){t._eventParam=e}),e.on("_zooming",function(n){e.getPitch()||(t._zoomMatrix=n.matrix.container),t._eventParam=n}),e.on("_zoomend",function(e){t._eventParam=e,delete t._zoomMatrix}),e.on("_spatialreferencechange",function(){t._spatialRefChanged=!0}),ae.webgl&&"undefined"!=typeof document&&ze(document,"visibilitychange",this._onVisibilitychange,this)},n._onMapMouseMove=function(t){var e=this,n=this.map;!n.isInteracting()&&n.options.hitDetect&&(this._hitDetectFrame&&T(this._hitDetectFrame),this._hitDetectFrame=S(function(){e.hitDetect(t.containerPoint)}))},n._getCanvasLayers=function(){return this.map._getLayers(function(t){return t.isCanvasRender()})},n._onVisibilitychange=function(){"visible"===document.visibilityState&&this.setToRedraw()},e}(ra);ri.registerRenderer("canvas",oa),ri.mergeOptions({fog:!0,fogColor:[233,233,233]});var aa=Object.freeze({ResourceCache:Qn,CanvasRenderer:Kn,ImageGLRenderable:Lo,MapRenderer:ra,MapCanvasRenderer:oa,Renderable:Zn,ImageLayerCanvasRenderer:Do,ImageLayerGLRenderer:ko,TileLayerCanvasRenderer:Yo,TileLayerGLRenderer:Ko,CanvasTileLayerCanvasRenderer:$o,CanvasTileLayerGLRenderer:ta,OverlayLayerCanvasRenderer:ea,VectorLayerCanvasRenderer:ia,CanvasLayerRenderer:No}),sa={_getRenderPoints:function(){return[[this._getCenter2DPoint(this.getMap().getGLZoom())],null]}};Wi.include(sa),rr.include(sa),ir.include(sa),ar.include(sa),or.include({_getRenderPoints:function(t){var e=this.getMap();if("vertex"===t){for(var n=this._trimRing(this.getShell()),i=[],r=0,o=n.length;r0&&Array.isArray(e[0])&&(e=e[0].concat(e[1]));else if("vertex"===t)if(r=[],(e=this._getPath2DPoints(this._getPrjCoordinates(),!1,i))&&e.length>0&&Array.isArray(e[0])){for(var o=0,a=e.length;o0&&Array.isArray(l[0]))for(var f,d=1,p=l.length;d0&&!f[0].equals(f[f.length-1])&&f.push(f[0]);for(var m=1,g=f.length;m0&&!l[0].equals(l[l.length-1])&&l.push(l[0]);for(var v=1,y=l.length;v0||t.getPitch()||this instanceof rr&&t.getBearing()},_getPaintParams:function(){var t=this.getMap();if(this._paintAsPath())return Ui.prototype._getPaintParams.call(this,!0);var e=this._getPrjCoordinates(),n=t._prjToPoint(e,t.getGLZoom()),i=this._getRenderSize();return[n,i.width,i.height]},_paintOn:function(){return this._paintAsPath()?sn.polygon.apply(sn,arguments):sn.ellipse.apply(sn,arguments)},_getRenderSize:function(){var t=this.getMap(),e=t.getGLZoom(),n=this._getPrjExtent(),i=t._prjToPoint(n.getMin(),e),r=t._prjToPoint(n.getMax(),e);return new le(Math.abs(r.x-i.x)/2,Math.abs(r.y-i.y)/2)}};rr.include(ua),ir.include(ua),or.include({_getPaintParams:function(){var t=this.getMap().getGLZoom(),e=this._getPrjShell();return[this._getPath2DPoints(e,!1,t)]},_paintOn:sn.polygon}),ar.include(ua,{_redrawWhenPitch:function(){return!0},_getPaintParams:function(){if(this._paintAsPath())return Ui.prototype._getPaintParams.call(this,!0);var t=this.getMap();return[t._prjToPoint(this._getPrjCoordinates(),t.getGLZoom()),this._getRenderSize().width,[this.getStartAngle(),this.getEndAngle()]]},_paintOn:function(){if(this._paintAsPath())return sn.polygon.apply(sn,arguments);var t=this.getMap().getBearing(),e=arguments;return t&&(e[3]=e[3].slice(0),e[3][0]+=t,e[3][1]+=t),sn.sector.apply(sn,e)}}),Hi.include({_paintAsPath:function(){return!0}}),qi.include({arrowStyles:{classic:[3,4]},_getArrowShape:function(t,e,n,i,r){r||(r=0);var o,a=n*i[0],s=n*i[1]+r,h=a/2+r;(o=e.nextCtrlPoint||e.prevCtrlPoint?e.prevCtrlPoint?e.sub(new ce(e.prevCtrlPoint)):e.sub(new ce(e.nextCtrlPoint)):e.sub(t))._unit();var u=e.sub(o.multi(s));o._perp();var c=u.add(o.multi(h));return o._multi(-1),[c,e,u.add(o.multi(h)),c]},_getPaintParams:function(){var t=this._getPrjCoordinates();return[this._getPath2DPoints(t,!1,this.getMap().getGLZoom())]},_paintOn:function(t,e,n,i,r){this.options.smoothness?sn.paintSmoothLine(t,e,n,this.options.smoothness,!1,this._animIdx,this._animTailRatio):sn.path(t,e,n,null,r),this._paintArrow(t,e,n)},_getArrowPlacement:function(){return this.options.arrowPlacement},_getArrowStyle:function(){var t=this.options.arrowStyle;return t?Array.isArray(t)?t:this.arrowStyles[t]:null},_getArrows:function(t,e,n){var i=this._getArrowStyle();if(!i||t.length<2)return[];for(var r=t.length>0&&Array.isArray(t[0])?t:[t],o=this._getArrowPlacement(),a=[],s=this.getMap(),h=s.coordToContainerPoint(this.getFirstCoordinate()),u=s.coordToContainerPoint(this.getLastCoordinate()),c=r.length-1;c>=0;c--)("vertex-first"===o||"vertex-firstlast"===o&&r[c][0].closeTo(h,.01))&&a.push(this._getArrowShape(r[c][1],r[c][0],e,i,n)),"vertex-last"===o||"vertex-firstlast"===o&&r[c][r[c].length-1].closeTo(u,.01)?a.push(this._getArrowShape(r[c][r[c].length-2],r[c][r[c].length-1],e,i,n)):"point"===o&&this._getArrowPoints(a,r[c],e,i,n);return a},_getArrowPoints:function(t,e,n,i,r){for(var o=0,a=e.length-1;o=0;o--)t.fillStyle=t.strokeStyle,sn.polygon(t,r[o],n,n)}}}),Ui.include({_getPaintParams:function(t){var e=this.getMap().getGLZoom(),n=this._getPrjShell(),i=this._getPath2DPoints(n,t,e),r=i.length>0&&Array.isArray(i[0]);r&&(i=[[i[0]],[i[1]]]);var o=this._getPrjHoles(),a=[];if(o&&o.length>0)for(var s=0;s"+r+""};t.exports=function(t,e){var n={};n[t]=e(s),i(i.P+i.F*r(function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}),"String",n)}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var i=n(50),r=n(25);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(51),r=n(35),o=n(17),a=n(24),s=n(16),h=n(99),u=Object.getOwnPropertyDescriptor;e.f=n(6)?u:function(t,e){if(t=o(t),e=a(e,!0),h)try{return u(t,e)}catch(t){}if(s(t,e))return r(!i.f.call(t,e),t[e])}},function(t,e,n){var i=n(16),r=n(10),o=n(70)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e,n){var i=n(12);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){"use strict";var i=n(3);t.exports=function(t,e){return!!t&&i(function(){e?t.call(null,function(){},1):t.call(null)})}},function(t,e,n){var i=n(4);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(0),r=n(20),o=n(3);t.exports=function(t,e){var n=(r.Object||{})[t]||Object[t],a={};a[t]=e(n),i(i.S+i.F*o(function(){n(1)}),"Object",a)}},function(t,e,n){var i=n(21),r=n(50),o=n(10),a=n(8),s=n(87);t.exports=function(t,e){var n=1==t,h=2==t,u=3==t,c=4==t,l=6==t,f=5==t||l,d=e||s;return function(e,s,p){for(var m,g,v=o(e),y=r(v),_=i(s,p,3),x=a(y.length),w=0,b=n?d(e,x):h?d(e,0):void 0;x>w;w++)if((f||w in y)&&(g=_(m=y[w],w,v),t))if(n)b[w]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return w;case 2:b.push(m)}else if(c)return!1;return l?-1:u||c?c:b}}},function(t,e,n){"use strict";if(n(6)){var i=n(33),r=n(2),o=n(3),a=n(0),s=n(64),h=n(93),u=n(21),c=n(42),l=n(35),f=n(13),d=n(44),p=n(26),m=n(8),g=n(125),v=n(38),y=n(24),_=n(16),x=n(52),w=n(4),b=n(10),M=n(84),E=n(39),S=n(19),T=n(40).f,C=n(86),P=n(36),A=n(5),L=n(28),R=n(54),O=n(61),I=n(89),D=n(48),k=n(58),N=n(41),z=n(88),F=n(115),B=n(7),j=n(18),G=B.f,H=j.f,U=r.RangeError,V=r.TypeError,W=r.Uint8Array,Z=Array.prototype,q=h.ArrayBuffer,X=h.DataView,Y=L(0),J=L(2),K=L(3),Q=L(4),$=L(5),tt=L(6),et=R(!0),nt=R(!1),it=I.values,rt=I.keys,ot=I.entries,at=Z.lastIndexOf,st=Z.reduce,ht=Z.reduceRight,ut=Z.join,ct=Z.sort,lt=Z.slice,ft=Z.toString,dt=Z.toLocaleString,pt=A("iterator"),mt=A("toStringTag"),gt=P("typed_constructor"),vt=P("def_constructor"),yt=s.CONSTR,_t=s.TYPED,xt=s.VIEW,wt=L(1,function(t,e){return Tt(O(t,t[vt]),e)}),bt=o(function(){return 1===new W(new Uint16Array([1]).buffer)[0]}),Mt=!!W&&!!W.prototype.set&&o(function(){new W(1).set({})}),Et=function(t,e){var n=p(t);if(n<0||n%e)throw U("Wrong offset!");return n},St=function(t){if(w(t)&&_t in t)return t;throw V(t+" is not a typed array!")},Tt=function(t,e){if(!(w(t)&> in t))throw V("It is not a typed array constructor!");return new t(e)},Ct=function(t,e){return Pt(O(t,t[vt]),e)},Pt=function(t,e){for(var n=0,i=e.length,r=Tt(t,i);i>n;)r[n]=e[n++];return r},At=function(t,e,n){G(t,e,{get:function(){return this._d[n]}})},Lt=function(t){var e,n,i,r,o,a,s=b(t),h=arguments.length,c=h>1?arguments[1]:void 0,l=void 0!==c,f=C(s);if(void 0!=f&&!M(f)){for(a=f.call(s),i=[],e=0;!(o=a.next()).done;e++)i.push(o.value);s=i}for(l&&h>2&&(c=u(c,arguments[2],2)),e=0,n=m(s.length),r=Tt(this,n);n>e;e++)r[e]=l?c(s[e],e):s[e];return r},Rt=function(){for(var t=0,e=arguments.length,n=Tt(this,e);e>t;)n[t]=arguments[t++];return n},Ot=!!W&&o(function(){dt.call(new W(1))}),It=function(){return dt.apply(Ot?lt.call(St(this)):St(this),arguments)},Dt={copyWithin:function(t,e){return F.call(St(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return Q(St(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return z.apply(St(this),arguments)},filter:function(t){return Ct(this,J(St(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return $(St(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return tt(St(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){Y(St(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return nt(St(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return et(St(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return ut.apply(St(this),arguments)},lastIndexOf:function(t){return at.apply(St(this),arguments)},map:function(t){return wt(St(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return st.apply(St(this),arguments)},reduceRight:function(t){return ht.apply(St(this),arguments)},reverse:function(){for(var t,e=St(this).length,n=Math.floor(e/2),i=0;i1?arguments[1]:void 0)},sort:function(t){return ct.call(St(this),t)},subarray:function(t,e){var n=St(this),i=n.length,r=v(t,i);return new(O(n,n[vt]))(n.buffer,n.byteOffset+r*n.BYTES_PER_ELEMENT,m((void 0===e?i:v(e,i))-r))}},kt=function(t,e){return Ct(this,lt.call(St(this),t,e))},Nt=function(t){St(this);var e=Et(arguments[1],1),n=this.length,i=b(t),r=m(i.length),o=0;if(r+e>n)throw U("Wrong length!");for(;o255?255:255&i),r.v[d](n*e+r.o,i,bt)}(this,n,t)},enumerable:!0})};_?(p=n(function(t,n,i,r){c(t,p,u,"_d");var o,a,s,h,l=0,d=0;if(w(n)){if(!(n instanceof q||"ArrayBuffer"==(h=x(n))||"SharedArrayBuffer"==h))return _t in n?Pt(p,n):Lt.call(p,n);o=n,d=Et(i,e);var v=n.byteLength;if(void 0===r){if(v%e)throw U("Wrong length!");if((a=v-d)<0)throw U("Wrong length!")}else if((a=m(r)*e)+d>v)throw U("Wrong length!");s=a/e}else s=g(n),o=new q(a=s*e);for(f(t,"_d",{b:o,o:d,l:a,e:s,v:new X(o)});ldocument.F=Object<\/script>"),t.close(),h=t.F;i--;)delete h.prototype[o[i]];return h()};t.exports=Object.create||function(t,e){var n;return null!==t?(s.prototype=i(t),n=new s,s.prototype=null,n[a]=t):n=h(),void 0===e?n:r(n,e)}},function(t,e,n){var i=n(101),r=n(71).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},function(t,e,n){"use strict";var i=n(2),r=n(7),o=n(6),a=n(5)("species");t.exports=function(t){var e=i[t];o&&e&&!e[a]&&r.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e){t.exports=function(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var i=n(21),r=n(113),o=n(84),a=n(1),s=n(8),h=n(86),u={},c={};(e=t.exports=function(t,e,n,l,f){var d,p,m,g,v=f?function(){return t}:h(t),y=i(n,l,e?2:1),_=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(o(v)){for(d=s(t.length);d>_;_++)if((g=e?y(a(p=t[_])[0],p[1]):y(t[_]))===u||g===c)return g}else for(m=v.call(t);!(p=m.next()).done;)if((g=r(m,y,p.value,e))===u||g===c)return g}).BREAK=u,e.RETURN=c},function(t,e,n){var i=n(14);t.exports=function(t,e,n){for(var r in e)i(t,r,e[r],n);return t}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.threeLayer=e.vector=void 0;var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(11)),r=n(349),o=n(350),a=l(n(355)),s=n(134),h=n(135),u=n(133),c=l(n(96));function l(t){return t&&t.__esModule?t:{default:t}}var f=new i.CanvasTileLayer("tile",{urlTemplate:"https://{s}.data.osmbuildings.org/0.2/anonymous/tile/{z}/{x}/{y}.json",subdomains:["a","b","c","d"],forceRenderOnMoving:!0,forceRenderOnZooming:!0,forceRenderOnRotating:!0,repeatWorld:!1,maxAvailableZoom:15}),d=new r.ThreeLayer("t",{forceRenderOnMoving:!0,forceRenderOnZooming:!0,forceRenderOnRotating:!0});d.prepareToDraw=a.default,t.threeLayer=d;var p=new i.VectorLayer("vector",{enableAltitude:!0,altitudeProperty:"altitude",forceRenderOnMoving:!0,forceRenderOnZooming:!0,forceRenderOnRotating:!0});function m(){for(var t=f.getTiles().tileGrids,e=0;e=15);e++);var n=t[e].zoom,i=t[e].tiles,r=i[0].x,o=i[0].x,a=i[0].y,s=i[0].y;i.forEach(function(t){t.x>r&&(r=t.x),t.y>a&&(a=t.y),t.xc;)if((s=h[c++])!=s)return!0}else for(;u>c;c++)if((t||c in h)&&h[c]===n)return t||c||0;return!t&&-1}}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var i=n(22);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){var i=n(4),r=n(22),o=n(5)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==r(t))}},function(t,e,n){var i=n(5)("iterator"),r=!1;try{var o=[7][i]();o.return=function(){r=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var o=[7],a=o[i]();a.next=function(){return{done:n=!0}},o[i]=function(){return a},t(o)}catch(t){}return n}},function(t,e,n){"use strict";var i=n(1);t.exports=function(){var t=i(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";var i=n(13),r=n(14),o=n(3),a=n(25),s=n(5);t.exports=function(t,e,n){var h=s(t),u=n(a,h,""[t]),c=u[0],l=u[1];o(function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})&&(r(String.prototype,t,c),i(RegExp.prototype,h,2==e?function(t,e){return l.call(t,this,e)}:function(t){return l.call(t,this)}))}},function(t,e,n){var i=n(1),r=n(12),o=n(5)("species");t.exports=function(t,e){var n,a=i(t).constructor;return void 0===a||void 0==(n=i(a)[o])?e:r(n)}},function(t,e,n){var i=n(2).navigator;t.exports=i&&i.userAgent||""},function(t,e,n){"use strict";var i=n(2),r=n(0),o=n(14),a=n(44),s=n(32),h=n(43),u=n(42),c=n(4),l=n(3),f=n(58),d=n(46),p=n(75);t.exports=function(t,e,n,m,g,v){var y=i[t],_=y,x=g?"set":"add",w=_&&_.prototype,b={},M=function(t){var e=w[t];o(w,t,"delete"==t?function(t){return!(v&&!c(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(v&&!c(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return v&&!c(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,n){return e.call(this,0===t?0:t,n),this})};if("function"==typeof _&&(v||w.forEach&&!l(function(){(new _).entries().next()}))){var E=new _,S=E[x](v?{}:-0,1)!=E,T=l(function(){E.has(1)}),C=f(function(t){new _(t)}),P=!v&&l(function(){for(var t=new _,e=5;e--;)t[x](e,e);return!t.has(-0)});C||((_=e(function(e,n){u(e,_,t);var i=p(new y,e,_);return void 0!=n&&h(n,g,i[x],i),i})).prototype=w,w.constructor=_),(T||P)&&(M("delete"),M("has"),g&&M("get")),(P||S)&&M(x),v&&w.clear&&delete w.clear}else _=m.getConstructor(e,t,g,x),a(_.prototype,n),s.NEED=!0;return d(_,t),b[t]=_,r(r.G+r.W+r.F*(_!=y),b),v||m.setStrong(_,t,g),_}},function(t,e,n){for(var i,r=n(2),o=n(13),a=n(36),s=a("typed_array"),h=a("view"),u=!(!r.ArrayBuffer||!r.DataView),c=u,l=0,f="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(i=r[f[l++]])?(o(i.prototype,s,!0),o(i.prototype,h,!0)):c=!1;t.exports={ABV:u,CONSTR:c,TYPED:s,VIEW:h}},function(t,e,n){"use strict";t.exports=n(33)||!n(3)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete n(2)[t]})},function(t,e,n){"use strict";var i=n(0);t.exports=function(t){i(i.S,t,{of:function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,n){"use strict";var i=n(0),r=n(12),o=n(21),a=n(43);t.exports=function(t){i(i.S,t,{from:function(t){var e,n,i,s,h=arguments[1];return r(this),(e=void 0!==h)&&r(h),void 0==t?new this:(n=[],e?(i=0,s=o(h,arguments[2],2),a(t,!1,function(t){n.push(s(t,i++))})):a(t,!1,n.push,n),new this(n))}})}},function(t,e,n){var i=n(4),r=n(2).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e,n){var i=n(2),r=n(20),o=n(33),a=n(100),s=n(7).f;t.exports=function(t){var e=r.Symbol||(r.Symbol=o?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},function(t,e,n){var i=n(53)("keys"),r=n(36);t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(2).document;t.exports=i&&i.documentElement},function(t,e,n){var i=n(4),r=n(1),o=function(t,e){if(r(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{(i=n(21)(Function.call,n(18).f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return o(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:o}},function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(t,e,n){var i=n(4),r=n(73).set;t.exports=function(t,e,n){var o,a=e.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&i(o)&&r&&r(t,o),t}},function(t,e,n){"use strict";var i=n(26),r=n(25);t.exports=function(t){var e=String(r(this)),n="",o=i(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,e){var n=Math.expm1;t.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}:n},function(t,e,n){var i=n(26),r=n(25);t.exports=function(t){return function(e,n){var o,a,s=String(r(e)),h=i(n),u=s.length;return h<0||h>=u?t?"":void 0:(o=s.charCodeAt(h))<55296||o>56319||h+1===u||(a=s.charCodeAt(h+1))<56320||a>57343?t?s.charAt(h):o:t?s.slice(h,h+2):a-56320+(o-55296<<10)+65536}}},function(t,e,n){"use strict";var i=n(33),r=n(0),o=n(14),a=n(13),s=n(48),h=n(81),u=n(46),c=n(19),l=n(5)("iterator"),f=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,p,m,g,v){h(n,e,p);var y,_,x,w=function(t){if(!f&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},b=e+" Iterator",M="values"==m,E=!1,S=t.prototype,T=S[l]||S["@@iterator"]||m&&S[m],C=T||w(m),P=m?M?w("entries"):C:void 0,A="Array"==e&&S.entries||T;if(A&&(x=c(A.call(new t)))!==Object.prototype&&x.next&&(u(x,b,!0),i||"function"==typeof x[l]||a(x,l,d)),M&&T&&"values"!==T.name&&(E=!0,C=function(){return T.call(this)}),i&&!v||!f&&!E&&S[l]||a(S,l,C),s[e]=C,s[b]=d,m)if(y={values:M?C:w("values"),keys:g?C:w("keys"),entries:P},v)for(_ in y)_ in S||o(S,_,y[_]);else r(r.P+r.F*(f||E),e,y);return y}},function(t,e,n){"use strict";var i=n(39),r=n(35),o=n(46),a={};n(13)(a,n(5)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(a,{next:r(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var i=n(57),r=n(25);t.exports=function(t,e,n){if(i(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(r(t))}},function(t,e,n){var i=n(5)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[i]=!1,!"/./"[t](e)}catch(t){}}return!0}},function(t,e,n){var i=n(48),r=n(5)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||o[r]===t)}},function(t,e,n){"use strict";var i=n(7),r=n(35);t.exports=function(t,e,n){e in t?i.f(t,e,r(0,n)):t[e]=n}},function(t,e,n){var i=n(52),r=n(5)("iterator"),o=n(48);t.exports=n(20).getIteratorMethod=function(t){if(void 0!=t)return t[r]||t["@@iterator"]||o[i(t)]}},function(t,e,n){var i=n(232);t.exports=function(t,e){return new(i(t))(e)}},function(t,e,n){"use strict";var i=n(10),r=n(38),o=n(8);t.exports=function(t){for(var e=i(this),n=o(e.length),a=arguments.length,s=r(a>1?arguments[1]:void 0,n),h=a>2?arguments[2]:void 0,u=void 0===h?n:r(h,n);u>s;)e[s++]=t;return e}},function(t,e,n){"use strict";var i=n(34),r=n(116),o=n(48),a=n(17);t.exports=n(80)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,r(1)):r(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){var i,r,o,a=n(21),s=n(106),h=n(72),u=n(68),c=n(2),l=c.process,f=c.setImmediate,d=c.clearImmediate,p=c.MessageChannel,m=c.Dispatch,g=0,v={},y=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},_=function(t){y.call(t.data)};f&&d||(f=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return v[++g]=function(){s("function"==typeof t?t:Function(t),e)},i(g),g},d=function(t){delete v[t]},"process"==n(22)(l)?i=function(t){l.nextTick(a(y,t,1))}:m&&m.now?i=function(t){m.now(a(y,t,1))}:p?(o=(r=new p).port2,r.port1.onmessage=_,i=a(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(i=function(t){c.postMessage(t+"","*")},c.addEventListener("message",_,!1)):i="onreadystatechange"in u("script")?function(t){h.appendChild(u("script")).onreadystatechange=function(){h.removeChild(this),y.call(t)}}:function(t){setTimeout(a(y,t,1),0)}),t.exports={set:f,clear:d}},function(t,e,n){var i=n(2),r=n(90).set,o=i.MutationObserver||i.WebKitMutationObserver,a=i.process,s=i.Promise,h="process"==n(22)(a);t.exports=function(){var t,e,n,u=function(){var i,r;for(h&&(i=a.domain)&&i.exit();t;){r=t.fn,t=t.next;try{r()}catch(i){throw t?n():e=void 0,i}}e=void 0,i&&i.enter()};if(h)n=function(){a.nextTick(u)};else if(!o||i.navigator&&i.navigator.standalone)if(s&&s.resolve){var c=s.resolve(void 0);n=function(){c.then(u)}}else n=function(){r.call(i,u)};else{var l=!0,f=document.createTextNode("");new o(u).observe(f,{characterData:!0}),n=function(){f.data=l=!l}}return function(i){var r={fn:i,next:void 0};e&&(e.next=r),t||(t=r,n()),e=r}}},function(t,e,n){"use strict";var i=n(12);t.exports.f=function(t){return new function(t){var e,n;this.promise=new t(function(t,i){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=i}),this.resolve=i(e),this.reject=i(n)}(t)}},function(t,e,n){"use strict";var i=n(2),r=n(6),o=n(33),a=n(64),s=n(13),h=n(44),u=n(3),c=n(42),l=n(26),f=n(8),d=n(125),p=n(40).f,m=n(7).f,g=n(88),v=n(46),y="prototype",_="Wrong index!",x=i.ArrayBuffer,w=i.DataView,b=i.Math,M=i.RangeError,E=i.Infinity,S=x,T=b.abs,C=b.pow,P=b.floor,A=b.log,L=b.LN2,R=r?"_b":"buffer",O=r?"_l":"byteLength",I=r?"_o":"byteOffset";function D(t,e,n){var i,r,o,a=new Array(n),s=8*n-e-1,h=(1<>1,c=23===e?C(2,-24)-C(2,-77):0,l=0,f=t<0||0===t&&1/t<0?1:0;for((t=T(t))!=t||t===E?(r=t!=t?1:0,i=h):(i=P(A(t)/L),t*(o=C(2,-i))<1&&(i--,o*=2),(t+=i+u>=1?c/o:c*C(2,1-u))*o>=2&&(i++,o/=2),i+u>=h?(r=0,i=h):i+u>=1?(r=(t*o-1)*C(2,e),i+=u):(r=t*C(2,u-1)*C(2,e),i=0));e>=8;a[l++]=255&r,r/=256,e-=8);for(i=i<0;a[l++]=255&i,i/=256,s-=8);return a[--l]|=128*f,a}function k(t,e,n){var i,r=8*n-e-1,o=(1<>1,s=r-7,h=n-1,u=t[h--],c=127&u;for(u>>=7;s>0;c=256*c+t[h],h--,s-=8);for(i=c&(1<<-s)-1,c>>=-s,s+=e;s>0;i=256*i+t[h],h--,s-=8);if(0===c)c=1-a;else{if(c===o)return i?NaN:u?-E:E;i+=C(2,e),c-=a}return(u?-1:1)*i*C(2,c-e)}function N(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function z(t){return[255&t]}function F(t){return[255&t,t>>8&255]}function B(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function j(t){return D(t,52,8)}function G(t){return D(t,23,4)}function H(t,e,n){m(t[y],e,{get:function(){return this[n]}})}function U(t,e,n,i){var r=d(+n);if(r+e>t[O])throw M(_);var o=t[R]._b,a=r+t[I],s=o.slice(a,a+e);return i?s:s.reverse()}function V(t,e,n,i,r,o){var a=d(+n);if(a+e>t[O])throw M(_);for(var s=t[R]._b,h=a+t[I],u=i(+r),c=0;cX;)(W=q[X++])in x||s(x,W,S[W]);o||(Z.constructor=x)}var Y=new w(new x(2)),J=w[y].setInt8;Y.setInt8(0,2147483648),Y.setInt8(1,2147483649),!Y.getInt8(0)&&Y.getInt8(1)||h(w[y],{setInt8:function(t,e){J.call(this,t,e<<24>>24)},setUint8:function(t,e){J.call(this,t,e<<24>>24)}},!0)}else x=function(t){c(this,x,"ArrayBuffer");var e=d(t);this._b=g.call(new Array(e),0),this[O]=e},w=function(t,e,n){c(this,w,"DataView"),c(t,x,"DataView");var i=t[O],r=l(e);if(r<0||r>i)throw M("Wrong offset!");if(r+(n=void 0===n?i-r:f(n))>i)throw M("Wrong length!");this[R]=t,this[I]=r,this[O]=n},r&&(H(x,"byteLength","_l"),H(w,"buffer","_b"),H(w,"byteLength","_l"),H(w,"byteOffset","_o")),h(w[y],{getInt8:function(t){return U(this,1,t)[0]<<24>>24},getUint8:function(t){return U(this,1,t)[0]},getInt16:function(t){var e=U(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=U(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return N(U(this,4,t,arguments[1]))},getUint32:function(t){return N(U(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return k(U(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return k(U(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){V(this,1,t,z,e)},setUint8:function(t,e){V(this,1,t,z,e)},setInt16:function(t,e){V(this,2,t,F,e,arguments[2])},setUint16:function(t,e){V(this,2,t,F,e,arguments[2])},setInt32:function(t,e){V(this,4,t,B,e,arguments[2])},setUint32:function(t,e){V(this,4,t,B,e,arguments[2])},setFloat32:function(t,e){V(this,4,t,G,e,arguments[2])},setFloat64:function(t,e){V(this,8,t,j,e,arguments[2])}});v(x,"ArrayBuffer"),v(w,"DataView"),s(w[y],a.VIEW,!0),e.ArrayBuffer=x,e.DataView=w},function(t,e,n){(t.exports=n(343)(!1)).push([t.i,"* {\r\n margin: 0;\r\n padding: 0;\r\n}\r\n\r\nhtml {\r\n --width: 100%;\r\n --height: 100%;\r\n}\r\nhtml, body {\r\n width: var(--width);\r\n height: var(--height)\r\n}\r\n#map {\r\n width: var(--width);\r\n height: calc(var(--height));\r\n overflow: hidden;\r\n}\r\n\r\n#test {\r\n width: var(--width);\r\n height: calc(var(--height) / 2);\r\n overflow: hidden;\r\n}\r\n\r\n#map {\r\n background: #ccc;\r\n}\r\n\r\n.point {\r\n width: 150px;\r\n font-size: 12px;\r\n text-align: center;\r\n margin-bottom: 10px;\r\n}\r\n\r\n#theme {\r\n position: absolute;\r\n right: 0;\r\n top: 0;\r\n padding: 5px;\r\n}",""])},function(t,e,n){"use strict";function i(){var t={},e=location.search.substr(1);return(e=e.split("&")).forEach(function(e){var n=e.indexOf("=");~n&&(t[e.substring(0,n)]=Number(e.substr(n+1)))}),t.lat&&t.lon||(t.lat=22.252832648721693,t.lon=113.57727389730132),t.zoom=t.zoom||16,t.pitch=t.pitch||60,t.bearing=t.bearing||60,t}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){var t=i();return function(){var e=[],n=map.getCenter();for(var i in t.lon=n.x,t.lat=n.y,t.zoom=map.getZoom(),t.pitch=map.getPitch(),t.bearing=map.getBearing(),t)e.push(i+"="+t[i]);var r=location.pathname+"?"+e.join("&");history.pushState({url:r,title:document.title},document.title,r)}}();e.mapGoto=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;map.animateTo(t,{duration:e})},e.analysis=i,e.listStatus=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={stepTotal:10,levelHeight:2,defaultHeight:12,criticalZoom:15,manyOffset:2}},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var h,u=[],c=!1,l=-1;function f(){c&&h&&(c=!1,h.length?u=h.concat(u):l=-1,u.length&&d())}function d(){if(!c){var t=s(f);c=!0;for(var e=u.length;e;){for(h=u,u=[];++l1)for(var n=1;n=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(137),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(31))},function(t,e,n){t.exports=!n(6)&&!n(3)(function(){return 7!=Object.defineProperty(n(68)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){e.f=n(5)},function(t,e,n){var i=n(16),r=n(17),o=n(54)(!1),a=n(70)("IE_PROTO");t.exports=function(t,e){var n,s=r(t),h=0,u=[];for(n in s)n!=a&&i(s,n)&&u.push(n);for(;e.length>h;)i(s,n=e[h++])&&(~o(u,n)||u.push(n));return u}},function(t,e,n){var i=n(7),r=n(1),o=n(37);t.exports=n(6)?Object.defineProperties:function(t,e){r(t);for(var n,a=o(e),s=a.length,h=0;s>h;)i.f(t,n=a[h++],e[n]);return t}},function(t,e,n){var i=n(17),r=n(40).f,o={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==o.call(t)?function(t){try{return r(t)}catch(t){return a.slice()}}(t):r(i(t))}},function(t,e,n){"use strict";var i=n(37),r=n(55),o=n(51),a=n(10),s=n(50),h=Object.assign;t.exports=!h||n(3)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=h({},t)[n]||Object.keys(h({},e)).join("")!=i})?function(t,e){for(var n=a(t),h=arguments.length,u=1,c=r.f,l=o.f;h>u;)for(var f,d=s(arguments[u++]),p=c?i(d).concat(c(d)):i(d),m=p.length,g=0;m>g;)l.call(d,f=p[g++])&&(n[f]=d[f]);return n}:h},function(t,e,n){"use strict";var i=n(12),r=n(4),o=n(106),a=[].slice,s={};t.exports=Function.bind||function(t){var e=i(this),n=a.call(arguments,1),h=function(){var i=n.concat(a.call(arguments));return this instanceof h?function(t,e,n){if(!(e in s)){for(var i=[],r=0;r>>0||(a.test(n)?16:10))}:i},function(t,e,n){var i=n(2).parseFloat,r=n(47).trim;t.exports=1/i(n(74)+"-0")!=-1/0?function(t){var e=r(String(t),3),n=i(e);return 0===n&&"-"==e.charAt(0)?-0:n}:i},function(t,e,n){var i=n(22);t.exports=function(t,e){if("number"!=typeof t&&"Number"!=i(t))throw TypeError(e);return+t}},function(t,e,n){var i=n(4),r=Math.floor;t.exports=function(t){return!i(t)&&isFinite(t)&&r(t)===t}},function(t,e){t.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,e,n){var i=n(77),r=Math.pow,o=r(2,-52),a=r(2,-23),s=r(2,127)*(2-a),h=r(2,-126);t.exports=Math.fround||function(t){var e,n,r=Math.abs(t),u=i(t);return rs||n!=n?u*(1/0):u*n}},function(t,e,n){var i=n(1);t.exports=function(t,e,n,r){try{return r?e(i(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&i(o.call(t)),e}}},function(t,e,n){var i=n(12),r=n(10),o=n(50),a=n(8);t.exports=function(t,e,n,s,h){i(e);var u=r(t),c=o(u),l=a(u.length),f=h?l-1:0,d=h?-1:1;if(n<2)for(;;){if(f in c){s=c[f],f+=d;break}if(f+=d,h?f<0:l<=f)throw TypeError("Reduce of empty array with no initial value")}for(;h?f>=0:l>f;f+=d)f in c&&(s=e(s,c[f],f,u));return s}},function(t,e,n){"use strict";var i=n(10),r=n(38),o=n(8);t.exports=[].copyWithin||function(t,e){var n=i(this),a=o(n.length),s=r(t,a),h=r(e,a),u=arguments.length>2?arguments[2]:void 0,c=Math.min((void 0===u?a:r(u,a))-h,a-s),l=1;for(h0;)h in n?n[s]=n[h]:delete n[s],s+=l,h+=l;return n}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){n(6)&&"g"!=/./g.flags&&n(7).f(RegExp.prototype,"flags",{configurable:!0,get:n(59)})},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var i=n(1),r=n(4),o=n(92);t.exports=function(t,e){if(i(t),r(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";var i=n(121),r=n(49);t.exports=n(63)("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=i.getEntry(r(this,"Map"),t);return e&&e.v},set:function(t,e){return i.def(r(this,"Map"),0===t?0:t,e)}},i,!0)},function(t,e,n){"use strict";var i=n(7).f,r=n(39),o=n(44),a=n(21),s=n(42),h=n(43),u=n(80),c=n(116),l=n(41),f=n(6),d=n(32).fastKey,p=n(49),m=f?"_s":"size",g=function(t,e){var n,i=d(e);if("F"!==i)return t._i[i];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,u){var c=t(function(t,i){s(t,c,e,"_i"),t._t=e,t._i=r(null),t._f=void 0,t._l=void 0,t[m]=0,void 0!=i&&h(i,n,t[u],t)});return o(c.prototype,{clear:function(){for(var t=p(this,e),n=t._i,i=t._f;i;i=i.n)i.r=!0,i.p&&(i.p=i.p.n=void 0),delete n[i.i];t._f=t._l=void 0,t[m]=0},delete:function(t){var n=p(this,e),i=g(n,t);if(i){var r=i.n,o=i.p;delete n._i[i.i],i.r=!0,o&&(o.n=r),r&&(r.p=o),n._f==i&&(n._f=r),n._l==i&&(n._l=o),n[m]--}return!!i},forEach:function(t){p(this,e);for(var n,i=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(i(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!g(p(this,e),t)}}),f&&i(c.prototype,"size",{get:function(){return p(this,e)[m]}}),c},def:function(t,e,n){var i,r,o=g(t,e);return o?o.v=n:(t._l=o={i:r=d(e,!0),k:e,v:n,p:i=t._l,n:void 0,r:!1},t._f||(t._f=o),i&&(i.n=o),t[m]++,"F"!==r&&(t._i[r]=o)),t},getEntry:g,setStrong:function(t,e,n){u(t,e,function(t,n){this._t=p(t,e),this._k=n,this._l=void 0},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?c(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,c(1))},n?"entries":"values",!n,!0),l(e)}}},function(t,e,n){"use strict";var i=n(121),r=n(49);t.exports=n(63)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return i.def(r(this,"Set"),t=0===t?0:t,t)}},i)},function(t,e,n){"use strict";var i,r=n(28)(0),o=n(14),a=n(32),s=n(104),h=n(124),u=n(4),c=n(3),l=n(49),f=a.getWeak,d=Object.isExtensible,p=h.ufstore,m={},g=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(t){if(u(t)){var e=f(t);return!0===e?p(l(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return h.def(l(this,"WeakMap"),t,e)}},y=t.exports=n(63)("WeakMap",g,v,h,!0,!0);c(function(){return 7!=(new y).set((Object.freeze||Object)(m),7).get(m)})&&(s((i=h.getConstructor(g,"WeakMap")).prototype,v),a.NEED=!0,r(["delete","has","get","set"],function(t){var e=y.prototype,n=e[t];o(e,t,function(e,r){if(u(e)&&!d(e)){this._f||(this._f=new i);var o=this._f[t](e,r);return"set"==t?this:o}return n.call(this,e,r)})}))},function(t,e,n){"use strict";var i=n(44),r=n(32).getWeak,o=n(1),a=n(4),s=n(42),h=n(43),u=n(28),c=n(16),l=n(49),f=u(5),d=u(6),p=0,m=function(t){return t._l||(t._l=new g)},g=function(){this.a=[]},v=function(t,e){return f(t.a,function(t){return t[0]===e})};g.prototype={get:function(t){var e=v(this,t);if(e)return e[1]},has:function(t){return!!v(this,t)},set:function(t,e){var n=v(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=d(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,o){var u=t(function(t,i){s(t,u,e,"_i"),t._t=e,t._i=p++,t._l=void 0,void 0!=i&&h(i,n,t[o],t)});return i(u.prototype,{delete:function(t){if(!a(t))return!1;var n=r(t);return!0===n?m(l(this,e)).delete(t):n&&c(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=r(t);return!0===n?m(l(this,e)).has(t):n&&c(n,this._i)}}),u},def:function(t,e,n){var i=r(o(e),!0);return!0===i?m(t).set(e,n):i[t._i]=n,t},ufstore:m}},function(t,e,n){var i=n(26),r=n(8);t.exports=function(t){if(void 0===t)return 0;var e=i(t),n=r(e);if(e!==n)throw RangeError("Wrong length!");return n}},function(t,e,n){var i=n(40),r=n(55),o=n(1),a=n(2).Reflect;t.exports=a&&a.ownKeys||function(t){var e=i.f(o(t)),n=r.f;return n?e.concat(n(t)):e}},function(t,e,n){"use strict";var i=n(56),r=n(4),o=n(8),a=n(21),s=n(5)("isConcatSpreadable");t.exports=function t(e,n,h,u,c,l,f,d){for(var p,m,g=c,v=0,y=!!f&&a(f,d,3);v0)g=t(e,n,p,o(p.length),g,l-1)-1;else{if(g>=9007199254740991)throw TypeError();e[g]=p}g++}v++}return g}},function(t,e,n){var i=n(8),r=n(76),o=n(25);t.exports=function(t,e,n,a){var s=String(o(t)),h=s.length,u=void 0===n?" ":String(n),c=i(e);if(c<=h||""==u)return s;var l=c-h,f=r.call(u,Math.ceil(l/u.length));return f.length>l&&(f=f.slice(0,l)),a?f+s:s+f}},function(t,e,n){var i=n(37),r=n(17),o=n(51).f;t.exports=function(t){return function(e){for(var n,a=r(e),s=i(a),h=s.length,u=0,c=[];h>u;)o.call(a,n=s[u++])&&c.push(t?[n,a[n]]:a[n]);return c}}},function(t,e,n){var i=n(52),r=n(131);t.exports=function(t){return function(){if(i(this)!=t)throw TypeError(t+"#toJSON isn't generic");return r(this)}}},function(t,e,n){var i=n(43);t.exports=function(t,e){var n=[];return i(t,!1,n.push,n,e),n}},function(t,e){t.exports=Math.scale||function(t,e,n,i,r){return 0===arguments.length||t!=t||e!=e||n!=n||i!=i||r!=r?NaN:t===1/0||t===-1/0?t:(t-e)*(r-i)/(n-e)+i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.singleDelay=function(t,e){var n=void 0;return function(){clearTimeout(n),n=setTimeout(function(){t.apply(this,arguments)},e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clearFids=e.addGeo=void 0;var i=a(n(351)),r=a(n(352)),o=n(45);function a(t){return t&&t.__esModule?t:{default:t}}var s=[new i.default];s.forEach(function(t){t.addEventListener("message",function(t){"addGeo"===t.data.incident&&(0,r.default)(t)})});var h=0;function u(){return h>=s.length&&(h=0),s[h++]}e.addGeo=function(t){console.log("add");var e=o.threeLayer.getMap(),n={center:e.getCenter(),maxNativeZoom:e.getMaxNativeZoom()};bus.emit("addGeoing");for(var i=s.length,r=Math.floor(t.length/i),a=0;as&&r>s||oh&&a>h)})}e.referText=function(){var t=o.threeLayer.getScene().children,e=[];console.log(t),t.forEach(function(t){if(t.texts)for(var n=0;na.default.criticalZoom?((0,r.mapGoto)({pitch:1,bearing:7.5},300),bus.emit("uninstall3D"),bus.emit("install2D")):t.to>a.default.criticalZoom&&t.from<=a.default.criticalZoom&&(bus.emit("uninstall2D"),bus.emit("install3D"),(0,r.mapGoto)({pitch:62,bearing:90},300))}),u.zoom>a.default.criticalZoom?bus.emit("install3D"):bus.emit("install2D")}).call(this,n(31))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r=1,o={},a=!1,s=t.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(t);h=h&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){c(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&c(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),i=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){c(t.data)},i=function(e){t.port2.postMessage(e)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var t=s.documentElement;i=function(e){var n=s.createElement("script");n.onreadystatechange=function(){c(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():i=function(t){setTimeout(c,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;nr;)q(t,n=i[r++],e[n]);return t},Y=function(t){var e=N.call(this,t=w(t,!0));return!(this===j&&r(F,t)&&!r(B,t))&&(!(e||!r(this,t)||!r(F,t)||r(this,D)&&this[D][t])||e)},J=function(t,e){if(t=x(t),e=w(e,!0),t!==j||!r(F,e)||r(B,e)){var n=P(t,e);return!n||!r(F,e)||r(t,D)&&t[D][e]||(n.enumerable=!0),n}},K=function(t){for(var e,n=L(x(t)),i=[],o=0;n.length>o;)r(F,e=n[o++])||e==D||e==h||i.push(e);return i},Q=function(t){for(var e,n=t===j,i=L(n?B:x(t)),o=[],a=0;i.length>a;)!r(F,e=i[a++])||n&&!r(j,e)||o.push(F[e]);return o};G||(s((R=function(){if(this instanceof R)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(n){this===j&&e.call(B,n),r(this,D)&&r(this[D],t)&&(this[D][t]=!1),V(this,t,b(1,n))};return o&&U&&V(j,t,{configurable:!0,set:e}),W(t)}).prototype,"toString",function(){return this._k}),S.f=J,T.f=q,n(40).f=E.f=K,n(51).f=Y,n(55).f=Q,o&&!n(33)&&s(j,"propertyIsEnumerable",Y,!0),p.f=function(t){return W(d(t))}),a(a.G+a.W+a.F*!G,{Symbol:R});for(var $="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;$.length>tt;)d($[tt++]);for(var et=C(d.store),nt=0;et.length>nt;)m(et[nt++]);a(a.S+a.F*!G,"Symbol",{for:function(t){return r(z,t+="")?z[t]:z[t]=R(t)},keyFor:function(t){if(!Z(t))throw TypeError(t+" is not a symbol!");for(var e in z)if(z[e]===t)return e},useSetter:function(){U=!0},useSimple:function(){U=!1}}),a(a.S+a.F*!G,"Object",{create:function(t,e){return void 0===e?M(t):X(M(t),e)},defineProperty:q,defineProperties:X,getOwnPropertyDescriptor:J,getOwnPropertyNames:K,getOwnPropertySymbols:Q}),O&&a(a.S+a.F*(!G||u(function(){var t=R();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))})),"JSON",{stringify:function(t){for(var e,n,i=[t],r=1;arguments.length>r;)i.push(arguments[r++]);if(n=e=i[1],(_(e)||void 0!==t)&&!Z(t))return v(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Z(e))return e}),i[1]=e,I.apply(O,i)}}),R.prototype[k]||n(13)(R.prototype,k,R.prototype.valueOf),l(R,"Symbol"),l(Math,"Math",!0),l(i.JSON,"JSON",!0)},function(t,e,n){var i=n(37),r=n(55),o=n(51);t.exports=function(t){var e=i(t),n=r.f;if(n)for(var a,s=n(t),h=o.f,u=0;s.length>u;)h.call(t,a=s[u++])&&e.push(a);return e}},function(t,e,n){var i=n(0);i(i.S,"Object",{create:n(39)})},function(t,e,n){var i=n(0);i(i.S+i.F*!n(6),"Object",{defineProperty:n(7).f})},function(t,e,n){var i=n(0);i(i.S+i.F*!n(6),"Object",{defineProperties:n(102)})},function(t,e,n){var i=n(17),r=n(18).f;n(27)("getOwnPropertyDescriptor",function(){return function(t,e){return r(i(t),e)}})},function(t,e,n){var i=n(10),r=n(19);n(27)("getPrototypeOf",function(){return function(t){return r(i(t))}})},function(t,e,n){var i=n(10),r=n(37);n(27)("keys",function(){return function(t){return r(i(t))}})},function(t,e,n){n(27)("getOwnPropertyNames",function(){return n(103).f})},function(t,e,n){var i=n(4),r=n(32).onFreeze;n(27)("freeze",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(t,e,n){var i=n(4),r=n(32).onFreeze;n(27)("seal",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(t,e,n){var i=n(4),r=n(32).onFreeze;n(27)("preventExtensions",function(t){return function(e){return t&&i(e)?t(r(e)):e}})},function(t,e,n){var i=n(4);n(27)("isFrozen",function(t){return function(e){return!i(e)||!!t&&t(e)}})},function(t,e,n){var i=n(4);n(27)("isSealed",function(t){return function(e){return!i(e)||!!t&&t(e)}})},function(t,e,n){var i=n(4);n(27)("isExtensible",function(t){return function(e){return!!i(e)&&(!t||t(e))}})},function(t,e,n){var i=n(0);i(i.S+i.F,"Object",{assign:n(104)})},function(t,e,n){var i=n(0);i(i.S,"Object",{is:n(159)})},function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}},function(t,e,n){var i=n(0);i(i.S,"Object",{setPrototypeOf:n(73).set})},function(t,e,n){"use strict";var i=n(52),r={};r[n(5)("toStringTag")]="z",r+""!="[object z]"&&n(14)(Object.prototype,"toString",function(){return"[object "+i(this)+"]"},!0)},function(t,e,n){var i=n(0);i(i.P,"Function",{bind:n(105)})},function(t,e,n){var i=n(7).f,r=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in r||n(6)&&i(r,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,e,n){"use strict";var i=n(4),r=n(19),o=n(5)("hasInstance"),a=Function.prototype;o in a||n(7).f(a,o,{value:function(t){if("function"!=typeof this||!i(t))return!1;if(!i(this.prototype))return t instanceof this;for(;t=r(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,n){var i=n(0),r=n(107);i(i.G+i.F*(parseInt!=r),{parseInt:r})},function(t,e,n){var i=n(0),r=n(108);i(i.G+i.F*(parseFloat!=r),{parseFloat:r})},function(t,e,n){"use strict";var i=n(2),r=n(16),o=n(22),a=n(75),s=n(24),h=n(3),u=n(40).f,c=n(18).f,l=n(7).f,f=n(47).trim,d=i.Number,p=d,m=d.prototype,g="Number"==o(n(39)(m)),v="trim"in String.prototype,y=function(t){var e=s(t,!1);if("string"==typeof e&&e.length>2){var n,i,r,o=(e=v?e.trim():f(e,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+e}for(var a,h=e.slice(2),u=0,c=h.length;ur)return NaN;return parseInt(h,i)}}return+e};if(!d(" 0o1")||!d("0b1")||d("+0x1")){d=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof d&&(g?h(function(){m.valueOf.call(n)}):"Number"!=o(n))?a(new p(y(e)),n,d):y(e)};for(var _,x=n(6)?u(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;x.length>w;w++)r(p,_=x[w])&&!r(d,_)&&l(d,_,c(p,_));d.prototype=m,m.constructor=d,n(14)(i,"Number",d)}},function(t,e,n){"use strict";var i=n(0),r=n(26),o=n(109),a=n(76),s=1..toFixed,h=Math.floor,u=[0,0,0,0,0,0],c="Number.toFixed: incorrect invocation!",l=function(t,e){for(var n=-1,i=e;++n<6;)i+=t*u[n],u[n]=i%1e7,i=h(i/1e7)},f=function(t){for(var e=6,n=0;--e>=0;)n+=u[e],u[e]=h(n/t),n=n%t*1e7},d=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==u[t]){var n=String(u[t]);e=""===e?n:e+a.call("0",7-n.length)+n}return e},p=function(t,e,n){return 0===e?n:e%2==1?p(t,e-1,n*t):p(t*t,e/2,n)};i(i.P+i.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(3)(function(){s.call({})})),"Number",{toFixed:function(t){var e,n,i,s,h=o(this,c),u=r(t),m="",g="0";if(u<0||u>20)throw RangeError(c);if(h!=h)return"NaN";if(h<=-1e21||h>=1e21)return String(h);if(h<0&&(m="-",h=-h),h>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(h*p(2,69,1))-69)<0?h*p(2,-e,1):h/p(2,e,1),n*=4503599627370496,(e=52-e)>0){for(l(0,n),i=u;i>=7;)l(1e7,0),i-=7;for(l(p(10,i,1),0),i=e-1;i>=23;)f(1<<23),i-=23;f(1<0?m+((s=g.length)<=u?"0."+a.call("0",u-s)+g:g.slice(0,s-u)+"."+g.slice(s-u)):m+g}})},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(109),a=1..toPrecision;i(i.P+i.F*(r(function(){return"1"!==a.call(1,void 0)})||!r(function(){a.call({})})),"Number",{toPrecision:function(t){var e=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},function(t,e,n){var i=n(0);i(i.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,n){var i=n(0),r=n(2).isFinite;i(i.S,"Number",{isFinite:function(t){return"number"==typeof t&&r(t)}})},function(t,e,n){var i=n(0);i(i.S,"Number",{isInteger:n(110)})},function(t,e,n){var i=n(0);i(i.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){var i=n(0),r=n(110),o=Math.abs;i(i.S,"Number",{isSafeInteger:function(t){return r(t)&&o(t)<=9007199254740991}})},function(t,e,n){var i=n(0);i(i.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){var i=n(0);i(i.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,n){var i=n(0),r=n(108);i(i.S+i.F*(Number.parseFloat!=r),"Number",{parseFloat:r})},function(t,e,n){var i=n(0),r=n(107);i(i.S+i.F*(Number.parseInt!=r),"Number",{parseInt:r})},function(t,e,n){var i=n(0),r=n(111),o=Math.sqrt,a=Math.acosh;i(i.S+i.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:r(t-1+o(t-1)*o(t+1))}})},function(t,e,n){var i=n(0),r=Math.asinh;i(i.S+i.F*!(r&&1/r(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},function(t,e,n){var i=n(0),r=Math.atanh;i(i.S+i.F*!(r&&1/r(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,n){var i=n(0),r=n(77);i(i.S,"Math",{cbrt:function(t){return r(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,n){var i=n(0),r=Math.exp;i(i.S,"Math",{cosh:function(t){return(r(t=+t)+r(-t))/2}})},function(t,e,n){var i=n(0),r=n(78);i(i.S+i.F*(r!=Math.expm1),"Math",{expm1:r})},function(t,e,n){var i=n(0);i(i.S,"Math",{fround:n(112)})},function(t,e,n){var i=n(0),r=Math.abs;i(i.S,"Math",{hypot:function(t,e){for(var n,i,o=0,a=0,s=arguments.length,h=0;a0?(i=n/h)*i:n;return h===1/0?1/0:h*Math.sqrt(o)}})},function(t,e,n){var i=n(0),r=Math.imul;i(i.S+i.F*n(3)(function(){return-5!=r(4294967295,5)||2!=r.length}),"Math",{imul:function(t,e){var n=+t,i=+e,r=65535&n,o=65535&i;return 0|r*o+((65535&n>>>16)*o+r*(65535&i>>>16)<<16>>>0)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,e,n){var i=n(0);i(i.S,"Math",{log1p:n(111)})},function(t,e,n){var i=n(0);i(i.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,n){var i=n(0);i(i.S,"Math",{sign:n(77)})},function(t,e,n){var i=n(0),r=n(78),o=Math.exp;i(i.S+i.F*n(3)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(r(t)-r(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,e,n){var i=n(0),r=n(78),o=Math.exp;i(i.S,"Math",{tanh:function(t){var e=r(t=+t),n=r(-t);return e==1/0?1:n==1/0?-1:(e-n)/(o(t)+o(-t))}})},function(t,e,n){var i=n(0);i(i.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,n){var i=n(0),r=n(38),o=String.fromCharCode,a=String.fromCodePoint;i(i.S+i.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,n=[],i=arguments.length,a=0;i>a;){if(e=+arguments[a++],r(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){var i=n(0),r=n(17),o=n(8);i(i.S,"String",{raw:function(t){for(var e=r(t.raw),n=o(e.length),i=arguments.length,a=[],s=0;n>s;)a.push(String(e[s++])),s=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var i=n(0),r=n(79)(!1);i(i.P,"String",{codePointAt:function(t){return r(this,t)}})},function(t,e,n){"use strict";var i=n(0),r=n(8),o=n(82),a="".endsWith;i(i.P+i.F*n(83)("endsWith"),"String",{endsWith:function(t){var e=o(this,t,"endsWith"),n=arguments.length>1?arguments[1]:void 0,i=r(e.length),s=void 0===n?i:Math.min(r(n),i),h=String(t);return a?a.call(e,h,s):e.slice(s-h.length,s)===h}})},function(t,e,n){"use strict";var i=n(0),r=n(82);i(i.P+i.F*n(83)("includes"),"String",{includes:function(t){return!!~r(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var i=n(0);i(i.P,"String",{repeat:n(76)})},function(t,e,n){"use strict";var i=n(0),r=n(8),o=n(82),a="".startsWith;i(i.P+i.F*n(83)("startsWith"),"String",{startsWith:function(t){var e=o(this,t,"startsWith"),n=r(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),i=String(t);return a?a.call(e,i,n):e.slice(n,n+i.length)===i}})},function(t,e,n){"use strict";n(15)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(t,e,n){"use strict";n(15)("big",function(t){return function(){return t(this,"big","","")}})},function(t,e,n){"use strict";n(15)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,e,n){"use strict";n(15)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,e,n){"use strict";n(15)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,e,n){"use strict";n(15)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(t,e,n){"use strict";n(15)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(t,e,n){"use strict";n(15)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,e,n){"use strict";n(15)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(t,e,n){"use strict";n(15)("small",function(t){return function(){return t(this,"small","","")}})},function(t,e,n){"use strict";n(15)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,e,n){"use strict";n(15)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,e,n){"use strict";n(15)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,e,n){var i=n(0);i(i.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,e,n){"use strict";var i=n(0),r=n(10),o=n(24);i(i.P+i.F*n(3)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(t){var e=r(this),n=o(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},function(t,e,n){var i=n(0),r=n(221);i(i.P+i.F*(Date.prototype.toISOString!==r),"Date",{toISOString:r})},function(t,e,n){"use strict";var i=n(3),r=Date.prototype.getTime,o=Date.prototype.toISOString,a=function(t){return t>9?t:"0"+t};t.exports=i(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!i(function(){o.call(new Date(NaN))})?function(){if(!isFinite(r.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),i=e<0?"-":e>9999?"+":"";return i+("00000"+Math.abs(e)).slice(i?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:o},function(t,e,n){var i=Date.prototype,r=i.toString,o=i.getTime;new Date(NaN)+""!="Invalid Date"&&n(14)(i,"toString",function(){var t=o.call(this);return t==t?r.call(this):"Invalid Date"})},function(t,e,n){var i=n(5)("toPrimitive"),r=Date.prototype;i in r||n(13)(r,i,n(224))},function(t,e,n){"use strict";var i=n(1),r=n(24);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return r(i(this),"number"!=t)}},function(t,e,n){var i=n(0);i(i.S,"Array",{isArray:n(56)})},function(t,e,n){"use strict";var i=n(21),r=n(0),o=n(10),a=n(113),s=n(84),h=n(8),u=n(85),c=n(86);r(r.S+r.F*!n(58)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,r,l,f=o(t),d="function"==typeof this?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,g=void 0!==m,v=0,y=c(f);if(g&&(m=i(m,p>2?arguments[2]:void 0,2)),void 0==y||d==Array&&s(y))for(n=new d(e=h(f.length));e>v;v++)u(n,v,g?m(f[v],v):f[v]);else for(l=y.call(f),n=new d;!(r=l.next()).done;v++)u(n,v,g?a(l,m,[r.value,v],!0):r.value);return n.length=v,n}})},function(t,e,n){"use strict";var i=n(0),r=n(85);i(i.S+i.F*n(3)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)r(n,t,arguments[t++]);return n.length=e,n}})},function(t,e,n){"use strict";var i=n(0),r=n(17),o=[].join;i(i.P+i.F*(n(50)!=Object||!n(23)(o)),"Array",{join:function(t){return o.call(r(this),void 0===t?",":t)}})},function(t,e,n){"use strict";var i=n(0),r=n(72),o=n(22),a=n(38),s=n(8),h=[].slice;i(i.P+i.F*n(3)(function(){r&&h.call(r)}),"Array",{slice:function(t,e){var n=s(this.length),i=o(this);if(e=void 0===e?n:e,"Array"==i)return h.call(this,t,e);for(var r=a(t,n),u=a(e,n),c=s(u-r),l=new Array(c),f=0;f1&&(i=Math.min(i,o(arguments[1]))),i<0&&(i=n+i);i>=0;i--)if(i in e&&e[i]===t)return i||0;return-1}})},function(t,e,n){var i=n(0);i(i.P,"Array",{copyWithin:n(115)}),n(34)("copyWithin")},function(t,e,n){var i=n(0);i(i.P,"Array",{fill:n(88)}),n(34)("fill")},function(t,e,n){"use strict";var i=n(0),r=n(28)(5),o=!0;"find"in[]&&Array(1).find(function(){o=!1}),i(i.P+i.F*o,"Array",{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(34)("find")},function(t,e,n){"use strict";var i=n(0),r=n(28)(6),o="findIndex",a=!0;o in[]&&Array(1)[o](function(){a=!1}),i(i.P+i.F*a,"Array",{findIndex:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(34)(o)},function(t,e,n){n(41)("Array")},function(t,e,n){var i=n(2),r=n(75),o=n(7).f,a=n(40).f,s=n(57),h=n(59),u=i.RegExp,c=u,l=u.prototype,f=/a/g,d=/a/g,p=new u(f)!==f;if(n(6)&&(!p||n(3)(function(){return d[n(5)("match")]=!1,u(f)!=f||u(d)==d||"/a/i"!=u(f,"i")}))){u=function(t,e){var n=this instanceof u,i=s(t),o=void 0===e;return!n&&i&&t.constructor===u&&o?t:r(p?new c(i&&!o?t.source:t,e):c((i=t instanceof u)?t.source:t,i&&o?h.call(t):e),n?this:l,u)};for(var m=function(t){t in u||o(u,t,{configurable:!0,get:function(){return c[t]},set:function(e){c[t]=e}})},g=a(c),v=0;g.length>v;)m(g[v++]);l.constructor=u,u.prototype=l,n(14)(i,"RegExp",u)}n(41)("RegExp")},function(t,e,n){"use strict";n(117);var i=n(1),r=n(59),o=n(6),a=/./.toString,s=function(t){n(14)(RegExp.prototype,"toString",t,!0)};n(3)(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?s(function(){var t=i(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?r.call(t):void 0)}):"toString"!=a.name&&s(function(){return a.call(this)})},function(t,e,n){n(60)("match",1,function(t,e,n){return[function(n){"use strict";var i=t(this),r=void 0==n?void 0:n[e];return void 0!==r?r.call(n,i):new RegExp(n)[e](String(i))},n]})},function(t,e,n){n(60)("replace",2,function(t,e,n){return[function(i,r){"use strict";var o=t(this),a=void 0==i?void 0:i[e];return void 0!==a?a.call(i,o,r):n.call(String(o),i,r)},n]})},function(t,e,n){n(60)("search",1,function(t,e,n){return[function(n){"use strict";var i=t(this),r=void 0==n?void 0:n[e];return void 0!==r?r.call(n,i):new RegExp(n)[e](String(i))},n]})},function(t,e,n){n(60)("split",2,function(t,e,i){"use strict";var r=n(57),o=i,a=[].push;if("c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length){var s=void 0===/()??/.exec("")[1];i=function(t,e){var n=String(this);if(void 0===t&&0===e)return[];if(!r(t))return o.call(n,t,e);var i,h,u,c,l,f=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),p=0,m=void 0===e?4294967295:e>>>0,g=new RegExp(t.source,d+"g");for(s||(i=new RegExp("^"+g.source+"$(?!\\s)",d));(h=g.exec(n))&&!((u=h.index+h[0].length)>p&&(f.push(n.slice(p,h.index)),!s&&h.length>1&&h[0].replace(i,function(){for(l=1;l1&&h.index=m));)g.lastIndex===h.index&&g.lastIndex++;return p===n.length?!c&&g.test("")||f.push(""):f.push(n.slice(p)),f.length>m?f.slice(0,m):f}}else"0".split(void 0,0).length&&(i=function(t,e){return void 0===t&&0===e?[]:o.call(this,t,e)});return[function(n,r){var o=t(this),a=void 0==n?void 0:n[e];return void 0!==a?a.call(n,o,r):i.call(String(o),n,r)},i]})},function(t,e,n){"use strict";var i,r,o,a,s=n(33),h=n(2),u=n(21),c=n(52),l=n(0),f=n(4),d=n(12),p=n(42),m=n(43),g=n(61),v=n(90).set,y=n(91)(),_=n(92),x=n(118),w=n(62),b=n(119),M=h.TypeError,E=h.process,S=E&&E.versions,T=S&&S.v8||"",C=h.Promise,P="process"==c(E),A=function(){},L=r=_.f,R=!!function(){try{var t=C.resolve(1),e=(t.constructor={})[n(5)("species")]=function(t){t(A,A)};return(P||"function"==typeof PromiseRejectionEvent)&&t.then(A)instanceof e&&0!==T.indexOf("6.6")&&-1===w.indexOf("Chrome/66")}catch(t){}}(),O=function(t){var e;return!(!f(t)||"function"!=typeof(e=t.then))&&e},I=function(t,e){if(!t._n){t._n=!0;var n=t._c;y(function(){for(var i=t._v,r=1==t._s,o=0,a=function(e){var n,o,a,s=r?e.ok:e.fail,h=e.resolve,u=e.reject,c=e.domain;try{s?(r||(2==t._h&&N(t),t._h=1),!0===s?n=i:(c&&c.enter(),n=s(i),c&&(c.exit(),a=!0)),n===e.promise?u(M("Promise-chain cycle")):(o=O(n))?o.call(n,h,u):h(n)):u(i)}catch(t){c&&!a&&c.exit(),u(t)}};n.length>o;)a(n[o++]);t._c=[],t._n=!1,e&&!t._h&&D(t)})}},D=function(t){v.call(h,function(){var e,n,i,r=t._v,o=k(t);if(o&&(e=x(function(){P?E.emit("unhandledRejection",r,t):(n=h.onunhandledrejection)?n({promise:t,reason:r}):(i=h.console)&&i.error&&i.error("Unhandled promise rejection",r)}),t._h=P||k(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},k=function(t){return 1!==t._h&&0===(t._a||t._c).length},N=function(t){v.call(h,function(){var e;P?E.emit("rejectionHandled",t):(e=h.onrejectionhandled)&&e({promise:t,reason:t._v})})},z=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),I(e,!0))},F=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw M("Promise can't be resolved itself");(e=O(t))?y(function(){var i={_w:n,_d:!1};try{e.call(t,u(F,i,1),u(z,i,1))}catch(t){z.call(i,t)}}):(n._v=t,n._s=1,I(n,!1))}catch(t){z.call({_w:n,_d:!1},t)}}};R||(C=function(t){p(this,C,"Promise","_h"),d(t),i.call(this);try{t(u(F,this,1),u(z,this,1))}catch(t){z.call(this,t)}},(i=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(44)(C.prototype,{then:function(t,e){var n=L(g(this,C));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=P?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&I(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new i;this.promise=t,this.resolve=u(F,t,1),this.reject=u(z,t,1)},_.f=L=function(t){return t===C||t===a?new o(t):r(t)}),l(l.G+l.W+l.F*!R,{Promise:C}),n(46)(C,"Promise"),n(41)("Promise"),a=n(20).Promise,l(l.S+l.F*!R,"Promise",{reject:function(t){var e=L(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(s||!R),"Promise",{resolve:function(t){return b(s&&this===a?C:this,t)}}),l(l.S+l.F*!(R&&n(58)(function(t){C.all(t).catch(A)})),"Promise",{all:function(t){var e=this,n=L(e),i=n.resolve,r=n.reject,o=x(function(){var n=[],o=0,a=1;m(t,!1,function(t){var s=o++,h=!1;n.push(void 0),a++,e.resolve(t).then(function(t){h||(h=!0,n[s]=t,--a||i(n))},r)}),--a||i(n)});return o.e&&r(o.v),n.promise},race:function(t){var e=this,n=L(e),i=n.reject,r=x(function(){m(t,!1,function(t){e.resolve(t).then(n.resolve,i)})});return r.e&&i(r.v),n.promise}})},function(t,e,n){"use strict";var i=n(124),r=n(49);n(63)("WeakSet",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return i.def(r(this,"WeakSet"),t,!0)}},i,!1,!0)},function(t,e,n){"use strict";var i=n(0),r=n(64),o=n(93),a=n(1),s=n(38),h=n(8),u=n(4),c=n(2).ArrayBuffer,l=n(61),f=o.ArrayBuffer,d=o.DataView,p=r.ABV&&c.isView,m=f.prototype.slice,g=r.VIEW;i(i.G+i.W+i.F*(c!==f),{ArrayBuffer:f}),i(i.S+i.F*!r.CONSTR,"ArrayBuffer",{isView:function(t){return p&&p(t)||u(t)&&g in t}}),i(i.P+i.U+i.F*n(3)(function(){return!new f(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(t,e){if(void 0!==m&&void 0===e)return m.call(a(this),t);for(var n=a(this).byteLength,i=s(t,n),r=s(void 0===e?n:e,n),o=new(l(this,f))(h(r-i)),u=new d(this),c=new d(o),p=0;i=e.length)return{value:void 0,done:!0}}while(!((t=e[this._i++])in this._t));return{value:t,done:!1}}),i(i.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,e,n){var i=n(18),r=n(19),o=n(16),a=n(0),s=n(4),h=n(1);a(a.S,"Reflect",{get:function t(e,n){var a,u,c=arguments.length<3?e:arguments[2];return h(e)===c?e[n]:(a=i.f(e,n))?o(a,"value")?a.value:void 0!==a.get?a.get.call(c):void 0:s(u=r(e))?t(u,n,c):void 0}})},function(t,e,n){var i=n(18),r=n(0),o=n(1);r(r.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return i.f(o(t),e)}})},function(t,e,n){var i=n(0),r=n(19),o=n(1);i(i.S,"Reflect",{getPrototypeOf:function(t){return r(o(t))}})},function(t,e,n){var i=n(0);i(i.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,n){var i=n(0),r=n(1),o=Object.isExtensible;i(i.S,"Reflect",{isExtensible:function(t){return r(t),!o||o(t)}})},function(t,e,n){var i=n(0);i(i.S,"Reflect",{ownKeys:n(126)})},function(t,e,n){var i=n(0),r=n(1),o=Object.preventExtensions;i(i.S,"Reflect",{preventExtensions:function(t){r(t);try{return o&&o(t),!0}catch(t){return!1}}})},function(t,e,n){var i=n(7),r=n(18),o=n(19),a=n(16),s=n(0),h=n(35),u=n(1),c=n(4);s(s.S,"Reflect",{set:function t(e,n,s){var l,f,d=arguments.length<4?e:arguments[3],p=r.f(u(e),n);if(!p){if(c(f=o(e)))return t(f,n,s,d);p=h(0)}if(a(p,"value")){if(!1===p.writable||!c(d))return!1;if(l=r.f(d,n)){if(l.get||l.set||!1===l.writable)return!1;l.value=s,i.f(d,n,l)}else i.f(d,n,h(0,s));return!0}return void 0!==p.set&&(p.set.call(d,s),!0)}})},function(t,e,n){var i=n(0),r=n(73);r&&i(i.S,"Reflect",{setPrototypeOf:function(t,e){r.check(t,e);try{return r.set(t,e),!0}catch(t){return!1}}})},function(t,e,n){"use strict";var i=n(0),r=n(54)(!0);i(i.P,"Array",{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n(34)("includes")},function(t,e,n){"use strict";var i=n(0),r=n(127),o=n(10),a=n(8),s=n(12),h=n(87);i(i.P,"Array",{flatMap:function(t){var e,n,i=o(this);return s(t),e=a(i.length),n=h(i,0),r(n,i,i,e,0,1,t,arguments[1]),n}}),n(34)("flatMap")},function(t,e,n){"use strict";var i=n(0),r=n(127),o=n(10),a=n(8),s=n(26),h=n(87);i(i.P,"Array",{flatten:function(){var t=arguments[0],e=o(this),n=a(e.length),i=h(e,0);return r(i,e,e,n,0,void 0===t?1:s(t)),i}}),n(34)("flatten")},function(t,e,n){"use strict";var i=n(0),r=n(79)(!0);i(i.P,"String",{at:function(t){return r(this,t)}})},function(t,e,n){"use strict";var i=n(0),r=n(128),o=n(62);i(i.P+i.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padStart:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,e,n){"use strict";var i=n(0),r=n(128),o=n(62);i(i.P+i.F*/Version\/10\.\d+(\.\d+)? Safari\//.test(o),"String",{padEnd:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},function(t,e,n){"use strict";n(47)("trimLeft",function(t){return function(){return t(this,1)}},"trimStart")},function(t,e,n){"use strict";n(47)("trimRight",function(t){return function(){return t(this,2)}},"trimEnd")},function(t,e,n){"use strict";var i=n(0),r=n(25),o=n(8),a=n(57),s=n(59),h=RegExp.prototype,u=function(t,e){this._r=t,this._s=e};n(81)(u,"RegExp String",function(){var t=this._r.exec(this._s);return{value:t,done:null===t}}),i(i.P,"String",{matchAll:function(t){if(r(this),!a(t))throw TypeError(t+" is not a regexp!");var e=String(this),n="flags"in h?String(t.flags):s.call(t),i=new RegExp(t.source,~n.indexOf("g")?n:"g"+n);return i.lastIndex=o(t.lastIndex),new u(i,e)}})},function(t,e,n){n(69)("asyncIterator")},function(t,e,n){n(69)("observable")},function(t,e,n){var i=n(0),r=n(126),o=n(17),a=n(18),s=n(85);i(i.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,i=o(t),h=a.f,u=r(i),c={},l=0;u.length>l;)void 0!==(n=h(i,e=u[l++]))&&s(c,e,n);return c}})},function(t,e,n){var i=n(0),r=n(129)(!1);i(i.S,"Object",{values:function(t){return r(t)}})},function(t,e,n){var i=n(0),r=n(129)(!0);i(i.S,"Object",{entries:function(t){return r(t)}})},function(t,e,n){"use strict";var i=n(0),r=n(10),o=n(12),a=n(7);n(6)&&i(i.P+n(65),"Object",{__defineGetter__:function(t,e){a.f(r(this),t,{get:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";var i=n(0),r=n(10),o=n(12),a=n(7);n(6)&&i(i.P+n(65),"Object",{__defineSetter__:function(t,e){a.f(r(this),t,{set:o(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";var i=n(0),r=n(10),o=n(24),a=n(19),s=n(18).f;n(6)&&i(i.P+n(65),"Object",{__lookupGetter__:function(t){var e,n=r(this),i=o(t,!0);do{if(e=s(n,i))return e.get}while(n=a(n))}})},function(t,e,n){"use strict";var i=n(0),r=n(10),o=n(24),a=n(19),s=n(18).f;n(6)&&i(i.P+n(65),"Object",{__lookupSetter__:function(t){var e,n=r(this),i=o(t,!0);do{if(e=s(n,i))return e.set}while(n=a(n))}})},function(t,e,n){var i=n(0);i(i.P+i.R,"Map",{toJSON:n(130)("Map")})},function(t,e,n){var i=n(0);i(i.P+i.R,"Set",{toJSON:n(130)("Set")})},function(t,e,n){n(66)("Map")},function(t,e,n){n(66)("Set")},function(t,e,n){n(66)("WeakMap")},function(t,e,n){n(66)("WeakSet")},function(t,e,n){n(67)("Map")},function(t,e,n){n(67)("Set")},function(t,e,n){n(67)("WeakMap")},function(t,e,n){n(67)("WeakSet")},function(t,e,n){var i=n(0);i(i.G,{global:n(2)})},function(t,e,n){var i=n(0);i(i.S,"System",{global:n(2)})},function(t,e,n){var i=n(0),r=n(22);i(i.S,"Error",{isError:function(t){return"Error"===r(t)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{clamp:function(t,e,n){return Math.min(n,Math.max(e,t))}})},function(t,e,n){var i=n(0);i(i.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(t,e,n){var i=n(0),r=180/Math.PI;i(i.S,"Math",{degrees:function(t){return t*r}})},function(t,e,n){var i=n(0),r=n(132),o=n(112);i(i.S,"Math",{fscale:function(t,e,n,i,a){return o(r(t,e,n,i,a))}})},function(t,e,n){var i=n(0);i(i.S,"Math",{iaddh:function(t,e,n,i){var r=t>>>0,o=n>>>0;return(e>>>0)+(i>>>0)+((r&o|(r|o)&~(r+o>>>0))>>>31)|0}})},function(t,e,n){var i=n(0);i(i.S,"Math",{isubh:function(t,e,n,i){var r=t>>>0,o=n>>>0;return(e>>>0)-(i>>>0)-((~r&o|~(r^o)&r-o>>>0)>>>31)|0}})},function(t,e,n){var i=n(0);i(i.S,"Math",{imulh:function(t,e){var n=+t,i=+e,r=65535&n,o=65535&i,a=n>>16,s=i>>16,h=(a*o>>>0)+(r*o>>>16);return a*s+(h>>16)+((r*s>>>0)+(65535&h)>>16)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,e,n){var i=n(0),r=Math.PI/180;i(i.S,"Math",{radians:function(t){return t*r}})},function(t,e,n){var i=n(0);i(i.S,"Math",{scale:n(132)})},function(t,e,n){var i=n(0);i(i.S,"Math",{umulh:function(t,e){var n=+t,i=+e,r=65535&n,o=65535&i,a=n>>>16,s=i>>>16,h=(a*o>>>0)+(r*o>>>16);return a*s+(h>>>16)+((r*s>>>0)+(65535&h)>>>16)}})},function(t,e,n){var i=n(0);i(i.S,"Math",{signbit:function(t){return(t=+t)!=t?t:0==t?1/t==1/0:t>0}})},function(t,e,n){"use strict";var i=n(0),r=n(20),o=n(2),a=n(61),s=n(119);i(i.P+i.R,"Promise",{finally:function(t){var e=a(this,r.Promise||o.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then(function(){return n})}:t,n?function(n){return s(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){"use strict";var i=n(0),r=n(92),o=n(118);i(i.S,"Promise",{try:function(t){var e=r.f(this),n=o(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}})},function(t,e,n){var i=n(30),r=n(1),o=i.key,a=i.set;i.exp({defineMetadata:function(t,e,n,i){a(t,e,r(n),o(i))}})},function(t,e,n){var i=n(30),r=n(1),o=i.key,a=i.map,s=i.store;i.exp({deleteMetadata:function(t,e){var n=arguments.length<3?void 0:o(arguments[2]),i=a(r(e),n,!1);if(void 0===i||!i.delete(t))return!1;if(i.size)return!0;var h=s.get(e);return h.delete(n),!!h.size||s.delete(e)}})},function(t,e,n){var i=n(30),r=n(1),o=n(19),a=i.has,s=i.get,h=i.key,u=function(t,e,n){if(a(t,e,n))return s(t,e,n);var i=o(e);return null!==i?u(t,i,n):void 0};i.exp({getMetadata:function(t,e){return u(t,r(e),arguments.length<3?void 0:h(arguments[2]))}})},function(t,e,n){var i=n(122),r=n(131),o=n(30),a=n(1),s=n(19),h=o.keys,u=o.key,c=function(t,e){var n=h(t,e),o=s(t);if(null===o)return n;var a=c(o,e);return a.length?n.length?r(new i(n.concat(a))):a:n};o.exp({getMetadataKeys:function(t){return c(a(t),arguments.length<2?void 0:u(arguments[1]))}})},function(t,e,n){var i=n(30),r=n(1),o=i.get,a=i.key;i.exp({getOwnMetadata:function(t,e){return o(t,r(e),arguments.length<3?void 0:a(arguments[2]))}})},function(t,e,n){var i=n(30),r=n(1),o=i.keys,a=i.key;i.exp({getOwnMetadataKeys:function(t){return o(r(t),arguments.length<2?void 0:a(arguments[1]))}})},function(t,e,n){var i=n(30),r=n(1),o=n(19),a=i.has,s=i.key,h=function(t,e,n){if(a(t,e,n))return!0;var i=o(e);return null!==i&&h(t,i,n)};i.exp({hasMetadata:function(t,e){return h(t,r(e),arguments.length<3?void 0:s(arguments[2]))}})},function(t,e,n){var i=n(30),r=n(1),o=i.has,a=i.key;i.exp({hasOwnMetadata:function(t,e){return o(t,r(e),arguments.length<3?void 0:a(arguments[2]))}})},function(t,e,n){var i=n(30),r=n(1),o=n(12),a=i.key,s=i.set;i.exp({metadata:function(t,e){return function(n,i){s(t,e,(void 0!==i?r:o)(n),a(i))}}})},function(t,e,n){var i=n(0),r=n(91)(),o=n(2).process,a="process"==n(22)(o);i(i.G,{asap:function(t){var e=a&&o.domain;r(e?e.bind(t):t)}})},function(t,e,n){"use strict";var i=n(0),r=n(2),o=n(20),a=n(91)(),s=n(5)("observable"),h=n(12),u=n(1),c=n(42),l=n(44),f=n(13),d=n(43),p=d.RETURN,m=function(t){return null==t?void 0:h(t)},g=function(t){var e=t._c;e&&(t._c=void 0,e())},v=function(t){return void 0===t._o},y=function(t){v(t)||(t._o=void 0,g(t))},_=function(t,e){u(t),this._c=void 0,this._o=t,t=new x(this);try{var n=e(t),i=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){i.unsubscribe()}:h(n),this._c=n)}catch(e){return void t.error(e)}v(this)&&g(this)};_.prototype=l({},{unsubscribe:function(){y(this)}});var x=function(t){this._s=t};x.prototype=l({},{next:function(t){var e=this._s;if(!v(e)){var n=e._o;try{var i=m(n.next);if(i)return i.call(n,t)}catch(t){try{y(e)}finally{throw t}}}},error:function(t){var e=this._s;if(v(e))throw t;var n=e._o;e._o=void 0;try{var i=m(n.error);if(!i)throw t;t=i.call(n,t)}catch(t){try{g(e)}finally{throw t}}return g(e),t},complete:function(t){var e=this._s;if(!v(e)){var n=e._o;e._o=void 0;try{var i=m(n.complete);t=i?i.call(n,t):void 0}catch(t){try{g(e)}finally{throw t}}return g(e),t}}});var w=function(t){c(this,w,"Observable","_f")._f=h(t)};l(w.prototype,{subscribe:function(t){return new _(t,this._f)},forEach:function(t){var e=this;return new(o.Promise||r.Promise)(function(n,i){h(t);var r=e.subscribe({next:function(e){try{return t(e)}catch(t){i(t),r.unsubscribe()}},error:i,complete:n})})}}),l(w,{from:function(t){var e="function"==typeof this?this:w,n=m(u(t)[s]);if(n){var i=u(n.call(t));return i.constructor===e?i:new e(function(t){return i.subscribe(t)})}return new e(function(e){var n=!1;return a(function(){if(!n){try{if(d(t,!1,function(t){if(e.next(t),n)return p})===p)return}catch(t){if(n)throw t;return void e.error(t)}e.complete()}}),function(){n=!0}})},of:function(){for(var t=0,e=arguments.length,n=new Array(e);t2,r=!!i&&a.call(arguments,2);return t(i?function(){("function"==typeof e?e:Function(e)).apply(this,r)}:e,n)}};r(r.G+r.B+r.F*s,{setTimeout:h(i.setTimeout),setInterval:h(i.setInterval)})},function(t,e,n){var i=n(0),r=n(90);i(i.G+i.B,{setImmediate:r.set,clearImmediate:r.clear})},function(t,e,n){for(var i=n(89),r=n(37),o=n(14),a=n(2),s=n(13),h=n(48),u=n(5),c=u("iterator"),l=u("toStringTag"),f=h.Array,d={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=r(d),m=0;m=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var h=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(h&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:R(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=n),m}}}function x(t,e,n,i){var r=e&&e.prototype instanceof b?e:b,o=Object.create(r.prototype),a=new L(i||[]);return o._invoke=function(t,e,n){var i=l;return function(r,o){if(i===d)throw new Error("Generator is already running");if(i===p){if("throw"===r)throw o;return O()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=C(a,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===l)throw i=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var h=w(t,e,n);if("normal"===h.type){if(i=n.done?p:f,h.arg===m)continue;return{value:h.arg,done:n.done}}"throw"===h.type&&(i=p,n.method="throw",n.arg=h.arg)}}}(t,n,a),o}function w(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function b(){}function M(){}function E(){}function S(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function T(t){function n(e,i,o,a){var s=w(t[e],t,i);if("throw"!==s.type){var h=s.arg,u=h.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then(function(t){n("next",t,o,a)},function(t){n("throw",t,o,a)}):Promise.resolve(u).then(function(t){h.value=t,o(h)},a)}a(s.arg)}var i;"object"==typeof e.process&&e.process.domain&&(n=e.process.domain.bind(n)),this._invoke=function(t,e){function r(){return new Promise(function(i,r){n(t,e,i,r)})}return i=i?i.then(r,r):r()}}function C(t,e){var i=t.iterator[e.method];if(i===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,C(t,e),"throw"===e.method))return m;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var r=w(i,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,m;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,m):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function R(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i=0&&h.splice(e,1)}function p(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var i=function(){0;return n.nc}();i&&(t.attrs.nonce=i)}return m(e,t.attrs),f(t,e),e}function m(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,i,r,o;if(e.transform&&t.css){if(!(o="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=o}if(e.singleton){var h=s++;n=a||(a=p(e)),i=y.bind(null,n,h,!1),r=y.bind(null,n,h,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",m(e,t.attrs),f(t,e),e}(e),i=function(t,e,n){var i=n.css,r=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||o)&&(i=u(i));r&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([i],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),r=function(){d(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(e),i=function(t,e){var n=e.css,i=e.media;i&&t.setAttribute("media",i);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){d(n)});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=r()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=l(t,e);return c(n,e),function(t){for(var r=[],o=0;o>=1,a>>=1;return"http://dynamic.t"+i+".tiles.ditu.live.com/comp/ch/"+r+"?it=G,VE,BX,L,LA&mkt=zh-cn,syr&n=z&og=111&ur=CN&cstl=w4c"},subdomains:["0","1","2","3"]}),new i.TileLayer("base",{urlTemplate:"https://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png",subdomains:["a","b","c"]}),new i.TileLayer("base",{urlTemplate:"http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.png",subdomains:["a","b","c"]}),new i.TileLayer("base",{urlTemplate:"http://{s}.tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png",subdomains:["a","b","c"]}),new i.TileLayer("base",{urlTemplate:"http://{s}.tile.osm.org/{z}/{x}/{y}.png",subdomains:["a","b","c"]}),new i.TileLayer("Carto light",{urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",subdomains:["a","b","c","d"]}),new i.TileLayer("Carto dark",{urlTemplate:"http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",subdomains:["a","b","c","d"]}),new i.TileLayer("base",{spatialReference:{projection:"EPSG:3857"},urlTemplate:"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",subdomains:["a","b","c"],attribution:'© OpenStreetMap contributors'})],o=localStorage.getItem("theme")||1,a=document.querySelector("#theme");a.innerHTML=r.map(function(t,e){return'"}).join(""),a.value=o,a.addEventListener("change",function(){localStorage.setItem("theme",a.value),location.reload()}),e.default=function(){return r[o]}},function(t,e,n){"use strict";n.r(e),n.d(e,"ThreeLayer",function(){return u}),n.d(e,"ThreeRenderer",function(){return c});var i=n(11),r=n(9);function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e): /*! * maptalks.three v0.5.0 * LICENSE : MIT * (c) 2016-2017 maptalks.org */ /*! * requires maptalks@>=0.36.2 */ function(t,e){for(var n=Object.getOwnPropertyNames(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=this.getMap();if(!n)return null;var i=n.coordinateToPoint(t,l(n));return new r.Vector3(i.x,i.y,-e)},e.prototype.distanceToVector3=function(t,e,n){var o=this.getMap(),a=l(o),s=n||o.getCenter(),h=o.locate(s,t,e),u=o.coordinateToPoint(s,a),c=o.coordinateToPoint(h,a),f=Math.abs(c.x-u.x)*i.Util.sign(t),d=Math.abs(c.y-u.y)*i.Util.sign(e);return new r.Vector3(f,d,0)},e.prototype.toShape=function(t){var e=this;if(!t)return null;if(t instanceof i.MultiPolygon)return t.getGeometries().map(function(t){return e.toShape(t)});var n=t.getCenter(),o=this.coordinateToVector3(n),a=t.getShell().map(function(t){return e.coordinateToVector3(t).sub(o)}),s=new r.Shape(a),h=t.getHoles();return h&&h.length>0&&(s.holes=h.map(function(t){var n=t.map(function(t){return e.coordinateToVector3(t).sub(o)});return new r.Shape(n)})),s},e.prototype.toExtrudeMesh=function(t,e,n,o){var a=this;if(!t)return null;if(t instanceof i.MultiPolygon)return t.getGeometries().map(function(t){return a.toExtrudeGeometry(t,e,n)});if(o){var s=t.getCoordinates();s.forEach(function(t){for(var e=t.length-1;e>=1;e--)t[e].equals(t[e-1])&&t.splice(e,1)}),t.setCoordinates(s)}var h=this.toShape(t),u=this.coordinateToVector3(t.getCenter());e=this.distanceToVector3(e,e).x;var c=new r.ExtrudeGeometry(h,{amount:e,bevelEnabled:!0}),l=new r.BufferGeometry;l.fromGeometry(c);var f=new r.Mesh(l,n);return f.position.set(u.x,u.y,-e),f},e.prototype.clearMesh=function(){var t=this.getScene();if(!t)return this;for(var e=t.children.length-1;e>=0;e--)t.children[e]instanceof r.Mesh&&t.remove(t.children[e]);return this},e.prototype.lookAt=function(t){var e=this._getRenderer();return e&&e.context.lookAt(t),this},e.prototype.getCamera=function(){var t=this._getRenderer();return t?t.camera:null},e.prototype.getScene=function(){var t=this._getRenderer();return t?t.scene:null},e.prototype.renderScene=function(){var t=this._getRenderer();return t?t.renderScene():this},e.prototype.getThreeRenderer=function(){var t=this._getRenderer();return t?t.context:null},e.prototype._getFovRatio=function(){var t=this.getMap().getFov();return Math.tan(t/2*h)},e}(i.CanvasLayer);u.mergeOptions({renderer:"gl",doubleBuffer:!0,glOptions:null});var c=function(t){function e(){return o(this,e),a(this,t.apply(this,arguments))}return s(e,t),e.prototype.getPrepareParams=function(){return[this.scene,this.camera]},e.prototype.getDrawParams=function(){return[this.scene,this.camera]},e.prototype._drawLayer=function(){t.prototype._drawLayer.apply(this,arguments),this.renderScene()},e.prototype.hitDetect=function(){return!1},e.prototype.createCanvas=function(){if(!this.canvas){var t=this.getMap().getSize(),e=i.Browser.retina?2:1,n=e*t.width,r=e*t.height;if(this.layer._canvas){var o=this.layer._canvas;o.width=n,o.height=r,o.style&&(o.style.width=t.width+"px",o.style.height=t.height+"px"),this.canvas=this.layer._canvas}else this.canvas=i.Canvas.createCanvas(n,r);this._initThreeRenderer(),this.onCanvasCreate(),this.layer.fire("canvascreate",{context:this.context,gl:this.gl})}},e.prototype._initThreeRenderer=function(){var t,e=this.getMap(),n=e.getSize(),o=this.layer.options.renderer;"gl"===o?((t=new r.WebGLRenderer(i.Util.extend({canvas:this.canvas,alpha:!0,preserveDrawingBuffer:!0},this.layer.options.glOptions))).autoClear=!1,t.clear()):"canvas"===o&&(t=new r.CanvasRenderer(i.Util.extend({canvas:this.canvas,alpha:!0},this.layer.options.glOptions))),t.setSize(this.canvas.width,this.canvas.height),t.setClearColor(new r.Color(1,1,1),0),t.canvas=this.canvas,this.context=t;var a=e.getScale(e.getMinZoom())/e.getScale(l(e))*n.height/2/this.layer._getFovRatio(),s=this.scene=new r.Scene,h=e.getFov(),u=this.camera=new r.PerspectiveCamera(h,n.width/n.height,1,a);s.add(u)},e.prototype.onCanvasCreate=function(){t.prototype.onCanvasCreate.call(this),this.layer.onCanvasCreate(this.context,this.scene,this.camera)},e.prototype.resizeCanvas=function(t){if(this.canvas){var e;e=t||this.getMap().getSize();var n=i.Browser.retina?2:1;this.canvas.height=n*e.height,this.canvas.width=n*e.width,this.camera.aspect=this.canvas.width/this.canvas.height,this.camera.updateProjectionMatrix(),this.context.setSize(this.canvas.width,this.canvas.height)}},e.prototype.clearCanvas=function(){this.canvas&&this.context.clear()},e.prototype.prepareCanvas=function(){return this.canvas?this.clearCanvas():this.createCanvas(),this.layer.fire("renderstart",{context:this.context}),null},e.prototype.renderScene=function(){this._locateCamera(),this.context.render(this.scene,this.camera),this.completeRender()},e.prototype.remove=function(){delete this._drawContext,t.prototype.remove.call(this)},e.prototype._locateCamera=function(){var t=this.getMap(),e=t.getSize(),n=t.getScale(),i=this.camera,o=t.coordinateToPoint(t.getCenter(),l(t)),a=t.getPitch()*h,s=t.getBearing()*h,u=this.layer._getFovRatio(),c=-n*e.height/2/u;i.position.z=c*Math.cos(a);var f=Math.sin(a)*c;i.position.x=o.x+f*Math.sin(s),i.position.y=o.y-f*Math.cos(s),i.up.set(Math.sin(s),-Math.cos(s),0),i.lookAt(new r.Vector3(o.x,o.y,0)),i.updateProjectionMatrix()},e}(i.renderer.CanvasLayerRenderer);function l(t){return t.getMaxNativeZoom()}u.registerRenderer("canvas",c),u.registerRenderer("gl",c),"undefined"!=typeof console&&console.log("maptalks.three v0.5.0, requires maptalks@>=0.36.2.")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.meshStatus=e.unMeshAll=void 0;var i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(9)),r=n(134),o=n(45);var a=new i.Frustum,s=new i.Matrix4;e.unMeshAll=function(){for(var t=o.threeLayer.getScene(),e=t.children,n=0;n